Преглед изворни кода

调整条文管理树结构展开逻辑+更改单位筛选方式

code4eat пре 3 година
родитељ
комит
ab13404a67

+ 2 - 2
config/proxy.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-05 17:06:44
+ * @LastEditTime: 2022-03-04 18:32:02
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/config/proxy.ts
@@ -20,7 +20,7 @@
 export default { 
   dev: {
     '/api': {
-      target: 'http://112.124.59.133:8083/',
+      target: 'http://118.31.245.65:8083/',
       changeOrigin: true,
       pathRewrite: { '^/api': '' },
     },

+ 20 - 23
src/components/MccsFileTree/components/DirectoryTree/index.tsx

@@ -1,13 +1,13 @@
 /*
  * @Author: your name
  * @Date: 2021-09-07 16:40:33
- * @LastEditTime: 2021-12-31 16:47:41
+ * @LastEditTime: 2022-03-04 18:35:37
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/components/directoryTree.tsx
  */
 import React, { useState,useEffect } from 'react'
-import type { ReactNode } from 'react';
+import { ReactNode } from 'react';
 import './index.less'
 
 
@@ -15,21 +15,21 @@ import './index.less'
 
 type DirectoryTreeProps = {
 
-    defaultCollapsed?: boolean,
-    nodeLabel: ReactNode,
-    className?: string,
-    itemClassName?: string,
-    childrenClassName?: string,
-    treeViewClassName?: string,
-    onClick?: (args: object) => void,
+    defaultCollapsed?:boolean,
+    nodeLabel:ReactNode,
+    className?:string,
+    itemClassName?:string,
+    childrenClassName?:string,
+    treeViewClassName?:string,
+    onClick?:(args:object)=>void,
     [propName: string]: any
 }
 
 type childTree = {
     title: string,
     id: string,
-    isLeaf: boolean,
-    code: string,
+    isLeaf:boolean,
+    code:string,
     children?: childTree[],
     [propName: string]: any;
 }
@@ -52,7 +52,7 @@ const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => {
         ...rest
     } = props;
     
-    // 是否展开   true合上反之展开
+    //是否展开   true合上反之展开
     const [collapsed, setCollapsed] = useState(defaultCollapsed);
     
 
@@ -66,7 +66,7 @@ const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => {
     }
 
 
-    const handleClick = (args: childTree)=>{
+    const handleClick = (args:childTree)=>{
         setcurrentActivedIndex(args.id);
         setCollapsed(!collapsed)
         if (rest.onClick) {
@@ -76,20 +76,17 @@ const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => {
     
     const arrow = (
         <div
-            className={`${className  } ${  arrowClassName}`}
+            className={className + ' ' + arrowClassName}
         />
     );
     
-    // useEffect(() => {
-    //     //当文件夹结点设置默认展开项时触发
-    //     if(props.currentActivedIndex==props.id){
-    //         const {title,id,isLeaf=false,code} = props;
-    //         handleClick({title,id,isLeaf,code});
-    //     }
-    // }, [])
+    useEffect(() => {
+        //当文件夹结点设置默认展开项时触发
+  
+    }, [])
 
     return (
-        <div className={`treeView ${  treeViewClassName}`}>
+        <div className={'treeView ' + treeViewClassName}>
             <div className={props.currentActivedIndex==props.id?'treeViewItem actived':'treeViewItem'} onClick={()=>handleClick({
                   title:props.title,
                   id:props.id,
@@ -106,7 +103,7 @@ const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => {
                  */}
                 { props.currentActivedIndex==props.id&&action}
             </div>
-            <div className={`${containerClassName  } ${  childrenClassName}`}>
+            <div className={containerClassName + ' ' + childrenClassName}>
                 {collapsed ? null : children}
             </div>
         </div>

+ 25 - 26
src/components/MccsFileTree/index.tsx

@@ -1,15 +1,15 @@
 /*
  * @Author: your name
  * @Date: 2021-09-06 10:28:12
- * @LastEditTime: 2021-12-31 16:47:55
+ * @LastEditTime: 2022-03-04 18:34:17
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/index.tsx
  */
 
 
-import type { ReactNode, MouseEvent } from 'react';
-import React, { useEffect, useState } from 'react'
+
+import React, { ReactNode, useEffect, useState, MouseEvent } from 'react'
 import { Input, Spin, Image, Popconfirm } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import DirectoryTree from './components/DirectoryTree';
@@ -23,51 +23,51 @@ import FileIcon from './images/file.png';
 // const { DirectoryTree } = Tree;
 const { Search } = Input;
 
-// 树形文件组件
+//树形文件组件
 
 enum Types { 'add', 'del', 'edit', 'search' };
 
 type TypeVals = keyof typeof Types;
 
 type MccsFileTreeProps = {
-  onSelectHandle?: (data: MccsFileTree.childTree) => void, // 选中回调
-  actionHandle?: ({ type, data }: { type: string, data: MccsFileTree.childTree }) => void, // 操作回调,包括编辑/删除/新增/搜索
+  onSelectHandle?: (data: MccsFileTree.childTree) => void, //选中回调
+  actionHandle?: ({ type, data }: { type: string, data: MccsFileTree.childTree }) => void, //操作回调,包括编辑/删除/新增/搜索
   searchHandle?: (val: any) => void,
   switcherIcon?: ReactNode,
   treeData: MccsFileTree.childTree[] | [],
-  defaultSelected?: string,  // 传id
+  defaultSelected?: string,  //传id
   formContent?: ReactNode,
   editable?: boolean,
-  renderFilter?: () => ReactNode,// 添加自定义过滤操作
+  renderFilter?: () => ReactNode,//添加自定义过滤操作
 }
 
 const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
   const { treeData, onSelectHandle, actionHandle, defaultSelected, searchHandle, editable, renderFilter } = props;
   const [isLoading, setIsLoading] = useState(true);
-  // 当前选中的
+  //当前选中的
   const [currentActivedIndex, setcurrentActivedIndex] = useState('');
 
   const actionFunc = (event: MouseEvent | undefined, type: TypeVals, data: MccsFileTree.childTree) => {
     event?.stopPropagation();
-    actionHandle && actionHandle({ type, data });
+    actionHandle && actionHandle({ type, data: data });
   }
 
 
-  // 操作
+  //操作
   const Action = (props: MccsFileTree.childTree) => {
     const { isLeaf } = props;
     return (
       <div className='action'>
         {
-          !isLeaf && (  // 非叶子结点才可以新增
+          !isLeaf && (  //非叶子结点才可以新增
             <>
               <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'add', props)} src={AddActionIcon} />
-              <div style={{ width: 5 }} />
+              <div style={{ width: 5 }}></div>
             </>
           )
         }
         <Image width={15} preview={false} onClick={(e) => actionFunc(e, 'edit', props)} src={EditActionIcon} />
-        <div style={{ width: 5 }} />
+        <div style={{ width: 5 }}></div>
         <Popconfirm
           title="是否确定删除?"
           onConfirm={(e) => { actionFunc(e, 'del', props) }}
@@ -80,7 +80,7 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
     )
   }
 
-  // 叶子结点结构
+  //叶子结点结构
   const TreeNode = (nodeProps: MccsFileTree.childTree) => {
     const { title, id, code, ...rest } = nodeProps;
 
@@ -91,20 +91,20 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
       } : () => { setcurrentActivedIndex(id); }}>
         <div style={{ display: 'flex', marginRight: 5, justifyContent: 'center', alignItems: 'center' }} ><Image width={15} preview={false} src={FileIcon} /> </div>
         {/* <div className='treeNodeInner'>{`${code} ${title}`}</div> */}
-        <NodeTextArea className="treeNodeInner" text={`${code} ${title}`} />
+        <NodeTextArea className="treeNodeInner" text={`${code} ${title}`}></NodeTextArea>
 
-        {(currentActivedIndex == id && editable) && <Action {...nodeProps} />  /* 点击展示操作项 */}
+        {(currentActivedIndex == id && editable) && <Action {...nodeProps} />  /*点击展示操作项*/}
       </div>
     )
   }
-  // 递归树形结构
+  //递归树形结构
   const loop = (data: MccsFileTree.childTree, i: number) => {
 
     const { title, children = [], ...restProps } = data;
 
     // const node = <div className="node">{`${restProps.code} ${title}`}</div>;
 
-    const node = <NodeTextArea className="node" text={`${restProps.code} ${title}`} />
+    const node = <NodeTextArea className="node" text={`${restProps.code} ${title}`}></NodeTextArea>
 
     if (data.isLeaf) {
       return <TreeNode key={data.id} currentActivedIndex={currentActivedIndex} setcurrentActivedIndex={setcurrentActivedIndex} title={title} {...restProps} />
@@ -113,15 +113,15 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
     return (
       <DirectoryTree key={data.id} currentActivedIndex={currentActivedIndex} setcurrentActivedIndex={setcurrentActivedIndex}
         nodeLabel={node}  {...data} onClick={() => onSelectHandle ? onSelectHandle(data) : () => { }}
-        action={editable && <Action  {...data} />} defaultCollapsed={true}
+        action={editable && <Action  {...data} />} defaultCollapsed={!(currentActivedIndex==data.id)}
       >
         {
           children.map((item, index) => {
             if (item.isLeaf) {
               return <TreeNode currentActivedIndex={currentActivedIndex} setcurrentActivedIndex={setcurrentActivedIndex} key={index}   {...item} />
-            } 
+            } else {
               return loop(item, index);
-            
+            }
           })
         }
       </DirectoryTree>
@@ -154,9 +154,9 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
   }
 
   useEffect(() => {
-    // 当设置默认激活项时触发
+    //当设置默认激活项时触发
     if (defaultSelected != currentActivedIndex) {
-      setcurrentActivedIndex(defaultSelected || '');
+      setcurrentActivedIndex(defaultSelected ? defaultSelected : '');
       const result = deepGetVal(treeData,'id','children',Number(defaultSelected));
       onSelectHandle&&onSelectHandle(result as MccsFileTree.childTree);
     }
@@ -211,5 +211,4 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
 
 
 
-export default MccsFileTree
-
+export default MccsFileTree

+ 282 - 279
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-01-05 14:29:28
+ * @LastEditTime: 2022-03-04 18:38:25
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -26,7 +26,7 @@ import MccsLightTable from '@/components/MccsLightTable';
 
 import MccsEditableTable from '@/components/MccsEditableTable/index';
 
-import { getCurrentLevelTable, getTaizhangDirectoryTable } from './server';
+import { getCurrentLevelTable, getDepartmentList, getTaizhangDirectoryTable } from './server';
 
 import { getScoreLevelData } from '@/pages/PlatformMana/generalSetting/serve';
 
@@ -39,158 +39,24 @@ import {
 } from '@ant-design/pro-form';
 
 import './index.less';
+import MccsSelect from '@/components/MccsProFormSelect';
 
 
 const { TextArea } = Input;
 const { Option } = Select;
 
 type ArticleManagementProps = {
-    // 组件配置信息
+    //组件配置信息
     columnsFromProps?: {}[],
-    headerConcig?: Record<string, any>, // 配置参考ProPageContainer
+    headerConcig?: { [key: string]: any }, //配置参考ProPageContainer
     isModeTwo?: boolean
 
 }
 
-type SelectedRowsType = Record<string, any>
-
-
-const columns = [
-
-    {
-        key: 'keyword',
-        hideInTable: true,
-        renderFormItem: (item: any, { type }: any, form: any) => {
-
-            if (type === 'form') {
-                return null;
-            }
-            return (
-                <Form.Item name='keyword'>
-                    <ProFormText placeholder='条文/条款' />
-                </Form.Item>
-            )
-        },
-    },
-    {
-        key: 'department',
-        hideInTable: true,
-        renderFormItem: (item: any, { type }: any, form: any) => {
-
-            if (type === 'form') {
-                return null;
-            }
-            return (
-                <Form.Item name='department'>
-                    <ProFormText placeholder='单位' />
-                </Form.Item>
-            )
-        },
-    },
-    {
-        key: 'name',
-        hideInTable: true,
-        renderFormItem: (item: any, { type }: any, form: any) => {
-
-            if (type === 'form') {
-                return null;
-            }
-            return (
-                <Form.Item name='name'>
-                    <ProFormText placeholder='负责人' />
-                </Form.Item>
-            )
-        },
-    },
-    {
-        key: 'selfEvaluation',
-        hideInTable: true,
-        renderFormItem: (item: any, { type }: any, form: any) => {
-
-            if (type === 'form') {
-                return null;
-            }
-            return (
-                <ProFormSelect
-                    name="selfEvaluation"
-                    request={async () => {
-                        const data = await getScoreLevelData();
-                        if (!data) return [];
-                        return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
-                    }}
-                    placeholder="选择自评"
-                    rules={[{ required: false }]}
-                />
-            )
-        },
-    },
-    {
-        key: 'targetEvaluation',
-        hideInTable: true,
-        renderFormItem: (item: any, { type }: any, form: any) => {
-
-            if (type === 'form') {
-                return null;
-            }
-            return (
-                <ProFormSelect
-                    name="targetEvaluation"
-                    request={async () => {
-                        const data = await getScoreLevelData();
-                        if (!data) return [];
-                        return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
-                    }}
-                    placeholder="选择目标"
-                    rules={[{ required: false }]}
-                />
-            )
-        },
-    },
-    {
-        title: '条款',
-        key: 'numStr',
-        dataIndex: 'numStr',
-        hideInSearch: true,
+type SelectedRowsType = {
+    [propsName: string]: any
+}
 
-    },
-    {
-        title: '条文',
-        dataIndex: 'name',
-        hideInSearch: true,
-        width: '35%',
-        ellipsis: true
-    },
-    {
-        title: '负责单位',
-        dataIndex: 'responsibilityDepartmentName',
-        hideInSearch: true,
-    },
-    {
-        title: '负责人',
-        dataIndex: 'responsibilityUserName',
-        hideInSearch: true,
-    },
-    {
-        title: '自评',
-        hideInSearch: true,
-        dataIndex: 'selfEvaluation',
-    },
-    // {
-    //     title: '现场查核',
-    //     hideInSearch: true,
-    //     dataIndex: 'siteEvaluation',
-    // },
-    {
-        title: '目标',
-        dataIndex: 'targetEvaluation',
-        hideInSearch: true,
-    },
-    {
-        title: '系统评分',
-        dataIndex: 'systemEvaluation',
-        hideInSearch: true,
-    },
-]
 
 const MccsLightTableColumns = [
     {
@@ -218,7 +84,7 @@ const MccsLightTableColumns = [
 
 
 
-// 条文管理
+//条文管理
 const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     const { columnsFromProps = [], headerConcig, isModeTwo } = props;
     const { articleManagement } = useModel('allModels');
@@ -232,16 +98,166 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         scoreList,
         getDepartmentRequest,
         departmentManagers,
-        getDepartment,// 获取责任单位
+        getDepartment,//获取责任单位
         ...restModelData
     } = articleManagement;
     const tableRef = useRef<MccsTable.MccsTableRef>();
 
-    const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  // 条文设置表单回显默认值
+    const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
     const [defaultOpened, setDefaultOpened] = useState<string>();
-    const [scrollAreaH,setScrollAreaH] = useState(100);
+    const [scrollAreaH, setScrollAreaH] = useState(100);
     const leafContentRef = useRef<HTMLDivElement>(null);
-  
+    const [departments, setdepartments] = useState<{ label: string; value: string }[]>([]);
+
+    const columns = [
+
+        {
+            key: 'keyword',
+            hideInTable: true,
+            renderFormItem: (item: any, { type }: any, form: any) => {
+
+                if (type === 'form') {
+                    return null;
+                }
+                return (
+                    <Form.Item name='keyword'>
+                        <ProFormText placeholder='条文/条款' />
+                    </Form.Item>
+                )
+            },
+        },
+        {
+            key: 'department',
+            hideInTable: true,
+            renderFormItem: (item: any, { type }: any, form: any) => {
+
+                if (type === 'form') {
+                    return null;
+                }
+
+                return (
+                    <Form.Item name='department'>
+                        <Select
+                            showSearch
+                            placeholder="请选择单位"
+                        >
+                            {
+                                departments.map((item,index)=>{
+                                      return (
+                                        <Option value={item.value} key={index}>{item.label}</Option>
+                                      )
+                                })
+                            }
+                        </Select>
+                    </Form.Item>
+                )
+            },
+        },
+        {
+            key: 'name',
+            hideInTable: true,
+            renderFormItem: (item: any, { type }: any, form: any) => {
+
+                if (type === 'form') {
+                    return null;
+                }
+                return (
+                    <Form.Item name='name'>
+                        <ProFormText placeholder='负责人' />
+                    </Form.Item>
+                )
+            },
+        },
+        {
+            key: 'selfEvaluation',
+            hideInTable: true,
+            renderFormItem: (item: any, { type }: any, form: any) => {
+
+                if (type === 'form') {
+                    return null;
+                }
+                return (
+                    <ProFormSelect
+                        name="selfEvaluation"
+                        request={async () => {
+                            const data = await getScoreLevelData();
+                            if (!data) return [];
+                            return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
+                        }}
+                        placeholder="选择自评"
+                        rules={[{ required: false }]}
+                    />
+                )
+            },
+        },
+        {
+            key: 'targetEvaluation',
+            hideInTable: true,
+            renderFormItem: (item: any, { type }: any, form: any) => {
+
+                if (type === 'form') {
+                    return null;
+                }
+                return (
+                    <ProFormSelect
+                        name="targetEvaluation"
+                        request={async () => {
+                            const data = await getScoreLevelData();
+                            if (!data) return [];
+                            return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
+                        }}
+                        placeholder="选择目标"
+                        rules={[{ required: false }]}
+                    />
+                )
+            },
+        },
+        {
+            title: '条款',
+            key: 'numStr',
+            dataIndex: 'numStr',
+            hideInSearch: true,
+
+        },
+        {
+            title: '条文',
+            dataIndex: 'name',
+            hideInSearch: true,
+            width: '35%',
+            ellipsis: true
+        },
+        {
+            title: '负责单位',
+            dataIndex: 'responsibilityDepartmentName',
+            hideInSearch: true,
+        },
+        {
+            title: '负责人',
+            dataIndex: 'responsibilityUserName',
+            hideInSearch: true,
+        },
+        {
+            title: '自评',
+            hideInSearch: true,
+            dataIndex: 'selfEvaluation',
+        },
+        // {
+        //     title: '现场查核',
+        //     hideInSearch: true,
+        //     dataIndex: 'siteEvaluation',
+        // },
+        {
+            title: '目标',
+            dataIndex: 'targetEvaluation',
+            hideInSearch: true,
+        },
+        {
+            title: '系统评分',
+            dataIndex: 'systemEvaluation',
+            hideInSearch: true,
+        },
+    ]
+
 
     const mccsEditableTableColumns = [
         {
@@ -275,16 +291,16 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                         placeholder='请选择'
                     >
                         {
-                            restModelData.gradeOptions.map((item,index)=>(
+                            restModelData.gradeOptions.map((item, index) => (
                                 <Option value={item.value} key={index}>{item.label}</Option>
                             ))
                         }
                     </Select>
-  
-                ): <Input />;
+
+                ) : <Input />;
             },
             render: (_: any, row: any) => {
-                return typeof _ === 'object' ? _.join(',') : _;
+                return typeof _ == 'object' ? _.join(',') : _;
             },
         },
         {
@@ -301,10 +317,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
                 return isEditable ? (
                     <Select
-                       placeholder='请选择'
+                        placeholder='请选择'
                     >
                         {
-                            restModelData.accountTypeOptions.map((item,index)=>(
+                            restModelData.accountTypeOptions.map((item, index) => (
                                 <Option value={item.value} key={index}>{item.label}</Option>
                             ))
                         }
@@ -330,28 +346,28 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     ]
 
 
-    // 左侧树搜索回调
+    //左侧树搜索回调
     const searchHandle = (val: any) => {
         restModelData.getArticleTreeData(val);
     }
 
     const onSelectHandle = (data: MccsFileTree.childTree) => {
-        // 左侧树节点点击回调
+        //左侧树节点点击回调
         setCurrentActivedTree(data);
-        setArticleSettingFormInit({});// 清空默认值
-        // 重新获取数据
+        setArticleSettingFormInit({});//清空默认值
+        //重新获取数据
         tableRef?.current?.getTableRef().current?.reload();
     }
 
     const batchSelfAssessment = (rowkeys: number[] | string[]) => {
-        // 批量设置
+        //批量设置
         restModelData.setDrawerFormType('BATCHSETTING');
         restModelData.setSelectedRowKeys(rowkeys);
         restModelData.setDrawerVisible(true);
     }
 
     const articleSetBtnHandle = () => {
-        // 条文设置
+        //条文设置
         // console.log({ articleSettingFormInit });
         restModelData.setDrawerFormType('ARTICLE_SET');
         restModelData.setDrawerVisible(true);
@@ -359,73 +375,47 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }
 
     const onVisibleChangeHandle = (visible: boolean) => {
-        // drawer展示控制
-        !visible && setArticleSettingFormInit({});// 清空默认值
+        //drawer展示控制
+        !visible && setArticleSettingFormInit({});//清空默认值
         restModelData.setDrawerVisible(visible);
     }
 
     const onModalVisibleChange = (visible: boolean) => {
-        // 表单弹窗
+        //表单弹窗
         //  console.log('uploadFormInitValue',restModelData.uploadFormInitValue);
         !visible && restModelData.setUploadFormInitValue(undefined);
         restModelData.setModalVisible(visible);
 
     }
 
-    // const upLoadFileHandle = (formInitData?: any) => {
-    //     //因为modalForm开启了request+params获取表单默认值,
-    //     //所以必须先设置默认值才能开启弹窗
-    //     if (formInitData) {
-    //         const { fileUrl, recordTypeName, accountType, fileName, cateId } = formInitData;
-    //         console.log({ formInitData });
-    //         restModelData.setUploadFormInitValue({
-    //             tab: { label: accountType, value: { label: recordTypeName, value: cateId } },
-    //             files: [{
-    //                 uid: new Date().getTime(),
-    //                 name: fileName,
-    //                 status: 'done',
-    //                 url: fileUrl
-    //             }]
-    //         });
-    //     } else {
-    //         restModelData.setUploadFormInitValue({})
-    //     }
-    //     restModelData.getUploadLedgerType().then(data => {
-    //         //设置上传台账类型
-    //         restModelData.setUploadLedgerTypeList(data);
-
-    //     })
-    //     restModelData.setModalVisible(true);
-    // }
-
     const uploadLedgerChangeHandle = (tabData: any) => {
-        // 台账上传类型选择回调
+        //台账上传类型选择回调
 
     }
 
     const setEditPageStatus = () => {
-        // 更改页面的编辑状态
+        //更改页面的编辑状态
         restModelData.setEditMode(!restModelData.editMode);
     }
 
     const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
-        // 更改执行情况说明数据
-        // 首先找出要更新的项,再进行整体替换
+        //更改执行情况说明数据
+        //首先找出要更新的项,再进行整体替换
 
         if (restModelData.selectedSelfEvolution) {
 
-            const editTargetLevel = restModelData.selectedSelfEvolution.label;  // 目标等级
-            // 找出目标等级下正在更新的level
+            const editTargetLevel = restModelData.selectedSelfEvolution.label;  //目标等级
+            //找出目标等级下正在更新的level
             const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
-            // 拷贝旧的目标等级数据
-            const _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
-            // 将新的编辑内容赋值给正在编辑的目标下的level
+            //拷贝旧的目标等级数据
+            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
+            //将新的编辑内容赋值给正在编辑的目标下的level
             _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
 
             if (editImplementationDataItemIndex != -1) {
                 restModelData.setImplementationData({
                     ...restModelData.implementationData,
-                    // 插入更新
+                    //插入更新
                     [editTargetLevel]: _cpOldImplemetationItem
                 }
                 )
@@ -435,54 +425,54 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }
 
     enum ActType {
-        'NOACT',  // 不操作
+        'NOACT',  //不操作
         'ADD',
         'EDIT',
         'DEL'
     };
 
     const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
-        // 台账资料目录编辑回调
-        console.log({data,actType});
+        //台账资料目录编辑回调
+        console.log({ data, actType });
         const version = restModelData.leafData?.reviewArticle.version;
         let prevData = restModelData.taizhangDataDirectoryCommitList;
         const numStr = restModelData.leafData?.reviewArticle.numStr;
 
         const objectSimpleFilter = (obj: object, keyToDel: string) => {
-            return JSON.parse(JSON.stringify(obj, (key, value) => {
+            return JSON.parse(JSON.stringify(obj, function (key, value) {
                 if (key == keyToDel) {
                     return undefined;
-                } 
+                } else {
                     return value;
-                
+                }
             }))
         }
 
 
-        if (actType == ActType.DEL && (typeof data.id === 'string')) {
-            // 如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
+        if (actType == ActType.DEL && (typeof data.id == 'string')) {
+            //如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
             prevData = prevData.filter(item => item.directory != data.directory);
             restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
             return;
         }
-        
-        const replaceData = (item: any,index: number)=>{
+
+        const replaceData = (item: any, index: number) => {
             prevData[index] = {
-                ...item,dataStatus: actType, version: version || '',
-                grade: data.grade.join(','), numStr, accountStatus: data.accountStatus?'1':'0'
+                ...item, dataStatus: actType, version: version ? version : '',
+                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
             };
             restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
-          
+
         }
 
-        const findeIndex = prevData.findIndex(item=>item.id == data.id);
-    
-        if(findeIndex != -1){
-            // 之前已有操作记录的,替换为最新状态
-            replaceData(data,findeIndex);
+        const findeIndex = prevData.findIndex(item => item.id == data.id);
+
+        if (findeIndex != -1) {
+            //之前已有操作记录的,替换为最新状态
+            replaceData(data, findeIndex);
             return;
         }
-        
+
         // if(findeIndex == -1){
         //     //不存在id的情况下,有可能编辑的不是服务已有的数据,比较directory
         //     const findIndexBydirectory = prevData.findIndex(item=>item.directory == data.directory);
@@ -494,37 +484,47 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
         restModelData.setTaizhangDataDirectoryCommitList(
             [...prevData, {
-                ...data, dataStatus: actType, version: version || '',
-                grade: data.grade.join(','), numStr, accountStatus: data.accountStatus?'1':'0'
+                ...data, dataStatus: actType, version: version ? version : '',
+                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
             }]
         )
     }
 
     const taizhangImplementationCommit = () => {
-        // 台账执行情况编辑结果提交
+        //台账执行情况编辑结果提交
         restModelData.commitTaizhangImplementationHandle();
     }
 
-    const followWindowResize = (num?: number)=>{
-           const _num = num || 0;
+    const followWindowResize = (num?: number) => {
+        const _num = num ? num : 0;
 
-           if(leafContentRef.current){
-            const leafContentH = leafContentRef.current.clientHeight + 50;  // 加上padding
+        if (leafContentRef.current) {
+            const leafContentH = leafContentRef.current.clientHeight + 50;  //加上padding
             const headerH = 48 + 16;
-            const scoreH = isModeTwo?(60+32):0;
-            const h =   window.innerHeight - (leafContentH + headerH + scoreH);
-            setScrollAreaH(h-_num);
-          }
+            const scoreH = isModeTwo ? (60 + 32) : 0;
+            const h = window.innerHeight - (leafContentH + headerH + scoreH);
+            setScrollAreaH(h - _num);
+        }
     }
 
-    
+    const getDepartments = async () => {
+
+        const resp = await getDepartmentList();
+
+        if (resp) {
+            const { list = [] } = resp;
+            setdepartments(list.map(t => ({ label: t.name, value: t.name })));
+        }
+    }
+
+
 
 
 
     useEffect(() => {
 
         if (restModelData.reloadRightContent) {
-            // 重新获取数据
+            //重新获取数据
             tableRef?.current?.getTableRef().current?.reload();
             tableRef?.current?.getTableRef().current?.clearSelected();
         }
@@ -533,7 +533,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
 
     useEffect(() => {
-        // 点击叶子结点时回调
+        //点击叶子结点时回调
         if (restModelData.leafData) {
             const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData.reviewArticle;
             if (responsibilityDepartmentName && responsibilityDepartmentId) {
@@ -545,8 +545,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                 });
             }
 
-            restModelData.getGradeOptions();  // 获取可选档次
-            restModelData.getAccoutTypeOptions(); // 可选类型
+            restModelData.getGradeOptions();  //获取可选档次
+            restModelData.getAccoutTypeOptions(); //可选类型
 
         }
 
@@ -555,64 +555,67 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     useEffect(() => {
         if (isModeTwo) {
-            // 设置当前模块模式,台账上传共用时
+            //设置当前模块模式,台账上传共用时
             restModelData.setModuleMode(isModeTwo);
         } else {
-            // 设置当前模块模式
+            //设置当前模块模式
             restModelData.setModuleMode(false);
         }
     }, [props]);
 
     useEffect(() => {
         if (treeData.length > 0) {
-            // 默认展开书结构第一个结点
-            // 树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
+            //默认展开书结构第一个结点
+            //树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
             const { id } = treeData[0];
             setDefaultOpened(`${id}`);
         }
     }, [treeData]);
 
 
-    useEffect(()=>{
+    useEffect(() => {
         // followWindowResize();
-        if(isLeaf){
-            setTimeout(()=>{
-                // 首次加载叶子节点内容触发一次
-                const myEvent = new Event('resize');
-                window.dispatchEvent(myEvent); 
-                document.body.style.overflowY = 'hidden';  // 叶子节点下锁住页面滚动
-            },500);
+        if (isLeaf) {
+            setTimeout(() => {
+                //首次加载叶子节点内容触发一次
+                var myEvent = new Event('resize');
+                window.dispatchEvent(myEvent);
+                document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
+            }, 500);
+            //获取单位列表
         }
-        
-        if(!isLeaf){
-            document.body.style.overflowY = 'auto';  // 非叶子节点放开
+
+        if (!isLeaf) {
+            document.body.style.overflowY = 'auto';  //非叶子节点放开
         }
-    },[isLeaf]);
+    }, [isLeaf]);
 
 
-    useEffect(()=>{
-          if(restModelData.editMode){
+    useEffect(() => {
+        if (restModelData.editMode) {
             followWindowResize(40);
-          }else{
+        } else {
             followWindowResize(0);
-          }
-    },[restModelData.editMode]);
+        }
+    }, [restModelData.editMode]);
 
 
     useEffect(() => {
-        // 页面加载完
-        // 获取左侧输结构
+        //页面加载完
+        //获取左侧输结构
         restModelData.getArticleTreeData();
-        // 获取当前评分
+        //获取当前评分
         restModelData.getCurrentHospScore();
-        
+
         // followWindowResize();
-        window.addEventListener("resize",()=>followWindowResize());
+        window.addEventListener("resize", () => followWindowResize());
 
-        return ()=>{
-            window.removeEventListener("resize",()=>followWindowResize());
+        getDepartments();
+
+        return () => {
+            window.removeEventListener("resize", () => followWindowResize());
         }
-        
+
     }, [])
 
 
@@ -620,7 +623,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     return (
         <div className='ArticleManagement'>
             <MccsPageContainer
-                config={headerConcig || {
+                config={headerConcig ? headerConcig : {
                     content: !isModeTwo && <div style={{ textAlign: 'right', fontSize: 12, color: '#525866' }}>{restModelData.currentHospSelfScoreAndOthers}</div>,
                     footer: restModelData.editMode ? [
                         <Button key="3" onClick={() => restModelData.setEditMode(false)}>取消</Button>,
@@ -632,7 +635,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
             >
                 {
                     restModelData.modalVisible && (
-                        // 台账上传弹窗
+                        //台账上传弹窗
                         <MccsModal title='台账上传' visible={restModelData.modalVisible}
                             onFinish={(values: any) => restModelData.uploadFile(values)}
                             initialValues={!restModelData.uploadFormInitValue ? {} : restModelData.uploadFormInitValue}
@@ -650,8 +653,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                 },
                             ]}>
                                 <MccsClickableTabs
-                                    // 重新上传不允许更改类型
-                                    disabled={!!((restModelData.uploadFormInitValue && JSON.stringify(restModelData.uploadFormInitValue) != '{}'))}
+                                    //重新上传不允许更改类型
+                                    disabled={(restModelData.uploadFormInitValue && JSON.stringify(restModelData.uploadFormInitValue) != '{}') ? true : false}
                                     type='multi'
                                     onChange={uploadLedgerChangeHandle}
                                     data={restModelData.uploadLedgerTypeList}
@@ -660,7 +663,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                             <ProFormDependency name={['tab']}>
                                 {
                                     ({ tab }) => {
-                                        // 制度特殊处理
+                                        //制度特殊处理
                                         return tab && tab.value.label == '制度' && (
                                             <ProFormSelect
                                                 name="publicCateId"
@@ -687,8 +690,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                 }
 
                 {
-                    // 条文设置/表格批量设置drawer弹窗
-                    // restModelData.drawerVisible && 
+                    //条文设置/表格批量设置drawer弹窗
+                    //restModelData.drawerVisible && 
                     (
                         <MccsDrawerForm
                             title={restModelData.drawerFormType == 'ARTICLE_SET' ? '条文设置' : '批量设置'}
@@ -711,7 +714,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                         fieldProps={{
                                             labelInValue: true,
                                             onChange: (value, option) => {
-                                                // 责任单位修改时清空责任人
+                                                //责任单位修改时清空责任人
                                                 drawerFormRef.current?.setFieldsValue({ ...articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
                                                 getDepartment(value, option)
                                             }
@@ -793,7 +796,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                     onSelectHandle={onSelectHandle}
                                     searchHandle={searchHandle}
                                     renderFilter={() => {
-                                        // 只在台账上传时展示
+                                        //只在台账上传时展示
                                         return isModeTwo ? (
                                             <div className='onlyMyselfFilter'>
                                                 <span>只看我的</span>
@@ -863,11 +866,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                                 }
                                             </div>
                                             {
-                                                // 条文页面
+                                                //条文页面
                                                 !restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
                                             }
                                             {
-                                                // 台账上传页面且非编辑状态下
+                                                //台账上传页面且非编辑状态下
                                                 (restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
                                             }
                                         </div>
@@ -920,11 +923,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
                         {
                             isLeaf && restModelData.leafData && (
-                                // 台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
-                                <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{height:`${scrollAreaH}px`,marginTop:'16px'}}>
+                                //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
+                                <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ height: `${scrollAreaH}px`, marginTop: '16px' }}>
                                     <div>
                                         {
-                                            // 渲染执行情况说明
+                                            //渲染执行情况说明
                                             /**
                                              * 满足条件:
                                              * 1.存在自评等级从接口获取或手动点击选择
@@ -967,7 +970,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                     </div>
                                     <div style={{ padding: '0 16px' }}>
                                         {
-                                            // 台帐下展示
+                                            //台帐下展示
                                             (isModeTwo && restModelData.leafData) && (
                                                 <MccsEditableTable
                                                     bordered={true}
@@ -985,14 +988,14 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                                         (data: any) => taizhangDataDerectoryEditHandle(data, ActType.DEL)
                                                     }
                                                     request={async (current, pageSize) => {
-                                        
+
                                                         if (restModelData.leafData) {
 
                                                             const { numStr, version } = restModelData.leafData.reviewArticle;
                                                             const resp = await getTaizhangDirectoryTable({ numStr, version, current, pageSize });
                                                             const { list = [] } = resp;
                                                             return {
-                                                                data: list.map(item => ({ ...item, grade: item.grade ? item.grade.split(',') : [], accountStatus: item.accountStatus != '0' })), // 多选下拉需传数组值
+                                                                data: list.map(item => ({ ...item, grade: item.grade ? item.grade.split(',') : [], accountStatus: item.accountStatus == '0' ? false : true })), //多选下拉需传数组值
                                                                 total: resp.totalCount,
                                                                 current: resp.current,
                                                                 success: true