Browse Source

refactor: 执行者事项权限表单项调整

lanjianrong 2 years ago
parent
commit
bfa1b07d0f

+ 1 - 1
src/pages/Business/Process/components/MemberItem.tsx

@@ -8,7 +8,7 @@ import { useState } from 'react'
 
 enum AuditType {
   ACCOUNT = 'account',
-  INSTITUTION = 'institution',
+  INSTITUTION = 'institutionRole',
   ROLE = 'role'
 }
 

+ 6 - 5
src/pages/Business/Process/hooks/useScripts.tsx

@@ -52,7 +52,6 @@ function transformMatterTree(tree: API.MatterTreeItem[]): TreeNodeProps[] {
     const newItem: TreeNodeProps = { key: item.ID, title: item.name, value: item.ID, isLeaf: true }
     if (item.children) {
       newItem.isLeaf = false
-      newItem.disabled = true
       newItem.children = transformMatterTree(item.children)
     }
     return newItem
@@ -80,12 +79,9 @@ export default function useScripts(modal: ModalAction, subject: string) {
 
   const addOrEdit = async (mode: 'add' | 'edit', initialValues?: API.ExecutorItem) => {
     const [gatherID, businessType] = subject.split('_')
-    console.log(subject)
-
     const { code = -1, data } = await queryMatterTree({ gatherID, businessType, pageSize: 214000 })
     if (code === consts.RET_CODE.SUCCESS) {
       const matterTree = transformMatterTree(data || [])
-      console.log(matterTree)
       const text = mode === 'add' ? '新增执行者' : '编辑执行者'
       modal.open({
         title: text,
@@ -128,7 +124,12 @@ export default function useScripts(modal: ModalAction, subject: string) {
               label="事项权限"
               placeholder="请选择"
               rules={[{ required: true, message: '请选择' }]}
-              fieldProps={{ multiple: true }}
+              fieldProps={{
+                multiple: true,
+                treeCheckable: true,
+                showCheckedStrategy: 'SHOW_CHILD',
+                maxTagCount: 'responsive'
+              }}
               request={() => matterTree}
             />
           </ProForm>