Browse Source

fix:分页重制搜索后的bug

code4eat 6 months ago
parent
commit
6b3697af37

+ 3 - 3
config/proxy.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-04-09 18:07:34
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2025-05-14 15:20:33
+ * @LastEditTime: 2025-05-21 17:30:57
  * @FilePath: /KC-MiddlePlatform/config/proxy.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -11,8 +11,8 @@ const proxy: { [key: string]: any } = {
   dev: {
     '/gateway': {
       //target: 'http://47.96.149.190:5000',
-      //target: 'http://120.27.235.181:5000',
-      target: 'http://platform.pre.bs.qjczt.com:5000',
+      target: 'http://120.27.235.181:5000',
+      //target: 'http://platform.pre.bs.qjczt.com:5000',
       changeOrigin: true,
       // pathRewrite: { '^/master': '' },
     },

+ 26 - 3
src/components/kcTable/index.tsx

@@ -16,6 +16,9 @@ const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
   columns,
   reload,
   newVer,
+  params,
+  request,
+  onChange,
   ...restProps
 }) => {
   const [tableColumns, setTableColumns] = useState<ProColumns[]>([]);
@@ -36,6 +39,13 @@ const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
     }
   }, [reload]);
 
+  // 处理分页变化
+  const handleTableChange = (pagination: any, filters: any, sorter: any) => {
+    if (onChange) {
+      onChange(pagination, filters, sorter);
+    }
+  };
+
   if(newVer){
     return (
       <ProTable
@@ -48,7 +58,14 @@ const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
         className="KCTable"
         actionRef={actionRef}
         columns={tableColumns}
-        pagination={{ defaultPageSize: 10 }}
+        pagination={{ 
+          defaultPageSize: 10,
+          current: params?.current,
+          pageSize: params?.pageSize
+        }}
+        onChange={handleTableChange}
+        params={params}
+        request={request}
         {...restProps}
       />
     );
@@ -62,12 +79,18 @@ const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
         className="KCTable"
         actionRef={actionRef}
         columns={tableColumns}
-        pagination={{ defaultPageSize: 10 }}
+        pagination={{ 
+          defaultPageSize: 10,
+          current: params?.current,
+          pageSize: params?.pageSize
+        }}
+        onChange={handleTableChange}
+        params={params}
+        request={request}
         {...restProps}
       />
     );
   }
-
 };
 
 export default KCTable;

+ 9 - 0
src/pages/index/index.less

@@ -552,3 +552,12 @@
     }
   }
 }
+
+.departmentName {
+  display: inline-block; /* 内联块元素 */
+  max-width: 140px; /* 最大宽度,可根据实际调整 */
+  overflow: hidden; /* 超出隐藏 */
+  text-overflow: ellipsis; /* 超出显示省略号 */
+  white-space: nowrap; /* 不换行 */
+  vertical-align: bottom;
+}

+ 22 - 7
src/pages/index/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2025-03-13 14:12:10
+ * @LastEditTime: 2025-05-20 10:53:28
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
@@ -9,7 +9,7 @@
 
 import { useModel, history, Location, Helmet } from 'umi';
 import './index.less';
-import { Skeleton, Drawer } from 'antd';
+import { Skeleton, Drawer, Tooltip } from 'antd';
 import { useState, useEffect } from 'react';
 
 import { FastEntry, FastEntryTabType } from './components/FastEntry';
@@ -254,25 +254,40 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
                   <div className="label">
                     <img src={require('../../../public/images/icon-keshi.png')} alt="" />
                     <span>{customerType == '2' ? '组织' : '科室'}</span>
-                    {userInfo?.departmentName ? userInfo?.departmentName : '-'}
+                    <Tooltip title={userInfo?.departmentName}>
+                      <span className="departmentName">
+                        {userInfo?.departmentName ? userInfo?.departmentName : '-'}
+                      </span>
+                    </Tooltip>
                   </div>
                   <div className="label">
                     <img src={require('../../../public/images/icon-zhicheng.png')} alt="" />
                     <span>{customerType == '2' ? '职务' : '职称'}</span>
-                    {customerType == '2' && <>{userInfo?.jobTitle ?? '-'}</>}
-                    {customerType == '1' && <>{userInfo?.title ?? '-'}</>}
+                    <Tooltip title={customerType == '2' ? userInfo?.jobTitle : userInfo?.title}>
+                      <span className="departmentName">
+                        {customerType == '2' ? (userInfo?.jobTitle ?? '-') : (userInfo?.title ?? '-')}
+                      </span>
+                    </Tooltip>
                   </div>
                 </div>
                 <div className="row">
                   <div className="label">
                     <img src={require('../../../public/images/icon-leibie.png')} alt="" />
                     <span>类别</span>
-                    {userInfo?.userCate ? userInfo?.userCate : '-'}
+                    <Tooltip title={userInfo?.userCate}>
+                      <span className="departmentName">
+                        {userInfo?.userCate ? userInfo?.userCate : '-'}
+                      </span>
+                    </Tooltip>
                   </div>
                   <div className="label">
                     <img src={require('../../../public/images/icon-gangwei.png')} alt="" />
                     <span>岗位</span>
-                    {userInfo?.position ? userInfo?.position : '-'}
+                    <Tooltip title={userInfo?.position}>
+                      <span className="departmentName">
+                        {userInfo?.position ? userInfo?.position : '-'}
+                      </span>
+                    </Tooltip>
                   </div>
                 </div>
               </div>

+ 3 - 1
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2025-05-15 10:30:23
+ * @LastEditTime: 2025-05-15 14:14:09
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/_layout.tsx
@@ -376,6 +376,7 @@ export default function Layout({ children, location, route, history, match, ...r
     }
     prevIsThirdPartySystemRef.current = isThirdPartySystem;
   }, [isThirdPartySystem]);
+  
 
   return (
     <ProLayout
@@ -438,6 +439,7 @@ export default function Layout({ children, location, route, history, match, ...r
       }}
       menu={isShowPageMenu && !noMenu ? {
         autoClose: false,
+        params:initialState?.currentSelectedSys,
         request: async () => {
           if (initialState && initialState.currentSelectedSys) {
             const { systemId, menuId, path, type, contentType } = initialState.currentSelectedSys;

+ 34 - 12
src/pages/platform/setting/dataFilling/fillingMana/index.tsx

@@ -109,7 +109,14 @@ let total_tableDataSource: any[] = [];
 
 export default function FillingMana() {
   const { initialState, setInitialState } = useModel('@@initialState');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const tableRef = useRef<ActionType>();
   const detailTableRef = useRef<ActionType>();
@@ -256,17 +263,24 @@ export default function FillingMana() {
     }
   };
   const getTableData = async (params: any) => {
-    const resp = await getTableList({ ...params });
+    const { current = 1, pageSize = 10, name } = params;
+    const resp = await getTableList({
+      current,
+      pageSize,
+      name
+    });
     if (resp) {
       return {
         data: resp.list,
         success: true,
-        total: resp.totalCount,
-        pageSize: resp.pageSize,
-        totalPage: resp.totalPage,
+        total: resp.totalCount
       };
     }
-    return [];
+    return {
+      data: [],
+      success: false,
+      total: 0
+    };
   };
 
   const delTableData = async (record: any) => {
@@ -314,13 +328,21 @@ export default function FillingMana() {
     return false;
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   const detailtableDataSearchHandle = (paramName: string) => {
     const result = total_tableDataSource.filter((a: any) => a[`${paramName}`].indexOf(tableDataSearchKeywords) != -1);
@@ -637,13 +659,13 @@ export default function FillingMana() {
             </div>
           </div>
           <KCTable
-            newVer
-            columns={columns as ProColumns[]}
-            scroll={{ y: 'calc(100vh - 232px)' }}
-            actionRef={tableRef}
+            columns={columns}
+            scroll={{ y: `calc(100vh - 250px)` }}
             rowKey="id"
+            newVer
             params={tableDataFilterParams}
             request={(params) => getTableData(params)}
+            onChange={handleTableChange}
           />
         </div>
       )}

+ 28 - 4
src/pages/platform/setting/departmentMana/index.tsx

@@ -28,7 +28,14 @@ import { checkRoleTagsIsObjArr } from '../roleManage/modals/modal';
 
 export default function DepartmentMana() {
   const { initialState, setInitialState } = useModel('@@initialState');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [reload, set_reload] = useState(false);
   const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -247,13 +254,21 @@ export default function DepartmentMana() {
     );
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   const downloadTemplateFileHandle = async () => {
     await downloadTemplateReq('/centerSys/sysdepartment/export');
@@ -366,7 +381,16 @@ export default function DepartmentMana() {
         </div>
       </div>
       <div style={{ marginTop: 16 }}>
-        <KCTable columns={columns as ProColumns[]} scroll={{ y: `calc(100vh - 255px)` }} reload={reload} rowKey="id" newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />
+        <KCTable
+          columns={columns}
+          scroll={{ y: `calc(100vh - 250px)` }}
+          reload={reload}
+          rowKey="id"
+          newVer
+          params={tableDataFilterParams}
+          request={(params) => getTableData(params)}
+          onChange={handleTableChange}
+        />
       </div>
     </div>
   );

+ 30 - 22
src/pages/platform/setting/hospManage/index.tsx

@@ -711,7 +711,12 @@ const DrawerActBtn = ({ record }: { record: any }) => {
 const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
   const { reloadTable } = state;
   const { initialState, setInitialState } = useModel('@@initialState');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    name: '',
+    hospName: ''
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [tabIds, set_tabIds] = useState<Key[]>([]);
   const [open, set_open] = useState(false);
@@ -1005,17 +1010,17 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
-  const onCheckedHandle = async (data: NavSelecterItemType[]) => {
-    dispatch &&
-      dispatch({
-        type: 'hospManageModel/postEditData',
-        payload: { bindMenuIds: data.map((a) => a.menuId) },
-      });
-  };
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   return (
     <div className="HospManage">
@@ -1026,7 +1031,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
           <div className="filterItem">
             <span className="label">检索:</span>
             <KCInput
-              placeholder={'请输入院名称'}
+              placeholder={'请输入院名称'}
               style={{ width: 160 }}
               search
               allowClear
@@ -1035,7 +1040,8 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
                 if (e.target.value.length == 0) {
                   set_tableDataFilterParams({
                     ...tableDataFilterParams,
-                    hospName: '',
+                    current: 1,
+                    hospName: ''
                   });
                 }
               }}
@@ -1049,16 +1055,18 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
           </span>
         </div>
       </div>
-      <KCTable
-        newVer
-        rowKey="id"
-        scroll={{ y: `calc(100vh - 250px)` }}
-        columns={columns}
-        reload={reloadTable}
-        options={false}
-        params={tableDataFilterParams}
-        request={(params) => getHospData(params)}
-      />
+      <div style={{ marginTop: 16 }}>
+        <KCTable
+          columns={columns}
+          scroll={{ y: `calc(100vh - 250px)` }}
+          reload={reloadTable}
+          rowKey="id"
+          newVer
+          params={tableDataFilterParams}
+          request={(params) => getHospData(params)}
+          onChange={handleTableChange}
+        />
+      </div>
     </div>
   );
 };

+ 28 - 17
src/pages/platform/setting/hospParamsMana/index.tsx

@@ -33,7 +33,11 @@ const SearchIcon = createFromIconfontCN({
 });
 
 export default function PubDicTypeMana() {
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    name: ''
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [reload, set_reload] = useState(false);
   const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -258,9 +262,17 @@ export default function PubDicTypeMana() {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
+
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   const getTreeReqFunc = async (name?: string) => {
     const resp = await getTreeData();
@@ -434,7 +446,7 @@ export default function PubDicTypeMana() {
             <div className="filterItem">
               <span className="label">检索:</span>
               <KCInput
-                placeholder={'请输入名称'}
+                placeholder={'请输入参数名称'}
                 style={{ width: 160 }}
                 search
                 allowClear
@@ -444,28 +456,27 @@ export default function PubDicTypeMana() {
                     set_tableDataFilterParams({
                       ...tableDataFilterParams,
                       current: 1,
-                      targetName: '',
+                      name: ''
                     });
                   }
                 }}
-                onSearch={() => tableDataSearchHandle('targetName')}
+                onSearch={() => tableDataSearchHandle('name')}
               />
             </div>
           </div>
           <div className="btnGroup">{currentSelectedTreeNode?.status == 1 && <UpDataActBtn record type="ADD" />}</div>
         </div>
         <div style={{ marginTop: 16 }}>
-          {currentSelectedTreeNode && (
-            <KCTable
-              scroll={{ y: `calc(100vh - 315px)` }}
-              columns={columns as ProColumns[]}
-              reload={reload}
-              rowKey="id"
-              newVer
-              params={tableDataFilterParams}
-              request={(params) => getTableData(params)}
-            />
-          )}
+          <KCTable
+            columns={columns}
+            scroll={{ y: `calc(100vh - 250px)` }}
+            reload={reload}
+            rowKey="id"
+            newVer
+            params={tableDataFilterParams}
+            request={(params) => getTableData(params)}
+            onChange={handleTableChange}
+          />
         </div>
       </div>
     </div>

+ 28 - 40
src/pages/platform/setting/indicatoLagacy/index.tsx

@@ -33,7 +33,16 @@ const IndicatorMana = () => {
   const [tableData, set_tableData] = useState<any[]>([]);
   const [cateId, set_cateId] = useState<string>();
 
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+    indicatorType?: string;
+    outsideIndexes?: string[];
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [currentSelectedLeft, set_currentSelectedLeft] = useState<any>(undefined);
 
@@ -184,11 +193,11 @@ const IndicatorMana = () => {
   };
 
   const getData = async (params: any) => {
-    const { current = 1, name, indicatorType, outsideIndexes } = params;
+    const { current = 1, pageSize = 10, name, indicatorType, outsideIndexes } = params;
     if (cateId) {
       const resp = await getIndicatorManaList_old({
-        current: 1,
-        pageSize: 0,
+        current,
+        pageSize,
         menuCode: cateId as string,
         indicatorName: name,
         indicatorType: indicatorType,
@@ -346,13 +355,21 @@ const IndicatorMana = () => {
     currentSelected && set_cateId(currentSelected.code);
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   useEffect(() => {
     if (tableData) {
@@ -421,43 +438,14 @@ const IndicatorMana = () => {
           </div>
           {cateId && (
             <KCTable
-              newVer
-              rowKey="menuId"
               columns={columns}
-              params={tableDataFilterParams}
-              actionRef={indicatorTableRef}
-              scroll={{ y: `calc(100vh - 228px)` }}
-              expandable={{
-                expandedRowKeys: defaultExpandedRowKeys,
-                onExpand: (expanded, record) => {
-                  // console.log({expanded, record});
-                  let _expandedKeys = [...defaultExpandedRowKeys];
-                  if (expanded) {
-                    _expandedKeys.push(record.menuId);
-                  } else {
-                    const index = _expandedKeys.findIndex((t) => t == `${record.menuId}`);
-                    if (index != -1) {
-                      _expandedKeys.splice(index, 1);
-                    }
-                  }
-                  set_defaultExpandedRowKeys([..._expandedKeys]);
-                },
-              }}
+              scroll={{ y: `calc(100vh - 250px)` }}
               reload={reloadTable}
-              pagination={false}
-              // toolBarRender={() => [
-              //   // <Button key="1" onClick={addHandle}>
-              //   //   上传
-              //   // </Button>,
-              //   // <Button key="2" onClick={addHandle}>
-              //   //   下载
-              //   // </Button>,
-              //   <Button key="3" type="primary" onClick={addHandle}>
-              //     新增
-              //   </Button>,
-              // ]}
-              options={false}
+              rowKey="id"
+              newVer
+              params={tableDataFilterParams}
               request={(params) => getData(params)}
+              onChange={handleTableChange}
             />
           )}
         </div>

+ 22 - 28
src/pages/platform/setting/indicatorMana/index.tsx

@@ -54,7 +54,11 @@ const IndicatorMana = () => {
 
   const [cateId, set_cateId] = useState<string>();
   const [tableColumns, set_tableColumns] = useState<ProColumns[]>([]);
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    name: '',
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [currentSelectedLeft, set_currentSelectedLeft] = useState<any>(undefined);
   const [actionType, set_actionType] = useState<'NORMAL' | 'DETAIL' | undefined>('NORMAL');
@@ -234,7 +238,7 @@ const IndicatorMana = () => {
   };
 
   const getData = async (params: any) => {
-    const { current = 1, name, indicatorType, outsideIndexes } = params;
+    const { current = 1, pageSize = 10, name, indicatorType, outsideIndexes } = params;
     if (cateId) {
       const resp = await getIndicatorManaList({
         menuCode: cateId as string,
@@ -242,40 +246,21 @@ const IndicatorMana = () => {
         indicatorName: name,
         indicatorType: indicatorType,
         outsideIndexes: outsideIndexes && outsideIndexes.length > 0 ? outsideIndexes[outsideIndexes.length - 1] : '',
+        current,
+        pageSize
       });
 
       if (resp && resp[0]) {
-        // const getName: any = (obj: any) => {
-
-        //   let isArr = Array.isArray(obj);
-        //   let reslut = [];
-        //   if (isArr) {
-        //     obj.forEach((item: any) => {
-        //       reslut.push(...getName(item));
-        //     });
-        //   } else {
-        //     reslut.push(obj.menuId)
-
-        //     if (obj.children) {
-        //       reslut.push(...getName(obj.children));
-        //     }
-        //   }
-        //   return reslut;
-
-        // }
-
-        // set_defaultExpandedRowKeys(getName(resp[0].children));
-
         return {
           data: resp[0].children as unknown as [],
           success: true,
-          total: 1,
+          total: resp[0].total || resp[0].children?.length || 0
         };
       } else {
         return {
           data: [],
           success: true,
-          total: 0,
+          total: 0
         };
       }
     }
@@ -283,7 +268,7 @@ const IndicatorMana = () => {
     return {
       data: [],
       success: false,
-      total: 0,
+      total: 0
     };
   };
 
@@ -403,9 +388,17 @@ const IndicatorMana = () => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
+
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   const detailTableDataSearchHandle = (paramName: string) => {
     const result = total_tableDataSource.filter((a: any) => a[`${paramName}`].indexOf(tableDataSearchKeywords) != -1);
@@ -738,6 +731,7 @@ const IndicatorMana = () => {
                 pagination={false}
                 options={false}
                 request={(params) => getData(params)}
+                onChange={handleTableChange}
               />
             )}
           </div>

+ 47 - 8
src/pages/platform/setting/kcClassification/index.tsx

@@ -22,7 +22,14 @@ import './style.less';
 import { findParents, renameChildListToChildren, searchTreeAndKeepStructure } from '@/utils';
 
 export default function KcClassification() {
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [reload, set_reload] = useState(false);
   const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -63,16 +70,31 @@ export default function KcClassification() {
     },
   ];
 
-  const getTableData = async () => {
+  const getTableData = async (params?: any) => {
     const resp = await getData();
     set_reload(false);
     if (resp) {
       const data = renameChildListToChildren(resp, 'childList');
       set_tableData(data);
       set_dataSource(data);
+      
+      // 处理分页
+      const { current = 1, pageSize = 10, name } = params || {};
+      const start = (current - 1) * pageSize;
+      const end = start + pageSize;
+      const filteredData = name ? searchTreeAndKeepStructure(data, 'name', name) : data;
+      
+      return {
+        data: filteredData.slice(start, end),
+        success: true,
+        total: filteredData.length
+      };
     }
-    set_reload(false);
-    return [];
+    return {
+      data: [],
+      success: false,
+      total: 0
+    };
   };
 
   const delTableData = async (record: any) => {
@@ -156,13 +178,21 @@ export default function KcClassification() {
     );
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
-      current:1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      current: 1,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   useEffect(() => {
     if (reload) {
@@ -214,7 +244,16 @@ export default function KcClassification() {
         </div>
       </div>
       <div style={{ marginTop: 16 }}>
-        <KCTable scroll={{ y: `calc(100vh - 195px)` }} pagination={false} columns={columns as ProColumns[]} rowKey="id" newVer dataSource={tableData} />
+        <KCTable
+          columns={columns}
+          scroll={{ y: `calc(100vh - 250px)` }}
+          reload={reload}
+          rowKey="id"
+          newVer
+          params={tableDataFilterParams}
+          request={(params) => getTableData(params)}
+          onChange={handleTableChange}
+        />
       </div>
     </div>
   );

+ 41 - 12
src/pages/platform/setting/notificationTemplate/index.tsx

@@ -26,7 +26,14 @@ import './style.less';
 
 export default function PubDicTypeMana() {
 
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+        current: number;
+        pageSize: number;
+        name?: string;
+    }>({
+        current: 1,
+        pageSize: 10
+    });
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
     const [reload, set_reload] = useState(false);
     const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -102,18 +109,25 @@ export default function PubDicTypeMana() {
 
 
     const getTableData = async (params: any) => {
-        const resp = await getData(params);
+        const { current = 1, pageSize = 10, name } = params;
+        const resp = await getData({
+            current,
+            pageSize,
+            name
+        });
         set_reload(false);
         if (resp) {
             return {
                 data: resp.list,
                 success: true,
-                total: resp.totalCount,
-                pageSize: resp.pageSize,
-                totalPage: resp.totalPage,
-            }
+                total: resp.totalCount
+            };
         }
-        return []
+        return {
+            data: [],
+            success: false,
+            total: 0
+        };
     }
 
     const delTableData = async (record: any) => {
@@ -304,14 +318,20 @@ export default function PubDicTypeMana() {
         )
     }
 
-    const tableDataSearchHandle = (paramName: string) => {
-
+    const handleTableChange = (pagination: any) => {
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            current: pagination.current,
+            pageSize: pagination.pageSize
+        });
+    }
 
+    const tableDataSearchHandle = (paramName: string) => {
         set_tableDataFilterParams({
             ...tableDataFilterParams,
-            current:1,
+            current: 1,
             [`${paramName}`]: tableDataSearchKeywords
-        })
+        });
     }
 
 
@@ -405,7 +425,16 @@ export default function PubDicTypeMana() {
                 </div>
             </div>
             <div style={{ marginTop: 16 }}>
-                <KCTable  scroll={{y:`calc(100vh - 250px)`}} columns={columns as ProColumns[]} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCTable
+                    columns={columns}
+                    scroll={{ y: `calc(100vh - 250px)` }}
+                    reload={reload}
+                    rowKey="id"
+                    newVer
+                    params={tableDataFilterParams}
+                    request={(params) => getTableData(params)}
+                    onChange={handleTableChange}
+                />
             </div>
         </div>
     )

+ 28 - 8
src/pages/platform/setting/paramsMana/index.tsx

@@ -33,7 +33,13 @@ const SearchIcon = createFromIconfontCN({
 
 export default function ParamsMana() {
 
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+        current: 1,
+        pageSize: 10,
+        paramName: '',
+        paramCode: '',
+        paramType: '',
+    });
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
     const [reload, set_reload] = useState(false);
     const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -196,15 +202,30 @@ export default function ParamsMana() {
 
 
     const tableDataSearchHandle = (paramName: string) => {
-
-
         set_tableDataFilterParams({
             ...tableDataFilterParams,
-            current:1,
+            current: 1,
             [`${paramName}`]: tableDataSearchKeywords
-        })
+        });
     }
 
+    const handleTableChange = (pagination: any) => {
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            current: pagination.current,
+            pageSize: pagination.pageSize
+        });
+    }
+
+    const tableDataResetHandle = () => {
+        set_tableDataFilterParams({
+            current: 1,
+            pageSize: 10,
+            paramName: '',
+            paramCode: '',
+            paramType: '',
+        });
+    }
 
     const getTreeReqFunc = async () => {
         const resp = await getSysLists();
@@ -392,13 +413,12 @@ export default function ParamsMana() {
                                     if (e.target.value.length == 0) {
                                         set_tableDataFilterParams({
                                             ...tableDataFilterParams,
-                                            current:1,
+                                            current: 1,
                                             parameterName: ''
                                         });
                                     }
                                 }}
                                 onSearch={() => tableDataSearchHandle('parameterName')}
-
                             />
                         </div>
                     </div>
@@ -407,7 +427,7 @@ export default function ParamsMana() {
                     </div>
                 </div>
                 <div style={{ marginTop: 16 }}>
-                    {currentSelectedTreeNode && <KCTable columns={columns} scroll={{ y: `calc(100vh - 250px)` }} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
+                    {currentSelectedTreeNode && <KCTable columns={columns} scroll={{ y: `calc(100vh - 250px)` }} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} onChange={handleTableChange} />}
                 </div>
             </div>
 

+ 21 - 5
src/pages/platform/setting/pubDicMana/index.tsx

@@ -39,7 +39,14 @@ if (currentSelectedTab) {
 }
 
 const PubDicMana = () => {
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [reload, set_reload] = useState(false);
 
@@ -212,13 +219,21 @@ const PubDicMana = () => {
     );
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   const getTreeReqFunc = async (type: number) => {
     const resp = await getLeftData(type);
@@ -461,13 +476,14 @@ const PubDicMana = () => {
         <div style={{ marginTop: 16 }}>
           {currentSelectedTreeNode && (
             <KCTable
+              columns={columns}
               scroll={{ y: `calc(100vh - 250px)` }}
-              columns={columns as ProColumns[]}
               reload={reload}
-              rowKey={pageType == 1 ? 'dictDataId' : 'id'}
+              rowKey="id"
               newVer
               params={tableDataFilterParams}
               request={(params) => getTableData(params)}
+              onChange={handleTableChange}
             />
           )}
         </div>

+ 22 - 6
src/pages/platform/setting/pubDicTypeMana/index.tsx

@@ -31,7 +31,14 @@ const SearchIcon = createFromIconfontCN({
 });
 
 export default function PubDicTypeMana() {
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<{
+    current: number;
+    pageSize: number;
+    name?: string;
+  }>({
+    current: 1,
+    pageSize: 10
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
   const [reload, set_reload] = useState(false);
   const [currentEdit, set_currentEdit] = useState<any>(undefined);
@@ -190,13 +197,21 @@ export default function PubDicTypeMana() {
     );
   };
 
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
+
   const tableDataSearchHandle = (paramName: string) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
 
   const getTreeReqFunc = async (name?: string) => {
     const resp = await getTreeData();
@@ -400,13 +415,14 @@ export default function PubDicTypeMana() {
         <div style={{ marginTop: 16 }}>
           {currentSelectedTreeNode && (
             <KCTable
-              scroll={{ y: `calc(100vh - 255px)` }}
-              columns={columns as ProColumns[]}
+              columns={columns}
+              scroll={{ y: `calc(100vh - 250px)` }}
               reload={reload}
-              rowKey="dictId"
+              rowKey="id"
               newVer
               params={tableDataFilterParams}
               request={(params) => getTableData(params)}
+              onChange={handleTableChange}
             />
           )}
         </div>

+ 133 - 54
src/pages/platform/setting/roleManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2025-02-21 17:50:31
+ * @LastEditTime: 2025-05-21 17:50:49
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/hospManage/index.tsx
@@ -131,14 +131,17 @@ const DrawerActBtn = ({ record }: { record: any }) => {
       key: 'deptName',
       render: (_: any, record: any) => {
         if (record.functionList) {
-          const options = record.functionList.map((item: any, index: number) => ({ label: item.name, value: item.code }));
+          const options = record.functionList.map((item: any, index: number) => ({ 
+            label: item.name, 
+            value: item.code 
+          }));
 
           const needItem = checkBoxCodes.filter((a) => a.menuId == record.menuId);
-
           const codes = needItem && needItem.length > 0 ? needItem[0].function.map((a: any) => a.code) : [];
 
           const onCheckGroupChange = (checkedValue: CheckboxValueType[]) => {
             if (checkedValue.length > 0) {
+              // 1. 处理功能权限数据
               const _temp = [...checkBoxCodes];
               const index = checkBoxCodes.findIndex((item) => item.menuId == record.menuId);
 
@@ -146,7 +149,6 @@ const DrawerActBtn = ({ record }: { record: any }) => {
               const transfered = needed.map((item: any) => ({ name: item.label, code: item.value }));
 
               if (index >= 0) {
-                //先去除旧的的对象
                 _temp.splice(index, 1);
               }
 
@@ -155,19 +157,30 @@ const DrawerActBtn = ({ record }: { record: any }) => {
                 function: transfered,
               });
 
-              set_checkedMenuParentsIds([...checkedMenuParentsIds, record.menuId]);
+              // 2. 获取并添加父级菜单ID
+              const parents = findParents(hospAllMenuTree, record.menuId);
+              const parentsIds = parents ? parents.map((a) => a.menuId) : [];
 
+              // 3. 更新所有相关状态
+              set_checkedMenuParentsIds([...checkedMenuParentsIds, record.menuId, ...parentsIds]);
               set_checkedTableMenuIds([...checkedTableMenuIds, record.menuId]);
-
               set_checkBoxCodes([..._temp]);
             } else {
-              //取消选择
+              // 取消选择时的处理
               const _temp = checkBoxCodes;
               const index = checkBoxCodes.findIndex((item) => item.menuId == record.menuId);
-
-              _temp.splice(index, 1);
-
-              set_checkBoxCodes([..._temp]);
+              
+              if (index >= 0) {
+                _temp.splice(index, 1);
+                set_checkBoxCodes([..._temp]);
+                
+                // 检查是否还有其他功能被选中
+                const hasOtherFunctions = _temp.some(item => item.menuId === record.menuId);
+                if (!hasOtherFunctions) {
+                  // 如果没有其他功能被选中,从选中列表中移除
+                  set_checkedTableMenuIds(checkedTableMenuIds.filter(id => id !== record.menuId));
+                }
+              }
             }
           };
 
@@ -355,39 +368,90 @@ const DrawerActBtn = ({ record }: { record: any }) => {
   };
 
   const saveResult = async () => {
-    let old = [...oldSelectedMenuIds];
-    //const needCancelMenus = needCancelCheckedMenus.map(a=>({hospId: record.id ,systemId: currentSelectedTreeNode.code,function:[],menuId:a}));
-    const result = checkBoxCodes.map((item: any) => {
-      old.splice(
-        old.findIndex((a) => a == item.menuId),
-        1,
-      );
-      return { ...item, hospId: record.hospId, roleId: record.roleId, systemId: currentSelectedTreeNode.code };
-    });
+    try {
+      // 1. 收集所有需要保存的菜单ID
+      const allMenuIds = new Set<string>();
 
-    const needCancelMenus = old.map((a) => ({
-      hospId: record.hospId,
-      systemId: currentSelectedTreeNode.code,
-      menuId: a,
-      roleId: record.roleId,
-      function: [],
-    }));
+      // 2. 添加当前选中的菜单ID(类型转换为string)
+      checkedMenuParentsIds.forEach(id => allMenuIds.add(String(id)));
 
-    const data = {
-      hospId: record.hospId,
-      roleId: record.roleId,
-      systemId: currentSelectedTreeNode.code,
-      menuIds: ifTixiMenu ? (ifTixiMenuAuth ? [currentSelectedTreeNode.code] : []) : [...new Set(checkedMenuParentsIds), currentSelectedTreeNode.code],
-      functionList: [...result, ...needCancelMenus],
-    };
+      // 3. 添加系统ID
+      if (currentSelectedTreeNode?.code) {
+        allMenuIds.add(String(currentSelectedTreeNode.code));
+      }
 
-    const resp = await saveRoleRelaApiPerm(data);
-    if (resp) {
-      set_drawerTablereload(true);
-      set_checkBoxCodes([]);
-      set_checkedTableMenuIds([]);
-      setInitCheckData();
+      // 4. 确保父级ID存在
+      const finalMenuIds = Array.from(allMenuIds).filter(id => {
+        const parents = findParents(hospAllMenuTree, id);
+        if (parents) {
+          return parents.every(parent => allMenuIds.has(String(parent.menuId)));
+        }
+        return true;
+      });
+
+      // 5. 生成 result 和 needCancelMenus
+      let old = [...oldSelectedMenuIds];
+      const result = checkBoxCodes.map((item: any) => {
+        const index = old.findIndex((a) => a == item.menuId);
+        if (index !== -1) {
+          old.splice(index, 1);
+        }
+        return { ...item, hospId: record.hospId, roleId: record.roleId, systemId: currentSelectedTreeNode.code };
+      });
+
+      const needCancelMenus = old.map((a) => ({
+        hospId: record.hospId,
+        systemId: currentSelectedTreeNode.code,
+        menuId: a,
+        roleId: record.roleId,
+        function: [],
+      }));
+
+      const data = {
+        hospId: record.hospId,
+        roleId: record.roleId,
+        systemId: currentSelectedTreeNode.code,
+        menuIds: ifTixiMenu
+          ? (ifTixiMenuAuth ? [currentSelectedTreeNode.code] : [])
+          : finalMenuIds,
+        functionList: [...result, ...needCancelMenus],
+      };
+
+      // 6. 数据验证
+      if (!validateMenuIds(data.menuIds, hospAllMenuTree)) {
+        console.warn('菜单ID数据不完整,请检查');
+        return;
+      }
+
+      const resp = await saveRoleRelaApiPerm(data);
+      if (resp) {
+        set_drawerTablereload(true);
+        set_checkBoxCodes([]);
+        set_checkedTableMenuIds([]);
+        await setInitCheckData();
+      }
+    } catch (error) {
+      console.error('保存角色权限失败:', error);
+    }
+  };
+
+  // 添加数据验证函数
+  const validateMenuIds = (menuIds: string[], tree: any[]) => {
+    // 检查是否所有父级ID都存在
+    const missingParents = menuIds.filter(id => {
+      const parents = findParents(tree, id);
+      if (parents) {
+        return parents.some(parent => !menuIds.includes(parent.menuId));
+      }
+      return false;
+    });
+
+    if (missingParents.length > 0) {
+      console.warn('发现缺失的父级菜单ID:', missingParents);
+      return false;
     }
+
+    return true;
   };
 
   const onCancel = () => {
@@ -699,8 +763,13 @@ const DrawerActBtn = ({ record }: { record: any }) => {
 const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
   const { reloadTable } = state;
   const { initialState, setInitialState } = useModel('@@initialState');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    roleName: '',
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+  const [reload, set_reload] = useState(false);
 
   const columns: ProColumns<TableListItem>[] = [
     {
@@ -886,9 +955,17 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
+
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   const editUserBind = async (record: TableListItem) => {
     //编辑角色与人员的绑定关系
@@ -949,7 +1026,7 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
                   set_tableDataFilterParams({
                     ...tableDataFilterParams,
                     current: 1,
-                    roleName: '',
+                    roleName: ''
                   });
                 }
               }}
@@ -964,16 +1041,18 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
         </div>
       </div>
 
-      <KCTable
-        rowKey="roleId"
-        columns={columns}
-        options={false}
-        newVer
-        params={tableDataFilterParams}
-        reload={reloadTable}
-        scroll={{ y: `calc(100vh - 255px)` }}
-        request={(params) => getData(params)}
-      />
+      <div style={{ marginTop: 16 }}>
+        <KCTable
+          columns={columns}
+          scroll={{ y: `calc(100vh - 250px)` }}
+          reload={reload}
+          rowKey="id"
+          newVer
+          params={tableDataFilterParams}
+          request={(params) => getData(params)}
+          onChange={handleTableChange}
+        />
+      </div>
     </div>
   );
 };

+ 18 - 5
src/pages/platform/setting/systemNavMana/index.tsx

@@ -50,7 +50,11 @@ const MonthlyInfoCheck: React.FC = () => {
 
   const [reload, set_reload] = useState(false);
 
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    name: ''
+  });
 
   const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
   const [searchValue, setSearchValue] = useState('');
@@ -412,9 +416,17 @@ const MonthlyInfoCheck: React.FC = () => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
+
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   const updateTable = async (type: 'EDIT' | 'ADD', formVal: any, record: any) => {
     if (type == 'ADD') {
@@ -702,7 +714,7 @@ const MonthlyInfoCheck: React.FC = () => {
             <div className="filterItem">
               <span className="label">检索:</span>
               <KCInput
-                placeholder={'请输入菜单名称'}
+                placeholder={'请输入名称'}
                 style={{ width: 160 }}
                 search
                 allowClear
@@ -712,7 +724,7 @@ const MonthlyInfoCheck: React.FC = () => {
                     set_tableDataFilterParams({
                       ...tableDataFilterParams,
                       current: 1,
-                      name: '',
+                      name: ''
                     });
                   }
                 }}
@@ -735,6 +747,7 @@ const MonthlyInfoCheck: React.FC = () => {
             rowKey="menuId"
             columns={columns as ProColumns[]}
             request={(params: any, sort: any, filter: any) => getTableData(params, sort, filter)}
+            onChange={handleTableChange}
           />
         )}
       </div>

+ 30 - 49
src/pages/platform/setting/userManage/index.tsx

@@ -39,7 +39,13 @@ interface PageProps extends ConnectProps {
 const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
   const { reloadTable } = state;
   const { initialState, setInitialState } = useModel('@@initialState');
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<TableRequestParamsType>({
+    current: 1,
+    pageSize: 10,
+    name: '',
+    account: '',
+    departmentId: undefined
+  });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
 
   const [dirData, set_dirData] = useState<UserRelaSeletDataType[]>([]);
@@ -245,9 +251,17 @@ const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
     set_tableDataFilterParams({
       ...tableDataFilterParams,
       current: 1,
-      [`${paramName}`]: tableDataSearchKeywords,
+      [`${paramName}`]: tableDataSearchKeywords
     });
-  };
+  }
+
+  const handleTableChange = (pagination: any) => {
+    set_tableDataFilterParams({
+      ...tableDataFilterParams,
+      current: pagination.current,
+      pageSize: pagination.pageSize
+    });
+  }
 
   const importData = (name: string) => {
     return (
@@ -358,6 +372,7 @@ const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
                     ...tableDataFilterParams,
                     current: 1,
                     name: '',
+                    account: ''
                   });
                 }
               }}
@@ -373,52 +388,18 @@ const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
         </div>
       </div>
 
-      <KCTable
-        rowKey="id"
-        headerTitle="查询表格"
-        columns={columns}
-        reload={reloadTable}
-        params={tableDataFilterParams}
-        newVer
-        scroll={{ y: `calc(100vh - 255px)` }}
-        expandable={{
-          expandedRowRender: (record) => (
-            <div className="userExpandInfo">
-              {initialState?.customerType == '2' ? <span>入职时间:{record.entryTime}</span> : <span>入职时间:{record.entryTime}</span>}
-              {initialState?.customerType == '2' ? <span>联系电话:{record.phoneNumber}</span> : <span>联系电话:{record.phoneNumber}</span>}
-              <span>所学专业:{record.major}</span>
-              <span>资格证号:{record.qualificationCertificateNo}</span>
-              {initialState?.customerType == '2' ? <span>执业级别:{record.doctorLevel}</span> : <span>医师级别:{record.doctorLevel}</span>}
-              <span>执业证号:{record.practiceCertificateNo}</span>
-              <span>执业类别:{record.practiceSubject}</span>
-              <span>执业科目:{record.practiceCate}</span>
-              <span>执业状态:{record.practiceStatus}</span>
-              <span>备注:{record.remark}</span>
-            </div>
-          ),
-          rowExpandable: () => true,
-        }}
-        // toolBarRender={() => [
-        //   <KCUpload
-        //     title="导入数据"
-        //     fieldProps={{
-        //       onChange: ({ file, fileList }:{file:any,fileList:any}) => {
-        //         if (file.status == 'done') {
-        //           importUserHandle(file.originFileObj);
-        //         }
-        //       },
-        //       showUploadList: false,
-        //     }}
-        //   />,
-        //   <Button key="2" onClick={() => getUserTemplateHandle()}>
-        //     模板下载
-        //   </Button>,
-        //   <Button key="3" onClick={addUserHandle}>
-        //     新增用户
-        //   </Button>,
-        // ]}
-        request={(params) => getUserData(params)}
-      />
+      <div style={{ marginTop: 16 }}>
+        <KCTable
+          columns={columns}
+          scroll={{ y: `calc(100vh - 250px)` }}
+          reload={reloadTable}
+          rowKey="id"
+          newVer
+          params={tableDataFilterParams}
+          request={(params) => getUserData(params)}
+          onChange={handleTableChange}
+        />
+      </div>
     </div>
   );
 };