Sfoglia il codice sorgente

feat: 流程设置和限制登录的优化

outaozhen 3 anni fa
parent
commit
797fac55e9

+ 1 - 1
config/routes.ts

@@ -120,7 +120,7 @@
       {
         path: 'process',
         name: 'process',
-        component: './Business/ProcessUser'
+        component: './Business/Process'
       }
     ]
   },

src/pages/Business/ProcessUser/components/LeftMenu/index.tsx → src/pages/Business/Process/components/LeftMenu/index.tsx


+ 16 - 28
src/pages/Business/ProcessUser/index.tsx

@@ -35,33 +35,22 @@ export enum LeftMenuEnum {
 
 export const menuOptions = [{ label: '预算业务审批', value: LeftMenuEnum.BUDGET }]
 
-export enum InstitutionEnum {
-  RECEIVER = 'receiver', // 收件员
-  FGLEADER = 'fgLeader', // 分管领导
-  ZXLEADER = 'zxLeader', // 中心领导
-  POST = 'post', // 发文
-  ARCHIVE = 'archive' // 归档
-}
-
-type ProcessUserProps = {
-  name: Nullable<string>
-  organizationListNew: API.OrganizationalStructureListItem[]
+type iProcessProps = {
+  activeKey: LeftMenuEnum
   approvalAccountDetail: API.ApprovalAccountDetail[]
 }
 
-const ProcessUser = props => {
+const Process: React.FC = props => {
   const { institutionList } = props
   const dispatch = useDispatch()
-  const [state, setState] = useState<ProcessUserProps>({
+  const [state, setState] = useState<iProcessProps>({
     activeKey: LeftMenuEnum.BUDGET,
-    name: null,
-    organizationListNew: [],
-    approvalAccountDetail: []
+    approvalAccountDetail: null
   })
 
-  const { run: tryApprovalAccountDetail } = useRequest(queryApprovalAccountDetail, {
-    manual: true,
-    onSuccess: (result: API.ApprovalAccountDetail[]) => {
+  const {} = useRequest(queryApprovalAccountDetail, {
+    // manual: true,
+    onSuccess: (result: API.ApprovalAccountDetail) => {
       setState({
         ...state,
         approvalAccountDetail:
@@ -104,7 +93,7 @@ const ProcessUser = props => {
         type: 'business/queryInstitution'
       })
     }
-    tryApprovalAccountDetail()
+    // tryApprovalAccountDetail()
   }, [])
 
   const form = createForm({
@@ -125,7 +114,7 @@ const ProcessUser = props => {
           const { code = -1, data } = await queryOrganizationalMembersList({ institutionID })
           if (code === consts.RET_CODE.SUCCESS) {
             form.setFieldState('receiver.receiverAccountIDs', field => {
-              field.dataSource = renderTreeNodes(data).filter(item => item.children?.length)
+              field.dataSource = renderTreeNodes(data)
             })
           }
         }
@@ -143,7 +132,7 @@ const ProcessUser = props => {
           const { code = -1, data } = await queryOrganizationalMembersList({ institutionID })
           if (code === consts.RET_CODE.SUCCESS) {
             form.setFieldState('fgLeader.fgLeaderAccountIDs', field => {
-              field.dataSource = renderTreeNodes(data).filter(item => item.children?.length)
+              field.dataSource = renderTreeNodes(data)
             })
           }
         }
@@ -158,7 +147,7 @@ const ProcessUser = props => {
           const { code = -1, data } = await queryOrganizationalMembersList({ institutionID })
           if (code === consts.RET_CODE.SUCCESS) {
             form.setFieldState('zxLeader.zxLeaderAccountIDs', field => {
-              field.dataSource = renderTreeNodes(data).filter(item => item.children?.length)
+              field.dataSource = renderTreeNodes(data)
             })
           }
         }
@@ -173,7 +162,7 @@ const ProcessUser = props => {
           const { code = -1, data } = await queryOrganizationalMembersList({ institutionID })
           if (code === consts.RET_CODE.SUCCESS) {
             form.setFieldState('post.postAccountIDs', field => {
-              field.dataSource = renderTreeNodes(data).filter(item => item.children?.length)
+              field.dataSource = renderTreeNodes(data)
             })
           }
         }
@@ -188,7 +177,7 @@ const ProcessUser = props => {
           const { code = -1, data } = await queryOrganizationalMembersList({ institutionID })
           if (code === consts.RET_CODE.SUCCESS) {
             form.setFieldState('archive.archiveAccountIDs', field => {
-              field.dataSource = renderTreeNodes(data).filter(item => item.children?.length)
+              field.dataSource = renderTreeNodes(data)
             })
           }
         }
@@ -251,6 +240,5 @@ const ProcessUser = props => {
 }
 
 export default connect(({ business }) => ({
-  institutionList: business.institutionList,
-  organizationList: business.organizationalMembersList
-}))(ProcessUser)
+  institutionList: business.institutionList
+}))(Process)

src/pages/Business/ProcessUser/schema.ts → src/pages/Business/Process/schema.ts


+ 10 - 5
src/pages/Institutions/Restrict/index.tsx

@@ -4,14 +4,20 @@ import consts from '@/utils/consts'
 import { ModalType } from '@/utils/enum'
 import { PageContainer } from '@ant-design/pro-layout'
 import ProTable from '@ant-design/pro-table'
+import type { ProColumnType } from '@ant-design/pro-table'
 import { useRequest } from '@umijs/max'
 import { Modal } from 'antd'
 import React, { useRef, useState } from 'react'
 import StaffDetail from '../Staff/components/StaffDetail'
 
-const Restrict = () => {
+type iRestrictProps = {
+  title: Nullable<string>
+  visible: boolean
+  currentModalType: ModalType
+}
+const Restrict: React.FC = () => {
   const tRef = useRef<ActionType>(null)
-  const [state, setState] = useState({
+  const [state, setState] = useState<iRestrictProps>({
     params: {
       search: null,
       accountType: '1',
@@ -27,8 +33,7 @@ const Restrict = () => {
     manual: true,
     onSuccess: () => tRef.current?.reload()
   })
-
-  const columns: ProColumnType = [
+  const columns: ProColumnType<API.InstitutionListParams>[] = [
     {
       dataIndex: 'account',
       key: 'account',
@@ -124,7 +129,7 @@ const Restrict = () => {
   ]
   return (
     <PageContainer title={false}>
-      <ProTable
+      <ProTable<API.InstitutionListItem>
         rowKey="ID"
         actionRef={tRef}
         params={state.params}