Преглед на файлове

添加查核单位分类设置界面

code4eat преди 2 години
родител
ревизия
b344fa622f

+ 12 - 2
.umirc.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-04-18 17:14:24
+ * @LastEditTime: 2023-04-19 18:02:10
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -153,7 +153,17 @@ export default defineConfig({
             }
           ]
         },
- 
+        {
+          name: '核算单元设置',
+          path: '/setting/checkUnitSet',
+          routes: [
+            {
+              name: '核算单元分类管理',
+              path: '/setting/checkUnitSet/checkUnitClassMana',
+              component: './setting/checkUnitSet/checkUnitClassMana',
+            },
+          ]
+        },
 
       ]
     },

+ 3 - 139
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: 2023-04-19 17:00:39
+ * @LastEditTime: 2023-04-19 18:12:17
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -228,6 +228,8 @@ export const request: RequestConfig = {
 
 
 export function patchClientRoutes({ routes }:{routes:any}) {
+
+  console.log({routes});
   
   const paths = [...new Array(10).keys()].map((a,index)=>({
     path: `/setting/manaPerformanceSet/reports/${index}`,
@@ -400,144 +402,6 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
           }
         }
 
-
-        // const data: menuDataItemType[] = [
-        //   {
-        //     path: '/home',
-        //     name: '首页',
-        //     icon: <Icon component={imgNode} />,
-        //   },
-        //   {
-        //     path: '/budgetMana',
-        //     name: '绩效管理',
-        //     icon: <Icon component={fileIcon} />,
-        //     children: [
-        //       {
-        //         path: '/budgetMana/monthlySet',
-        //         name: '月度结转',
-        //         icon: '',
-        //       },
-        //       {
-        //         path: '/budgetMana/monthlyInfoCheck',
-        //         name: '月度设置信息核对',
-        //         icon: '',
-        //       },
-        //       {
-        //         path: '/budgetMana/monthlyDataCheck',
-        //         name: '月度绩效数据核对',
-        //         icon: '',
-        //       },
-        //       {
-        //         path: '/budgetMana/personnelSalaryBudget',
-        //         name: '人事薪酬预算',
-        //         icon: '',
-        //       },
-        //       {
-        //         path: '/budgetMana/oneBatch',
-        //         name: '一次分配',
-        //         icon: '',
-        //       },
-        //     ],
-        //   },
-        //   {
-        //     path: '/setting',
-        //     name: '系统设置',
-        //     icon: <Icon component={setting} />,
-        //     children: [
-        //       {
-        //         path: '/setting/baseSetting',
-        //         name: '基础设置',
-        //         icon: '',
-        //         children: [
-        //           {
-        //             path: '/setting/baseSetting/dicClassfication',
-        //             name: '业务字典分类管理',
-        //             icon: '',
-        //           },
-        //           {
-        //             path: '/setting/baseSetting/businessDicMana',
-        //             name: '业务字典管理',
-        //             icon: '',
-        //           },
-        //           {
-        //             path: '/setting/baseSetting/paramsMana',
-        //             name: '参数管理',
-        //             icon: '',
-        //           },
-        //           {
-        //             name: '职类基础设定',
-        //             path: '/setting/baseSetting/jobCateBaseSet',
-        //             icon: ''
-        //           },
-        //           {
-        //             name: '岗位等级系数设定',
-        //             path: '/setting/baseSetting/positionLevelRateSet',
-        //             icon: ''
-        //           }
-        //         ]
-        //       },
-        //       {
-        //         path: '/setting/manaPerformanceSet',
-        //         name: '管理绩效设置',
-        //         icon: '',
-        //         children: [
-        //           {
-        //             path: '/setting/manaPerformanceSet/manaIndicItemSet',
-        //             name: '管理指标项目设定',
-        //             icon: '',
-        //           },
-        //           {
-        //             path: '/setting/manaPerformanceSet/classAssessAndGradeSet',
-        //             name: '职类考核分级设定',
-        //             icon: '',
-        //           },
-        //           {
-        //             path: '/setting/manaPerformanceSet/indicGroupWeightSet',
-        //             name: '指标分组权重设定',
-        //             icon: '',
-        //           },
-        //           {
-        //             name: '单元指标目标设定',
-        //             path: '/setting/manaPerformanceSet/unitIndicTargetSet',
-        //             icon: ''
-        //           }
-        //         ]
-        //       },
-        //       {
-        //         path: '/setting/reportSet',
-        //         name: '报表设置',
-        //         icon: '',
-        //         children: [
-        //           {
-        //             path: '/setting/reportSet/reportListMana',
-        //             name: '报表列管理',
-        //             icon: '',
-        //           },
-        //           {
-        //             name: '报表设置',
-        //             path: '/setting/reportSet/reportSetting',
-        //             icon: ''
-        //           },
-        //           {
-        //             name: '报表跳转管理',
-        //             path: '/setting/reportSet/reportNavSet',
-        //             icon: ''
-        //           },
-        //           {
-        //             name: '自定义SQL管理',
-        //             path: '/setting/reportSet/diySqlMana',
-        //             icon: ''
-        //           }
-        //         ]
-        //       }
-        //     ],
-        //   }
-        // ];
-
-        // return data
-
-        // console.log('mappingIcon(data)',mappingIcon(data));
-        // return mappingIcon(data);
       },
     },
     onPageChange: (location: Location) => {

+ 4 - 0
src/components/BMSTable/style.less

@@ -3,6 +3,10 @@
 
 .bms-ant-table-wrapper {
     border-radius: 4px !important;
+
+    .bms-ant-table-row-indent+.bms-ant-table-row-expand-icon {
+        margin-top: -2px !important;
+    }
 }
 
 .bms-ant-table-wrapper .bms-ant-table-tbody >tr >td {

+ 92 - 66
src/pages/reportCheck/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: 2023-04-19 15:07:25
+ * @LastEditTime: 2023-04-19 18:44:11
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -12,7 +12,7 @@ import BMSPagecontainer from '@/components/BMSPageContainer'
 import { BMSTable } from '@/components/BMSTable';
 import { getComputeDate } from '@/pages/Home/service';
 import { ActionType, ProColumns } from '@ant-design/pro-components';
-import { Breadcrumb} from 'antd';
+import { Space, Dropdown, MenuProps } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 import { getData, getRedirReportData } from './service';
 
@@ -22,6 +22,7 @@ import './style.less';
 
 import { create, all, string } from 'mathjs'
 import { useParams } from '@umijs/max';
+import { DownOutlined } from '@ant-design/icons';
 
 const config = {
   number: 'number',
@@ -38,105 +39,130 @@ const math = create(all, config as any);
 const ReportTemplate = () => {
 
 
-  const { reportCode:urlReportCode } = useParams();
+  const { reportCode: urlReportCode } = useParams();
 
   const [tableColumn, set_tableColumn] = useState<ProColumns[] | any[]>([]);
 
   const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>();
- 
-  const [breadCrumbList,set_breadCrumbList] = useState<any[]>([]);
 
-  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ reportCode:urlReportCode });
+  const [breadCrumbList, set_breadCrumbList] = useState<any[]>([]);
+
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>({ reportCode: urlReportCode });
 
   const tableRef = useRef<ActionType>();
 
   const [tableH, set_tableH] = useState(0);
 
-  const [step,set_step] = useState(0);
+  const [step, set_step] = useState(0);
 
 
-  const reportJumphandle = (reportData:any)=>{
-    console.log({reportData});
-    let parameter:{[key:string]:any} = {};
-    const {redirectParameter = undefined} = reportData;
+  const reportJumphandle = (reportData: any) => {
+    console.log({ reportData });
+    let parameter: { [key: string]: any } = {};
+    const { redirectParameter = undefined } = reportData;
     const _step = step + 1;
 
-    if(redirectParameter){
-         const tempArr = redirectParameter.split('|');
-         tempArr.forEach((element:string) => {
-             parameter[`${element}`] = reportData[`${element}`]
-         });
+    if (redirectParameter) {
+      const tempArr = redirectParameter.split('|');
+      tempArr.forEach((element: string) => {
+        parameter[`${element}`] = reportData[`${element}`]
+      });
     }
 
     set_breadCrumbList(
       [...breadCrumbList,
-        {
-          index:_step,
-          name:reportData[`report_name`],
-          params:{
-            reportCode:reportData.redirectReportCode,
-            parameter
-          }
+      {
+        index: _step,
+        name: reportData[`report_name`],
+        params: {
+          reportCode: reportData.redirectReportCode,
+          parameter
         }
+      }
       ]
     );
     set_step(_step);
-    
-    set_tableDataFilterParams({...tableDataFilterParams,reportCode:reportData.redirectReportCode,parameter})
+
+    set_tableDataFilterParams({ ...tableDataFilterParams, reportCode: reportData.redirectReportCode, parameter })
   }
 
 
   const getTableData = async (params: any, sort: any, filter: any) => {
 
-    const {reportCode,parameter} = params;
+    const { reportCode, parameter } = params;
 
-    let resp:any = undefined;
+    let resp: any = undefined;
 
-    if(step != 0){
-          //报表跳转
-          resp = await getRedirReportData(
-            reportCode,
-            parameter
-          ); 
+    if (step != 0) {
+      //报表跳转
+      resp = await getRedirReportData(
+        reportCode,
+        parameter
+      );
     }
 
-    if(step == 0){
+    if (step == 0) {
       //首次获取表格数据
       resp = await getData(
         reportCode,
         parameter
-      ); 
+      );
     }
 
     if (resp) {
 
-      const { title,data:assignmentData } = resp;
-      const columns = title.map((item: any,index:number) => {
+      const { title, data: assignmentData } = resp;
+      const columns = title.map((item: any, index: number) => {
         return {
           title: item.name,
           dataIndex: `${item.columnName}`,
           key: `${item.columnName}`,
           width: 100,
-          render:(_:any,record:any)=>{
-                  if(item.redirect){
-                       return <a className='active' onClick={()=>reportJumphandle({...item,...record})}>{_}</a>
-                  } 
-                  return <span >{_}</span>
+          render: (_: any, record: any) => {
+
+            if(item.redirect){
+              if (item.redirectData&&item.redirectData.length > 1) {
+
+                const items:MenuProps['items'] = [
+                  ...(item.redirectData.map((a:any,index:number)=>({
+                           key:index,
+                           label: (
+                            <a onClick={() => reportJumphandle({ ...item,...record, ...a })}>
+                              {a.redirectReportName}
+                            </a>
+                          ),
+                  })))
+                ];
+  
+               return  <Dropdown menu={{ items }}>
+                  <a onClick={(e) => e.preventDefault()}>
+                    <Space>
+                      {_}
+                      <DownOutlined />
+                    </Space>
+                  </a>
+                </Dropdown>
+              }else {
+                return <a className='active' onClick={() => reportJumphandle({ ...item, ...record })}>{_}</a>
+              }
+            }
+
+            return <span >{_}</span>
           }
 
         }
       });
-      set_tableColumn([ ...columns]);
+      set_tableColumn([...columns]);
 
       const data = assignmentData.map((item: any) => {
 
         let rowData: { [key: string]: any } = {};
-        
+
         for (let i = 0; i < item.length; i++) {
           rowData[`${title[i].columnName}`] = item[i].value
         }
-        
-        return { ...item, ...rowData,id:Math.random(), columns }
+
+        return { ...item, ...rowData, id: Math.random(), columns }
       });
 
       return {
@@ -151,10 +177,10 @@ const ReportTemplate = () => {
 
   const getCurrentComputeDate = async () => {
     const resp = await getComputeDate();
-    set_tableDataFilterParams({...tableDataFilterParams,parameter:{...tableDataFilterParams.parameter,compute_date:resp}});
+    set_tableDataFilterParams({ ...tableDataFilterParams, parameter: { ...tableDataFilterParams.parameter, compute_date: resp } });
     set_currentComputeDate(resp);
   }
-  
+
 
   const handleResize = (e: any) => {
     const wH = e.target.innerHeight;
@@ -168,25 +194,25 @@ const ReportTemplate = () => {
       window.dispatchEvent(ev);
     }, 0)
   }
-  
+
 
   //面包屑跳转
-  const switchHandle = (data:any)=>{
-  
+  const switchHandle = (data: any) => {
+
     set_step(data.index);
-    const _breadCrumbList = breadCrumbList.filter((a:any)=>a.index<=data.index);
+    const _breadCrumbList = breadCrumbList.filter((a: any) => a.index <= data.index);
     set_breadCrumbList([..._breadCrumbList]);
-    set_tableDataFilterParams({...tableDataFilterParams,...data.params});
+    set_tableDataFilterParams({ ...tableDataFilterParams, ...data.params });
   }
 
 
   useEffect(() => {
     // 在这里处理路由参数变化的逻辑
-    set_tableDataFilterParams({reportCode:urlReportCode,parameter:{compute_date:currentComputeDate}});
+    set_tableDataFilterParams({ reportCode: urlReportCode, parameter: { compute_date: currentComputeDate } });
     set_breadCrumbList([{
-      name:'首页',
-      params:{reportCode:urlReportCode,parameter:{compute_date:currentComputeDate}}
-  }])
+      name: '首页',
+      params: { reportCode: urlReportCode, parameter: { compute_date: currentComputeDate } }
+    }])
   }, [urlReportCode]);
 
 
@@ -204,17 +230,17 @@ const ReportTemplate = () => {
   return (
     <BMSPagecontainer className='ReportTemplate' title={`核算年月:${currentComputeDate}`}>
       <div className='breadcrumb'>
-          {
-            breadCrumbList.length>1&&breadCrumbList.map((item:any,index:number)=>{
-                 return (
-                     
-                     <span className={index != step?'tab':'tab actived'} key={index} onClick={()=>{index != step && switchHandle(item)}}>{item.name}{index == breadCrumbList.length - 1?'':' / '}</span>
-                 )
-            })
-          }
+        {
+          breadCrumbList.length > 1 && breadCrumbList.map((item: any, index: number) => {
+            return (
+
+              <span className={index != step ? 'tab' : 'tab actived'} key={index} onClick={() => { index != step && switchHandle(item) }}>{item.name}{index == breadCrumbList.length - 1 ? '' : ' / '}</span>
+            )
+          })
+        }
       </div>
       <div className='content'>
-        {currentComputeDate&&<BMSTable actionRef={tableRef} rowKey='id' pagination={false} columns={tableColumn as ProColumns[]}
+        {currentComputeDate && <BMSTable actionRef={tableRef} rowKey='id' pagination={false} columns={tableColumn as ProColumns[]}
           params={tableDataFilterParams}
           scroll={{ x: 100 * tableColumn.length, y: tableH }}
           request={(params, sort, filter) => getTableData(params, sort, filter)}

+ 247 - 0
src/pages/setting/checkUnitSet/checkUnitClassMana/index.tsx

@@ -0,0 +1,247 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-04-20 15: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
+ */
+
+
+
+
+import BMSPagecontainer from '@/components/BMSPageContainer';
+import { BMSTable } from '@/components/BMSTable';
+import { getDataByKeyFromDic, getPubDicDataByKey } from '@/services/getDic';
+import { createFromIconfontCN } from '@ant-design/icons';
+
+import { ActionType, ProFormInstance, ProFormText } from '@ant-design/pro-components';
+import { ModalForm, ProFormDependency, ProFormDigit, ProFormSelect, ProFormTextArea } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import { Input, message, Popconfirm } from 'antd';
+import { useEffect, useMemo, useRef, useState } from 'react';
+
+
+import { addData, delData, editData, getCheckUnitClassTableData } from './service';
+
+import './style.less';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_1927152_4nm5kxbv4m3.js',
+});
+
+
+
+export default function CheckUnitClassficationMana() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+    const tableRef = useRef<ActionType>();
+    const formRef = useRef<ProFormInstance>();
+
+    const columns: ProColumns[] = [
+
+        {
+            title: '分类名称',
+            dataIndex: 'className',
+        },
+        {
+            title: '职类',
+            dataIndex: 'unitTypeName',
+        },
+        {
+            title: '序号',
+            dataIndex: 'sort',
+            // render:(_:any)=>_ == 1?'指标':'自定义SQL'
+        },
+        {
+            title: '说明',
+            width: 200,
+            dataIndex: 'description',
+            ellipsis: true,
+        },
+        {
+            title: '操作',
+            key: 'option',
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'add'} record={record} type='ADDCHILD' />,
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>
+                ]
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const resp = await getCheckUnitClassTableData(params);
+        if (resp) {
+            return {
+                data: resp,
+                success: true
+            }
+        }
+        return []
+    }
+
+    const delTableData = async (record: any) => {
+        const resp = await delData(record.id);
+        if (resp) {
+            message.success('操作成功!');
+            tableRef.current?.reload();
+            // message.success('操作成功!');
+        }
+    }
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD"|'ADDCHILD') => {
+
+
+        if (type == 'ADD'||type == 'ADDCHILD') {
+            const resp = await addData({
+                  ...formVal,
+                  parentClassCode:formVal.parentClassCode?formVal.parentClassCode:'0'
+            });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+
+        }
+        if (type == 'EDIT') {
+
+            const resp = await editData({
+                ...formVal
+            });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+        return true;
+
+    }
+
+    const [dicData, set_dicData] = useState<any[]>([]);
+
+    const getDirecData = async (key?: string) => {
+
+        const data = await getPubDicDataByKey();
+        if (data) {
+            set_dicData(data);
+        }
+    }
+
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD'|'ADDCHILD' }) => {
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}核算单元分类`}
+                width={400}
+                formRef={formRef}
+                initialValues={type == 'EDIT' ? {
+                    ...record,
+
+                } :{}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" >编辑</a> :type=='ADDCHILD'?<a className='add'>添加</a>: <span className='add'>新增</span>
+                }
+                onFinish={(val) => {
+                    return updateTable(type == 'EDIT' ? { ...record, ...val } :type == 'ADDCHILD'?{...val,parentClassCode:record.code}:{ ...val }, type);
+                }}
+                modalProps={{ destroyOnClose: true }}
+                colProps={{ span: 24 }}
+                grid
+            >
+                <ProFormText
+                    name="className"
+                    label="分类名称:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '名称不能为空!' }]}
+                />
+                <ProFormSelect label="职类:"
+                    name='unitType'
+                    options={(getDataByKeyFromDic(dicData, '1')).list}
+                    rules={[{ required: true, message: '职类不能为空!' }]}
+                />
+                <ProFormDigit
+                    name="sort"
+                    label="序号:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '序号不能为空!' }]}
+                />
+                <ProFormTextArea
+                    name="description"
+                    label="说明:"
+                    placeholder="请输入"
+                    
+                />
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+
+    }
+
+
+    useEffect(() => {
+        getDirecData();
+    }, [])
+
+    return (
+        <BMSPagecontainer className='CheckUnitClassficationMana' title={false}>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
+                        <Input placeholder={'请输入分类名称'} allowClear
+                            suffix={
+                                <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('unitTypeName')} />
+                            }
+                            onChange={(e) => {
+                                set_tableDataSearchKeywords(e.target.value);
+                                if (e.target.value.length == 0) {
+                                    set_tableDataFilterParams({
+                                        ...tableDataFilterParams,
+                                        unitTypeName: ''
+                                    });
+                                }
+                            }}
+                            onPressEnter={(e) => {
+
+                                set_tableDataFilterParams({
+                                    ...tableDataFilterParams,
+                                    unitTypeName: (e.target as HTMLInputElement).value
+                                });
+                            }}
+
+                        />
+                    </div>
+                </div>
+                <div className='btnGroup'>
+                    <UpDataActBtn record type='ADD' />
+                </div>
+            </div>
+
+            <div style={{ marginTop: 16 }}>
+                <BMSTable columns={columns as ProColumns[]} pagination={false} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </BMSPagecontainer>
+    )
+}

+ 90 - 0
src/pages/setting/checkUnitSet/checkUnitClassMana/service.ts

@@ -0,0 +1,90 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-04-20 15:22:23
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { request } from 'umi';
+
+//获取table列表数据
+
+export type CheckUnitClassTableDataType = {
+  id:number,
+  hospId:number,
+  code:number,
+  className:string,
+  parentClassCode:string,
+  unitType:string,
+  unitTypeName:string,
+  sort?:string,
+  description?:string,
+  children:CheckUnitClassTableDataType[]
+}
+
+
+export const getCheckUnitClassTableData = (params?:{unitTypeName?:string}) => {
+  return request<CheckUnitClassTableDataType[]>('/performance/unit/getUnitTypeList', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+
+//新增
+export type AddTableDataType = {
+  className:string,
+  parentClassCode:string,
+  unitType:string,
+  sort:string,
+  description:string
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/performance/unit/addUnitType', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+
+
+
+//编辑表格数据
+
+export type EditTableDataType = {
+  id:number;
+}&AddTableDataType
+
+export const editData = (data:any) => {
+  return request('/performance/unit/editUnitType', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/performance/unit/deleteUnitType', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+
+
+
+

+ 43 - 0
src/pages/setting/checkUnitSet/checkUnitClassMana/style.less

@@ -0,0 +1,43 @@
+.CheckUnitClassficationMana {
+  padding: 16px;
+  background: #FFFFFF;
+  border-radius: 4px;
+
+
+  .toolBar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+
+    .filter {
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .filterItem {
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        align-items: center;
+      }
+    }
+
+    .btnGroup {
+      .add {
+        cursor: pointer;
+        display: inline-block;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #FFFFFF;
+        line-height: 24px;
+        padding: 0 14px;
+        background: #3377FF;
+        border-radius: 4px;
+      }
+    }
+
+  }
+}

+ 66 - 42
src/pages/setting/reportSet/reportSetting/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-04-14 10:05:44
+ * @LastEditTime: 2023-04-20 15:39:17
  * @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
  */
@@ -69,7 +69,7 @@ const ReportSetting = () => {
         {
             title: '列名称',
             width: 120,
-            ellipsis:true,
+            ellipsis: true,
             dataIndex: 'columnName',
 
         },
@@ -143,7 +143,7 @@ const ReportSetting = () => {
 
 
     const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA') => {
-        
+
         // console.log({formVal,type});
 
         if (type == 'ADD_LEFTDATA') {
@@ -172,7 +172,7 @@ const ReportSetting = () => {
         }
 
         if (type == 'EDIT') {
-   
+
             let newDataSource = dataSource.map((a: any, index: number) => {
                 //更新排序
                 return { ...a, sort: index + 1 }
@@ -270,8 +270,8 @@ const ReportSetting = () => {
         {
             title: '列名称',
             dataIndex: 'name',
-            with:100,
-            ellipsis:true,
+            with: 100,
+            ellipsis: true,
             key: 'name',
         },
         {
@@ -291,7 +291,7 @@ const ReportSetting = () => {
             title: `选择报表列`,
             icon: <></>,
             width: 750,
-            centered:true,
+            centered: true,
             content: <TableTransfer
                 ref={ref}
                 record={undefined}
@@ -317,7 +317,7 @@ const ReportSetting = () => {
             if (resp) {
 
                 set_datasource(resp.list);
-        
+
                 const defaultSelctedkeys = dataSource.map((item: any) => item.columnCode);
 
                 setTargetKeys(defaultSelctedkeys);
@@ -350,7 +350,7 @@ const ReportSetting = () => {
                 }));
 
                 const resp = await addReportTableList(result);
-                
+
                 if (resp) {
                     message.success('添加成功!');
                     getTableData({ reportCode: currentSelectedType.code });
@@ -448,6 +448,30 @@ const ReportSetting = () => {
                 </a>
             ),
         },
+        {
+            key: '3',
+            label: (<a onClick={async (e) => {
+                e.preventDefault();
+                // 选取要复制的文本
+                const textToCopy =currentEditLeftData.code;
+
+                // 创建一个临时的textarea元素
+                const tempTextArea = document.createElement("textarea");
+                tempTextArea.value = textToCopy;
+                document.body.appendChild(tempTextArea);
+
+                // 选中并复制文本
+                tempTextArea.select();
+                document.execCommand("copy");
+
+                // 移除临时元素
+                document.body.removeChild(tempTextArea);
+                message.success('复制成功!');
+
+            }}>
+                复制报表code
+            </a>),
+        },
     ];
 
 
@@ -509,25 +533,25 @@ const ReportSetting = () => {
                 width: 60,
                 className: 'drag-visible',
                 render: () => <DragHandle />
-            }, ...column, 
-            // {
-            //     title: '操作',
-            //     key: 'option',
-            //     width: 120,
-            //     valueType: 'option',
-            //     render: (_: any, record: any) => {
-            //         return [
-            //             <Popconfirm
-            //                 title="是否确认移除?"
-            //                 key="del"
-            //                 onConfirm={() => { delData(record.id); getTableData({ reportCode: currentSelectedType.code }); }}
-            //             >
-            //                 <a>移除</a>
-            //             </Popconfirm>
-            //         ]
-            //     },
-            // }
-        ])
+            }, ...column,
+                // {
+                //     title: '操作',
+                //     key: 'option',
+                //     width: 120,
+                //     valueType: 'option',
+                //     render: (_: any, record: any) => {
+                //         return [
+                //             <Popconfirm
+                //                 title="是否确认移除?"
+                //                 key="del"
+                //                 onConfirm={() => { delData(record.id); getTableData({ reportCode: currentSelectedType.code }); }}
+                //             >
+                //                 <a>移除</a>
+                //             </Popconfirm>
+                //         ]
+                //     },
+                // }
+            ])
         } else {
             set_tableColumn(column);
         }
@@ -569,21 +593,21 @@ const ReportSetting = () => {
                                 <div className={currentSelectedType ? currentSelectedType.id == item.id ? 'type on' : 'type' : 'type'}
                                     key={index}
                                     onClick={() => {
-                                           if(ifEditTable){
-                                               //编辑状态还未保存
-                                               Modal.confirm({
-                                                   title:'当前存在编辑未保存,请保存后再操作!',
-                                                   okText:'放弃编辑',
-                                                   cancelText:'继续编辑',
-                                                   onOk(...args) {
-                                                      set_ifEditTable(false);
-                                                      set_currentSelectedType(item);
-                                                      getTableData({ reportCode: item.code });
-                                                   },
-                                               })
-                                           }else{
+                                        if (ifEditTable) {
+                                            //编辑状态还未保存
+                                            Modal.confirm({
+                                                title: '当前存在编辑未保存,请保存后再操作!',
+                                                okText: '放弃编辑',
+                                                cancelText: '继续编辑',
+                                                onOk(...args) {
+                                                    set_ifEditTable(false);
+                                                    set_currentSelectedType(item);
+                                                    getTableData({ reportCode: item.code });
+                                                },
+                                            })
+                                        } else {
                                             set_currentSelectedType(item)
-                                           }
+                                        }
                                     }}
                                 >
                                     <img className='icon' src={require('../../../../../static/reportIcon.png')} alt="" />

+ 3 - 0
src/pages/setting/reportSet/reportSetting/style.less

@@ -76,6 +76,9 @@
             color: #17181A;
             line-height: 15px;
             margin-bottom: 8px;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
           }
 
           .sub {

+ 55 - 0
src/services/getDic.ts

@@ -0,0 +1,55 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-04-20 14:06:17
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-04-20 14:45:29
+ * @FilePath: /BudgetManaSystem/src/services/getDic.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+
+
+
+
+import { request } from "@umijs/max"
+
+
+//从公共字典获取数据
+export const getPubDicDataByKey =  () => {
+    
+    return request('/performance/dict', {
+        method: 'GET',
+    });    
+}
+
+// 筛选指定的字典数据
+
+export const getDataByKeyFromDic = (dicData:any[],key: string) => {
+
+    let result = dicData.filter((t: any) => (t.code == key));
+
+    if (result.length > 0) {
+
+      let dataArr = result[0].dataVoList;
+
+      let defaultValue = dataArr.filter((t:any) => t.defaultValue == 1);
+
+      dataArr.sort((prev:any, next:any) => {
+        return prev.sort - next.sort;
+      });
+
+      return {
+        defaultvalue: defaultValue[0] ? defaultValue[0].value : '',
+        list: dataArr.map((t:any) => {
+          return ({ label: t.name, value: t.code })
+        })
+      }
+    }
+
+    return {
+      defaultvalue: '',
+      list: []
+    };
+  }

Файловите разлики са ограничени, защото са твърде много
+ 380 - 380
yarn.lock


Някои файлове не бяха показани, защото твърде много файлове са промени