Переглянути джерело

refactor(指标管理): 优化表单组件性能并修复渲染问题

重构指标管理页面和抽屉表单组件,主要变更包括:
1. 添加静态缓存避免重复请求大数据量接口
2. 为所有选择器添加搜索功能
3. 修复条件渲染导致的空数组问题
4. 清理无用注释代码
5. 优化Modal和Drawer的渲染逻辑
JammeyJiang 1 місяць тому
батько
коміт
19458f5a68

+ 266 - 66
src/pages/platform/setting/indicatorMana/DrawerForm/drawer.tsx

@@ -9,16 +9,32 @@
 
 import React, { useEffect, useRef, useState } from 'react';
 import { Drawer, Cascader, Button, Form, Transfer } from 'antd';
-import ProForm, { ModalForm, ProFormCascader, ProFormDependency, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
+import ProForm, {
+  ModalForm,
+  ProFormCascader,
+  ProFormDependency,
+  ProFormDigit,
+  ProFormInstance,
+  ProFormRadio,
+  ProFormSelect,
+  ProFormText,
+  ProFormTextArea,
+} from '@ant-design/pro-form';
 
 import './style.less';
 import { getIndicatorDictionary, IndicatorDictionaryDataType } from '@/service/dictionary';
 import { DefaultOptionType } from 'antd/lib/select';
 import { getHospDepartment } from '@/service/department';
 import { getUsers } from '@/service/user';
+import { getCurrentHospAllEmps } from '@/service/hospList';
 import { addIndicatorManaList, getTransferDataReq } from '@/service/indicator';
 import { createFromIconfontCN } from '@ant-design/icons';
-import { DATAFILL_DIMENSIONTYPE, DATAFILL_MAINTYPE, DATAFILL_PERIODTYPE, transformToLabelValue } from '../../dataFilling/fillingMana';
+import {
+  DATAFILL_DIMENSIONTYPE,
+  DATAFILL_MAINTYPE,
+  DATAFILL_PERIODTYPE,
+  transformToLabelValue,
+} from '../../dataFilling/fillingMana';
 import { addData, getCurrentHospAlldeps } from '../../dataFilling/fillingMana/service';
 import { useHistory } from 'umi';
 
@@ -35,6 +51,11 @@ const IconFont = createFromIconfontCN({
   scriptUrl: '',
 });
 
+// 定义静态缓存,避免每次打开弹框都重新请求大数据量接口
+let userCache: DefaultOptionType[] | null = null;
+let deptCache: DefaultOptionType[] | null = null;
+let allDeptCache: DefaultOptionType[] | null = null;
+
 const DrawerForm = (props: IndicatorDrawerForm) => {
   const { visible = false, onChange, onFinish, record, onVisibleChange, actType } = props;
   const [renderType, set_renderType] = useState<'ADD' | 'EDIT' | 'DATAMANA'>('ADD');
@@ -48,7 +69,10 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
   const [transferDataSource, set_transferDataSource] = useState<any[]>([]);
   const [selectedKeys, set_selectedKeys] = useState<string[]>([]);
   const history: any = useHistory();
-  const { indicatorType: indicatorUrlType, id: indicatorId }: { id: string; indicatorType: string } = history.location.query;
+  const {
+    indicatorType: indicatorUrlType,
+    id: indicatorId,
+  }: { id: string; indicatorType: string } = history.location.query;
 
   const commitHandle = () => {
     if (actType == 'DATAMANA') {
@@ -61,7 +85,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
     if (actType != 'DATAMANA') {
       let commitData: any[] = [];
       if (baseInfoformRef.current && baseInfoformRef.current.validateFieldsReturnFormatValue) {
-        baseInfoformRef.current?.validateFieldsReturnFormatValue().then((val) => {
+        baseInfoformRef.current?.validateFieldsReturnFormatValue().then(val => {
           commitData.push({
             baseInfoformRef: val,
           });
@@ -69,27 +93,40 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
       }
 
       if (manaInfoformRef.current && manaInfoformRef.current.validateFieldsReturnFormatValue) {
-        manaInfoformRef.current?.validateFieldsReturnFormatValue().then((val) => {
+        manaInfoformRef.current?.validateFieldsReturnFormatValue().then(val => {
           console.log('manaInfoformRef', val);
           //_indicatorTypeList
           // manaInfoformRef.current?.getFieldsValue();
           // console.log('w',manaInfoformRef.current?.getFieldValue('_indicatorTypeList'))
           const _indicatorTypeLists = manaInfoformRef.current?.getFieldValue('_indicatorTypeList');
-          const _indicatorExternalList = manaInfoformRef.current?.getFieldValue('_indicatorExternalList');
+          const _indicatorExternalList = manaInfoformRef.current?.getFieldValue(
+            '_indicatorExternalList'
+          );
 
           // console.log({_indicatorTypeLists,_indicatorExternalList});
 
           commitData.push({
             manaInfoformRef: {
               ...val,
-              indicatorTypeList: _indicatorTypeLists ? _indicatorTypeLists : val.indicatorTypeList ? val.indicatorTypeList.map((t: any) => t[t.length - 1]) : [],
-              indicatorExternalList: _indicatorExternalList ? _indicatorExternalList : val.indicatorExternalList ? val.indicatorExternalList.map((t: any) => t[t.length - 1]) : [],
+              indicatorTypeList: _indicatorTypeLists
+                ? _indicatorTypeLists
+                : val.indicatorTypeList
+                ? val.indicatorTypeList.map((t: any) => t[t.length - 1])
+                : [],
+              indicatorExternalList: _indicatorExternalList
+                ? _indicatorExternalList
+                : val.indicatorExternalList
+                ? val.indicatorExternalList.map((t: any) => t[t.length - 1])
+                : [],
             },
           });
         });
       }
-      if (showSetInfoformRef.current && showSetInfoformRef.current.validateFieldsReturnFormatValue) {
-        showSetInfoformRef.current?.validateFieldsReturnFormatValue().then((val) => {
+      if (
+        showSetInfoformRef.current &&
+        showSetInfoformRef.current.validateFieldsReturnFormatValue
+      ) {
+        showSetInfoformRef.current?.validateFieldsReturnFormatValue().then(val => {
           // console.log('showSetInfoformRef',val);
           commitData.push({
             showSetInfoformRef: val,
@@ -97,13 +134,17 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
         });
       }
       if (adminInfoformRef.current && adminInfoformRef.current.validateFieldsReturnFormatValue) {
-        adminInfoformRef.current?.validateFieldsReturnFormatValue().then((val) => {
+        adminInfoformRef.current?.validateFieldsReturnFormatValue().then(val => {
           const _indicatorMenuList = adminInfoformRef.current?.getFieldValue('_indicatorMenuList');
           if (val.indicatorMenuList) {
             commitData.push({
               adminInfoformRef: {
                 ...val,
-                indicatorMenuList: _indicatorMenuList ? _indicatorMenuList : val.indicatorMenuList ? val.indicatorMenuList.map((t: any) => t[t.length - 1]) : [],
+                indicatorMenuList: _indicatorMenuList
+                  ? _indicatorMenuList
+                  : val.indicatorMenuList
+                  ? val.indicatorMenuList.map((t: any) => t[t.length - 1])
+                  : [],
               },
             });
           }
@@ -111,8 +152,10 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
       }
 
       setTimeout(() => {
-        const hasBaseInfoformRef = commitData.some((item) => item.hasOwnProperty('baseInfoformRef'));
-        const hasAdminInfoformRef = commitData.some((item) => item.hasOwnProperty('adminInfoformRef'));
+        const hasBaseInfoformRef = commitData.some(item => item.hasOwnProperty('baseInfoformRef'));
+        const hasAdminInfoformRef = commitData.some(item =>
+          item.hasOwnProperty('adminInfoformRef')
+        );
         if (hasBaseInfoformRef && hasAdminInfoformRef) {
           onFinish && onFinish(commitData);
         }
@@ -126,14 +169,14 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
   };
 
   const getSelectorData = (code: string, type?: 'Cascader') => {
-    const result = dirData.filter((t) => t.code == code);
+    const result = dirData.filter(t => t.code == code);
 
     if (type == 'Cascader' && result.length > 0) {
       return result[0].children;
     }
 
     if (result.length > 0) {
-      return result[0].children.map((t) => ({ label: t.name, value: t.code }));
+      return result[0].children.map(t => ({ label: t.name, value: t.code }));
     }
     return [];
   };
@@ -150,9 +193,23 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
         description: data.description,
         fillDeptList:
           data.fillDeptList instanceof Array
-            ? data.fillDeptList.map((a: any) => ({ departmentCode: a.value, departmentName: a.label }))
-            : [{ departmentCode: data.fillDeptList.value, departmentName: data.fillDeptList.label }],
-        relateDeptList: data.type != 2 && data.dimensionType != 1 && data.relateDeptList ? data.relateDeptList.map((a: any) => ({ departmentCode: a.value, departmentName: a.label })) : [],
+            ? data.fillDeptList.map((a: any) => ({
+                departmentCode: a.value,
+                departmentName: a.label,
+              }))
+            : [
+                {
+                  departmentCode: data.fillDeptList.value,
+                  departmentName: data.fillDeptList.label,
+                },
+              ],
+        relateDeptList:
+          data.type != 2 && data.dimensionType != 1 && data.relateDeptList
+            ? data.relateDeptList.map((a: any) => ({
+                departmentCode: a.value,
+                departmentName: a.label,
+              }))
+            : [],
       };
 
       if (type == 'ADD') {
@@ -196,13 +253,21 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
           type == 'EDIT'
             ? {
                 ...record,
-                fillDeptList: record?.fillDeptList?.map((a: any) => ({ label: a.departmentName, value: Number(a.departmentCode) })) || [],
-                relateDeptList: record?.relateDeptList?.map((a: any) => ({ label: a.departmentName, value: Number(a.departmentCode) })) || [],
+                fillDeptList:
+                  record?.fillDeptList?.map((a: any) => ({
+                    label: a.departmentName,
+                    value: Number(a.departmentCode),
+                  })) || [],
+                relateDeptList:
+                  record?.relateDeptList?.map((a: any) => ({
+                    label: a.departmentName,
+                    value: Number(a.departmentCode),
+                  })) || [],
               }
             : { periodType: 1, type: 1, dimensionType: 1 }
         }
         trigger={type == 'EDIT' ? <a key="edit">编辑</a> : <span className="add">新增</span>}
-        onFinish={(val) => {
+        onFinish={val => {
           return updateTable(type == 'EDIT' ? { ...val } : { ...val }, type);
         }}
         modalProps={{ destroyOnClose: true }}
@@ -218,8 +283,19 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
               // disabled={type == 'EDIT'}
               rules={[{ required: true, message: '填报项目不能为空!' }]}
             />
-            <ProFormText name="code" label="填报编码:" hidden={type == 'ADD'} disabled={type == 'EDIT'} />
-            <ProFormRadio.Group label="填报周期:" name="periodType" disabled={type == 'EDIT' && record.limitFlag} options={DATAFILL_PERIODTYPE} rules={[{ required: true }]} />
+            <ProFormText
+              name="code"
+              label="填报编码:"
+              hidden={type == 'ADD'}
+              disabled={type == 'EDIT'}
+            />
+            <ProFormRadio.Group
+              label="填报周期:"
+              name="periodType"
+              disabled={type == 'EDIT' && record.limitFlag}
+              options={DATAFILL_PERIODTYPE}
+              rules={[{ required: true }]}
+            />
             <ProFormRadio.Group
               label="填报主体类型:"
               name="type"
@@ -247,14 +323,23 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               maxTagCount: 'responsive',
                               labelInValue: true,
                               size: 'small',
+                              showSearch: true,
+                              optionFilterProp: 'label',
+                            }
+                          : {
+                              labelInValue: true,
+                              size: 'small',
+                              showSearch: true,
+                              optionFilterProp: 'label',
                             }
-                          : { labelInValue: true, size: 'small' }
                       }
                       rules={[{ required: true, message: '填报主体不能为空!' }]}
                       request={async () => {
+                        if (allDeptCache) return allDeptCache;
                         const depLists = await getCurrentHospAlldeps();
                         if (depLists) {
-                          return transformToLabelValue(depLists);
+                          allDeptCache = transformToLabelValue(depLists);
+                          return allDeptCache;
                         }
                         return [];
                       }}
@@ -262,7 +347,13 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
 
                     {type != 2 && (
                       <>
-                        <ProFormRadio.Group label="填报维度:" name="dimensionType" disabled={type == 'EDIT' && record.limitFlag} options={DATAFILL_DIMENSIONTYPE} rules={[{ required: true }]} />
+                        <ProFormRadio.Group
+                          label="填报维度:"
+                          name="dimensionType"
+                          disabled={type == 'EDIT' && record.limitFlag}
+                          options={DATAFILL_DIMENSIONTYPE}
+                          rules={[{ required: true }]}
+                        />
                         <ProFormDependency name={['dimensionType']}>
                           {({ dimensionType }) => {
                             return (
@@ -276,12 +367,16 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                                     maxTagCount: 'responsive',
                                     labelInValue: true,
                                     size: 'small',
+                                    showSearch: true,
+                                    optionFilterProp: 'label',
                                   }}
                                   rules={[{ required: true, message: '相关科室不能为空!' }]}
                                   request={async () => {
+                                    if (allDeptCache) return allDeptCache;
                                     const depLists = await getCurrentHospAlldeps();
                                     if (depLists) {
-                                      return transformToLabelValue(depLists);
+                                      allDeptCache = transformToLabelValue(depLists);
+                                      return allDeptCache;
                                     }
                                     return [];
                                   }}
@@ -297,7 +392,12 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
               }}
             </ProFormDependency>
 
-            <ProFormText name="unit" label="填报值单位:" placeholder="请输入" rules={[{ required: true, message: '填报值单位不能为空!' }]} />
+            <ProFormText
+              name="unit"
+              label="填报值单位:"
+              placeholder="请输入"
+              rules={[{ required: true, message: '填报值单位不能为空!' }]}
+            />
             <ProFormTextArea
               name="description"
               label="填报说明:"
@@ -316,7 +416,9 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
   const setFormInit = (key: string) => {
     if (key == 'indicatorTypeList') {
       if (record && record.indicatorTypeList) {
-        const indicatorTypeListVal = record.indicatorTypeList ? record.indicatorTypeList.map((t: string) => t.split('/')) : [];
+        const indicatorTypeListVal = record.indicatorTypeList
+          ? record.indicatorTypeList.map((t: string) => t.split('/'))
+          : [];
         const _indicatorTypeList = indicatorTypeListVal.map((t: any) => t.slice(1, t.length));
         // console.log({indicatorTypeListVal,_indicatorTypeList})
         return _indicatorTypeList;
@@ -324,7 +426,9 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
     }
     if (key == 'indicatorMenuList') {
       if (record && record.indicatorMenuList) {
-        const a = record.indicatorMenuList ? record.indicatorMenuList.map((t: string) => t.split('/')) : [];
+        const a = record.indicatorMenuList
+          ? record.indicatorMenuList.map((t: string) => t.split('/'))
+          : [];
         const b = a.map((t: any) => t.slice(1, t.length));
         // console.log({a,b})
         return b;
@@ -333,7 +437,9 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
 
     if (key == 'indicatorExternalList') {
       if (record && record.indicatorExternalList) {
-        const a = record.indicatorExternalList ? record.indicatorExternalList.map((t: string) => t.split('/')) : [];
+        const a = record.indicatorExternalList
+          ? record.indicatorExternalList.map((t: string) => t.split('/'))
+          : [];
         const b = a.map((t: any) => t.slice(1, t.length));
         // console.log({a,b})
         return b;
@@ -416,12 +522,12 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
               className="DATAMANA_Transfer"
               dataSource={transferDataSource}
               selectedKeys={selectedKeys}
-              rowKey={(item) => item.code}
+              rowKey={item => item.code}
               onSelectChange={(sourceSelectedKeys, targetSelectedKeys) => {
                 set_selectedKeys(sourceSelectedKeys);
               }}
               showSearch
-              render={(item) => `[${item.code}]${item.name}`}
+              render={item => `[${item.code}]${item.name}`}
               listStyle={{
                 width: '100%', // 左侧列表宽度为100%
                 height: `calc(100vh - 70px)`,
@@ -447,9 +553,27 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     render: () => null,
                   }}
                 >
-                  <ProFormText colProps={{ md: 12, xl: 8 }} name="name" label="指标名称" placeholder="请输入" fieldProps={{}} rules={[{ required: true, message: '这是必填项' }]} />
-                  <ProFormText colProps={{ md: 12, xl: 8 }} name="code" label="指标编码" placeholder="请输入" rules={[{ required: true, message: '这是必填项' }]} />
-                  <ProFormText colProps={{ md: 12, xl: 8 }} name="nationalCode" label="国家编码" placeholder="请输入" />
+                  <ProFormText
+                    colProps={{ md: 12, xl: 8 }}
+                    name="name"
+                    label="指标名称"
+                    placeholder="请输入"
+                    fieldProps={{}}
+                    rules={[{ required: true, message: '这是必填项' }]}
+                  />
+                  <ProFormText
+                    colProps={{ md: 12, xl: 8 }}
+                    name="code"
+                    label="指标编码"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '这是必填项' }]}
+                  />
+                  <ProFormText
+                    colProps={{ md: 12, xl: 8 }}
+                    name="nationalCode"
+                    label="国家编码"
+                    placeholder="请输入"
+                  />
                   <ProFormTextArea
                     colProps={{ md: 12, xl: 16 }}
                     name="targetDefinition"
@@ -465,7 +589,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="dimension"
                     label="指标维度"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true }}
                     options={[
                       {
                         label: '结构面',
@@ -506,7 +630,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               colProps={{ md: 12, xl: 8 }}
                               name="directionType"
                               label="管理指向"
-                              fieldProps={{ size: 'small' }}
+                              fieldProps={{ size: 'small', showSearch: true }}
                               options={[
                                 {
                                   label: '正向',
@@ -532,13 +656,33 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               placeholder="请选择"
                             />
                             <ProForm.Group colProps={{ md: 12, xl: 8 }}>
-                              <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
+                              <div
+                                style={{
+                                  display: 'flex',
+                                  flexDirection: 'row',
+                                  justifyContent: 'center',
+                                  alignItems: 'center',
+                                }}
+                              >
                                 <div>
-                                  <ProFormDigit label="指标区间" name="lowerLimit" min={0} max={10000} placeholder="最小值" fieldProps={{ precision: 3 }} />
+                                  <ProFormDigit
+                                    label="指标区间"
+                                    name="lowerLimit"
+                                    min={0}
+                                    max={10000}
+                                    placeholder="最小值"
+                                    fieldProps={{ precision: 3 }}
+                                  />
                                 </div>
                                 -
                                 <div style={{ position: 'relative', top: 10 }}>
-                                  <ProFormDigit name="upperLimit" min={0} max={10000} placeholder="最大值" fieldProps={{ precision: 3 }} />
+                                  <ProFormDigit
+                                    name="upperLimit"
+                                    min={0}
+                                    max={10000}
+                                    placeholder="最大值"
+                                    fieldProps={{ precision: 3 }}
+                                  />
                                 </div>
                               </div>
                             </ProForm.Group>
@@ -547,13 +691,16 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               colProps={{ md: 12, xl: 8 }}
                               name="unit"
                               label="单位"
-                              fieldProps={{ size: 'small' }}
+                              fieldProps={{ size: 'small', showSearch: true }}
                               request={async () => {
                                 const dirData = await getIndicatorDictionary();
-                                const result = dirData.filter((t) => t.code == 'Department');
+                                const result = dirData.filter(t => t.code == 'Department');
 
                                 if (result.length > 0) {
-                                  return result[0].children.map((t) => ({ label: t.name, value: t.code }));
+                                  return result[0].children.map(t => ({
+                                    label: t.name,
+                                    value: t.code,
+                                  }));
                                 }
                                 return [];
                               }}
@@ -564,20 +711,40 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               {({ unit }) => {
                                 return unit == '173' || unit == '326' ? (
                                   <ProForm.Group colProps={{ md: 12, xl: 24 }}>
-                                    <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
+                                    <div
+                                      style={{
+                                        display: 'flex',
+                                        flexDirection: 'row',
+                                        justifyContent: 'center',
+                                        alignItems: 'center',
+                                      }}
+                                    >
                                       <div>
-                                        <ProFormText name="molecule" label="公式" width={437} placeholder="请输入分子" />
+                                        <ProFormText
+                                          name="molecule"
+                                          label="公式"
+                                          width={437}
+                                          placeholder="请输入分子"
+                                        />
                                       </div>
                                       /
                                       <div style={{ position: 'relative', top: 10 }}>
-                                        <ProFormText width={437} name="denominator" placeholder="请输入分母" />
+                                        <ProFormText
+                                          width={437}
+                                          name="denominator"
+                                          placeholder="请输入分母"
+                                        />
                                       </div>
                                       {unit == '173' ? `*100%` : `‰`}
                                     </div>
                                   </ProForm.Group>
                                 ) : (
                                   <ProForm.Group colProps={{ md: 12, xl: 24 }}>
-                                    <ProFormText name="molecule" label="公式" placeholder="请输入公式" />
+                                    <ProFormText
+                                      name="molecule"
+                                      label="公式"
+                                      placeholder="请输入公式"
+                                    />
                                   </ProForm.Group>
                                 );
                               }}
@@ -587,7 +754,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               colProps={{ md: 12, xl: 8 }}
                               name="moleculeSourcType"
                               label="分子数据来源"
-                              fieldProps={{ size: 'small' }}
+                              fieldProps={{ size: 'small', showSearch: true }}
                               options={[
                                 {
                                   label: '定期填报',
@@ -624,7 +791,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                               colProps={{ md: 12, xl: 8 }}
                               name="denominatorSourceType"
                               label="分母数据来源"
-                              fieldProps={{ size: 'small' }}
+                              fieldProps={{ size: 'small', showSearch: true }}
                               options={[
                                 {
                                   label: '定期填报',
@@ -697,10 +864,12 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="divisionId"
                     label="负责科室"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true, optionFilterProp: 'label' }}
                     request={async () => {
+                      if (deptCache) return deptCache;
                       const data = await getHospDepartment();
-                      return data.map((t) => ({ label: t.name, value: t.code }));
+                      deptCache = data.map(t => ({ label: t.name, value: t.code }));
+                      return deptCache;
                     }}
                     placeholder="请选择"
                   />
@@ -708,10 +877,23 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="principalId"
                     label="负责人"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{
+                      size: 'small',
+                      showSearch: true,
+                      optionFilterProp: 'label',
+                    }}
                     request={async () => {
-                      const data = await getUsers({ pageSize: 1000, current: 1 });
-                      return data.list.map((t) => ({ label: t.name, value: t.userId }));
+                      if (userCache) return userCache;
+                      const resp = await getCurrentHospAllEmps();
+                      if (resp) {
+                        // 统一转换为 label/value 结构并缓存
+                        userCache = resp.map((a: any) => ({
+                          label: a.name,
+                          value: a.userId || a.id, // 兼容不同接口的 ID 字段名
+                        }));
+                        return userCache;
+                      }
+                      return [];
                     }}
                     placeholder="请选择"
                   />
@@ -734,6 +916,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       // mode: 'multiple',
                       size: 'small',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       {
@@ -759,7 +942,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="analysisType"
                     label="分析方式"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true }}
                     options={[
                       {
                         label: '数值',
@@ -800,6 +983,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       maxTagCount: 'responsive',
                       multiple: true,
+                      showSearch: true,
                       showCheckedStrategy: 'SHOW_CHILD',
                       fieldNames: { label: 'name', value: 'code', children: 'children' },
                       options: getSelectorData('IndicatorType', 'Cascader'),
@@ -842,7 +1026,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                           }
                         }
 
-                        const codes = nodes.map((t) => t.code);
+                        const codes = nodes.map(t => t.code);
                         manaInfoformRef.current?.setFieldsValue({ _indicatorTypeList: codes });
                       },
                     }}
@@ -857,12 +1041,18 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       mode: 'multiple',
                       size: 'small',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={getSelectorData('IndicatorDepartment') as DefaultOptionType[]}
                     placeholder="请选择"
                   />
 
-                  <ProFormDigit colProps={{ md: 12, xl: 8 }} name="reference" label="同级参考值" placeholder="请输入" />
+                  <ProFormDigit
+                    colProps={{ md: 12, xl: 8 }}
+                    name="reference"
+                    label="同级参考值"
+                    placeholder="请输入"
+                  />
                   {/* <ProFormText colProps={{ md: 12, xl: 8 }} name="referenceDesc" label="参考值来源说明" placeholder="请输入" /> */}
                   <ProFormTextArea
                     colProps={{ md: 12, xl: 8 }}
@@ -884,6 +1074,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={getSelectorData('IndicatorCommittee') as DefaultOptionType[]}
                     placeholder="请选择"
@@ -897,6 +1088,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       multiple: true,
                       maxTagCount: 'responsive',
+                      showSearch: true,
                       fieldNames: { label: 'name', value: 'code', children: 'children' },
                       options: getSelectorData('IndicatorExternal', 'Cascader'),
                       onChange(value, selectOptions) {
@@ -938,7 +1130,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                           }
                         }
 
-                        const codes = nodes.map((t) => t.code);
+                        const codes = nodes.map(t => t.code);
                         manaInfoformRef.current?.setFieldsValue({ _indicatorExternalList: codes });
                       },
                     }}
@@ -976,7 +1168,9 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       : renderType == 'EDIT' && record
                       ? {
                           ...record,
-                          caseBreakdown: record.caseBreakdown ? record.caseBreakdown.split('/') : [],
+                          caseBreakdown: record.caseBreakdown
+                            ? record.caseBreakdown.split('/')
+                            : [],
                           chartType: record.chartType ? record.chartType.split('/') : [],
                           dataDownload: record.dataDownload ? record.dataDownload.split('/') : [],
                           dataSum: record.dataSum ? record.dataSum.split('/') : [],
@@ -992,7 +1186,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="appearDate"
                     label="呈现期间"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true }}
                     options={[
                       {
                         label: '年',
@@ -1017,6 +1211,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       {
@@ -1046,6 +1241,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       { label: '全院', value: '全院' },
@@ -1062,6 +1258,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       {
@@ -1095,6 +1292,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       {
@@ -1128,6 +1326,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       size: 'small',
                       mode: 'multiple',
                       maxTagCount: 'responsive',
+                      showSearch: true,
                     }}
                     options={[
                       {
@@ -1226,6 +1425,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     fieldProps={{
                       size: 'small',
                       multiple: true,
+                      showSearch: true,
                       fieldNames: { label: 'name', value: 'code' },
                       onChange(value: any, selectOptions: any) {
                         var nodes: any[] = [];
@@ -1264,7 +1464,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                           }
                         }
 
-                        const codes = nodes.map((t) => t.code);
+                        const codes = nodes.map(t => t.code);
                         adminInfoformRef.current?.setFieldsValue({ _indicatorMenuList: codes });
                       },
                     }}
@@ -1272,7 +1472,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                       if (indicatorId) {
                         const dirData = await getIndicatorDictionary();
                         if (dirData) {
-                          const result = dirData.filter((t) => t.code == indicatorId);
+                          const result = dirData.filter(t => t.code == indicatorId);
 
                           if (result.length > 0) {
                             return result[0].children;
@@ -1289,7 +1489,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="isPublic"
                     label="是否公开"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true }}
                     options={[
                       {
                         label: '是',
@@ -1306,7 +1506,7 @@ const DrawerForm = (props: IndicatorDrawerForm) => {
                     colProps={{ md: 12, xl: 8 }}
                     name="version"
                     label="版本"
-                    fieldProps={{ size: 'small' }}
+                    fieldProps={{ size: 'small', showSearch: true }}
                     options={[
                       {
                         label: '版本1',

+ 156 - 108
src/pages/platform/setting/indicatorMana/index.tsx

@@ -62,7 +62,9 @@ const IndicatorMana = () => {
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [currentSelectedLeft, set_currentSelectedLeft] = useState<any>(undefined);
   const [actionType, set_actionType] = useState<'NORMAL' | 'DETAIL' | undefined>('NORMAL');
-  const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT' | 'DATAMANA' | undefined>(undefined);
+  const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT' | 'DATAMANA' | undefined>(
+    undefined
+  );
   const [tableDataSource, set_tableDataSource] = useState<any[]>([]);
   const [currentYear, set_currentYear] = useState(defaultYear);
   const [currentEditRow, set_currentEditRow] = useState<any>(undefined);
@@ -72,7 +74,9 @@ const IndicatorMana = () => {
   const indicatorTableRef = useRef<ActionType>();
   const history: any = useHistory();
   const [currentTab, set_currentTab] = useState('1');
-  const { indicatorType: indicatorUrlType }: { id: string; indicatorType: string } = history.location.query;
+  const {
+    indicatorType: indicatorUrlType,
+  }: { id: string; indicatorType: string } = history.location.query;
 
   const [reportModalVisible, setReportModalVisible] = useState(false);
   const reportForm = useRef<ProFormInstance>();
@@ -108,9 +112,9 @@ const IndicatorMana = () => {
       request: async () => {
         const resp = await getIndicatorDictionary();
         if (resp) {
-          const data = resp.filter((t) => t.code == 'IndicatorType');
+          const data = resp.filter(t => t.code == 'IndicatorType');
           if (data.length > 0) {
-            return data[0].children.map((t) => ({ label: t.name, value: t.code }));
+            return data[0].children.map(t => ({ label: t.name, value: t.code }));
           }
         }
         return [];
@@ -118,7 +122,9 @@ const IndicatorMana = () => {
       render: (text, record) => {
         if (record) {
           const { indicatorBoolean, indicatorTypeList } = record;
-          return indicatorBoolean && indicatorTypeList ? indicatorTypeList.map((t: any) => t.name).join('/') : '';
+          return indicatorBoolean && indicatorTypeList
+            ? indicatorTypeList.map((t: any) => t.name).join('/')
+            : '';
         } else {
           return '';
         }
@@ -139,7 +145,7 @@ const IndicatorMana = () => {
       request: async () => {
         const resp = await getIndicatorDictionary();
         if (resp) {
-          const data = resp.filter((t) => t.code == 'IndicatorExternal');
+          const data = resp.filter(t => t.code == 'IndicatorExternal');
           if (data.length > 0) {
             return data[0].children;
           }
@@ -149,7 +155,11 @@ const IndicatorMana = () => {
       render: (text, record) => {
         if (record) {
           const { indicatorBoolean, indicatorExternalList } = record;
-          return indicatorBoolean ? (indicatorExternalList ? indicatorExternalList.map((t: any) => t.name).join('/') : '-') : '';
+          return indicatorBoolean
+            ? indicatorExternalList
+              ? indicatorExternalList.map((t: any) => t.name).join('/')
+              : '-'
+            : '';
         } else {
           return '';
         }
@@ -180,7 +190,6 @@ const IndicatorMana = () => {
             key: '1',
             label: (
               <a
-                key="link"
                 onClick={() => {
                   set_currentEditRow(record);
                   set_actionType('DETAIL');
@@ -193,7 +202,7 @@ const IndicatorMana = () => {
           {
             key: '2',
             label: (
-              <a key="linka" href={record.indicatorPath} target="_blank">
+              <a href={record.indicatorPath} target="_blank">
                 统计分析
               </a>
             ),
@@ -201,7 +210,12 @@ const IndicatorMana = () => {
           {
             key: '3',
             label: (
-              <Popconfirm title="是否确定删除?" onConfirm={() => delHandle(record)} okText="确定" cancelText="取消" key="link2">
+              <Popconfirm
+                title="是否确定删除?"
+                onConfirm={() => delHandle(record)}
+                okText="确定"
+                cancelText="取消"
+              >
                 <a>删除</a>
               </Popconfirm>
             ),
@@ -209,19 +223,19 @@ const IndicatorMana = () => {
         ];
 
         if (record && record.indicatorBoolean) {
-          return [
-            <a key="link3" onClick={() => actionHandle('EDIT', record)}>
-              管理
-            </a>,
-            <Dropdown menu={{ items }}>
-              <a>
-                <DownOutlined />
-              </a>
-            </Dropdown>,
-          ];
+          return (
+            <React.Fragment key="action-cell">
+              <a onClick={() => actionHandle('EDIT', record)}>管理</a>
+              <Dropdown menu={{ items }}>
+                <a>
+                  <DownOutlined />
+                </a>
+              </Dropdown>
+            </React.Fragment>
+          );
         }
 
-        return [];
+        return null;
       },
     },
   ];
@@ -245,22 +259,25 @@ const IndicatorMana = () => {
         menuType: indicatorUrlType,
         indicatorName: name,
         indicatorType: indicatorType,
-        outsideIndexes: outsideIndexes && outsideIndexes.length > 0 ? outsideIndexes[outsideIndexes.length - 1] : '',
+        outsideIndexes:
+          outsideIndexes && outsideIndexes.length > 0
+            ? outsideIndexes[outsideIndexes.length - 1]
+            : '',
         current,
-        pageSize
+        pageSize,
       });
 
       if (resp && resp[0]) {
         return {
-          data: resp[0].children as unknown as [],
+          data: (resp[0].children as unknown) as [],
           success: true,
-          total: resp[0].total || resp[0].children?.length || 0
+          total: resp[0].total || resp[0].children?.length || 0,
         };
       } else {
         return {
           data: [],
           success: true,
-          total: 0
+          total: 0,
         };
       }
     }
@@ -268,7 +285,7 @@ const IndicatorMana = () => {
     return {
       data: [],
       success: false,
-      total: 0
+      total: 0,
     };
   };
 
@@ -351,7 +368,9 @@ const IndicatorMana = () => {
 
           indicatorMenuList: formData.indicatorMenuList ? formData.indicatorMenuList : [],
           indicatorTypeList: formData.indicatorTypeList ? formData.indicatorTypeList : [],
-          indicatorExternalList: formData.indicatorExternalList ? formData.indicatorExternalList : [],
+          indicatorExternalList: formData.indicatorExternalList
+            ? formData.indicatorExternalList
+            : [],
           divisionId: `${formData.divisionId}`,
         });
 
@@ -388,20 +407,22 @@ const IndicatorMana = () => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords
+      [`${paramName}`]: tableDataSearchKeywords,
     });
-  }
+  };
 
   const handleTableChange = (pagination: any) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: pagination.current,
-      pageSize: pagination.pageSize
+      pageSize: pagination.pageSize,
     });
-  }
+  };
 
   const detailTableDataSearchHandle = (paramName: string) => {
-    const result = total_tableDataSource.filter((a: any) => a[`${paramName}`].indexOf(tableDataSearchKeywords) != -1);
+    const result = total_tableDataSource.filter(
+      (a: any) => a[`${paramName}`].indexOf(tableDataSearchKeywords) != -1
+    );
     set_tableDataSource(result);
   };
 
@@ -413,7 +434,11 @@ const IndicatorMana = () => {
     if (currentEditRow) {
       set_tableColumns([]);
       set_tableDataSource([]);
-      const resp = await getIndicatorDetailReq({ indicatorCode: currentEditRow.code, dataYear: `${currentYear}`, periodType: currentTab });
+      const resp = await getIndicatorDetailReq({
+        indicatorCode: currentEditRow.code,
+        dataYear: `${currentYear}`,
+        periodType: currentTab,
+      });
       if (resp) {
         const { itemTitles, itemDatas } = resp;
         const { columns, dataSource } = generateTableData(itemTitles, itemDatas);
@@ -478,28 +503,6 @@ const IndicatorMana = () => {
     getIndicatorCateTree();
   }, []);
 
-  // // 当弹窗可见性变化时,处理表单回显
-  // useEffect(() => {
-  //   console.log('Modal visibility changed:', reportModalVisible); // 日志 1: 检查可见性变化
-  //   if (reportModalVisible && currentEditRow) {
-  //     console.log('Attempting to set form values. currentEditRow:', currentEditRow); // 日志 2: 检查 currentEditRow 内容
-  //     const valuesToSet = {
-  //       reportId: currentEditRow.onlineReportCode,
-  //       remark: currentEditRow.onlineRemark
-  //     };
-  //     console.log('Values to set:', valuesToSet); // 日志 3: 检查要设置的值
-  //     try {
-  //       reportForm?.current?.setFieldsValue(valuesToSet);
-  //       console.log('setFieldsValue called successfully.'); // 日志 4: 确认调用成功
-  //     } catch (e) {
-  //       console.error('Error calling setFieldsValue:', e); // 日志 5: 检查调用是否出错
-  //     }
-  //   } else if (reportModalVisible) {
-  //       console.log('Modal is visible, but currentEditRow is missing or empty:', currentEditRow); // 日志 6: 检查 currentEditRow 是否为空
-  //   }
-  //   // ModalForm 的 destroyOnClose 会处理关闭时的重置
-  // }, [reportModalVisible, currentEditRow, reportForm]); // 依赖项
-
   // 打开报告管理弹窗
   const openReportModal = () => {
     setReportModalVisible(true);
@@ -511,14 +514,14 @@ const IndicatorMana = () => {
       const resp = await applyOnlineReportMap({
         code: currentEditRow.code,
         onlineReportCode: values.reportId,
-        onlineRemark: values.remark
+        onlineRemark: values.remark,
       });
       if (resp) {
         message.success('提交成功');
         set_currentEditRow((prevRow: any) => ({
           ...prevRow,
-          onlineRemark:values.remark,
-          onlineReportCode: values.reportId
+          onlineRemark: values.remark,
+          onlineReportCode: values.reportId,
         }));
         return true; // 提交成功后关闭弹窗
       }
@@ -534,42 +537,54 @@ const IndicatorMana = () => {
 
   return (
     <div className="IndicatorMana">
-      <DrawerForm actType={drawerActype} visible={drawerVisible} onVisibleChange={onVisibleChangeHandle} onFinish={(data) => drawerFormCommitHanndle(data)} record={currentEditRowData} />
+      {drawerVisible && (
+        <DrawerForm
+          actType={drawerActype}
+          visible={drawerVisible}
+          onVisibleChange={onVisibleChangeHandle}
+          onFinish={data => drawerFormCommitHanndle(data)}
+          record={currentEditRowData}
+        />
+      )}
 
       {/* 报告管理弹窗 */}
-      <ModalForm
-        title="报告管理"
-        visible={reportModalVisible}
-        onVisibleChange={setReportModalVisible}
-        onFinish={handleReportSubmit}
-        width={500}
-        initialValues={currentEditRow&&{reportId: currentEditRow.onlineReportCode,
-          remark: currentEditRow.onlineRemark}}
-        formRef={reportForm}
-        modalProps={{ 
-          destroyOnClose: true,
-          bodyStyle: {
-            maxHeight: '72vh',
-            overflowY: 'auto',
-            overflowX: 'hidden'
-          }
-        }}
-      >
-        <ProFormText
-          name="reportId"
-          label="关联报告ID"
-          placeholder="请输入"
-          rules={[{ required: true, message: '请输入关联报告ID' }]}
-        />
-        <ProFormTextArea
-          name="remark"
-          label="备注说明"
-          placeholder="请输入"
-          fieldProps={{
-            rows: 4,
+      {reportModalVisible && (
+        <ModalForm
+          title="报告管理"
+          open={reportModalVisible}
+          onOpenChange={setReportModalVisible}
+          onFinish={handleReportSubmit}
+          width={500}
+          initialValues={{
+            reportId: currentEditRow?.onlineReportCode,
+            remark: currentEditRow?.onlineRemark,
           }}
-        />
-      </ModalForm>
+          formRef={reportForm}
+          modalProps={{
+            destroyOnClose: true,
+            bodyStyle: {
+              maxHeight: '72vh',
+              overflowY: 'auto',
+              overflowX: 'hidden',
+            },
+          }}
+        >
+          <ProFormText
+            name="reportId"
+            label="关联报告ID"
+            placeholder="请输入"
+            rules={[{ required: true, message: '请输入关联报告ID' }]}
+          />
+          <ProFormTextArea
+            name="remark"
+            label="备注说明"
+            placeholder="请输入"
+            fieldProps={{
+              rows: 4,
+            }}
+          />
+        </ModalForm>
+      )}
 
       {actionType == 'DETAIL' && (
         <div className="FillingMana-detail">
@@ -586,10 +601,16 @@ const IndicatorMana = () => {
             </div>
           </div>
           <div className="bigTab" title={`${currentBigTab == '1'}`}>
-            <div className={currentBigTab === '1' ? 'tab on' : 'tab'} onClick={() => set_currentBigTab('1')}>
+            <div
+              className={currentBigTab === '1' ? 'tab on' : 'tab'}
+              onClick={() => set_currentBigTab('1')}
+            >
               线上数据
             </div>
-            <div className={currentBigTab === '2' ? 'tab on' : 'tab'} onClick={() => set_currentBigTab('2')}>
+            <div
+              className={currentBigTab === '2' ? 'tab on' : 'tab'}
+              onClick={() => set_currentBigTab('2')}
+            >
               填报数据
             </div>
           </div>
@@ -598,22 +619,33 @@ const IndicatorMana = () => {
             <div className="currentBigTab1content">
               {/* <img src={require('../../../../../public/images/empty_bigger.png')} alt="" />
               <div className="detail-noAuthRecord-title">暂无内容</div> */}
-              <div className='currentBigTab1content_header'>
+              <div className="currentBigTab1content_header">
                 <span>{currentEditRow?.onlineRemark}</span>
-                <div className='btn' onClick={openReportModal}>
-                  <IconFont type='iconpeizhi' /> 报告管理
+                <div className="btn" onClick={openReportModal}>
+                  <IconFont type="iconpeizhi" /> 报告管理
                 </div>
               </div>
-              {(currentEditRow&&currentEditRow.onlineReportCode)&&<FrameComponent link={`/platform/setting/embeddedDashboard/${currentEditRow.onlineReportCode}?noTopbar=true&noMenu=true`} />}
+              {currentEditRow && currentEditRow.onlineReportCode && (
+                <FrameComponent
+                  link={`/platform/setting/embeddedDashboard/${currentEditRow.onlineReportCode}?noTopbar=true&noMenu=true`}
+                />
+              )}
             </div>
           )}
 
           {currentBigTab === '2' && (
             <div className="FillingMana-detail-content">
               <div className="tabBar">
-                <Tabs defaultActiveKey={currentTab} onChange={tabChangeHandle} items={DATAFILL_PERIODTYPE.map((a) => ({ label: a.label, key: `${a.value}` }))} />
+                <Tabs
+                  defaultActiveKey={currentTab}
+                  onChange={tabChangeHandle}
+                  items={DATAFILL_PERIODTYPE.map(a => ({ label: a.label, key: `${a.value}` }))}
+                />
                 <div className="dataManaBtn" onClick={() => dataManaBtnHandle()}>
-                  <IconFont type={'iconpeizhi'} style={{ position: 'relative', top: 1, paddingRight: 4 }} />
+                  <IconFont
+                    type={'iconpeizhi'}
+                    style={{ position: 'relative', top: 1, paddingRight: 4 }}
+                  />
                   数据管理
                 </div>
               </div>
@@ -629,15 +661,23 @@ const IndicatorMana = () => {
                       placeholder={'填报科室'}
                       allowClear
                       autoComplete="off"
-                      suffix={<IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => detailTableDataSearchHandle('fillItemName')} />}
-                      onChange={(e) => {
+                      suffix={
+                        <IconFont
+                          type="iconsousuo"
+                          style={{ color: '#99A6BF' }}
+                          onClick={() => detailTableDataSearchHandle('fillItemName')}
+                        />
+                      }
+                      onChange={e => {
                         set_tableDataSearchKeywords(e.target.value);
                         if (e.target.value.length == 0) {
                           set_tableDataSource(total_tableDataSource);
                         }
                       }}
                       onPressEnter={(e: any) => {
-                        const result = total_tableDataSource.filter((a: any) => a.fillItemName.indexOf(e.target.value) != -1);
+                        const result = total_tableDataSource.filter(
+                          (a: any) => a.fillItemName.indexOf(e.target.value) != -1
+                        );
                         set_tableDataSource(result);
                       }}
                     />
@@ -655,7 +695,15 @@ const IndicatorMana = () => {
                   </div>
                 </div>
               </div>
-              <KCTable newVer actionRef={detailTableRef} columns={[...tableColumns]} scroll={{ y: 'calc(100vh - 232px)' }} rowKey="id" dataSource={tableDataSource} pagination={false} />
+              <KCTable
+                newVer
+                actionRef={detailTableRef}
+                columns={[...tableColumns]}
+                scroll={{ y: 'calc(100vh - 232px)' }}
+                rowKey="id"
+                dataSource={tableDataSource}
+                pagination={false}
+              />
             </div>
           )}
         </div>
@@ -670,7 +718,7 @@ const IndicatorMana = () => {
               dataSource={indicatorCateTreeData}
               fieldNames={{ title: 'name', key: 'code' }}
               contentH={'100%'}
-              onChange={(info) => onSelectChangehandle(info)}
+              onChange={info => onSelectChangehandle(info)}
             />
           </div>
           <div className="right">
@@ -683,7 +731,7 @@ const IndicatorMana = () => {
                     style={{ width: 240 }}
                     search
                     allowClear
-                    onChange={(e) => {
+                    onChange={e => {
                       set_tableDataSearchKeywords(e.target.value);
                       if (e.target.value.length == 0) {
                         set_tableDataFilterParams({
@@ -719,7 +767,7 @@ const IndicatorMana = () => {
                     if (expanded) {
                       _expandedKeys.push(record.menuId);
                     } else {
-                      const index = _expandedKeys.findIndex((t) => t == `${record.menuId}`);
+                      const index = _expandedKeys.findIndex(t => t == `${record.menuId}`);
                       if (index != -1) {
                         _expandedKeys.splice(index, 1);
                       }
@@ -730,7 +778,7 @@ const IndicatorMana = () => {
                 reload={reloadTable}
                 pagination={false}
                 options={false}
-                request={(params) => getData(params)}
+                request={params => getData(params)}
                 onChange={handleTableChange}
               />
             )}