|
@@ -14,9 +14,9 @@ const A1Outer = React.lazy(() => import("../A1Outer"));
|
|
|
|
|
|
const A1Tab = [
|
|
|
{ id: "1080", name: "项目介绍" },
|
|
|
- { id: "1111", name: "项目成果" },
|
|
|
+ { id: "1115", name: "项目成果" },
|
|
|
{ id: "1090", name: "项目文件" },
|
|
|
- { id: "1101", name: "内控文件" },
|
|
|
+ { id: "1100", name: "内控文件" },
|
|
|
{ id: "1110", name: "项目成员" },
|
|
|
];
|
|
|
|
|
@@ -31,12 +31,17 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
// 权限
|
|
|
const authArr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
|
|
|
|
|
|
- // useEffect(() => {
|
|
|
- // if (authArr.includes("1080")) setTopType("1080");
|
|
|
- // else if (authArr.includes("1090")) setTopType("1090");
|
|
|
- // else if (authArr.includes("1101")) setTopType("1101");
|
|
|
- // else if (authArr.includes("1110")) setTopType("1110");
|
|
|
- // }, [authArr]);
|
|
|
+ useEffect(() => {
|
|
|
+ if (authArr.includes("1080")) setTopType("1080");
|
|
|
+ else if (authArr.includes("1115")) setTopType("1115");
|
|
|
+ else if (authArr.includes("1090")) setTopType("1090");
|
|
|
+ else if (authArr.includes("1100")) setTopType("1100");
|
|
|
+ else if (authArr.includes("1110")) setTopType("1110");
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ if (tabType && authArr.includes("1100")) setTopType("1100");
|
|
|
+ }, 50);
|
|
|
+ }, [authArr, tabType]);
|
|
|
|
|
|
// 动态改变顶部 title
|
|
|
const [myTitle, setMyTitle] = useState("");
|
|
@@ -47,14 +52,10 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
|
|
|
const [sonPageType, setSonPageType] = useState(pageType);
|
|
|
|
|
|
- const [topType, setTopType] = useState("1080");
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- if (tabType && authArr.includes("1101")) setTopType("1101");
|
|
|
- }, [authArr, tabType]);
|
|
|
+ const [topType, setTopType] = useState("");
|
|
|
|
|
|
useEffect(() => {
|
|
|
- if (["1080", "1111"].includes(topType)) {
|
|
|
+ if (["1080", "1115"].includes(topType)) {
|
|
|
setSonPageType({ txt: "look", id: pageType.id });
|
|
|
}
|
|
|
}, [pageType.id, topType]);
|
|
@@ -84,7 +85,7 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
</div>
|
|
|
<div className="A1LookTab">
|
|
|
{A1Tab.map((v) => (
|
|
|
- <AuthCom aId={v.id === "1101" ? "1101" : "-1"} key={v.id}>
|
|
|
+ <AuthCom aId={v.id} key={v.id}>
|
|
|
<div
|
|
|
onClick={() => setTopType(v.id)}
|
|
|
className={classNames(
|
|
@@ -98,7 +99,7 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
))}
|
|
|
</div>
|
|
|
<div className="A1LookMain">
|
|
|
- {["1080", "1111"].includes(topType) && sonPageType.txt === "look" ? (
|
|
|
+ {["1080", "1115"].includes(topType) && sonPageType.txt === "look" ? (
|
|
|
<AuthCom aId="1081">
|
|
|
<div className="A1lrBtn">
|
|
|
<Button
|
|
@@ -121,7 +122,7 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
/>
|
|
|
) : topType === "1090" ? (
|
|
|
<A1Outer projectId={pageType.id} projectName={myTitle} />
|
|
|
- ) : topType === "1101" ? (
|
|
|
+ ) : topType === "1100" ? (
|
|
|
<A1Inner
|
|
|
projectId={pageType.id}
|
|
|
myTitle={myTitle.split(" - ") ? myTitle.split(" - ")[0] : ""}
|
|
@@ -129,7 +130,7 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
|
|
|
/>
|
|
|
) : topType === "1110" ? (
|
|
|
<A1User projectId={pageType.id} />
|
|
|
- ) : topType === "1111" ? (
|
|
|
+ ) : topType === "1115" ? (
|
|
|
<A1Result
|
|
|
closeFu={tab1CloseFu}
|
|
|
pageType={sonPageType}
|