Bläddra i källkod

添加菜单权限检验

code4eat 1 år sedan
förälder
incheckning
1da37d5705
52 ändrade filer med 656 tillägg och 804 borttagningar
  1. BIN
      .DS_Store
  2. 3 44
      .umirc.ts
  3. 88 281
      src/app.tsx
  4. 18 18
      src/authWrapper.tsx
  5. 12 1
      src/global.less
  6. 25 0
      src/pages/404.tsx
  7. 9 3
      src/pages/Home/index.tsx
  8. 74 242
      src/pages/Home/style.less
  9. 11 3
      src/pages/baseSetting/accountingAccountSet/accountingSubMap/index.tsx
  10. 2 2
      src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/index.tsx
  11. 2 2
      src/pages/baseSetting/costAllocationSet/allocationLevelSet/index.tsx
  12. 15 3
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/editTableModal.tsx
  13. 8 3
      src/pages/baseSetting/costAllocationSet/allocationParamsMap/index.tsx
  14. 6 3
      src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/index.tsx
  15. 2 2
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/index.tsx
  16. 164 53
      src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/transform.tsx
  17. 2 2
      src/pages/baseSetting/costAllocationSet/idleCostSetting/index.tsx
  18. 2 2
      src/pages/baseSetting/costAllocationSet/revenueImputationSet/index.tsx
  19. 24 10
      src/pages/baseSetting/otherItemSet/departmentCostCalc/index.tsx
  20. 24 1
      src/pages/baseSetting/otherItemSet/departmentCostCalc/style.less
  21. 2 2
      src/pages/baseSetting/otherItemSet/reportItemSet/index.tsx
  22. 2 2
      src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/index.tsx
  23. 2 2
      src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index.tsx
  24. 0 2
      src/pages/costAccounting/calcPageTemplate/columns.tsx
  25. 8 7
      src/pages/costAccounting/calcPageTemplate/index.tsx
  26. 2 2
      src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx
  27. 2 2
      src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx
  28. 2 2
      src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx
  29. 2 1
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx
  30. 3 1
      src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/style.less
  31. 2 2
      src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/index.tsx
  32. 2 2
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index.tsx
  33. 2 2
      src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/index.tsx
  34. 2 2
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index.tsx
  35. 3 2
      src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/style.less
  36. 2 2
      src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/index.tsx
  37. 2 2
      src/pages/costLibraryManagement/projectCostManagement/projectCostShareSet/index.tsx
  38. 2 2
      src/pages/costLibraryManagement/projectCostManagement/projectShareParamsSet/index.tsx
  39. 2 2
      src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/index.tsx
  40. 2 2
      src/pages/costLibraryManagement/reportMana/reportColumnMana/index.tsx
  41. 1 1
      src/pages/costLibraryManagement/reportMana/reportListMana/index.tsx
  42. 2 2
      src/pages/costLibraryManagement/reportMana/reportNavSet/index.tsx
  43. 8 5
      src/pages/incomeCollectionAction/index.tsx
  44. 8 3
      src/pages/monthlyInfoCollection/components/leftAndRighrStructure.tsx
  45. 65 44
      src/pages/monthlyInfoCollection/index.tsx
  46. 3 3
      src/pages/monthlyInfoSearch/patientInfoImport/index.tsx
  47. 1 1
      src/pages/monthlyInfoSearch/patientInfoImport/style.less
  48. 2 2
      src/pages/noAccess/index.tsx
  49. 10 9
      src/pages/reportExport/report/index.tsx
  50. 19 16
      src/pages/specialDataImport/index.tsx
  51. BIN
      static/indexBg.png
  52. BIN
      static/indexBgCenter.png

BIN
.DS_Store


+ 3 - 44
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-17 15:38:48
+ * @LastEditTime: 2024-08-23 11:20:10
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -75,8 +75,9 @@ export default defineConfig({
   routes: [
     {
       path: '/',
-      redirect: '/baseSetting/otherItemSet',
+      redirect: '/home',
     },
+    { path: '*', component: '@/pages/404' },
     {
       path: '/noAccess',
       component: './noAccess',
@@ -97,13 +98,11 @@ export default defineConfig({
               path: '/baseSetting/responsibilityCenterSet/responsibilityCenter',
               name: '责任中心管理',
               component: './baseSetting/responsibilityCenterSet/responsibilityCenter/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/responsibilityCenterSet/responsibilityCenterConnect',
               name: '责任中心对应',
               component: './baseSetting/responsibilityCenterSet/responsibilityCenterConnect/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -115,25 +114,21 @@ export default defineConfig({
               path: '/baseSetting/accountingAccountSet/costIncomeProjectMana',
               name: '会计收入项目管理',
               component: './baseSetting/accountingAccountSet/costIncomeProjectMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/accountingAccountSet/accountingSubMana',
               name: '会计科目管理',
               component: './baseSetting/accountingAccountSet/accountingSubMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/accountingAccountSet/accountingSubMap',
               name: '会计科目对应',
               component: './baseSetting/accountingAccountSet/accountingSubMap/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/accountingAccountSet/chargeItemMap',
               name: '收费项目对应',
               component: './baseSetting/accountingAccountSet/chargeItemMap/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -146,37 +141,31 @@ export default defineConfig({
               path: '/baseSetting/costAllocationSet/allocationLevelSet',
               name: '分摊层级设置',
               component: './baseSetting/costAllocationSet/allocationLevelSet/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/costAllocationSet/idleCostSetting',
               name: '闲置成本设置',
               component: './baseSetting/costAllocationSet/idleCostSetting/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/costAllocationSet/costAllocationParamsSet',
               name: '成本分摊参数设置',
               component: './baseSetting/costAllocationSet/costAllocationParamsSet/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/costAllocationSet/costAllocationParamsDeal',
               name: '成本分摊参数处理',
               component: './baseSetting/costAllocationSet/costAllocationParamsDeal/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/costAllocationSet/allocationParamsMap',
               name: '分摊参数对应',
               component: './baseSetting/costAllocationSet/allocationParamsMap/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/costAllocationSet/revenueImputationSet',
               name: '收入归集设置',
               component: './baseSetting/costAllocationSet/revenueImputationSet/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -189,31 +178,26 @@ export default defineConfig({
               path: '/baseSetting/otherItemSet/diySqlMana',
               name: '自定义SQl管理',
               component: './baseSetting/otherItemSet/diySqlMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/otherItemSet/reportItemSet',
               name: '报表项目设置',
               component: './baseSetting/otherItemSet/reportItemSet/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/otherItemSet/departmentCostCalc',
               name: '科室损益计算',
               component: './baseSetting/otherItemSet/departmentCostCalc/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/otherItemSet/visitsAndBedDayCostSetting',
               name: '诊次/床日成本设置',
               component: './baseSetting/otherItemSet/visitsAndBedDayCostSetting/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/baseSetting/otherItemSet/wholeHospCostAndIncomeSet',
               name: '全院其他收支设置',
               component: './baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -223,19 +207,16 @@ export default defineConfig({
       path:'/monthlyInfoCollection',
       name: '月度信息采集2',
       component:'./monthlyInfoCollection/index',
-      wrappers: ['@/authWrapper'],
     },
     {
       path:'/specialDataImport',
       name: '填报数据导入',
       component:'./specialDataImport/index',
-      wrappers: ['@/authWrapper'],
     },
     {
       path:'/incomeCollectionAction',
       name: '收入归集',
       component:'./incomeCollectionAction/index',
-      wrappers: ['@/authWrapper'],
     },
     {
       path: '/monthlyInfoSearch',
@@ -245,31 +226,26 @@ export default defineConfig({
           path: '/monthlyInfoSearch/wholeHospIncomeAndCost',
           name: '全院其他收支',
           component: './monthlyInfoSearch/wholeHospIncomeAndCost/index',
-          wrappers: ['@/authWrapper'],
         },
         {
           path: '/monthlyInfoSearch/empCostDataImport',
           name: '人事成本数据导入',
           component: './monthlyInfoSearch/empCostDataImport/index',
-          wrappers: ['@/authWrapper'],
         },
         {
           path: '/monthlyInfoSearch/patientChargeItemsImport',
           name: '患者收费项目导入',
           component: './monthlyInfoSearch/patientChargeItemsImport/index',
-          wrappers: ['@/authWrapper'],
         },
         {
           path: '/monthlyInfoSearch/patientInfoImport',
           name: '患者信息导入',
           component: './monthlyInfoSearch/patientInfoImport/index',
-          wrappers: ['@/authWrapper'],
         },
         {
           path: '/monthlyInfoSearch/incomeCostDataImport',
           name: '收入成本数据导入',
           component: './monthlyInfoSearch/incomeCostDataImport/index',
-          wrappers: ['@/authWrapper'],
         },
       ],
     },
@@ -280,7 +256,6 @@ export default defineConfig({
         {
           path: '/costAccounting/:calcPageKey',
           component: './costAccounting/calcPageTemplate/index',
-          wrappers: ['@/authWrapper'],
         }
       ],
     },
@@ -294,7 +269,6 @@ export default defineConfig({
             {
               path: '/reportExport/:reportType/:reportCode',
               component: './reportExport/report',
-              wrappers: ['@/authWrapper'],
             },
           ]
         }
@@ -320,31 +294,26 @@ export default defineConfig({
               path: '/costLibraryManagement/basicCostManagement/personnelClassificationMana',
               name: '人事分类管理',
               component: './costLibraryManagement/basicCostManagement/personnelClassificationMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/basicCostManagement/drugCostManagement',
               name: '药品成本管理',
               component: './costLibraryManagement/basicCostManagement/drugCostManagement/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/basicCostManagement/materialCostManagement',
               name: '材料成本管理',
               component: './costLibraryManagement/basicCostManagement/materialCostManagement/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/basicCostManagement/equipmentCostManagement',
               name: '设备成本管理',
               component: './costLibraryManagement/basicCostManagement/equipmentCostManagement/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/basicCostManagement/spaceCostManagement',
               name: '空间成本管理',
               component: './costLibraryManagement/basicCostManagement/spaceCostManagement/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -356,25 +325,21 @@ export default defineConfig({
               path: '/costLibraryManagement/projectCostManagement/chargeItemsMana',
               name: '收费项目管理',
               component: './costLibraryManagement/projectCostManagement/chargeItemsMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/projectCostManagement/standardProjectMana',
               name: '标准项目管理',
               component: './costLibraryManagement/projectCostManagement/standardProjectMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/projectCostManagement/projectShareParamsSet',
               name: '项目分摊参数设置',
               component: './costLibraryManagement/projectCostManagement/projectShareParamsSet/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/projectCostManagement/projectCostShareSet',
               name: '项目成本分摊设置',
               component: './costLibraryManagement/projectCostManagement/projectCostShareSet/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -386,7 +351,6 @@ export default defineConfig({
               path: '/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana',
               name: '收费项目管理',
               component: './costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -398,13 +362,11 @@ export default defineConfig({
               path: '/costLibraryManagement/diseaseCostManagement/diseaseMana',
               name: '病种管理',
               component: './costLibraryManagement/diseaseCostManagement/diseaseMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison',
               name: '病种诊断对照',
               component: './costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index',
-              wrappers: ['@/authWrapper'],
             },
           ],
         },
@@ -423,18 +385,15 @@ export default defineConfig({
               path: '/costLibraryManagement/reportMana/reportColumnMana',
               name: '报表列管理',
               component: './costLibraryManagement/reportMana/reportColumnMana/index',
-              wrappers: ['@/authWrapper'],
             },
             {
               path: '/costLibraryManagement/reportMana/reportListMana',
               name: '报表管理',
-              wrappers: ['@/authWrapper'],
               component: './costLibraryManagement/reportMana/reportListMana/index',
             },
             {
               path: '/costLibraryManagement/reportMana/reportNavSet',
               name: '报表跳转',
-              wrappers: ['@/authWrapper'],
               component: './costLibraryManagement/reportMana/reportNavSet/index',
             },
           ],

+ 88 - 281
src/app.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-11 16:15:45
+ * @LastEditTime: 2024-08-23 15:29:07
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -28,13 +28,38 @@ import DevicePixelRatio from './utils/devicePixelRatio.js';
 
 import Icon, { createFromIconfontCN, FolderOutlined } from '@ant-design/icons';
 import { getPlatformMenu } from '@/services/auth';
-import { Key, useEffect, useState } from 'react';
+import { JSXElementConstructor, Key, ReactElement, ReactFragment, ReactPortal, useEffect, useRef, useState } from 'react';
 
 
 import './utils/zhongtaiC'
 import { RuntimeAntdConfig } from '@umijs/max';
 import { useLocation } from '@umijs/max';
 import ResizableContainer from './components/ResizableContainer/index';
+import { IRoute } from '@umijs/max';
+
+
+// 权限检查函数
+function checkAccess(menu: IRoute[], pathname: string): boolean {
+  for (const item of menu) {
+    if (item.path === pathname) {
+      return true;
+    }
+    if (item.children) {
+      const hasAccess = checkAccess(item.children, pathname);
+      if (hasAccess) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+function removePrefix(input: string, prefix: string): string {
+  if (input.startsWith(prefix)) {
+    return input.slice(prefix.length);
+  }
+  return input;
+}
 
 
 const IconFont = createFromIconfontCN({
@@ -127,12 +152,12 @@ const findItemByKey: any = (tree: any[], key: string, keyName: string) => {
 
 
 export async function getInitialState(): Promise<{
-  isCollapsed: boolean, spacicalPageParamsType?: any[], userData: UserData, memuData: any[]
+  isCollapsed: boolean, spacicalPageParamsType?: any[], userData: UserData, memuData: any[], computeDate: string
 }> {
 
   new DevicePixelRatio().init();
 
-  return { isCollapsed: false, spacicalPageParamsType: [], userData: {}, memuData: [] };
+  return { isCollapsed: false, spacicalPageParamsType: [], userData: {}, memuData: [], computeDate: `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}` };
 }
 
 export const request: RequestConfig = {
@@ -209,12 +234,12 @@ export const request: RequestConfig = {
 
             } else {
               notification.error({
-                top:72,
+                top: 72,
                 message: '提示',
                 description: errorMessage || msg,
                 placement: 'topRight',
-                icon:<IconFont type="icon-jinggaotishi"  />,
-                style:{padding:16,borderRadius:8}
+                icon: <IconFont type="icon-jinggaotishi" />,
+                style: { padding: 16, borderRadius: 8 }
               })
               return false
             }
@@ -229,12 +254,12 @@ export const request: RequestConfig = {
               } else {
 
                 notification.error({
-                  top:72,
+                  top: 72,
                   message: '提示',
                   description: errorMessage || msg,
                   placement: 'topRight',
-                  icon:<IconFont type="icon-jinggaotishi"  />,
-                  style:{padding:16,borderRadius:8}
+                  icon: <IconFont type="icon-jinggaotishi" />,
+                  style: { padding: 16, borderRadius: 8 }
                 })
                 return false;
               }
@@ -360,199 +385,50 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
 
   const location = useLocation();
   const currentPath = location.pathname;
+  const isMenuClickRef = useRef(false);
 
   const onCollapse = (isCollapsed: boolean): void => {
     setInitialState({ ...initialState, isCollapsed }).then();
   };
 
-
-  useEffect(() => {
-
-    function findMenuItemByPath(menu: any, path: string) {
-      let result: any = null;
-
-      // 递归搜索函数
-      function search(items: any) {
-        for (let item of items) {
-          if (item.path === path) {
-            result = item;
-            return; // 找到匹配项,提前终止搜索
-          }
-          if (item.children && item.children.length > 0) {
-            search(item.children); // 递归搜索子菜单
-            if (result) return; // 如果在子菜单中找到匹配项,提前终止搜索
-          }
-        }
-      }
-
-      search(menu); // 从顶层菜单开始搜索
-      return result;
+  const checkPermission = (path: string) => {
+    const { memuData = [] } = initialState || {};  
+    // 检查是否为无访问权限页面
+    if (path === '/noAccess') {
+      return true;
     }
-
-    // const matchedItem = findMenuItemByPath(menuData, currentPath);
-    // if (matchedItem) {
-
-    //   set_selectedKeys([matchedItem.key]);
-    // }
-
-  }, [currentPath])
+  
+    // 检查访问权限
+    const hasAccess = checkAccess([...memuData], path);
+  
+    return hasAccess;
+  };
+  
+  
+
+
+  // useEffect(() => {
+  //   return history.listen((location: any) => {
+  //     if (!isMenuClickRef.current) {
+  //       const path = removePrefix(location.location.pathname, '/CostAccountingSys');
+  //       const hasPermission = checkPermission(path);
+  //       console.log({ hasPermission, path });
+  
+  //       // 如果hasPermission为true,确保不会跳转到/noAccess
+  //       if (!hasPermission && path !== '/noAccess') {
+  //         history.push('/noAccess');
+  //       }
+  //     }
+  //     isMenuClickRef.current = false; // 重置状态
+  //   });
+  // }, [initialState]);
+  
+  
 
 
   return {
     menuHeaderRender: false,
-    // token: {
-    //   sider: {
-
-    //     colorMenuBackground: '#fff',
-    //     colorTextMenuActive: '#3376FE',
-    //     colorTextMenuSelected: '#3376FE',
-    //     colorTextMenuTitle: '#17181A',
-    //     colorTextMenu: '#17181A',
-    //     //colorBgMenuItemHover:'##f0f2f5',
-    //     colorBgMenuItemSelected: '#F2F6FF',
-
-    //     // colorBgMenuItemCollapsedHover:'#f0f2f5',
-    //     // //colorBgMenuItemCollapsedSelected:'blue'
-
-    //   }
-
-    // },
-
     disableMobile: true,
-    // menuProps: {
-    //   openKeys: [...openKeys],
-    //   selectedKeys: [...selectedKeys],
-    //   onSelect: ({ selectedKeys }: { selectedKeys: string[] }) => {
-    //     set_selectedKeys(selectedKeys);
-    //     localStorage.setItem('selectedKeys', JSON.stringify(selectedKeys));
-    //   },
-    //   onOpenChange: (keys: string[]) => {
-    //     set_openKeys([...keys]);
-    //     localStorage.setItem('openKeys', JSON.stringify(keys));
-    //   },
-    // },
-    menu: {
-      locale: false,
-      // request: async () => {
-      //   const userData = localStorage.getItem('userData');
-      //   const currentSelectedTab = localStorage.getItem('currentSelectedTab');
-      //   if (currentSelectedTab) {
-      //     const { menuId } = JSON.parse(currentSelectedTab);
-      //     const systemId = menuId;
-      //     const data: any[] = await getPlatformMenu(systemId);
-      //     if (data) {
-
-      //       const selectedKeys = localStorage.getItem('selectedKeys');
-      //       const openKeys = localStorage.getItem('openKeys');
-      //       set_menuData(data);
-      //       if (selectedKeys && openKeys) {
-      //         const _selectedKeys = JSON.parse(selectedKeys);
-      //         const _openKeys = JSON.parse(openKeys);
-      //         set_openKeys(_openKeys);
-      //         set_selectedKeys(_selectedKeys);
-      //       } else {
-      //         if (data[0].children && data[0].children.length > 0) {
-
-      //           const childs = data[0].children;
-      //           set_openKeys([data[0].key]);
-      //           set_selectedKeys([childs[0].key]);
-      //           localStorage.setItem('openKeys', JSON.stringify([data[0].key]));
-      //           localStorage.setItem('selectedKeys', JSON.stringify([childs[0].key]));
-      //           history.push(`${childs[0].path}`);
-
-      //         } else {
-      //           if (data[0]) {
-      //             set_openKeys([data[0].key]);
-      //             set_selectedKeys([data[0].key]);
-      //             localStorage.setItem('openKeys', JSON.stringify([data[0].key]));
-      //             localStorage.setItem('selectedKeys', JSON.stringify([data[0].key]));
-      //             history.push(`${data[0].path}`);
-      //           }
-      //         }
-      //       }
-
-
-      //       function processMenuItem(item: any) {
-      //         if (!item) return null;
-
-      //         let newItem = { ...item };  // 深拷贝当前节点
-
-      //         // 如果是叶子节点
-      //         if (!item.children || item.children.length === 0) {
-      //           let queryParams = [];
-
-      //           if (newItem.softUrl) {
-      //             queryParams.push(`softUrl=${newItem.softUrl}`);
-      //           }
-
-      //           if (newItem.youshuUrl) {
-      //             queryParams.push(`youshuUrl=${newItem.youshuUrl}`);
-      //           }
-
-      //           if (queryParams.length > 0) {
-      //             newItem.path = `${newItem.path}?${queryParams.join('&')}`;
-      //           }
-
-      //           return newItem; // 返回新的叶子节点
-      //         }
-
-      //         // 否则,递归处理子节点
-      //         newItem.children = newItem.children.map(processMenuItem);
-      //         return newItem;
-      //       }
-
-      //       function processMenu(menuArray: any[]) {
-      //         if (!menuArray) return [];
-      //         return menuArray.map(processMenuItem);
-      //       }
-
-      //       const _menu = processMenu(data);
-
-      //       setInitialState((t: any) => ({ ...t, spacicalPageParamsType: _menu, memuData: data, userData: JSON.parse(userData as string) }));
-
-
-      //       function addIconToPath(node: any, paths: string[]) {
-      //         if (paths.includes(node.path)) {
-      //           if (node.path == '/home') {
-      //             node.icon = <Icon component={imgNode}  />;
-      //           }
-      //           if (node.path == '/baseSetting') {
-
-      //             node.icon = <Icon component={setting} />;
-      //           }
-      //           if (node.path == '/monthlyInfoSearch') {
-      //             node.icon = <Icon component={()=><IconFont type='icon-yueduxinxicaiji' />} />;
-      //           }
-      //           if (node.path == '/costAccounting') {
-      //             node.icon = <Icon component={()=><IconFont type='icon-jixiaoguanli' />} />;
-      //           }
-      //           if (node.path == '/reportExport') {
-      //             node.icon = <Icon component={()=><IconFont type='icon-jixiaoguanli' />} />;
-      //           }
-      //           if (node.path == '/costLibraryManagement') {
-      //             node.icon = <Icon component={()=><IconFont type='icon-chengbenkuguanli' />} />;
-      //           }
-      //           if (node.path == '/static') {
-      //             node.icon = <Icon component={()=><IconFont type='icon-baobiaochaxun' />} />;
-      //           }
-      //         }
-      //         if (node.children) {
-      //           node.children.forEach((child: any) => addIconToPath(child, paths));
-      //         }
-      //       }
-
-      //       _menu.forEach((item: any) => {
-      //         addIconToPath(item, ['/home', '/baseInfoMana', '/costAccounting','/monthlyInfoSearch','/static','/reportExport','/costLibraryManagement','/baseSetting']);
-      //       });
-
-
-
-      //       return _menu
-      //     }
-      //   }
-
-      // },
-    },
     onPageChange: () => { },
     collapsedButtonRender: () => {
       return (
@@ -567,35 +443,22 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
         }><IconFont className='menuCollapseIcon' type={isCollapsed ? 'icon-celanzhankai' : 'icon-celanshouqi'} /></div>
       )
     },
-    // collapsed: isCollapsed,
+    collapsed: isCollapsed,
     // fixSiderbar:false,
-    menuRender: (props: any) => {
-
-
-      const { location } = props;
-      const [menu, set_menu] = useState<any[]>([]);
-
-      const [slectedKey, set_slectedKey] = useState<string[]>([]);
-      const [openKeys, set_openKeys] = useState<string[]>([]);
-
-      // const currentSelectedItem = findItemByKey(menuData,location.pathname,'path');
-
-      const menuClickHandle = (info: any) => {
-        const foundItem = findItemByKey(menu, info.key, 'key');
-        // console.log({foundItem,info});
-        if (foundItem) {
-          set_slectedKey([`${info.key}`]);
-          history.push(foundItem.path);
-
-        }
-
-      }
-
-      const onOpenChangeHandle = (openKeys: string[]) => {
-        set_openKeys(openKeys);
-      }
-
-      const getMenu = async () => {
+    menuItemRender:(item: { path: any; }, dom: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | null | undefined) => {
+      return (
+        <a
+          onClick={() => {
+            isMenuClickRef.current = true; // 标记为菜单点击
+            history.push(`${item.path}`);
+          }}
+        >
+          {dom}
+        </a>
+      );
+    },
+    menu:{
+      request:async ()=>{
         const userData = localStorage.getItem('userData');
         const currentSelectedTab = localStorage.getItem('currentSelectedTab');
         if (currentSelectedTab) {
@@ -603,37 +466,6 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
           const systemId = menuId;
           const data: any[] = await getPlatformMenu(systemId);
           if (data) {
-
-            const selectedKeys = localStorage.getItem('selectedKeys');
-            const openKeys = localStorage.getItem('openKeys');
-      
-            if (selectedKeys && openKeys) {
-              const _selectedKeys = JSON.parse(selectedKeys);
-              const _openKeys = JSON.parse(openKeys);
-              set_openKeys(_openKeys);
-              set_slectedKey(_selectedKeys);
-            } else {
-              if (data[0].children && data[0].children.length > 0) {
-
-                const childs = data[0].children;
-                set_openKeys([data[0].key]);
-                set_slectedKey([childs[0].key]);
-                localStorage.setItem('openKeys', JSON.stringify([data[0].key]));
-                localStorage.setItem('selectedKeys', JSON.stringify([childs[0].key]));
-                history.push(`${childs[0].path}`);
-
-              } else {
-                if (data[0]) {
-                  set_openKeys([data[0].key]);
-                  set_slectedKey([data[0].key]);
-                  localStorage.setItem('openKeys', JSON.stringify([data[0].key]));
-                  localStorage.setItem('selectedKeys', JSON.stringify([data[0].key]));
-                  history.push(`${data[0].path}`);
-                }
-              }
-            }
-
-
             function processMenuItem(item: any) {
               if (!item) return null;
 
@@ -708,44 +540,19 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
             });
 
             const { newTree, firstLeafNode, firstLeafNodePath } = transformTree(_menu);
-            // set_openKeys(firstLeafNodePath.map(a => `${a.key}`));
-            // set_slectedKey([`${firstLeafNode.key}`]);
-            set_menu(newTree);
+            return newTree
 
           }
         }
       }
-
-      useEffect(() => {
-
-        const foundItem = findItemByKey(menu, location.pathname, 'path');
-
-        if (foundItem) {
-          set_slectedKey(foundItem.key);
-
-        }
-
-      }, [menu]);
-
-      useEffect(() => {
-        getMenu();
-      }, [])
+    },
+    menuRender: (props: any, defaultDom: any) => {
 
       return (
-        <ResizableContainer width={isCollapsed ? 64 : 200} minWidth={0} maxWidth={600} height={'calc(100vh - 58px)'}>
+        <ResizableContainer width={isCollapsed ? 64 : 200} minWidth={0} maxWidth={600} height={'calc(100vh - 47px)'}>
           <div style={{ height: '100%', background: '#fff', position: 'relative' }}>
             <div className='menuWrapper' style={{ height: 'calc(100% - 40px)', overflowY: 'scroll', overflowX: 'hidden' }}>
-              <Menu
-
-                onClick={menuClickHandle}
-                onOpenChange={onOpenChangeHandle}
-                style={{ width: '100%' }}
-                openKeys={openKeys}
-                selectedKeys={slectedKey}
-                mode="inline"
-                items={menu}
-                inlineCollapsed={isCollapsed}
-              />
+              {defaultDom}
             </div>
 
             <div style={{

+ 18 - 18
src/authWrapper.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-07-17 10:36:43
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-18 16:44:36
+ * @LastEditTime: 2024-07-26 17:14:07
  * @FilePath: /BudgetManaSystem/src/authWrapper.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -14,25 +14,25 @@ import { Outlet } from '@umijs/max';
 
 // 权限检查函数
 function checkAccess(menu: IRoute[], pathname: string): boolean {
-    for (const item of menu) {
-      if (item.path === pathname) {
+  for (const item of menu) {
+    if (item.path === pathname) {
+      return true;
+    }
+    if (item.children) {
+      const hasAccess = checkAccess(item.children, pathname);
+      if (hasAccess) {
         return true;
       }
-      if (item.children) {
-        const hasAccess = checkAccess(item.children, pathname);
-        if (hasAccess) {
-          return true;
-        }
-      }
     }
-    return false;
+  }
+  return false;
 }
 
 function removePrefix(input: string, prefix: string): string {
-    if (input.startsWith(prefix)) {
-        return input.slice(prefix.length);
-    }
-    return input;
+  if (input.startsWith(prefix)) {
+    return input.slice(prefix.length);
+  }
+  return input;
 }
 
 // 权限包装组件
@@ -45,17 +45,17 @@ const AuthWrapper: React.FC = (props) => {
     if (!dataLoaded) {
       const menu = initialState?.memuData ?? [];
       if (menu.length > 0) {
-          setDataLoaded(true);
-          const { pathname } = history.location;
+        setDataLoaded(true);
+        const { pathname } = history.location;
         const hasAccess = checkAccess(menu, removePrefix(pathname, '/CostAccountingSys'));
-      //   console.log({ hasAccess, menu, pathname });
+        // console.log({ hasAccess, menu, pathname });
         if (!hasAccess) {
           history.push('/noAccess');
         }
         setLoading(false);
       }
     }
-  }, [initialState,dataLoaded]);
+  }, [initialState, dataLoaded]);
 
   return loading ? <>loading...</> : <Outlet />;
 };

+ 12 - 1
src/global.less

@@ -403,8 +403,13 @@ textarea {
 }
 
 
-
+.cost-ant-menu-submenu {
+    &.cost-ant-menu-submenu-selected {
+        color: #3376FE !important; 
+    }
+}
 .cost-ant-menu-item-selected {
+    color: #3376FE !important; 
     background-color:#F2F6FF !important;
     // margin:8px !important;
     &:hover {
@@ -675,6 +680,12 @@ textarea {
     }
 }
 
+.cost-ant-layout-sider {
+    max-width: 100% !important;
+    min-width: unset !important;
+    width: 100% !important; 
+}
+
 .cost-ant-pro .cost-ant-pro-layout .cost-ant-pro-sider .cost-ant-layout-sider-children {
     padding-inline: 0 !important;
     &>div {

+ 25 - 0
src/pages/404.tsx

@@ -0,0 +1,25 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2024-07-19 15:01:35
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2024-08-23 11:20:28
+ * @FilePath: /CostAccountingSys/src/pages/404.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+import React from 'react';
+import { Button } from 'antd';
+import { history } from 'umi';
+
+const NotFoundPage: React.FC = () => {
+  return (
+    <div style={{ textAlign: 'center', marginTop: 50 }}>
+      <h1>404 - 页面未找到</h1>
+      <p>抱歉,您访问的页面不存在。</p>
+      <Button type="primary" onClick={() => history.push('/')}>
+        返回首页
+      </Button>
+    </div>
+  );
+};
+
+export default NotFoundPage;

+ 9 - 3
src/pages/Home/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-09-26 15:36:15
+ * @LastEditTime: 2024-08-02 10:43:28
  * @FilePath: /BudgetManaSystem/src/pages/Home/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 
@@ -20,8 +20,14 @@ const HomePage: React.FC = () => {
 
 
   return (
-    <KCIMPagecontainer className='HomePage'  ghost>
-        HomePage
+    <KCIMPagecontainer title={false} ghost>
+      <div className='HomePage'>
+        <div className='title'>全成本核算系统</div>
+        <div className='titleSub'>以促进医院内部经济、经营管理向正规化的轨道转变,建立规范以及完整的成本管理决策体系,将管理重点转移到经济管理上来,并透过完善的信息化建设,实现对成本管理的支撑。纠正医院的成本管控理念及应用错误,改变现行的“四类三级”成本核算方法。实现医院科室成本核算,支持医院床位动态管理,支持科室实施主诊医师负责制;实现科室真实盈亏计算及盈亏平衡分析,指导科室经营;实现利润敏感性分析,使用国际先进的管理会计理论用以医院经营管理决策。</div>
+        <div className='banner'>
+          <img src={require('../../../static/indexBgCenter.png')} alt="" />
+        </div>
+      </div>
     </KCIMPagecontainer>
   );
 };

+ 74 - 242
src/pages/Home/style.less

@@ -1,262 +1,94 @@
 .HomePage {
+  display: flex;
+  flex-direction: column;
+  height: calc(100vh - 80px);
   padding: 16px;
-  height: 100%;
-  padding-bottom: 36px;
-  background: #fff;
-  overflow-y: scroll;
-  .tabWrap {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    background: #F7F9FC;
-    border-radius: 4px;
-    padding: 16px 28px;
-    margin-top: 16px;
-
-    .tab {
-      position: relative;
-      display: flex;
-      flex-direction: column;
-      justify-content: center;
-      align-items: center;
-      width: 88px;
-      height: 88px;
-      cursor: pointer;
-
-      .index {
-        position: relative;
-        width: 32px;
-        height: 32px;
-        border-radius: 8px;
-        text-align: center;
-        line-height: 32px;
-        font-size: 16px;
-        font-family: Roboto-Bold, Roboto;
-        font-weight: bold;
-        color: #FFF;
-        margin-bottom: 16px;
-        background: #CFD6E6;
-
-        .point {
-          position: absolute;
-          width: 8px;
-          height: 8px;
-          top: -2px;
-          right: -2px;
-          background: #FFC34D;
-          border-radius: 2px;
-          border: 2px solid #FFF;
-        }
-
-        &.active {
-          background: #37F;
-        }
-
-      }
-
-      .name {
-        font-size: 12px;
-        font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-        font-weight: 500;
-        color: #7A8599;
-      }
-
-
-      // &::after {
-      //   right: -79%;
-      //   top: -1px;
-      //   position: absolute;
-      //   display: block;
-      //   content: '...';
-      //   font-size: 33px;
-      //   color: #DAE2F2;
-      // }
-
-
-      &.on {
-        background: #FAFCFF;
-        border-radius: 8px;
-        border: 1px solid #DAE2F2;
-      }
-
-      &.active {
-        &::after {
-          color: #37F;
-        }
-      }
-
-      &:last-child {
-        &::after {
-          display: none;
-        }
-      }
+  background: #FFFFFF;
+  border-radius: 4px;
+  .title {
+    height: 24px;
+    font-weight: bold;
+    font-size: 24px;
+    color: #17181A;
+    line-height: 24px;
+    margin-bottom: 12px;
+    padding-left: 8px;
+    margin-top: 8px;
+  }
+  .titleSub {
+    font-weight: 400;
+    font-size: 14px;
+    color: #525866;
+    line-height: 20px;
+    margin-bottom: 12px;
+    padding: 0 8px;
+  }
 
+  .banner {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 100%;
+    flex-grow: 1;
+    min-height: 440px;
+    // height:calc(100% - 110px);
+    background: url('../../../static/indexBg.png');
+    background-size: cover !important;
+    overflow: hidden;
+    background-repeat: no-repeat !important;
 
+    &>img {
+      width: 810px;
+      transition: all 0.3s linear;
     }
+  }
 
-    .point {
-      position: relative;
-      top: -7px;
-      // right:-22.5px;
-      font-size: 33px;
-      color: #DAE2F2;
-
+  /* 当屏幕宽度小于或等于 600px */
+  @media screen and (max-width: 1250px) {
+    .banner>img {
+      width: 600px;
     }
   }
 
-  .tabRelaContent {
-    margin-top: 24px;
-    min-height: 80px;
-
-    .step {
-      padding: 0 8px;
-      cursor: pointer;
-
-      .title {
-        display: flex;
-        flex-direction: row;
-        justify-content: flex-start;
-        align-items: center;
-        height: 17px;
-        font-size: 16px;
-        cursor: pointer;
-        font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-        font-weight: 500;
-        color: #17181A;
-        line-height: 17px;
-        margin-bottom: 10px;
-
-
-        &>span {
-          display: inline-block;
-          font-size: 14px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          cursor: pointer;
-          margin-left: 8px;
-        }
-
-
-      }
-
-      .detail {
-        height: 42px;
-        font-size: 14px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #525866;
-        line-height: 21px;
-        word-break: break-all;
-        text-overflow: ellipsis;
-        display: box;
-        -webkit-box-orient: vertical;
-        -webkit-line-clamp: 2;
-
-        /* 这里是超出几行省略 */
-        overflow: hidden;
-        
-      }
-
-      &.active {
-          &:hover {
-            .title { 
-              color: rgb(51 119 255 / 100%);
-
-              &>span {
-                color: rgb(51 119 255 / 100%);
-              }
-            }
-          }
-      
-      }
+  /* 当屏幕宽度小于或等于 600px */
+  @media screen and (min-width: 1250px) and (max-width: 1360px) {
+    .banner>img {
+      width: 700px;
     }
+  }
 
-    .multiStep {
-      display: flex;
-      flex-direction: row;
-      justify-content: space-between;
-      align-items: flex-start;
-      padding: 0 8px;
-
-      .block {
-        width: 28%;
-        cursor: pointer;
-
-        .title {
-          cursor: pointer;
-          display: flex;
-          flex-direction: row;
-          justify-content: flex-start;
-          align-items: center;
-          height: 17px;
-          font-size: 16px;
-          font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-          font-weight: 500;
-          color: #17181A;
-          line-height: 17px;
-          margin-bottom: 10px;
-
-          &>span {
-            display: inline-block;
-            font-size: 14px;
-            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-            font-weight: 400;
-            cursor: pointer;
-            margin-left: 8px;
-          }
-
-
-        }
-
-        .detail {
-          font-size: 14px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          color: #525866;
-          line-height: 21px;
-          word-break: break-all;
-          text-overflow: ellipsis;
-          display: box;
-          -webkit-box-orient: vertical;
-          -webkit-line-clamp: 2;
-          
-          /* 这里是超出几行省略 */
-          overflow: hidden;
-
-        }
+  /* 当屏幕宽度在 601px 到 900px */
+  @media screen and (min-width: 1360px) and (max-width: 1500px) {
+    .banner>img {
+      width: 800px;
+    }
+  }
 
-        &.active {
-          &:hover {
-              .title {
-                color: rgb(51 119 255 / 100%);
-  
-                &>span {
-                  color: rgb(51 119 255 / 100%);
-                }
-              }
-          
-  
-          }
-        }
-      }
+  /* 当屏幕宽度大于 900px */
+  @media screen and (min-width: 1500px) and (max-width: 1760px) {
+    .banner>img {
+      width: 900px;
+    }
+  }
 
-      
+  /* 当屏幕宽度大于 900px */
+  @media screen and (min-width: 1760px) and (max-width: 1920px) {
+    .banner>img {
+      width: 1000px;
     }
   }
 
-  .map {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    // border:1px solid red;
-    background: url('../../../static/shouyechatu.png');
-    // background-size: 50vw 25vw;
-    background-size: 850px 425px;
-    background-repeat: no-repeat;
-    background-position: center;
+  /* 当屏幕宽度大于 900px */
+  @media screen and (min-width: 1960px) and (max-width: 2000px) {
+    .banner>img {
+      width: 1200px;
+    }
+  }
 
-    &>img {
-        
+  /* 当屏幕宽度大于 900px */
+  @media screen and (min-width: 2000px) {
+    .banner>img {
+      width: 1400px;
     }
   }
 }

+ 11 - 3
src/pages/baseSetting/accountingAccountSet/accountingSubMap/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-19 13:27:55
+ * @LastEditTime: 2024-08-19 17:12:32
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -45,6 +45,11 @@ const tableSelectorColumns = [
         width:60,
         dataIndex: 'id',
     },
+    // {
+    //     title: '会计科目编码',
+    //     width:300,
+    //     dataIndex: 'accountingCode',
+    // },
     {
         title: '成本收入项目',
         dataIndex: 'name',
@@ -73,12 +78,14 @@ export default function AccountingSubMap() {
         },
         {
             title: '会计科目编码',
-            width:120,
+            width:300,
+            ellipsis:true,
             dataIndex: 'accountingCode',
         },
         {
             title: '收入项目',
             dataIndex: 'productVOs',
+            ellipsis:true,
             renderText(productVOs, record) {
                 if (Array.isArray(productVOs)) {
                     return productVOs.map((item, index) => { return <Tag key={index}>{item.productName}</Tag> })
@@ -125,6 +132,7 @@ export default function AccountingSubMap() {
         {
             title: '成本项目',
             dataIndex: 'productVOs',
+            ellipsis:true,
             renderText(productVOs, record) {
                 if (Array.isArray(productVOs)) {
                     return productVOs.map((item, index) => { return <Tag key={index}>{item.productName}</Tag> })
@@ -189,7 +197,7 @@ export default function AccountingSubMap() {
 //productCode,productName
     const getTableSelectorData = async () => {
         const {responsibilityId,productVOs = []} = currentRow;
-        const defaultRows = productVOs?productVOs.map((a:any)=>({id:a.id,name:a.productName})):[];
+        const defaultRows = productVOs?productVOs.map((a:any)=>({id:a.id,name:`${a.productName}[${a.productCode}]`})):[];
         const resp = await getAccountProductConnectableList({responsibilityId,pageSize:500,current:1});
         if(resp){
             return [...resp,...defaultRows]

+ 2 - 2
src/pages/baseSetting/accountingAccountSet/costIncomeProjectMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-07 14:52:40
+ * @LastEditTime: 2024-07-29 15:47:04
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -286,7 +286,7 @@ export default function CostIncomeProjectMana() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 235px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/baseSetting/costAllocationSet/allocationLevelSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 13:45:36
+ * @LastEditTime: 2024-08-23 10:27:22
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -303,7 +303,7 @@ export default function AllocationLevelSet() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 15 - 3
src/pages/baseSetting/costAllocationSet/allocationParamsMap/editTableModal.tsx

@@ -50,7 +50,7 @@ const EditTableModal = ({ record, open, title, onVisibleChange, rowKey = 'id', o
                 fieldProps:{
                     showSearch:true,
                     style: {
-                        width: '160px', // 设置你想要的宽度
+                        width: '280px', // 设置你想要的宽度
                     },
                     onSelect:(a: any,b: any,c:any)=>{
                         currentSelectedRow = b;
@@ -59,13 +59,25 @@ const EditTableModal = ({ record, open, title, onVisibleChange, rowKey = 'id', o
             },
             {
                 title: '分摊比例',
+                width:90,
                 dataIndex: 'shareParamPopout',
                 ellipsis:true,
-                valueType:'digit'
+                valueType:'digit',
+                fieldProps:{
+                    style:{
+                        width:'70px'
+                    }
+                }
             }, 
             {
                 title: '操作',
+                width:130,
                 valueType: 'option',
+                fieldProps:{
+                    style:{
+                        gap:'2px !important'
+                    }
+                },
                 render: (text, record, _, action) => [
                   <a
                     key="editable"
@@ -84,7 +96,7 @@ const EditTableModal = ({ record, open, title, onVisibleChange, rowKey = 'id', o
                     删除
                   </a>,
                 ],
-              },
+            },
         ];
 
 

+ 8 - 3
src/pages/baseSetting/costAllocationSet/allocationParamsMap/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 13:43:06
+ * @LastEditTime: 2024-08-12 10:56:07
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -79,6 +79,11 @@ export default function AllocationParamsMap() {
             width:120,
             dataIndex: 'responsibilityName',
         },
+        {
+            title: '分摊参数',
+            ellipsis: true,
+            dataIndex: 'shareParamMap',
+        },
         {
             title: '会计科目名称',
             ellipsis: true,
@@ -432,9 +437,9 @@ export default function AllocationParamsMap() {
                     <UpDataActBtn record type='ADD' />
                 </div>
             </div>
-
+            
             <div>
-                <KCIMTable scroll={{x:2000}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable  scroll={{x:2000,y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 6 - 3
src/pages/baseSetting/costAllocationSet/costAllocationParamsDeal/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-11 11:09:36
+ * @LastEditTime: 2024-07-31 15:01:30
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -154,7 +154,11 @@ export default function CostAllocationParamsDeal(
             key: '2',
             label: (
                 <a onClick={()=>getHandle().then((isok)=>{
-                    if(isok)tableRef.current?.reload();
+   
+                    if(isok){
+                       
+                        tableRef.current?.reload()
+                    };
                 })} style={{ display: ifShowGetBtn ? 'inline-block' : 'none' }}>
                     获取
                 </a>
@@ -250,7 +254,6 @@ export default function CostAllocationParamsDeal(
     };
 
     useEffect(() => {
-        console.log({date,responsibilityCode});
         if (date&&responsibilityCode) {
             set_computeDate(date);
             set_tableDataFilterParams({

+ 2 - 2
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-19 10:35:08
+ * @LastEditTime: 2024-08-23 10:27:55
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -305,7 +305,7 @@ export default function CostAllocationParamsSet() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 164 - 53
src/pages/baseSetting/costAllocationSet/costAllocationParamsSet/transform.tsx

@@ -1,17 +1,85 @@
 import React, { Key, useEffect, useImperativeHandle, useState } from "react";
-import { Transfer } from 'antd'
+import { Transfer } from 'antd';
 import { TransferItem, TransferProps } from 'antd/es/transfer';
-import { ColumnsType } from 'antd/es/table';
 import { difference } from "lodash";
 import { TableRowSelection } from 'antd/es/table/interface';
 import { KCIMTable } from "@/components/KCIMTable";
 import { ProColumns } from "@ant-design/pro-components";
-import { Tabs} from 'antd';
-
-import { log } from "mathjs";
+import { Tabs } from 'antd';
 import { getAccountingSubjectList } from "../../accountingAccountSet/accountingSubMana/service";
 
 
+function flatten(list: any[]) {
+    let result: any[] = [];
+    list.forEach(item => {
+        result.push(item);
+        if (item.children) {
+            result = result.concat(flatten(item.children));
+        }
+    });
+    return result;
+}
+
+
+function getUniqueSubsetsByProperty(treeData: any[], uniqueProperty: string) {
+    const result: any[] = [];
+    const uniqueSet = new Set();
+
+    function traverse(node: { [x: string]: any; children: string | any[]; }, isRoot = true) {
+        if (!node) return;
+
+        // 获取节点的唯一属性值
+        const uniqueValue = node[uniqueProperty];
+
+        // 如果节点是根节点,不添加到结果集,但处理它的子节点
+        if (!isRoot && !uniqueSet.has(uniqueValue)) {
+            result.push(node);
+            uniqueSet.add(uniqueValue);
+        }
+
+        // 递归处理子节点
+        if (node.children && node.children.length > 0) {
+            for (let child of node.children) {
+                traverse(child, false); // 子节点传递 isRoot = false
+            }
+        }
+    }
+
+    for (let rootNode of treeData) {
+        traverse(rootNode);
+    }
+
+    return result;
+}
+
+
+
+function removeSelectedKeys(nodes: any[], keysToRemove: string[]): any[] {
+    const result = nodes
+        .map(node => {
+            // 检查 id 是否存在
+            if (!node || node.id === undefined || node.id === null) {
+                return node; // 或者返回 null, 取决于你的业务逻辑
+            }
+
+            if (keysToRemove.includes(node.id)) {
+                return null;
+            }
+
+            if (node.children) {
+                node.children = removeSelectedKeys(node.children, keysToRemove);
+                if (node.children.length === 0) {
+                    return null;
+                }
+            }
+
+            return node;
+        })
+        .filter(node => node !== null);
+    return result;
+}
+
+
 
 interface TableTransferProps extends TransferProps<TransferItem> {
     leftColumns: ProColumns[];
@@ -22,77 +90,102 @@ interface TableTransferProps extends TransferProps<TransferItem> {
 }
 
 const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, record, onSave, ...restProps }: TableTransferProps, ref) => {
-    
     const [_data, _set_data] = useState<any>();
-    const [targetKeys, setTargetKeys] = useState<string[]>(record.accountingIds?[...((record.accountingIds).map((a:string)=>Number(a)))]:[]);
+    const [targetKeys, setTargetKeys] = useState<string[]>(record.accountingIds ? [...(record.accountingIds.map((a: string) => Number(a)))] : []);
     const [datasource, set_datasource] = useState<any[]>([]);
-    const [selectedKeys, setSelectedKeys] = useState<string[]>(record.accountingIds?[...((record.accountingIds).map((a:string)=>Number(a)))]:[]);
+    const [filteredDataSource, setFilteredDataSource] = useState<any[]>([]);
+    const [selectedKeys, setSelectedKeys] = useState<string[]>(record.accountingIds ? [...(record.accountingIds.map((a: string) => Number(a)))] : []);
     const [accountType, set_accountType] = useState(1);
     const [tabs, set_tabs] = useState<any[]>([]);
 
-
-    //获取列表
     const getFuncList = async () => {
-
-        const resp = await getAccountingSubjectList({ accountType:1, pageSize: 500, current: 1 });
-
+        const resp = await getAccountingSubjectList({ accountType: 1, pageSize: 500, current: 1 });
         if (resp) {
-
             set_datasource(resp.list);
             _set_data(resp.list);
         }
-
-    }
+    };
 
     const onChange = (nextTargetKeys: string[]) => {
         setTargetKeys(nextTargetKeys);
+        const clonedDataSource = JSON.parse(JSON.stringify(datasource));
+        const filteredData = removeSelectedKeys(clonedDataSource, nextTargetKeys);
+        setFilteredDataSource(filteredData);
     };
 
     const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
-        //console.log('sourceSelectedKeys:', sourceSelectedKeys,'targetSelectedKeys:',targetSelectedKeys);
         setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
     };
 
+    useEffect(() => {
+        // 过滤出左侧的待选项数据
+        const clonedDataSource = JSON.parse(JSON.stringify(datasource));
+        const filtered = removeSelectedKeys(clonedDataSource, targetKeys);
+        setFilteredDataSource(filtered);
+    }, [datasource, targetKeys]);
+
     useImperativeHandle(ref, () => ({
         save: async () => {
-            const items = datasource.filter(a => targetKeys.includes(a[`${keyName}`]));
-            onSave(targetKeys, items);
+            const items = flatten(datasource).filter(a => targetKeys.includes(a[`${keyName}`]));
+            onSave(targetKeys,getUniqueSubsetsByProperty(items,`${keyName}`));
         }
     }));
 
-
-    const onTabChanged = (key:string) => {
+    const onTabChanged = (key: string) => {
         set_accountType(Number(key));
-    }
+    };
+
+    const handleTreeItemSelect = (key: string, selected: boolean) => {
+        let newSelectedKeys = [...selectedKeys];
+        
+        const updateSelection = (node: TransferItem, isSelected: boolean) => {
+            const keyIndex = newSelectedKeys.indexOf(node[keyName]);
+            if (isSelected && keyIndex === -1) {
+                newSelectedKeys.push(node[keyName]);
+            } else if (!isSelected && keyIndex > -1) {
+                newSelectedKeys.splice(keyIndex, 1);
+            }
+    
+            if (node.children) {
+                node.children.forEach((child: any) => updateSelection(child, isSelected));
+            }
+        };
+    
+        const node = flatten(datasource).find(item => item[keyName] === key);
+    
+        if (node) {
+            updateSelection(node, selected);
+        }
+    
+        // 确保没有重复项
+        newSelectedKeys = Array.from(new Set(newSelectedKeys));
+        setSelectedKeys(newSelectedKeys);
+    };
+    
+    
+    
 
     useEffect(() => {
         getFuncList();
     }, [accountType]);
 
-    
-
     useEffect(() => {
         set_tabs([
-            {
-                label: '收入',
-                key: 1,
-            },
-            {
-                label: '支出',
-                key: 2,
-            },
-        ])
-    }, [])
+            { label: '收入', key: 1 },
+            { label: '支出', key: 2 },
+        ]);
+    }, []);
 
     return (
         <div>
             <Tabs
                 defaultActiveKey={tabs.length > 0 ? tabs[0].key : undefined}
                 items={tabs}
-                key={'key'}
                 onChange={(key) => onTabChanged(key)}
             />
-            <Transfer className='TableTransfer' showSearch
+            <Transfer
+                className='TableTransfer'
+                showSearch
                 titles={['待选项', '已选项']}
                 locale={{
                     itemUnit: '项',
@@ -102,14 +195,11 @@ const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, re
                 oneWay={false}
                 onChange={onChange}
                 onSelectChange={onSelectChange}
-                dataSource={datasource}
+                dataSource={flatten(datasource)}
                 rowKey={record => record[`${keyName}`]}
                 targetKeys={targetKeys}
                 selectedKeys={selectedKeys}
-                filterOption={(inputValue, item) => {
-                    return item.accountingName!.indexOf(inputValue) !== -1
-
-                }}
+                filterOption={(inputValue, item) => item.accountingName.indexOf(inputValue) !== -1}
             >
                 {({
                     direction,
@@ -119,14 +209,12 @@ const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, re
                     selectedKeys: listSelectedKeys,
                     disabled: listDisabled,
                 }) => {
-
-                    // console.log({ filteredItems, listSelectedKeys,direction });
                     const columns = direction === 'left' ? leftColumns : rightColumns;
 
                     const rowSelection: TableRowSelection<TransferItem> = {
                         getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
                         onSelectAll(selected, selectedRows) {
-                            const treeSelectedKeys = selectedRows.map((a) => a[`${keyName}`]);
+                            const treeSelectedKeys = selectedRows.map(a => a[`${keyName}`]);
                             const diffKeys = selected
                                 ? difference(treeSelectedKeys, listSelectedKeys)
                                 : difference(listSelectedKeys, treeSelectedKeys);
@@ -134,26 +222,52 @@ const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, re
                         },
                         onSelect(item, selected) {
                             onItemSelect(item[`${keyName}`], selected);
+                            handleTreeItemSelect(item[`${keyName}`], selected);
                         },
                         selectedRowKeys: listSelectedKeys,
                     };
 
+                    // 使用 filteredDataSource 作为数据源,确保左侧表格正确显示未选中的数据
+
+                    const flattenAndFilter = (list: any[], targetKeys: string | any[]) => {
+                        let result: any[] = [];
+                        list.forEach((item: { [x: string]: any; children: any; }) => {
+                            if (targetKeys.includes(item[keyName])) {
+                                // 如果父节点已经选中,不再单独加入子节点
+                                result.push(item);
+                            } else if (item.children) {
+                                // 递归处理子节点
+                                const filteredChildren = flattenAndFilter(item.children, targetKeys);
+                                if (filteredChildren.length > 0) {
+                                    result = result.concat(filteredChildren);
+                                }
+                            }
+                        });
+                        return result;
+                    };
+
+                    const dataSourceToUse = direction === 'left'
+                        ? filteredDataSource // 左侧的未选中项
+                        : flattenAndFilter(datasource, targetKeys); // 右侧的已选中项
+
+
                     return (
                         <KCIMTable
                             rowSelection={rowSelection}
                             columns={columns as TransferItem[]}
-                            dataSource={filteredItems}
+                            dataSource={dataSourceToUse}
                             size="small"
                             bordered={false}
                             rowKey={keyName}
-                            scroll={{y:280}}
+                            scroll={{ y: 280 }}
                             pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
                             tableAlertRender={false}
                             style={{ pointerEvents: listDisabled ? 'none' : undefined }}
                             onRow={(row) => ({
                                 onClick: () => {
-                                    if (row.itemDisabled || listDisabled) return;
-                                    onItemSelect(row[`${keyName}`], !listSelectedKeys.includes(row[`${keyName}`]));
+                                    const selected = !listSelectedKeys.includes(row[`${keyName}`]);
+                                    onItemSelect(row[`${keyName}`], selected);
+                                    handleTreeItemSelect(row[`${keyName}`], selected);
                                 },
                             })}
                         />
@@ -161,10 +275,7 @@ const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, keyName, re
                 }}
             </Transfer>
         </div>
-
-    )
+    );
 });
 
-export default TableTransfer
-
-
+export default TableTransfer;

+ 2 - 2
src/pages/baseSetting/costAllocationSet/idleCostSetting/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-04-26 11:31:57
+ * @LastEditTime: 2024-08-23 10:30:12
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -409,7 +409,7 @@ export default function IdleCostSetting() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/baseSetting/costAllocationSet/revenueImputationSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-21 17:11:20
+ * @LastEditTime: 2024-08-23 10:26:40
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -362,7 +362,7 @@ export default function AccountingSubMana() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 234px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 24 - 10
src/pages/baseSetting/otherItemSet/departmentCostCalc/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-12 15:53:48
+ * @LastEditTime: 2024-08-23 10:31:29
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -37,6 +37,7 @@ import { cleanTree, getStringWidth } from '@/utils/tooljs';
 import { getDicDataBySysId } from '@/services/getDic';
 import { KCIMLeftList } from '@/components/KCIMLeftList';
 import { formatMoneyNumber } from '@/utils/format';
+import { useModel } from '@umijs/max';
 
 
 
@@ -170,7 +171,8 @@ export default function DepartmentCostCalc() {
     const formRef = useRef<ProFormInstance>();
     const [tabs, set_tabs] = useState<any[]>([]);
 
-    const [computeDate, set_computeDate] = useState<string>(`${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`);
+    const { initialState,setInitialState } = useModel('@@initialState');
+    const [computeDate, set_computeDate] = useState<string>(initialState?initialState.computeDate:'');
     const [responsibleCenters, set_responsibleCenters] = useState<any[]>([]);
     const [currentTabKey, set_currentTabKey] = useState<any | undefined>(undefined);
     const [currentTab, set_currentTab] = useState<any | undefined>(undefined);
@@ -190,15 +192,24 @@ export default function DepartmentCostCalc() {
         {
             title: '金额(元)',
             dataIndex: 'amount',
-            renderText(num) {
-                return formatMoneyNumber(num);
+            renderText(num,record) {
+                if (record.children) {
+                    return <React.Fragment></React.Fragment>
+                }else{
+                    return formatMoneyNumber(num);
+                } 
             },
         },
         {
             title: '占比',
             dataIndex: 'percent',
-            renderText(num) {
-                return `${((num * 100).toFixed(2)).replace(/(\.\d*?)0+$/, '$1').replace(/\.$/, '')}%`
+            renderText(num,record) {
+                if (record.children) {
+                    return <React.Fragment></React.Fragment>
+                }else{
+                    return `${((num * 100).toFixed(2)).replace(/(\.\d*?)0+$/, '$1').replace(/\.$/, '')}%`
+                } 
+                
             },
         },
     ]
@@ -309,7 +320,7 @@ export default function DepartmentCostCalc() {
 
             set_dataSource(dataSource);
             set_drawerTableVisible(true);
-            console.log({ columns: [...defaultColumns, ...tableColumns], dataSource })
+            // console.log({ columns: [...defaultColumns, ...tableColumns], dataSource })
 
         }
 
@@ -494,7 +505,7 @@ const handleExport = () => {
                     <div className='title'>{currentTab ? currentTab.label : ''}(单位:元)</div>
                     <div className='btns'>
                         <span onClick={() => handleExport()}>导出</span>
-                        <span onClick={() => set_drawerTableVisible(false)}>关闭</span>
+                        <span className='close' onClick={() => set_drawerTableVisible(false)}>关闭</span>
                     </div>
                 </div>
                 {dataSource.length > 0 ? <KCIMTable expandable={{ defaultExpandAllRows: true }} className='departmentCostCalcReportTable' dataSource={dataSource} bordered pagination={false} scroll={{ x: 6000, y: '65vh' }} columns={tableColumns as ProColumns[]} rowKey='responsibilityCode' /> : <></>}
@@ -506,6 +517,7 @@ const handleExport = () => {
                     <DatePicker
                         onChange={(data, dateString) => {
                             set_computeDate(dateString);
+                            setInitialState((s:any)=>({...s,computeDate: dateString,}))
                             set_tableDataFilterParams({
                                 ...tableDataFilterParams,
                                 computeDate: dateString,
@@ -570,7 +582,9 @@ const handleExport = () => {
                                 <span className='calc' onClick={() => computeProfitHandle()}>计算</span>
                             </div>
                         </div>
-                        <KCIMTable pagination={false} expandable={{
+                        <KCIMTable pagination={false} 
+                        rowClassName={(record) => (record.children ? 'has-children' : '')}
+                        expandable={{
                             defaultExpandAllRows: true, expandedRowKeys: allParentsKeys,
                             onExpand(expanded, record) {
                                 const { id } = record;
@@ -581,7 +595,7 @@ const handleExport = () => {
                                     set_allParentsKeys([...allParentsKeys, id]);
                                 }
                             },
-                        }} columns={columns as ProColumns[]} scroll={{ y: `calc(100vh - 300px)` }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                        }} columns={columns as ProColumns[]} scroll={{ y: `calc(100vh - 302px)` }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
                     </div>
                 </div>
 

+ 24 - 1
src/pages/baseSetting/otherItemSet/departmentCostCalc/style.less

@@ -25,6 +25,11 @@
         font-size: 14px;
         color: #17181A;
         border: 1px solid #DAE2F2;
+        &.close {
+          color: #fff;
+          background: #3377FF;
+          margin-left: 8px;
+        }
       }
     }
   }
@@ -58,7 +63,7 @@
 
       .left {
         width: 220px;
-        height: calc(734px - 44px);
+        height: calc(100vh - 223px);
 
         border-radius: 4px;
         padding-top: 16px;
@@ -106,6 +111,24 @@
             }
           }
         }
+        .KCIMTable {
+          .cost-ant-table-header {
+                .cost-ant-table-thead {
+                    .cost-ant-table-cell {
+                        
+                    }
+                }
+          }
+          .cost-ant-table-body {
+            .cost-ant-table-row {
+                &.has-children {
+                     .cost-ant-table-cell-with-append {
+                         font-weight: bold;
+                     }
+                }
+            }
+          }
+        }
       }
     }
   }

+ 2 - 2
src/pages/baseSetting/otherItemSet/reportItemSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-21 10:32:54
+ * @LastEditTime: 2024-08-23 10:18:54
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -602,7 +602,7 @@ export default function ReportItemSet() {
             </div>
 
             <div>
-                <KCIMTable pagination={false} scroll={{x:1500, y: `calc(100vh - 230px)` }} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable pagination={false} scroll={{x:1500, y: `calc(100vh - 191px)` }} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/baseSetting/otherItemSet/visitsAndBedDayCostSetting/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 13:49:28
+ * @LastEditTime: 2024-08-23 10:22:59
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -294,7 +294,7 @@ export default function VisitsAndBedDayCostSetting() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{ y: `calc(100vh - 191px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/baseSetting/otherItemSet/wholeHospCostAndIncomeSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 13:48:46
+ * @LastEditTime: 2024-08-23 10:22:11
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -201,7 +201,7 @@ export default function WholeHospCostAndIncomeSet() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{ y: `calc(100vh - 191px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 0 - 2
src/pages/costAccounting/calcPageTemplate/columns.tsx

@@ -794,7 +794,6 @@ export const afterCostShareSearch: ProColumns[] = [
     },
     {
         title: '分摊层级',
-        width: tableColumnsWidObj.shareLevel,
         dataIndex: 'levelSort',
     },
     {
@@ -814,7 +813,6 @@ export const afterCostShareSearch: ProColumns[] = [
     {
         title: '会计科目编码',
         dataIndex: 'accountingCode',
-        width: 300
     },
     {
         title: '会计科目名',

+ 8 - 7
src/pages/costAccounting/calcPageTemplate/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-28 14:29:32
+ * @LastEditTime: 2024-08-16 16:26:12
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -34,22 +34,22 @@ import ExportProgressModal from '@/pages/reportExport/report/ExportProgressModal
 import exportTableToExcel from '@/utils/tableToExcel';
 
 import { useAccess, useParams } from '@umijs/max'
+import { useModel } from '@umijs/max';
 
 
 const IconFont = createFromIconfontCN({
   scriptUrl: '',
 });
 
-const currentData = `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`;
-
 const calTypeStr = `ITEM_COST_CALCULATE${(new Date()).getTime()}`;
 
 let currentPage = 0;
 let totalTableData: any[] = [];
 
 export default function calcPageTemplate() {
-  const [computeDate, set_computeDate] = useState(currentData);
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any>({ computeDate: currentData });
+  const { initialState,setInitialState } = useModel('@@initialState');
+  const [computeDate, set_computeDate] = useState<string>(initialState?initialState.computeDate:'');
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any>({ computeDate });
   const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState('');
   const tableRef = useRef<ActionType>();
   const [loading, set_loading] = useState(false);
@@ -753,6 +753,7 @@ export default function calcPageTemplate() {
                 <DatePicker
                   onChange={(data, dateString) => {
                     set_computeDate(dateString);
+                    setInitialState((s:any)=>({...s,computeDate: dateString}));
                     set_tableDataFilterParams({
                       ...tableDataFilterParams,
                       computeDate: dateString,
@@ -760,7 +761,7 @@ export default function calcPageTemplate() {
                   }}
                   picker="month"
                   locale={locale}
-                  defaultValue={moment(`${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`, 'YYYY-MM')}
+                  defaultValue={moment(computeDate, 'YYYY-MM')}
                   format="YYYY-MM"
                   placeholder="选择年月"
                 />
@@ -782,7 +783,7 @@ export default function calcPageTemplate() {
           columns={columns}
           actionRef={tableRef}
           rowKey="id"
-          scroll={{ x: scrollX, y: `calc(100vh - 230px)` }}
+          scroll={{ x: scrollX, y:params.calcPageKey == 'afterCostShareSearch'?`calc(100vh - 270px)`: `calc(100vh - 233px)` }}
           params={tableDataFilterParams}
           request={(params) => getTableData(params)}
         />

+ 2 - 2
src/pages/costLibraryManagement/basicCostManagement/drugCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 14:36:59
+ * @LastEditTime: 2024-08-16 10:28:49
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -360,7 +360,7 @@ export default function DrugCostManagement() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable columns={columns as ProColumns[]} scroll={{y:`calc(100vh - 235px)`}} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/basicCostManagement/equipmentCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 14:39:16
+ * @LastEditTime: 2024-08-16 10:28:57
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -356,7 +356,7 @@ export default function EquipmentCostManagement() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/basicCostManagement/materialCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-28 17:50:21
+ * @LastEditTime: 2024-08-16 10:28:41
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -394,7 +394,7 @@ export default function MaterialCostManagement() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 1
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-03-25 16:35:11
+ * @LastEditTime: 2024-08-16 10:29:24
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -569,6 +569,7 @@ const PersonnelClassificationMana = () => {
                 </div>
                 <div style={{ marginTop: 16 }}>
                     {currentSelectedType && <KCIMTable actionRef={tableRef} columns={tableColumn}
+                        scroll={{y:`calc(100vh - 233px)`}}
                         rowKey='id'
                         request={(params) => getTableData(params)}
                         tableAlertRender={false}

+ 3 - 1
src/pages/costLibraryManagement/basicCostManagement/personnelClassificationMana/style.less

@@ -82,7 +82,7 @@ box-shadow: 0px -8px 16px 0px rgba(64,85,128,0.1);
     border-radius: 4px;
     width: 220px;
     height: calc(100vh - 80px);
-    overflow: scroll;
+    overflow:hidden;
     margin-right: 16px;
     padding: 16px 8px;
     background: #FFFFFF;
@@ -113,6 +113,8 @@ box-shadow: 0px -8px 16px 0px rgba(64,85,128,0.1);
     }
 
     .wrap {
+      height: calc(100% - 30px);
+      overflow-y: scroll;
       margin-top: 16px;
 
       .type {

+ 2 - 2
src/pages/costLibraryManagement/basicCostManagement/spaceCostManagement/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-17 10:10:32
+ * @LastEditTime: 2024-08-16 10:29:30
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -384,7 +384,7 @@ export default function SpaceCostManagement() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable pagination={false}  columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable pagination={false} scroll={{y:`calc(100vh - 233px)`}}  columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/diseaseCostManagement/diseaseDiagnosisComparison/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 14:24:47
+ * @LastEditTime: 2024-08-16 10:38:58
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -334,7 +334,7 @@ export default function DiseaseDiagnosisComparison() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable  scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/diseaseCostManagement/diseaseMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 14:24:06
+ * @LastEditTime: 2024-08-16 10:39:53
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -278,7 +278,7 @@ export default function DiseaseMana() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-28 11:00:07
+ * @LastEditTime: 2024-08-16 10:41:16
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -564,7 +564,7 @@ const MedicalOrderProjectMana = () => {
                 </div>
                 <div style={{ marginTop: 16 }}>
                     {currentSelectedType && <KCIMTable actionRef={tableRef} columns={column}
-                        scroll={{ y: 500 }}
+                        scroll={{ y:`calc(100vh - 233px)` }}
                         rowKey='id'
                         params={tableDataFilterParams}
                         request={(params) => getTableData(params)}

+ 3 - 2
src/pages/costLibraryManagement/medicalOrderProject/medicalOrderProjectMana/style.less

@@ -82,7 +82,7 @@ box-shadow: 0px -8px 16px 0px rgba(64,85,128,0.1);
     border-radius: 4px;
     width: 220px;
     height: calc(100vh - 80px);
-    overflow: scroll;
+    overflow: hidden;
     margin-right: 16px;
     padding: 16px 8px;
     background: #FFFFFF;
@@ -113,8 +113,9 @@ box-shadow: 0px -8px 16px 0px rgba(64,85,128,0.1);
     }
 
     .wrap {
+      height: calc(100% - 58px);
       margin-top: 16px;
-
+      overflow-y: scroll;
       .type {
         cursor: pointer;
         height: 56px;

+ 2 - 2
src/pages/costLibraryManagement/projectCostManagement/chargeItemsMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-05 14:20:16
+ * @LastEditTime: 2024-08-16 10:34:01
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -559,7 +559,7 @@ export default function ChargeItemsMana() {
 
                             <div style={{ marginTop: 16 }}>
                                 <KCIMTable
-                                    scroll={{ x: 1500 }}
+                                    scroll={{ x: 1500,y:`calc(100vh - 271px)` }}
                                     columns={columns as ProColumns[]}
                                     actionRef={tableRef} rowKey='id' params={tableDataFilterParams}
                                     request={(params) => getTableData(params)}

+ 2 - 2
src/pages/costLibraryManagement/projectCostManagement/projectCostShareSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-12 17:45:12
+ * @LastEditTime: 2024-08-16 10:37:50
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -420,7 +420,7 @@ export default function AllocationParamsMap() {
             </div>
 
             <div>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable  scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/projectCostManagement/projectShareParamsSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-02-22 17:13:33
+ * @LastEditTime: 2024-08-16 10:35:12
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -300,7 +300,7 @@ export default function ProjectShareParamsSet() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable columns={columns as ProColumns[]} scroll={{y:`calc(100vh - 233px)`}} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/projectCostManagement/standardProjectMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-12 13:53:06
+ * @LastEditTime: 2024-08-16 10:31:19
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -421,7 +421,7 @@ export default function StandardProjectMana() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable scroll={{x:2500}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{x:2500,y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 2 - 2
src/pages/costLibraryManagement/reportMana/reportColumnMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-11 15:06:53
+ * @LastEditTime: 2024-08-16 10:41:51
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -279,7 +279,7 @@ const reportColumnMana = () => {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 1 - 1
src/pages/costLibraryManagement/reportMana/reportListMana/index.tsx

@@ -550,7 +550,7 @@ const reportListMana = () => {
                 </div>
                 <div style={{ marginTop: 16 }}>
                     {currentSelectedType && <KCIMTable actionRef={tableRef} columns={tableColumn}
-                        scroll={{ y: 500 }}
+                        scroll={{y:`calc(100vh - 233px)`}}
                         rowKey='id'
                         dataSource={dataSource}
                         tableAlertRender={false}

+ 2 - 2
src/pages/costLibraryManagement/reportMana/reportNavSet/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-01-05 14:33:46
+ * @LastEditTime: 2024-08-16 10:43:15
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -352,7 +352,7 @@ export default function ReportNavSet() {
             </div>
 
             <div style={{ marginTop: 16 }}>
-                <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCIMTable scroll={{y:`calc(100vh - 233px)`}} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </KCIMPagecontainer>
     )

+ 8 - 5
src/pages/incomeCollectionAction/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-03-18 15:52:26
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-18 17:11:41
+ * @LastEditTime: 2024-08-16 15:54:53
  * @FilePath: /CostAccountingSys/src/pages/monthlyInfoCollection/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -23,6 +23,7 @@ import { ActionType, ProColumns } from "@ant-design/pro-components";
 import { getResponsibilityCenterList } from "../baseSetting/responsibilityCenterSet/responsibilityCenter/service";
 import { getIncomeCollectionReq, getTableDataReq } from "./service";
 import { cancelIncomeCollection, getAfterIncomeCollectionTableData, startIncomeCollection } from "../costAccounting/calcPageTemplate/service";
+import { useModel } from "@umijs/max";
 
 const IconFont = createFromIconfontCN({
     scriptUrl: '',
@@ -55,13 +56,14 @@ const tableColumn: ProColumns[] = [
         dataIndex: 'amount',
     },
 ];
-const currentDate = `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`;
+
 
 const IncomeCollectionAction = () => {
     const tableRef = useRef<ActionType>();
 
-    const [computeDate, set_computeDate] = useState<string>(currentDate);
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ computeDate: currentDate });
+    const { initialState,setInitialState } = useModel('@@initialState');
+    const [computeDate, set_computeDate] = useState<string>(initialState?initialState.computeDate:'');
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ computeDate });
     const [incomeCollectionData,set_incomeCollectionData] = useState<any>(undefined);
     const [loading, set_loading] = useState(false);
 
@@ -268,6 +270,7 @@ const IncomeCollectionAction = () => {
                                 computeDate: dateString,
                                 accountFilter:''
                             });
+                            setInitialState((s:any)=>({...s,computeDate: dateString,}));
                             set_tableDataSearchKeywords('');
                         }}
                         picker="month"
@@ -336,7 +339,7 @@ const IncomeCollectionAction = () => {
                             rowKey='id'
                             request={(params) => getTableData(params)}
                             tableAlertRender={false}
-                            scroll={{ x: scrollX,y:`calc(100vh - 270px)` }}
+                            scroll={{ x: scrollX,y:`calc(100vh - 322px)` }}
                             params={tableDataFilterParams}
                         />
                     </div>

+ 8 - 3
src/pages/monthlyInfoCollection/components/leftAndRighrStructure.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-03-19 10:55:39
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-11 11:36:50
+ * @LastEditTime: 2024-08-16 15:25:58
  * @FilePath: /CostAccountingSys/src/pages/monthlyInfoCollection/components/leftAndRighrStructure.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -50,6 +50,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
     const [tableColumn, set_tableColumn] = useState<ProColumns[]>([]);
     const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>(undefined);
     const [scrollX, set_scrollX] = useState<number|undefined>(1000);
+    const [scrollY, set_scrollY] = useState<string>(`calc(100vh - 324px)`);
     const [tabSearchKey, set_tabSearchKey] = useState('');
     const [currentLeftTab, set_currentLeftTab] = useState(1);
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState('');
@@ -68,7 +69,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
     const getTableData = async (params: any) => {
 
         if (tabKey == '1') {
-            const resp = await getCalcPageTableData({ calcPageKey: 'beforeCollectionSearch', ...tableDataFilterParams, computeDate, type: currentLeftTab, departmentCode: _currentSelectedLeftObj.subText });
+            const resp = await getCalcPageTableData({ calcPageKey: 'beforeCollectionSearch',...params, ...tableDataFilterParams, computeDate, type: currentLeftTab, departmentCode: _currentSelectedLeftObj.subText });
             if (resp) {
                 // set_totalAmount(resp.totalAmount);
                 set_currentResp(resp);
@@ -195,6 +196,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
         if (tabKey == '1') {
             set_tableColumn([...beforeCollectionSearch]);
             set_scrollX(1300);
+            set_scrollY(`calc(100vh - 395px)`);
             set_tabSearchKey('name');
             set_tableSearchKey('filter');
             inComeLeftData();
@@ -210,6 +212,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
         if (tabKey == '2') {
             set_tableColumn([...beforeCostShareSearch]);
             set_scrollX(undefined);
+            set_scrollY(`calc(100vh - 396px)`);
             set_tabSearchKey('name');
             set_tableSearchKey('filter');
             costLeftData();
@@ -218,6 +221,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
 
         if (tabKey == '5') {
             set_scrollX(1300);
+            set_scrollY(`calc(100vh - 345px)`);
             set_tabSearchKey('name');
             set_tableSearchKey('');
             getPatientInfoDepartments();
@@ -282,6 +286,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
     }, [reload]);
 
     useEffect(() => {
+        // console.log({tabKey,currentLeftTab});
         if (tabKey == '1') {
             inComeLeftData();
         }
@@ -387,7 +392,7 @@ export const LeftAndRighrStructure = (props: LeftAndRighrStructure) => {
                         rowKey='id'
                         request={(params) => getTableData(params)}
                         tableAlertRender={false}
-                        scroll={{ x: scrollX,y:`calc(100vh - 324px)` }}
+                        scroll={{ x: scrollX,y:scrollY }}
                         params={tableDataFilterParams}
                     />}
                  

+ 65 - 44
src/pages/monthlyInfoCollection/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-03-18 15:52:26
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-28 15:03:53
+ * @LastEditTime: 2024-08-16 15:39:20
  * @FilePath: /CostAccountingSys/src/pages/monthlyInfoCollection/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -22,10 +22,12 @@ import EmpCostDataImport from "../monthlyInfoSearch/empCostDataImport";
 import WholeHospIncomeAndCost from "../monthlyInfoSearch/wholeHospIncomeAndCost";
 import TableSelecter from "./tableSelector";
 import { cancelReq, getReq, oneKeyGetDataReq } from "./service";
+import { useModel } from "@umijs/max";
 
 const MonthlyInfoCollection = () => {
 
-    const [computeDate, set_computeDate] = useState<string>(`${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`);
+    const { initialState,setInitialState } = useModel('@@initialState');
+    const [computeDate, set_computeDate] = useState<string>(initialState?initialState.computeDate:'');
     const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>(undefined);
     const [tabs, set_tabs] = useState<any[]>([]);
     const [currentTabKey, set_currentTabKey] = useState('0');
@@ -44,8 +46,7 @@ const MonthlyInfoCollection = () => {
         const resp = await getDicDataBySysId(systemId, 'DATA_COLLECT_TYPE');
         if (resp) {
             const { dataVoList } = resp;
-            const dataVoListSort = dataVoList.sort((a: any, b: any) => a.sort - b.sort);
-            const tabs = dataVoList.map((a: any) => ({ ...a, label: a.name, key: a.code }));
+            const tabs = dataVoList.map((a: any) => ({ ...a, label: `${a.name}`, key: a.code }));
             const showTabs = tabs.filter((a: any) => a.expandOne == '1')
             set_tabs([{ label: '月度数据导入', key: '0' }, ...showTabs]);
         }
@@ -53,14 +54,34 @@ const MonthlyInfoCollection = () => {
     }
 
     const oneKeyGetHandle = async () => {
-        const resp = await oneKeyGetDataReq({ computeDate });
-        if (resp) {
-            message.success('操作成功!');
-            set_reload(true);
-            setTimeout(() => {
-                set_reload(false);
-            }, 3000)
-        }
+        return new Promise((resolve) => {
+            Modal.confirm({
+                title: '注意',
+                content: '获取操作会覆盖上次获取的数据,确定要继续操作?',
+                onOk: async () => {
+                    try {
+                        const resp = await oneKeyGetDataReq({ computeDate });
+                        if (resp) {
+                            message.success('获取成功!');
+                            set_reload(true);
+                            setTimeout(() => {
+                                set_reload(false);
+                            }, 1000);
+                            resolve(true);
+                        } else {
+                            resolve(false);
+                        }
+                    } catch (error) {
+                        // 请求失败,处理错误
+                        console.error(error);
+                        resolve(false);
+                    }
+                },
+                onCancel() {
+                    resolve(false);
+                },
+            });
+        });
     }
     //撤销请求
     const cancelHandle = async () => {
@@ -77,40 +98,39 @@ const MonthlyInfoCollection = () => {
     }
 
     //获取请求
-    const getHandle = async (): Promise<boolean> => {
-        let timeoutFlag = false;
-        // 创建一个定时器,2秒后设置标志位并开启Modal
-        const timeout = setTimeout(() => {
-            timeoutFlag = true;
-            set_isModalOpen(true);
-        }, 2000);
+    const getHandle = (): Promise<boolean> => {
+        return new Promise((resolve) => {
+            Modal.confirm({
+                title: '注意',
+                content: '获取操作会覆盖上次获取的数据,确定要继续操作?',
+                onOk: async () => {
+                    try {
+                        const resp = await getReq(computeDate, Number(currentTabKey));
     
-        try {
-            const resp = await getReq(computeDate, Number(currentTabKey));
-            // 请求成功,清除定时器并关闭Modal
-            clearTimeout(timeout);
-    
-            if (resp) {
-                if (timeoutFlag) {
-                    set_isModalOpen(false);
-                }
-                message.success('获取成功!');
-                set_reload(true);
-                setTimeout(() => {
-                    set_reload(false);
-                }, 1000);
-                return true;
-            }
-            set_isModalOpen(false);
-            return false;
-        } catch (error) {
-            // 请求失败,清除定时器并处理错误
-            clearTimeout(timeout);
-            console.error(error);
-            return false;
-        }
+                        if (resp) {
+                            message.success('获取成功!');
+                            set_reload(true);
+                            setTimeout(() => {
+                                set_reload(false);
+                            }, 1000);
+                            resolve(true);
+                        } else {
+                            resolve(false);
+                        }
+                    } catch (error) {
+                        // 请求失败,处理错误
+                        console.error(error);
+                        resolve(false);
+                    }
+                },
+                onCancel() {
+                    resolve(false);
+                },
+            });
+        });
     };
     
+
     useEffect(() => {
         const needTab = tabs.filter((a) => a.key == currentTabKey);
         set_currentSelectedTab(needTab[0]);
@@ -146,6 +166,7 @@ const MonthlyInfoCollection = () => {
                     <DatePicker
                         onChange={(data, dateString) => {
                             set_computeDate(dateString);
+                            setInitialState((s:any)=>({...s,computeDate: dateString}));
                             set_tableDataFilterParams({
                                 ...tableDataFilterParams,
                                 computeDate: dateString,
@@ -180,7 +201,7 @@ const MonthlyInfoCollection = () => {
                     {currentTabKey == '4' && <EmpCostDataImport cancelHandle={cancelHandle} getHandle={getHandle} date={computeDate} btnPerm={currentSelectedTab ? currentSelectedTab.expandTwo : '0|0'} />}
                     {currentTabKey == '7' && <WholeHospIncomeAndCost cancelHandle={cancelHandle} getHandle={getHandle} date={computeDate} btnPerm={currentSelectedTab ? currentSelectedTab.expandTwo : '0|0'} />}
                 </div>
-                
+
             </div>
         </KCIMPagecontainer>
     )

+ 3 - 3
src/pages/monthlyInfoSearch/patientInfoImport/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-11 11:31:45
+ * @LastEditTime: 2024-08-16 15:35:09
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -289,7 +289,7 @@ export default function PatientInfoImport(
         type: type
       });
     }
-    console.log({type});
+
     if(type == 3){
       set_columns(columnsTwo);
     }else{
@@ -386,7 +386,7 @@ export default function PatientInfoImport(
           columns={columns}
           actionRef={tableRef}
           rowKey="id"
-          scroll={{ x: type == 3?4000:2000,y:`calc(100vh - 305px)` }}
+          scroll={{ x: type == 3?4000:2000,y:`calc(100vh - 346px)` }}
           params={tableDataFilterParams}
           request={(params) => getTableData(params)}
         />

+ 1 - 1
src/pages/monthlyInfoSearch/patientInfoImport/style.less

@@ -36,7 +36,7 @@
 
 .patientInfoImport {
   position: relative;
-  padding: 16px;
+  // padding: 16px;
   background: #FFFFFF;
   border-radius: 4px;
 

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

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-17 15:33:14
+ * @LastEditTime: 2024-07-24 17:25:11
  * @FilePath: /BudgetManaSystem/src/pages/noAccess/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -21,7 +21,7 @@ const NoAccessPage: React.FC = () => {
               <img className='flagIcon' src={require('./images/noAccess.png')} alt="" />
               <div className='title'>暂无权限</div>
               <div className='subTitle'>当前功能暂无权限,请联系管理员分配权限</div>
-              <Link to='/home' replace ><div className='btn'>返回首页</div></Link>
+              {/* <Link to='/home' replace ><div className='btn'>返回首页</div></Link> */}
          </div>
     </KCIMPagecontainer>
   );

+ 10 - 9
src/pages/reportExport/report/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-01-04 14:12:31
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-28 16:00:46
+ * @LastEditTime: 2024-08-15 14:19:33
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -33,6 +33,7 @@ import { getStringWidth } from '@/utils/tooljs';
 
 import ExportProgressModal from './ExportProgressModal';
 import { getParamsDataBySysId } from '@/services/getDic';
+import { useModel } from '@umijs/max';
 
 
 const IconFont = createFromIconfontCN({
@@ -51,8 +52,6 @@ let currentPage = 0;
 let maxFetchCount = 0;
 
 
-// const {search} = locatio
-const currentTimeStr = `${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}`;
 
 const ReportExport = () => {
 
@@ -63,7 +62,8 @@ const ReportExport = () => {
 
   const [tableScrollX, set_tableScrollX] = useState<number>(1000);
 
-  const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(currentTimeStr);
+  const { initialState,setInitialState } = useModel('@@initialState');
+  const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(initialState?initialState.computeDate:undefined);
 
   const [breadCrumbList, set_breadCrumbList] = useState<any[]>([]);
 
@@ -79,12 +79,10 @@ const ReportExport = () => {
 
   const [reportName, set_reportName] = useState('');
 
-  const [exportData, set_exportData] = useState([]);
+  const [pageSize, set_pageSize] = useState(20);
   const [openProcessModal, set_openProcessModal] = useState(false);
 
 
-
-
   const reportJumphandle = (reportData: any) => {
 
     let parameter: { [key: string]: any } = {};
@@ -131,8 +129,10 @@ const ReportExport = () => {
 
     const { systemId } = JSON.parse(localStorage.getItem('currentSelectedTab') as string)
     const paramsData = await getParamsDataBySysId(systemId, '1806523783696224256');
+    const pageSize = paramsData.value?Number(paramsData.value):100;
+    set_pageSize(pageSize);    
+    const { parameter, current, reportCode } = params;
     
-    const { parameter, pageSize = paramsData.value?Number(paramsData.value):100, current, reportCode } = params;
     searchKeys = [];
     let resp: any = undefined;
 
@@ -454,6 +454,7 @@ const ReportExport = () => {
           <DatePicker
             onChange={(data, dateString) => {
               set_currentComputeDate(dateString);
+              setInitialState((s:any)=>({...s,computeDate:dateString}))
             }}
             allowClear={false}
             picker='month'
@@ -494,7 +495,7 @@ const ReportExport = () => {
             // loading={loading}
             scroll={{ x: tableScrollX, y: tableH }}
             // dataSource={tableData}
-            pagination={{ pageSizeOptions: [10, 20, 50, 100, 1000], showSizeChanger: true }}
+            pagination={{ pageSizeOptions: [10, 20, 50, 100, 1000], showSizeChanger: true,pageSize }}
             request={(params, sort, filter) => getTableData(params)}
           />}
         </div>

+ 19 - 16
src/pages/specialDataImport/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-06-05 17:52:06
+ * @LastEditTime: 2024-08-16 10:02:03
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -18,7 +18,7 @@ import { ProColumns } from '@ant-design/pro-table';
 import { Input, message, Popconfirm, DatePicker } from 'antd';
 import { useEffect, useRef, useState } from 'react'
 
-import {afterImport, getData, getSpecialImportTable, tableDataImport } from './service';
+import { afterImport, getData, getSpecialImportTable, tableDataImport } from './service';
 import FormItem from 'antd/es/form/FormItem';
 
 import './style.less';
@@ -30,6 +30,7 @@ import { getComputeDate } from '@/pages/Home/service';
 import KCIMUpload from '@/components/KCIMUpload';
 import KCIMPagecontainer from '@/components/KCIMPageContainer';
 import { KCIMTable } from '@/components/KCIMTable';
+import { useModel } from '@umijs/max';
 
 
 const IconFont = createFromIconfontCN({
@@ -43,7 +44,8 @@ export default function DicClassfication() {
 
     const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
-    const [currentComputeDate, set_currentComputeDate] = useState<string>(currentDate);
+    const { initialState, setInitialState } = useModel('@@initialState');
+    const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(initialState ? initialState.computeDate : undefined);
     const tableRef = useRef<ActionType>();
 
 
@@ -87,11 +89,11 @@ export default function DicClassfication() {
             render: (_: any, record: any) => {
                 return [
                     <Popconfirm
-                        title={`是否${record.importStatus == 1?'复原导入':'撤销导入'}?`}
+                        title={`是否${record.importStatus == 1 ? '复原导入' : '撤销导入'}?`}
                         key="del"
                         onConfirm={() => afterImportHandle(record)}
                     >
-                        <a>{record.importStatus == 1?'复原导入':'撤销导入'}</a>
+                        <a>{record.importStatus == 1 ? '复原导入' : '撤销导入'}</a>
                     </Popconfirm>
                 ]
             },
@@ -100,19 +102,19 @@ export default function DicClassfication() {
     ];
 
 
-    const afterImportHandle =async (record:any) => {
-         const {importStatus} = record;
-         const resp = await afterImport(record.id,importStatus?'RECOVERY':'CANCEL');
-         if(resp){
+    const afterImportHandle = async (record: any) => {
+        const { importStatus } = record;
+        const resp = await afterImport(record.id, importStatus ? 'RECOVERY' : 'CANCEL');
+        if (resp) {
             message.success('操作成功!');
             tableRef.current?.reload();
-         }
+        }
     }
 
 
     const getTableData = async (params: any) => {
         const { computeDate } = params;
-        const resp = await getData({ ...params, computeDate: computeDate?computeDate:currentComputeDate });
+        const resp = await getData({ ...params, computeDate: computeDate ? computeDate : currentComputeDate });
         if (resp) {
             return {
                 data: resp.list,
@@ -129,7 +131,7 @@ export default function DicClassfication() {
     const importData = () => {
 
         function downloadTemplate(): void {
-           
+
         }
 
         return (
@@ -174,7 +176,7 @@ export default function DicClassfication() {
                     request={async () => {
                         const resp = await getSpecialImportTable();
                         if (resp) {
-                            
+
                             return resp.map((a: any) => ({
                                 label: a.name,
                                 value: a.code
@@ -201,7 +203,8 @@ export default function DicClassfication() {
                             <span>所属年月:</span>
                             <DatePicker
                                 onChange={(data, dateString) => {
-                                    set_tableDataFilterParams({ ...tableDataFilterParams, computeDate: dateString })
+                                    set_tableDataFilterParams({ ...tableDataFilterParams, computeDate: dateString });
+                                    setInitialState((s:any)=>({...s,currentComputeDate:dateString}));
                                 }}
                                 picker='month'
                                 locale={locale}
@@ -228,7 +231,7 @@ export default function DicClassfication() {
                             }}
                             fieldProps={{
                                 onChange(value, option) {
-                                    set_tableDataFilterParams({ ...tableDataFilterParams,tableName: value })
+                                    set_tableDataFilterParams({ ...tableDataFilterParams, tableName: value })
                                 },
                             }}
                         />
@@ -239,7 +242,7 @@ export default function DicClassfication() {
                 </div>
             </div>
             <div style={{ marginTop: 16 }}>
-                {currentComputeDate && <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params, sort, filter) => getTableData(params)} />}
+                {currentComputeDate && <KCIMTable scroll={{ y: `calc(100vh - 230px)` }} columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params, sort, filter) => getTableData(params)} />}
             </div>
         </KCIMPagecontainer>
     )

BIN
static/indexBg.png


BIN
static/indexBgCenter.png