shaogen1995 2 سال پیش
والد
کامیت
fb022a7857

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

@@ -21,9 +21,8 @@ import { getTokenFu } from "@/utils/storage";
 import { MessageFu } from "@/utils/message";
 import { A1_APIIupBtnOk, A1_APIremoveSure } from "@/store/action/A1Project";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
-import { useSelector } from "react-redux";
-import { RootState } from "@/store";
 import { domShowFu } from "@/utils/domShow";
+import { A2Tab2Type } from "@/types/api/A2Dict";
 
 const { Dragger } = Upload;
 
@@ -42,18 +41,23 @@ type props = {
   closeFu: () => void;
   myTitle: string;
   projectId: number;
+  typeData: A2Tab2Type[];
 };
 
-function A1IupFile({ myUrl, closeFu, upFileFu, myTitle, projectId }: props) {
+function A1IupFile({
+  myUrl,
+  closeFu,
+  upFileFu,
+  myTitle,
+  projectId,
+  typeData,
+}: props) {
   const [modal, contextHolder] = Modal.useModal();
 
   const [fileList, setFileList] = useState<UploadFile[]>([]);
 
   const timeRef = useRef(-1);
 
-  // 从仓库获取 内控文件 属性
-  const typeData = useSelector((state: RootState) => state.A2Dict.A2Tab2Arr);
-
   // 下拉框改变
   const selectChangeFu = useCallback(
     (val: number, uid: string, id: number) => {

+ 38 - 20
src/pages/A1Project/A1Inner/index.tsx

@@ -9,7 +9,11 @@ import styles from "./index.module.scss";
 import { Button, Cascader, Input, Select, Table, Tooltip } from "antd";
 import { useSelector } from "react-redux";
 import { RootState } from "@/store";
-import { A1_APIIdowns, A1_APIIgetList } from "@/store/action/A1Project";
+import {
+  A1_APIIdowns,
+  A1_APIIgetIresList,
+  A1_APIIgetList,
+} from "@/store/action/A1Project";
 import { A1ItableType } from "@/types";
 import { authFilesLookFu, urlChangeFu } from "@/utils/authFilesLook";
 import A1IRemove from "./A1IRemove";
@@ -17,6 +21,7 @@ import A1ILack from "./A1ILack";
 import A1IAudit from "./A1IAudit";
 import A1IupFile from "./A1IupFile";
 import { baseURL } from "@/utils/http";
+import { A2Tab2Type } from "@/types/api/A2Dict";
 
 type FromType = {
   searchKey: string;
@@ -85,8 +90,19 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
     [fromData]
   );
 
-  // 从仓库获取文件类别数据
-  const arr1 = useSelector((state: RootState) => state.A2Dict.A2Tab2Arr);
+  // 获取 内控文件属性 下拉 数据(已过滤权限)
+
+  const [iResList, setIResList] = useState<A2Tab2Type[]>([]);
+  const getIresListFu = useCallback(async () => {
+    const res = await A1_APIIgetIresList();
+    if (res.code === 0) {
+      setIResList(res.data);
+    }
+  }, []);
+
+  useEffect(() => {
+    getIresListFu();
+  }, [getIresListFu]);
 
   // 从仓库获取部门 级联 信息
   const deptList = useSelector((state: RootState) => state.A5Section.tableList);
@@ -115,28 +131,29 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
 
     const txt = num === 0 ? "待审批" : num === 1 ? "审批通过" : "审批驳回";
 
-    const dom = item.auditDesc&&num !== 0 ? (
-      <Tooltip title={item.auditDesc}>
+    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
-          className="iconHoverTit A1ItablauidtBox"
+          className="A1ItablauidtBox"
           onClick={() =>
             setAuditInfo({ id: item.id, sta: num, txt: item.auditDesc || "" })
           }
         >
-          {txt}&nbsp;
-          <div className="iconHoverTitTxt">?</div>
+          {txt}
         </div>
-      </Tooltip>
-    ) : (
-      <div
-        className="A1ItablauidtBox"
-        onClick={() =>
-          setAuditInfo({ id: item.id, sta: num, txt: item.auditDesc || "" })
-        }
-      >
-        {txt}
-      </div>
-    );
+      );
 
     return dom;
   }, []);
@@ -272,7 +289,7 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
             onChange={(e) => setFromData({ ...fromData, attrId: e })}
             options={[
               { value: "", label: "全部" },
-              ...arr1.map((v) => ({ value: v.id, label: v.name })),
+              ...iResList.map((v) => ({ value: v.id, label: v.name })),
             ]}
           />
         </div>
@@ -380,6 +397,7 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
           closeFu={() => setUpFileOpen(false)}
           myTitle={myTitle}
           projectId={projectId}
+          typeData={iResList}
         />
       ) : null}
     </div>

+ 1 - 0
src/pages/A4Role/index.tsx

@@ -31,6 +31,7 @@ function A4Role() {
     searchKey: "",
   });
 
+
   useEffect(() => {
     dispatch(getRoleListAPI(tableSelect));
   }, [dispatch, tableSelect]);

+ 19 - 1
src/pages/A7Recycled/index.module.scss

@@ -11,7 +11,25 @@
       }
 
       .A7TopBtn{
-        margin-left: 180px;
+        margin-left: 150px;
+      }
+    }
+    .A7tableBox{
+      margin-top: 15px;
+      border-radius: 10px;
+      height: calc(100% - 85px);
+      background-color: #fff;
+      overflow: hidden;
+      display: flex;
+      .ant-table-body {
+        height: 620px;
+        overflow-y: auto !important;
+
+        .ant-table-row {
+          .ant-table-cell {
+            padding: 10px 8px;
+          }
+        }
       }
     }
   }

+ 67 - 7
src/pages/A7Recycled/index.tsx

@@ -1,8 +1,15 @@
-import React, { useCallback, useEffect, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
-import { Button, DatePicker, Input, Popconfirm } from "antd";
-import { useDispatch } from "react-redux";
+import { Button, DatePicker, Input, Popconfirm, Table } from "antd";
+import { useDispatch, useSelector } from "react-redux";
 import { A7_APIgetList } from "@/store/action/A7Recycled";
+import { RootState } from "@/store";
 
 const { RangePicker } = DatePicker;
 
@@ -33,9 +40,7 @@ function A7Recycled() {
         sizeMax: fromData.sizeMax ? Number(fromData.sizeMax) : null,
       };
 
-      console.log("---", obj);
-
-      // dispatch(A7_APIgetList(obj));
+      dispatch(A7_APIgetList(obj));
     }, 500);
   }, [dispatch, fromData]);
 
@@ -66,9 +71,37 @@ function A7Recycled() {
     setFromData({ ...fromData, startTime, endTime, pageNum: 1 });
   };
 
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      setFromData({ ...fromData, pageNum, pageSize });
+    },
+    [fromData]
+  );
+
+  // 从仓库获取表格数据
+  const tableData = useSelector(
+    (state: RootState) => state.A7Recycled.tableInfo
+  );
+
+  // 关于表格的多选
+  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
+
   // 点击删除
   const delById = useCallback((ids: string) => {}, []);
 
+  // 点击恢复
+  const restortFu = useCallback((ids: string) => {}, []);
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: "创建用户",
+        dataIndex: "creatorName",
+      },
+    ];
+  }, []);
+
   return (
     <div className={styles.A7Recycled}>
       <div className="pageTitle">回收站&emsp;当前文件占用内存:</div>
@@ -113,9 +146,36 @@ function A7Recycled() {
             </Button>
           </Popconfirm>
           &emsp;
-          <Button type="primary">批量恢复</Button>
+          <Button type="primary" onClick={() => restortFu("123")}>
+            批量恢复
+          </Button>
         </div>
       </div>
+
+      <div className="A7tableBox">
+        <Table
+          rowSelection={{
+            type: "checkbox",
+            selectedRowKeys,
+            onChange: (selectedRowKeys: React.Key[]) => {
+              setSelectedRowKeys(selectedRowKeys);
+            },
+          }}
+          scroll={{ y: 620 }}
+          dataSource={tableData.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: fromData.pageNum,
+            pageSize: fromData.pageSize,
+            total: tableData.total,
+            onChange: paginationChange(),
+          }}
+        />
+      </div>
     </div>
   );
 }

+ 1 - 6
src/pages/Layout/index.tsx

@@ -22,7 +22,6 @@ import logoImg from "@/assets/img/logo.png";
 import { useDispatch, useSelector } from "react-redux";
 import { A5_APIgetList } from "@/store/action/A5Section";
 import { A4_APIgetRoleAll } from "@/store/action/A4Role";
-import { A2_APIgetListFile } from "@/store/action/A2Dict";
 import NotFound from "@/components/NotFound";
 import tabLeftArr from "./data";
 import { RootState } from "@/store";
@@ -39,12 +38,8 @@ function Layout() {
     // 进页面获取 部门 列表 信息(给 用户管理、字典管理 项目管理-内控文件下拉框 页面使用)
     dispatch(A5_APIgetList());
 
-    // 获取字典的 -内控文件属性 列表(角色管理 项目管理-内控文件下拉框 页面使用)
-    dispatch(A2_APIgetListFile());
-
     // 获取 项目管理-项目文件-左侧一级写死目录
-    dispatch(A1_APIOgetHardCoded())
-
+    dispatch(A1_APIOgetHardCoded());
   }, [dispatch]);
 
   // 左侧菜单 和 路由 信息

+ 9 - 0
src/store/action/A1Project.ts

@@ -157,6 +157,15 @@ export const A1_APIUdel = (id: number) => {
 };
 
 // --------------------------  内控文件  --------------------------
+
+
+/**
+ * 内控文件---------获取内控文件属性的已过滤的列表
+ */
+export const A1_APIIgetIresList = () => {
+  return http.get('cms/inside/getFileAttributeList');
+};
+
 /**
  * 内控文件---------获取列表
  */