shaogen1995 2 years ago
parent
commit
46bfedb7cd

+ 1 - 1
src/components/AuthCom.tsx

@@ -10,7 +10,7 @@ type Props = {
 function AuthCom({ aId, children }: Props) {
 function AuthCom({ aId, children }: Props) {
   const arr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
   const arr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
 
 
-  return <>{arr.find((v) => v === aId) ? children : null}</>;
+  return <>{arr.find((v) => v === aId) || aId === "-1" ? children : null}</>;
 }
 }
 
 
 const MemoAuthCom = React.memo(AuthCom);
 const MemoAuthCom = React.memo(AuthCom);

+ 14 - 11
src/pages/A1Project/A1Add/index.tsx

@@ -23,6 +23,7 @@ import { useSelector } from "react-redux";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
 import { A1_APIaddProject, A1_APIgetInfoById } from "@/store/action/A1Project";
 import { A1_APIaddProject, A1_APIgetInfoById } from "@/store/action/A1Project";
 import { A1TableType, FileImgListType } from "@/types";
 import { A1TableType, FileImgListType } from "@/types";
+import AuthCom from "@/components/AuthCom";
 
 
 const { RangePicker } = DatePicker;
 const { RangePicker } = DatePicker;
 
 
@@ -316,18 +317,20 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
           </Form.Item>
           </Form.Item>
 
 
           {pageType.txt === "look" ? (
           {pageType.txt === "look" ? (
-            <div className="e_row">
-              <div className="e_rowL">
-                <span> </span>项目金额:
-              </div>
-              <div className="e_rowR e_rowRLook">
-                {isOk
-                  ? lookInfo.amount
-                    ? lookInfo.amount + "¥"
-                    : "(空)"
-                  : ""}
+            <AuthCom aId="1082">
+              <div className="e_row">
+                <div className="e_rowL">
+                  <span> </span>项目金额:
+                </div>
+                <div className="e_rowR e_rowRLook">
+                  {isOk
+                    ? lookInfo.amount
+                      ? lookInfo.amount + "¥"
+                      : "(空)"
+                    : ""}
+                </div>
               </div>
               </div>
-            </div>
+            </AuthCom>
           ) : (
           ) : (
             <Form.Item label="项目金额" name="amount">
             <Form.Item label="项目金额" name="amount">
               <InputNumber
               <InputNumber

+ 8 - 4
src/pages/A1Project/A1Inner/A1IupFile/index.module.scss

@@ -24,6 +24,14 @@
       .ant-upload-list-item-container {
       .ant-upload-list-item-container {
         transition: none !important;
         transition: none !important;
         height: 40px !important;
         height: 40px !important;
+        margin-bottom: 15px;
+      }
+
+      // 删除之后的延迟问题
+      .ant-upload-list-item-container.ant-upload-animate-leave {
+        margin-bottom: 0px;
+        height: 0px !important;
+        overflow: hidden;
       }
       }
 
 
       .ant-upload-list-item-action {
       .ant-upload-list-item-action {
@@ -42,10 +50,6 @@
         margin-right: 598px;
         margin-right: 598px;
       }
       }
 
 
-      .ant-upload-list-item-container {
-        margin-bottom: 15px;
-      }
-
 
 
       .myIncoBox {
       .myIncoBox {
         position: absolute;
         position: absolute;

+ 1 - 6
src/pages/A1Project/A1Inner/A1IupFile/index.tsx

@@ -21,7 +21,6 @@ import { getTokenFu } from "@/utils/storage";
 import { MessageFu } from "@/utils/message";
 import { MessageFu } from "@/utils/message";
 import { A1_APIIupBtnOk, A1_APIremoveSure } from "@/store/action/A1Project";
 import { A1_APIIupBtnOk, A1_APIremoveSure } from "@/store/action/A1Project";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
-import { domShowFu } from "@/utils/domShow";
 import { A2Tab2Type } from "@/types/api/A2Dict";
 import { A2Tab2Type } from "@/types/api/A2Dict";
 
 
 const { Dragger } = Upload;
 const { Dragger } = Upload;
@@ -236,12 +235,8 @@ function A1IupFile({
               const res = await A1_APIremoveSure([id + ""]);
               const res = await A1_APIremoveSure([id + ""]);
 
 
               if (res.code === 0) {
               if (res.code === 0) {
-                domShowFu("#AsyncSpinLoding", true);
+                MessageFu.success("删除成功!");
                 resolve(true);
                 resolve(true);
-                setTimeout(() => {
-                  domShowFu("#AsyncSpinLoding", false);
-                  MessageFu.success("删除成功!");
-                }, 2000);
               }
               }
             } else {
             } else {
               resolve(true);
               resolve(true);

+ 79 - 55
src/pages/A1Project/A1Inner/index.tsx

@@ -22,6 +22,7 @@ import A1IAudit from "./A1IAudit";
 import A1IupFile from "./A1IupFile";
 import A1IupFile from "./A1IupFile";
 import { baseURL } from "@/utils/http";
 import { baseURL } from "@/utils/http";
 import { A2Tab2Type } from "@/types/api/A2Dict";
 import { A2Tab2Type } from "@/types/api/A2Dict";
+import AuthCom from "@/components/AuthCom";
 
 
 type FromType = {
 type FromType = {
   searchKey: string;
   searchKey: string;
@@ -125,38 +126,49 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
   // 删除的弹窗数据
   // 删除的弹窗数据
   const [delInfo, setDelInfo] = useState({ id: 0, name: "" });
   const [delInfo, setDelInfo] = useState({ id: 0, name: "" });
 
 
-  // 关于 审核
-  const adidtDom = useCallback((item: A1ItableType) => {
-    const num = item.auditStatus;
-
-    const txt = num === 0 ? "待审批" : num === 1 ? "审批通过" : "审批驳回";
+  // 权限
+  const authArr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
 
 
-    const dom =
-      item.auditDesc && num !== 0 ? (
-        <Tooltip title={item.auditDesc}>
+  // 关于 审核
+  const adidtDom = useCallback(
+    (item: A1ItableType) => {
+      const num = item.auditStatus;
+
+      const txt = num === 0 ? "待审批" : num === 1 ? "审批通过" : "审批驳回";
+
+      const dom =
+        item.auditDesc && num !== 0 ? (
+          <Tooltip title={item.auditDesc}>
+            <div
+              className="iconHoverTit A1ItablauidtBox"
+              onClick={() =>
+                setAuditInfo({
+                  id: item.id,
+                  sta: num,
+                  txt: item.auditDesc || "",
+                })
+              }
+            >
+              {txt}&nbsp;
+              <div className="iconHoverTitTxt">?</div>
+            </div>
+          </Tooltip>
+        ) : (
           <div
           <div
-            className="iconHoverTit A1ItablauidtBox"
+            className="A1ItablauidtBox"
             onClick={() =>
             onClick={() =>
               setAuditInfo({ id: item.id, sta: num, txt: item.auditDesc || "" })
               setAuditInfo({ id: item.id, sta: num, txt: item.auditDesc || "" })
             }
             }
           >
           >
-            {txt}&nbsp;
-            <div className="iconHoverTitTxt">?</div>
+            {txt}
           </div>
           </div>
-        </Tooltip>
-      ) : (
-        <div
-          className="A1ItablauidtBox"
-          onClick={() =>
-            setAuditInfo({ id: item.id, sta: num, txt: item.auditDesc || "" })
-          }
-        >
-          {txt}
-        </div>
-      );
+        );
 
 
-    return dom;
-  }, []);
+      if (authArr.includes("1104")) return dom;
+      else return txt;
+    },
+    [authArr]
+  );
 
 
   const columns = useMemo(() => {
   const columns = useMemo(() => {
     return [
     return [
@@ -226,24 +238,30 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
                   查看
                   查看
                 </Button>
                 </Button>
               ) : null}
               ) : null}
-              <Button
-                size="small"
-                type="text"
-                onClick={() =>
-                  urlChangeFu(item.filePath, true, undefined, item.fileName)
-                }
-              >
-                下载
-              </Button>
-
-              <Button
-                size="small"
-                type="text"
-                danger
-                onClick={() => setDelInfo({ id: item.id, name: item.fileName })}
-              >
-                删除
-              </Button>
+              <AuthCom aId="1106">
+                <Button
+                  size="small"
+                  type="text"
+                  onClick={() =>
+                    urlChangeFu(item.filePath, true, undefined, item.fileName)
+                  }
+                >
+                  下载
+                </Button>
+              </AuthCom>
+
+              <AuthCom aId="1107">
+                <Button
+                  size="small"
+                  type="text"
+                  danger
+                  onClick={() =>
+                    setDelInfo({ id: item.id, name: item.fileName })
+                  }
+                >
+                  删除
+                </Button>
+              </AuthCom>
             </>
             </>
           ),
           ),
       },
       },
@@ -323,21 +341,27 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
         </div>
         </div>
 
 
         <div className="A1ItopRow A1ItopRow2">
         <div className="A1ItopRow A1ItopRow2">
-          <Button type="primary" onClick={() => setLack(true)}>
-            登记缺失文件
-          </Button>
+          <AuthCom aId="1105">
+            <Button type="primary" onClick={() => setLack(true)}>
+              登记缺失文件
+            </Button>
+          </AuthCom>
           &emsp;
           &emsp;
-          <Button type="primary" onClick={() => setUpFileOpen(true)}>
-            批量上传
-          </Button>
+          <AuthCom aId="1103">
+            <Button type="primary" onClick={() => setUpFileOpen(true)}>
+              批量上传
+            </Button>
+          </AuthCom>
           &emsp;
           &emsp;
-          <Button
-            type="primary"
-            onClick={downSelectFu}
-            disabled={selectedRowKeys.length <= 0}
-          >
-            批量下载
-          </Button>
+          <AuthCom aId="1102">
+            <Button
+              type="primary"
+              onClick={downSelectFu}
+              disabled={selectedRowKeys.length <= 0}
+            >
+              批量下载
+            </Button>
+          </AuthCom>
         </div>
         </div>
       </div>
       </div>
 
 

+ 7 - 1
src/pages/A1Project/A1Look/index.module.scss

@@ -68,6 +68,12 @@
         z-index: 30;
         z-index: 30;
       }
       }
     }
     }
-
+    .noAuth{
+      font-size: 24px;
+      letter-spacing: 4px;
+      color: var(--themeColor);
+      text-align: center;
+      padding-top: 200px;
+      }
   }
   }
 }
 }

+ 56 - 41
src/pages/A1Project/A1Look/index.tsx

@@ -4,15 +4,18 @@ import { Button } from "antd";
 import classNames from "classnames";
 import classNames from "classnames";
 import A1User from "../A1User";
 import A1User from "../A1User";
 import A1Inner from "../A1Inner";
 import A1Inner from "../A1Inner";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import AuthCom from "@/components/AuthCom";
 
 
 const A1Add = React.lazy(() => import("../A1Add"));
 const A1Add = React.lazy(() => import("../A1Add"));
 const A1Outer = React.lazy(() => import("../A1Outer"));
 const A1Outer = React.lazy(() => import("../A1Outer"));
 
 
 const A1Tab = [
 const A1Tab = [
-  { id: 1, name: "项目介绍" },
-  { id: 2, name: "项目文件" },
-  { id: 3, name: "内控文件" },
-  { id: 4, name: "项目成员" },
+  { id: "1080", name: "项目介绍" },
+  { id: "1090", name: "项目文件" },
+  { id: "1101", name: "内控文件" },
+  { id: "1110", name: "项目成员" },
 ];
 ];
 
 
 type Props = {
 type Props = {
@@ -23,6 +26,16 @@ type Props = {
 };
 };
 
 
 function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
 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]);
+
   // 动态改变顶部 title
   // 动态改变顶部 title
   const [myTitle, setMyTitle] = useState("");
   const [myTitle, setMyTitle] = useState("");
 
 
@@ -32,14 +45,14 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
 
 
   const [sonPageType, setSonPageType] = useState(pageType);
   const [sonPageType, setSonPageType] = useState(pageType);
 
 
-  const [topType, setTopType] = useState(1);
+  const [topType, setTopType] = useState("1080");
 
 
   useEffect(() => {
   useEffect(() => {
-    if (tabType) setTopType(3);
-  }, [tabType]);
+    if (tabType && authArr.includes("1101")) setTopType("1101");
+  }, [authArr, tabType]);
 
 
   useEffect(() => {
   useEffect(() => {
-    if (topType === 1) {
+    if (topType === "1080") {
       setSonPageType({ txt: "look", id: pageType.id });
       setSonPageType({ txt: "look", id: pageType.id });
     }
     }
   }, [pageType.id, topType]);
   }, [pageType.id, topType]);
@@ -54,15 +67,12 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
   }, [pageType.id]);
   }, [pageType.id]);
 
 
   // 编辑成功
   // 编辑成功
-  const editSuFu = useCallback(
-    (val: string) => {
-      // 设置key,更新数据
-      setTab1Key(Date.now());
-      // 动态修改 顶部 标题
-      setMyTitle(val);
-    },
-    []
-  );
+  const editSuFu = useCallback((val: string) => {
+    // 设置key,更新数据
+    setTab1Key(Date.now());
+    // 动态修改 顶部 标题
+    setMyTitle(val);
+  }, []);
 
 
   return (
   return (
     <div className={styles.A1Look}>
     <div className={styles.A1Look}>
@@ -72,31 +82,34 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
       </div>
       </div>
       <div className="A1LookTab">
       <div className="A1LookTab">
         {A1Tab.map((v) => (
         {A1Tab.map((v) => (
-          <div
-            onClick={() => setTopType(v.id)}
-            className={classNames(
-              "A1LookTabRow",
-              topType === v.id ? "A1LookTabRowAc" : ""
-            )}
-            key={v.id}
-          >
-            {v.name}
-          </div>
+          <AuthCom aId={v.id === "1101" ? "1101" : "-1"} key={v.id}>
+            <div
+              onClick={() => setTopType(v.id)}
+              className={classNames(
+                "A1LookTabRow",
+                topType === v.id ? "A1LookTabRowAc" : ""
+              )}
+            >
+              {v.name}
+            </div>
+          </AuthCom>
         ))}
         ))}
       </div>
       </div>
       <div className="A1LookMain">
       <div className="A1LookMain">
-        {topType === 1 && sonPageType.txt === "look" ? (
-          <div className="A1lrBtn">
-            <Button
-              type="primary"
-              onClick={() => setSonPageType({ txt: "edit", id: pageType.id })}
-            >
-              编辑
-            </Button>
-          </div>
+        {topType === "1080" && sonPageType.txt === "look" ? (
+          <AuthCom aId="1081">
+            <div className="A1lrBtn">
+              <Button
+                type="primary"
+                onClick={() => setSonPageType({ txt: "edit", id: pageType.id })}
+              >
+                编辑
+              </Button>
+            </div>
+          </AuthCom>
         ) : null}
         ) : null}
 
 
-        {topType === 1 ? (
+        {topType === "1080" ? (
           <A1Add
           <A1Add
             key={tab1Key}
             key={tab1Key}
             pageType={sonPageType}
             pageType={sonPageType}
@@ -104,17 +117,19 @@ function A1Look({ pageType, closeFu, tabType, lookTit }: Props) {
             addFu={() => {}}
             addFu={() => {}}
             editFu={(val) => editSuFu(val)}
             editFu={(val) => editSuFu(val)}
           />
           />
-        ) : topType === 2 ? (
+        ) : topType === "1090" ? (
           <A1Outer projectId={pageType.id} projectName={myTitle} />
           <A1Outer projectId={pageType.id} projectName={myTitle} />
-        ) : topType === 3 ? (
+        ) : topType === "1101" ? (
           <A1Inner
           <A1Inner
             projectId={pageType.id}
             projectId={pageType.id}
             myTitle={myTitle.split(" - ") ? myTitle.split(" - ")[0] : ""}
             myTitle={myTitle.split(" - ") ? myTitle.split(" - ")[0] : ""}
             projectName={myTitle}
             projectName={myTitle}
           />
           />
-        ) : topType === 4 ? (
+        ) : topType === "1110" ? (
           <A1User projectId={pageType.id} />
           <A1User projectId={pageType.id} />
-        ) : null}
+        ) : (
+          <div className="noAuth">您没有这个页面的权限,请联系管理员添加</div>
+        )}
       </div>
       </div>
     </div>
     </div>
   );
   );

+ 76 - 61
src/pages/A1Project/A1Outer/index.tsx

@@ -22,6 +22,7 @@ import {
 import { MessageFu } from "@/utils/message";
 import { MessageFu } from "@/utils/message";
 import A1OupFile from "./A1OupFile";
 import A1OupFile from "./A1OupFile";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
+import AuthCom from "@/components/AuthCom";
 
 
 type Props = {
 type Props = {
   projectId: number;
   projectId: number;
@@ -199,49 +200,57 @@ function A1Outer({ projectId, projectName }: Props) {
             ) : null}
             ) : null}
 
 
             {item.type === 1 ? (
             {item.type === 1 ? (
-              <Button
-                size="small"
-                type="text"
-                onClick={() => downFilesFu(item.id, item.name)}
-              >
-                下载
-              </Button>
+              <AuthCom aId="1094">
+                <Button
+                  size="small"
+                  type="text"
+                  onClick={() => downFilesFu(item.id, item.name)}
+                >
+                  下载
+                </Button>
+              </AuthCom>
             ) : (
             ) : (
-              <Button
-                size="small"
-                type="text"
-                onClick={() =>
-                  urlChangeFu(item.filePath, true, undefined, item.name)
-                }
-              >
-                下载
-              </Button>
+              <AuthCom aId="1094">
+                <Button
+                  size="small"
+                  type="text"
+                  onClick={() =>
+                    urlChangeFu(item.filePath, true, undefined, item.name)
+                  }
+                >
+                  下载
+                </Button>
+              </AuthCom>
             )}
             )}
 
 
             <Button size="small" type="text" onClick={() => setRenFile(item)}>
             <Button size="small" type="text" onClick={() => setRenFile(item)}>
               重命名
               重命名
             </Button>
             </Button>
             {item.type === 1 ? null : (
             {item.type === 1 ? null : (
-              <Button
-                size="small"
-                type="text"
-                onClick={() => setMoveId({ id: item.id, name: item.name })}
-              >
-                移动
-              </Button>
+              <AuthCom aId="1095">
+                <Button
+                  size="small"
+                  type="text"
+                  onClick={() => setMoveId({ id: item.id, name: item.name })}
+                >
+                  移动
+                </Button>
+              </AuthCom>
             )}
             )}
 
 
-            <Popconfirm
-              title="删除后无法恢复,是否删除?"
-              okText="删除"
-              cancelText="取消"
-              onConfirm={() => delById(item.id)}
-              okButtonProps={{ loading: false }}
-            >
-              <Button size="small" type="text" danger>
-                删除
-              </Button>
-            </Popconfirm>
+            <AuthCom aId="1096">
+              <Popconfirm
+                title="删除后无法恢复,是否删除?"
+                okText="删除"
+                cancelText="取消"
+                onConfirm={() => delById(item.id)}
+                okButtonProps={{ loading: false }}
+              >
+                <Button size="small" type="text" danger>
+                  删除
+                </Button>
+              </Popconfirm>
+            </AuthCom>
           </>
           </>
         ),
         ),
       },
       },
@@ -284,36 +293,42 @@ function A1Outer({ projectId, projectName }: Props) {
         <div className="A1Otop2">
         <div className="A1Otop2">
           {tab2.id ? null : (
           {tab2.id ? null : (
             <>
             <>
-              <Button
-                type="primary"
-                onClick={() =>
-                  setRenFile({
-                    id: -1,
-                    name: "",
-                    type: 1,
-                    parentId: tab1.id,
-                  } as A1OFileType)
-                }
-              >
-                新建文件夹
-              </Button>
-              &emsp;
+              <AuthCom aId="1092">
+                <Button
+                  type="primary"
+                  onClick={() =>
+                    setRenFile({
+                      id: -1,
+                      name: "",
+                      type: 1,
+                      parentId: tab1.id,
+                    } as A1OFileType)
+                  }
+                >
+                  新建文件夹
+                </Button>
+                &emsp;
+              </AuthCom>
             </>
             </>
           )}
           )}
-          <Button
-            type="primary"
-            onClick={downSelectFu}
-            disabled={selectedRowKeys.length <= 0}
-          >
-            批量下载
-          </Button>
+          <AuthCom aId="1093">
+            <Button
+              type="primary"
+              onClick={downSelectFu}
+              disabled={selectedRowKeys.length <= 0}
+            >
+              批量下载
+            </Button>
+          </AuthCom>
           &emsp;
           &emsp;
-          <Button
-            type="primary"
-            onClick={() => setUpFileId(tab2.id ? tab2.id : tab1.id)}
-          >
-            批量上传
-          </Button>
+          <AuthCom aId="1091">
+            <Button
+              type="primary"
+              onClick={() => setUpFileId(tab2.id ? tab2.id : tab1.id)}
+            >
+              批量上传
+            </Button>
+          </AuthCom>
           &emsp;
           &emsp;
         </div>
         </div>
       </div>
       </div>

+ 38 - 30
src/pages/A1Project/A1User/index.tsx

@@ -14,6 +14,7 @@ import { useSelector } from "react-redux";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
 import lastIdresArrFu from "@/pages/A3User/UserAdd/dataRes";
 import lastIdresArrFu from "@/pages/A3User/UserAdd/dataRes";
 import { MessageFu } from "@/utils/message";
 import { MessageFu } from "@/utils/message";
+import AuthCom from "@/components/AuthCom";
 
 
 type Props = {
 type Props = {
   projectId: number;
   projectId: number;
@@ -69,13 +70,11 @@ function A1User({ projectId }: Props) {
   // 从仓库获取部门 级联 信息
   // 从仓库获取部门 级联 信息
   const deptList = useSelector((state: RootState) => state.A5Section.tableList);
   const deptList = useSelector((state: RootState) => state.A5Section.tableList);
 
 
+  // 权限
+  const authArr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
+
   const columns = useMemo(() => {
   const columns = useMemo(() => {
-    return [
-      // {
-      //   width: 100,
-      //   title: "序号",
-      //   render: (item: A1UtableType) =>()
-      // },
+    const arr: any = [
       {
       {
         title: "项目职能",
         title: "项目职能",
         dataIndex: "jobName",
         dataIndex: "jobName",
@@ -94,30 +93,37 @@ function A1User({ projectId }: Props) {
         title: "姓名",
         title: "姓名",
         dataIndex: "userName",
         dataIndex: "userName",
       },
       },
-      {
+    ];
+
+    if (authArr.includes("1112") || authArr.includes("1113"))
+      arr.push({
         title: "操作",
         title: "操作",
         render: (item: A1UtableType) => (
         render: (item: A1UtableType) => (
           <>
           <>
-            <Button size="small" type="text" onClick={() => setAddInfo(item)}>
-              编辑
-            </Button>
-
-            <Popconfirm
-              title="删除后无法恢复,是否删除?"
-              okText="删除"
-              cancelText="取消"
-              onConfirm={() => delById(item.id)}
-              okButtonProps={{ loading: false }}
-            >
-              <Button size="small" type="text" danger>
-                删除
+            <AuthCom aId="1112">
+              <Button size="small" type="text" onClick={() => setAddInfo(item)}>
+                编辑
               </Button>
               </Button>
-            </Popconfirm>
+            </AuthCom>
+            <AuthCom aId="1113">
+              <Popconfirm
+                title="删除后无法恢复,是否删除?"
+                okText="删除"
+                cancelText="取消"
+                onConfirm={() => delById(item.id)}
+                okButtonProps={{ loading: false }}
+              >
+                <Button size="small" type="text" danger>
+                  删除
+                </Button>
+              </Popconfirm>
+            </AuthCom>
           </>
           </>
         ),
         ),
-      },
-    ];
-  }, [delById, deptList]);
+      });
+
+    return arr;
+  }, [authArr, delById, deptList]);
 
 
   // 编辑 新增 的数据
   // 编辑 新增 的数据
   const [addInfo, setAddInfo] = useState({} as A1UtableType);
   const [addInfo, setAddInfo] = useState({} as A1UtableType);
@@ -137,12 +143,14 @@ function A1User({ projectId }: Props) {
           />
           />
         </div>
         </div>
         <div className="A1Utop2">
         <div className="A1Utop2">
-          <Button
-            type="primary"
-            onClick={() => setAddInfo({ id: -1, projectId } as A1UtableType)}
-          >
-            新增
-          </Button>
+          <AuthCom aId="1111">
+            <Button
+              type="primary"
+              onClick={() => setAddInfo({ id: -1, projectId } as A1UtableType)}
+            >
+              新增
+            </Button>
+          </AuthCom>
         </div>
         </div>
       </div>
       </div>
 
 

+ 80 - 53
src/pages/A1Project/index.tsx

@@ -18,6 +18,7 @@ import { getUserListAPI } from "@/store/action/A3User";
 import { A2_APIgetList1 } from "@/store/action/A2Dict";
 import { A2_APIgetList1 } from "@/store/action/A2Dict";
 import { scheduleCollectArr, scheduleAuditArr, projectRoleArr } from "./data";
 import { scheduleCollectArr, scheduleAuditArr, projectRoleArr } from "./data";
 import { MessageFu } from "@/utils/message";
 import { MessageFu } from "@/utils/message";
+import AuthCom from "@/components/AuthCom";
 
 
 function A1Project() {
 function A1Project() {
   const dispatch = useDispatch();
   const dispatch = useDispatch();
@@ -145,6 +146,14 @@ function A1Project() {
     [resetSelectFu, topType]
     [resetSelectFu, topType]
   );
   );
 
 
+  // 权限-------项目视图 和 内控文件视图
+  const authArr = useSelector((state: RootState) => state.A4Role.A4RoleAll);
+
+  useEffect(() => {
+    // 没有项目文件视图权限,一定有内控文件视图权限
+    if (!authArr.includes("1010")) setTopType("inner");
+  }, [authArr]);
+
   // 从仓库获取表格数据
   // 从仓库获取表格数据
   const tableInfo = useSelector(
   const tableInfo = useSelector(
     (state: RootState) => state.A1Project.tableInfo
     (state: RootState) => state.A1Project.tableInfo
@@ -270,49 +279,60 @@ function A1Project() {
           </Button>
           </Button>
           {topType === "inner" ? (
           {topType === "inner" ? (
             <>
             <>
-              <Button
-                size="small"
-                type="text"
-                onClick={() => {
-                  lookTabType.current = true;
-                  setPageType({
-                    txt: "look",
-                    id: item.id,
-                    tit: item.num + " - " + item.name,
-                  });
-                }}
-              >
-                审批
-              </Button>
-              <Button
-                size="small"
-                type="text"
-                onClick={() =>
-                  setDownId({ id: item.id, txt: item.num + " - " + item.name })
-                }
-              >
-                下载
-              </Button>
+              <AuthCom aId="1104">
+                <Button
+                  hidden={!authArr.includes("1101")}
+                  size="small"
+                  type="text"
+                  onClick={() => {
+                    lookTabType.current = true;
+                    setPageType({
+                      txt: "look",
+                      id: item.id,
+                      tit: item.num + " - " + item.name,
+                    });
+                  }}
+                >
+                  审批
+                </Button>
+              </AuthCom>
+
+              <AuthCom aId="1050">
+                <Button
+                  size="small"
+                  type="text"
+                  onClick={() =>
+                    setDownId({
+                      id: item.id,
+                      txt: item.num + " - " + item.name,
+                    })
+                  }
+                >
+                  下载
+                </Button>
+              </AuthCom>
             </>
             </>
           ) : null}
           ) : null}
 
 
-          <Popconfirm
-            title="删除后无法恢复,是否删除?"
-            okText="删除"
-            cancelText="取消"
-            onConfirm={() => delById(item.id)}
-            okButtonProps={{ loading: false }}
-          >
-            <Button size="small" type="text" danger>
-              删除
-            </Button>
-          </Popconfirm>
+          <AuthCom aId="1060">
+            <Popconfirm
+              title="删除后无法恢复,是否删除?"
+              okText="删除"
+              cancelText="取消"
+              onConfirm={() => delById(item.id)}
+              okButtonProps={{ loading: false }}
+            >
+              <Button size="small" type="text" danger>
+                删除
+              </Button>
+            </Popconfirm>
+          </AuthCom>
         </>
         </>
       ),
       ),
     });
     });
 
 
     return arr;
     return arr;
-  }, [delById, pcsTxt, topType]);
+  }, [authArr, delById, pcsTxt, topType]);
 
 
   // 新增和查看
   // 新增和查看
   const [pageType, setPageType] = useState<{
   const [pageType, setPageType] = useState<{
@@ -337,18 +357,23 @@ function A1Project() {
         <div className="A1Search">
         <div className="A1Search">
           {/* 顶部试图切换 */}
           {/* 顶部试图切换 */}
           <div className="A1SearchRow">
           <div className="A1SearchRow">
-            <Button
-              onClick={() => topTypeFu("outer")}
-              type={topType === "outer" ? "primary" : "default"}
-            >
-              项目文件视图
-            </Button>
-            <Button
-              onClick={() => topTypeFu("inner")}
-              type={topType === "inner" ? "primary" : "default"}
-            >
-              内控文件视图
-            </Button>
+            <AuthCom aId="1010">
+              <Button
+                onClick={() => topTypeFu("outer")}
+                type={topType === "outer" ? "primary" : "default"}
+              >
+                项目文件视图
+              </Button>
+            </AuthCom>
+
+            <AuthCom aId="1020">
+              <Button
+                onClick={() => topTypeFu("inner")}
+                type={topType === "inner" ? "primary" : "default"}
+              >
+                内控文件视图
+              </Button>
+            </AuthCom>
           </div>
           </div>
 
 
           <div className="A1SearchRow">
           <div className="A1SearchRow">
@@ -459,12 +484,14 @@ function A1Project() {
           )}
           )}
 
 
           <div className="A1SearchRow A1SearchBtn">
           <div className="A1SearchRow A1SearchBtn">
-            <Button
-              type="primary"
-              onClick={() => setPageType({ txt: "add", id: 0 })}
-            >
-              新增项目
-            </Button>
+            <AuthCom aId="1030">
+              <Button
+                type="primary"
+                onClick={() => setPageType({ txt: "add", id: 0 })}
+              >
+                新增项目
+              </Button>
+            </AuthCom>
             &emsp;&emsp;
             &emsp;&emsp;
             <Button onClick={resetSelectFu}>重置</Button>
             <Button onClick={resetSelectFu}>重置</Button>
           </div>
           </div>

+ 8 - 0
src/pages/A4Role/A4Auth/index.module.scss

@@ -113,6 +113,14 @@
 
 
       .A4A1Btn {
       .A4A1Btn {
         margin-bottom: 15px;
         margin-bottom: 15px;
+        position: relative;
+        .A4AMainTit{
+          position: absolute;
+          right: 373px;
+          top: 77px;
+          font-size: 1px;
+          color: #ff4d4f;
+        }
       }
       }
 
 
     }
     }

+ 27 - 1
src/pages/A4Role/A4Auth/index.tsx

@@ -64,6 +64,8 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
         if (!val && arr.filter((v) => v.authority).length <= 1)
         if (!val && arr.filter((v) => v.authority).length <= 1)
           return MessageFu.warning("至少勾选一个 功能权限 的页面模块!");
           return MessageFu.warning("至少勾选一个 功能权限 的页面模块!");
 
 
+        if (!val && id === "1000") setIsTit(false);
+
         // 第一级的选中
         // 第一级的选中
         setArr1(
         setArr1(
           arr.map((v) => ({
           arr.map((v) => ({
@@ -72,6 +74,10 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
           }))
           }))
         );
         );
       } else if (ind === 2) {
       } else if (ind === 2) {
+        if (val) {
+          if (id === "1010" || id === "1020") setIsTit(false);
+        }
+
         // 第二级的选中
         // 第二级的选中
         setArr1(
         setArr1(
           arr.map((v) => ({
           arr.map((v) => ({
@@ -121,6 +127,8 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
   // 内控文件权限 组件 的 ref
   // 内控文件权限 组件 的 ref
   const r3Ref = useRef<any>(null);
   const r3Ref = useRef<any>(null);
 
 
+  // 项目文件视图和内控文件视图 必须选中一个
+
   // 点击确定
   // 点击确定
   const btnOkFu = useCallback(async () => {
   const btnOkFu = useCallback(async () => {
     if (arr1.filter((v) => v.authority).length <= 0)
     if (arr1.filter((v) => v.authority).length <= 0)
@@ -131,7 +139,9 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
     if (!flag) return MessageFu.warning("至少勾选一个 数据权限 的跨部门数据!");
     if (!flag) return MessageFu.warning("至少勾选一个 数据权限 的跨部门数据!");
 
 
     const { flag2, txt2 } = r3Ref.current.sonRes();
     const { flag2, txt2 } = r3Ref.current.sonRes();
-    if (!flag2) return MessageFu.warning("至少勾选一个 内控文件权限 模块!");
+    console.log(flag2);
+    
+    // if (!flag2) return MessageFu.warning("至少勾选一个 内控文件权限 模块!");
 
 
     // 处理功能权限
     // 处理功能权限
     const tempArr: string[] = [];
     const tempArr: string[] = [];
@@ -159,6 +169,16 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
       roleId: mId,
       roleId: mId,
     };
     };
 
 
+    if (tempArr) {
+      // 勾选了 项目管理 页面权限
+      if (tempArr.includes("1000")) {
+        if (!tempArr.includes("1010") && !tempArr.includes("1020")) {
+          setIsTit(true);
+          return;
+        }
+      }
+    }
+
     const res1 = await A4_APIsave1(obj1);
     const res1 = await A4_APIsave1(obj1);
 
 
     if (res1.code === 0) {
     if (res1.code === 0) {
@@ -189,6 +209,9 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
     }
     }
   }, [arr1, authColseFu, authEditFu, dispatch, mId]);
   }, [arr1, authColseFu, authEditFu, dispatch, mId]);
 
 
+  // 项目文件视图/内控文件视图 至少勾选一个
+  const [isTit, setIsTit] = useState(false);
+
   return (
   return (
     <div className={styles.A4Auth}>
     <div className={styles.A4Auth}>
       <div className="A4AMain">
       <div className="A4AMain">
@@ -207,6 +230,9 @@ function A4Auth({ mId, authColseFu, authEditFu }: Props) {
             <Button type="primary" size="small" onClick={setArr1Fu}>
             <Button type="primary" size="small" onClick={setArr1Fu}>
               应用权限配置
               应用权限配置
             </Button>
             </Button>
+            <div className="A4AMainTit" hidden={!isTit}>
+              项目文件视图/内控文件视图 至少勾选一个
+            </div>
           </div>
           </div>
           <div className="A4A1Cen">
           <div className="A4A1Cen">
             {arr1.map((v1) => (
             {arr1.map((v1) => (

+ 6 - 0
src/pages/A7Recycled/index.module.scss

@@ -1,5 +1,11 @@
 .A7Recycled {
 .A7Recycled {
   :global {
   :global {
+    .pageTitle{
+      &>span{
+        font-weight: 400;
+        font-size: 16px;
+      }
+    }
     .A7Top {
     .A7Top {
       border-radius: 10px;
       border-radius: 10px;
       padding: 20px 15px;
       padding: 20px 15px;

+ 35 - 4
src/pages/A7Recycled/index.tsx

@@ -11,6 +11,7 @@ import { useDispatch, useSelector } from "react-redux";
 import {
 import {
   A7_APIdel,
   A7_APIdel,
   A7_APIgetList,
   A7_APIgetList,
+  A7_APIgetSizeAll,
   A7_APIrecover,
   A7_APIrecover,
 } from "@/store/action/A7Recycled";
 } from "@/store/action/A7Recycled";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
@@ -31,6 +32,25 @@ function A7Recycled() {
     pageSize: 10,
     pageSize: 10,
   });
   });
 
 
+  // 文件获取总内存
+
+  const [sizeAll, setSizeAll] = useState("0");
+
+  const getSizeAllFu = useCallback(async () => {
+    const res = await A7_APIgetSizeAll();
+    if (res.code === 0) {
+      let num = "0";
+
+      if (res.data && res.data.pcs) num = (res.data.pcs / 1024).toFixed(2);
+
+      setSizeAll(num);
+    }
+  }, []);
+
+  useEffect(() => {
+    getSizeAllFu();
+  }, [getSizeAllFu]);
+
   // 输入框的定时器
   // 输入框的定时器
   const tableTime = useRef(-1);
   const tableTime = useRef(-1);
 
 
@@ -91,6 +111,7 @@ function A7Recycled() {
 
 
       if (res.code === 0) {
       if (res.code === 0) {
         MessageFu.success("删除成功!");
         MessageFu.success("删除成功!");
+        getSizeAllFu();
         getListFu();
         getListFu();
         if (flag) {
         if (flag) {
           // 清空选中
           // 清空选中
@@ -98,7 +119,7 @@ function A7Recycled() {
         }
         }
       }
       }
     },
     },
-    [getListFu]
+    [getListFu, getSizeAllFu]
   );
   );
 
 
   // 点击恢复
   // 点击恢复
@@ -108,6 +129,7 @@ function A7Recycled() {
 
 
       if (res.code === 0) {
       if (res.code === 0) {
         MessageFu.success("恢复成功!");
         MessageFu.success("恢复成功!");
+        getSizeAllFu();
         getListFu();
         getListFu();
         if (flag) {
         if (flag) {
           // 清空选中
           // 清空选中
@@ -115,7 +137,7 @@ function A7Recycled() {
         }
         }
       }
       }
     },
     },
-    [getListFu]
+    [getListFu, getSizeAllFu]
   );
   );
 
 
   const columns = useMemo(() => {
   const columns = useMemo(() => {
@@ -134,7 +156,14 @@ function A7Recycled() {
       },
       },
       {
       {
         title: "删除原因",
         title: "删除原因",
-        dataIndex: "description",
+        render: (item: A7tableType) =>
+          item.description.length >= 30 ? (
+            <span style={{ cursor: "pointer" }} title={item.description}>
+              {item.description.substring(0, 30) + "..."}
+            </span>
+          ) : (
+            item.description
+          ),
       },
       },
       {
       {
         title: "文件大小(MB)",
         title: "文件大小(MB)",
@@ -171,7 +200,9 @@ function A7Recycled() {
 
 
   return (
   return (
     <div className={styles.A7Recycled}>
     <div className={styles.A7Recycled}>
-      <div className="pageTitle">回收站&emsp;当前文件占用内存:</div>
+      <div className="pageTitle">
+        回收站&emsp;<span>当前文件占用内存:{sizeAll} MB</span>
+      </div>
       <div className="A7Top">
       <div className="A7Top">
         <div className="A7TopRow">
         <div className="A7TopRow">
           <span>文件名称:</span>
           <span>文件名称:</span>

+ 7 - 0
src/store/action/A7Recycled.ts

@@ -29,3 +29,10 @@ export const A7_APIrecover = (ids: string) => {
 export const A7_APIdel = (ids: string) => {
 export const A7_APIdel = (ids: string) => {
   return http.get(`cms/recycle/remove/${ids}`);
   return http.get(`cms/recycle/remove/${ids}`);
 };
 };
+
+/**
+ * 文件占用总内存
+ */
+export const A7_APIgetSizeAll = () => {
+  return http.get("cms/recycle/getSize");
+};