Parcourir la source

合并master/addqiankun分支

code4eat il y a 3 ans
Parent
commit
09388deb60
92 fichiers modifiés avec 2049 ajouts et 1840 suppressions
  1. 9 9
      README.md
  2. 5 1
      config/proxy.ts
  3. BIN
      public/arrow.png
  4. BIN
      public/arrow_white.png
  5. BIN
      public/cycleArrow.png
  6. BIN
      public/cycleArrow_white.png
  7. BIN
      public/doubleArrow.png
  8. BIN
      public/doubleArrow_white.png
  9. 6 6
      src/access.ts
  10. 42 43
      src/app.tsx
  11. 6 6
      src/components/MccsClickableTabs/index.tsx
  12. 12 12
      src/components/MccsClickableTabs/typings.d.ts
  13. 1 1
      src/components/MccsDrawerForm/index.tsx
  14. 3 3
      src/components/MccsDrawerForm/typings.d.ts
  15. 12 12
      src/components/MccsEditableTable/index.tsx
  16. 18 20
      src/components/MccsEditableTable/typings.d.ts
  17. 4 0
      src/components/MccsFileTree/components/DirectoryTree/index.tsx
  18. 3 3
      src/components/MccsFileTree/components/NodeTextArea/index.tsx
  19. 6 2
      src/components/MccsFileTree/index.tsx
  20. 2 2
      src/components/MccsFileTree/typing.d.ts
  21. 16 16
      src/components/MccsLightTable/index.tsx
  22. 4 4
      src/components/MccsLightTable/typings.d.ts
  23. 5 5
      src/components/MccsModal/index.tsx
  24. 1 3
      src/components/MccsModal/typings.d.ts
  25. 10 14
      src/components/MccsPageContainer/index.tsx
  26. 6 6
      src/components/MccsProCard/index.tsx
  27. 13 13
      src/components/MccsProFormSelect/index.tsx
  28. 9 9
      src/components/MccsRecordList/index.tsx
  29. 19 19
      src/components/MccsRecordList/typings.d.ts
  30. 4 4
      src/components/MccsScoreBanner/index.tsx
  31. 8 1
      src/components/MccsTable/index.tsx
  32. 7 7
      src/components/MccsTable/typings.d.ts
  33. 2 2
      src/components/MccsUpload/index.tsx
  34. 2 2
      src/components/MccsUpload/typings.d.ts
  35. 1 1
      src/components/RightContent/index.tsx
  36. 3 5
      src/components/antdProOverwrite/MccsProForm/index.tsx
  37. 4 4
      src/components/antdProOverwrite/MccsProFormText/index.tsx
  38. 2 2
      src/components/iframePage/index.tsx
  39. 1 1
      src/constant.ts
  40. 1 2
      src/global.tsx
  41. 1 1
      src/menuIcons.js
  42. 4 4
      src/models/allModels.ts
  43. 1 3
      src/pages/Admin.tsx
  44. 24 28
      src/pages/DataManagement/publicData/index.tsx
  45. 11 11
      src/pages/DataManagement/publicData/model.ts
  46. 24 24
      src/pages/DataManagement/publicData/serve.ts
  47. 18 18
      src/pages/DataManagement/publicData/typings.d.ts
  48. 18 18
      src/pages/GradeHospitalAccreditation/accreditationDetail/components/FormList/index.tsx
  49. 9 9
      src/pages/GradeHospitalAccreditation/accreditationDetail/components/FormList/typings.d.ts
  50. 32 10
      src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/index.tsx
  51. 25 0
      src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/style.less
  52. 12 12
      src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/typings.d.ts
  53. 41 54
      src/pages/GradeHospitalAccreditation/accreditationDetail/index.tsx
  54. 6 6
      src/pages/GradeHospitalAccreditation/accreditationDetail/model.ts
  55. 59 59
      src/pages/GradeHospitalAccreditation/accreditationDetail/service.ts
  56. 46 46
      src/pages/GradeHospitalAccreditation/accreditationDetail/typings.d.ts
  57. 164 0
      src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/index.tsx
  58. 503 0
      src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx
  59. 235 0
      src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/style.less
  60. 2 199
      src/pages/GradeHospitalAccreditation/articleManagement/index.less
  61. 76 589
      src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
  62. 167 166
      src/pages/GradeHospitalAccreditation/articleManagement/model.ts
  63. 58 53
      src/pages/GradeHospitalAccreditation/articleManagement/server.ts
  64. 32 32
      src/pages/GradeHospitalAccreditation/articleManagement/typings.d.ts
  65. 23 23
      src/pages/GradeHospitalAccreditation/ledgerUpload/componets/deitailModule/detail.tsx
  66. 14 16
      src/pages/GradeHospitalAccreditation/ledgerUpload/index.tsx
  67. 24 26
      src/pages/GradeHospitalAccreditation/ledgerUpload/model.ts
  68. 8 8
      src/pages/GradeHospitalAccreditation/ledgerUpload/server.ts
  69. 33 33
      src/pages/GradeHospitalAccreditation/ledgerUpload/typings.d.ts
  70. 5 8
      src/pages/KeepImprove/departmentIssueRank/index.tsx
  71. 2 2
      src/pages/KeepImprove/departmentScoreRank/index.tsx
  72. 2 2
      src/pages/KeepImprove/indexNumGather/index.tsx
  73. 5 5
      src/pages/KeepImprove/qualityRating/index.tsx
  74. 2 2
      src/pages/KeepImprove/qualityRating/serve.ts
  75. 2 2
      src/pages/KeepImprove/questionGather/index.tsx
  76. 2 2
      src/pages/KeepImprove/questionGatherAndRevise/index.tsx
  77. 5 5
      src/pages/PlatformMana/districtMana/service.js
  78. 13 13
      src/pages/PlatformMana/generalSetting/index.tsx
  79. 18 18
      src/pages/PlatformMana/generalSetting/serve.ts
  80. 15 15
      src/pages/PlatformMana/generalSetting/typings.d.ts
  81. 2 2
      src/pages/PlatformMana/menuManage/index.js
  82. 5 5
      src/pages/PlatformMana/menuManage/service.js
  83. 0 3
      src/pages/PlatformMana/roleManage/component/drawer.jsx
  84. 16 11
      src/pages/PlatformMana/roleManage/index.js
  85. 8 8
      src/pages/PlatformMana/roleManage/service.js
  86. 2 2
      src/pages/PlatformMana/userMana/index.js
  87. 5 5
      src/pages/PlatformMana/userMana/service.js
  88. 2 2
      src/pages/Settings/index.tsx
  89. 5 5
      src/pages/user/Login/index.tsx
  90. 5 5
      src/pages/user/Login/service.ts
  91. 1 1
      src/services/user.ts
  92. 10 29
      src/utils.js

+ 9 - 9
README.md

@@ -123,17 +123,17 @@ npm run start:dev //开发环境,不使用mock,所有数据通过代理接口
     },[data]);
 ...
 
-//条文管理和台账上传界面是共用页面模块,在编写这两块的逻辑时注意状态区分
+##### 条文管理和台账上传界面是共用页面模块,在编写这两块的逻辑时注意状态区分
 
-//项目数据共享使用的是umi 的model插件,每个page对应一个model.ts文件
-//model文件分布在每个page下面,然后统一在src/models/allModel.ts里引入使用
+##### 项目数据共享使用的是umi 的model插件,每个page对应一个model.ts文件
+##### model文件分布在每个page下面,然后统一在src/models/allModel.ts里引入使用
 
-//在复杂的组件方面都配有readme.md文件,里面提供了相关demo
-//项目引入的绝大多数组件来自antd/antd Pro,在使用这些组件时,多数进行了初步的包装,以便在项目中对一些特性进行统一处理
-
-//项目的平台管理下的多个页面都是从成本核算移植过来的,采用的是react+react hook写法,并没有采用目前的react+react //hook+typescript,考虑到这块将来统一提升至中台,暂时没做处理。
+##### 在复杂的组件方面都配有readme.md文件,里面提供了相关demo
+##### 项目引入的绝大多数组件来自antd/antd Pro,在使用这些组件时,多数进行了初步的包装,以便在项目中对一些特性进行统一处理
 
+##### 项目的平台管理下的多个页面都是从成本核算移植过来的,采用的是react+react hook写法,并没有采用目前的react+react //hook+typescript,考虑到这块将来统一提升至中台,暂时没做处理。
 
+##### 条文管理和台账上传两个页面有数据/组件共享,在处理时需重点注意
 
 ```
 
@@ -141,6 +141,6 @@ npm run start:dev //开发环境,不使用mock,所有数据通过代理接口
 
 #### RoadMap
 
-- 2022-11-25 
-- 
+- 2022-01-25 
+- 2022-03-07
 

+ 5 - 1
config/proxy.ts

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

BIN
public/arrow.png


BIN
public/arrow_white.png


BIN
public/cycleArrow.png


BIN
public/cycleArrow_white.png


BIN
public/doubleArrow.png


BIN
public/doubleArrow_white.png


+ 6 - 6
src/access.ts

@@ -12,14 +12,14 @@
 
 
 type menuDataItemType = {
-  path:string,
-  name:string,
-  icon:any,
-  component:string,
-  children?:menuDataItemType[]
+  path: string,
+  name: string,
+  icon: any,
+  component: string,
+  children?: menuDataItemType[]
 }
 
-export default  function access(initialState: { currentUser?: API.CurrentUser | undefined,menu:menuDataItemType[],isDev:boolean}) {
+export default  function access(initialState: { currentUser?: API.CurrentUser | undefined,menu: menuDataItemType[],isDev: boolean}) {
   // const { currentUser,menu,isDev } = initialState || {};
   return {
     // canAdmin: currentUser && currentUser.access === 'admin',

+ 42 - 43
src/app.tsx

@@ -8,7 +8,8 @@
  */
 import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
 import { PageLoading } from '@ant-design/pro-layout';
-import { RunTimeLayoutConfig,history, Link } from 'umi';
+import type { RunTimeLayoutConfig} from 'umi';
+import {history, Link } from 'umi';
 import { notification, Modal } from 'antd';
 // import 'yet-another-abortcontroller-polyfill'
 import RightContent from '@/components/RightContent';
@@ -27,9 +28,9 @@ const isDev = process.env.NODE_ENV === 'development';
 
 const loginPath = '/user/login';
 
-let hospSign:any='';
+let hospSign: any='';
 
-let ifStopNextRequet:boolean = false;  //控制当出现token过期阻止后面弹窗提示
+let ifStopNextRequet: boolean = false;  // 控制当出现token过期阻止后面弹窗提示
 
 if(history){
   hospSign = history.location.query?.hospSign;
@@ -46,12 +47,12 @@ if(history){
 
 
 export type menuDataItemType = {
-  path:string,
-  name:string,
-  icon:any,
-  component:string,
-  softUrl?:string, //帆软url
-  children?:menuDataItemType[]
+  path: string,
+  name: string,
+  icon: any,
+  component: string,
+  softUrl?: string, // 帆软url
+  children?: menuDataItemType[]
 }
 
 /**
@@ -60,15 +61,15 @@ export type menuDataItemType = {
 export async function getInitialState(): Promise<{
   settings?: Partial<LayoutSettings>;
   currentUser?: API.CurrentUserData;
-  logo?:String;
-  isDev?:boolean,
-  goSetting?:boolean,//设置栏触发
-  resetPasswordHandle?:(formData:any)=>Promise<boolean>,
-  fetchUserMenu?:()=>Promise<menuDataItemType[]>,
-  menu?:menuDataItemType[],
-  clearUserData?:() => Promise<boolean>;  //清空用户数据
+  logo?: string;
+  isDev?: boolean,
+  goSetting?: boolean,// 设置栏触发
+  resetPasswordHandle?: (formData: any) => Promise<boolean>,
+  fetchUserMenu?: () => Promise<menuDataItemType[]>,
+  menu?: menuDataItemType[],
+  clearUserData?: () => Promise<boolean>;  // 清空用户数据
   fetchUserInfo?: () => Promise<API.CurrentUser | undefined>;
-  postDataToTop?:(data:any)=>Promise<boolean>,
+  postDataToTop?: (data: any) => Promise<boolean>,
 }> {
 
   const fetchUserInfo = async () => {
@@ -94,7 +95,7 @@ export async function getInitialState(): Promise<{
 
  
 
-  const resetPasswordHandle = async (data:API.EditUserInfoType)=>{
+  const resetPasswordHandle = async (data: API.EditUserInfoType)=>{
         const resp = await updateUserInfo(data);
         if(resp){
           return Promise.resolve(true);
@@ -136,11 +137,11 @@ export async function getInitialState(): Promise<{
 const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
   
   const userData = localStorage.getItem('userData');
-  let authHeader = {token:''};
+  const authHeader = {token:''};
   
   
   if(userData){
-       const {token}:API.CurrentUserData = JSON.parse(userData);
+       const {token}: API.CurrentUserData = JSON.parse(userData);
        authHeader.token = token;
   }
 
@@ -153,11 +154,11 @@ const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
 
 
 interface responseInterceptorsOptions extends RequestOptionsInit {
-  isCloseNotify?:boolean, //是否关闭POST请求后反馈
-  responseSpecifyFeedback?:{
-       successMessage:string,
-       errorMessage:string,
-       isShow:boolean,  //是否启用
+  isCloseNotify?: boolean, // 是否关闭POST请求后反馈
+  responseSpecifyFeedback?: {
+       successMessage: string,
+       errorMessage: string,
+       isShow: boolean,  // 是否启用
   }
 }
 
@@ -170,15 +171,15 @@ const responseInterceptors = async (response: Response, options: responseInterce
   try {
     const {status} = response;
     if(status == 200){
-        //网络请求成功
+        // 网络请求成功
         const _response = await response.clone().json();
         const { status: dataStatus,errorCode,errorMessage,data} = _response;
         if(dataStatus == 200){
          
-             //接口请求成功
+             // 接口请求成功
              if(requestMethod=='POST'&&url != "/api/pfm/login"&&!isCloseNotify){
                if(responseSpecifyFeedback&&responseSpecifyFeedback.isShow){
-                 //当指定了请求成功反馈时
+                 // 当指定了请求成功反馈时
                  console.log({responseSpecifyFeedback});
                  console.log(responseSpecifyFeedback.successMessage);
                  notification.success({
@@ -186,7 +187,7 @@ const responseInterceptors = async (response: Response, options: responseInterce
                  });
                    
                }else{
-                 //否则用默认提示
+                 // 否则用默认提示
                 notification.success({
                   message:'操作成功!'
                  });
@@ -197,7 +198,7 @@ const responseInterceptors = async (response: Response, options: responseInterce
               return data;
              }
              return true;
-        }else if(errorCode == 499){
+        }if(errorCode == 499){
           if(!ifStopNextRequet){
             Modal.confirm({
               title: '抱歉,登录已过期请重新登录!',
@@ -209,14 +210,14 @@ const responseInterceptors = async (response: Response, options: responseInterce
           }
           ifStopNextRequet = true;
         }else {
-             //接口请求信息错误
+             // 接口请求信息错误
              notification.error({
               message:errorMessage
              });
         }
         
     }else {
-      //网络请求失败
+      // 网络请求失败
        notification.error({
         message:'服务器错误!'
        });
@@ -233,13 +234,11 @@ const demo1Middleware = async (ctx: Context, next: () => void) => {
 };
 
 
-type RequestConfig = {
-  [propsName:string]:any
-}
+type RequestConfig = Record<string, any>
 
 export const request: RequestConfig = {
   // 新增自动添加AccessToken的请求前拦截器
-  errorHandler: (error:any) => {
+  errorHandler: (error: any) => {
     console.log({ error });
     throw error;
   },
@@ -250,8 +249,8 @@ export const request: RequestConfig = {
 
 
 
-//将服务端获取的菜单 icon 字符串映射为对应的 icon Dom
-const mappingIcon = (menuData:menuDataItemType[]) => {
+// 将服务端获取的菜单 icon 字符串映射为对应的 icon Dom
+const mappingIcon = (menuData: menuDataItemType[]) => {
   if(menuData.length==0){
       console.log('空菜单');
       return [
@@ -262,14 +261,14 @@ const mappingIcon = (menuData:menuDataItemType[]) => {
           component: './404',
         }
       ]
-  }else {
-    const mappingMenu:menuDataItemType[] = menuData.map(item => ({
+  }
+    const mappingMenu: menuDataItemType[] = menuData.map(item => ({
       ...item,
       icon: item.icon&&iconEnum[item.icon],
       children: item.children ? mappingIcon(item.children) : [],
     }));
     return mappingMenu;
-  }
+  
   
 };
 
@@ -317,12 +316,12 @@ export const layout: RunTimeLayoutConfig = ({ initialState,setInitialState }) =>
         if(initialState){
           const { currentUser,isDev} = initialState;
           if(false){
-            //开发环境
+            // 开发环境
             return []
           }
       
           if (currentUser) {
-            const data:menuDataItemType[] = await getMenus();
+            const data: menuDataItemType[] = await getMenus();
             
             if(data){
               await setInitialState(t=>({...t,menu:data}));

+ 6 - 6
src/components/MccsClickableTabs/index.tsx

@@ -14,25 +14,25 @@ import React,{useState,useEffect} from 'react'
 
 import styles from './index.less';
 
-const MccsClickableTabs:React.FC<MccsClickableTabs.propsType> = (props)=>{
+const MccsClickableTabs: React.FC<MccsClickableTabs.propsType> = (props)=>{
 
     const [list,setList] = useState<MccsClickableTabs.TabType[]>([]);
     const {tabClickHandle,onChange,type='single',classNames} = props;
-    const [activedTab,setActivedTab] = useState<{label:string,value:any}>();
+    const [activedTab,setActivedTab] = useState<{label: string,value: any}>();
     const [disabled,setDisabled] = useState(false);
 
-    const clickHandle = (item:MccsClickableTabs.TabType,supItem:{label:string,value:string|number})=>{
+    const clickHandle = (item: MccsClickableTabs.TabType,supItem: {label: string,value: string|number})=>{
 
         if(!disabled){
             // console.log(item,type);
             if(type=='single'){
                 tabClickHandle&&tabClickHandle(item);
-                onChange?.({label:`${item.value}`,value:item.value});  //Form传递过来的onChange,设置表单值
+                onChange?.({label:`${item.value}`,value:item.value});  // Form传递过来的onChange,设置表单值
                 setActivedTab(supItem);
             }
             if(type=='multi'){
-                tabClickHandle&&tabClickHandle(supItem?supItem:null);
-                onChange?.({label:`${item.label}`,value:supItem});  //Form传递过来的onChange,设置表单值
+                tabClickHandle&&tabClickHandle(supItem || null);
+                onChange?.({label:`${item.label}`,value:supItem});  // Form传递过来的onChange,设置表单值
                 setActivedTab({label:item.label,value:supItem});
             }
         }

+ 12 - 12
src/components/MccsClickableTabs/typings.d.ts

@@ -10,20 +10,20 @@
 
 declare namespace MccsClickableTabs {
       type propsType = {
-        data:TabType[],
-        defaultTabValue?:any[],
-        onChange?:({label:string,value:any})=>void,
-        tabClickHandle?:(data:TabType|null)=>{},
-        type?:'single'|'multi',
-        value?:{label:string,value:any},
-        disabled?:boolean,//是否禁用
-        clear?:boolean, //清空选中数据
-        classNames?:string, //class名
+        data: TabType[],
+        defaultTabValue?: any[],
+        onChange?: ({label:string,value:any}) => void,
+        tabClickHandle?: (data: TabType|null) => {},
+        type?: 'single'|'multi',
+        value?: {label: string,value: any},
+        disabled?: boolean,// 是否禁用
+        clear?: boolean, // 清空选中数据
+        classNames?: string, // class名
       }
 
       type TabType = {
-          label:string,
-          value:string|number,
-          list?:TabType[]
+          label: string,
+          value: string|number,
+          list?: TabType[]
       }
 }

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

@@ -15,7 +15,7 @@ import {
     DrawerForm,
   } from '@ant-design/pro-form';
 
-const MccsDrawerForm:React.FC<MccsDrawerForm.propsType> = (props)=>{
+const MccsDrawerForm: React.FC<MccsDrawerForm.propsType> = (props)=>{
     const {children,noFormMode,onVisibleChange,drawerProps,visible,...rest} = props;
     const [drawerVisible,setDrawerVisible] = useState(false);
 

+ 3 - 3
src/components/MccsDrawerForm/typings.d.ts

@@ -10,8 +10,8 @@
 
 declare namespace MccsDrawerForm {
      type propsType = {
-          noFormMode?:boolean,  //是否不带有表单
-          drawerProps?:object,
-          [propsName:string]:any
+          noFormMode?: boolean,  // 是否不带有表单
+          drawerProps?: object,
+          [propsName: string]: any
      }
 }

+ 12 - 12
src/components/MccsEditableTable/index.tsx

@@ -10,10 +10,10 @@
 import { Pagination, Popconfirm } from 'antd';
 import React, { useState, useEffect, useRef } from 'react'
 import { EditableProTable } from '@ant-design/pro-table';
-import { Key } from 'antd/lib/table/interface';
+import type { Key } from 'antd/lib/table/interface';
 
 
-//仅仅对pro-table简单的包装,详细使用参考antd pro
+// 仅仅对pro-table简单的包装,详细使用参考antd pro
 
 const MccsEditableTable: React.FC<MccsEditableTableType.MccsEditableTableProps> = (props) => {
 
@@ -73,10 +73,10 @@ const MccsEditableTable: React.FC<MccsEditableTableType.MccsEditableTableProps>
 
     }
 
-    const pageChangeHandle = (page:number,pageSize:number|undefined)=>{
-        //分页页码变化时
+    const pageChangeHandle = (page: number,pageSize: number|undefined)=>{
+        // 分页页码变化时
         // console.log({page,pageSize});
-        setPageData({current:page,pageSize:pageSize?pageSize:10});
+        setPageData({current:page,pageSize:pageSize || 10});
     }
 
     const generateRowKey = ()=>{
@@ -86,7 +86,7 @@ const MccsEditableTable: React.FC<MccsEditableTableType.MccsEditableTableProps>
     }
 
     useEffect(() => {
-        //加载模块获取数据
+        // 加载模块获取数据
         getData();
 
     }, [reload]);
@@ -98,12 +98,12 @@ const MccsEditableTable: React.FC<MccsEditableTableType.MccsEditableTableProps>
         const hasIndex = columns.findIndex(item => item.valueType == 'option');
         // console.log({hasIndex,edit});
         if (hasIndex == -1 && edit) {
-            //当无操作按钮时,自行添加默认
+            // 当无操作按钮时,自行添加默认
             setTableColumns([...columns, mccsEditableTableAction]);
             return;
         }
         if (!edit) {
-            //当非编辑下时除去操作项
+            // 当非编辑下时除去操作项
             setTableColumns(columns.filter(item => item.valueType != 'option'));
             tableRef.current.cancelEditable(editableKeys[editableKeys.length-1]);
 
@@ -152,16 +152,16 @@ const MccsEditableTable: React.FC<MccsEditableTableType.MccsEditableTableProps>
                     onSave: async (rowKey, data, row) => {
                         const { id } = data;
                         // console.log({dataSource});
-                        if (typeof id == 'string') {
-                            //新增
+                        if (typeof id === 'string') {
+                            // 新增
                             // addHandle && addHandle(objectSimpleFilter(data, 'id'));
                             addHandle && addHandle(data);
-                        } else if(typeof id == 'number') {
+                        } else if(typeof id === 'number') {
     
                             editHandle && editHandle(data);
                         }
                     },
-                    onChange: (editableKeys: Key[], editableRows: {id:string}|{id:string}[])=>{
+                    onChange: (editableKeys: Key[], editableRows: {id: string}|{id: string}[])=>{
                         //  console.log({editableKeys,editableRows});
                          setEditableRowKeys(editableKeys)
                     },

+ 18 - 20
src/components/MccsEditableTable/typings.d.ts

@@ -13,28 +13,26 @@
 
 declare namespace MccsEditableTableType {
 
-    export type RowDataType = {
-        [key:string]:any
-    }
+    export type RowDataType = Record<string, any>
      
     export type MccsEditableTableProps = {
-         columns:any[],
-         request?:(
-             current:number,
-             pageSize:number,
-         )=>Promise<{
-             data:any[],
-             current?:number,
-             total?:number,
-             success?:boolean
+         columns: any[],
+         request?: (
+             current: number,
+             pageSize: number,
+         ) => Promise<{
+             data: any[],
+             current?: number,
+             total?: number,
+             success?: boolean
          }>,
-         addHandle?:(data:any)=>void,
-         editHandle?:(data:any)=>void,
-         delHandle?:(data:any)=>void,   //当使用默认操作项才存在
-         pagination?:boolean,
-         reload?:boolean,
-         edit?:boolean,
-         getTableRef?:(ref:any)=>void,
-         [key:string]:any
+         addHandle?: (data: any) => void,
+         editHandle?: (data: any) => void,
+         delHandle?: (data: any) => void,   // 当使用默认操作项才存在
+         pagination?: boolean,
+         reload?: boolean,
+         edit?: boolean,
+         getTableRef?: (ref: any) => void,
+         [key: string]: any
     }
 }

+ 4 - 0
src/components/MccsFileTree/components/DirectoryTree/index.tsx

@@ -1,7 +1,11 @@
 /*
  * @Author: your name
  * @Date: 2021-09-07 16:40:33
+<<<<<<< HEAD
  * @LastEditTime: 2022-03-04 17:30:38
+=======
+ * @LastEditTime: 2022-03-04 18:35:37
+>>>>>>> master
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/components/directoryTree.tsx

+ 3 - 3
src/components/MccsFileTree/components/NodeTextArea/index.tsx

@@ -12,16 +12,16 @@ import React,{useRef,useState} from 'react';
 import { Tooltip } from 'antd';
 
 
-const NodeTextArea = ({text,className}:{text:string,className?:string}) => {
+const NodeTextArea = ({text,className}: {text: string,className?: string}) => {
 
     const theTextRef = useRef<HTMLSpanElement>(null);
     const textWrapRef = useRef<HTMLDivElement>(null);
     const [visible,setVisible] = useState(false);
-    const onVisibleChangeHandle = (visible:boolean)=>{
+    const onVisibleChangeHandle = (visible: boolean)=>{
 
          if(visible){
              if(textWrapRef.current&&theTextRef.current){
-                //文案长度大于容器长度时触发
+                // 文案长度大于容器长度时触发
                 if(textWrapRef.current.offsetWidth > theTextRef.current.offsetWidth ){
                     setVisible(false);  
                 }else{

+ 6 - 2
src/components/MccsFileTree/index.tsx

@@ -1,13 +1,18 @@
 /*
  * @Author: your name
  * @Date: 2021-09-06 10:28:12
+<<<<<<< HEAD
  * @LastEditTime: 2022-03-04 17:32:24
+=======
+ * @LastEditTime: 2022-03-04 18:34:17
+>>>>>>> master
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsFileTree/index.tsx
  */
 
 
+
 import React, { ReactNode, useEffect, useState, MouseEvent } from 'react'
 import { Input, Spin, Image, Popconfirm } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
@@ -210,5 +215,4 @@ const MccsFileTree: React.FC<MccsFileTreeProps> = (props) => {
 
 
 
-export default MccsFileTree
-
+export default MccsFileTree

+ 2 - 2
src/components/MccsFileTree/typing.d.ts

@@ -14,8 +14,8 @@ declare namespace MccsFileTree {
     type childTree = {
         title: string,
         id: string,
-        isLeaf:boolean,
-        code:string,
+        isLeaf: boolean,
+        code: string,
         [propName: string]: any;
         children?: childTree[]
     }

+ 16 - 16
src/components/MccsLightTable/index.tsx

@@ -8,7 +8,7 @@
  */
 
 import React, { useEffect, useState } from 'react';
-import { MccsLightTableTypes } from './typings';
+import type { MccsLightTableTypes } from './typings';
 import { Empty, Tooltip, Pagination } from 'antd';
 
 import './style.less';
@@ -18,7 +18,7 @@ import './style.less';
 const MccsLightTable: React.FC<{
     columns: MccsLightTableTypes.MccsLightTableColumn[],
     data?: [],
-    request?: (current:number,pageSize:number) => Promise<{
+    request?: (current: number,pageSize: number) => Promise<{
         current: number,
         list: any[],
         pageSize: number,
@@ -36,9 +36,9 @@ const MccsLightTable: React.FC<{
     const [dataList, setDataList] = useState<any[]>([]);
     const [renderColumns, seRenderColumns] = useState<MccsLightTableTypes.MccsLightTableColumn[]>([]);
     const [pageData, setPageData] = useState<{ pageSize: number, current: number }>({pageSize:10,current:1});
-    const [total,setTotal] = useState(0);  //数据总数
+    const [total,setTotal] = useState(0);  // 数据总数
 
-    const getData = async (current:number,size:number) => {
+    const getData = async (current: number,size: number) => {
         if (!request) return [];
         const data = await request(current,size);
         if (data) {
@@ -51,33 +51,33 @@ const MccsLightTable: React.FC<{
 
     }
 
-    const onShowSizeChangeHandle = (current:number,size:number)=>{
+    const onShowSizeChangeHandle = (current: number,size: number)=>{
 
         setPageData({...pageData,current:current+1,pageSize:size});
-        getData(current+1,size); //current 默认从0开始
+        getData(current+1,size); // current 默认从0开始
     }
 
-    const pageChangeHandle = (page:number,pageSize:number|undefined)=>{
-        //分页页码变化时
+    const pageChangeHandle = (page: number,pageSize: number|undefined)=>{
+        // 分页页码变化时
         // console.log({page,pageSize});
-        getData(page,pageSize?pageSize:10);
+        getData(page,pageSize || 10);
     }
 
     useEffect(() => {
         const hasSetWidColumns = columns.filter(item => item.width);
         const needCountWidCloumnsNum = columns.length - hasSetWidColumns.length;
         const widArray = hasSetWidColumns.map(item => item.width)
-        const CountableWid = widArray.reduce((prev, curr) => (prev ? prev : 0) + (curr ? curr : 0), 0);
-        //初始化cell长度
+        const CountableWid = widArray.reduce((prev, curr) => (prev || 0) + (curr || 0), 0);
+        // 初始化cell长度
         const a = columns.map((item, index) => {
 
             if (index == 0) {
                 // console.log({...item,width:(100-(CountableWid?CountableWid:0))/needCountWidCloumnsNum});
-                return item.width ? item : { ...item, width: (100 - (CountableWid ? CountableWid : 0)) / needCountWidCloumnsNum }
+                return item.width ? item : { ...item, width: (100 - (CountableWid || 0)) / needCountWidCloumnsNum }
             }
 
 
-            const beichushu = 100 - (CountableWid ? CountableWid : 0);
+            const beichushu = 100 - (CountableWid || 0);
             const chushu = needCountWidCloumnsNum;
 
             return item.width ? item : { ...item, width: (beichushu / chushu) }
@@ -124,11 +124,11 @@ const MccsLightTable: React.FC<{
         // ]);
     }, []);
 
-    //自定义渲染表格内容
+    // 自定义渲染表格内容
     const renderTableRow = (data: any) => {
         const { pfmDataDirectoryList: list, gradeLevel: grade } = data;
         const _cpcolumns = Object.assign([], renderColumns);
-        _cpcolumns.splice(0, 1);  //剔除第一个
+        _cpcolumns.splice(0, 1);  // 剔除第一个
 
         const headWid = renderColumns[0] && renderColumns[0].width ? renderColumns[0].width : 0;
 
@@ -143,7 +143,7 @@ const MccsLightTable: React.FC<{
                                     {
                                         _cpcolumns.map((v: any, k: any) => {
                                             let cellValue = item[v.key];
-                                            //自定义value结果
+                                            // 自定义value结果
                                             if (v.render) {
                                                 cellValue = v.render(item)
                                             }

+ 4 - 4
src/components/MccsLightTable/typings.d.ts

@@ -12,9 +12,9 @@ import MccsLightTable from ".";
 
 declare namespace MccsLightTableTypes {
        type MccsLightTableColumn = {
-            key:any,
-            title:string,
-            width?:number,
-            render?:(data:any)=>ReatNode
+            key: any,
+            title: string,
+            width?: number,
+            render?: (data: any) => ReatNode
        }
 }

+ 5 - 5
src/components/MccsModal/index.tsx

@@ -19,12 +19,12 @@ import {
 
 
 
-//卡片组件,使用参考antD pro ModalForm
+// 卡片组件,使用参考antD pro ModalForm
 
 type MccsModalProps = {
-    title:string,
-    visible:boolean,
-    onVisibleChange?:(bool:boolean)=>void,
+    title: string,
+    visible: boolean,
+    onVisibleChange?: (bool: boolean) => void,
     [propName: string]: any;
 }
 
@@ -50,7 +50,7 @@ const MccsModal: React.FC<MccsModalProps> = (props) => {
       }}
       {...restProps}
     >
-      <MccsModalContext.Provider value={{formRef:formRef}}>
+      <MccsModalContext.Provider value={{formRef}}>
          {children}
       </MccsModalContext.Provider> 
    </ModalForm>

+ 1 - 3
src/components/MccsModal/typings.d.ts

@@ -11,7 +11,5 @@
 
 
 declare namespace MccsModal {
-    type MccsModalContextT = {
-         [propsName:string]:any
-    }
+    type MccsModalContextT = Record<string, any>
 }

+ 10 - 14
src/components/MccsPageContainer/index.tsx

@@ -12,33 +12,29 @@ import ProForm, {
 import { useModel,history } from 'umi';
 import './index.less';
 
-import {menuDataItemType} from '@/app';
+import type {menuDataItemType} from '@/app';
 
 import IframePage from '@/components/iframePage/index';
 
 
-type MccsPageContainerType = {
-    [key:string]:any
-}
+type MccsPageContainerType = Record<string, any>
 
 const getCurrentRoutesData = (data: menuDataItemType[], path: string) => {
     let result;
-    function looper (arr:menuDataItemType[]){
+    function looper (arr: menuDataItemType[]){
         for (const element of arr) {
             if (element.path == path) {
                 result =  element
-            } else {
-                if (element.children && element.children.length > 0) {
+            } else if (element.children && element.children.length > 0) {
                     looper(element.children);
                 }
-            }
         }
     }
     looper(data);
     return result;
 }
 
-const MccsPageContainer:React.FC<MccsPageContainerType> = (props)=>{
+const MccsPageContainer: React.FC<MccsPageContainerType> = (props)=>{
     /**
      * @param {*} children 
      * @param {Object} config  //组件配置信息,参考ProComponent ProContainer
@@ -58,7 +54,7 @@ const MccsPageContainer:React.FC<MccsPageContainerType> = (props)=>{
     useEffect(() => {
       
         if (goSetting) {
-            //设置触发
+            // 设置触发
             Modal.confirm({
                 title: '密码设置',
                 icon: null,
@@ -100,15 +96,15 @@ const MccsPageContainer:React.FC<MccsPageContainerType> = (props)=>{
                             password,
                             rePassword
                         }
-                        resetPasswordHandle?.(params).then((bool:boolean)=>{
+                        resetPasswordHandle?.(params).then((bool: boolean)=>{
                                 if(bool){
-                                    update((t:any) => ({ ...t, goSetting: false }))
+                                    update((t: any) => ({ ...t, goSetting: false }))
                                 }
                         })
                     }
                 },
                 closable: false,
-                onCancel: () => update((t:any) => ({ ...t, goSetting: false }))
+                onCancel: () => update((t: any) => ({ ...t, goSetting: false }))
             })
         }
     }, [goSetting]);
@@ -116,7 +112,7 @@ const MccsPageContainer:React.FC<MccsPageContainerType> = (props)=>{
     useEffect(()=>{
         const { location: { pathname } } = history;
         if (menu) {
-            const currentRouteData:any = getCurrentRoutesData(menu, pathname);
+            const currentRouteData: any = getCurrentRoutesData(menu, pathname);
             if(currentRouteData){
                 setIframeUrl(currentRouteData.softUrl);
             }else{

+ 6 - 6
src/components/MccsProCard/index.tsx

@@ -13,14 +13,14 @@ import React from 'react'
 import ProCard from '@ant-design/pro-card';
 import './style.less';
 
-//卡片组件,参考antD ProCard
+// 卡片组件,参考antD ProCard
 
 type MccsProCardProps = {
-    gutter?:number,
-    ghost?:boolean,
+    gutter?: number,
+    ghost?: boolean,
     isProCard?: boolean,
-    colSpan?:number | string,
-    direction?:"column" | "row" | undefined,
+    colSpan?: number | string,
+    direction?: "column" | "row" | undefined,
     [propName: string]: any;
 }
 
@@ -38,7 +38,7 @@ const MccsProCard: React.FC<MccsProCardProps> = (props) => {
 };
 
 
-//参考 源码:https://github.com/ant-design/pro-components/blob/master/packages/card/src/ProCard.tsx
+// 参考 源码:https://github.com/ant-design/pro-components/blob/master/packages/card/src/ProCard.tsx
 MccsProCard.isProCard = true;
 
 export default MccsProCard

+ 13 - 13
src/components/MccsProFormSelect/index.tsx

@@ -12,7 +12,7 @@ import React,{ useState,useEffect } from 'react'
 import {
     ProFormSelect,
 } from '@ant-design/pro-form';
-import { ProFormSelectProps } from '@ant-design/pro-form/lib/components/Select';
+import type { ProFormSelectProps } from '@ant-design/pro-form/lib/components/Select';
 import { Input,Form } from 'antd';
 
 
@@ -21,25 +21,25 @@ import './style.less';
 
 
 type MccsSelectProps = {
-    withInput?: boolean, //是否带有输入功能
-    selectList?: { label: string, value: string }[], //select可选项
-    value?:string|number,
-    onChange?:(val:any)=>void
+    withInput?: boolean, // 是否带有输入功能
+    selectList?: { label: string, value: string }[], // select可选项
+    value?: string|number,
+    onChange?: (val: any) => void
 } & ProFormSelectProps
 
-//props 参考proComponent
-const MccsSelect = (props:MccsSelectProps) => {
+// props 参考proComponent
+const MccsSelect = (props: MccsSelectProps) => {
 
     const { withInput, fieldProps, selectList,name,label,value,onChange,...restProperty } = props;
     const [selectMode, setSelectMode] = useState<'SELECT' | 'INPUT'>('SELECT');
-    const [keyValue,setKeyValue] = useState<string>('');  //输入关键字
+    const [keyValue,setKeyValue] = useState<string>('');  // 输入关键字
     const [find,setFind] = useState(false);
 
 
     const onSearchHandle = (val: string) => {
         setKeyValue(val);
         if (selectList&&withInput&&val.length>0) {
-            //且需要带有输入框时
+            // 且需要带有输入框时
             const findeIndex = selectList.findIndex((t) => {
                 return t.value == val;
             });
@@ -53,11 +53,11 @@ const MccsSelect = (props:MccsSelectProps) => {
         }
     }
 
-    const inputOnChange = (e:any)=>{
+    const inputOnChange = (e: any)=>{
         // console.log(e.target.value);
         setKeyValue(e.target.value);
         if (selectList&&withInput) {
-            //且需要带有输入框时
+            // 且需要带有输入框时
             const findeIndex = selectList.findIndex((t) => {
                 return t.value == e.target.value;
             });
@@ -69,10 +69,10 @@ const MccsSelect = (props:MccsSelectProps) => {
         }
     }
 
-    const onSelectionchange = (values:any)=>{
+    const onSelectionchange = (values: any)=>{
         // console.log({values});
         if(withInput){
-            //带有输入框且单选的时候
+            // 带有输入框且单选的时候
             if(Object.prototype.toString.call(values) == '[object String]'){
                 setKeyValue(values);
             }

+ 9 - 9
src/components/MccsRecordList/index.tsx

@@ -31,8 +31,8 @@ const MccsRecordList: React.FC<MccsRecordList.propsType> = (props) => {
     }
 
     const actionHandle = (supIndex: number, subIndex: number, lowerIndex: number) => {
-        let _data = data;
-        actionFunc && actionFunc(_data[supIndex].details[subIndex].historyRecords[lowerIndex]);  //返回true表示服务器删除成功!
+        const _data = data;
+        actionFunc && actionFunc(_data[supIndex].details[subIndex].historyRecords[lowerIndex]);  // 返回true表示服务器删除成功!
 
     }
 
@@ -96,11 +96,11 @@ const MccsRecordList: React.FC<MccsRecordList.propsType> = (props) => {
 
     return (
         <div className='mccsRecordList'>
-            <div className="mccsRecordListTitle">{title ? title : '标题'}</div>
+            <div className="mccsRecordListTitle">{title || '标题'}</div>
             {
                 data.length == 0 && (
-                    //空数据
-                    <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}></Empty>
+                    // 空数据
+                    <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
                 )
             }
             {
@@ -162,13 +162,13 @@ const MccsRecordList: React.FC<MccsRecordList.propsType> = (props) => {
                                                                                         return (
                                                                                             <React.Fragment key={i}>
                                                                                                 {
-                                                                                                    i == 0 && ( //当前版本
-                                                                                                        <Timeline.Item dot={<span className='timeLineDot'></span>} >
+                                                                                                    i == 0 && ( // 当前版本
+                                                                                                        <Timeline.Item dot={<span className='timeLineDot' />} >
                                                                                                             <div className='timeLineNode on'>
                                                                                                                 <div className='version'>{val.versionName}</div>
                                                                                                                 <div className='actionPeople'>{`上传人:${val.name}`}</div>
                                                                                                                 <div className='time'>{val.time}</div>
-                                                                                                                <span className='action' onClick={() => actionHandle(index, detailListIndex, i)}></span>
+                                                                                                                <span className='action' onClick={() => actionHandle(index, detailListIndex, i)} />
                                                                                                             </div>
                                                                                                         </Timeline.Item >
                                                                                                     )
@@ -180,7 +180,7 @@ const MccsRecordList: React.FC<MccsRecordList.propsType> = (props) => {
                                                                                                                 <div className='version'>{val.versionName}</div>
                                                                                                                 <div className='actionPeople'>{`上传人:${val.name}`}</div>
                                                                                                                 <div className='time'>{val.time}</div>
-                                                                                                                <span className='action' onClick={() => actionHandle(index, detailListIndex, i)}></span>
+                                                                                                                <span className='action' onClick={() => actionHandle(index, detailListIndex, i)} />
                                                                                                             </div>
                                                                                                         </Timeline.Item >
                                                                                                     )

+ 19 - 19
src/components/MccsRecordList/typings.d.ts

@@ -11,34 +11,34 @@
 declare namespace MccsRecordList {
 
       type propsType = {
-        title:string,
-        list?:MccsRecordListType|[],
-        actionFunc?:(data:historyRecordsItem)=>void,  //删除历史版本回调
-        actionText?:string,
-        actionNode?:(item?:MccsRecordListItemInnerDetail)=>ReactNode,  //记录操作按钮
+        title: string,
+        list?: MccsRecordListType|[],
+        actionFunc?: (data: historyRecordsItem) => void,  // 删除历史版本回调
+        actionText?: string,
+        actionNode?: (item?: MccsRecordListItemInnerDetail) => ReactNode,  // 记录操作按钮
       }
 
       type historyRecordsItem = {
-        versionName:string,
-        name:string,
-        time:string,
-        id:number
+        versionName: string,
+        name: string,
+        time: string,
+        id: number
       }
       
       type MccsRecordListItemInnerDetail = {
-        name:string,
-        fileName:string,
-        fileUrl:string,
-        createTime:string,
-        recordTypeName?:string,
-        accountType?:string,
-        cateId?:number,
-        historyRecords:historyRecordsItem[]|[]
+        name: string,
+        fileName: string,
+        fileUrl: string,
+        createTime: string,
+        recordTypeName?: string,
+        accountType?: string,
+        cateId?: number,
+        historyRecords: historyRecordsItem[]|[]
       }
 
       type MccsRecordListItem = {
-          evaluation:string,
-          details:MccsRecordListItemInnerDetail[]
+          evaluation: string,
+          details: MccsRecordListItemInnerDetail[]
       }
 
       type MccsRecordListType = MccsRecordListItem[]

+ 4 - 4
src/components/MccsScoreBanner/index.tsx

@@ -16,14 +16,14 @@ import './index.less'
 
 
 type ScoreListItem = {
-     label:string,
-     value:string
+     label: string,
+     value: string
 }
 type MccsScoreBannerProps = {
-     list:ScoreListItem[]
+     list: ScoreListItem[]
 }
 
-const MccsScoreBanner:React.FC<MccsScoreBannerProps>=(props)=>{
+const MccsScoreBanner: React.FC<MccsScoreBannerProps>=(props)=>{
     const {list=[]} = props;
     return (
         <div className='MccsScoreBanner'>

+ 8 - 1
src/components/MccsTable/index.tsx

@@ -1,9 +1,16 @@
 /*
  * @Author: your name
+<<<<<<< HEAD
  * @Date: 2022-03-09 10:08:00
  * @LastEditTime: 2022-03-09 14:13:03
  * @LastEditors: your name
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+=======
+ * @Date: 2021-09-14 11:14:06
+ * @LastEditTime: 2022-03-07 11:00:11
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+>>>>>>> master
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsTable/index.tsx
  */
 
@@ -23,7 +30,7 @@ const MccsTable=React.forwardRef<MccsTable.MccsTableRef,MccsTable.MccsTable>((pr
     const formRef = useRef<ProFormInstance>();
     const tableRef =useRef<ActionType>(); 
 
-    const processColumns = (colums:MccsTable.Columns[])=>{
+    const processColumns = (colums: MccsTable.Columns[])=>{
          return colums.map((item,index)=>{
                 return {
                      ...item,

+ 7 - 7
src/components/MccsTable/typings.d.ts

@@ -28,17 +28,17 @@ declare namespace MccsTable {
     };
 
     type Columns = {
-        title?:string,
-        key?:string,
-        [propsName:string]:any
+        title?: string,
+        key?: string,
+        [propsName: string]: any
     }
 
     type MccsTable = {
-        columns:MccsTable.Columns[],
-        [propsName:string]:any
+        columns: MccsTable.Columns[],
+        [propsName: string]: any
     }
     type MccsTableRef = {
-        getFormRef:()=>any,
-        getTableRef:()=>any
+        getFormRef: () => any,
+        getTableRef: () => any
     }|undefined
 }

+ 2 - 2
src/components/MccsUpload/index.tsx

@@ -12,7 +12,7 @@ import React from 'react'
 import { Upload, message, Button } from 'antd';
 import { UploadOutlined } from '@ant-design/icons';
 
-const MccsUpload:React.FC<MccsUpload.propsType> = (props)=>{
+const MccsUpload: React.FC<MccsUpload.propsType> = (props)=>{
     
     const {children,value:fileList,...rest} = props;
 
@@ -31,7 +31,7 @@ const MccsUpload:React.FC<MccsUpload.propsType> = (props)=>{
     return (
         <Upload  defaultFileList={fileList} {...config}  {...rest}>
               {
-                  children?children:(
+                  children || (
                     <Button icon={<UploadOutlined />}>上传文件</Button>
                   )
               }

+ 2 - 2
src/components/MccsUpload/typings.d.ts

@@ -34,7 +34,7 @@ declare namespace MccsUpload {
 
      type propsType = {
        
-         value?:any,
-         [key:string]:any
+         value?: any,
+         [key: string]: any
      }
 }

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

@@ -19,7 +19,7 @@ export type SiderTheme = 'light' | 'dark';
 
 
 const Notice = () => {
-  const list:API.NoticeIconItem[] = [
+  const list: API.NoticeIconItem[] = [
     {
       id: '000000001',
       avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',

+ 3 - 5
src/components/antdProOverwrite/MccsProForm/index.tsx

@@ -12,11 +12,9 @@ import React from 'react'
 import ProForm from '@ant-design/pro-form';
 
 
-type MccsProFormProps = {
-    [propsName:string]:any
-}
-//使用方式参考 antd pro
-const MccsProForm:React.FC<MccsProFormProps> =(props)=>{
+type MccsProFormProps = Record<string, any>
+// 使用方式参考 antd pro
+const MccsProForm: React.FC<MccsProFormProps> =(props)=>{
     const {children} = props;
     return (
         <ProForm 

+ 4 - 4
src/components/antdProOverwrite/MccsProFormText/index.tsx

@@ -16,11 +16,11 @@ import {
 
 
 type MccsProFormTextProps = {
-    type?:'text'|'textArea',
-    [propsName:string]:any
+    type?: 'text'|'textArea',
+    [propsName: string]: any
 }
-//使用方式参考 antd pro
-const MccsProFormText:React.FC<MccsProFormTextProps> =(props)=>{
+// 使用方式参考 antd pro
+const MccsProFormText: React.FC<MccsProFormTextProps> =(props)=>{
     const {type = 'text'} = props;
 
     return (

+ 2 - 2
src/components/iframePage/index.tsx

@@ -8,13 +8,13 @@
  */
 
 
-const IframePage = ({url}:{url:string})=>{
+const IframePage = ({url}: {url: string})=>{
     
     return (
         <>
             {
                 url&&(
-                    <iframe  id="reportFrame" src={`${url}`} width="100%" height="800px"></iframe>
+                    <iframe  id="reportFrame" src={`${url}`} width="100%" height="800px" />
                 )
             }
         </>

+ 1 - 1
src/constant.ts

@@ -9,7 +9,7 @@
 
 
 
-export const getScoreColor = (key:string)=>{
+export const getScoreColor = (key: string)=>{
       
     switch(key){
          case 'A':

+ 1 - 2
src/global.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-14 11:37:33
+ * @LastEditTime: 2022-03-09 17:32:29
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/global.tsx
@@ -78,7 +78,6 @@ if (pwa) {
   serviceWorker.getRegistration().then((sw) => {
     if (sw) sw.unregister();
   });
-
 }
 
 

+ 1 - 1
src/menuIcons.js

@@ -26,7 +26,7 @@ import { SmileOutlined,
 } from '@ant-design/icons';
 
 const iconEnum = {
-  smile: <SmileOutlined></SmileOutlined>,
+  smile: <SmileOutlined />,
   home: <HomeOutlined />,
   picLeft: <PicLeftOutlined />,
   setting: <SettingOutlined />,

+ 4 - 4
src/models/allModels.ts

@@ -30,9 +30,9 @@ export default function allModel() {
     setUser,
     signin,
     signout,
-    accreditationDetail:{...accreditationDetail()}, //评审细则
-    articleManagement:{...articleManagement()},//条文管理
-    ledgerUpload:{...ledgerUpload()}, //台账上传
-    publicData:{...publicData()},//公共资料
+    accreditationDetail:{...accreditationDetail()}, // 评审细则
+    articleManagement:{...articleManagement()},// 条文管理
+    ledgerUpload:{...ledgerUpload()}, // 台账上传
+    publicData:{...publicData()},// 公共资料
   }
 }

+ 1 - 3
src/pages/Admin.tsx

@@ -16,8 +16,6 @@ export default (): React.ReactNode => {
   return (
     <PageHeaderWrapper
       content='This page can only be viewed by admin'
-    >
-
-    </PageHeaderWrapper>
+     />
   );
 };

+ 24 - 28
src/pages/DataManagement/publicData/index.tsx

@@ -35,9 +35,7 @@ type PublicDataType = {
 
 }
 
-type SelectedRowsType = {
-    [propsName: string]: any
-}
+type SelectedRowsType = Record<string, any>
 
 const PublicData: React.FC<PublicDataType> = (props) => {
 
@@ -67,7 +65,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
                     return null;
                 }
                 return (
-                    <ProFormDateRangePicker fieldProps={{ format: 'yyyy-MM-DD',locale:locale }} placeholder={['开始时间', '结束时间']} />
+                    <ProFormDateRangePicker fieldProps={{ format: 'yyyy-MM-DD',locale }} placeholder={['开始时间', '结束时间']} />
                 )
             },
         },
@@ -186,9 +184,9 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
     const [drawerVisible, setDrawerVisible] = useState(false);
 
-    const [selectedRowIds, setSelectedRowIds] = useState<number[]>([]); //条文id
+    const [selectedRowIds, setSelectedRowIds] = useState<number[]>([]); // 条文id
 
-    const [selectedFiles, setSelectedFiles] = useState<any[]>([]);  //文件id
+    const [selectedFiles, setSelectedFiles] = useState<any[]>([]);  // 文件id
 
     const [uploadModalVisible, setUploadModalVisible] = useState(false);
 
@@ -200,14 +198,14 @@ const PublicData: React.FC<PublicDataType> = (props) => {
         return { publicData: model.publicData };
     });
 
-    //搜索回调
+    // 搜索回调
     const searchHandle = (val: any) => {
         publicData.getTreeData(val);
     }
 
     const onSelectHandle = (data: SelectedTreeDataType) => {
         publicData.setCurrentActivedTree(data);
-        //重新获取数据
+        // 重新获取数据
         tableRef?.current?.getTableRef().current?.reload();
     }
 
@@ -217,8 +215,8 @@ const PublicData: React.FC<PublicDataType> = (props) => {
     }
 
     const connectHandle = (records?: any) => {
-        //关联条款 records传参解决useState异步拿不到数据
-        let defaultSelectedAccreditation: number[] = []; //默认选中的条文
+        // 关联条款 records传参解决useState异步拿不到数据
+        let defaultSelectedAccreditation: number[] = []; // 默认选中的条文
 
         if (!records) {
             selectedFiles.map((item: any) => {
@@ -236,18 +234,18 @@ const PublicData: React.FC<PublicDataType> = (props) => {
     }
 
     const delFileHandle = (records: any) => {
-        //删除树结构对应的公共资料
+        // 删除树结构对应的公共资料
         publicData.delTableFlieListFunc(records.id);
     }
 
 
-    //操作回调
+    // 操作回调
     const actionHandle = ({ type, data }: { type: string, data: MccsFileTree.childTree }) => {
 
-        data ? publicData.setCurrentActived(data) : publicData.setCurrentActived(undefined);  //点击获取当前树数据
+        data ? publicData.setCurrentActived(data) : publicData.setCurrentActived(undefined);  // 点击获取当前树数据
 
         if (type == 'del') {
-            //删除
+            // 删除
             setActionType('del');
             if (data) {
                 const { id } = data;
@@ -268,7 +266,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
     const MccsModalFinnishHandle = (values: { name: string, cateType: number }) => {
         //   console.log({values});
-        let parentId = 0;  //默认最顶级为0
+        let parentId = 0;  // 默认最顶级为0
         if (publicData.currentActived) {
             parentId = Number(publicData.currentActived.id)
         }
@@ -289,8 +287,8 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
     const onDrawerVisibleChangeHandle = (bool: boolean) => {
         if (!bool) {
-            setSelectedRowIds([]); //关闭drawer清空
-            tableRef?.current?.getTableRef().current?.clearSelected(); //关闭Drawer清空选中项
+            setSelectedRowIds([]); // 关闭drawer清空
+            tableRef?.current?.getTableRef().current?.clearSelected(); // 关闭Drawer清空选中项
             setSelectedRowIds([]);
             setSelectedFiles([]);
         }
@@ -307,7 +305,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
             ids: selectedFiles.map((t: any) => t.id)
         });
         setDrawerVisible(false);
-        tableRef?.current?.getTableRef().current?.clearSelected(); //关闭Drawer清空选中项
+        tableRef?.current?.getTableRef().current?.clearSelected(); // 关闭Drawer清空选中项
         setSelectedRowIds([]);
         setSelectedFiles([]);
     }
@@ -327,15 +325,15 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
 
     useEffect(() => {
-        //刷新表格数据
+        // 刷新表格数据
         tableRef?.current?.getTableRef().current?.reload();
     }, [publicData.reloadTable])
 
 
     useEffect(() => {
         if (publicData.treeData.length > 0) {
-            //默认展开书结构第一个结点
-            //树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
+            // 默认展开书结构第一个结点
+            // 树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
             console.log(publicData.treeData);
             // const { id } = publicData.treeData[0].childre[0];
             // setDefaultOpened(`${id}`);
@@ -344,7 +342,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
 
     useEffect(() => {
-        //默认获取数据
+        // 默认获取数据
         publicData.getTreeData();
     }, []);
 
@@ -362,8 +360,8 @@ const PublicData: React.FC<PublicDataType> = (props) => {
 
                     <MccsTable
                         columns={drawerTableColumns}
-                        request={async (params:any)=>{
-                              const ids = (selectedFiles.map((t:any)=>t.id)).join(',');
+                        request={async (params: any)=>{
+                              const ids = (selectedFiles.map((t: any)=>t.id)).join(',');
                               return  await publicData.getDrawerTableList(params,ids)
                         }} 
                         search={{
@@ -381,7 +379,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
                                 // const combinIds = selectedRowKeys.concat(_prev);
                                 // // setSelectedRowIds(Array.from(new Set(combinIds)));
                             },
-                            onSelect:(record:any, selected: any, selectedRows: any, nativeEvent: any)=>{
+                            onSelect:(record: any, selected: any, selectedRows: any, nativeEvent: any)=>{
                                 // console.log({record,selected,selectedRows,nativeEvent});
                                 const {id} = record;
                                 const _prev = selectedRowIds;
@@ -402,9 +400,7 @@ const PublicData: React.FC<PublicDataType> = (props) => {
                                 </Space>
                             );
                         }}
-                    >
-
-                    </MccsTable>
+                     />
                 </Form.Item>
             </MccsDrawerForm>
             {

+ 11 - 11
src/pages/DataManagement/publicData/model.ts

@@ -54,7 +54,7 @@ const publicData = () => {
           endDate: date[1],
         });
         const { list = [],totalCount } = resp;
-        //每次刷新完数据将是否刷新置为false
+        // 每次刷新完数据将是否刷新置为false
         setReloadTable(false);
         return {
           data: list,
@@ -91,14 +91,14 @@ const publicData = () => {
     }
   };
 
-  const delTableFlieListFunc = async (id:number)=>{
+  const delTableFlieListFunc = async (id: number)=>{
        const resp = await delTableFlieList(id);
        if(resp){
         setReloadTable(true);
        }
   }
 
-  const getDrawerTableList = async (params:any,ids:string) => {
+  const getDrawerTableList = async (params: any,ids: string) => {
     const resp = await getAllAccreditionLevelFourList({...params,id:ids});
     if (resp) {
       return {
@@ -106,26 +106,26 @@ const publicData = () => {
         success: true,
         total:resp.totalCount
       };
-    }else{
+    }
       return {
         data: [],
         success: true,
       };
-    }
+    
   };
 
   const batchConnectAccreditation = async (data: API.BatchConnectAccreditation) => {
-      //批量关联条款
+      // 批量关联条款
     const resp = await connectAccreditation(data);
     if (resp) {
       setReloadTable(true);
     }
   };
 
-  const uploadFilehandle = async (files:any) => {
+  const uploadFilehandle = async (files: any) => {
     if (currentActivedTree) {
       const { id } = currentActivedTree;
-      const resp = await publicResourceUpload({ id: Number(id), files: files });
+      const resp = await publicResourceUpload({ id: Number(id), files });
       if (resp) {
         setReloadTable(true);
       }
@@ -135,14 +135,14 @@ const publicData = () => {
   };
 
   const batchDownloadResourcePost = async (ids: number[]) => {
-      //批量下载
+      // 批量下载
     if (currentActivedTree) {
       const { cateType } = currentActivedTree;
       if (cateType != undefined) {
         const resp = await batchDownloadResource(ids, cateType);
         if (resp) {
-          let blob = new Blob([resp], { type: 'application/zip' });
-          let url = window.URL.createObjectURL(blob);
+          const blob = new Blob([resp], { type: 'application/zip' });
+          const url = window.URL.createObjectURL(blob);
           const link = document.createElement('a'); // 创建a标签
           link.href = url;
           link.click();

+ 24 - 24
src/pages/DataManagement/publicData/serve.ts

@@ -9,8 +9,8 @@
 
 import { request } from 'umi';
 
-//获取公共资料树结构
-export const getTreeList  = (keyword?:string|number)=>{
+// 获取公共资料树结构
+export const getTreeList  = (keyword?: string|number)=>{
   
     return request('/api/pfm/publicResource/list', {
         method: 'GET',
@@ -19,8 +19,8 @@ export const getTreeList  = (keyword?:string|number)=>{
 
 }
 
-//获取所有四码列表
-export const getAllAccreditionLevelFourList  = (params:any)=>{
+// 获取所有四码列表
+export const getAllAccreditionLevelFourList  = (params: any)=>{
     return request('/api/pfm/publicresource/getByPublicResourceId', {
         method: 'GET',
         params:{...params}
@@ -28,8 +28,8 @@ export const getAllAccreditionLevelFourList  = (params:any)=>{
 
 }
 
-//获取公共资料树结构对应表格数据
-export const getTreeTableList  = (data:API.GetTableListRequestType)=>{
+// 获取公共资料树结构对应表格数据
+export const getTreeTableList  = (data: API.GetTableListRequestType)=>{
   
     return request('/api/pfm/publicresource/getResourceList', {
         method: 'GET',
@@ -39,8 +39,8 @@ export const getTreeTableList  = (data:API.GetTableListRequestType)=>{
 }
 
 
-//新增公共资料树结构
-export const addTreeTableList  = (data:API.AddTableListRequestType)=>{
+// 新增公共资料树结构
+export const addTreeTableList  = (data: API.AddTableListRequestType)=>{
   
     return request('/api/pfm/publicResource/create', {
         method: 'POST',
@@ -49,8 +49,8 @@ export const addTreeTableList  = (data:API.AddTableListRequestType)=>{
 
 }
 
-//修改公共资料树结构
-export const editTreeTableList  = (data:API.EditTableListRequestType)=>{
+// 修改公共资料树结构
+export const editTreeTableList  = (data: API.EditTableListRequestType)=>{
   
     return request('/api/pfm/publicResource/update', {
         method: 'POST',
@@ -60,8 +60,8 @@ export const editTreeTableList  = (data:API.EditTableListRequestType)=>{
 }
 
 
-//关联条款
-export const connectAccreditation  = (data:API.BatchConnectAccreditation)=>{
+// 关联条款
+export const connectAccreditation  = (data: API.BatchConnectAccreditation)=>{
   
     return request('/api/pfm/publicresource/updateBatchArticles', {
         method: 'POST',
@@ -70,8 +70,8 @@ export const connectAccreditation  = (data:API.BatchConnectAccreditation)=>{
 
 }
 
-//删除公共资料树结构
-export const delTreeTableList  = (id:number[])=>{
+// 删除公共资料树结构
+export const delTreeTableList  = (id: number[])=>{
   
     return request('/api/pfm/publicResource/delete', {
         method: 'POST',
@@ -80,8 +80,8 @@ export const delTreeTableList  = (id:number[])=>{
 
 }
 
-//删除树结构对应的公共资料
-export const delTableFlieList  = (id:number)=>{
+// 删除树结构对应的公共资料
+export const delTableFlieList  = (id: number)=>{
   
     return request('/api/pfm/publicresource/deleteResource', {
         method: 'POST',
@@ -92,10 +92,10 @@ export const delTableFlieList  = (id:number)=>{
 
 
 
-//公共资料上传
-export const publicResourceUpload  = (data:{files:any,id:number})=>{
-    let formData = new FormData();
-    data.files.map((t:any)=>{
+// 公共资料上传
+export const publicResourceUpload  = (data: {files: any,id: number})=>{
+    const formData = new FormData();
+    data.files.map((t: any)=>{
         formData.append('file',t.originFileObj);
     })
     formData.set('id',`${data.id}`);
@@ -106,8 +106,8 @@ export const publicResourceUpload  = (data:{files:any,id:number})=>{
 
 }
 
-//删除公共资料
-export const delPublicResource  = (id:number[])=>{
+// 删除公共资料
+export const delPublicResource  = (id: number[])=>{
   
     return request('/api/pfm/publicResource/delete', {
         method: 'POST',
@@ -116,8 +116,8 @@ export const delPublicResource  = (id:number[])=>{
 
 }
 
-//公共资料批量下载
-export const batchDownloadResource  = (ids:number[],cateType:number)=>{
+// 公共资料批量下载
+export const batchDownloadResource  = (ids: number[],cateType: number)=>{
   
     return request('/api/pfm/publicResource/downloadCates', {
         method: 'GET',

+ 18 - 18
src/pages/DataManagement/publicData/typings.d.ts

@@ -8,39 +8,39 @@
  */
 
 type ArticlesList = {
-    ruleId:number,  //条文ID
-    ruleStr:string, //四码
+    ruleId: number,  // 条文ID
+    ruleStr: string, // 四码
 }
 
 interface SelectedTreeDataType extends MccsFileTree.childTree {
-    cateType?:number
+    cateType?: number
 }
 
 declare namespace API {
      type GetTableListRequestType = {
-        id:number,
-        cateType:string,
-        current?:number,
-        pageSize?:number,
-        keyword?:string,
-        fileType?:string,
-        startDate?:string,
-        endDate?:string
+        id: number,
+        cateType: string,
+        current?: number,
+        pageSize?: number,
+        keyword?: string,
+        fileType?: string,
+        startDate?: string,
+        endDate?: string
      }
 
      type AddTableListRequestType = {
-        parentId:number,
-        name:string,
-        cateType:number
+        parentId: number,
+        name: string,
+        cateType: number
      }
 
      type EditTableListRequestType = {
-        id:number,
-        name:string
+        id: number,
+        name: string
      }
 
      type BatchConnectAccreditation = {
-        articlesList:number[],
-        ids:number[],
+        articlesList: number[],
+        ids: number[],
      }
 }

+ 18 - 18
src/pages/GradeHospitalAccreditation/accreditationDetail/components/FormList/index.tsx

@@ -20,7 +20,7 @@ import './index.less'
 
 const { TextArea } = Input;
 
-let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((props,ref) => {
+const FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((props,ref) => {
 
     const [data, setData] = useState<FormList.MapList[]>([]);
     const {formContext} = props;
@@ -29,8 +29,8 @@ let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((p
     // console.log({props,providerData});
 
 
-    const formHandle = (type:string,supKey:number|string) => {
-        let tempData = data;
+    const formHandle = (type: string,supKey: number|string) => {
+        const tempData = data;
         if(type=='add'){
             const newFormObj: FormList.MapList = {
                 key:new Date().getTime(),
@@ -54,10 +54,10 @@ let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((p
         
     }
 
-    const textAreaHandle = (type:string,supKey:number|string,subKey?:number|string) => {
+    const textAreaHandle = (type: string,supKey: number|string,subKey?: number|string) => {
         // console.log({type,supKey,subKey});
-        let tempData = data;
-        let needUpdateItem = (tempData.filter(item=>item.key == supKey ))[0];
+        const tempData = data;
+        const needUpdateItem = (tempData.filter(item=>item.key == supKey ))[0];
 
         if(type=='add'){
             const newObj = {key:new Date().getTime(),detail:''};
@@ -75,23 +75,23 @@ let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((p
     }
 
     
-    const setInputVal = (val:any,supKey:string|number,subKey?:string|number)=>{
+    const setInputVal = (val: any,supKey: string|number,subKey?: string|number)=>{
         //  console.log(val.target.value,supKey,subKey);
-         let copiedData = data;
-         let currentGroup = (copiedData.filter(item=>item.key==supKey))[0]; //选出父级
+         const copiedData = data;
+         const currentGroup = (copiedData.filter(item=>item.key==supKey))[0]; // 选出父级
 
          if(subKey||subKey==0){
-             //单个修改
-            let currentChildInputTextArea = (currentGroup.list.filter(val=>val.key ==subKey ))[0]; //选出子集
+             // 单个修改
+            const currentChildInputTextArea = (currentGroup.list.filter(val=>val.key ==subKey ))[0]; // 选出子集
 
-            if(typeof val == 'object'){
-               //来自ChangeEvent时
+            if(typeof val === 'object'){
+               // 来自ChangeEvent时
                currentChildInputTextArea.detail = val?.target.value;
             }else {
                currentChildInputTextArea.detail = val;
             }
          }else {
-             //批量删除
+             // 批量删除
              currentGroup.list.forEach((val,i)=>{
                 val.detail = ''
              });
@@ -101,9 +101,9 @@ let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((p
     }
 
 
-    const selecterChangeHandle = (value:any,index:number)=>{
+    const selecterChangeHandle = (value: any,index: number)=>{
         //  console.log({value});
-         let copiedData = data;
+         const copiedData = data;
          copiedData[index].evaluation = value;
     }
 
@@ -112,10 +112,10 @@ let FormList = forwardRef<FormList.FormListRefCurrent,FormList.FormListProps>((p
         const { data = [] } = props;
         const _data = data.map((item,index)=>{
               const {detail:list,evaluation} = item;
-              const tempList = list.map((val:any,i:number)=>({key:i,detail:val.title}));
+              const tempList = list.map((val: any,i: number)=>({key:i,detail:val.title}));
               return {
                    key:index,
-                   evaluation:evaluation,
+                   evaluation,
                    list:tempList
               }
         });

+ 9 - 9
src/pages/GradeHospitalAccreditation/accreditationDetail/components/FormList/typings.d.ts

@@ -10,29 +10,29 @@
 
 declare namespace FormList {
     type MapList = {
-        key:string|number,
-        evaluation?:string,
+        key: string|number,
+        evaluation?: string,
         list: {
-            key:string|number,
-            detail:string,
+            key: string|number,
+            detail: string,
             [propsName: string]: any
         }[],
         [propsName: string]: any
     }
 
     type SelecterItem = {
-        label:string,
-        value:string|number
+        label: string,
+        value: string|number
     }
     
     type FormListProps = {
         data?: MapList[],
-        selecterList:SelecterItem[],
-        onFinnish?:()=>void,
+        selecterList: SelecterItem[],
+        onFinnish?: () => void,
         [propsName: string]: any
     }
     
     type FormListRefCurrent = {
-        getData:()=>MapList[]
+        getData: () => MapList[]
     }
 }

+ 32 - 10
src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/index.tsx

@@ -1,17 +1,17 @@
 /*
  * @Author: your name
  * @Date: 2021-12-07 09:28:41
- * @LastEditTime: 2021-12-14 14:34:15
+ * @LastEditTime: 2022-02-28 14:11:18
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/index.tsx
  */
 
 
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState,useRef } from 'react';
 import MccsSelect from '@/components/MccsProFormSelect/index';
 
-import { Input, Row, Col, Button, Checkbox, Divider, Pagination, Empty,Spin } from 'antd';
+import { Input, Row, Col, Button, Checkbox, Divider, Pagination, Empty,Spin,Tooltip } from 'antd';
 
 import './style.less';
 import { CheckboxChangeEvent } from 'antd/lib/checkbox';
@@ -22,13 +22,38 @@ const { Search } = Input;
 const TableItem: React.FC<any> = ({ data, actionHandle,checkBoxChangeHandle }) => {
 
     //注意!!!!data类型有待补充
+    const textWraperSpanRef = useRef(null);
+    const subTextRef = useRef(null);
+    const [ifShowTip,setIfShowTip] = useState(false);
+    const [ifHasMore,setifHasMore] = useState(false);
+
+    const onVisibleChangeHanfle = (bool:boolean)=>{
+         if(bool){
+            setIfShowTip(ifHasMore);
+         }else{
+            setIfShowTip(false);
+         }
+    }
+
+    useEffect(()=>{
+        if(textWraperSpanRef.current&&subTextRef.current){
+            setifHasMore(textWraperSpanRef.current['clientWidth'] > subTextRef.current['clientWidth'])
+        }
+    },[]);
 
     return (
         <div className='tableChild'>
+            {
+                //用于测量渲染出文案的长度
+            }
+            <div ref={textWraperSpanRef} style={{height:0.1,position:'absolute',visibility:'hidden'}}>{`档次:${data.grade}   目录:${data.directory}`}</div>
+
             <Checkbox className='check' onChange={(e:CheckboxChangeEvent)=>checkBoxChangeHandle(e,data)} />
-            <div className='tableChildContent'>
-                <div className='mainText'>{`${data.sort}.${data.profileName}`}</div>
-                <div className='subText'>{`档次:${data.grade}   目录:${data.directory}`}</div>
+            <div className='tableChildContent' ref={subTextRef}>
+                {(data.sort&&data.profileName)&&<div className='mainText'>{`${data.sort}.${data.profileName}`}</div>}
+                <Tooltip title={`档次:${data.grade}   目录:${data.directory}`} visible={ifShowTip} onVisibleChange={onVisibleChangeHanfle}>
+                    <div className='subText' >{`档次:${data.grade}   目录:${data.directory}`}</div>
+                </Tooltip>
             </div>
             <div className='action'>
                 <a onClick={() => actionHandle('EDIT',[data])}>修改</a><Divider type='vertical' /><a onClick={() => actionHandle('DEL',[data])}>删除</a>
@@ -39,7 +64,7 @@ const TableItem: React.FC<any> = ({ data, actionHandle,checkBoxChangeHandle }) =
 
 const MaterialTable: React.FC<MaterialTable.MaterialTableProps> = (props) => {
 
-    const { selectOptions, request, addHandle, tableItemActionHandle, reload } = props;
+    const { selectOptions, request, addHandle, tableItemActionHandle } = props;
     const [list, setList] = useState<any[]>([]);
     const [selectorFilter, setSelectorFilter] = useState<string>('');  //下拉筛选
     const [keyword, setKeyword] = useState<string>('');
@@ -100,9 +125,6 @@ const MaterialTable: React.FC<MaterialTable.MaterialTableProps> = (props) => {
         }
     }
 
-    // useEffect(()=>{
-    //      console.log({checkedList});
-    // },[checkedList]);
 
     useEffect(() => {
         //刷新数据

+ 25 - 0
src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/style.less

@@ -50,7 +50,13 @@
                  margin-right: 2%;
              }
              .tableChildContent {
+                 display: flex;
+                 flex-direction: row;
+                 justify-content: flex-start;
+                 align-items: center;
+                 width: 78%;
                  .mainText {
+                    width: 100%;
                     font-size: 14px;
                     font-family: SourceHanSansCN-Normal, SourceHanSansCN;
                     font-weight: 400;
@@ -61,6 +67,8 @@
                     text-overflow: ellipsis;
                  }
                  .subText {
+                    position: relative;
+                    width: 100%;
                     font-size: 12px;
                     font-family: SourceHanSansCN-Normal, SourceHanSansCN;
                     font-weight: 400;
@@ -68,6 +76,23 @@
                     overflow: hidden;
                     white-space: nowrap;
                     text-overflow: ellipsis;
+                    &>span {
+                        display: inline-block;
+                        white-space:nowrap;
+                        
+                    }
+
+                    // &.more {
+                    //     &::after {
+                    //         // position: absolute;
+                    //         // right: 0;
+                    //         // z-index: 99;
+                    //         display: inline-block;
+                    //         content: '...';
+                    //         background-color: #fff;
+
+                    //     }
+                    // }
                  }
              }
              .action {

+ 12 - 12
src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/typings.d.ts

@@ -11,23 +11,23 @@
 declare namespace MaterialTable {
 
     type GeDataParams = {
-        selectorFilter?:string,
-        keyword?:string,
-        pageSize:number,
-        current:number,
+        selectorFilter?: string,
+        keyword?: string,
+        pageSize: number,
+        current: number,
     }
 
     type MaterialTableProps = {
         selectOptions?: { label: string, value: string }[],
-        request?:(params:GeDataParams)=>Promise<{
-            total:number,//总数
-            pageSize:number,
-            current:number,
-            list:any[],
+        request?: (params: GeDataParams) => Promise<{
+            total: number,// 总数
+            pageSize: number,
+            current: number,
+            list: any[],
         }|undefined>
-        addHandle?:()=>void,
-        reload?:boolean,
-        tableItemActionHandle?:(type:'DEL'|"EDIT",data:any[])=>Promise<boolean|null>,
+        addHandle?: () => void,
+        reload?: boolean,
+        tableItemActionHandle?: (type: 'DEL'|"EDIT",data: any[]) => Promise<boolean|null>,
     }
     
 }

+ 41 - 54
src/pages/GradeHospitalAccreditation/accreditationDetail/index.tsx

@@ -2,7 +2,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-06 09:07:56
- * @LastEditTime: 2022-01-05 14:29:11
+ * @LastEditTime: 2022-02-28 14:42:14
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/accreditationDetail/index.tsx
@@ -63,7 +63,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
   const { getTreeData, treeData, delDetailRuleHandle, addDetailRuleHandle, editDetailRulehandle, detailRuleList, getDetailRuleListHandle, setDetailRuleList, ...restAccreditationModel } = accreditationDetail;
 
 
-  const [mode, setMode] = useState(1); //1,2
+  const [mode, setMode] = useState(1); // 1,2
   const [currentActived, setCurrentActived] = useState<API.ResultTreeDataItem | treeItem>();
 
   const [isLeaf, setIsLeaf] = useState(false);
@@ -76,37 +76,37 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
   const [formDefaultData, setFormDefaultData] = useState<any>(undefined);
   const [defaultOpened, setDefaultOpened] = useState<string>();
 
-  const [selectOptions, setSelectOptions] = useState<{ label: string, value: string }[]>([]); //资料目录表格下拉筛选
+  const [selectOptions, setSelectOptions] = useState<{ label: string, value: string }[]>([]); // 资料目录表格下拉筛选
 
-  const [showCardThree, setShowCardThree] = useState(false);  //是否展示资料目录栏
-  const [materialDirModalVisible, setMaterialDirModalVisible] = useState(false); //资料目录弹窗展示/掩藏
-  const [allMaterialDirList, setAllMaterialDirList] = useState<{ label: string, value: string }[]>([]); //所有可选的资料目录
-  const [editMaterialDir,setEditMaterialDir] = useState(false); //是否编辑资料目录数据
-  const [currentEditMaterialDir,setCurrentEditMaterialDir] = useState<API.MaterialDirListItem>(); //当前编辑的资料目录项数据
-  const [reloadMaterialDirData,setReloadMaterialDirData] = useState(false);  //是否刷新资料目录数据
+  const [showCardThree, setShowCardThree] = useState(false);  // 是否展示资料目录栏
+  const [materialDirModalVisible, setMaterialDirModalVisible] = useState(false); // 资料目录弹窗展示/掩藏
+  const [allMaterialDirList, setAllMaterialDirList] = useState<{ label: string, value: string }[]>([]); // 所有可选的资料目录
+  const [editMaterialDir,setEditMaterialDir] = useState(false); // 是否编辑资料目录数据
+  const [currentEditMaterialDir,setCurrentEditMaterialDir] = useState<API.MaterialDirListItem>(); // 当前编辑的资料目录项数据
+  const [reloadMaterialDirData,setReloadMaterialDirData] = useState(false);  // 是否刷新资料目录数据
 
   const onSelectHandle = (data: treeItem) => {
 
-    setCurrentActived(data);  //设置当前树数据
+    setCurrentActived(data);  // 设置当前树数据
     const { isLeaf, children, id, code, version = 'ZJ201901' } = data;
 
     if (isLeaf) {
-      //叶子结点
+      // 叶子结点
       setIsLeaf(true);
       getDetailRuleListHandle(id);
-      //获取四码对应所有档次
+      // 获取四码对应所有档次
       getMaterialListGradesFunc(code, version);
       setMode(2);
       setShowCardThree(true);
-      //每次切换叶子节点刷新资料目录表格数据
+      // 每次切换叶子节点刷新资料目录表格数据
       setReloadMaterialDirData(true);
 
     } else {
-      //文件夹结点
+      // 文件夹结点
       setMode(1);
       setIsLeaf(false);
       setShowCardThree(false);
-      let tempArr = children ? children.map((item) => ({
+      const tempArr = children ? children.map((item) => ({
         title: item.title,
         code: item.code,
         id: item.id,
@@ -114,13 +114,13 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
       setChildRuleList(tempArr);
     }
   }
-  //操作回调
+  // 操作回调
   const actionHandle = ({ type, data }: { type: string, data: treeItem | null }) => {
 
-    data ? setCurrentActived(data) : setCurrentActived(undefined);  //点击获取当前树数据
+    data ? setCurrentActived(data) : setCurrentActived(undefined);  // 点击获取当前树数据
 
     if (type == 'del') {
-      //删除
+      // 删除
       setActionType('del');
       if (data) {
         const { id } = data;
@@ -139,12 +139,12 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
       setModalVisible(true);
     }
   }
-  //左侧树搜索回调
+  // 左侧树搜索回调
   const searchHandle = (val: any) => {
     getTreeData(val);
   }
 
-  //获取该四码所有档次
+  // 获取该四码所有档次
   const getMaterialListGradesFunc = async (code: string, version: string) => {
     const gadeList = await getMaterialListGrades({ numStr: code, version });
     if (gadeList) {
@@ -153,7 +153,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
     }
   }
 
-  //获取叶子节点下资料目录表格数据
+  // 获取叶子节点下资料目录表格数据
   const getMaterialListFunc = async (params: MaterialTable.GeDataParams) => {
     const { selectorFilter, keyword,pageSize=10,current } = params;
     if (currentActived) {
@@ -178,7 +178,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
   }
 
   const getMaterialDirListFunc = async () => {
-    //获取所有资料目录集合用于弹窗表单
+    // 获取所有资料目录集合用于弹窗表单
     if (currentActived) {
       const { code, version } = currentActived;
       const resp = await getMaterialDirList({ numStr: code, version });
@@ -189,7 +189,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
   }
 
   const addMaterialDirHandle = () => {
-    //新增资料目录数据
+    // 新增资料目录数据
     setEditMaterialDir(false);
     setMaterialDirModalVisible(true);
   }
@@ -206,12 +206,12 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
     profileName: string,
 
   }
-  //资料目录弹窗表单提交
+  // 资料目录弹窗表单提交
   const mateialDirModalFinishHandle = async (values: mateialDirModalValues) => {
     console.log('commit', values);
     const { grade, ...restVals } = values;
     if(editMaterialDir&&currentEditMaterialDir){
-      //编辑
+      // 编辑
       const resp = await editMaterialDirList({
         grade: grade.join(','),
         id:currentEditMaterialDir.id,
@@ -224,7 +224,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
         return true;
       }
     }else{
-      //新增
+      // 新增
       if (currentActived) {
         const { code, version, id } = currentActived;
         const resp = await addMaterialDirList({
@@ -243,14 +243,14 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
     
   }
 
-  //资料目录表格删除/编辑回调
+  // 资料目录表格删除/编辑回调
   const tableItemActionHandle = async (type: 'DEL' | "EDIT", data: API.MaterialDirListItem[]) => {
     if (type == 'DEL') {
       if (await delMaterialDirList(data.map(t=>t.id))) {
         return true
-      } else {
+      } 
         return false
-      }
+      
     }
 
     if (type == 'EDIT') {
@@ -282,9 +282,9 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
       if (actionType == 'add') {
 
         let details: any = [];
-        const { levelNum = 0 } = currentActived ? currentActived : {};
+        const { levelNum = 0 } = currentActived || {};
         if (formListRef.current && levelNum == 3) {
-          //当是新增叶子结点,也就是增加第4层
+          // 当是新增叶子结点,也就是增加第4层
           setShowMore(true);
           const tempArr = formListRef.current.getData();
           details = tempArr.map(item => {
@@ -299,8 +299,8 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
         }
         const paramData = {
           parentId,
-          name: name,
-          numStr: numStr,
+          name,
+          numStr,
           detail: details
         }
         addDetailRuleHandle(paramData);
@@ -312,7 +312,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
           const { id, isLeaf } = currentActived;
           let details: any = [];
           if (formListRef.current && isLeaf) {
-            //当是叶子结点
+            // 当是叶子结点
             const tempArr = formListRef.current.getData();
             // console.log({tempArr});
             details = tempArr.map(item => {
@@ -327,7 +327,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
           }
           const paramData = {
             id: Number(id),
-            name: name,
+            name,
             detail: isLeaf ? details : [],
           }
           editDetailRulehandle(paramData);
@@ -349,12 +349,12 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
 
         const { isLeaf, levelNum } = currentActived;
   
-        isLeaf&&setReloadMaterialDirData(true); //点击叶子结点,刷新资料目录数据
-        isLeaf && setShowMore(true);//当新增或编辑第4层时也就是叶子节点,增加表单数据
-        (levelNum == 3 && actionType == 'add') && setShowMore(true);  //当新增或编辑第4层时也就是叶子节点,增加表单数据
+        isLeaf&&setReloadMaterialDirData(true); // 点击叶子结点,刷新资料目录数据
+        isLeaf && setShowMore(true);// 当新增或编辑第4层时也就是叶子节点,增加表单数据
+        (levelNum == 3 && actionType == 'add') && setShowMore(true);  // 当新增或编辑第4层时也就是叶子节点,增加表单数据
 
         if (isLeaf || (levelNum == 3 && actionType == 'add')) {
-          //展示子集时才请求
+          // 展示子集时才请求
           restAccreditationModel.getScoreSelectableList().then(data => {
             const tempArrFilted = data.filter((t: any) => t.configStatus != 0);
             const tempArr = tempArrFilted.map((t: any) => ({ label: t.levelNumber, value: t.levelNumber }));
@@ -413,7 +413,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
 
   useEffect(() => {
     if (treeData.length > 0) {
-      //默认展开书结构第一个结点
+      // 默认展开书结构第一个结点
       const { id } = treeData[0];
       setDefaultOpened(`${id}`);
     }
@@ -485,7 +485,7 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
             )
           }
         </MccsProCard>
-        <MccsProCard colSpan={showCardThree ? 9 : 16} className='rightCard' style={{ height: '78vh', overflow: 'hidden' }} >
+        <MccsProCard colSpan={16} className='rightCard' style={{ height: '78vh', overflow: 'hidden' }} >
           <div className="detailRuleTitle">{currentActived?.title}</div>
           <Divider />
           <div className="ruleDetailContainer">
@@ -536,19 +536,6 @@ const AccreditationDetail: React.FunctionComponent<AccreditationDetailProps> = p
             }
           </div>
         </MccsProCard>
-        <MccsProCard colSpan={showCardThree ? 7 : 0} className='rightCard' style={{ height: '78vh', overflow: 'hidden' }} >
-          {
-            showCardThree && (
-              <MaterialTable
-                selectOptions={selectOptions}
-                request={getMaterialListFunc}
-                addHandle={addMaterialDirHandle}
-                tableItemActionHandle={tableItemActionHandle}
-                reload={reloadMaterialDirData}
-              />
-            )
-          }
-        </MccsProCard>
       </MccsProCard>
     </MccsPageContainer>
   );

+ 6 - 6
src/pages/GradeHospitalAccreditation/accreditationDetail/model.ts

@@ -18,7 +18,7 @@ const accreditationDetail = () => {
   const [treeData, setTreeData] = useState<MccsFileTree.childTree[]>([]);
   const [detailRuleList,setDetailRuleList] = useState<API.DetailRuleList[]>([]);
 
-  const getTreeData = async (keyword?:string|number) => {
+  const getTreeData = async (keyword?: string|number) => {
     const {
       list=[]
     } = await getTreeList(false,keyword);
@@ -36,21 +36,21 @@ const accreditationDetail = () => {
     getTreeData();
   };
 
-  const editDetailRulehandle = async (data:API.EditDetailRule)=>{
+  const editDetailRulehandle = async (data: API.EditDetailRule)=>{
      const resp = await editDetailRule(data);
      if(resp){
-      getTreeData(); //更新树
-      getDetailRuleListHandle(data.id); //重新获取
+      getTreeData(); // 更新树
+      getDetailRuleListHandle(data.id); // 重新获取
      }
   }
 
-  const getDetailRuleListHandle = async (id:number|string)=>{
+  const getDetailRuleListHandle = async (id: number|string)=>{
      const {leafDetails=[]} = await getDetailRuleList(id);
      setDetailRuleList(leafDetails);
   }
 
   const getScoreSelectableList = async ()=>{
-     //获取表单下拉评分数据
+     // 获取表单下拉评分数据
      return await getScoreLevelData();
   }
 

+ 59 - 59
src/pages/GradeHospitalAccreditation/accreditationDetail/service.ts

@@ -12,27 +12,27 @@ import { request } from 'umi';
 
 
 interface MineTreeData {
-    list:{
-        id:number,
-        numStr:string,
-        name:string,
-        parentId:number,
-        allParentIds:number,
-        ruleLevel:number,
-        ruleLevelNum:string,
-        version:string,
-        hospId:string,
+    list: {
+        id: number,
+        numStr: string,
+        name: string,
+        parentId: number,
+        allParentIds: number,
+        ruleLevel: number,
+        ruleLevelNum: string,
+        version: string,
+        hospId: string,
     }[]
 }
 
 
-//获取树结构
-export const getTreeList  = async (isShowMineOnly:boolean,keyword?:string|number)=>{
+// 获取树结构
+export const getTreeList  = async (isShowMineOnly: boolean,keyword?: string|number)=>{
 
     if(isShowMineOnly){
         const resp = await request<MineTreeData>('/api/pfm/reviewArticle/getAllByMy', {
             method: 'GET',
-            params: {keyword:keyword},
+            params: {keyword},
           });
           const {list=[]} = resp;
           const data =  list.map(item=>({
@@ -55,21 +55,21 @@ export const getTreeList  = async (isShowMineOnly:boolean,keyword?:string|number
 
 }
 
-//新增细则
+// 新增细则
 
 
-export const addDetailRule = (data:API.AddDetailRule)=>{
+export const addDetailRule = (data: API.AddDetailRule)=>{
 
     return request('/api/pfm/reviewRules/add', {
         method: 'POST',
-        data:data
+        data
     });
 
 }
 
-//删除细则
+// 删除细则
 
-export const delDetailRule = (id:string|number)=>{
+export const delDetailRule = (id: string|number)=>{
 
     return request('/api/pfm/reviewRules/delete', {
         method: 'POST',
@@ -78,21 +78,21 @@ export const delDetailRule = (id:string|number)=>{
 
 }
 
-//编辑细则
+// 编辑细则
 
-export const editDetailRule = (data:API.EditDetailRule)=>{
+export const editDetailRule = (data: API.EditDetailRule)=>{
 
     return request('/api/pfm/reviewRules/edit', {
         method: 'POST',
-        data:data
+        data
     });
 
 }
 
 
-//查询叶子对应的详细细则
+// 查询叶子对应的详细细则
 
-export const getDetailRuleList = (id:string|number)=>{
+export const getDetailRuleList = (id: string|number)=>{
 
     return request('/api/pfm/reviewRules/getDetails', {
         method: 'GET',
@@ -101,72 +101,72 @@ export const getDetailRuleList = (id:string|number)=>{
 
 }
 
-//查询叶子对应的资料目录表格数据
-export const getMaterialList = (params:API.GetMaterialListApiParams)=>{
+// 查询叶子对应的资料目录表格数据
+export const getMaterialList = (params: API.GetMaterialListApiParams)=>{
 
     return request<Promise<API.GetMaterialListApiResult>>('/api/pfm/pfmdatadirectory/getPfmDataDirectory', {
         method: 'GET',
-        params:params
+        params
     });
 
 }
 
-//查询叶子对应的所有目录数据
-export const getMaterialDirList = (params:{
-    numStr:string,  //四码
-    version:string //版本
+// 查询叶子对应的所有目录数据
+export const getMaterialDirList = (params: {
+    numStr: string,  // 四码
+    version: string // 版本
 })=>{
 
     return request<string[]>('/api/pfm/pfmdatadirectory/getDirectoryList', {
         method: 'GET',
-        params:params
+        params
     });
 
 }
 
-//查询叶子对应的资料目录所有档次
-export const getMaterialListGrades = (params:{numStr:string,version:string})=>{
-    return request<Promise<{grade:string,detail:string}[]>>('/api/pfm/pfmdatadirectory/getGradeList', {
+// 查询叶子对应的资料目录所有档次
+export const getMaterialListGrades = (params: {numStr: string,version: string})=>{
+    return request<Promise<{grade: string,detail: string}[]>>('/api/pfm/pfmdatadirectory/getGradeList', {
         method: 'GET',
-        params:params
+        params
     });
 }
 
-//添加叶子对应的资料目录
-export const addMaterialDirList = (data:{
-    numStr:string, //四码
-    version:string,
-    directory:string,
-    grade:string,
-    note?:string,
-    profileName:string,
-    ruleId:string, //四码Id
+// 添加叶子对应的资料目录
+export const addMaterialDirList = (data: {
+    numStr: string, // 四码
+    version: string,
+    directory: string,
+    grade: string,
+    note?: string,
+    profileName: string,
+    ruleId: string, // 四码Id
 })=>{
-    return request<Promise<{data:any}>>('/api/pfm/pfmdatadirectory/addPfmDataDirectory', {
+    return request<Promise<{data: any}>>('/api/pfm/pfmdatadirectory/addPfmDataDirectory', {
         method: 'POST',
-        data:data
+        data
     });
 }
 
-//删除叶子对应的资料目录
-export const delMaterialDirList = (data:number[])=>{
-    return request<Promise<{data:any}>>('/api/pfm/pfmdatadirectory/deletePfmDataDirectoryById', {
+// 删除叶子对应的资料目录
+export const delMaterialDirList = (data: number[])=>{
+    return request<Promise<{data: any}>>('/api/pfm/pfmdatadirectory/deletePfmDataDirectoryById', {
         method: 'POST',
-        data:data
+        data
     });
 }
 
-//修改叶子对应的资料目录
-export const editMaterialDirList = (data:{
-    directory:string,
-    grade:string,
-    id:number,
-    note:string,
-    profileName:string
+// 修改叶子对应的资料目录
+export const editMaterialDirList = (data: {
+    directory: string,
+    grade: string,
+    id: number,
+    note: string,
+    profileName: string
 })=>{
-    return request<Promise<{data:any}>>('/api/pfm/pfmdatadirectory/updatePfmDataDirectory', {
+    return request<Promise<{data: any}>>('/api/pfm/pfmdatadirectory/updatePfmDataDirectory', {
         method: 'POST',
-        data:data
+        data
     });
 }
 

+ 46 - 46
src/pages/GradeHospitalAccreditation/accreditationDetail/typings.d.ts

@@ -13,79 +13,79 @@
 declare namespace API {
        
       type RequestResult = {
-          status:number,
-          msg?:string,
-          [propsName:string]:any
+          status: number,
+          msg?: string,
+          [propsName: string]: any
       }
 
       type ResultTreeDataItem = {
-        title:string,
-        id:string,
-        code:string,
-        isLeaf:boolean,
-        levelNum:number,
-        version:string,
-        children?:ResultTreeData[]
+        title: string,
+        id: string,
+        code: string,
+        isLeaf: boolean,
+        levelNum: number,
+        version: string,
+        children?: ResultTreeData[]
       }
       type RuleDetailListItem = {
-        evaluation:string,
-        detail:{
-          title:string|number,
+        evaluation: string,
+        detail: {
+          title: string|number,
         }[]|[]
       }
 
       type AddDetailRule = {
-        parentId:number,
-        name:string,
-        detail:RuleDetailListItem[]
+        parentId: number,
+        name: string,
+        detail: RuleDetailListItem[]
       }
 
       type EditDetailRule = {
-        id:number,
-        name:string,
-        detail:{
-          evaluation:string,
-          detail:{
-            title:string|number,
+        id: number,
+        name: string,
+        detail: {
+          evaluation: string,
+          detail: {
+            title: string|number,
           }[]|[]
         }[]|[]
       }
 
       type DetailRuleList = {
-        evaluation:string,
-        detail:{
-          title:string
+        evaluation: string,
+        detail: {
+          title: string
         }[]
       }
     
       type ResultTreeData =ResultTreeDataItem[]
 
       type GetMaterialListApiParams = {
-        numStr:string,//四码
-        version:string,//版本
-        current?:number,//当前页码
-        grade?:string,//档次
-        keyword?:string,//关键词
-        pageSize?:number,
+        numStr: string,// 四码
+        version: string,// 版本
+        current?: number,// 当前页码
+        grade?: string,// 档次
+        keyword?: string,// 关键词
+        pageSize?: number,
       }
 
-      type MaterialDirListItem = {  //资料目录表格项数据
-        directory:string,
-        grade:string,
-        id:number,
-        note:string,
-        numStr:string,
-        profileName:string,
-        ruleId:number,
-        sort:number
+      type MaterialDirListItem = {  // 资料目录表格项数据
+        directory: string,
+        grade: string,
+        id: number,
+        note: string,
+        numStr: string,
+        profileName: string,
+        ruleId: number,
+        sort: number
       }
 
-      type GetMaterialListApiResult = {  //资料目录获取表格数据接口返回
-          current:number,
-          list:MaterialDirListItem[],
-          pageSize:number,
-          totalCount:number,
-          totalPage:number,
+      type GetMaterialListApiResult = {  // 资料目录获取表格数据接口返回
+          current: number,
+          list: MaterialDirListItem[],
+          pageSize: number,
+          totalCount: number,
+          totalPage: number,
       }
 
   

+ 164 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/index.tsx

@@ -0,0 +1,164 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-07 11:05:19
+ * @LastEditTime: 2022-03-09 18:01:50
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/drawer/set.tsx
+ */
+
+
+
+import MccsDrawerForm from '@/components/MccsDrawerForm/index';
+import { ProFormDependency, ProFormInstance, ProFormSelect } from '@ant-design/pro-form';
+import MccsClickableTabs from '@/components/MccsClickableTabs/index';
+import { useRef } from 'react'
+
+import { Form, Row, Col } from 'antd'
+import { useModel } from 'umi';
+
+
+
+//条文设置/表格批量设置drawer弹窗
+
+const SetDrawer = () => {
+
+    const { articleManagement } = useModel('allModels');
+
+    const {
+        isLeaf,
+        treeData,
+        getTableData,
+        currentActivedTree,
+        setCurrentActivedTree,
+        scoreList,
+        getDepartmentRequest,
+        departmentManagers,
+        getDepartment,//获取责任单位
+        ...restModelData
+    } = articleManagement;
+
+    const drawerFormRef = useRef<ProFormInstance>();
+
+
+
+    const onVisibleChangeHandle = (visible: boolean) => {
+        //drawer展示控制
+        !visible && articleManagement.setArticleSettingFormInit({});//清空默认值
+        restModelData.setDrawerVisible(visible);
+    }
+    
+    const setTitle = (type:string) => {
+        if (restModelData.drawerFormType == 'ARTICLE_SET') {
+            return '条文设置'
+        }
+        if (restModelData.drawerFormType == 'BATCHSETTING') {
+            return '批量设置'
+        }
+    }
+
+    const onFinishHandle = (values:any)=>{
+        
+        if (restModelData.drawerFormType == 'ARTICLE_SET') {
+            restModelData.setArticle(values)
+        }
+        if (restModelData.drawerFormType == 'BATCHSETTING') {
+            restModelData.batchSetting(values)
+        }
+    }
+
+    return (
+        <MccsDrawerForm
+            title={setTitle(restModelData.drawerFormType?restModelData.drawerFormType:'')}
+            width={500}
+            formRef={drawerFormRef}
+            visible={restModelData.drawerVisible}
+            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleManagement.articleSettingFormInit } : {}}
+            onFinish={(values: any) => onFinishHandle(values)}
+            onVisibleChange={onVisibleChangeHandle}
+        >
+                    <div>
+                        <div className='formItemTitle'>负责人及单位</div>
+                        <Row gutter={16}>
+                            <Col className="gutter-row" span={10}>
+                                <ProFormSelect
+                                    name="responsibilityDepartment"
+                                    width='sm'
+                                    showSearch
+                                    request={getDepartmentRequest}
+                                    placeholder="选择单位"
+                                    fieldProps={{
+                                        labelInValue: true,
+                                        onChange: (value, option) => {
+                                            //责任单位修改时清空责任人
+                                            drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
+                                            getDepartment(value, option)
+                                        }
+                                    }}
+                                    rules={[{ required: true, message: '请选择单位!' }]}
+                                />
+                            </Col>
+
+                            <Col className="gutter-row" span={8}>
+                                <ProFormDependency name={['responsibilityDepartment']}>
+                                    {({ responsibilityDepartment }) => {
+                                        return (
+                                            <ProFormSelect
+                                                name="responsibilityUser"
+                                                width='sm'
+                                                disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
+                                                options={departmentManagers}
+                                                placeholder="选择负责人"
+                                                fieldProps={{
+                                                    labelInValue: true,
+                                                    // onChange:(value,option)=>getManagers(value,option)
+                                                }}
+                                                rules={[{ required: true, message: '请选择负责人!' }]}
+                                            />
+                                        )
+                                    }}
+                                </ProFormDependency>
+                            </Col>
+                        </Row>
+                        <div className='formItemTitle'>目标分数</div>
+                        <Row >
+                            <Col span={24}>
+                                <Form.Item name='targetScores' rules={[
+                                    {
+                                        required: true,
+                                        message: '请选择目标分数!',
+                                    },
+                                ]}>
+                                    <MccsClickableTabs
+                                        data={restModelData.targetScores}
+                                    />
+                                </Form.Item>
+                            </Col>
+                        </Row>
+                        {
+                            true && (
+                                <>
+                                    <div className='formItemTitle'>条文组别</div>
+                                    <Row>
+                                        <Col span={24}>
+                                            <Form.Item name='articleType' rules={[
+                                                {
+                                                    required: true,
+                                                    message: '请选择条文组别!',
+                                                },
+                                            ]}>
+                                                <MccsClickableTabs
+                                                    data={restModelData.ruleTypes}
+                                                />
+                                            </Form.Item>
+                                        </Col>
+                                    </Row>
+                                </>
+                            )
+                        }
+                    </div>
+        </MccsDrawerForm>
+    )
+}
+
+export default SetDrawer;

+ 503 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx

@@ -0,0 +1,503 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-08 10:41:15
+ * @LastEditTime: 2022-03-09 18:14:12
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx
+ */
+
+
+import MccsEditableTable from '@/components/MccsEditableTable';
+import MccsLightTable from '@/components/MccsLightTable';
+import { getScoreColor } from '@/constant';
+import TextArea from 'antd/lib/input/TextArea';
+import React, { useRef, useEffect, useState } from 'react'
+import { useModel } from 'umi';
+import { ActType } from '../..';
+import { getCurrentLevelTable, getTaizhangDirectoryTable } from '../../server';
+
+import { Input, Switch, Select } from 'antd'
+
+import './style.less';
+import SetDrawer from './drawer';
+
+const { Option } = Select;
+
+const myEvent = new Event('resize');
+
+const MccsLightTableColumns = [
+    {
+        key: 'gradeLevel',
+        title: '档次',
+        width: 10
+    },
+    {
+        key: 'directory',
+        title: '名称',
+        width: 60
+    },
+    {
+        key: 'accountType',
+        title: '类型',
+    },
+    {
+        key: 'accountStatus',
+        title: '需要台账',
+        render: (record: any) => {
+            return record.accountStatus == 0 ? '否' : '是'
+        }
+    },
+]
+
+const ArticleDetail = ({ isModeTwo = false }) => {
+
+    const { articleManagement } = useModel('allModels');
+
+    const {
+        isLeaf,
+        treeData,
+        getTableData,
+        currentActivedTree,
+        setCurrentActivedTree,
+        scoreList,
+        getDepartmentRequest,
+        departmentManagers,
+        getDepartment,//获取责任单位
+        currentSelectedActObj,
+        ...restModelData
+    } = articleManagement;
+    
+    // console.log({isModeTwo});
+
+    const [scrollAreaH, setScrollAreaH] = useState(100);
+    const leafContentRef = useRef<HTMLDivElement>(null);
+    const scrollContentRef = useRef<HTMLDivElement>(null);
+    const [ifCollapse, setifCollapse] = useState(false);
+
+    const mccsEditableTableColumns = [
+        {
+            title: '名称',
+            dataIndex: 'directory',
+            width: '50%',
+            align: 'center',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+        },
+        {
+            title: '档次',
+            dataIndex: 'grade',
+            width: '15%',
+            align: 'center',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+            renderFormItem: (_: any, config: any, form: any) => {
+
+                const { isEditable } = config;
+
+                return isEditable ? (
+                    <Select
+                        mode='multiple'
+                        placeholder='请选择'
+                    >
+                        {
+                            restModelData.gradeOptions.map((item, index) => (
+                                <Option value={item.value} key={index}>{item.label}</Option>
+                            ))
+                        }
+                    </Select>
+
+                ) : <Input />;
+            },
+            render: (_: any, row: any) => {
+                return typeof _ == 'object' ? _.join(',') : _;
+            },
+        },
+        {
+            title: '类型',
+            dataIndex: 'accountType',
+            align: 'center',
+            width: '15%',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+            renderFormItem: (_: any, { isEditable }: { isEditable: boolean }, form: any) => {
+
+                return isEditable ? (
+                    <Select
+                        placeholder='请选择'
+                    >
+                        {
+                            restModelData.accountTypeOptions.map((item, index) => (
+                                <Option value={item.value} key={index}>{item.label}</Option>
+                            ))
+                        }
+                    </Select>
+                ) : <Input />;
+            },
+
+
+        },
+        {
+            title: '台账上传',
+            align: 'center',
+            dataIndex: 'accountStatus',
+            width: '10%',
+            valueType: 'switch',
+            render: (_: any, row: any) => {
+                return (
+                    <Switch size='small' disabled checked={row.accountStatus} />
+                )
+            },
+        },
+
+    ]
+
+
+    const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
+        //更改执行情况说明数据
+        //首先找出要更新的项,再进行整体替换
+
+        if (restModelData.selectedSelfEvolution) {
+
+            const editTargetLevel = restModelData.selectedSelfEvolution.label;  //目标等级
+            //找出目标等级下正在更新的level
+            const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
+            //拷贝旧的目标等级数据
+            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
+            //将新的编辑内容赋值给正在编辑的目标下的level
+            _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
+
+            if (editImplementationDataItemIndex != -1) {
+                restModelData.setImplementationData({
+                    ...restModelData.implementationData,
+                    //插入更新
+                    [editTargetLevel]: _cpOldImplemetationItem
+                }
+                )
+            }
+        }
+
+    }
+
+    const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
+        //台账资料目录编辑回调
+        const version = restModelData.leafData?.reviewArticle.version;
+        let prevData = restModelData.taizhangDataDirectoryCommitList;
+        const numStr = restModelData.leafData?.reviewArticle.numStr;
+
+
+        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) => {
+            prevData[index] = {
+                ...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);
+            return;
+        }
+
+        restModelData.setTaizhangDataDirectoryCommitList(
+            [...prevData, {
+                ...data, dataStatus: actType, version: version ? version : '',
+                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
+            }]
+        )
+    }
+
+
+
+    const followWindowResize = (num?: number, leafContentHeight?: number) => {
+        const _num = num ? num : 0;
+
+        if (leafContentRef.current) {
+            const leafContentH = leafContentHeight ? leafContentHeight : (leafContentRef.current.clientHeight);  //className为leafContent的div
+            const headerH = 48 + 16;
+            const scoreH = isModeTwo ? (60 + 32) : 0;
+            const h = window.innerHeight - (leafContentH + headerH + scoreH);
+            // console.log({leafContentH,headerH,scoreH,h});
+            setScrollAreaH(h - _num);
+        }
+    }
+
+    const telescopicBtnHandle = (e: React.MouseEvent) => {
+        //展开/收起
+        e.preventDefault();
+        
+        setifCollapse(!ifCollapse);
+        if (!ifCollapse) {
+            followWindowResize(0, 55);
+        } else {
+            followWindowResize(0);
+        }
+
+        // window.dispatchEvent(myEvent);
+
+        if (scrollContentRef.current) {
+            scrollContentRef.current.scrollTop = 0
+        }
+
+    }
+
+
+    const articleSetBtnHandle = () => {
+        //条文设置
+        // console.log({ articleSettingFormInit });
+        restModelData.setDrawerFormType('ARTICLE_SET');
+        restModelData.setDrawerVisible(true);
+
+    }
+
+    const setEditPageStatus = () => {
+        //更改页面的编辑状态
+        restModelData.setEditMode(!restModelData.editMode);
+    }
+
+
+    useEffect(() => {
+        if (restModelData.editMode) {
+            followWindowResize(40);
+        } else {
+            followWindowResize(0);
+        }
+    }, [restModelData.editMode]);
+
+    useEffect(() => {
+        // followWindowResize();
+        if (isLeaf) {
+            setTimeout(() => {
+                //首次加载叶子节点内容触发一次
+                window.dispatchEvent(myEvent);
+                document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
+            }, 500);
+            //获取单位列表
+        }
+
+        if (!isLeaf) {
+            document.body.style.overflowY = 'auto';  //非叶子节点放开
+        }
+    }, [isLeaf]);
+
+
+    useEffect(() => {
+        window.addEventListener("resize", () => followWindowResize());
+        return () => {
+            window.removeEventListener("resize", () => followWindowResize());
+        }
+    }, []);
+
+
+    return (
+        <div className='articleDetailContainer' >
+
+            {
+                //抽屉
+            }
+            <SetDrawer />
+            
+            {
+                isLeaf && (
+                    <div className={ifCollapse ? 'leafContent collapse' : 'leafContent'} ref={leafContentRef}>
+                        <div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
+                        <div className='peopleGroup'>
+                            <span>条文组别:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.accountType}</span>
+                            <span>负责单位:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.responsibilityDepartmentName}</span>
+                            <span>负责人:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.responsibilityUserName}</span>
+                        </div>
+                        {/* <MccsScoreBanner list={scoreList} /> */}
+                        <div className='scoreRow'>
+                            <div className='scoreInfo'>
+                                {
+                                    scoreList.map((item, index) => {
+                                        return (
+                                            <div key={index} className='scoreBlock'>
+                                                {item.label}
+                                                {item.value && item.value != '-' ? (<span style={{ color: getScoreColor(item.value) }}>{item.value}</span>) : ' -'}
+                                            </div>
+                                        )
+                                    })
+                                }
+                            </div>
+                            {
+                                //条文页面
+                                !restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
+                            }
+                            {
+                                //台账上传页面且非编辑状态下
+                                (restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
+                            }
+                        </div>
+                        <div className='scoreGradeDetail'>
+
+                            {
+                                restModelData.leafData?.pfmViewRuleDetailDataVoList.map((item, index) => (
+                                    <div className='scoreGradeDetailList' key={index}>
+                                        <div className='head'>{item.evaluation}</div>
+                                        <div className='detail'>
+                                            {
+                                                item.viewRuleAndLevelVos && item.viewRuleAndLevelVos.map((v, k) => (
+                                                    <div className='textLine' key={k}>{`${v.grade} ${v.detail}`}</div>
+                                                ))
+                                            }
+                                        </div>
+                                    </div>
+                                ))
+                            }
+                        </div>
+
+                        <div className={ifCollapse ? 'telescopicBtn collapse' : 'telescopicBtn'} onClick={e => telescopicBtnHandle(e)}></div>
+                    </div>
+                )
+            }
+
+            {
+                isLeaf && isModeTwo && (
+                    <div className='selfEvaluationWrap'>
+                        <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', }}>
+                            <div className='selfEvaluation'>
+                                自评等级
+                                {!restModelData.editMode && (
+                                    <span style={{ color: getScoreColor(restModelData.leafData ? restModelData.leafData.reviewArticle.selfEvaluation : '') }}>{restModelData.leafData?.reviewArticle.selfEvaluation ? restModelData.leafData?.reviewArticle.selfEvaluation : '-'}</span>
+                                )}
+                            </div>
+                            {
+                                restModelData.editMode && (
+                                    <div className='wrap' style={{ width: '60%', display: 'flex', flexDirection: 'row', justifyContent: 'flex-end' }}>
+                                        {
+                                            (restModelData.targetScores).map((item, index) => (
+                                                <div className={restModelData.selectedSelfEvolution?.label == item.label ? 'tab on' : 'tab'} key={index} onClick={() => restModelData.onSelfEvolutionTabChange(item)}>{item.label}</div>
+                                            ))
+                                        }
+                                    </div>
+                                )
+                            }
+                        </div>
+                    </div>
+                )
+            }
+
+            {
+                isLeaf && restModelData.leafData && (
+                    //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
+                    <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ marginTop: '16px', height: `${scrollAreaH - 16}px` }} ref={scrollContentRef}>
+                        <div>
+                            {
+                                //渲染执行情况说明
+                                /**
+                                 * 满足条件:
+                                 * 1.存在自评等级从接口获取或手动点击选择
+                                 * 2.implementationData里有当前等级的数据
+                                 */
+                                (restModelData.selectedSelfEvolution && restModelData.implementationData[restModelData.selectedSelfEvolution.label])
+                                && restModelData.implementationData[restModelData.selectedSelfEvolution.label].map((item, index) => {
+
+                                    return (
+                                        <div className='card' key={index} style={{ marginBottom: isModeTwo ? 0 : '16px', paddingBottom: isModeTwo ? 0 : '16px', paddingTop: isModeTwo ? 0 : '16px' }}>
+                                            <div className='cardTitle' style={{ marginBottom: isModeTwo ? '8px' : '16px' }}>{`执行情况说明(等级${item.level})`}</div>
+
+                                            <TextArea allowClear showCount maxLength={2000}
+                                                autoSize={{
+                                                    minRows: 5,
+                                                    maxRows: 20
+                                                }}
+                                                disabled={!restModelData.editMode} value={item.note}
+                                                onChange={e => onTextAreaChange(e, item.level)}
+                                                style={{ marginBottom: 20 }} />
+
+                                            {
+                                                !isModeTwo && (
+                                                    <MccsLightTable
+                                                        columns={MccsLightTableColumns}
+                                                        request={(current, pageSize) => getCurrentLevelTable({
+                                                            level: item.level,
+                                                            numStr: currentSelectedActObj ? (currentSelectedActObj.numStr?currentSelectedActObj.numStr:currentSelectedActObj.code) : 'null',
+                                                            version: restModelData.leafData ? (restModelData.leafData.reviewArticle.version) : 'null',
+                                                            current,
+                                                            pageSize
+                                                        })}
+                                                    />
+                                                )
+                                            }
+                                        </div>
+                                    )
+                                })
+                            }
+                        </div>
+                        <div>
+                            {
+                                //台帐下展示
+                                (isModeTwo && restModelData.leafData) && (
+                                    <MccsEditableTable
+                                        bordered={true}
+                                        controlled={false}
+                                        edit={restModelData.editMode}
+                                        reload={!restModelData.editMode}
+                                        pagination={true}
+                                        addHandle={
+                                            (data: any) => taizhangDataDerectoryEditHandle(data, ActType.ADD)
+                                        }
+                                        editHandle={
+                                            (data: any) => taizhangDataDerectoryEditHandle(data, ActType.EDIT)
+                                        }
+                                        delHandle={
+                                            (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' ? false : true })), //多选下拉需传数组值
+                                                    total: resp.totalCount,
+                                                    current: resp.current,
+                                                    success: true
+                                                };
+                                            }
+                                            return {
+                                                data: [],
+                                                total: 0,
+                                                success: false
+                                            }
+                                        }}
+                                        columns={mccsEditableTableColumns}
+                                    />
+                                )
+                            }
+                        </div>
+                    </div>
+                )
+            }
+
+        </div>
+    )
+}
+
+export default ArticleDetail;

+ 235 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/style.less

@@ -0,0 +1,235 @@
+
+
+
+.articleDetailContainer {
+      
+    .leafContent {
+  
+        position: relative;
+        background-color: #fff;
+        padding:16px;
+        .telescopicBtn {
+          position: absolute;
+          top:16px;
+          right:16px;
+          z-index: 99;
+          cursor: pointer;
+           margin-left: -15px;
+          width: 25px;
+          height: 25px;
+          border-radius: 50%;
+          background: url('../../../../../../public/arrow.png');
+          background-size: 60%;
+          background-position: center center;
+          transition: all 0.2s ease-in;
+          background-repeat: no-repeat;
+          transform: rotate(0deg);
+          &.collapse {
+              transform: rotate(180deg);
+          }
+          &:hover {
+            background-image: url('../../../../../../public/arrow_white.png');
+            background-color:#A3B1CC;
+          }
+      
+        }
+        .leafContentTitle {
+          font-size: 16px;
+          font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+          font-weight: bold;
+          color: #292C33;
+          line-height: 24px;
+          overflow: hidden; //超出的文本隐藏
+          text-overflow: ellipsis; //溢出用省略号显示
+          white-space: nowrap; //溢出不换行
+          margin-bottom: 16px;
+        }
+      
+        .peopleGroup {
+          display: flex;
+          flex-direction: row;
+          justify-content: flex-start;
+          align-items: center;
+          margin-bottom: 24px;
+      
+          span {
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #292C33;
+            line-height: 21px;
+      
+            &:nth-child(2n) {
+              margin-right: 40px;
+            }
+          }
+        }
+      
+        .scoreRow {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          height:32px;
+      
+          .scoreInfo {
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: center;
+      
+            .scoreBlock {
+              display: flex;
+              flex-direction: row;
+              justify-content: center;
+              align-items: center;
+              width: 117px;
+              height: 16px;
+              font-size: 12px;
+              font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+              font-weight: 400;
+              color: #525866;
+              border-right: 1px solid #DADEE6;
+      
+              &>span {
+                position: relative;
+                top: -2px;
+                display: inline-block;
+                margin-left: 16px;
+                font-size: 20px;
+                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                font-weight: 500;
+              }
+      
+              &:last-child {
+                border: none;
+              }
+      
+              &:first-child {
+                width: 94px;
+              }
+            }
+          }
+      
+          .ruleSettingBtn,
+          .editPageBtn {
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #525966;
+            padding-right: 16px;
+            cursor: pointer;
+      
+            &::before {
+              position: relative;
+              top: 3px;
+              display: inline-block;
+              content: '';
+              width: 16px;
+              height: 16px;
+              margin-right: 8px;
+              background: url('../../../../../../public/ruleSettingIcon.png');
+              background-size: contain;
+      
+            }
+          }
+      
+          .editPageBtn {
+            &::before {
+              position: relative;
+              top: 3px;
+              display: inline-block;
+              content: '';
+              width: 16px;
+              height: 16px;
+              margin-right: 8px;
+              background: url('../../../../../../public/pageEditIcon.png');
+              background-size: contain;
+      
+            }
+          }
+        }
+      
+        .scoreGradeDetail {
+          width: 100%;
+          margin-top: 26px;
+          border-radius: 2px;
+          overflow: hidden;
+      
+          .scoreGradeDetailList {
+            position: relative;
+            display: flex;
+            width: 100%;
+            height: 100%;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: stretch;
+            padding-left: 40px;
+            margin-bottom: 2px;
+      
+            .head {
+              position: absolute;
+              top: 0;
+              left: 0;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+              width: 40px;
+              height: 100%;
+              background: #A3B1CC;
+              font-size: 16px;
+              font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+              font-weight: bold;
+              color: #FFFFFF;
+            }
+      
+            .detail {
+              width: 100%;
+              background: #F5F7FA;
+              padding: 9px 18px;
+      
+              .textLine {
+                font-size: 12px;
+                font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                font-weight: 400;
+                color: #5C7099;
+                line-height: 14px;
+                margin-bottom: 5px;
+      
+                &:last-child {
+                  margin-bottom: 0;
+                }
+              }
+            }
+      
+            &:last-child {
+              margin-bottom: 0;
+            }
+          }
+        }
+      
+        .articleSetBtn {
+          height: 50px;
+          text-align: center;
+          line-height: 50px;
+          background: #FFFFFF;
+          border-radius: 25px;
+          border: 1px dashed #DADEE6;
+          margin-top: 40px;
+          margin-bottom: 40px;
+      
+          span {
+            font-size: 16px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            cursor: pointer;
+            color: @primary-color;
+          }
+        }
+      
+        &.collapse {
+          height:55px;
+          overflow-y: hidden;
+        }
+      }
+}

+ 2 - 199
src/pages/GradeHospitalAccreditation/articleManagement/index.less

@@ -95,11 +95,7 @@ textarea.mwc-ant-input {
 
 }
 .cardWrap {
-  // padding-top: 16px;
-  height: calc(100vh - 364px);
-  // border-bottom: 2px solid red;
   overflow-y: scroll;
-  padding-bottom: 16px;
 
   .card {
     padding: 16px;
@@ -116,7 +112,8 @@ textarea.mwc-ant-input {
     }
 
     &:last-child {
-      margin-bottom: 0;
+      margin-bottom: 0 !important;
+    
     }
   }
 
@@ -135,201 +132,7 @@ textarea.mwc-ant-input {
   background-color: #FFFFFF;
 }
 
-.leafContent {
-  .leafContentTitle {
-    font-size: 16px;
-    font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-    font-weight: bold;
-    color: #292C33;
-    line-height: 24px;
-    overflow: hidden; //超出的文本隐藏
-    text-overflow: ellipsis; //溢出用省略号显示
-    white-space: nowrap; //溢出不换行
-    margin-bottom: 16px;
-  }
-
-  .peopleGroup {
-    display: flex;
-    flex-direction: row;
-    justify-content: flex-start;
-    align-items: center;
-    margin-bottom: 24px;
-
-    span {
-      font-size: 14px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #292C33;
-      line-height: 21px;
-
-      &:nth-child(2n) {
-        margin-right: 40px;
-      }
-    }
-  }
-
-  .scoreRow {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    height:32px;
-
-    .scoreInfo {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .scoreBlock {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-        width: 117px;
-        height: 16px;
-        font-size: 12px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #525866;
-        border-right: 1px solid #DADEE6;
-
-        &>span {
-          position: relative;
-          top: -2px;
-          display: inline-block;
-          margin-left: 16px;
-          font-size: 20px;
-          font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-          font-weight: 500;
-        }
-
-        &:last-child {
-          border: none;
-        }
-
-        &:first-child {
-          width: 94px;
-        }
-      }
-    }
-
-    .ruleSettingBtn,
-    .editPageBtn {
-      font-size: 14px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #525966;
-      padding-right: 16px;
-      cursor: pointer;
 
-      &::before {
-        position: relative;
-        top: 3px;
-        display: inline-block;
-        content: '';
-        width: 16px;
-        height: 16px;
-        margin-right: 8px;
-        background: url('../../../../public/ruleSettingIcon.png');
-        background-size: contain;
-
-      }
-    }
-
-    .editPageBtn {
-      &::before {
-        position: relative;
-        top: 3px;
-        display: inline-block;
-        content: '';
-        width: 16px;
-        height: 16px;
-        margin-right: 8px;
-        background: url('../../../../public/pageEditIcon.png');
-        background-size: contain;
-
-      }
-    }
-  }
-
-  .scoreGradeDetail {
-    width: 100%;
-    margin-top: 26px;
-    border-radius: 2px;
-    overflow: hidden;
-
-    .scoreGradeDetailList {
-      position: relative;
-      display: flex;
-      width: 100%;
-      height: 100%;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: stretch;
-      padding-left: 40px;
-      margin-bottom: 2px;
-
-      .head {
-        position: absolute;
-        top: 0;
-        left: 0;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        width: 40px;
-        height: 100%;
-        background: #A3B1CC;
-        font-size: 16px;
-        font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-        font-weight: bold;
-        color: #FFFFFF;
-      }
-
-      .detail {
-        width: 100%;
-        background: #F5F7FA;
-        padding: 9px 18px;
-
-        .textLine {
-          font-size: 12px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          color: #5C7099;
-          line-height: 14px;
-          margin-bottom: 5px;
-
-          &:last-child {
-            margin-bottom: 0;
-          }
-        }
-      }
-
-      &:last-child {
-        margin-bottom: 0;
-      }
-    }
-  }
-
-  .articleSetBtn {
-    height: 50px;
-    text-align: center;
-    line-height: 50px;
-    background: #FFFFFF;
-    border-radius: 25px;
-    border: 1px dashed #DADEE6;
-    margin-top: 40px;
-    margin-bottom: 40px;
-
-    span {
-      font-size: 16px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      cursor: pointer;
-      color: @primary-color;
-    }
-  }
-}
 
 .selfEvolutionTitle {
   text-align: left;

+ 76 - 589
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,7 +1,6 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-03-09 14:52:34
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -15,24 +14,19 @@ import MccsPageContainer from '@/components/MccsPageContainer/index'
 import { useModel } from 'umi';
 import MccsFileTree from '@/components/MccsFileTree/index';
 import MccsTable from '@/components/MccsTable/index';
-// import MccsSelect from '@/components/MccsProFormSelect';
-import MccsDrawerForm from '@/components/MccsDrawerForm/index';
+
 import MccsClickableTabs from '@/components/MccsClickableTabs/index';
 import MccsUpload from '@/components/MccsUpload/index';
 import { MccsModal } from '@/components/MccsModal';
-import type { ProFormInstance, } from '@ant-design/pro-form';
 
-import { getScoreColor } from '@/constant';
-import MccsLightTable from '@/components/MccsLightTable';
 
-import MccsEditableTable from '@/components/MccsEditableTable/index';
+import { getDepartmentList } from './server';
 
-import { getCurrentLevelTable, getDepartmentList, getTaizhangDirectoryTable } from './server';
 
 import { getScoreLevelData } from '@/pages/PlatformMana/generalSetting/serve';
 
 
-import { Form, Table, Space, Row, Col, Button, Input, Switch, Select } from 'antd'
+import { Form, Table, Space, Button, Switch, Select } from 'antd'
 import {
     ProFormText,
     ProFormSelect,
@@ -40,9 +34,9 @@ import {
 } from '@ant-design/pro-form';
 
 import './index.less';
+import ArticleDetail from './components/articleDetailModule';
+import MccsDrawerForm from '@/components/MccsDrawerForm/index';
 
-
-const { TextArea } = Input;
 const { Option } = Select;
 
 type ArticleManagementProps = {
@@ -58,37 +52,18 @@ type SelectedRowsType = {
 }
 
 
-const MccsLightTableColumns = [
-    {
-        key: 'gradeLevel',
-        title: '档次',
-        width: 10
-    },
-    {
-        key: 'directory',
-        title: '名称',
-        width: 60
-    },
-    {
-        key: 'accountType',
-        title: '类型',
-    },
-    {
-        key: 'accountStatus',
-        title: '需要台账',
-        render: (record: any) => {
-            return record.accountStatus == 0 ? '否' : '是'
-        }
-    },
-]
-
-
+export enum ActType {
+    'NOACT',  //不操作
+    'ADD',
+    'EDIT',
+    'DEL'
+};
 
 //条文管理
 const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     const { columnsFromProps = [], headerConcig, isModeTwo } = props;
     const { articleManagement } = useModel('allModels');
-    const drawerFormRef = useRef<ProFormInstance>();
+
     const {
         isLeaf,
         treeData,
@@ -99,18 +74,22 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         getDepartmentRequest,
         departmentManagers,
         getDepartment,//获取责任单位
+        currentSelectedActObj,
+        setdetailDrawerVisible,
+        detailDrawerVisible,
         ...restModelData
     } = articleManagement;
     const tableRef = useRef<MccsTable.MccsTableRef>();
 
-    const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
+
     const [defaultOpened, setDefaultOpened] = useState<string>();
-    const [scrollAreaH, setScrollAreaH] = useState(100);
-    const leafContentRef = useRef<HTMLDivElement>(null);
+
     const [departments, setdepartments] = useState<{ label: string; value: string }[]>([]);
+    
 
     const columns = [
 
+
         {
             key: 'keyword',
             hideInTable: true,
@@ -135,6 +114,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                     return null;
                 }
 
+
                 return (
                     <Form.Item name='department'>
                         <Select
@@ -142,10 +122,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                             placeholder="请选择单位"
                         >
                             {
-                                departments.map((item,index)=>{
-                                      return (
+                                departments.map((item, index) => {
+                                    return (
                                         <Option value={item.value} key={index}>{item.label}</Option>
-                                      )
+                                    )
                                 })
                             }
                         </Select>
@@ -158,6 +138,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
             hideInTable: true,
             renderFormItem: (item: any, { type }: any, form: any) => {
 
+
                 if (type === 'form') {
                     return null;
                 }
@@ -256,96 +237,17 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
             dataIndex: 'systemEvaluation',
             hideInSearch: true,
         },
-    ]
-
-
-    const mccsEditableTableColumns = [
-        {
-            title: '名称',
-            dataIndex: 'directory',
-            width: '50%',
-            align: 'center',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-        },
         {
-            title: '档次',
-            dataIndex: 'grade',
-            width: '15%',
-            align: 'center',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-            renderFormItem: (_: any, config: any, form: any) => {
-
-                const { isEditable } = config;
+            title: '操作',
+            width: 100,
+            valueType: 'option',
+            render: (_: any, record: any) => {
 
-                return isEditable ? (
-                    <Select
-                        mode='multiple'
-                        placeholder='请选择'
-                    >
-                        {
-                            restModelData.gradeOptions.map((item, index) => (
-                                <Option value={item.value} key={index}>{item.label}</Option>
-                            ))
-                        }
-                    </Select>
-
-                ) : <Input />;
-            },
-            render: (_: any, row: any) => {
-                return typeof _ == 'object' ? _.join(',') : _;
+                return [<a key="1" onClick={() => openDetailInDrawer(record)}>详情</a>]
             },
         },
-        {
-            title: '类型',
-            dataIndex: 'accountType',
-            align: 'center',
-            width: '15%',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-            renderFormItem: (_: any, { isEditable }: { isEditable: boolean }, form: any) => {
-
-                return isEditable ? (
-                    <Select
-                        placeholder='请选择'
-                    >
-                        {
-                            restModelData.accountTypeOptions.map((item, index) => (
-                                <Option value={item.value} key={index}>{item.label}</Option>
-                            ))
-                        }
-                    </Select>
-                ) : <Input />;
-            },
-
-
-        },
-        {
-            title: '台账上传',
-            align: 'center',
-            dataIndex: 'accountStatus',
-            width: '10%',
-            valueType: 'switch',
-            render: (_: any, row: any) => {
-                return (
-                    <Switch size='small' disabled checked={row.accountStatus} />
-                )
-            },
-        },
-
     ]
 
-
     //左侧树搜索回调
     const searchHandle = (val: any) => {
         restModelData.getArticleTreeData(val);
@@ -354,7 +256,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     const onSelectHandle = (data: MccsFileTree.childTree) => {
         //左侧树节点点击回调
         setCurrentActivedTree(data);
-        setArticleSettingFormInit({});//清空默认值
+        restModelData.setCurrentSelectedActObj(data);
+        articleManagement.setArticleSettingFormInit({});//清空默认值
         //重新获取数据
         tableRef?.current?.getTableRef().current?.reload();
     }
@@ -366,20 +269,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         restModelData.setDrawerVisible(true);
     }
 
-    const articleSetBtnHandle = () => {
-        //条文设置
-        // console.log({ articleSettingFormInit });
-        restModelData.setDrawerFormType('ARTICLE_SET');
-        restModelData.setDrawerVisible(true);
-
-    }
-
-    const onVisibleChangeHandle = (visible: boolean) => {
-        //drawer展示控制
-        !visible && setArticleSettingFormInit({});//清空默认值
-        restModelData.setDrawerVisible(visible);
-    }
-
     const onModalVisibleChange = (visible: boolean) => {
         //表单弹窗
         //  console.log('uploadFormInitValue',restModelData.uploadFormInitValue);
@@ -393,101 +282,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     }
 
-    const setEditPageStatus = () => {
-        //更改页面的编辑状态
-        restModelData.setEditMode(!restModelData.editMode);
-    }
-
-    const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
-        //更改执行情况说明数据
-        //首先找出要更新的项,再进行整体替换
-
-        if (restModelData.selectedSelfEvolution) {
-
-            const editTargetLevel = restModelData.selectedSelfEvolution.label;  //目标等级
-            //找出目标等级下正在更新的level
-            const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
-            //拷贝旧的目标等级数据
-            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
-            //将新的编辑内容赋值给正在编辑的目标下的level
-            _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
-
-            if (editImplementationDataItemIndex != -1) {
-                restModelData.setImplementationData({
-                    ...restModelData.implementationData,
-                    //插入更新
-                    [editTargetLevel]: _cpOldImplemetationItem
-                }
-                )
-            }
-        }
-
-    }
-
-    enum ActType {
-        'NOACT',  //不操作
-        'ADD',
-        'EDIT',
-        'DEL'
-    };
-
-    const taizhangDataDerectoryEditHandle = (data: any, actType: 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, function (key, value) {
-                if (key == keyToDel) {
-                    return undefined;
-                } else {
-                    return value;
-                }
-            }))
-        }
-
-
-        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) => {
-            prevData[index] = {
-                ...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);
-            return;
-        }
-
-        // if(findeIndex == -1){
-        //     //不存在id的情况下,有可能编辑的不是服务已有的数据,比较directory
-        //     const findIndexBydirectory = prevData.findIndex(item=>item.directory == data.directory);
-        //     if(findIndexBydirectory != -1){
-        //         replaceData(data,findIndexBydirectory);
-        //         return;
-        //     }
-        // }
-
-        restModelData.setTaizhangDataDirectoryCommitList(
-            [...prevData, {
-                ...data, dataStatus: actType, version: version ? version : '',
-                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
-            }]
-        )
+    const openDetailInDrawer = (record: any) => {
+        // restModelData.setRecords(record)
+        setdetailDrawerVisible(true);
+        restModelData.setCurrentSelectedActObj(record);
+        getTableData({ id: record.id});
     }
 
     const taizhangImplementationCommit = () => {
@@ -495,22 +294,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         restModelData.commitTaizhangImplementationHandle();
     }
 
-    const followWindowResize = (num?: number) => {
-        const _num = num ? num : 0;
-
-        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 getDepartments = async () => {
 
         const resp = await getDepartmentList();
-
         if (resp) {
             const { list = [] } = resp;
             setdepartments(list.map(t => ({ label: t.name, value: t.name })));
@@ -518,9 +305,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }
 
 
-
-
-
     useEffect(() => {
 
         if (restModelData.reloadRightContent) {
@@ -537,7 +321,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         if (restModelData.leafData) {
             const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData.reviewArticle;
             if (responsibilityDepartmentName && responsibilityDepartmentId) {
-                setArticleSettingFormInit({
+
+                articleManagement.setArticleSettingFormInit({
                     responsibilityDepartment: { label: responsibilityDepartmentName, value: responsibilityDepartmentId },
                     responsibilityUser: { label: responsibilityUserName, value: responsibilityUserId },
                     targetScores: { label: targetEvaluation, value: targetEvaluation },
@@ -572,34 +357,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         }
     }, [treeData]);
 
-
-    useEffect(() => {
-        // followWindowResize();
-        if (isLeaf) {
-            setTimeout(() => {
-                //首次加载叶子节点内容触发一次
-                var myEvent = new Event('resize');
-                window.dispatchEvent(myEvent);
-                document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
-            }, 500);
-            //获取单位列表
-        }
-
-        if (!isLeaf) {
-            document.body.style.overflowY = 'auto';  //非叶子节点放开
-        }
-    }, [isLeaf]);
-
-
-    useEffect(() => {
-        if (restModelData.editMode) {
-            followWindowResize(40);
-        } else {
-            followWindowResize(0);
-        }
-    }, [restModelData.editMode]);
-
-
     useEffect(() => {
         //页面加载完
         //获取左侧输结构
@@ -607,21 +364,25 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         //获取当前评分
         restModelData.getCurrentHospScore();
 
-        // followWindowResize();
-        window.addEventListener("resize", () => followWindowResize());
-
         getDepartments();
 
-        return () => {
-            window.removeEventListener("resize", () => followWindowResize());
-        }
-
     }, [])
 
 
 
     return (
         <div className='ArticleManagement'>
+
+            <MccsDrawerForm
+                width={1000}
+                visible={detailDrawerVisible}
+                onVisibleChange={(bool: boolean) => setdetailDrawerVisible(bool)}
+                submitter={false}
+            >
+                <ArticleDetail  />
+            </MccsDrawerForm>
+
+
             <MccsPageContainer
                 config={headerConcig ? headerConcig : {
                     content: !isModeTwo && <div style={{ textAlign: 'right', fontSize: 12, color: '#525866' }}>{restModelData.currentHospSelfScoreAndOthers}</div>,
@@ -689,103 +450,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                     )
                 }
 
-                {
-                    //条文设置/表格批量设置drawer弹窗
-                    //restModelData.drawerVisible && 
-                    (
-                        <MccsDrawerForm
-                            title={restModelData.drawerFormType == 'ARTICLE_SET' ? '条文设置' : '批量设置'}
-                            width={500}
-                            formRef={drawerFormRef}
-                            visible={restModelData.drawerVisible}
-                            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleSettingFormInit } : {}}
-                            onFinish={(values: any) => restModelData.drawerFormType == 'ARTICLE_SET' ? restModelData.setArticle(values) : restModelData.batchSetting(values)}
-                            onVisibleChange={onVisibleChangeHandle}
-                        >
-                            <div className='formItemTitle'>负责人及单位</div>
-                            <Row gutter={16}>
-                                <Col className="gutter-row" span={10}>
-                                    <ProFormSelect
-                                        name="responsibilityDepartment"
-                                        width='sm'
-                                        showSearch
-                                        request={getDepartmentRequest}
-                                        placeholder="选择单位"
-                                        fieldProps={{
-                                            labelInValue: true,
-                                            onChange: (value, option) => {
-                                                //责任单位修改时清空责任人
-                                                drawerFormRef.current?.setFieldsValue({ ...articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
-                                                getDepartment(value, option)
-                                            }
-                                        }}
-                                        rules={[{ required: true, message: '请选择单位!' }]}
-                                    />
-                                </Col>
-
-                                <Col className="gutter-row" span={8}>
-                                    <ProFormDependency name={['responsibilityDepartment']}>
-                                        {({ responsibilityDepartment }) => {
-                                            return (
-                                                <ProFormSelect
-                                                    name="responsibilityUser"
-                                                    width='sm'
-                                                    disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
-                                                    options={departmentManagers}
-                                                    placeholder="选择负责人"
-                                                    fieldProps={{
-                                                        labelInValue: true,
-                                                        // onChange:(value,option)=>getManagers(value,option)
-                                                    }}
-                                                    rules={[{ required: true, message: '请选择负责人!' }]}
-                                                />
-                                            )
-                                        }}
-                                    </ProFormDependency>
-                                </Col>
-                            </Row>
-                            <div className='formItemTitle'>目标分数</div>
-                            <Row >
-                                <Col span={24}>
-                                    <Form.Item name='targetScores' rules={[
-                                        {
-                                            required: true,
-                                            message: '请选择目标分数!',
-                                        },
-                                    ]}>
-                                        <MccsClickableTabs
-                                            data={restModelData.targetScores}
-                                        />
-                                    </Form.Item>
-                                </Col>
-                            </Row>
-                            {
-                                true && (
-                                    <>
-                                        <div className='formItemTitle'>条文组别</div>
-                                        <Row>
-                                            <Col span={24}>
-                                                <Form.Item name='articleType' rules={[
-                                                    {
-                                                        required: true,
-                                                        message: '请选择条文组别!',
-                                                    },
-                                                ]}>
-                                                    <MccsClickableTabs
-                                                        data={restModelData.ruleTypes}
-                                                    />
-                                                </Form.Item>
-                                            </Col>
-                                        </Row>
-                                    </>
-                                )
-                            }
-
-                        </MccsDrawerForm>
-
-                    )
-                }
-
                 <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', width: '100%' }}>
                     <div style={{ height: '85vh', width: restModelData.editMode ? 0 : '25%', transition: 'width 0.2s ease-in', padding: '16px', backgroundColor: '#fff', marginRight: '16px', boxSizing: 'border-box' }} >
                         {
@@ -810,212 +474,35 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                         }
                     </div>
                     <div style={{ padding: 0, width: restModelData.editMode ? '100%' : '75%', transition: 'width 0.2s ease-in' }}>
-                        <div className='card'>
-                            {
-                                !isLeaf && (
-                                    <MccsTable
-                                        ref={tableRef}
-                                        columns={columnsFromProps.length > 0 ? columnsFromProps : columns}
-                                        request={getTableData}
-                                        search={{
-                                            span: 6
-                                        }}
-                                        rowSelection={isModeTwo ? false : {
-                                            // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                                            // 注释该行则默认不显示下拉选项
-                                            selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                                        }}
-                                        rowKey="id"
-                                        tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }: { selectedRowKeys: number[] | string[], selectedRows: SelectedRowsType[], onCleanSelected: () => void }) => {
-                                            return (
-                                                <Space size={16}>
-                                                    <Button type='primary' onClick={() => batchSelfAssessment(selectedRowKeys)}>批量设置</Button>
-                                                    <Button type='ghost' onClick={onCleanSelected}>取消选择</Button>
-                                                </Space>
-                                            );
-                                        }}
-                                    // searchNode={searchNode()}
-                                    />
-                                )
-                            }
 
-                            {
-                                isLeaf && (
-                                    <div className='leafContent' ref={leafContentRef}>
-                                        <div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
-                                        <div className='peopleGroup'>
-                                            <span>条文组别:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.accountType}</span>
-                                            <span>负责单位:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.responsibilityDepartmentName}</span>
-                                            <span>负责人:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.responsibilityUserName}</span>
-                                        </div>
-                                        {/* <MccsScoreBanner list={scoreList} /> */}
-                                        <div className='scoreRow'>
-                                            <div className='scoreInfo'>
-                                                {
-                                                    scoreList.map((item, index) => {
-                                                        return (
-                                                            <div key={index} className='scoreBlock'>
-                                                                {item.label}
-                                                                {item.value && item.value != '-' ? (<span style={{ color: getScoreColor(item.value) }}>{item.value}</span>) : ' -'}
-                                                            </div>
-                                                        )
-                                                    })
-                                                }
-                                            </div>
-                                            {
-                                                //条文页面
-                                                !restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
-                                            }
-                                            {
-                                                //台账上传页面且非编辑状态下
-                                                (restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
-                                            }
-                                        </div>
-                                        <div className='scoreGradeDetail'>
-
-                                            {
-                                                restModelData.leafData?.pfmViewRuleDetailDataVoList.map((item, index) => (
-                                                    <div className='scoreGradeDetailList' key={index}>
-                                                        <div className='head'>{item.evaluation}</div>
-                                                        <div className='detail'>
-                                                            {
-                                                                item.viewRuleAndLevelVos && item.viewRuleAndLevelVos.map((v, k) => (
-                                                                    <div className='textLine' key={k}>{`${v.grade} ${v.detail}`}</div>
-                                                                ))
-                                                            }
-                                                        </div>
-                                                    </div>
-                                                ))
-                                            }
-                                        </div>
-                                    </div>
-                                )
-                            }
+                        <div className='card' style={{ display: currentActivedTree?.isLeaf ? 'none' : 'block' }}>
+                            <MccsTable
+                                ref={tableRef}
+                                columns={columnsFromProps.length > 0 ? columnsFromProps : columns}
+                                request={getTableData}
+                                search={{
+                                    span: 6
+                                }}
+                                rowSelection={isModeTwo ? false : {
+                                    // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                                    // 注释该行则默认不显示下拉选项
+                                    selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                                }}
+                                rowKey="id"
+                                tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }: { selectedRowKeys: number[] | string[], selectedRows: SelectedRowsType[], onCleanSelected: () => void }) => {
+                                    return (
+                                        <Space size={16}>
+                                            <Button type='primary' onClick={() => batchSelfAssessment(selectedRowKeys)}>批量设置</Button>
+                                            <Button type='ghost' onClick={onCleanSelected}>取消选择</Button>
+                                        </Space>
+                                    );
+                                }}
+                            // searchNode={searchNode()}
+                            />
+                        </div>
+                        <div style={{ display: currentActivedTree?.isLeaf ? 'block' : 'none' }}>
+                            <ArticleDetail isModeTwo={isModeTwo} />
                         </div>
-                        {
-                            isLeaf && isModeTwo && (
-                                <div className='selfEvaluationWrap'>
-                                    <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', }}>
-                                        <div className='selfEvaluation'>
-                                            自评等级
-                                            {!restModelData.editMode && (
-                                                <span style={{ color: getScoreColor(restModelData.leafData ? restModelData.leafData.reviewArticle.selfEvaluation : '') }}>{restModelData.leafData?.reviewArticle.selfEvaluation ? restModelData.leafData?.reviewArticle.selfEvaluation : '-'}</span>
-                                            )}
-                                        </div>
-                                        {
-                                            restModelData.editMode && (
-                                                <div className='wrap' style={{ width: '60%', display: 'flex', flexDirection: 'row', justifyContent: 'flex-end' }}>
-                                                    {
-                                                        (restModelData.targetScores).map((item, index) => (
-                                                            <div className={restModelData.selectedSelfEvolution?.label == item.label ? 'tab on' : 'tab'} key={index} onClick={() => restModelData.onSelfEvolutionTabChange(item)}>{item.label}</div>
-                                                        ))
-                                                    }
-                                                </div>
-                                            )
-                                        }
-                                    </div>
-                                </div>
-                            )
-                        }
-
-                        {
-                            isLeaf && restModelData.leafData && (
-                                //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
-                                <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ height: `${scrollAreaH}px`, marginTop: '16px' }}>
-                                    <div>
-                                        {
-                                            //渲染执行情况说明
-                                            /**
-                                             * 满足条件:
-                                             * 1.存在自评等级从接口获取或手动点击选择
-                                             * 2.implementationData里有当前等级的数据
-                                             */
-                                            (restModelData.selectedSelfEvolution && restModelData.implementationData[restModelData.selectedSelfEvolution.label])
-                                            && restModelData.implementationData[restModelData.selectedSelfEvolution.label].map((item, index) => {
-
-                                                return (
-                                                    <div className='card' key={index} style={{ marginBottom: isModeTwo ? 0 : '16px', paddingBottom: isModeTwo ? 0 : '16px', paddingTop: isModeTwo ? 0 : '16px' }}>
-                                                        <div className='cardTitle' style={{ marginBottom: isModeTwo ? '8px' : '16px' }}>{`执行情况说明(等级${item.level})`}</div>
-
-                                                        <TextArea allowClear showCount maxLength={2000}
-                                                            autoSize={{
-                                                                minRows: 5,
-                                                                maxRows: 20
-                                                            }}
-                                                            disabled={!restModelData.editMode} value={item.note}
-                                                            onChange={e => onTextAreaChange(e, item.level)}
-                                                            style={{ marginBottom: 20 }} />
-
-                                                        {
-                                                            !isModeTwo && (
-                                                                <MccsLightTable
-                                                                    columns={MccsLightTableColumns}
-                                                                    request={(current, pageSize) => getCurrentLevelTable({
-                                                                        level: item.level,
-                                                                        numStr: currentActivedTree ? currentActivedTree.code : 'null',
-                                                                        version: restModelData.leafData ? (restModelData.leafData.reviewArticle.version) : 'null',
-                                                                        current,
-                                                                        pageSize
-                                                                    })}
-                                                                />
-                                                            )
-                                                        }
-                                                    </div>
-                                                )
-                                            })
-                                        }
-                                    </div>
-                                    <div style={{ padding: '0 16px' }}>
-                                        {
-                                            //台帐下展示
-                                            (isModeTwo && restModelData.leafData) && (
-                                                <MccsEditableTable
-                                                    bordered={true}
-                                                    controlled={false}
-                                                    edit={restModelData.editMode}
-                                                    reload={!restModelData.editMode}
-                                                    pagination={true}
-                                                    addHandle={
-                                                        (data: any) => taizhangDataDerectoryEditHandle(data, ActType.ADD)
-                                                    }
-                                                    editHandle={
-                                                        (data: any) => taizhangDataDerectoryEditHandle(data, ActType.EDIT)
-                                                    }
-                                                    delHandle={
-                                                        (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' ? false : true })), //多选下拉需传数组值
-                                                                total: resp.totalCount,
-                                                                current: resp.current,
-                                                                success: true
-                                                            };
-                                                        }
-                                                        return {
-                                                            data: [],
-                                                            total: 0,
-                                                            success: false
-                                                        }
-                                                    }}
-                                                    columns={mccsEditableTableColumns}
-                                                />
-                                            )
-                                        }
-                                    </div>
-                                </div>
-                            )
-                        }
-
                     </div>
                 </div>
             </MccsPageContainer>

+ 167 - 166
src/pages/GradeHospitalAccreditation/articleManagement/model.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:46:45
- * @LastEditTime: 2022-01-05 14:02:15
+ * @LastEditTime: 2022-03-09 18:17:18
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
@@ -16,16 +16,15 @@ import {
   getSelfEvaluation,
   uploadFilePost,
   selfEvolutionCommit,
-  delHistoryRecods,
   getUploadLedgerSelectableType,
   getCurrentHospSelfScore,
   getRuleChildrens,
   getTaizhangImplementation,
   commitTaizhangImplementation,
   commitTaizhangDataDirectoryTableList,
-  
+
 } from './server';
-import { getTreeList,getMaterialListGrades} from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
+import { getTreeList, getMaterialListGrades } from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
 import {
   getScoreLevelData,
   getAccreditationTypeData,
@@ -39,80 +38,86 @@ export interface ImplementationDataItem {
   note: string;
 }
 
-export interface ImplementationDataItemCache {
-  [tabkey: string]: ImplementationDataItem[];
-}
+export type ImplementationDataItemCache = Record<string, ImplementationDataItem[]>;
 
-//articleManagement
+// articleManagement
 const articleManagement = () => {
   const [treeData, setTreeData] = useState<any[]>([]);
-  // const [tableData, setTableData] = useState([]);
   const [currentActivedTree, setCurrentActivedTree] = useState<MccsFileTree.childTree>();
   const [isLeaf, setIsLeaf] = useState(false);
   const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
-  const [leafData, setLeafData] = useState<API.LeafDataType>(); //叶子结点数据
+  const [leafData, setLeafData] = useState<API.LeafDataType>(); // 叶子结点数据
   const [departmentManagers, setDepartmentManagers] = useState<{ label: string; value: number }[]>(
     [],
   );
-  const [selectedDepartment, setSelectedDepartment] = useState<any>();
+
   const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
   const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
-  const [records, setRecords] = useState<MccsRecordList.MccsRecordListType>([]);
-  const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); //自评记录
+
+  const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); // 自评记录
   const [selectedRowKeys, setSelectedRowKeys] = useState<number[] | string[]>([]);
 
   const [drawerVisible, setDrawerVisible] = useState(false);
-  const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING'>(
-    'ARTICLE_SET',
-  );
+
+  /**
+   * ARTICLE_SET 条文设置
+   * BATCHSETTING 批量设置
+   */
+
+  const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING' | undefined>(undefined);
 
   const [reloadRightContent, setReloadRightContent] = useState(false);
 
-  const [moduleMode, setModuleMode] = useState(false); //true台账上传 false条文管理
+  const [moduleMode, setModuleMode] = useState(false); // true台账上传 false条文管理
 
   const [modalVisible, setModalVisible] = useState(false);
 
   const [uploadFormInitValue, setUploadFormInitValue] = useState<any>();
 
   const [selectedSelfEvolution, setSelectedSelfEvolution] =
-    useState<{ label: string; value: any }>(); //MccsClickableTabs value值
+    useState<{ label: string; value: any }>(); // MccsClickableTabs value值
 
   const [currentSelectedSelefEvolution, setCurrentSelectedSelefEvolution] =
-    useState<{ label: string; value: any }>(); //当前选中自评 点击对象
+    useState<{ label: string; value: any }>(); // 当前选中自评 点击对象
 
-  const [uploadLedgerTypeList, setUploadLedgerTypeList] = useState<MccsClickableTabs.TabType[]>([]); //上传台账可选类型
+  const [uploadLedgerTypeList, setUploadLedgerTypeList] = useState<MccsClickableTabs.TabType[]>([]); // 上传台账可选类型
 
-  const [currentHospSelfScoreAndOthers, setCurrentHospSelfScoreAndOthers] = useState<string>(); //当前医院评分及自评结果
+  const [currentHospSelfScoreAndOthers, setCurrentHospSelfScoreAndOthers] = useState<string>(); // 当前医院评分及自评结果
 
-  const [editMode, setEditMode] = useState(false); //编辑模式,台帐上传页面用到
+  const [editMode, setEditMode] = useState(false); // 编辑模式,台帐上传页面用到
 
-  const [implementationData, setImplementationData] = useState<ImplementationDataItemCache>({}); //执行情况说明数据
+  const [implementationData, setImplementationData] = useState<ImplementationDataItemCache>({}); // 执行情况说明数据
   const [taizhangDataDirectoryCommitList, setTaizhangDataDirectoryCommitList] = useState<
     API.TaizhangDataDirectoryCommitListItem[]
   >([]);
 
-  const [isShowMineOnly, setIsShowMineOnly] = useState(false); //左侧树形结构是否只展示当前用户所属的
+  const [isShowMineOnly, setIsShowMineOnly] = useState(false); // 左侧树形结构是否只展示当前用户所属的
 
-  const [hasEditAuthority, setHasEditAuthority] = useState(false); //是否有编辑权限
+  const [hasEditAuthority, setHasEditAuthority] = useState(false); // 是否有编辑权限
 
   const [gradeOptions, setGradeOptions] = useState<{ label: string, value: string | number }[]>([]);
   const [accountTypeOptions, setAccountTypeOptions] = useState<{ label: string, value: string | number }[]>([]);
+  const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
+
+  const [currentSelectedActObj, setCurrentSelectedActObj] = useState<any>(undefined);  //当前正在操作的对象,例如当前选中的树中层级数据,点击详情的的行数据
+
+  const [detailDrawerVisible, setdetailDrawerVisible] = useState(false);   //条文详情抽屉
+
+
 
 
   const getArticleTreeData = async (keyword?: string | number) => {
-    //获取树数据
+    // 获取树数据
     const { list = [] } = await getTreeList(isShowMineOnly, keyword);
     setTreeData(list);
   };
 
   const getTableData = async (params?: any, sorter?: any, filter?: any) => {
-    //根据选中树结构的id获取对应的详情
-    // console.log({params});
-
+    // 根据选中树结构的id获取对应的详情
     let specifyId: number | null = null;
 
     if (params && params.id) {
-      //当存在指定id
+      // 当存在指定id
       specifyId = params.id;
     }
 
@@ -120,25 +125,25 @@ const articleManagement = () => {
       const resp = await getTreeFileTableData(
         specifyId
           ? {
-              //传入树结构id指定获取某一节点对应数据
-              pageSize: 10,
-              ...params,
-              id: specifyId,
-            }
+            // 传入树结构id指定获取某一节点对应数据
+            pageSize: 10,
+            ...params,
+            id: specifyId,
+          }
           : {
-              //直接拿树结构id
-              pageSize: 10,
-              ...params,
-              id: currentActivedTree ? currentActivedTree.id : 0,
-            },
+            // 直接拿树结构id
+            pageSize: 10,
+            ...params,
+            id: currentActivedTree ? currentActivedTree.id : 0,
+          },
         moduleMode,
       );
 
       if (resp) {
         const { page, leafData, isLeaf } = resp;
-        // console.log({page, leafData, isLeaf});
+        setIsLeaf(isLeaf);
         if (!isLeaf && page) {
-          //非叶子结点返回table数据
+          // 非叶子结点返回table数据
           const { list = [], totalCount } = page;
           return {
             data: list,
@@ -166,7 +171,7 @@ const articleManagement = () => {
               responsibilityUserName: '-',
               accountType: '-',
               hospId: -1,
-              userId:-1
+              userId: -1
             },
             pfmViewRuleDetailDataVoList: [],
             pfmImplementations: [],
@@ -178,7 +183,7 @@ const articleManagement = () => {
   };
 
   const getDepartmentRequest = async () => {
-    //获取单位列表
+    // 获取单位列表
     const resp = await getDepartmentList();
     if (resp) {
       const { list = [] } = resp;
@@ -186,20 +191,20 @@ const articleManagement = () => {
         label: item.name,
         value: item.id,
       }));
-    } else {
-      return [];
     }
+    return [];
+
   };
 
   type FormValueType = {
     articleType: { label: string; value: any };
-    responsibilityDepartment: { label: string; value: number; [key: string]: any };
-    responsibilityUser: { label: string; value: number; [key: string]: any };
+    responsibilityDepartment: { label: string; value: number;[key: string]: any };
+    responsibilityUser: { label: string; value: number;[key: string]: any };
     targetScores: { label: string; value: any };
   };
 
   const batchSetting = async (values: FormValueType) => {
-    //批量设置
+    // 批量设置
     const resp = await batchSettingArticle({
       ruleIds: selectedRowKeys,
       responsibilityDepartmentId: values.responsibilityDepartment.value,
@@ -211,22 +216,34 @@ const articleManagement = () => {
     });
 
     if (resp) {
-      //重新刷新表格
-      setReloadRightContent(true);
+      // 重新刷新表格
+      if (!detailDrawerVisible) {
+        //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
+        setReloadRightContent(true);
+      }
       return true;
     }
   };
 
   const setArticle = async (values: FormValueType) => {
-    //条文设置
+    // 条文设置
     // console.log({values});
     if (currentActivedTree && leafData) {
-      const { id: ruleId } = currentActivedTree;
+
+      let ruleId = 0;
+      if (detailDrawerVisible) {
+        //在条文抽屉详情里条文设置
+        ruleId = currentSelectedActObj.id;
+      } else {
+        //正常在详情页设置条文
+        ruleId = Number(currentActivedTree.id)
+      }
+
       const { id } = leafData.reviewArticle;
 
-      let paramsData = {
+      const paramsData = {
         id,
-        ruleId: Number(ruleId),
+        ruleId: ruleId,
         responsibilityDepartmentId: values.responsibilityDepartment.value,
         responsibilityDepartmentName: values.responsibilityDepartment.label,
         responsibilityUserId: values.responsibilityUser.value,
@@ -236,17 +253,18 @@ const articleManagement = () => {
       };
       const resp = await settingArticle(paramsData);
       if (resp) {
-        //更新界面信息
-        getTableData();
+        // 更新界面信息
+        if (!detailDrawerVisible) {
+          //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
+          getTableData();
+        }
         return true;
       }
     }
   };
 
   const getDepartment = async (item: any, option: any) => {
-    //获取责任单位
-    setSelectedDepartment(option);
-
+    // 获取责任单位
     const resp = await getDepartmentList({ responsibilityDepartmentId: item.value });
     if (resp) {
       const { list = [] } = resp;
@@ -294,17 +312,17 @@ const articleManagement = () => {
           publicCateId,
         } = values;
         const { id, accountType } = leafData.reviewArticle;
-        let formData = new FormData();
+        const formData = new FormData();
         fileList.map((t: MccsUpload.UploadFile) => {
           formData.append('file', t.originFileObj);
         });
         formData.append('id', id.toString());
         formData.append('categoryType', accountType);
-        //应产品要求‘制度’是不可变,根据制度获取对应关系
+        // 应产品要求‘制度’是不可变,根据制度获取对应关系
         tab.value.label == '制度' && formData.append('publicCateId', publicCateId);
 
         if (uploadFormInitValue && JSON.stringify(uploadFormInitValue) != '{}') {
-          //重新上传不允许修改类型
+          // 重新上传不允许修改类型
           const { tab } = uploadFormInitValue;
           formData.append('accountType', tab.label);
           formData.append('accountName', tab.value.label);
@@ -315,11 +333,11 @@ const articleManagement = () => {
 
         const resp = await uploadFilePost(formData);
         if (resp) {
-          //上传成功,获取最新台账记录
+          // 上传成功,获取最新台账记录
           getTableData();
         }
         setModalVisible(false);
-        //每次提交完清空表单默认值
+        // 每次提交完清空表单默认值
         setUploadFormInitValue(undefined);
       } catch (err) {
         console.log({ err });
@@ -328,18 +346,18 @@ const articleManagement = () => {
   };
 
   const compalier = (data: ImplementationDataItem[], base: any[]) => {
-    let result: ImplementationDataItem[] = [];
+    const result: ImplementationDataItem[] = [];
 
-    const hasDataKeys = data.map((item) => item.level); //找出已经请求到数据的集合
+    const hasDataKeys = data.map((item) => item.level); // 找出已经请求到数据的集合
 
-    let difference = hasDataKeys
+    const difference = hasDataKeys
       .concat(base)
-      .filter((v) => !hasDataKeys.includes(v) || !base.includes(v)); //找出缺失的项
+      .filter((v) => !hasDataKeys.includes(v) || !base.includes(v)); // 找出缺失的项
     // console.log({difference});
     const needAddImplementationData = difference.map((item) => ({ level: item, note: '' }));
-    const lastimplementationData = [...data, ...needAddImplementationData]; //将需要新增的项添加
+    const lastimplementationData = [...data, ...needAddImplementationData]; // 将需要新增的项添加
     lastimplementationData.forEach((item) => {
-      //数据排序,A>B>C
+      // 数据排序,A>B>C
       switch (item.level) {
         case 'A':
           result[2] = item;
@@ -361,7 +379,7 @@ const articleManagement = () => {
         /**
          * 根据业务逻辑,当选中的值为A时,需要提供A,B,C三个的数据,若没有则需要添加
          */
-        if (data.length == 3) return data; //存在三个值时,直接返回
+        if (data.length == 3) return data; // 存在三个值时,直接返回
         return compalier(data, ['A', 'B', 'C']);
       }
 
@@ -369,14 +387,14 @@ const articleManagement = () => {
         /**
          * 根据业务逻辑,当选中的值为B时,需要提供B,C两个的数据,若没有则需要添加
          */
-        if (data.length == 2) return data; //存在2个值时,直接返回
+        if (data.length == 2) return data; // 存在2个值时,直接返回
         return compalier(data, ['B', 'C']);
       }
       if (selectedSelfEvolution?.label == 'C') {
         /**
          * 根据业务逻辑,当选中的值为C时,需要提供C一个个的数据,若没有则需要添加
          */
-        if (data.length == 1) return data; //存在1个值时,直接返回
+        if (data.length == 1) return data; // 存在1个值时,直接返回
         return compalier(data, ['C']);
       }
     }
@@ -392,16 +410,16 @@ const articleManagement = () => {
     version: string;
     level: string;
   }) => {
-    //或区指定等级的执行情况说明数据,同时根据返回的数据自行添加需要补充的项
-
-    if (implementationData[level]) return; //implementationData集合里已经有了该等级对应的数据时,不请求,为了保证编辑的数据缓存
+    // 或区指定等级的执行情况说明数据,同时根据返回的数据自行添加需要补充的项
+    if (implementationData[level]) return; // implementationData集合里已经有了该等级对应的数据时,不请求,为了保证编辑的数据缓存
 
     const data = await getTaizhangImplementation({ numStr, version, level });
+
     const implementData: ImplementationDataItem[] = data.map((item) => ({
       level: item.level,
       note: item.note,
     }));
-    const resultData = implementationDataFilter(implementData); //得到改造过的数据
+    const resultData = implementationDataFilter(implementData); // 得到改造过的数据
     /**
      * 
      * 应业务要求,自评等级切换时保留之前填写数据
@@ -412,52 +430,45 @@ const articleManagement = () => {
   };
 
   const onSelfEvolutionTabChange = (value: { label: string; value: any }) => {
-    //自评tab切换回调
+    // 自评tab切换回调
     value && setCurrentSelectedSelefEvolution(value);
     value && setSelectedSelfEvolution(value);
   };
 
   const commitSelfEvolution = async () => {
-    //提交自评
+    // 提交自评
     if (leafData && currentSelectedSelefEvolution) {
-      //存在详情信息,且已选择评分
+      // 存在详情信息,且已选择评分
       const { id } = leafData.reviewArticle;
-      let _userData = localStorage.getItem('userData');
+      const _userData = localStorage.getItem('userData');
       if (_userData) {
-        let userData: { name: string; userId: number } = JSON.parse(_userData);
+        const userData: { name: string; userId: number } = JSON.parse(_userData);
         const params = {
           id: Number(id),
-          selfEvaluation: `${
-            currentSelectedSelefEvolution ? currentSelectedSelefEvolution.value : 'null'
-          }`,
+          selfEvaluation: `${currentSelectedSelefEvolution ? currentSelectedSelefEvolution.value : 'null'
+            }`,
           userId: userData?.userId,
           userName: userData?.name,
         };
         const resp = await selfEvolutionCommit(params);
         if (resp && currentActivedTree) {
-          //刷新自评记录
+          // 刷新自评记录
           getSelfEvaluationRecordList(Number(currentActivedTree.id));
-          setSelectedSelfEvolution({ label: 'null', value: 'null' }); //清空选中项
+          setSelectedSelfEvolution({ label: 'null', value: 'null' }); // 清空选中项
           setCurrentSelectedSelefEvolution(undefined);
         }
       }
     } else {
-      notification['info']({
+      notification.info({
         message: '请选择评分!',
       });
     }
   };
 
-  const delHistoryRecordHandle = async (historyRecords: MccsRecordList.historyRecordsItem) => {
-    //删除台账记录
-    const resp = await delHistoryRecods(historyRecords.id);
-    if (resp) {
-      getTableData();
-    }
-  };
+
 
   const getScoreList = async () => {
-    //条文评级
+    // 条文评级
     const data = await getScoreLevelData();
     const tempArr = data.map((t: any) => ({
       label: t.levelNumber,
@@ -468,14 +479,15 @@ const articleManagement = () => {
   };
 
   const accreditationGroupType = async () => {
-    //获取条文组别
+    // 获取条文组别
     const data = await getAccreditationTypeData();
+    console.log({ data });
     const tempArr = data.map((t: any) => ({ label: t.categoryType, value: t.categoryType }));
     return Promise.resolve(tempArr);
   };
 
   const getUploadLedgerType = async () => {
-    //台账类型
+    // 台账类型
     const data = await getUploadLedgerSelectableType();
     if (data) {
       const tempArr = data.map((t: API.RuleChildsItemType) => {
@@ -492,13 +504,13 @@ const articleManagement = () => {
   };
 
   const getCurrentHospScore = async () => {
-    //获取医院评分及自评信息
+    // 获取医院评分及自评信息
     const resp = await getCurrentHospSelfScore();
     setCurrentHospSelfScoreAndOthers(resp);
   };
 
   const getSelectableSelfScoreList = async () => {
-    //获取自评可选列表
+    // 获取自评可选列表
     const resp = await getScoreLevelData();
     const listFilted = resp.filter((t: any) => t.configStatus != 0);
     const list = listFilted.map((t: any) => ({ label: t.levelNumber, value: t.levelNumber }));
@@ -506,7 +518,7 @@ const articleManagement = () => {
   };
 
   const getSelectableRuleChilds = async (id: number) => {
-    //获取台账上传时可选下拉类型
+    // 获取台账上传时可选下拉类型
     const resp = await getRuleChildrens(id);
     return resp.map((t: { id: number; name: string }) => ({ label: t.name, value: t.id }));
   };
@@ -519,7 +531,7 @@ const articleManagement = () => {
         selfEvaluation: item.level,
         node: item.note,
       }));
-      //提交台账执行情况说明
+      // 提交台账执行情况说明
       const respImplementation = await commitTaizhangImplementation({
         hospId: `${leafData.reviewArticle.hospId}`,
         id: leafData.reviewArticle.id,
@@ -532,15 +544,15 @@ const articleManagement = () => {
       const respDataDirectoryTable = await commitTaizhangDataDirectoryTableList(
         taizhangDataDirectoryCommitList,
       );
-      
+
       setEditMode(false);
       // console.log({respDataDirectoryTable,respImplementation})
-      if(respDataDirectoryTable&&respImplementation){
-        //每次服务保存数据成功后,清空台账上传的缓存数据
-        setImplementationData({}); //清空执行情况说明
-        setTaizhangDataDirectoryCommitList([]); //清空台账上传资料目录
-        
-        getTableData(); //两个保存都成功时刷新数据
+      if (respDataDirectoryTable && respImplementation) {
+        // 每次服务保存数据成功后,清空台账上传的缓存数据
+        setImplementationData({}); // 清空执行情况说明
+        setTaizhangDataDirectoryCommitList([]); // 清空台账上传资料目录
+
+        getTableData(); // 两个保存都成功时刷新数据
       }
     }
   };
@@ -548,47 +560,33 @@ const articleManagement = () => {
 
   const getGradeOptions = async () => {
     if (leafData) {
-        const { numStr, version } = leafData.reviewArticle;
-        const resp = await getMaterialListGrades({ numStr, version });
-        if (resp) {
-            const options = resp.map(item => ({ label: item.grade, value: item.grade }));
-            setGradeOptions(options);
-        }
+      const { numStr, version } = leafData.reviewArticle;
+      const resp = await getMaterialListGrades({ numStr, version });
+      if (resp) {
+        const options = resp.map(item => ({ label: item.grade, value: item.grade }));
+        setGradeOptions(options);
+      }
     }
-}
+  }
 
-const getAccoutTypeOptions = async () => {
+  const getAccoutTypeOptions = async () => {
     const resp = await getLedgerType();
     if (resp) {
-        const options =  resp.map(item => ({ label: item.generalName, value: item.generalName }));
-        setAccountTypeOptions(options);
+      const options = resp.map(item => ({ label: item.generalName, value: item.generalName }));
+      setAccountTypeOptions(options);
     }
-}
+  }
 
-  useEffect(() => {
-    if (currentActivedTree) {
-      const { isLeaf } = currentActivedTree;
-      setIsLeaf(isLeaf);
-      getTableData();
-      if (isLeaf) {
-        getScoreList().then((data) => {
-          const dataFilted = data.filter((t: any) => t.configStatus != 0); //去掉不启动
-          // console.log({data,dataFilted});
-          setTargetScores(dataFilted);
-        });
-        accreditationGroupType().then((data) => {
-          setRuleTypes(data);
-        });
-      }
 
-      //每次切换树结构,清空台账上传的缓存数据
-      setImplementationData({}); //清空执行情况说明
-      setTaizhangDataDirectoryCommitList([]); //清空台账上传资料目录
+  useEffect(() => {
+    if (!drawerVisible) {
+      setDrawerFormType(undefined);
     }
-  }, [currentActivedTree]);
+  }, [drawerVisible]);
+
 
   useEffect(() => {
-    //叶子结点数据变化后相关回调
+    // 叶子结点数据变化后相关回调
     if (leafData) {
       const { systemEvaluation, targetEvaluation, selfEvaluation, userId } =
         leafData.reviewArticle;
@@ -596,64 +594,62 @@ const getAccoutTypeOptions = async () => {
       const tempScoreList = [
         {
           label: '目标',
-          value: targetEvaluation ? targetEvaluation : '-',
+          value: targetEvaluation || '-',
         },
         {
           label: '自评',
-          value: selfEvaluation ? selfEvaluation : '-',
+          value: selfEvaluation || '-',
         },
-        // {
-        //   label: '现场查核',
-        //   value: siteEvaluation?siteEvaluation:'-',
-        // },
         {
           label: '系统评分',
-          value: systemEvaluation ? systemEvaluation : '-',
+          value: systemEvaluation || '-',
         },
       ];
       /**
        * 默认加载页面时执行获取执行情况说明数据
        */
-
-
-
       const t = localStorage.getItem('userData') ? localStorage.getItem('userData') : '';
       const userData = JSON.parse(t as string);
 
       setHasEditAuthority(userId == userData.userId);
 
       setImplementationData({ [selfEvaluation]: leafData.pfmImplementations });
-      
+
       const selfEvolution = leafData.reviewArticle.selfEvaluation;
       setSelectedSelfEvolution({ label: selfEvolution, value: selfEvolution });
       setScoreList(tempScoreList);
       getSelectableSelfScoreList();
-      // setRecords(tempRecords);
     }
   }, [leafData]);
 
+  console.log({ drawerFormType });
+
   useEffect(() => {
-    //当抽屉类型改变时
-    if (drawerFormType == 'BATCHSETTING') {
+    // 当抽屉类型改变时
+    console.log('drawerFormType changed');
+    if (drawerFormType == 'BATCHSETTING' || drawerFormType == 'ARTICLE_SET') {
       getScoreList().then((data) => {
-        const dataFilted = data.filter((t: any) => t.configStatus != 0); //去掉不启动
+        const dataFilted = data.filter((t: any) => t.configStatus != 0); // 去掉不启动
         setTargetScores(dataFilted);
       });
+
+
       accreditationGroupType().then((data) => {
         setRuleTypes(data);
       });
     }
   }, [drawerFormType]);
 
+
   useEffect(() => {
-    //左侧树结构只看我的开关切换时,重新获取树结构数据
+    // 左侧树结构只看我的开关切换时,重新获取树结构数据
     getArticleTreeData();
   }, [isShowMineOnly]);
 
   useEffect(() => {
     // console.log({ leafData, selectedSelfEvolution });
     if (leafData && selectedSelfEvolution) {
-      //更新台账页面编辑下的执行情况说明
+      // 更新台账页面编辑下的执行情况说明
       getImplementationForEdit({
         level: selectedSelfEvolution.label,
         /**
@@ -668,17 +664,17 @@ const getAccoutTypeOptions = async () => {
 
   useEffect(() => {
     if (!editMode && leafData) {
-      //取消编辑时,将原自评等级设为默认
+      // 取消编辑时,将原自评等级设为默认
       const selfEvolution = leafData.reviewArticle.selfEvaluation;
       setSelectedSelfEvolution({ label: selfEvolution, value: selfEvolution });
     }
   }, [editMode]);
 
   useEffect(() => {
-    //切换页面类型时做相关处理,如清除之前页面的默认数据
+    // 切换页面类型时做相关处理,如清除之前页面的默认数据
     if (!moduleMode) {
-      setEditMode(false); //条文管理界面无需编辑
-      setIsShowMineOnly(false); //条文管理界面关闭
+      setEditMode(false); // 条文管理界面无需编辑
+      setIsShowMineOnly(false); // 条文管理界面关闭
     }
   }, [moduleMode]);
 
@@ -690,8 +686,7 @@ const getAccoutTypeOptions = async () => {
     getTableData,
     currentActivedTree,
     setCurrentActivedTree,
-    scoreList, //评分
-    records, //台账记录
+    scoreList, // 评分
     getDepartmentRequest,
     departmentManagers,
     getDepartment,
@@ -719,7 +714,7 @@ const getAccoutTypeOptions = async () => {
     commitSelfEvolution,
     selectedSelfEvolution,
     getSelfEvaluationRecordList,
-    delHistoryRecordHandle,
+
     getUploadLedgerType,
     uploadLedgerTypeList,
     setUploadLedgerTypeList,
@@ -728,6 +723,7 @@ const getAccoutTypeOptions = async () => {
     getSelectableRuleChilds,
     editMode,
     setEditMode,
+
     implementationData,
     setImplementationData,
     commitTaizhangImplementationHandle,
@@ -740,7 +736,12 @@ const getAccoutTypeOptions = async () => {
     gradeOptions,
     accountTypeOptions,
     getGradeOptions,
-    getAccoutTypeOptions
+    getAccoutTypeOptions,
+    articleSettingFormInit, setArticleSettingFormInit,
+    setCurrentSelectedActObj,
+    currentSelectedActObj,
+    detailDrawerVisible,
+    setdetailDrawerVisible,
   };
 };
 

+ 58 - 53
src/pages/GradeHospitalAccreditation/articleManagement/server.ts

@@ -1,7 +1,11 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:20
+<<<<<<< HEAD
  * @LastEditTime: 2022-03-04 17:49:35
+=======
+ * @LastEditTime: 2022-03-08 18:29:06
+>>>>>>> master
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/server.ts
@@ -11,19 +15,19 @@ import { request } from 'umi';
 
 
 
-//获取条文表格数据
+// 获取条文表格数据
 export const getTreeFileTableData = (
-  query: { id: string | number; keyword?: string | number,pageSize?:number},
+  query: { id: string | number; keyword?: string | number,pageSize?: number},
   mode?: boolean,
 ) => {
   if (!mode) {
-    //条文
+    // 条文
     return request('/api/pfm/reviewArticle/list', {
       method: 'GET',
       params: { ...query },
     });
-  } else if(mode){
-    //台账
+  } if(mode){
+    // 台账
     return request('/api/pfm/recordUpload/list', {
       method: 'GET',
       params: { ...query },
@@ -31,7 +35,7 @@ export const getTreeFileTableData = (
   }
 };
 
-//获取单位列表
+// 获取单位列表
 
 export type GetDepartmentListType = {
   current: number;
@@ -40,10 +44,10 @@ export type GetDepartmentListType = {
     id: number;
     name: string;
     sysEmployeeVOList: {
-      code:string;
+      code: string;
       hiId: number;
       id: number;
-      name:string;
+      name: string;
     }[];
   }[];
   pageSize: number;
@@ -61,7 +65,7 @@ export const getDepartmentList = async (query?: {
   });
 };
 
-//条文设置
+// 条文设置
 
 export const settingArticle = async (data: API.settingArticlePostDataType) => {
   return request('/api/pfm/reviewArticle/setArticle', {
@@ -70,7 +74,7 @@ export const settingArticle = async (data: API.settingArticlePostDataType) => {
   });
 };
 
-//条文批量设置
+// 条文批量设置
 
 export const batchSettingArticle = async (data: API.batchSettingArticleType) => {
   return request('/api/pfm/reviewArticle/setTargetEvaluation', {
@@ -79,7 +83,7 @@ export const batchSettingArticle = async (data: API.batchSettingArticleType) =>
   });
 };
 
-//获取自评记录
+// 获取自评记录
 
 export const getSelfEvaluation = async (ruleId: string | number) => {
   return request('/api/pfm/pfmarticlehistory/getSelfEvaluation', {
@@ -88,16 +92,16 @@ export const getSelfEvaluation = async (ruleId: string | number) => {
   });
 };
 
-//获取制度下的子节点
+// 获取制度下的子节点
 
 export const getRuleChildrens = async (id: number) => {
   return request('/api/pfm/publicResource/getPublicCateChildren', {
     method: 'GET',
-    params: { id: id },
+    params: { id },
   });
 };
 
-//上传台账
+// 上传台账
 
 export const uploadFilePost = async (uploadData: any) => {
   return request('/api/pfm/recordUpload/setRecordFile', {
@@ -111,7 +115,7 @@ export const uploadFilePost = async (uploadData: any) => {
 export const selfEvolutionCommit = async (data: API.SelfEvolutionCommitType) => {
   return request('/api/pfm/recordUpload/setSelfEvaluationResult', {
     method: 'POST',
-    data: data,
+    data,
   });
 };
 
@@ -124,78 +128,79 @@ export const delHistoryRecods = async (id: number) => {
   });
 };
 
-//获取可选台账类型
+// 获取可选台账类型
 export const getUploadLedgerSelectableType = async () => {
   return request('/api/pfm/sysgeneralconfig/getAccountConfigByType', {
     method: 'GET',
   });
 };
 
-//获取当前医院目标和自评结果
+// 获取当前医院目标和自评结果
 export const getCurrentHospSelfScore = async () => {
   return request('/api/pfm/reviewArticle/getTargetAndSelf', {
     method: 'GET',
   });
 };
 
-//根据执行情况等级获取对应的表格数据
-export const getCurrentLevelTable = async (params:{
-    level:string,//等级
-    numStr:string, //四码
-    version:string,
-    current?:number,//当前页码
-    pageSize?:number,
+// 根据执行情况等级获取对应的表格数据
+export const getCurrentLevelTable = async (params: {
+    level: string,// 等级
+    numStr: string, // 四码
+    version: string,
+    current?: number,// 当前页码
+    pageSize?: number,
 }) => {
     return request('/api/pfm/pfmdatadirectory/getPfmDataDirectoryByLevel', {
       method: 'GET',
-      params:params
+      params
     });
 };
 
-//台账上传时获取四码对应的资料目录表格数据
+// 台账上传时获取四码对应的资料目录表格数据
 
-export const getTaizhangDirectoryTable = async (params:{
-    numStr:string, //四码
-    version:string,
-    current?:number,//当前页码
-    pageSize?:number,
+export const getTaizhangDirectoryTable = async (params: {
+    numStr: string, // 四码
+    version: string,
+    current?: number,// 当前页码
+    pageSize?: number,
 }) => {
     return request<{
-        totalCount:number,
-        pageSize:number,
-        totalPage:number,
-        current:number,
-        list:API.TaizhangDirectoryTableItem[]
+        totalCount: number,
+        pageSize: number,
+        totalPage: number,
+        current: number,
+        list: API.TaizhangDirectoryTableItem[]
     }>('/api/pfm/pfmdatadirectory/getPfmDataDirectory', {
       method: 'GET',
-      params:params,
+      params,
     });
 };
 
 
 
 
-//根据指定level值获取对应的执行情况说明,用于台账上传界面
+// 根据指定level值获取对应的执行情况说明,用于台账上传界面
 
-export const getTaizhangImplementation = async (params:{
-   numStr:string, //四码
-   version:string,
-   level:string,//等级
+export const getTaizhangImplementation = async (params: {
+   numStr: string, // 四码
+   version: string,
+   level: string,// 等级
 }) => {
+
    return request<API.TaizhangImplementationItem[]>('/api/pfmimplementation/getImplementationByLevel', {
      method: 'GET',
-     params:params,
+     params,
    });
 };
 
-//台账界面提交执行情况说明
-export const commitTaizhangImplementation = async (params:{
-    hospId:string, //医院标识
-    id:number,
-    numStr:string,
-    selfEvaluation:string,
-    version:string,
-    implementationDtoList:API.ImplementationDtoListItem[]
+// 台账界面提交执行情况说明
+export const commitTaizhangImplementation = async (params: {
+    hospId: string, // 医院标识
+    id: number,
+    numStr: string,
+    selfEvaluation: string,
+    version: string,
+    implementationDtoList: API.ImplementationDtoListItem[]
 }) => {
    return request('/api/pfm/recordUpload/addAccountData', {
      method: 'POST',
@@ -208,8 +213,8 @@ export const commitTaizhangImplementation = async (params:{
 };
 
 
-//台账界面提交资料目录编辑/新增/删除数据
-export const commitTaizhangDataDirectoryTableList = async (params:API.TaizhangDataDirectoryCommitListItem[]) => {
+// 台账界面提交资料目录编辑/新增/删除数据
+export const commitTaizhangDataDirectoryTableList = async (params: API.TaizhangDataDirectoryCommitListItem[]) => {
    return request('/api/pfm/pfmdatadirectory/addPfmDataDirectory', {
      method: 'POST',
      data:params,

+ 32 - 32
src/pages/GradeHospitalAccreditation/articleManagement/typings.d.ts

@@ -76,12 +76,12 @@ declare namespace API {
     systemEvaluation: string;
     siteEvaluation: string;
     responsibilityDepartmentId: number;
-    responsibilityDepartmentName: string; //负责单位名称
+    responsibilityDepartmentName: string; // 负责单位名称
     responsibilityUserId: number;
-    responsibilityUserName: string; //负责人名称
-    accountType: string; //条文组别
+    responsibilityUserName: string; // 负责人名称
+    accountType: string; // 条文组别
     hospId: number;
-    userId:number,
+    userId: number,
     // recordDay: number;
     // createTime: number;
     // updateTime: number;
@@ -89,9 +89,9 @@ declare namespace API {
   };
 
   type LeafDataType = {
-    pfmImplementations: Type_fmImplementations[]; //执行情况
-    pfmViewRuleDetailDataVoList: Type_pfmViewRuleDetailDataVoList[]; //等级细则
-    reviewArticle: Type_reviewArticle; //四码对应的组别/负责人等数据
+    pfmImplementations: Type_fmImplementations[]; // 执行情况
+    pfmViewRuleDetailDataVoList: Type_pfmViewRuleDetailDataVoList[]; // 等级细则
+    reviewArticle: Type_reviewArticle; // 四码对应的组别/负责人等数据
   };
 
   type settingArticlePostDataType = {
@@ -129,7 +129,7 @@ declare namespace API {
   };
 
   type GetSelfEvaluationRequestType = {
-    //获取自评记录
+    // 获取自评记录
     id: number;
     selfEvaluation: string;
     userName: string;
@@ -150,38 +150,38 @@ declare namespace API {
   };
 
   type TaizhangDirectoryTableItem = {
-    id:number,
-    numStr:string,
-    grade:string,
-    directory:string,
-    accountType:string,
-    accountStatus:string
+    id: number,
+    numStr: string,
+    grade: string,
+    directory: string,
+    accountType: string,
+    accountStatus: string
   }
 
   type TaizhangImplementationItem = {
-    id:number,
-    numStr:string,
-    level:string,
-    note:string,
-    userAccount:string,
-    userName:string,
-    hospId:string,
-    [key:string]:any
+    id: number,
+    numStr: string,
+    level: string,
+    note: string,
+    userAccount: string,
+    userName: string,
+    hospId: string,
+    [key: string]: any
   }  
 
   type ImplementationDtoListItem =  {
-    node:string,
-    selfEvaluation:string
+    node: string,
+    selfEvaluation: string
   }
 
   type  TaizhangDataDirectoryCommitListItem = {
-    accountStatus:string,
-    accountType:string,
-    dataStatus:number, //操作状态 0不操作 1增加 2修改 3删除
-    directory:string,
-    grade:string,
-    id:number,
-    numStr:string,
-    version:string
+    accountStatus: string,
+    accountType: string,
+    dataStatus: number, // 操作状态 0不操作 1增加 2修改 3删除
+    directory: string,
+    grade: string,
+    id: number,
+    numStr: string,
+    version: string
   }
 }

+ 23 - 23
src/pages/GradeHospitalAccreditation/ledgerUpload/componets/deitailModule/detail.tsx

@@ -27,7 +27,7 @@ const { TextArea } = Input;
 const {Option} = Select;
 
 enum ActType {
-    'NOACT',  //不操作
+    'NOACT',  // 不操作
     'ADD',
     'EDIT',
     'DEL'
@@ -123,7 +123,7 @@ const DetailModule = () => {
             },
             render: (_: any, row: any) => {
                 // console.log({ _, row }); 
-                return typeof _ == 'object' ? _.join(',') : _;
+                return typeof _ === 'object' ? _.join(',') : _;
             },
         },
         {
@@ -184,7 +184,7 @@ const DetailModule = () => {
     const followWindowResize = ()=>{
 
         if(leafContentRef.current){
-         const leafContentH = leafContentRef.current.clientHeight + 50;  //加上padding
+         const leafContentH = leafContentRef.current.clientHeight + 50;  // 加上padding
          const headerH = 0;
          const scoreH = isModeTwo?(60+32):0;
          const h =   window.innerHeight - (leafContentH + headerH + scoreH);
@@ -193,39 +193,39 @@ const DetailModule = () => {
     }
 
     const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
-        //台账资料目录编辑回调
+        // 台账资料目录编辑回调
         const version = restModelData.leafData?.reviewArticle.version;
         let prevData = restModelData.taizhangDataDirectoryCommitList;
         const numStr = restModelData.leafData?.reviewArticle.numStr;
 
         if (actType == ActType.DEL && data.id == '-') {
-            //如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
+            // 如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
             prevData = prevData.filter(item => item.directory != data.directory);
             restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
             return;
         }
 
-        restModelData.setTaizhangDataDirectoryCommitList([...prevData, { ...data, dataStatus: actType, version: version ? version : '', grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0' }])
+        restModelData.setTaizhangDataDirectoryCommitList([...prevData, { ...data, dataStatus: actType, version: version || '', grade: data.grade.join(','), numStr, accountStatus: data.accountStatus ? '1' : '0' }])
     }
 
     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);
-            //拷贝旧的目标等级数据
-            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
-            //将新的编辑内容赋值给正在编辑的目标下的level
+            // 拷贝旧的目标等级数据
+            const _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
+            // 将新的编辑内容赋值给正在编辑的目标下的level
             _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
 
             if (editImplementationDataItemIndex != -1) {
                 restModelData.setImplementationData({
                     ...restModelData.implementationData,
-                    //插入更新
+                    // 插入更新
                     [editTargetLevel]: _cpOldImplemetationItem
                 }
                 )
@@ -237,7 +237,7 @@ const DetailModule = () => {
 
 
     useEffect(() => {
-        const leafData = restModelData.leafData;
+        const {leafData} = restModelData;
         if (leafData) {
             restModelData.setSelectedSelfEvolution({
                 label: leafData.reviewArticle.selfEvaluation,
@@ -251,10 +251,10 @@ const DetailModule = () => {
         window.addEventListener("resize",followWindowResize);
 
         setTimeout(()=>{
-            //首次加载叶子节点内容触发一次
-            var myEvent = new Event('resize');
+            // 首次加载叶子节点内容触发一次
+            const myEvent = new Event('resize');
             window.dispatchEvent(myEvent); 
-            document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
+            document.body.style.overflowY = 'hidden';  // 叶子节点下锁住页面滚动
         },100);
 
         return ()=>{
@@ -292,7 +292,7 @@ const DetailModule = () => {
                 </div>
 
                 {
-                    //台账上传页面且非编辑状态下
+                    // 台账上传页面且非编辑状态下
                     !restModelData.editMode && restModelData.hasEditAuthority && <div className='editPageBtn' onClick={() => setEditStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
                 }
             </div>
@@ -344,11 +344,11 @@ const DetailModule = () => {
 
             {
                 restModelData.leafData && (
-                    //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
+                    // 台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
                     <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{height:`${scrollAreaH}px`}}>
                         <div>
                             {
-                                //渲染执行情况说明
+                                // 渲染执行情况说明
                                 /**
                                  * 满足条件:
                                  * 1.存在自评等级从接口获取或手动点击选择
@@ -390,7 +390,7 @@ const DetailModule = () => {
                             }
                             <div >
                                 {
-                                    //台帐下展示
+                                    // 台帐下展示
                                     (isModeTwo && restModelData.leafData) && (
                                         <MccsEditableTable
                                             bordered={true}
@@ -412,7 +412,7 @@ const DetailModule = () => {
                                                     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' ? false : true })), //多选下拉需传数组值
+                                                        data: list.map(item => ({ ...item, grade: item.grade ? item.grade.split(',') : [], accountStatus: item.accountStatus != '0' })), // 多选下拉需传数组值
                                                         total: resp.totalCount,
                                                         current: resp.current,
                                                         success: true

+ 14 - 16
src/pages/GradeHospitalAccreditation/ledgerUpload/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-01-05 14:18:54
+ * @LastEditTime: 2022-03-07 13:58:03
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -30,7 +30,7 @@ type LedgerUploadPropsType = {
 
 }
 
-//条文管理
+// 条文管理
 const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
     const columns = [
@@ -67,7 +67,7 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
                 }
                 return (
 
-                    <ProFormDateRangePicker name='date' placeholder={['开始时间', '结束时间']} fieldProps={{ locale: locale }} />
+                    <ProFormDateRangePicker name='date' placeholder={['开始时间', '结束时间']} fieldProps={{ locale }} />
 
                 )
             },
@@ -160,7 +160,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
 
     const openDrawerHandle = (record: any) => {
-        // console.log({record});
         restLedgerUploadModelData.setCurrentRecord(record)
         restLedgerUploadModelData.setDrawerVisible(true);
         restArticleManagementModelData.getTableData({ id: record.id });
@@ -170,8 +169,8 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
         const { id } = record;
         restLedgerUploadModelData.delRuleHandle(id);
-        restArticleManagementModelData.getArticleTreeData();  //刷新树结构
-        restArticleManagementModelData.setReloadRightContent(true);  //刷新表格数据
+        restArticleManagementModelData.getArticleTreeData();  // 刷新树结构
+        restArticleManagementModelData.setReloadRightContent(true);  // 刷新表格数据
     }
 
     const onVisibleChangeHandle = (visible: boolean) => {
@@ -180,8 +179,8 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
     }
 
     const upLoadFileHandle = (formInitData?: any) => {
-        //因为modalForm开启了request+params获取表单默认值,
-        //所以必须先设置默认值才能开启弹窗
+        // 因为modalForm开启了request+params获取表单默认值,
+        // 所以必须先设置默认值才能开启弹窗
         if (formInitData) {
             const { fileUrl, recordTypeName, fileName, accountType, cateId } = formInitData;
             restArticleManagementModelData.setUploadFormInitValue({
@@ -197,8 +196,8 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
             restArticleManagementModelData.setUploadFormInitValue({})
         }
 
-        restArticleManagementModelData.getUploadLedgerType().then((data:any) => {
-            //设置上传台账可选类型
+        restArticleManagementModelData.getUploadLedgerType().then((data: any) => {
+            // 设置上传台账可选类型
             restArticleManagementModelData.setUploadLedgerTypeList(data);
 
         })
@@ -206,7 +205,7 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
     }
 
     const actionNodeFunc = (data: any) => {
-        //渲染记录列表操作按钮
+        // 渲染记录列表操作按钮
         // console.log({ data });
         const reupload = () => {
 
@@ -219,16 +218,16 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
     useEffect(()=>{
         
-        const drawerVisible =  restLedgerUploadModelData.drawerVisible;
+        const {drawerVisible} = restLedgerUploadModelData;
         
-        //关闭抽屉时,取消编辑模式
+        // 关闭抽屉时,取消编辑模式
         if(!drawerVisible){
             restArticleManagementModelData.setEditMode(false);
         }
-      },[restLedgerUploadModelData.drawerVisible]);
+    },[restLedgerUploadModelData.drawerVisible]);
 
     useEffect(() => {
-        //监听上传台账弹窗变化,更新本地drawer里台账记录
+        // 监听上传台账弹窗变化,更新本地drawer里台账记录
         if (!restArticleManagementModelData.modalVisible && restLedgerUploadModelData.currentRecord) {
             restArticleManagementModelData.getTableData({ id: restLedgerUploadModelData.currentRecord.id });
         }
@@ -244,7 +243,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
                 isModeTwo={true}
             />
 
-
             <MccsDrawerForm
                 title={restLedgerUploadModelData.currentRecord?.name}
                 visible={restLedgerUploadModelData.drawerVisible}

+ 24 - 26
src/pages/GradeHospitalAccreditation/ledgerUpload/model.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:46:45
- * @LastEditTime: 2021-12-31 11:33:37
+ * @LastEditTime: 2022-03-07 10:17:07
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
@@ -16,24 +16,24 @@ import {
 import { delDetailRule } from '@/pages/GradeHospitalAccreditation/accreditationDetail/service';
 import {getScoreLevelData} from '@/pages/PlatformMana/generalSetting/serve';
 
-//ledgerUpload
+// ledgerUpload
 const ledgerUpload = () => {
   const [drawerVisible, setDrawerVisible] = useState(false);
   const [scoreList, setScoreList] = useState<any[]>([]);
   const [records, setRecords] = useState<MccsRecordList.MccsRecordListType>();
   const [currentRecord, setCurrentRecord] = useState<API.tableDataItemType>();
   const [currentLeafData, setCurrentLeafData] = useState<API.LeafDataType>();
-  const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); //自评记录
+  const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); // 自评记录
   // const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING'>(  'ARTICLE_SET');
 
-  const [targetScores,setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);  //可选等级列表
+  const [targetScores,setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);  // 可选等级列表
 
-  const [selectedSelfEvolution,setSelectedSelfEvolution] = useState<{label:string,value:any}>();  //MccsClickableTabs value值
+  const [selectedSelfEvolution,setSelectedSelfEvolution] = useState<{label: string,value: any}>();  // MccsClickableTabs value值
 
-  const [currentSelectedSelefEvolution,setCurrentSelectedSelefEvolution] = useState<{label:string,value:any}>(); //MccsClickableTabs 点击对象
+  const [currentSelectedSelefEvolution,setCurrentSelectedSelefEvolution] = useState<{label: string,value: any}>(); // MccsClickableTabs 点击对象
 
   const getTableData = async () => {
-    //根据选中表格的id获取对应的详情
+    // 根据选中表格的id获取对应的详情
     if (currentRecord) {
       const resp = await getTreeFileTableData({
         id: currentRecord ? currentRecord.id : 0,
@@ -55,7 +55,7 @@ const ledgerUpload = () => {
   };
 
   const getSelfEvaluationRecordList = async (id: number) => {
-    //获取自评记录(无法从accreditationDetail迁移)
+    // 获取自评记录(无法从accreditationDetail迁移)
     const resp = await getSelfEvaluation(id);
 
     if (resp) {
@@ -78,24 +78,24 @@ const ledgerUpload = () => {
   };
 
   const commitSelfEvolution = async ()=>{
-    //提交自评
+    // 提交自评
     if(currentLeafData&&currentSelectedSelefEvolution){
-      //存在详情信息,且已选择评分
+      // 存在详情信息,且已选择评分
       const {id} = currentLeafData.reviewArticle;
-      let _userData = localStorage.getItem('userData');
+      const _userData = localStorage.getItem('userData');
       if(_userData){
-        let userData:{name:string,userId:number} = JSON.parse(_userData)
+        const userData: {name: string,userId: number} = JSON.parse(_userData)
         const params = {
           id:Number(id),
-          selfEvaluation:`${currentSelectedSelefEvolution?currentSelectedSelefEvolution:'null'}`,
+          selfEvaluation:`${currentSelectedSelefEvolution || 'null'}`,
           userId:userData?.userId,
           userName:userData?.name
         }
          const resp = await selfEvolutionCommit(params);
          if(resp&&currentRecord){
-           //刷新自评记录
+           // 刷新自评记录
           getSelfEvaluationRecordList(Number(currentRecord.id));
-          setSelectedSelfEvolution(undefined);  //清空选中项
+          setSelectedSelfEvolution(undefined);  // 清空选中项
           setCurrentSelectedSelefEvolution(undefined);
          }
       }  
@@ -106,23 +106,23 @@ const ledgerUpload = () => {
     }
   }
 
-  const onSelfEvolutionTabChange = (value:{label:string,value:any})=>{
-    //自评tab切换回调
+  const onSelfEvolutionTabChange = (value: {label: string,value: any})=>{
+    // 自评tab切换回调
     value&&setCurrentSelectedSelefEvolution(value);
     value&&setSelectedSelfEvolution(value);
   }
   
 
   const getSelectableSelfScoreList = async ()=>{
-      //获取自评可选列表
+      // 获取自评可选列表
       const resp = await getScoreLevelData();
-      const listFilted = resp.filter((t:any)=>t.configStatus != 0);
-      const list = listFilted.map((t:any)=>({label:t.levelNumber,value:t.levelNumber}));
+      const listFilted = resp.filter((t: any)=>t.configStatus != 0);
+      const list = listFilted.map((t: any)=>({label:t.levelNumber,value:t.levelNumber}));
       setTargetScores(list);
   }
 
   useEffect(() => {
-    //点击时获取对应详情
+    // 点击时获取对应详情
     getTableData();
     // getSelectableSelfScoreList();
   }, [currentRecord]);
@@ -136,13 +136,11 @@ const ledgerUpload = () => {
         systemEvaluation,
         targetEvaluation,
         selfEvaluation,
-        siteEvaluation,
-        // records = [],
       } = currentLeafData.reviewArticle;
       const tempScoreList = [
         {
           label: '自评',
-          value: selfEvaluation ? selfEvaluation : '-',
+          value: selfEvaluation || '-',
         },
         // {
         //   label: '现场查核',
@@ -150,11 +148,11 @@ const ledgerUpload = () => {
         // },
         {
           label: '目标',
-          value: targetEvaluation ? targetEvaluation : '-',
+          value: targetEvaluation || '-',
         },
         {
           label: '系统评分',
-          value: systemEvaluation ? systemEvaluation : '-',
+          value: systemEvaluation || '-',
         },
       ];
       // console.log({tempScoreList});

+ 8 - 8
src/pages/GradeHospitalAccreditation/ledgerUpload/server.ts

@@ -15,8 +15,8 @@ import { request } from 'umi';
 
 
 
-//获取条文表格数据
-export const getTreeFileTableData  = async (query:{id:string|number,keyword?:string|number})=>{
+// 获取条文表格数据
+export const getTreeFileTableData  = async (query: {id: string|number,keyword?: string|number})=>{
   
     return request('/api/pfm/reviewArticle/list', {
         method: 'GET',
@@ -25,8 +25,8 @@ export const getTreeFileTableData  = async (query:{id:string|number,keyword?:str
 
 }
 
-//获取单位列表
-export const getDepartmentList  = async (query?:{responsibilityDepartmentId?:number,responsibilityUserId?:number})=>{
+// 获取单位列表
+export const getDepartmentList  = async (query?: {responsibilityDepartmentId?: number,responsibilityUserId?: number})=>{
   
     return request('/api/pfm/sysdepartment/getSysDepartmentList', {
         method: 'GET',
@@ -35,9 +35,9 @@ export const getDepartmentList  = async (query?:{responsibilityDepartmentId?:num
 
 }
 
-//条文设置
+// 条文设置
 
-export const settingArticle  = async (data:API.settingArticlePostDataType)=>{
+export const settingArticle  = async (data: API.settingArticlePostDataType)=>{
   
     return request('/api/pfm/reviewArticle/setArticle', {
         method: 'POST',
@@ -46,9 +46,9 @@ export const settingArticle  = async (data:API.settingArticlePostDataType)=>{
 
 }
 
-//条文批量设置
+// 条文批量设置
 
-export const batchSettingArticle  = async (data:API.batchSettingArticleType)=>{
+export const batchSettingArticle  = async (data: API.batchSettingArticleType)=>{
   
     return request('/api/pfm/reviewArticle/setTargetEvaluation', {
         method: 'POST',

+ 33 - 33
src/pages/GradeHospitalAccreditation/ledgerUpload/typings.d.ts

@@ -13,50 +13,50 @@
 declare namespace API {
 
      type RecordsItemType = {
-      evaluation:string,
-      details:{
-         userName:string,
-         fileName:string,
-         fileUrl:string,
-         createTime:string,
-         recordTypeName:string
+      evaluation: string,
+      details: {
+         userName: string,
+         fileName: string,
+         fileUrl: string,
+         createTime: string,
+         recordTypeName: string
       }[]
      }
 
      type LeafDataType = {
-        id:number,	
-        numStr:string,	
-        name:string,	
-        accountType:string,
-        responsibilityDepartmentName:number,	
-        responsibilityUserName:string,
-        selfEvaluation:string,	
-        targetEvaluation:string,
-        systemEvaluation:string,
-        siteEvaluation:string,
-        records?:RecordsItemType[]
+        id: number,	
+        numStr: string,	
+        name: string,	
+        accountType: string,
+        responsibilityDepartmentName: number,	
+        responsibilityUserName: string,
+        selfEvaluation: string,	
+        targetEvaluation: string,
+        systemEvaluation: string,
+        siteEvaluation: string,
+        records?: RecordsItemType[]
      }
 
 
      type settingArticlePostDataType = {
-      id:number,  // maybe 0
-      ruleId:number,
-      responsibilityDepartmentId:number,
-      responsibilityDepartmentName:string,
-      responsibilityUserId:number,
-      responsibilityUserName:string,
-      targetEvaluation:string,
-      articleType:string
+      id: number,  // maybe 0
+      ruleId: number,
+      responsibilityDepartmentId: number,
+      responsibilityDepartmentName: string,
+      responsibilityUserId: number,
+      responsibilityUserName: string,
+      targetEvaluation: string,
+      articleType: string
      }
 
      type batchSettingArticleType = {
-      ruleIds:number[]|string[]|[],
-      responsibilityDepartmentId:number,
-      responsibilityDepartmentName:string,
-      responsibilityUserId:number,
-      responsibilityUserName:string,
-      targetEvaluation:string,
-      articleType:string
+      ruleIds: number[]|string[]|[],
+      responsibilityDepartmentId: number,
+      responsibilityDepartmentName: string,
+      responsibilityUserId: number,
+      responsibilityUserName: string,
+      targetEvaluation: string,
+      articleType: string
      }
 
 }

+ 5 - 8
src/pages/KeepImprove/departmentIssueRank/index.tsx

@@ -14,7 +14,7 @@ import { history, useModel } from 'umi'
 
 import './index.less';
 
-import { menuDataItemType } from '@/app';
+import type { menuDataItemType } from '@/app';
 
 
 type QuestionGatherAndReviseProps = {}
@@ -22,15 +22,13 @@ type QuestionGatherAndReviseProps = {}
 
 const getCurrentRoutesData = (data: menuDataItemType[], path: string) => {
     let result;
-    function looper (arr:menuDataItemType[]){
+    function looper (arr: menuDataItemType[]){
         for (const element of arr) {
             if (element.path == path) {
                 result =  element
-            } else {
-                if (element.children && element.children.length > 0) {
+            } else if (element.children && element.children.length > 0) {
                     looper(element.children);
                 }
-            }
         }
     }
     looper(data);
@@ -47,7 +45,7 @@ const QuestionGatherAndRevise: React.FC<QuestionGatherAndReviseProps> = () => {
         const { location: { pathname } } = history;
         if (initialState?.menu) {
             // console.log(getCurrentRoutesData(initialState.menu, pathname));
-            const currentRouteData:any = getCurrentRoutesData(initialState.menu, pathname);
+            const currentRouteData: any = getCurrentRoutesData(initialState.menu, pathname);
             if(currentRouteData){
                 console.log({currentRouteData});
                 setIframeUrl(currentRouteData.softUrl);
@@ -60,8 +58,7 @@ const QuestionGatherAndRevise: React.FC<QuestionGatherAndReviseProps> = () => {
         <MccsPageContainer>
             {
                 iframeUrl&&(
-                    <iframe id="reportFrame" src={`${iframeUrl}`} width="100%" height="800px">
-                    </iframe>
+                    <iframe id="reportFrame" src={`${iframeUrl}`} width="100%" height="800px" />
                 )
             }
         </MccsPageContainer>

+ 2 - 2
src/pages/KeepImprove/departmentScoreRank/index.tsx

@@ -16,7 +16,7 @@ import './index.less';
 type QuestionGatherAndReviseProps = {}
 
 
-const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
+const QuestionGatherAndRevise: React.FC<QuestionGatherAndReviseProps> = ()=>{
     useEffect(() => {
 
     }, []);
@@ -24,7 +24,7 @@ const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
     return (
         <MccsPageContainer>
             {
-                //children已被iframe代理,详细请查看MccsPageContainer组件
+                // children已被iframe代理,详细请查看MccsPageContainer组件
             }
         </MccsPageContainer>
     )

+ 2 - 2
src/pages/KeepImprove/indexNumGather/index.tsx

@@ -15,7 +15,7 @@ import './index.less';
 
 type QuestionGatherAndReviseProps = {}
 
-const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
+const QuestionGatherAndRevise: React.FC<QuestionGatherAndReviseProps> = ()=>{
 
     useEffect(() => {
 
@@ -24,7 +24,7 @@ const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
     return (
         <MccsPageContainer>
             {
-                //children已被iframe代理,详细请查看MccsPageContainer组件
+                // children已被iframe代理,详细请查看MccsPageContainer组件
             }
         </MccsPageContainer>
     )

+ 5 - 5
src/pages/KeepImprove/qualityRating/index.tsx

@@ -30,7 +30,7 @@ type TableDataItemType = {
 }
 
 
-const setColor = (type:string) => {
+const setColor = (type: string) => {
     switch (type) {
         case 'A':
             return '#69D1CC';
@@ -63,7 +63,7 @@ const QualityRating: React.FC<QualityRatingType> = (props) => {
         if (resp) {
             setTableData(resp);
             const lineArr = resp.map((t: any) => {
-                //设置辅助线
+                // 设置辅助线
                 return {
                     type: 'line',
                     start: ['min', Number(t.requirements.replace(/[^0-9]/ig, ""))],
@@ -90,7 +90,7 @@ const QualityRating: React.FC<QualityRatingType> = (props) => {
         const resp = await getColumnData();
         if (resp) {
             const mapData = resp;
-            let dataArr: any[] = [];//柱形图数据
+            let dataArr: any[] = [];// 柱形图数据
 
             mapData[0].qualityTypeList.forEach((a: any, index: number) => {
                 const tempArr = mapData.map((a: any) => {
@@ -252,12 +252,12 @@ const QualityRating: React.FC<QualityRatingType> = (props) => {
                             }}
                             tooltip={{
                                 formatter: (datum: any) => {
-                                    return { name: datum.name, value: datum.value + '%' };
+                                    return { name: datum.name, value: `${datum.value  }%` };
                                 },
                             }}
                             color={
                                 (_ref) => {
-                                    var type = _ref.name;
+                                    const type = _ref.name;
                                     if (type === 'A') {
                                         return '#69D1CC';
                                     }

+ 2 - 2
src/pages/KeepImprove/qualityRating/serve.ts

@@ -11,7 +11,7 @@
 
 import { request } from 'umi';
 
-//获取统计表单数据
+// 获取统计表单数据
 export const getTableData  = async ()=>{
     
         return request('/api/pfm/sysgeneralconfig/getFormStatistical', {
@@ -19,7 +19,7 @@ export const getTableData  = async ()=>{
         });
 }
 
-//获取柱形图数据
+// 获取柱形图数据
 export const getColumnData  = async ()=>{
     
     return request('/api/pfm/sysgeneralconfig/getStatistics', {

+ 2 - 2
src/pages/KeepImprove/questionGather/index.tsx

@@ -14,7 +14,7 @@ import './index.less';
 
 type QuestionGatherAndReviseProps = {}
 
-const QuestionGather:React.FC<QuestionGatherAndReviseProps> = ()=>{
+const QuestionGather: React.FC<QuestionGatherAndReviseProps> = ()=>{
 
     useEffect(() => {
 
@@ -23,7 +23,7 @@ const QuestionGather:React.FC<QuestionGatherAndReviseProps> = ()=>{
     return (
         <MccsPageContainer>
             {
-                //children已被iframe代理,详细请查看MccsPageContainer组件
+                // children已被iframe代理,详细请查看MccsPageContainer组件
             }
         </MccsPageContainer>
     )

+ 2 - 2
src/pages/KeepImprove/questionGatherAndRevise/index.tsx

@@ -16,7 +16,7 @@ import './index.less';
 type QuestionGatherAndReviseProps = {}
 
 
-const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
+const QuestionGatherAndRevise: React.FC<QuestionGatherAndReviseProps> = ()=>{
 
 
     useEffect(() => {
@@ -26,7 +26,7 @@ const QuestionGatherAndRevise:React.FC<QuestionGatherAndReviseProps> = ()=>{
     return (
         <MccsPageContainer>
             {
-                //children已被iframe代理,详细请查看MccsPageContainer组件
+                // children已被iframe代理,详细请查看MccsPageContainer组件
             }
         </MccsPageContainer>
     )

+ 5 - 5
src/pages/PlatformMana/districtMana/service.js

@@ -10,7 +10,7 @@
 import { request } from 'umi';
 
 
-//获取所有医院列表
+// 获取所有医院列表
 export async function getDistrictList(params, options) {
     return request('/api/pfm/hosptail/list', {
       method: 'GET',
@@ -19,7 +19,7 @@ export async function getDistrictList(params, options) {
     });
 }
 
-//获取主医院列表
+// 获取主医院列表
 export async function getMainDistrictList(params, options) {
   return request('/api/pfm/hosptail/getAll', {
     method: 'GET',
@@ -28,7 +28,7 @@ export async function getMainDistrictList(params, options) {
   });
 }
 
-//编辑医院
+// 编辑医院
 export async function editDistrictList(body, options) {
   return request('/api/pfm/hosptail/update', {
     method: 'POST',
@@ -37,7 +37,7 @@ export async function editDistrictList(body, options) {
   });
 }
 
-//新增医院
+// 新增医院
 export async function addDistrict(body, options) {
   return request('/api/pfm/hosptail/save', {
     method: 'POST',
@@ -46,7 +46,7 @@ export async function addDistrict(body, options) {
   });
 }
 
-//删除医院
+// 删除医院
 export async function delDistrict(params, options) {
   const {id} = params;
   const ids = [id];

+ 13 - 13
src/pages/PlatformMana/generalSetting/index.tsx

@@ -208,7 +208,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
 
     const getTableDataRequest = async () => {
 
-        const respData:any[] = await getAccreditationTypeData();
+        const respData: any[] = await getAccreditationTypeData();
         if (respData) {
             setReloadTableOne(false);
             return {
@@ -222,10 +222,10 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
     }
 
     const getLevelScoreTableDataRequest = async () => {
-        //获取等级分数
+        // 获取等级分数
         const respData = await getScoreLevelData();
         if (respData) {
-            const _respData = respData.map((t:any)=>({...t,configStatus:`${t.configStatus}`})); //Columns的key只可以是string
+            const _respData = respData.map((t: any)=>({...t,configStatus:`${t.configStatus}`})); // Columns的key只可以是string
             setReloadTableTwo(false);
             return {
                 data: _respData,
@@ -238,10 +238,10 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
     }
 
     const getLedgerTableDataRequest = async () => {
-        //获取台账类型数据
+        // 获取台账类型数据
         const respData = await getLedgerType();
         if (respData) {
-            const _respData = respData.map((t:any)=>({...t,configStatus:`${t.configStatus}`}));//Columns的key只可以是string
+            const _respData = respData.map((t: any)=>({...t,configStatus:`${t.configStatus}`}));// Columns的key只可以是string
             setReloadTableThree(false);
             return {
                 data: _respData,
@@ -268,7 +268,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
     const addData = async (data: dataType, typeNum: number) => {
         const { categoryType,configStatus,requirements,levelNumber,configNote, generalName} = data;
         if (typeNum == 1) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.AddtableDataPostType = {
                 configType: typeNum,
                 categoryType,
@@ -280,7 +280,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
             }
         }
         if (typeNum == 2) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.AddtableDataPostType = {
                 configType: typeNum,
                 configStatus:Number(configStatus),
@@ -294,7 +294,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
             }
         }
         if (typeNum == 3) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.AddtableDataPostType = {
                 configType: typeNum,
                 configStatus:Number(configStatus),
@@ -310,7 +310,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
 
     }
 
-    const delData = async (id:number,typeNum:number)=>{
+    const delData = async (id: number,typeNum: number)=>{
           const resp = await delTableData(id);
           if(resp){
             typeNum==1&&setReloadTableOne(true);
@@ -322,7 +322,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
     const editDataHandle = async (data: dataType, typeNum: number) => {
         const { categoryType,configStatus,requirements,levelNumber,configNote, generalName, id } = data;
         if (typeNum == 1) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.EdittableDataPostType = {
                 configType: typeNum,
                 categoryType,
@@ -336,7 +336,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
             }
         }
         if (typeNum == 2) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.EdittableDataPostType = {
                 configType: typeNum,
                 configStatus:Number(configStatus),
@@ -351,7 +351,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
             }
         }
         if (typeNum == 3) {
-            //条文组别类型新增
+            // 条文组别类型新增
             const postData: API.EdittableDataPostType = {
                 configType: typeNum,
                 configStatus:Number(configStatus),
@@ -374,7 +374,7 @@ const GeneralSetting: React.FC<GeneralSettingType> = () => {
                  <ProForm 
                     onFinish={async (values)=>{
                             console.log({values});
-                            let formData = new FormData();
+                            const formData = new FormData();
                             formData.set('file',values.file.file.originFileObj);
                             // console.log(formData.get('file'));
                             const resp = await importFile(formData);

+ 18 - 18
src/pages/PlatformMana/generalSetting/serve.ts

@@ -10,7 +10,7 @@
 
 import { request } from 'umi';
 
-//获取评审细则类型数据
+// 获取评审细则类型数据
 export const getAccreditationTypeData  = async ()=>{
     
         return request('/api/pfm/sysgeneralconfig/getReviewRulesConfig', {
@@ -21,26 +21,26 @@ export const getAccreditationTypeData  = async ()=>{
 
 
 
-//添加数据
-export const addTableData  = async (data:API.AddtableDataPostType)=>{
+// 添加数据
+export const addTableData  = async (data: API.AddtableDataPostType)=>{
     
     return request('/api/pfm/sysgeneralconfig/addSysGeneralConfig', {
         method: 'POST',
-        data:data
+        data
     });
 }
 
-//编辑数据
-export const editTableData  = async (data:API.EdittableDataPostType)=>{
+// 编辑数据
+export const editTableData  = async (data: API.EdittableDataPostType)=>{
     
     return request('/api/pfm/sysgeneralconfig/updateSysGeneralConfig', {
         method: 'POST',
-        data:data
+        data
     });
 }
 
 
-//获取分数等级数据
+// 获取分数等级数据
 export const getScoreLevelData  = async ()=>{
     
     return request<Promise<any[]>>('/api/pfm/sysgeneralconfig/getScoreConfig', {
@@ -48,22 +48,22 @@ export const getScoreLevelData  = async ()=>{
     });
 }
 
-//获取台账类型数据
+// 获取台账类型数据
 export const getLedgerType  = async ()=>{
     
     return request<{
-        configNote:string,
-        configStatus:number,
-        generalName:string,
-        id:number,
-        levelNumber:string
+        configNote: string,
+        configStatus: number,
+        generalName: string,
+        id: number,
+        levelNumber: string
     }[]>('/api/pfm/sysgeneralconfig/getAccountConfig', {
         method: 'GET',
     });
 }
 
-//删除数据
-export const delTableData  = async (id:number)=>{
+// 删除数据
+export const delTableData  = async (id: number)=>{
     
     return request('/api/pfm/sysgeneralconfig/deleteSysGeneralConfig', {
         method: 'POST',
@@ -71,8 +71,8 @@ export const delTableData  = async (id:number)=>{
     });
 }
 
-//导入
-export const importFile  = async (formData:FormData)=>{
+// 导入
+export const importFile  = async (formData: FormData)=>{
 
     return request('/api/pfm/excel/importReviewRule', {
         method: 'POST',

+ 15 - 15
src/pages/PlatformMana/generalSetting/typings.d.ts

@@ -10,22 +10,22 @@
 
 declare namespace API {
     type AddtableDataPostType = {
-        configType:number,
-        categoryType?:string,
-        configNote?:string,
-        configStatus?:number,
-        generalName?:string,
-        levelNumber?:string,
-        requirements?:string
+        configType: number,
+        categoryType?: string,
+        configNote?: string,
+        configStatus?: number,
+        generalName?: string,
+        levelNumber?: string,
+        requirements?: string
     }
     type EdittableDataPostType = {
-        categoryType?:string,
-        configNote?:string,
-        configStatus?:number,
-        configType:number,
-        generalName?:string,
-        id:number,
-        levelNumber?:string,
-        requirements?:string
+        categoryType?: string,
+        configNote?: string,
+        configStatus?: number,
+        configType: number,
+        generalName?: string,
+        id: number,
+        levelNumber?: string,
+        requirements?: string
     }
 }

+ 2 - 2
src/pages/PlatformMana/menuManage/index.js

@@ -125,7 +125,7 @@ const UserMana = () => {
     if (!bool) setCurrentRow(undefined);
   };
 
-  //获取Drawer菜单列表
+  // 获取Drawer菜单列表
   const getMenus = async (params = {}, sort, filter) => {
     const res = await getMenuList(params);
     if(res){
@@ -247,7 +247,7 @@ const UserMana = () => {
           ]}
           fieldProps={{
             optionItemRender(item) {
-              return item.label + ' - ' + item.value;
+              return `${item.label  } - ${  item.value}`;
             },
           }}
           placeholder="请选择类型"

+ 5 - 5
src/pages/PlatformMana/menuManage/service.js

@@ -11,7 +11,7 @@
 
 import { request } from 'umi';
 
-//获角色列表
+// 获角色列表
 export async function getMenuList(params, options) {
     return request('/api/pfm/menu/list', {
       method: 'GET',
@@ -20,7 +20,7 @@ export async function getMenuList(params, options) {
     });
 }
 
-//新增菜单
+// 新增菜单
 export async function addList(body, options) {
     return request('/api/pfm/menu/save', {
       method: 'POST',
@@ -29,7 +29,7 @@ export async function addList(body, options) {
     });
 }
 
-//编辑角色
+// 编辑角色
 export async function editList(body, options) {
   return request('/api/pfm/menu/edit', {
     method: 'POST',
@@ -38,7 +38,7 @@ export async function editList(body, options) {
   });
 }
 
-//删除角色
+// 删除角色
 export async function delList(params, options) {
   const {ids} = params;
   return request(`/api/pfm/menu/delete`, {
@@ -58,7 +58,7 @@ export async function delList(params, options) {
 //   });
 // }
 
-//角色绑定用户
+// 角色绑定用户
 export async function roleBindUser(params, options) {
   const {roleId, userIds} = params;
   return request(`/api/pfm/role/editUserRole`, {

+ 0 - 3
src/pages/PlatformMana/roleManage/component/drawer.jsx

@@ -75,7 +75,6 @@ export default function DrawerContent(props) {
                         span:8,
                     }}
                     onSubmit={(u)=>{
-                        //  console.log({u});
                         setIfSearch(true);
                     }}
                     onReset={()=>{setIfSearch(false);}}
@@ -87,7 +86,6 @@ export default function DrawerContent(props) {
                         checkStrictly:false,
                         selectedRowKeys:selectedKeys,
                         onChange:(selectedRowKeys, selectedRows)=>{
-                            // console.log({selectedRowKeys,selectedRows});
                             setSelectedKeys(selectedRowKeys);
                             
                         },
@@ -104,7 +102,6 @@ export default function DrawerContent(props) {
                                 }
                                 arr.push(record[rowKeys]);
     
-                                // console.log({arr,children});
     
                                 if(!selected){
                                     arr.forEach(val=>{

+ 16 - 11
src/pages/PlatformMana/roleManage/index.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2022-01-05 17:20:33
+ * @LastEditTime: 2022-02-28 16:14:22
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -50,7 +50,7 @@ const UserMana = () => {
         }
         return (
           <Form.Item noStyle>
-            <ProFormDateRangePicker  fieldProps={{locale: locale,onChange:(moment)=>{console.log(moment)} }} name="modifyTime" />
+            <ProFormDateRangePicker  fieldProps={{locale,onChange:(moment)=>{console.log(moment)} }} name="modifyTime" />
           </Form.Item>
         )
       },
@@ -161,9 +161,9 @@ const UserMana = () => {
     if (!bool) setCurrentRow(undefined);
   };
 
-  //获取列表
+  // 获取列表
   const getList = async (params = {}, sort, filter) => {
-    //format: (value) => { return [value[0].format('YYYY-MM-DD'),value[1].format('YYYY-MM-DD')] }
+    // format: (value) => { return [value[0].format('YYYY-MM-DD'),value[1].format('YYYY-MM-DD')] }
     const {pageSize,current,modifyTime,roleName:keyword} = params;
     const query = modifyTime?{pageSize,current,keyword,startDate:moment(modifyTime[0]).format('YYYY-MM-DD'),endDate:moment(modifyTime[1]).format('YYYY-MM-DD')}:{pageSize,current,keyword}
     const res = await getRoleList(query);
@@ -176,8 +176,14 @@ const UserMana = () => {
     }
   };
 
-  //获取Drawer用户列表
+  // 获取Drawer用户列表
   const getUsers = async (params = {}, sort, filter) => {
+    const {roleId} = currentRow;
+    const resp = await roleHasBindUsers({roleId});
+    if(resp){
+      const tempArr = resp.map(item=>item.id);
+      setSelectedUsers(tempArr);
+    }
     const res = await getUserList({...params,roleId:currentRow.roleId});
     if(res){
       return {
@@ -188,7 +194,7 @@ const UserMana = () => {
     }
   };
 
-  //获取Drawer菜单列表
+  // 获取Drawer菜单列表
   const getMenus = async (params = {}, sort, filter) => {
     const res = await getMenuList(params);
     if(res){
@@ -214,7 +220,7 @@ const UserMana = () => {
     }
   };
   
-  //绑定初始化
+  // 绑定初始化
   /**
    * 
    * @param {Object} record 
@@ -344,7 +350,7 @@ const UserMana = () => {
       />
 
       {editRoleBindUsers ? (
-        //编辑用户
+        // 编辑用户
         <DrawerContent
           columns={DrawerTableUsersColumns}
           visible={drawerVisible}
@@ -369,7 +375,7 @@ const UserMana = () => {
           }}
         />
       ) : (
-        //编辑权限
+        // 编辑权限
         <DrawerContent
           columns={DrawerTableMenusColumns}
           visible={drawerVisible}
@@ -381,8 +387,7 @@ const UserMana = () => {
           config={{rowKeys:'menuId',tableSearch:false}}
           tableSearch={false}
           onFinishFunc={async (value, selectedRowKeys) => {
-            console.log({value,selectedRowKeys});
-            // return ;
+
             const { roleId } = currentRow;
             const resp = await roleBindMenu({ roleId, menuIds: selectedRowKeys });
             const { status } = resp;

+ 8 - 8
src/pages/PlatformMana/roleManage/service.js

@@ -10,7 +10,7 @@
 
 import { request } from 'umi';
 
-//获角色列表
+// 获角色列表
 export async function getRoleList(params, options) {
     return request('/api/pfm/role/list', {
       method: 'GET',
@@ -19,7 +19,7 @@ export async function getRoleList(params, options) {
     });
 }
 
-//新增角色
+// 新增角色
 export async function addList(body, options) {
     return request('/api/pfm/role/save', {
       method: 'POST',
@@ -28,7 +28,7 @@ export async function addList(body, options) {
     });
 }
 
-//编辑角色
+// 编辑角色
 export async function editList(body, options) {
   return request('/api/pfm/role/edit', {
     method: 'POST',
@@ -37,7 +37,7 @@ export async function editList(body, options) {
   });
 }
 
-//删除角色
+// 删除角色
 export async function delList(params, options) {
   const {ids} = params;
   return request(`/api/pfm/role/delete`, {
@@ -57,7 +57,7 @@ export async function delList(params, options) {
 //   });
 // }
 
-//角色绑定用户
+// 角色绑定用户
 export async function roleBindUser(params, options) {
   const {roleId, userIds} = params;
   return request(`/api/pfm/role/editUserRole`, {
@@ -67,7 +67,7 @@ export async function roleBindUser(params, options) {
   });
 }
 
-//角色绑定菜单
+// 角色绑定菜单
 export async function roleBindMenu(params, options) {
   const {roleId, menuIds} = params;
   return request(`/api/pfm/role/editRoleMenu`, {
@@ -78,7 +78,7 @@ export async function roleBindMenu(params, options) {
 }
 
 
-//获取角色已绑定的用户
+// 获取角色已绑定的用户
 export async function roleHasBindUsers(params, options) {
   const {roleId} = params;
   return request(`/api/pfm/role/roleUsers`, {
@@ -89,7 +89,7 @@ export async function roleHasBindUsers(params, options) {
 }
 
 
-//获取角色已绑定的菜单
+// 获取角色已绑定的菜单
 export async function roleHasBindMenus(params, options) {
   const {roleId} = params;
   return request(`/api/pfm/role/roleMenus`, {

+ 2 - 2
src/pages/PlatformMana/userMana/index.js

@@ -95,7 +95,7 @@ const UserMana = () => {
     if (!bool) setCurrentRow(undefined);
   };
 
-  //获取用户列表
+  // 获取用户列表
   const getUserlist = async (params = {}, sort, filter) => {
     const res = await getUserList(params);
     if(res){
@@ -119,7 +119,7 @@ const UserMana = () => {
       }
     }
   };
-  //自定义上传回调
+  // 自定义上传回调
   const customRequestCallback = async (formData)=>{
     const resp = await importExcel({formData},{
       'content-type':'multipart/form-data',

+ 5 - 5
src/pages/PlatformMana/userMana/service.js

@@ -10,7 +10,7 @@
 
 import { request } from 'umi';
 
-//获用户列表
+// 获用户列表
 export async function getUserList(params, options) {
     return request('/api/pfm/user/list', {
       method: 'GET',
@@ -19,7 +19,7 @@ export async function getUserList(params, options) {
     });
 }
 
-//新增人员
+// 新增人员
 export async function addUser(body, options) {
     return request('/api/pfm/user/save', {
       method: 'POST',
@@ -28,7 +28,7 @@ export async function addUser(body, options) {
     });
 }
 
-//编辑人员
+// 编辑人员
 export async function editUser(body, options) {
   return request('/api/pfm/user/update', {
     method: 'POST',
@@ -37,7 +37,7 @@ export async function editUser(body, options) {
   });
 }
 
-//删除人员
+// 删除人员
 export async function delUser(params, options) {
   const {id} = params;
   const ids = [id];
@@ -49,7 +49,7 @@ export async function delUser(params, options) {
 }
 
 
-//导入excel
+// 导入excel
 export async function importExcel(body, options) {
   const {formData} = body;
   return request('/api/pfm/excel/importUser', {

+ 2 - 2
src/pages/Settings/index.tsx

@@ -16,10 +16,10 @@ type SettingsType = {
 
 }
 
-const Settings:React.FC<SettingsType> = ()=>{
+const Settings: React.FC<SettingsType> = ()=>{
     return (
         <div className='pageContainer'>
-                <MccsProCard></MccsProCard>
+                <MccsProCard />
         </div>
     )
 }

+ 5 - 5
src/pages/user/Login/index.tsx

@@ -32,7 +32,7 @@ const Login: React.FC = () => {
   const { setInitialState } = useModel('@@initialState');
 
 
-  const setUserInfo = async (data:API.CurrentUserData) => {
+  const setUserInfo = async (data: API.CurrentUserData) => {
    
       localStorage.setItem('userData',JSON.stringify(data));
       const menuData = await getMenus();
@@ -48,13 +48,13 @@ const Login: React.FC = () => {
     setSubmitting(true);
     try {
       // 登录
-      //医院标识
-      let hospSign:any='';
+      // 医院标识
+      let hospSign: any='';
       hospSign = history.location.query?.hospSign;
-      let loginResult = await login({ ...values,hospSign});
+      const loginResult = await login({ ...values,hospSign});
 
       if (loginResult) {
-        localStorage.setItem('hospSign',hospSign); //保存医院标识
+        localStorage.setItem('hospSign',hospSign); // 保存医院标识
         message.success('登录成功!');
         await setUserInfo({...loginResult});
         /** 此方法会跳转到 redirect 参数所在的位置 */

+ 5 - 5
src/pages/user/Login/service.ts

@@ -13,20 +13,20 @@ import { request } from 'umi';
 
 
 
-export const login  = (data:API.LoginParams)=>{
+export const login  = (data: API.LoginParams)=>{
     
     return request('/api/pfm/login', {
         method: 'POST',
-        data:data
+        data
     });
 
 }
-//修改密码
-export const updateUserInfo  = (data:API.EditUserInfoType)=>{
+// 修改密码
+export const updateUserInfo  = (data: API.EditUserInfoType)=>{
     
     return request('/api/pfm/user/modifyPwd', {
         method: 'POST',
-        data:data
+        data
     });
 
 }

+ 1 - 1
src/services/user.ts

@@ -10,7 +10,7 @@
 
 import { request } from 'umi';
 
-//获取当前登录用户菜单数据
+// 获取当前登录用户菜单数据
 export async function getMenus() {
     return request(`/api/pfm/menu/nav`, {
       method: 'GET',

+ 10 - 29
src/utils.js

@@ -1,25 +1,7 @@
-/*
- * @Author: your name
- * @Date: 2021-09-26 17:59:56
- * @LastEditTime: 2022-02-14 14:32:46
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: /MedicalWisdomCheckSys/src/pages/utils.js
- */
-
 
 
-/*
- * @Author: your name
- * @Date: 2021-07-26 13:50:44
- * @LastEditTime: 2021-08-27 14:31:46
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: /TracerMethodology_PC/src/utils.js
- */
 
-
-//获取url参数
+// 获取url参数
 /**
  * 
  * @param {*} name 需要获取的query名
@@ -33,8 +15,8 @@
 
 
 const getQueryString = (name)=>{
-    let reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
-    let r = window.location.search.substr(1).match(reg);
+    const reg = new RegExp(`(^|&)${ name }=([^&]*)(&|$)`);
+    const r = window.location.search.substr(1).match(reg);
  
     if (r != null) {
         return decodeURIComponent(r[2]);
@@ -54,7 +36,6 @@ const getQueryString = (name)=>{
     
 
     if (window.location.pathname !== '/user/login' && !redirect) {
-
       localStorage.removeItem('userData');
     //   history.replace({
     //     pathname: '/user/login',
@@ -81,10 +62,10 @@ const CARequest = (url)=>{
       
 }
 
-//递归获取所有层级某一属性
+// 递归获取所有层级某一属性
 const deepGetVal = (dataToDeep,key,subArr)=>{
     // console.log({dataToDeep,key,subArr});
-    let resultArr = [];
+    const resultArr = [];
     
     function looper(dataToDeep,key,subArr){
         dataToDeep.forEach(item=>{
@@ -101,9 +82,9 @@ const deepGetVal = (dataToDeep,key,subArr)=>{
     return resultArr
 }
 
-//递归获取所有有树子集的节点
+// 递归获取所有有树子集的节点
 const deepGetAllParents = (dataToDeep,subArr)=>{
-    let resultArr = [];
+    const resultArr = [];
 
     function looper(dataToDeep,subArr){
         dataToDeep.forEach(item=>{
@@ -121,14 +102,14 @@ const deepGetAllParents = (dataToDeep,subArr)=>{
     
 }
 
-//数组去重
+// 数组去重
 function unique(arr) {
     if (!Array.isArray(arr)) {
         console.log('type error!')
         return
     }
-    var array = [];
-    for (var i = 0; i < arr.length; i++) {
+    const array = [];
+    for (let i = 0; i < arr.length; i++) {
         if (array .indexOf(arr[i]) === -1) {
             array .push(arr[i])
         }