Quellcode durchsuchen

Merge branch 'master' of http://120.55.44.4:10080/xujunjie/GtDigManageWeb

Renxy vor 2 Jahren
Ursprung
Commit
5c59d42e24

+ 38 - 6
.umirc.ts

@@ -8,9 +8,10 @@ export default defineConfig({
   initialState: {},
   request: {},
   layout: {
-    title: '金科环境数字化平台',
+    title: '金科环境数字化管理平台',
     locale: false,
   },
+  title: "金科环境数字化管理平台",
   proxy: {
     '/api': {
       // target: 'http://47.96.12.136:8788/',
@@ -19,6 +20,14 @@ export default defineConfig({
       changeOrigin: true,
     },
   },
+  // chainWebpack(config) {
+  //   config.module
+  //     .rule()
+  //     .test(/\.(pdf|svg|docx|doc)$/)
+  //     .use('file-loader?name=[path][name].[ext]')
+  //     .loader('file-loader')
+  //     .end()
+  // },
   routes: [
     {
       path: '/',
@@ -31,7 +40,7 @@ export default defineConfig({
       layout: false,
     },
     {
-      name: '流程图列表',
+      name: '审批流管理',
       path: '/flow',
       hideChildrenInMenu: true,
       routes: [
@@ -40,12 +49,12 @@ export default defineConfig({
           redirect: '/flow/list',
         },
         {
-          name: '流程图列表',
+          name: '审批流管理',
           path: '/flow/list',
           component: './Flow/index',
         },
         {
-          name: '流程图详情',
+          name: '审批流详情',
           path: '/flow/audit',
           component: './Flow/Audit',
           hideInMenu: true,
@@ -118,9 +127,32 @@ export default defineConfig({
     {
       name: '个人中心',
       path: '/profile',
-      component: './Profile/index',
-      hideInMenu: true,
+      routes:[
+        {
+          name:'我的申请',
+          path:'/profile/apply',
+          component:'./Profile/apply'
+        },
+        {
+          name:'我的审批',
+          path:'/profile/approve',
+          component:'./Profile/approve'
+        },
+        {
+          name:'已审核',
+          path:'/profile/approved',
+          component:'./Profile/approved'
+        }
+      ]
+      // component: './Profile/index',
+      // hideInMenu: true,
     },
+    // {
+    //   name: '个人中心',
+    //   path: '/profile',
+    //   component: './Profile/index',
+    //   hideInMenu: true,
+    // },
     {
       name: '审批详情',
       path: '/profile/:id',

+ 1 - 1
src/app.tsx

@@ -17,7 +17,7 @@ export const layout: RunTimeLayoutConfig = (initialState) => {
     navTheme: 'light',
     layout: 'side',
     contentWidth: 'Fluid',
-    title: '金科环境数字化平台',
+    title: '金科环境数字化管理平台',
     token: {
       sider: {
         colorMenuBackground: '#292f33',

+ 1 - 0
src/components/FileViewer/index.js

@@ -21,6 +21,7 @@ const FileViewerModal = ({ data, visible, onCancel, downloadFile }) => {
     } else if (data?.url) {
       return (
         <FileViewer
+          
           key={data?.name}
           fileType={type}
           filePath={data?.url}

+ 1 - 1
src/components/UserDropdown/index.tsx

@@ -22,7 +22,7 @@ const items: MenuProps['items'] = [
 export default function UserDropdown(props: any) {
   const { user } = useModel('userInfo');
   return (
-    <Dropdown menu={{ items }}>
+    <Dropdown placement="top" menu={{ items }}>
       <a className={styles.action} onClick={(e) => e.preventDefault()}>
         <Avatar icon={<UserOutlined />} />
         <span className={styles.name}>{user?.CName}</span>

+ 8 - 0
src/global.less

@@ -92,4 +92,12 @@ input[type='reset'] {
 // Remove outline on focus
 *:focus {
   outline: none;
+}
+#pg-photo-container {
+  width: 100% !important;
+    height: unset !important;
+}
+#pg-photo-container > img{
+  width: 100% !important;
+  height: unset !important;
 }

+ 121 - 0
src/layouts/temp.tsx

@@ -0,0 +1,121 @@
+import {
+  Link,
+  useLocation,
+  useNavigate,
+  Outlet,
+  useAppData,
+  useAccessMarkedRoutes,
+} from 'umi';
+import type { IRoute } from 'umi';
+import React, { useMemo } from 'react';
+import { ProLayout } from '@ant-design/pro-components';
+import logo from '@/assets/logo.png';
+import UserDropdown from '@/components/UserDropdown';
+
+// 过滤出需要显示的路由, 这里的filterFn 指 不希望显示的层级
+const filterRoutes = (
+  routes: any[],
+  filterFn: (route: IRoute) => boolean,
+): IRoute[] => {
+  if (routes.length === 0) {
+    return [];
+  }
+
+  let newRoutes = [];
+  for (const route of routes) {
+    const newRoute = { ...route };
+    if (filterFn(route)) {
+      if (Array.isArray(newRoute.routes)) {
+        newRoutes.push(...filterRoutes(newRoute.routes, filterFn));
+      }
+    } else {
+      if (Array.isArray(newRoute.children)) {
+        newRoute.children = filterRoutes(newRoute.children, filterFn);
+        newRoute.routes = newRoute.children;
+      }
+      newRoutes.push(newRoute);
+    }
+  }
+
+  return newRoutes;
+};
+
+// 格式化路由 处理因 wrapper 导致的 菜单 path 不一致
+const mapRoutes = (routes: IRoute[]) => {
+  if (routes.length === 0) {
+    return [];
+  }
+  return routes.map((route) => {
+    // 需要 copy 一份, 否则会污染原始数据
+    const newRoute = { ...route };
+    if (route.originPath) {
+      newRoute.path = route.originPath;
+    }
+
+    if (Array.isArray(route.routes)) {
+      newRoute.routes = mapRoutes(route.routes);
+    }
+
+    if (Array.isArray(route.children)) {
+      newRoute.children = mapRoutes(route.children);
+    }
+
+    return newRoute;
+  });
+};
+
+export default (props: any) => {
+  const location = useLocation();
+  const navigate = useNavigate();
+  const data = useAppData();
+  const { clientRoutes } = data;
+  console.log(data);
+
+  // 现在的 layout 及 wrapper 实现是通过父路由的形式实现的, 会导致路由数据多了冗余层级, proLayout 消费时, 无法正确展示菜单, 这里对冗余数据进行过滤操作
+  const newRoutes = filterRoutes(clientRoutes, (route) => {
+    return route.isLayout || route.isWrapper;
+  });
+  const [route] = useAccessMarkedRoutes(mapRoutes(newRoutes));
+
+  return (
+    <ProLayout
+      route={route}
+      location={location}
+      title={'金科环境数字化平台'}
+      navTheme="light"
+      siderWidth={256}
+      onMenuHeaderClick={(e) => {
+        e.stopPropagation();
+        e.preventDefault();
+        navigate('/');
+      }}
+      menu={{ locale: false }}
+      logo={logo}
+      menuItemRender={(menuItemProps, defaultDom) => {
+        if (menuItemProps.isUrl || menuItemProps.children) {
+          return defaultDom;
+        }
+        if (menuItemProps.path && location.pathname !== menuItemProps.path) {
+          return (
+            // handle wildcard route path, for example /slave/* from qiankun
+            <Link
+              to={menuItemProps.path.replace('/*', '')}
+              target={menuItemProps.target}
+            >
+              {defaultDom}
+            </Link>
+          );
+        }
+        return defaultDom;
+      }}
+      itemRender={(route: any) => (
+        <Link to={route.path}>{route.breadcrumbName}</Link>
+      )}
+      fixSiderbar
+      fixedHeader
+      rightContentRender={() => <UserDropdown />}
+    >
+      <Outlet />
+    </ProLayout>
+  );
+};

+ 68 - 0
src/pages/FileManagement/components/PreModal.js

@@ -0,0 +1,68 @@
+import { Checkbox, Modal, Radio } from "antd";
+import { useRef, useEffect, useMemo } from "react";
+import style from './index.less'
+import { useRequest } from '@umijs/max';
+
+const PerModal = ({ node,fileNode,auditList, visible, handleCancel, handleOk }) => {
+  console.log(node)
+  const checkedValuesRef = useRef([])
+  const auditItem= useRef()
+  const data = [
+    { name: "文件权限", id: "DDMultiSelectField_2e553cd3-094e-4a34-8a2a-40271d6b107e", value: ["删除", "下载"] },
+    { name: "文件名称", id: "TextField_663c9a4e - 26c7- 408e-ac90 - fac20e796edf", value: ["文件夹1"] },
+    { name: "文件id", id: "TextField_1d1334ed - 1944 - 4e59 - 97db - 2d8615acf7c6", value: ["2"] },
+    { name: "文件类型", id: "TextField_1d1334ed - 1944 - 4e59 - 97db - 2d8615acf7c7", value: ["2"] }
+  ]
+  const options = useMemo(() => {
+   return node?.dir_type ? [
+    { label: '下载', value: 1},
+    { label: '删除', value:2 }
+  ] : [
+    { label: '下载', value: 1}
+  ];
+  }, [node]) 
+
+  const onChange = (checkedValues) => {
+    checkedValuesRef.current = checkedValues;
+    console.log('checked = ', checkedValues);
+  };
+  const handleOkClick = () => {
+    data[0].value = checkedValuesRef.current;
+    data[1].value = [node?.dir_name];
+    data[2].value = [node?.id.toString()];
+    data[3].value = [node?.dir_type.toString()];
+
+    const result = {
+      flow_id: auditItem.current,
+      form: JSON.stringify(data),
+      audit_list:[448],
+      files: '',
+      file_type:fileNode?.file_type,
+    }
+    handleOk?.(result)
+  }
+  return (
+    <Modal
+      title="权限申请"
+      open={visible}
+      onOk={handleOkClick}
+      onCancel={handleCancel}
+      destroyOnClose
+      width={800}
+    >
+      <div className={style.title}>申请权限对象:</div>
+      <div className={style.content}>{fileNode?.file_name}</div>
+      <div className={style.title}>选择权限:</div>
+      <div className={style.content}>
+        <Checkbox.Group options={options} onChange={onChange} />
+      </div>
+      <div className={style.title}>可选流程:</div>
+      <Radio.Group onChange={onChange}>
+       {auditList?.map(item=><Radio value={item?.id} onChange={(e)=>{auditItem.current = e.target.value}}>{item?.name}</Radio>)}
+      </Radio.Group>
+
+    </Modal>
+  );
+}
+  
+export default PerModal

+ 9 - 0
src/pages/FileManagement/components/index.less

@@ -0,0 +1,9 @@
+.title{
+  font-weight: bold;
+  margin: 10px 0;
+}
+.content{
+  border: 1px solid #ddd;
+  padding: 10px 20px;
+  border-radius: 5px;
+}

+ 30 - 0
src/pages/FileManagement/components/model.jsx

@@ -0,0 +1,30 @@
+import { Input, Modal } from 'antd';
+import { useRef, useState } from 'react';
+
+const AddFileModal = ({ id, visible, handleOk, handleCancel }) => {
+  const [value, setValue] = useState('新建文件夹');
+
+  const onChange = () => {
+    console.log(value);
+    handleOk?.({ id, dir_name: value });
+  };
+  return (
+    <Modal
+      title="新建文件夹"
+      open={visible}
+      onOk={onChange}
+      onCancel={handleCancel}
+    >
+      <div
+        style={{ display: 'flex', whiteSpace: 'nowrap', alignItems: 'center' }}
+      >
+        文件名:
+        <Input
+          defaultValue={'新建文件夹'}
+          onChange={(e) => setValue(e.target.value)}
+        />
+      </div>
+    </Modal>
+  );
+};
+export default AddFileModal;

+ 414 - 47
src/pages/FileManagement/index.js

@@ -1,33 +1,43 @@
 import React, { useState } from 'react';
-import { Input, Tree, Table, Button, Form, DatePicker, Divider } from 'antd';
-import { PageContainer } from '@ant-design/pro-components';
-
-const temp = [
-  {
-    key: 1,
-    title: '文件夹1',
-    children: [
-      { key: '1-1', title: '文件夹1' },
-      {
-        key: '1-2',
-        title: '文件夹2',
-        children: [{ key: '1-2-1', title: '文件夹1' }],
-      },
-    ],
-  },
-  {
-    key: 2,
-    title: '文件夹2',
-    children: [
-      { key: '2-1', title: '文件夹1' },
-      { key: '2-2', title: '文件夹2' },
-      { key: '2-3', title: '文件夹3' },
-    ],
-  },
-];
+import {
+  Input,
+  Tree,
+  Table,
+  Button,
+  Form,
+  DatePicker,
+  Divider,
+  Modal,
+  Checkbox,
+  TreeSelect,
+  Upload,
+  Space,
+  message,
+} from 'antd';
+import dayjs from 'dayjs';
+import { PageContainer, ProCard } from '@ant-design/pro-components';
+import { useRequest, useModel } from '@umijs/max';
+import axios from 'axios';
+import {
+  queryDirCreate,
+  queryDirList,
+  queryFileList,
+  queryFileUpload,
+  queryOAFile,
+  querySetPermit,
+  queryFileDownload,
+} from '../../services/file';
+import { queryGetContractList } from '../../services/contract';
+import { downloadFile, getToken } from '@/utils/utils';
+import { PlusCircleOutlined } from '@ant-design/icons';
+import AddFileModal from './components/model';
+import PerModal from './components/PreModal';
+import { queryAuditList, createAduit } from '@/services/boom';
+import {stringify} from 'qs'
 
 const tempData = [
-  { name: '文件', upload_user: '管理员', upload_time: '2023-04-08 11:00:00' },
+  { name: '文件1', upload_user: '管理员', upload_time: '2023-04-08 11:00:00' },
+  { name: '文件2', upload_user: '管理员', upload_time: '2023-04-10 11:00:00' },
 ];
 
 const { DirectoryTree } = Tree;
@@ -36,28 +46,158 @@ const { RangePicker } = DatePicker;
 
 function FileManagement(props) {
   const [form] = Form.useForm();
+  const { user } = useModel('userInfo');
+  const [tableData , setTableData] = useState([])
+  const [visible, setVisible] = useState(false);
+  const [node, setNode] = useState();
+  const [selectedRowKeys, setSelectedRowKeys] = useState([])
+
+  const { data:treeData, run: runFileDir } = useRequest((data) => queryDirList(data), {
+    formatResult: (res) => {
+      const result = [];
+      result[0] = res?.data.limit_list[0];
+      result[1] = res?.data.list[0];
+      return result
+    },
+  });
+
+  const { loading, run } = useRequest((data) => queryFileList(data), {
+    manual: true,
+    onSuccess: (data) => {
+      let result = data?.list?.map((item, idx) => {
+        return {...item, dir_name:item.file_name, create_time: item.created_on, key:idx }
+      }) || []
+      setTableData(result)
+      setSelectedRowKeys([])
+    }
+  });
+
+  const {
+    loading: OAloading,
+    run: runOA,
+  } = useRequest((data) => queryOAFile(data), {
+    manual: true,
+    onSuccess: (data) => {
+      let result = data?.list.map((item, idx) => {
+        let name
+        if (item?.name) {
+          name = item.name
+        } else if (item?.path) {
+          const list = item.path.split('/');
+          name = list?.length > 0 ? list[list.length - 1] : "-";
+        } else if (item?.url) {
+          const list = item?.url?.split('/');
+          name = list?.length > 0 ? list[list.length - 1] : "-";
+        }
+        return {...item, dir_name:name, create_time: dayjs(item.c_time).format('YYYY-MM-DD'), key:idx}
+      }) || []
+      setTableData(result)
+      setSelectedRowKeys([])
+    }
+  });
+
+  const {
+    loading: contractLoading,
+    run: runContract,
+  } = useRequest((data) => queryGetContractList({ ...data, status: 3 }), {
+    manual: true,
+    onSuccess: (data) => {
+      let result = data?.list.map((item, idx) => {
+        return {...item, dir_name:item.name, create_time: item.created_on, key:idx }
+      }) || []
+      setTableData(result)
+      setSelectedRowKeys([])
+    }
+  });
+
+  const { loading: createLoading, run: RunCreate } = useRequest(
+    (data) => queryDirCreate(data),
+    {
+      manual: true,
+      onSuccess: () => {
+        setVisible(false);
+        runFileDir()
+        message.success('创建成功');
+      },
+      onError: () => {
+        message.success('创建失败');
+      },
+    },
+  );
+  //申请权限
+  const { loading:perLoading, run:runPer } = useRequest((data) => querySetPermit(data), {
+    manual: true,
+    onSuccess: (data) => {
+      message.success('申请成功')
+    },
+    onError: () => {
+      message.error('申请失败')
+    }
+  });
+
+  //上传文件
+  const { run:runUploadFiles} = useRequest((data) => queryFileUpload(data), {
+    manual: true,
+    onSuccess: (data) => {
+      updateTableFile(node)
+      message.success('文件上传成功')
+    },
+    onError: () => {
+      message.error('文件上传失败')
+    }
+  })
+
+  //文件审批列表
+  const { data: auditList} = useRequest(() => queryAuditList({ flow_type: 1 }));
+  //发起申请权限的文件审批
+  const { loading: createLoadin, run:runAuditCreate  } = useRequest(createAduit, {
+    manual: true,
+    onSuccess() {
+      message.success('申请审批成功');
+      setPerOpen(false);
+    },
+  });
+
+  //下载文件
+  // const { data: fileData, run:runDownload } = useRequest((data) => queryFileDownload(data), {
+  //   manual: true,
+  //   onSuccess: (data) => {
+  //     message.success('文件下载成功')
+  //   },
+  //   onError: (data) => {
+  //     message.error('文件下载失败')
+  //   }
+  // })
 
   const [expandedKeys, setExpandedKeys] = useState([]);
   const [searchValue, setSearchValue] = useState('');
+  const [permissionOpen, setPerOpen] = useState(false);
+  const [addOpen, setAddOpen] = useState(false);
+  const [editPer, setEditPer] = useState(false);
 
   const columns = [
-    { title: '文档名称', dataIndex: 'name' },
-    { title: '上传人员', dataIndex: 'upload_user' },
-    { title: '上传时间', dataIndex: 'upload_time' },
+    { title: '文档名称', dataIndex: 'dir_name' },
+    { title: '上传人员', dataIndex: 'user_name' },
+    {
+      title: '上传时间',
+      dataIndex: 'create_time',
+      render: (text) => dayjs(text).format('YYYY-MM-DD'),
+    },
     {
       title: '操作',
       render: (_, record) => (
-        <>
-          <a>下载</a>
-          <Divider type="vertical" />
-          <a>删除</a>
-        </>
+        <Space>
+          <a onClick={()=>handleSeeClick(record)}>查看</a>
+          <a onClick={() => onDownload(record)}>下载</a>
+          {node?.dir_type == 0 && <a>删除</a>}
+        </Space>
       ),
     },
   ];
 
+
   // 搜索文件夹树
-  const onSearchDirectory = (value, nodes = temp) => {
+  const onSearchDirectory = (value, nodes = treeData) => {
     const expandedKeys = getExpandedKeys(nodes, value);
     setExpandedKeys(expandedKeys);
     setSearchValue(value);
@@ -68,13 +208,15 @@ function FileManagement(props) {
     if (!value) return [];
     let result = [];
     nodes.forEach((node) => {
-      if (node.title.includes(value)) {
-        result.push(node.key);
+      // 若该节点名称包含搜索值,将key加入result
+      if (node.dir_name.includes(value)) {
+        result.push(node.id);
       }
+      // 若该节点的子节点包含搜索值,将子节点key和该节点key加入result
       if (node.children) {
         let getChildren = getExpandedKeys(node.children, value);
         if (getChildren.length != 0)
-          result = [...result, node.key, ...getChildren];
+          result = [...result, node.id, ...getChildren];
       }
     });
     return result;
@@ -85,8 +227,9 @@ function FileManagement(props) {
   };
 
   const filterTreeNode = (node) =>
-    searchValue.length > 0 ? node.title.includes(searchValue) : false;
+    searchValue.length > 0 ? node.dir_name.includes(searchValue) : false;
 
+  // 搜索文件
   const onSearch = () => {
     form
       .validateFields()
@@ -98,19 +241,121 @@ function FileManagement(props) {
       });
   };
 
+  const findListById = (id) => {
+    if(!id )return 
+    const fun = (data) => {
+      for (let i = 0; i < data.length; i++){
+        let item = data[i];
+        if (item.id == id) {
+          return item.children;
+        }else if(item.children){
+          let res = fun(item.children);
+          if (res) return res;
+        }
+      }
+    }
+    const list = fun(treeData)
+
+    return list?.map((item, idx) => { return { ...item, key :idx} })
+  }
+
+  const updateTableFile = (node) => {
+    if (node.id == 1) {
+      //点击受控文件直接把文件夹下的文件夹列表显示出来
+      setTableData(findListById(1))
+      setSelectedRowKeys([])
+    } else if (node.id == 3) {
+      //点击合同文件直接把文件夹下的文件夹列表显示出来
+      setTableData(findListById(3))
+      setSelectedRowKeys([])
+    } else if (node.id == 7) {
+      //合同归档走合同接口
+      runContract({});
+    } else if(node.is_limit){
+      //其他受控文件走classify_id
+      runOA({ classify_id: node.classify_id });
+    } else {
+      //部门文件
+      run({ dir_id:node.id })
+    }
+  }
+ cons
+  const handleSelect = (SelectKeys, e) => {
+    console.log(e, SelectKeys)
+    const node = e.node;
+    setNode(node)
+    updateTableFile(e.node)
+  };
+
+
+  const onDownload = (record) => {
+    // runDownload({file_id:record.id, path:record.path, file_type:node.dir_type })
+    // const token = getToken();
+    const data = {file_id:record.id, path:record.path, file_type:node.dir_type }
+    window.downloadFile(`/api/archive/v1/file/download?${stringify(data)}`, record.dir_name, false);
+  };
+
+  const handleSeeClick = (record) => {
+    const token = getToken();
+    const data = {file_id:record.id, path:record.path, file_type:node.dir_type,'JWT-TOKEN':token }
+    axios.get(`/api/archive/v1/file/download?${stringify(data)}`)
+      .then(function (response) {
+        console.log(response);
+      })
+      .catch(function (error) {
+        console.log(error);
+      });
+  }
+
+  const handleFilesChange = () => {
+    const inputDom = document.getElementById('files');
+    let formData = new FormData()
+    formData.append('dir_id', node.id);
+    formData.append('user_name', user.CName);
+    if (inputDom.files?.length > 0) {
+      for (let i = 0; i < inputDom.files.length; i++){
+        formData.append('files', inputDom.files[i]);
+      }
+      runUploadFiles(formData)
+    }
+  }
+
   return (
     <PageContainer>
       <div style={{ display: 'flex', justifyContent: 'space-between' }}>
-        <div style={{ height: '100%', width: '30%' }}>
+        <ProCard style={{ height: '100%', width: '30%' }}>
           <Search onSearch={(value, _) => onSearchDirectory(value)} />
           <DirectoryTree
             expandedKeys={expandedKeys}
             onExpand={onExpand}
-            treeData={temp}
+            treeData={treeData}
+            onSelect={handleSelect}
+            fieldNames={{ key: 'id', title: 'dir_name', children: 'children' }}
             filterTreeNode={filterTreeNode}
+            titleRender={(item) => {
+              return item.dir_name == '部门文件' ? (
+                <Space>
+                  <span>{item.dir_name}</span>
+                  <PlusCircleOutlined style={{fontSize:'16px'}} onClick={() => {
+                      setNode(item);
+                      setVisible(true);
+                    }}/>
+                  {/* <Button
+                    shape="circle"
+                    icon={<PlusOutlined style={{fontSize:'16px'}} />}
+                    onClick={() => {
+                      setNode(item);
+                      setVisible(true);
+                    }}
+                  /> */}
+                </Space>
+              ) : (
+                <span>{item.dir_name}</span>
+              );
+            }}
           />
-        </div>
-        <div style={{ height: '100%', width: 'calc(70% - 20px)' }}>
+        </ProCard>
+        <ProCard style={{ height: '100%', width: 'calc(70% - 20px)' }}>
           <Form layout="inline" form={form}>
             <Form.Item name="date">
               <RangePicker />
@@ -124,14 +369,136 @@ function FileManagement(props) {
               </Button>
             </Form.Item>
             <Form.Item>
-              <Button type="primary">上传</Button>
+              <Button type="primary" onClick={ ()=>document.getElementById('files')?.click()} disabled={node ? false : true}>上传</Button>
+            </Form.Item>
+            <Form.Item>
+              <Button type="primary" onClick={() => setPerOpen(true)} disabled={selectedRowKeys ? false : true}>
+                申请权限
+              </Button>
             </Form.Item>
           </Form>
-          <Table columns={columns} dataSource={tempData} />
-        </div>
+          <div>
+            <Table
+              columns={columns}
+              dataSource={tableData}
+              rowSelection={{
+                selectedRowKeys ,
+                type:'radio',
+                onChange: (e,fileNode) => {
+                  console.log(e)
+                  setSelectedRowKeys(e)
+                    // (fileNode[0])
+              }}}
+              loading={OAloading || contractLoading || loading}
+              style={{ overflowY: 'auto' }}
+              childrenColumnName='none'
+              pagination={false}
+            />
+            {/* 
+            <Button type="primary" onClick={() => setAddOpen(true)}>
+              <PlusOutlined />
+              新增权限
+            </Button>
+            {!editPer && (
+              <Button
+                type="primary"
+                onClick={() => setEditPer(true)}
+                style={{ marginLeft: 20 }}
+              >
+                编辑权限
+              </Button>
+            )}
+            {editPer && (
+              <Button
+                type="primary"
+                onClick={() => setEditPer(false)}
+                style={{ marginLeft: 20 }}
+              >
+                确定
+              </Button>
+            )}
+            <Table
+              columns={columnsPer}
+              dataSource={tempPer}
+              style={{ overflowY: 'auto' }}
+            />
+            */}
+          </div>
+        </ProCard>
+         <Input
+            id="files"
+            type="file"
+            style={{ display: 'none' }}
+            onChange={handleFilesChange}
+            multiple
+          />
       </div>
+      {/* <PerModal /> */}
+      <AddModal />
+
+      <AddFileModal
+        id={node?.id}
+        visible={visible}
+        handleOk={(value) => {
+          RunCreate({ ...value, user_name: user?.CName });
+        }}
+        handleCancel={() => setVisible(false)}
+      />
+      <PerModal
+        node={node}
+        fileNode={tableData?.find(item => item.key == selectedRowKeys[0])}
+        auditList={auditList}
+        visible={permissionOpen}
+        handleCancel={() => setPerOpen(false)}
+        handleOk={(data)=>{runAuditCreate(data)}}
+      />
     </PageContainer>
   );
+  function AddModal(props) {
+    const perList = [
+      { label: '查看列表', value: 'a', disabled: true },
+      { label: '只读', value: 'b', disabled: true },
+      { label: '下载', value: 'c' },
+      { label: '删除', value: 'd' },
+      { label: '授权', value: 'e' },
+    ];
+
+    const rowSelection = {
+      onChange: (selectedRowKeys, selectedRows) => {
+        console.log(
+          `selectedRowKeys: ${selectedRowKeys}`,
+          'selectedRows: ',
+          selectedRows,
+        );
+      },
+    };
+
+    return (
+      <Modal
+        title="新增权限"
+        open={addOpen}
+        onCancel={() => setAddOpen(false)}
+        width={800}
+      >
+        <Table
+          title={() => '文档列表'}
+          columns={columns.slice(0, -1)}
+          dataSource={tempData}
+          pagination={false}
+          rowSelection={rowSelection}
+          destroyOnClose
+        />
+        <div style={{ margin: '20px 0px' }}>
+          <span style={{ marginRight: 20 }}>选择用户:</span>
+          <TreeSelect multiple={true} style={{ width: 200 }}></TreeSelect>
+        </div>
+        <div>
+          <span style={{ marginRight: 20 }}>选择权限:</span>
+          <Checkbox.Group options={perList} defaultValue={['a', 'b']} />
+        </div>
+      </Modal>
+    );
+  }
 }
 
 export default FileManagement;

+ 378 - 0
src/pages/Profile/apply.js

@@ -0,0 +1,378 @@
+import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
+import { useNavigate } from 'umi';
+import {
+  Card,
+  Table,
+  Empty,
+  Button,
+  Modal,
+  message,
+  Form,
+  DatePicker,
+  Row,
+  Col,
+  Select,
+} from 'antd';
+import { PageContainer } from '@ant-design/pro-components';
+const { RangePicker } = DatePicker;
+import { useRequest, useModel } from '@umijs/max';
+import { queryProfileList, queryApplyList } from '@/services/boom';
+import dayjs from 'dayjs';
+import { queryContractCheck, queryGetContractList } from '@/services/contract';
+import ContractModal, {
+  Status,
+  StatusText,
+  Type,
+} from '../ContractManager/component/Modal';
+const TYPE = {
+  Contract: 1,
+  OA: 2,
+};
+function Apply(props) {
+  const { user } = useModel('userInfo');
+  const [tabActive, setTabActive] = useState('1');
+  const [detail, setDetail] = useState({});
+  const [conVisible, setConVisible] = useState(false);
+  const approveFormRef = useRef();
+  const [applyFormRef] = Form.useForm();
+  let navigate = useNavigate();
+  const contractResult = (res) => {
+    let data = res.data?.list?.map((item) => {
+      return {
+        ...item,
+        table_name: `${user.CName}提交的合同审批`,
+        table_desc: [
+          `合同名称:${item.name}`,
+          `合同编号:${item.code}`,
+          `合同金额:${item.amount}万元`,
+        ],
+        CName: user.CName,
+        create_time: item.cancel_on || item.created_on,
+        type: TYPE.Contract,
+        statusText: StatusText[item.status],
+        showBtn:
+          item.status == Status.Checking || item.status == Status.CalChecking,
+        // key: `${TYPE.Contract}_${item.id}`,
+      };
+    });
+    return { data, pagination: res.data?.pagination }
+  };
+  //OA我的申请列表
+  const {
+    data: OAApplyData,
+    run: OAApplyRun,
+    loading: OAApplyLoading,
+  } = useRequest(queryApplyList, {
+    // manual: true,
+    formatResult: (res) => {
+      return {
+        data: res.data?.list?.map((item) => {
+          return {
+            ...item,
+            CName: item.AuthorInfo.CName,
+            table_desc: [item.table_desc],
+            table_name: item.name
+          };
+        }),
+        pagination: res.data?.pagination
+      }
+    },
+  });
+  //合同管理相关数据
+  //请求我的申请列表
+  const {
+    data: conApplyData,
+    run: conApplyRun,
+    loading: conApplyLoading,
+  } = useRequest(queryGetContractList, {
+    // manual: true,
+    defaultParams: [{ created_by: user?.ID, pageSize: 10 }],
+    formatResult: contractResult,
+  });
+  const applyData = useMemo(() => {
+    let result = [];
+    if (OAApplyData?.data && OAApplyData?.data.length > 0) result = [...OAApplyData?.data];
+    return result;
+  }, [OAApplyData]);
+  const onTabChange = (activeKey) => {
+    if (activeKey == '1') {
+      OAApplyRun();
+    } else {
+      conApplyRun({ current: 1, page_size: 10 });
+    }
+    setTabActive(activeKey);
+  };
+  const handleApplySubmit = (values) => {
+    console.log(values);
+    OAApplyRun(values);
+  };
+  const handleApplyPaginationChange = (pagination) => {
+    applyFormRef.validateFields().then((values) => {
+      OAApplyRun({
+        ...values,
+        currentPage: pagination.current,
+        pageSize: pagination.pageSize,
+      });
+    });
+  };
+  const handleProfilePaginationChange = (pagination) => {
+    conApplyRun({
+      current: pagination.current,
+      page_size: pagination.pageSize,
+    });
+  };
+  const columns = [
+    {
+      title: '标题',
+      dataIndex: 'table_name',
+      width: '30%',
+    },
+    // {
+    //   title: '摘要',
+    //   dataIndex: 'table_desc',
+    //   render: (descList) => {
+    //     return (
+    //       <ul>
+    //         {descList?.map((item) => (
+    //           <li>{item}</li>
+    //         ))}
+    //       </ul>
+    //     );
+    //   },
+    // },
+    {
+      title: '发起人',
+      dataIndex: 'CName',
+      width: '20%',
+    },
+    {
+      title: '发起时间',
+      render: (record) => {
+        return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
+    },
+    {
+      title: '流程状态',
+      // dataIndex: 'status',
+      render: (record) => {
+        switch (record.audit_status) {
+          case 0: return '审核中'
+          case 1: return '通过'
+          case 2: return '拒绝'
+          case 3: return '终审通过'
+        }
+      },
+      width: '20%'
+    },
+    {
+      title: '操作',
+      render: (text, record) => (
+        <Fragment>
+          <>
+            <a
+              style={{ color: '#4096ff' }}
+              onClick={() => {
+                navigate(`/profile/${record.id}`);
+              }}
+            >
+              申请
+            </a>
+          </>
+        </Fragment>
+      ),
+      width: '10%',
+    },
+  ];
+  const agreementColumns = [
+    {
+      title: '标题',
+      dataIndex: 'table_name',
+      width: '30%',
+    },
+    {
+      title: '摘要',
+      dataIndex: 'table_desc',
+      render: (descList) => {
+        return (
+          <ul>
+            {descList?.map((item) => (
+              <li>{item}</li>
+            ))}
+          </ul>
+        );
+      },
+    },
+    {
+      title: '发起人',
+      dataIndex: 'CName',
+      width: '20%',
+    },
+    {
+      title: '发起时间',
+      render: (record) => {
+        return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
+    },
+    {
+      title: '流程状态',
+      dataIndex: 'statusText',
+      // render: (record) => {
+      //   switch (record.audit_status) {
+      //     case 0: return '审核中'
+      //     case 1: return '通过'
+      //     case 2: return '拒绝'
+      //     case 3: return '终审通过'
+      //   }
+      // },
+      // width: '20%'
+    },
+    {
+      title: '操作',
+      render: (text, record) => (
+        <Fragment>
+          <>
+            <a
+              style={{ color: '#4096ff' }}
+              onClick={() => {
+                navigate(`/profile/${record.id}`);
+              }}
+            >
+              申请
+            </a>
+          </>
+        </Fragment>
+      ),
+      width: '10%',
+    },
+  ];
+  const renderPage = (activeKey) => {
+    if (activeKey == '1')
+      return (
+        <>
+          {' '}
+          <Form
+            name="basic"
+            // labelCol={{ span: 0 }}
+            // wrapperCol={{ span: 24 }}
+            onFinish={handleApplySubmit}
+            form={applyFormRef}
+          >
+            <div style={{ display: 'flex' }}>
+              {/* <Form.Item name="range-picker" label="申请时间:">
+                <RangePicker />
+              </Form.Item> */}
+              <Form.Item name="audit_status" label="状态:" initialValue="">
+                <Select
+                  style={{ width: 120 }}
+                  options={[
+                    { value: '', label: '全部' },
+                    { value: '0', label: '审核中' },
+                    { value: '1', label: '通过' },
+                    { value: '2', label: '拒绝' },
+                    { value: '3', label: '终审通过' },
+                  ]}
+                />
+              </Form.Item>
+              <Form.Item>
+                <Button
+                  type="primary"
+                  htmlType="submit"
+                  style={{ marginLeft: 10 }}
+                >
+                  查询
+                </Button>
+              </Form.Item>
+            </div>
+          </Form>
+          <Table
+            rowKey='id'
+            columns={columns}
+            dataSource={applyData}
+            loading={OAApplyLoading}
+            pagination={OAApplyData?.pagination}
+            onChange={handleApplyPaginationChange}
+          />
+        </>
+      );
+    else if (activeKey == '2')
+      return (
+        <>
+          {' '}
+          <Form
+            name="basic"
+            // labelCol={{ span: 0 }}
+            // wrapperCol={{ span: 24 }}
+            // onFinish={handleApproveSubmit}
+            ref={approveFormRef}
+          >
+            {/* <div style={{ display: 'flex' }}>
+              <Form.Item name="range-picker" label="审批时间:">
+                <RangePicker />
+              </Form.Item>
+              <Form.Item name="audit_status" label="状态:" initialValue="">
+                <Select
+                  style={{ width: 120 }}
+                  options={[
+                    { value: '', label: '全部' },
+                    { value: '0', label: '审核中' },
+                    { value: '1', label: '通过' },
+                    { value: '2', label: '拒绝' },
+                    { value: '3', label: '终审通过' },
+                  ]}
+                />
+              </Form.Item>
+              <Form.Item>
+                <Button
+                  type="primary"
+                  htmlType="submit"
+                  style={{ marginLeft: 10 }}
+                >
+                  查询
+                </Button>
+              </Form.Item>
+            </div> */}
+          </Form>
+          <Table
+            columns={agreementColumns}
+            dataSource={conApplyData?.data}
+            loading={conApplyLoading}
+            pagination={conApplyData?.pagination}
+            onChange={handleProfilePaginationChange}
+          />
+        </>
+      );
+  };
+  return (
+    <PageContainer
+      header={{
+        title: '我的申请',
+      }}
+      tabList={[
+        {
+          tab: `OA审批(${OAApplyData?.pagination?.total || 0})`,
+          key: '1',
+        },
+        {
+          tab: `合同管理(${conApplyData?.pagination?.total || 0})`,
+          key: '2',
+        },
+      ]}
+      onTabChange={onTabChange}
+    >
+      <div>{renderPage(tabActive)}</div>
+      <ContractModal
+        detail={detail}
+        type={Type.check}
+        // projectList={projectData?.list}
+        visible={conVisible}
+        handleOk={(data) =>
+          detail.status == Status.Checking ? runCheck(data) : null
+        }
+        handleCancel={() => setConVisible(false)}
+      />
+    </PageContainer>
+  );
+}
+export default Apply;

+ 359 - 0
src/pages/Profile/approve.js

@@ -0,0 +1,359 @@
+import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
+import { useNavigate } from 'umi';
+import {
+  Card,
+  Table,
+  Empty,
+  Button,
+  Modal,
+  message,
+  Form,
+  DatePicker,
+  Row,
+  Col,
+  Select,
+} from 'antd';
+import { PageContainer } from '@ant-design/pro-components';
+const { RangePicker } = DatePicker;
+import { useRequest, useModel } from '@umijs/max';
+import { queryProfileList, queryApplyList } from '@/services/boom';
+import dayjs from 'dayjs';
+import { queryContractCheck, queryGetContractList } from '@/services/contract';
+import ContractModal, {
+  Status,
+  StatusText,
+  Type,
+} from '../ContractManager/component/Modal';
+const TYPE = {
+  Contract: 1,
+  OA: 2,
+};
+function Approve(props) {
+  const { user } = useModel('userInfo');
+  const [tabActive, setTabActive] = useState('1');
+  const [detail, setDetail] = useState({});
+  const [conVisible, setConVisible] = useState(false);
+  const approveFormRef = useRef();
+  const applyFormRef = useRef();
+  let navigate = useNavigate();
+  const contractResult = (res) => {
+    let data = res.data?.list?.map((item) => {
+      return {
+        ...item,
+        table_name: `${user.CName}提交的合同审批`,
+        table_desc: [
+          `合同名称:${item.name}`,
+          `合同编号:${item.code}`,
+          `合同金额:${item.amount}万元`,
+        ],
+        CName: user.CName,
+        create_time: item.cancel_on || item.created_on,
+        type: TYPE.Contract,
+        statusText: StatusText[item.status],
+        showBtn:
+          item.status == Status.Checking || item.status == Status.CalChecking,
+        // key: `${TYPE.Contract}_${item.id}`,
+      };
+    });
+    return { data, pagination: res.data?.pagination }
+  };
+  //OA我的审批和待审批列表
+  const {
+    data: OAAuditData,
+    run: OAAuditRun,
+    loading: OAAuditLoading,
+  } = useRequest(queryProfileList, {
+    formatResult: (res) => {
+      return {
+        data: res.data?.list?.map((item) => {
+          return {
+            ...item,
+            CName: item.AuthorInfo.CName,
+            table_desc: [item.table_desc],
+            statusText: item.status,
+            // key: `${TYPE.Contract}_${item.id}`,
+            showBtn: true,
+            type: TYPE.OA,
+          };
+        }),
+        pagination: res.data?.pagination
+      }
+    },
+  });
+  //合同 我的待审批列表
+  const {
+    data: conAuditData,
+    run: conAuditRun,
+    loading: conAduitLoading,
+  } = useRequest((data) => queryGetContractList(data), {
+    // manual: true,
+    formatResult: contractResult,
+  });
+  const applyData = useMemo(() => {
+    let result = [];
+    if (OAAuditData?.data && OAAuditData?.data.length > 0) result = [...OAAuditData?.data];
+    return result;
+  }, [OAAuditData]);
+  const onTabChange = (activeKey) => {
+    if (activeKey == '1') {
+      OAAuditRun({ current: 1, page_size: 10 });
+    } else {
+      if (user?.Permission['menu-001-audit']) conAuditRun({ status: 1, currentPage: 1, page_size: 10 });
+    }
+    setTabActive(activeKey);
+  };
+  const handleApplySubmit = (values) => {
+    console.log(values);
+    OAApplyRun(values);
+  };
+  const handleProfilePaginationChange = (pagination) => {
+    conAuditRun({
+      status: user?.Permission['menu-001-audit'] ? 1 : undefined,
+      currentPage: pagination.current,
+      page_size: 10,
+    });
+  };
+  const handleApplyPaginationChange = (pagination) => {
+    OAAuditRun({
+      currentPage: pagination.current,
+      pageSize: pagination.pageSize,
+    });
+  };
+  const columns = [
+    {
+      title: '标题',
+      dataIndex: 'table_name',
+      width: '30%',
+    },
+    {
+      title: '摘要',
+      dataIndex: 'table_desc',
+      render: (descList) => {
+        return (
+          <ul>
+            {descList?.map((item) => (
+              <li>{item}</li>
+            ))}
+          </ul>
+        );
+      },
+    },
+    {
+      title: '发起人',
+      dataIndex: 'CName',
+      width: '20%',
+    },
+    {
+      title: '发起时间',
+      render: (record) => {
+        return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
+    },
+    {
+      title: '流程状态',
+      dataIndex: 'status',
+      // render: (record) => {
+      //   switch (record.audit_status) {
+      //     case 0: return '审核中'
+      //     case 1: return '通过'
+      //     case 2: return '拒绝'
+      //     case 3: return '终审通过'
+      //   }
+      // },
+      // width: '20%'
+    },
+    {
+      title: '操作',
+      render: (text, record) => (
+        <Fragment>
+          <>
+            <a
+              style={{ color: '#4096ff' }}
+              onClick={() => {
+                navigate(`/profile/${record.id}`);
+              }}
+            >
+              申请
+            </a>
+          </>
+        </Fragment>
+      ),
+      width: '10%',
+    },
+  ];
+  const agreementColumns = [
+    {
+      title: '标题',
+      dataIndex: 'table_name',
+    },
+    {
+      title: '摘要',
+      dataIndex: 'table_desc',
+      render: (descList) => {
+        return (
+          <ul>
+            {descList?.map((item) => (
+              <li>{item}</li>
+            ))}
+          </ul>
+        );
+      },
+    },
+    {
+      title: '发起人',
+      dataIndex: 'CName',
+    },
+    {
+      title: '发起时间',
+      render: (record) => {
+        return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+    },
+    {
+      title: '流程状态',
+      dataIndex: 'statusText',
+    },
+    {
+      title: '操作',
+      dataIndex: 'showBtn',
+      render: (text, record) => (
+        <>
+          {text ? (
+            <a
+              style={{ color: '#4096ff' }}
+              onClick={() => {
+                if (record.type == TYPE.Contract) {
+                  setDetail(record);
+                  setConVisible(true);
+                } else {
+                  navigate(`/oa/detail/${record.flow_id}/${record.id}`);
+                }
+              }}
+            >
+              审批
+            </a>
+          ) : (
+            <div>已审批</div>
+          )}
+        </>
+      ),
+    },
+  ];
+  const renderPage = (activeKey) => {
+    if (activeKey == '1')
+      return (
+        <>
+          {' '}
+          <Form
+            name="basic"
+            // labelCol={{ span: 0 }}
+            // wrapperCol={{ span: 24 }}
+            onFinish={handleApplySubmit}
+            ref={applyFormRef}
+          >
+            {/* <div style={{ display: 'flex' }}>
+              <Form.Item name="range-picker" label="申请时间:">
+                <RangePicker />
+              </Form.Item>
+              <Form.Item>
+                <Button
+                  type="primary"
+                  htmlType="submit"
+                  style={{ marginLeft: 10 }}
+                >
+                  查询
+                </Button>
+              </Form.Item>
+            </div> */}
+          </Form>
+          <Table
+            rowKey='id'
+            columns={columns}
+            dataSource={applyData}
+            loading={OAAuditLoading}
+            pagination={OAAuditData?.pagination}
+            onChange={handleApplyPaginationChange}
+          />
+        </>
+      );
+    else if (activeKey == '2')
+      return (
+        <>
+          {' '}
+          <Form
+            name="basic"
+            // labelCol={{ span: 0 }}
+            // wrapperCol={{ span: 24 }}
+            // onFinish={handleApproveSubmit}
+            ref={approveFormRef}
+          >
+            {/* <div style={{ display: 'flex' }}>
+              <Form.Item name="range-picker" label="审批时间:">
+                <RangePicker />
+              </Form.Item>
+              <Form.Item name="audit_status" label="状态:" initialValue="">
+                <Select
+                  style={{ width: 120 }}
+                  options={[
+                    { value: '', label: '全部' },
+                    { value: '0', label: '审核中' },
+                    { value: '1', label: '通过' },
+                    { value: '2', label: '拒绝' },
+                    { value: '3', label: '终审通过' },
+                  ]}
+                />
+              </Form.Item>
+              <Form.Item>
+                <Button
+                  type="primary"
+                  htmlType="submit"
+                  style={{ marginLeft: 10 }}
+                >
+                  查询
+                </Button>
+              </Form.Item>
+            </div> */}
+          </Form>
+          <Table
+            columns={agreementColumns}
+            dataSource={conAuditData?.data}
+            loading={conAduitLoading}
+            pagination={conAuditData?.pagination}
+            onChange={handleProfilePaginationChange}
+          />
+        </>
+      );
+  };
+  return (
+    <PageContainer
+      header={{
+        title: '我的审批',
+      }}
+      tabList={[
+        {
+          tab: `OA审批(${OAAuditData?.pagination?.total || 0})`,
+          key: '1',
+        },
+        {
+          tab: `合同管理(${conAuditData?.pagination?.total || 0})`,
+          key: '2',
+        },
+      ]}
+      onTabChange={onTabChange}
+    >
+      <div>{renderPage(tabActive)}</div>
+      <ContractModal
+        detail={detail}
+        type={Type.check}
+        // projectList={projectData?.list}
+        visible={conVisible}
+        handleOk={(data) =>
+          detail.status == Status.Checking ? runCheck(data) : null
+        }
+        handleCancel={() => setConVisible(false)}
+      />
+    </PageContainer>
+  );
+}
+export default Approve;

+ 255 - 0
src/pages/Profile/approved.js

@@ -0,0 +1,255 @@
+import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
+import { useNavigate } from 'umi';
+import {
+  Card,
+  Table,
+  Empty,
+  Button,
+  Modal,
+  message,
+  Form,
+  DatePicker,
+  Row,
+  Col,
+  Select,
+} from 'antd';
+import { PageContainer } from '@ant-design/pro-components';
+const { RangePicker } = DatePicker;
+import { useRequest, useModel } from '@umijs/max';
+import { queryProfileList, queryApplyList } from '@/services/boom';
+import dayjs from 'dayjs';
+import { queryApprovedList } from '@/services/contract';
+const TYPE = {
+  Contract: 1,
+  OA: 2,
+};
+function Approved(props) {
+  const { user } = useModel('userInfo');
+  // const [tabActive, setTabActive] = useState('1');
+  // const [detail, setDetail] = useState({});
+  const [conVisible, setConVisible] = useState(false);
+  const approveFormRef = useRef();
+  const applyFormRef = useRef();
+  let navigate = useNavigate();
+  const contractResult = (res) => {
+    let data = res.data?.list?.map((item) => {
+      return {
+        ...item,
+        table_name: `${user.CName}提交的合同审批`,
+        table_desc: [
+          `合同名称:${item.name}`,
+          `合同编号:${item.code}`,
+          `合同金额:${item.amount}万元`,
+        ],
+        CName: user.CName,
+        create_time: item.cancel_on || item.created_on,
+        type: TYPE.Contract,
+        statusText: StatusText[item.status],
+        showBtn:
+          item.status == Status.Checking || item.status == Status.CalChecking,
+        // key: `${TYPE.Contract}_${item.id}`,
+      };
+    });
+    return { data, pagination: res.data?.pagination }
+  };
+  //OA我审批过的列表
+  const {
+    data: conAuditedData,
+    run: conAuditedRun,
+    loading: conAduitedLoading,
+  } = useRequest((data) => queryApprovedList(data), {
+    defaultParams: [{ currentPage: 1, pageSize: 10 }]
+    // formatResult: contractResult,
+  });
+  // //合同 我审批过的列表
+  // const {
+  //   data: conAuditData,
+  //   run: conAuditRun,
+  //   loading: conAduitLoading,
+  // } = useRequest((data) => queryGetContractList(data), {
+  //   manual: true,
+  //   formatResult: contractResult,
+  // });0
+  // const applyData = useMemo(() => {
+  //   let result = [];
+  //   if (conAuditedData?.data && conAuditedData?.data.length > 0) result = [...conAuditedData?.data];
+  //   return result;
+  // }, [conAuditedData]);
+  // const onTabChange = (activeKey) => {
+  //   if (activeKey == '1') {
+  //     conAuditedRun();
+  //   } else {
+
+  //   }
+  //   setTabActive(activeKey);
+  // };
+  const handleApplySubmit = (values) => {
+    console.log(values);
+    OAApplyRun(values);
+  };
+  const handleApplyPaginationChange = (pagination) => {
+    conAuditedRun({
+      currentPage: pagination.current,
+      pageSize: 10,
+    });
+  };
+  const columns = [
+    {
+      title: '标题',
+      dataIndex: 'name',
+      width: '30%',
+    },
+    // {
+    //   title: '摘要',
+    //   dataIndex: 'table_desc',
+    //   render: (descList) => {
+    //     return (
+    //       <ul>
+    //         {descList?.map((item) => (
+    //           <li>{item}</li>
+    //         ))}
+    //       </ul>
+    //     );
+    //   },
+    // },
+    // {
+    //   title: '发起人',
+    //   dataIndex: 'CName',
+    //   width: '20%',
+    // },
+    {
+      title: '发起时间',
+      render: (record) => {
+        return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
+    },
+    {
+      title: '我审批的时间',
+      render: (record) => {
+        return dayjs(record.audit_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
+    },
+    {
+      title: '状态',
+      // dataIndex: 'status',
+      render: (record) => {
+        switch (record.audit_status) {
+          case 0: return '审核中'
+          case 1: return '通过'
+          case 2: return '拒绝'
+          case 3: return '终审通过'
+        }
+      },
+      width: '20%'
+    },
+  ];
+
+  const renderPage = () => {
+    // if (activeKey == '1')
+    return (
+      <>
+        {' '}
+        <Form
+          name="basic"
+          // labelCol={{ span: 0 }}
+          // wrapperCol={{ span: 24 }}
+          onFinish={handleApplySubmit}
+          ref={applyFormRef}
+        >
+          {/* <div style={{ display: 'flex' }}>
+            <Form.Item name="range-picker" label="申请时间:">
+              <RangePicker />
+            </Form.Item>
+            <Form.Item>
+              <Button
+                type="primary"
+                htmlType="submit"
+                style={{ marginLeft: 10 }}
+              >
+                查询
+              </Button>
+            </Form.Item>
+          </div> */}
+        </Form>
+        <Table
+          rowKey='id'
+          columns={columns}
+          dataSource={conAuditedData?.list}
+          loading={conAduitedLoading}
+          pagination={conAuditedData?.pagination}
+          onChange={handleApplyPaginationChange}
+        />
+      </>
+    );
+    // else if (activeKey == '2')
+    //   return (
+    //     <>
+    //       {' '}
+    //       <Form
+    //         name="basic"
+    //         // labelCol={{ span: 0 }}
+    //         // wrapperCol={{ span: 24 }}
+    //         // onFinish={handleApproveSubmit}
+    //         ref={approveFormRef}
+    //       >
+    //         <div style={{ display: 'flex' }}>
+    //           <Form.Item name="range-picker" label="审批时间:">
+    //             <RangePicker />
+    //           </Form.Item>
+    //           <Form.Item name="audit_status" label="状态:" initialValue="">
+    //             <Select
+    //               style={{ width: 120 }}
+    //               options={[
+    //                 { value: '', label: '全部' },
+    //                 { value: '0', label: '审核中' },
+    //                 { value: '1', label: '通过' },
+    //                 { value: '2', label: '拒绝' },
+    //                 { value: '3', label: '终审通过' },
+    //               ]}
+    //             />
+    //           </Form.Item>
+    //           <Form.Item>
+    //             <Button
+    //               type="primary"
+    //               htmlType="submit"
+    //               style={{ marginLeft: 10 }}
+    //             >
+    //               查询
+    //             </Button>
+    //           </Form.Item>
+    //         </div>
+    //       </Form>
+    //       <Table
+    //         columns={agreementColumns}
+    //         dataSource={conAuditData?.data}
+    //         loading={conAduitLoading}
+    //         pagination={conAuditData?.pagination}
+    //       // onChange={handleProfilePaginationChange}
+    //       />
+    //     </>
+    //   );
+  };
+  return (
+    <PageContainer
+      header={{
+        title: `已审批(${conAuditedData?.pagination?.total || 0})`,
+      }}
+    // tabList={[
+    //   {
+    //     tab: 'OA审批',
+    //     key: '1',
+    //   },
+    //   {
+    //     tab: '合同管理',
+    //     key: '2',
+    //   },
+    // ]}
+    // onTabChange={onTabChange}
+    >
+      <div>{renderPage()}</div>
+    </PageContainer>
+  );
+}
+export default Approved;

+ 3 - 2
src/services/boom.js

@@ -205,8 +205,8 @@ export async function advanceSubmitNextNode(params) {
   });
 }
 
-export async function queryProfileList() {
-  let profileList = await request(`/api/v1/oa/audit/list`, { method: 'GET' });
+export async function queryProfileList(params) {
+  let profileList = await request(`/api/v1/oa/audit/list`, { params });
   let auditList = await request(`/api/v1/purchase/flow/info?flow_type=1`);
   profileList?.data?.list.map((item) => {
     var audit = auditList?.data?.find(
@@ -224,6 +224,7 @@ export async function queryProfileList() {
 export async function queryApplyList(params) {
   return request(`/api/v1/oa/audit/my/list`, { params });
 }
+
 // /**
 //   project_id
 //   version_id	大版本id

+ 7 - 0
src/services/contract.js

@@ -52,3 +52,10 @@ export const queryContractCancel = async (data) => {
     data,
   });
 };
+
+//OA已审核过的
+export const queryApprovedList = async (data) => {
+  return await request('/api/v1/oa/audited/my/list', {
+    params: data,
+  });
+};

+ 48 - 0
src/services/file.js

@@ -0,0 +1,48 @@
+import { request } from 'umi';
+
+export const queryDirList = async (data) => {
+  return await request('/api/archive/v1/dir/list', {
+    method: 'POST',
+    data,
+  });
+};
+export const queryFileList = async (data) => {
+  return await request('/api/archive/v1/file/list', {
+    method: 'POST',
+    data,
+  });
+};
+// 获取OA文件列表(合同文件&投标文件)
+// params: page_size, current_page, classify_id = 42/43
+export const queryOAFile = async (data) => {
+  return await request(`/api/v1/oa/file/list`, { params: data });
+};
+export const queryDirCreate = async (data) => {
+  return await request('/api/archive/v1/dir/create', {
+    method: 'POST',
+    data,
+  });
+};
+
+export const querySetPermit = async (data) => {
+  return await request('/api/archive/v1/set/permit', {
+    method: 'POST',
+    data,
+  });
+};
+
+export const queryFileUpload = async (data) => {
+  return await request('/api/archive/v1/file/upload', {
+    method: 'POST',
+    data,
+    headers: {'content-type':'mutipart/form-data'}
+  });
+};
+
+export const queryFileDownload = async (data) => {
+  return await request('/api/archive/v1/file/download', {
+    method: 'GET',
+    params: data,
+    responseType: 'blob',
+  });
+};