Quellcode durchsuchen

新增管理指标,职类考核,指标分组权重

code4eat vor 2 Jahren
Ursprung
Commit
d0cb48d3c2

+ 22 - 1
.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-03-22 15:21:48
+ * @LastEditTime: 2023-03-29 16:02:56
  * @FilePath: /BudgetManaSystem/.umirc.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -90,6 +90,27 @@ export default defineConfig({
             }
           ]
         },
+        {
+          name: '管理绩效设置',
+          path: '/setting/manaPerformanceSet',
+          routes: [
+            {
+              name: '管理指标项目设定',
+              path: '/setting/manaPerformanceSet/manaIndicItemSet',
+              component: './setting/manaPerformanceSet/manaIndicItemSet',
+            },
+            {
+              name: '职类考核分级设定',
+              path: '/setting/manaPerformanceSet/classAssessAndGradeSet',
+              component: './setting/manaPerformanceSet/classAssessAndGradeSet',
+            },
+            {
+              name: '指标分组权重设定',
+              path: '/setting/manaPerformanceSet/indicGroupWeightSet',
+              component: './setting/manaPerformanceSet/indicGroupWeightSet',
+            }
+          ]
+        },
 
       ]
     },

Datei-Diff unterdrückt, da er zu groß ist
+ 275 - 270
package-lock.json


+ 2 - 0
package.json

@@ -18,9 +18,11 @@
     "@umijs/max": "^4.0.51",
     "antd": "^5.0.7",
     "axios": "^1.3.3",
+    "lodash": "^4.17.21",
     "mathjs": "^11.6.0"
   },
   "devDependencies": {
+    "@types/lodash": "^4.14.192",
     "@types/react": "^18.0.0",
     "@types/react-dom": "^18.0.0",
     "cross-env": "^7.0.3",

+ 24 - 2
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-03-22 15:21:18
+ * @LastEditTime: 2023-03-29 16:03:35
  * @FilePath: /BudgetManaSystem/src/app.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -23,7 +23,7 @@ import iconEnum from './menuIcons.js';
 import DevicePixelRatio from './utils/devicePixelRatio.js';
 
 import Icon, { createFromIconfontCN, NodeCollapseOutlined } from '@ant-design/icons';
-import { useModel } from '@umijs/max';
+
 
 const IconFont = createFromIconfontCN({
   scriptUrl: '//at.alicdn.com/t/c/font_3878861_tw9yqguouab.js',
@@ -343,6 +343,28 @@ export const layout = ({ initialState, setInitialState }: { initialState: any, s
                   }
                 ]
               },
+              {
+                path: '/setting/manaPerformanceSet',
+                name: '管理绩效设置',
+                icon:'',
+                children: [
+                  {
+                    path: '/setting/manaPerformanceSet/manaIndicItemSet',
+                    name: '管理指标项目设定',
+                    icon: '',
+                  },
+                  {
+                    path: '/setting/manaPerformanceSet/classAssessAndGradeSet',
+                    name: '职类考核分级设定',
+                    icon: '',
+                  },
+                  {
+                    path: '/setting/manaPerformanceSet/indicGroupWeightSet',
+                    name: '指标分组权重设定',
+                    icon: '',
+                  },
+                ]
+              },
             ],
           }
         ];

+ 24 - 3
src/components/BMSTable/index.tsx

@@ -2,11 +2,13 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-20 15:24:11
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-02-20 15:51:33
+ * @LastEditTime: 2023-03-27 16:37:22
  * @FilePath: /BudgetManaSystem/src/components/BMSTable/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
+import { deepEqual } from "@/utils/tooljs"
 import { ProTable, ProTableProps } from "@ant-design/pro-components"
+import { useEffect, useState } from "react"
 
 import './style.less'
 
@@ -14,9 +16,27 @@ export type BMSTablePropsType<T, U, ValueType> = ProTableProps<T, U, ValueType>
     
 }
 
+export const BMSTablePageDefaultConfig = {
+    defaultPageSize:10
+}
+
 export const BMSTable = (props: BMSTablePropsType<any, any, any>) => {
 
-    const { ...rest } = props;
+    const { params,...rest } = props;
+    // let prevParams:any = undefined;
+    const [prevParams,set_prevParams] = useState<any>(undefined);
+
+    useEffect(()=>{
+        // console.log({'deepEqual(prevParams,params)':deepEqual(prevParams,params)});
+        // console.log({prevParams,params});
+
+        if(deepEqual(prevParams,params)){
+            
+        }else{
+              
+        }
+        set_prevParams(params);
+    },[params])
     
     return (
         <ProTable
@@ -24,8 +44,9 @@ export const BMSTable = (props: BMSTablePropsType<any, any, any>) => {
             toolBarRender={false}
             options={false}
             pagination={{
-                defaultPageSize:10
+                   ...BMSTablePageDefaultConfig  
             }}
+            params={{...params}}
             bordered={false}
             search={false}
             tableStyle={{

+ 30 - 17
src/components/BMSUpload/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-02-15 16:48:56
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-02-23 15:37:20
+ * @LastEditTime: 2023-03-24 16:07:25
  * @FilePath: /BudgetManaSystem/src/components/BMSUpload/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -11,21 +11,24 @@
 
 import React, { useState } from 'react';
 import { InboxOutlined } from '@ant-design/icons';
-import type { UploadFile, UploadProps } from 'antd';
+import { Alert, UploadFile, UploadProps } from 'antd';
 import { Upload } from 'antd';
 
+import './style.less';
+
 const { Dragger } = Upload;
 
 type BMSUploadPropsType = {
-       onChange?:()=>void
-}|UploadProps
+    onChange?: () => void;
+    downloadTemplateFile?: () => void; //模板下载回调
+} & UploadProps
 
-const BMSUpload = (props:BMSUploadPropsType) => {
+const BMSUpload = (props: BMSUploadPropsType) => {
     const [fileList, setFileList] = useState<UploadFile[]>([]);
-    const {onChange} = props;
+    const { onChange, downloadTemplateFile } = props;
 
-    const config:UploadProps  = {
-        action:()=>Promise.resolve(''),
+    const config: UploadProps = {
+        action: () => Promise.resolve(''),
         name: 'file',
         multiple: false,
         beforeUpload: (file) => {
@@ -33,23 +36,33 @@ const BMSUpload = (props:BMSUploadPropsType) => {
             return false;
         },
         //onChange:onChange?onChange:()=>{},
-        onChange:(fileInfo)=>{
-            onChange&&onChange(fileInfo);
+        onChange: (fileInfo) => {
+            onChange && onChange(fileInfo);
         },
         onDrop(e) {
             console.log('Dropped files', e.dataTransfer.files);
         },
     };
 
+    const download = () => {
+        downloadTemplateFile && downloadTemplateFile()
+    }
 
     return (
-        <Dragger {...config}>
-            <p className="ant-upload-drag-icon">
-                <InboxOutlined style={{fontSize:50,color:'#3376FE'}} />
-            </p>
-            <p className="ant-upload-text">点击或拖入上传</p>
-            
-        </Dragger>
+        <div className='BMSUpload' style={{ paddingBottom: 16 }}>
+            <div className='toolBar'>
+                <span>文件下载</span>
+                <span onClick={() => download()}>模板下载</span>
+            </div>
+            <Alert message="注意,导入的数据将会覆盖当前数据" type="warning" style={{ height: 24, fontSize: 12, marginBottom: 16,marginTop:16 }} showIcon closable banner />
+            <Dragger {...config} height={140}>
+                <p className="ant-upload-drag-icon" style={{ marginBottom: 5 }}>
+                    <InboxOutlined style={{ fontSize: 50, color: '#3376FE' }} />
+                </p>
+                <p className="ant-upload-text">点击或将文件拖拽到这里上传</p>
+
+            </Dragger>
+        </div>
     )
 }
 

+ 30 - 0
src/components/BMSUpload/style.less

@@ -0,0 +1,30 @@
+.BMSUpload {
+  .kcmp-ant-form-item {
+    margin-bottom: 0 !important;
+  }
+
+  .toolBar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 16px;
+    margin-top: 16px;
+
+    &>span {
+      display: inline-block;
+      height: 15px;
+      font-size: 14px;
+      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+      font-weight: 400;
+      color: #17181A;
+      line-height:15px;
+
+      &:last-child {
+           cursor: pointer;
+           color: #3376FE;
+      }
+    }
+  }
+  
+}

+ 27 - 2
src/global.less

@@ -36,6 +36,11 @@ textarea {
         padding: 16px !important;
         .bms-ant-modal-body {
              .bms-ant-modal-confirm-body-wrapper {
+                   .bms-ant-modal-confirm-body {
+                       .bms-ant-modal-confirm-content {
+                          max-width: 100% !important;
+                       }
+                   }
                    .bms-ant-modal-confirm-btns {
                     display: flex;
                     flex-direction: row;
@@ -64,7 +69,7 @@ textarea {
                 display: flex;
                 justify-content: center;
                 align-items: center;
-                width: 56px;
+                min-width: 56px;
                 height: 24px;
                 border-radius: 4px;
 
@@ -190,6 +195,20 @@ textarea {
        border-radius: 4px;
 }
 
+.bms-ant-table-wrapper {
+    .bms-ant-table-content {
+        .bms-ant-table-thead {
+            tr {
+                &:last-child {
+                      .bms-ant-table-cell {
+                          border-top: 1px solid #dae2f2;
+                      }
+                }
+            }
+        }
+    }
+}
+
 .bms-ant-table-wrapper .bms-ant-table:not(.bms-ant-table-bordered) .bms-ant-table-tbody>tr.bms-ant-table-row:hover>td:first-child {
     border-start-start-radius:0 !important;
     border-end-start-radius:0 !important;
@@ -235,7 +254,7 @@ textarea {
       border: 1px solid #CFD7E6 !important;
   
       .bms-ant-select-selection-item {
-        line-height: 24px;
+        line-height: 24px !important;
       }
   
       .bms-ant-select-selection-search-input {
@@ -389,6 +408,10 @@ textarea {
 .bms-ant-input-number {
     border: 1px solid #CFD7E6 !important;
     color: #99A6BF !important;
+    .bms-ant-input-number-input {
+        height: 24px !important;
+        line-height: 24px !important;
+    }
 }
 
 .bms-ant-input-number-disabled {
@@ -425,3 +448,5 @@ textarea {
 
 
 
+
+

+ 9 - 8
src/pages/budgetMana/monthlyDataCheck/index.tsx

@@ -4,7 +4,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-08 11:11:39
+ * @LastEditTime: 2023-03-24 16:05:15
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -935,6 +935,7 @@ const MonthlyDataCheck: React.FC = () => {
 
         return (
             <ModalForm
+                width={360}
                 title={`导入${name}数据`}
                 trigger={
                     <span key="3">导入</span>
@@ -945,12 +946,12 @@ const MonthlyDataCheck: React.FC = () => {
                             return b.key != 'rest'
                         })
                         return [
-                            <Button
-                                key="ok"
-                                onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
-                            >
-                                下载模板
-                            </Button>,
+                            // <Button
+                            //     key="ok"
+                            //     onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
+                            // >
+                            //     下载模板
+                            // </Button>,
                             ...needBtn,
                         ];
                     },
@@ -973,7 +974,7 @@ const MonthlyDataCheck: React.FC = () => {
                 }}
             >
                 <FormItem name={'importFile'}>
-                    <BMSUpload />
+                    <BMSUpload downloadTemplateFile={auditType == '0' ? () => downloadTemplate(index) : () => { }} />
                 </FormItem>
 
             </ModalForm>

+ 6 - 4
src/pages/setting/baseSetting/businessDicMana/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-03-22 15:18:18
+ * @LastEditTime: 2023-03-30 16:10:13
  * @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
  */
@@ -11,7 +11,8 @@
 
 
 import BMSPagecontainer from '@/components/BMSPageContainer';
-import { BMSTable } from '@/components/BMSTable';
+import { BMSTable, BMSTablePageDefaultConfig } from '@/components/BMSTable';
+import { deepEqual } from '@/utils/tooljs';
 import { createFromIconfontCN } from '@ant-design/icons';
 import { ActionType } from '@ant-design/pro-components';
 import { ModalForm, ProFormDigit, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
@@ -33,7 +34,7 @@ const IconFont = createFromIconfontCN({
 
 const BusinessDicMana = () => {
 
-    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any|undefined>();
     const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
     const [reload, set_reload] = useState(false);
     const [typeList, set_typeList] = useState<any[]>([]);
@@ -50,7 +51,7 @@ const BusinessDicMana = () => {
         },
         {
             title: '项目代码',
-            dataIndex: 'typeCode',
+            dataIndex: 'code',
         },
         {
             title: '项目值',
@@ -297,6 +298,7 @@ const BusinessDicMana = () => {
                                 onPressEnter={(e)=>{
                                     set_tableDataFilterParams({
                                         ...tableDataFilterParams,
+                                        current:1,
                                         typeName:(e.target as HTMLInputElement).value
                                     });
                                 }}

+ 5 - 2
src/pages/setting/baseSetting/paramsMana/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-03-22 15:41:47
+ * @LastEditTime: 2023-03-28 16:10: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
  */
@@ -46,6 +46,10 @@ export default function ParamsMana() {
             title: '参数名称',
             dataIndex: 'name',
         },
+        {
+            title: '参数代码',
+            dataIndex: 'code',
+        },
         {
             title: '描述',
             dataIndex: 'description',
@@ -58,7 +62,6 @@ export default function ParamsMana() {
             title: '启用',
             dataIndex: 'status', 
             render: (_: any, record: any) => {
-                  console.log({_});
                   return _ == 1?'是':'否'
             } 
         },

+ 188 - 0
src/pages/setting/manaPerformanceSet/classAssessAndGradeSet/index.tsx

@@ -0,0 +1,188 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-30 17:07:26
+ * @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 { ActionType } from '@ant-design/pro-components';
+import { ModalForm, ProFormDigit } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import {  message } from 'antd';
+import { useEffect, useRef, useState } from 'react'
+
+import {editData, getData } from './service';
+
+import './style.less';
+
+
+export default function ClassAssessAndGradeSet() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableColumn, set_tableColumn] = useState<ProColumns[] | any[]>([]);
+
+    const tableRef = useRef<ActionType>();
+
+    const getTableData = async (params: any) => {
+        const resp = await getData(params);
+        if (resp) {
+
+            const { title, unitTypeData } = resp;
+            const columns = title.map((item: any) => {
+                if (item.children) {
+
+                    const children = item.children.map((a: any) => ({
+                        title: a.name,
+                        dataIndex: `${a.code}${item.code}`,
+                    }))
+
+                    return {
+                        title: item.name,
+                        dataIndex: `${item.code}`,
+                        key: `${item.code}`,
+                        // width: 140,
+                        children: children
+
+                    }
+                } else {
+                    return {
+                        title: item.name,
+                        dataIndex: `${item.code}`,
+                        key: `${item.code}`,
+                        // width: 140,
+
+                    }
+                }
+            });
+            set_tableColumn([{
+                title: '职类',
+                dataIndex: 'unitTypeName',
+                key: 'unitTypeName',
+                width: 140,
+                fixed: 'left',
+
+            }, ...columns, {
+                title: '操作',
+                key: 'option',
+                // width: 120,
+                valueType: 'option',
+                render: (_: any, record: any) => {
+                    return [
+                        <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    ]
+                },
+            },]);
+
+            const data = unitTypeData.map((item: any) => {
+
+                let rowData: { [key: string]: any } = {};
+
+                for (let index = 0; index < item.value.length; index++) {
+                    for (const key in item.value[index]) {
+                        if (key != 'code') {
+                            rowData[`${key}${item.value[index].code}`] = item.value[index][`${key}`]
+                        }
+                    }
+                }
+
+                return { ...item, ...rowData, id: item.id, columns }
+            });
+            return {
+                data,
+                success: true
+            }
+
+        }
+        return []
+    }
+
+
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+
+        let result = {
+            unitTypeCode:formVal.unitTypeCode,
+            unitTypeName:formVal.unitTypeName,
+            value:formVal.value.map((a:any)=>{
+                  return ({
+                    code:a.code,
+                    floor:formVal[`floor${a.code}`],
+                    rate:formVal[`rate${a.code}`],
+                    ceiling:formVal[`ceiling${a.code}`],
+                  })
+            })
+        }
+
+        //console.log({formVal,result});
+        
+        if (type == 'EDIT') {
+            const resp = await editData(result);
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+        return true;
+
+    }
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+    
+        return (
+            <ModalForm
+                title={`考核分级设定(${record.unitTypeName})`}
+                className='ClassAssessAndGradeSet-ModalForm'
+                width={400}
+                initialValues={type == 'EDIT' ? { ...record } : {}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
+                }
+                onFinish={(val) => {
+                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
+                }}
+
+            >
+                <div className='tip'>区间的上限及下限至少填写一个,没填表示无</div>
+                {
+                    record.value.map((item: any, index: number) => {
+
+                        let label = record.columns.filter((a:any) => a.key == item.code);
+
+                        return (
+                            <div className='list' key={index}>
+                                <div className='label'>{label.length > 0 ? `${label[0].title}:` : ''}</div>
+                                <div className='wrap'>
+                                    <ProFormDigit width={100} name={`floor${item.code}`} placeholder='分数下限' />
+                                    <ProFormDigit width={100} name={`ceiling${item.code}`} placeholder='分数上限' />
+                                    <ProFormDigit width={144} name={`rate${item.code}`} placeholder='惩罚系数' />
+                                </div>
+                            </div>
+                        )
+                    })
+                }
+            </ModalForm>
+        )
+    }
+
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <BMSPagecontainer className='ClassAssessAndGradeSet' title={'职类考核分级设定'}>
+            <div style={{ marginTop: 16 }}>
+                <BMSTable actionRef={tableRef} bordered rowKey='unitTypeCode' pagination={false} columns={tableColumn as ProColumns[]} params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </BMSPagecontainer>
+    )
+}

+ 44 - 0
src/pages/setting/manaPerformanceSet/classAssessAndGradeSet/service.ts

@@ -0,0 +1,44 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-29 15:44:03
+ * @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 const getData = (params?:any) => {
+  return request('/performance/managerIndicator/getManagerLevel', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+
+//编辑表格数据
+
+export const editData = (data:any) => {
+  return request('/performance/managerIndicator/editManagerLevel', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+
+
+
+
+
+
+

+ 86 - 0
src/pages/setting/manaPerformanceSet/classAssessAndGradeSet/style.less

@@ -0,0 +1,86 @@
+.ClassAssessAndGradeSet-ModalForm {
+  .tip {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 100%;
+    height: 24px;
+    font-size: 12px;
+    font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+    font-weight: 500;
+    color: #FF9933;
+    border-radius: 4px;
+    margin-bottom: 16px;
+    background: #FCF6F0;
+  }
+
+  .list {
+    .label {
+      height: 15px;
+      line-height: 15px;
+      font-size: 14px;
+      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+      font-weight: 400;
+      color: #17181A;
+      margin-bottom: 8px;
+
+      &::before {
+        position: relative;
+        display: inline-block;
+        content: '*';
+        color: #FF4060;
+      }
+    }
+
+    .wrap {
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+    }
+  }
+}
+
+.ClassAssessAndGradeSet {
+  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;
+      }
+    }
+
+  }
+}

+ 520 - 0
src/pages/setting/manaPerformanceSet/indicGroupWeightSet/index.tsx

@@ -0,0 +1,520 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-30 17:17:44
+ * @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 { createFromIconfontCN } from '@ant-design/icons';
+
+import { ActionType, ProFormDigit, ProFormSelect } from '@ant-design/pro-components';
+import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import { Input, message, Modal, Popconfirm, Table, Transfer } from 'antd';
+import { DefaultOptionType } from 'antd/es/select';
+import { ColumnsType, TableRowSelection } from 'antd/es/table/interface';
+import { TransferItem, TransferProps } from 'antd/es/transfer';
+import React, { useImperativeHandle } from 'react';
+import { useEffect, useRef, useState } from 'react'
+import { getManaIndicListData } from '../manaIndicItemSet/service';
+
+import difference from 'lodash/difference';
+
+import { addData, addIndicGroup, addUnitForGroup, delData, editData, getAllUnit, getData } from './service';
+
+import './style.less';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_1927152_gfxzp431jpt.js',
+});
+
+const AddIconFont = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_3824256_kzhiq41zywa.js',
+});
+
+
+
+export default function IndicGroupWeightSet() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+
+    const [currentOperateRow, set_currentOperateRow] = useState<any | undefined>(undefined);  //当前操作的表格行数据
+
+    const tableRef = useRef<ActionType>();
+
+
+
+
+    const columns = [
+
+        {
+            title: '分组名称',
+            dataIndex: 'groupName',
+            width: 80
+        },
+        {
+            title: '组内单元名称',
+            dataIndex: 'unitInfoVos',
+            width: 300,
+            ellipsis: true,
+            render: (_: any, record: any) => {
+
+
+                if (record.unitInfoVos && typeof record.unitInfoVos == 'object') {
+                    return record.unitInfoVos.reduce((prev: any, cur: any) => `${prev.length > 0 ? prev + ' | ' : prev}${cur.unitName}`, '')
+                }
+                return ''
+
+            }
+        },
+        {
+            title: '管理指标',
+            ellipsis: true,
+            width: 300,
+            dataIndex: 'indicatorWeights',
+            render: (_: any, record: any) => {
+
+
+                if (record.indicatorWeights && typeof record.indicatorWeights == 'object') {
+                    return record.indicatorWeights.reduce((prev: any, cur: any) => `${prev.length > 0 ? prev + ' | ' : prev}${cur.indicatorName}`, '')
+                }
+                return ''
+
+            }
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <a key={'fuc'} onClick={() => addFuncHandle(record)}>单元</a>,
+                    <UpDataActBtn key={'act_INDICATOR'} record={record} type='INDICATOR' />,
+                    <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 getData(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' | 'INDICATOR' | 'UNIT') => {
+
+        if (type == 'ADD') {
+            const resp = await addData({ ...formVal });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+        if (type == 'EDIT') {
+            const resp = await editData({ ...formVal });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+
+        if (type == 'INDICATOR') {
+            const resp = await addIndicGroup({ ...formVal });
+            if (resp) {
+                tableRef.current?.reload();
+                message.success('操作成功!');
+            }
+        }
+
+
+        return true;
+
+    }
+
+
+    interface DataType {
+        key: string;
+        title: string;
+        description: string;
+        disabled: boolean;
+        tag: string;
+    }
+
+    interface TableTransferProps extends TransferProps<TransferItem> {
+        dataSource: DataType[];
+        leftColumns: ColumnsType<DataType>;
+        rightColumns: ColumnsType<DataType>;
+        record: any
+    }
+
+
+    const transferTableColumn = [
+        {
+            title: '核算单元名称',
+            dataIndex: 'unitName',
+            key: 'unitName',
+
+        },
+        {
+            title: '职类',
+            dataIndex: 'unitType',
+            key: 'unitType',
+            render: (_: any, record: any) => {
+                switch (parseInt(record.unitType)) {
+                    case 1:
+                        return '临床'
+                        break;
+                    case 2:
+                        return '医技'
+                        break;
+                    case 3:
+                        return '护理'
+                        break;
+                    case 6:
+                        return '行政后勤'
+                        break;
+                    default:
+                        break;
+                }
+            }
+        },
+    ]
+
+
+    const addFuncHandle = (record: any) => {
+        set_currentOperateRow(record);
+        const ref = React.createRef<{ save: any; }>();
+
+        Modal.confirm({
+            title: '添加分组核算单元',
+            icon: <></>,
+            width: 672,
+            content: <TableTransfer
+                ref={ref}
+                record={record}
+                leftColumns={transferTableColumn}
+                rightColumns={transferTableColumn} dataSource={[]}
+            ></TableTransfer>,
+            onOk: () => {
+                return ref.current && ref.current.save();
+            }
+        })
+    }
+
+    const TableTransfer = React.forwardRef(({ leftColumns, rightColumns, record, ...restProps }: TableTransferProps, ref) => {
+
+        const [_data, _set_data] = useState<any>();
+        const [targetKeys, setTargetKeys] = useState<string[]>([]);
+        const [datasource, set_datasource] = useState<any[]>([]);
+        const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
+
+        //获取单元
+        const getFuncList = async () => {
+            const resp = await getAllUnit();
+            if (resp) {
+
+                set_datasource(resp);
+
+                if (record && record.unitInfoVos) {
+
+                    const defaultSelctedkeys = record.unitInfoVos.map((item: any) => item.unitCode);
+
+                    setTargetKeys(defaultSelctedkeys);
+                }
+
+            }
+        }
+
+        const onChange = (nextTargetKeys: string[]) => {
+            setTargetKeys(nextTargetKeys);
+        };
+
+        const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
+            //console.log('sourceSelectedKeys:', sourceSelectedKeys,'targetSelectedKeys:',targetSelectedKeys);
+            setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
+        };
+
+        useImperativeHandle(ref, () => ({
+            save: async () => {
+
+                const needData = datasource.filter(item => targetKeys.includes(item.code));
+
+                const result = needData.map(a=>({unitCode:a.code,unitName:a.unitName}))
+        
+                const resp = await addUnitForGroup({
+                    id: record.id,
+                    unitInfoVos: result
+                });
+                if (resp) {
+                    tableRef.current?.reload();
+                }
+            }
+        }));
+
+        useEffect(() => {
+            getFuncList();
+        }, [])
+
+        return (
+            <Transfer className='TableTransfer' showSearch
+                titles={['待选项', '已选项']}
+                locale={{
+                    itemUnit: '项',
+                    itemsUnit: '项',
+                    searchPlaceholder: '请输入'
+                }}
+                onChange={onChange}
+                onSelectChange={onSelectChange}
+                dataSource={datasource}
+                rowKey={record => record.code}
+                targetKeys={targetKeys}
+                selectedKeys={selectedKeys}
+                filterOption={(inputValue, item) => {
+                    return item.name!.indexOf(inputValue) !== -1
+
+                }}
+            >
+                {({
+                    direction,
+                    filteredItems,
+                    onItemSelectAll,
+                    onItemSelect,
+                    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(({ code }) => code);
+                            const diffKeys = selected
+                                ? difference(treeSelectedKeys, listSelectedKeys)
+                                : difference(listSelectedKeys, treeSelectedKeys);
+                            onItemSelectAll(diffKeys as string[], selected);
+                        },
+                        onSelect({ code }, selected) {
+                            onItemSelect(code as string, selected);
+                        },
+                        selectedRowKeys: listSelectedKeys,
+                    };
+
+                    return (
+                        <Table
+                            rowSelection={rowSelection}
+                            columns={columns as TransferItem[]}
+                            dataSource={filteredItems}
+                            size="small"
+                            rowKey={'code'}
+                            style={{ pointerEvents: listDisabled ? 'none' : undefined }}
+                            onRow={({ code, disabled: itemDisabled }) => ({
+                                onClick: () => {
+                                    if (itemDisabled || listDisabled) return;
+                                    onItemSelect(code as string, !listSelectedKeys.includes(code as string));
+                                },
+                            })}
+                        />
+                    );
+                }}
+            </Transfer>
+        )
+    })
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'INDICATOR' | 'UNIT' }) => {
+
+
+        const [indicatorData, set_indicatorData] = useState<any[]>([]);
+
+        const triggerNode = () => {
+            if (type == 'ADD') {
+                return <span className='add'>新增</span>
+            }
+            if (type == 'EDIT') {
+                return <a key="edit" >编辑</a>
+            }
+            if (type == 'INDICATOR') {
+                return <a key="INDICATOR" >指标</a>
+            }
+            if (type == 'UNIT') {
+                return <a key="UNIT" >单元</a>
+            }
+        }
+
+        const title = () => {
+            if (type == 'ADD') {
+                return '新增指标分组'
+            }
+            if (type == 'EDIT') {
+                return '编辑指标分组'
+            }
+            if (type == 'INDICATOR') {
+                return '分组指标设置'
+            }
+            if (type == 'UNIT') {
+                return '单元设置'
+            }
+        }
+
+
+        const addIndicator = () => {
+            set_indicatorData([...indicatorData, {}]);
+        }
+
+
+        useEffect(() => {
+            if (type == 'INDICATOR') {
+                set_indicatorData([{}]);
+            }
+        }, [type]);
+
+        useEffect(() => {
+            // console.log({ indicatorData });
+        }, [indicatorData]);
+
+        return (
+
+            <ModalForm
+                title={title()}
+                width={352}
+                className='IndicGroupWeightSet-ModalForm'
+                initialValues={type == 'EDIT' ? { ...record } : {}}
+                trigger={
+                    triggerNode()
+                }
+                onFinish={(val) => {
+                    if (type == 'ADD') {
+                        return updateTable({ ...val }, type)
+                    }
+                    if (type == 'EDIT') {
+                        return updateTable({ ...record, ...val }, type)
+                    }
+                    if (type == 'INDICATOR') {
+                        return updateTable({ id: record.id, indicatorWeights: indicatorData }, type)
+                    }
+
+                    return Promise.resolve(true);
+                    // if (type == 'UNIT') {
+                    //     return { id:record.id,indicatorWeights:indicatorData }
+                    // }
+                }}
+            >
+                {
+                    (type == 'EDIT' || type == 'ADD') && (
+                        <>
+                            <ProFormText
+                                name="groupName"
+                                label="分组名称:"
+                                placeholder="请输入"
+                                rules={[{ required: true, message: '名称不能为空!' }]}
+                            />
+                            <ProFormTextArea name={'depiction'} label='说明:' />
+                        </>
+                    )
+                }
+                {
+                    type == 'INDICATOR' && (
+                        <div>
+                            {
+                                indicatorData.map((item: any, index: number) => {
+                                    return (
+                                        <div className='item' key={index}>
+                                            <ProFormSelect label="管理指标:" width={160} request={async () => {
+                                                const resp = await getManaIndicListData();
+                                                if (resp) {
+                                                    return resp.list.map((a: any) => ({
+                                                        label: a.name,
+                                                        value: a.id
+                                                    }))
+                                                }
+                                                return []
+
+                                            }}
+                                                fieldProps={{
+                                                    //   labelInValue:true,
+                                                    onChange(value, option:any) {
+                                                        let temp = indicatorData;
+                                                        temp[index] = { ...temp[index], indicatorCode: value, indicatorName: option.label }
+                                                        set_indicatorData([...temp]);
+                                                    },
+                                                }}
+                                            />
+                                            <ProFormDigit label='占比:' width={120} fieldProps={{
+                                                onChange(value) {
+                                                    let temp = indicatorData;
+                                                    temp[index] = { ...temp[index], weight: value };
+                                                    set_indicatorData([...temp]);
+                                                },
+                                            }} />
+                                            <span className='delIcon'><IconFont type="iconshanchu" /></span>
+                                        </div>
+                                    )
+                                })
+                            }
+                            <div className='addBtn' onClick={() => addIndicator()}>
+                                <AddIconFont type="icon-zengjia" style={{ color: '#3376FE' }} /><span>增加一行</span>
+                            </div>
+                        </div>
+                    )
+                }
+
+            </ModalForm>
+        )
+    }
+
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <BMSPagecontainer className='IndicGroupWeightSet' title={'指标分组权重设置'}>
+            <div className='toolBar'>
+                <div className='filter'>
+
+                </div>
+                <div className='btnGroup' style={{ position: 'absolute', right: 16, top: 16 }}>
+                    <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>
+    )
+}

+ 108 - 0
src/pages/setting/manaPerformanceSet/indicGroupWeightSet/service.ts

@@ -0,0 +1,108 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-30 17:10:16
+ * @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 IndcGroupWeightItemTableRowType = {
+  id:number;
+  hospId:number;
+  groupCode:string;
+  groupName:string;
+  unitInfoVos:any[];
+  indicatorWeights:any[]
+}
+
+
+export const getData = (params?:any) => {
+  return request<IndcGroupWeightItemTableRowType[]>('/performance/managerIndicator/groupList', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增表格数据
+export type AddTableDataType = {
+  groupName:string;
+  depiction:string;
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/performance/managerIndicator/groupAdd', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type EditTableDataType = {
+    id:number
+}&AddTableDataType
+
+export const editData = (data:EditTableDataType) => {
+  return request('/performance/managerIndicator/groupEdit', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (groupId:string) => {
+  return request('/performance/managerIndicator/groupDelete', {
+    method: 'POST',
+    params:{groupId}
+  });
+};
+
+
+//新增指标分组
+
+export const addIndicGroup = (data:{id:number,indicatorWeights:[]}) => {
+  return request('/performance/managerIndicator/addGroupWeight', {
+    method: 'POST',
+    data
+  });
+};
+
+
+//获取所有单元
+
+export const getAllUnit = (unitCode?:string) => {
+  return request('/performance/kpi/getUnitList', {
+    method: 'GET',
+    params:{unitCode}
+  });
+};
+
+
+//分组添加单元
+
+export const addUnitForGroup = (data:{id:number,unitInfoVos:any[]}) => {
+  return request('/performance/managerIndicator/addGroupUnit', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+
+
+
+
+
+
+

+ 83 - 0
src/pages/setting/manaPerformanceSet/indicGroupWeightSet/style.less

@@ -0,0 +1,83 @@
+.IndicGroupWeightSet-ModalForm {
+  .item {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+
+    .delIcon {
+      position: relative;
+      top:3px;
+      cursor: pointer;
+      display:flex;
+      justify-content: center;
+      align-items: center;
+      width: 24px;
+      height: 24px;
+      background: #FAFCFF;
+      border-radius: 4px;
+      border: 1px solid #DAE2F2;
+    }
+  }
+  .addBtn {
+    cursor: pointer;
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    width: 320px;
+    height: 40px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    color: #3376FE;
+    border: 1px dashed #CFD6E6;
+
+    &>span {
+       margin-left: 8px;
+    }
+  }
+}
+
+.IndicGroupWeightSet {
+  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;
+      }
+    }
+
+  }
+}

+ 282 - 0
src/pages/setting/manaPerformanceSet/manaIndicItemSet/index.tsx

@@ -0,0 +1,282 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-30 16:55:35
+ * @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 { createFromIconfontCN } from '@ant-design/icons';
+
+import { ActionType, ProFormRadio } from '@ant-design/pro-components';
+import { ModalForm, ProFormCascader, ProFormDependency, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import { Input, message, Popconfirm } from 'antd';
+import { useEffect, useRef, useState } from 'react'
+
+import { addData, delData, editData, getManaIndicListData } from './service';
+
+import './style.less';
+
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_1927152_4nm5kxbv4m3.js',
+});
+
+
+
+export default function manaIndicItemSet() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+    const tableRef = useRef<ActionType>();
+
+
+
+
+    const columns = [
+
+        {
+            title: '管理指标名称',
+            dataIndex: 'name',
+        },
+        {
+            title: '指标导向',
+            dataIndex: 'guideName',
+        },
+        {
+            title: '得分下限',
+            dataIndex: 'scoreFloor',
+        },
+        {
+            title: '得分上限',
+            dataIndex: 'scoreCeiling',
+        },
+        {
+            title: '数据格式',
+            dataIndex: 'dataTypeName',
+        },
+        {
+            title: 'SQL',
+            dataIndex: 'sql',
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <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 getManaIndicListData(params);
+        if (resp) {
+            return {
+                data: resp.list,
+                success: true,
+                total: resp.totalCount,
+                pageSize: resp.pageSize,
+                totalPage: resp.totalPage,
+            }
+        }
+        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") => {
+
+        if (type == 'ADD') {
+            const resp = await addData({ ...formVal });
+            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 UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}管理指标项目`}
+                width={352}
+                initialValues={type == 'EDIT' ? { ...record } : {}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
+                }
+                onFinish={(val) => {
+                    return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
+                }}
+                colProps={{ span: 24 }}
+                grid
+            >
+
+                <ProFormText
+                    name="name"
+                    label="管理指标名称:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '指标名称不能为空!' }]}
+                />
+                <ProFormSelect
+                    name="guide"
+                    label="指标导向"
+                    placeholder="请选择"
+                    options={[
+                        { label: '正向', value: 1 },
+                        { label: '负向', value: 2 }
+                    ]}
+                    rules={[{ required: true, message: '指标导向不能为空!' }]}
+                />
+                <ProFormDigit
+                    name="scoreFloor"
+                    label="得分下限:"
+                    placeholder="请输入"
+                    min={0.01}
+                    rules={[{ required: true, message: '得分下限不能为空!' }]}
+                />
+                <ProFormDigit
+                    name="scoreCeiling"
+                    label="得分上限:"
+                    placeholder="请输入"
+                    min={0.01}
+                    rules={[{ required: true, message: '得分上限不能为空!' }]}
+                />
+                <ProFormRadio.Group
+                    name="dataType"
+                    label="数据格式:"
+                    fieldProps={{
+                        buttonStyle: 'solid'
+                    }}
+                    options={[
+                        {
+                            label: '数值',
+                            value: 1,
+                        },
+                        {
+                            label: '百分比',
+                            value: 2,
+                        },
+                    ]}
+                    rules={[{ required: true, message: '默认不能为空!' }]}
+                />
+                <ProFormRadio.Group
+                    name="source"
+                    label="数据来源:"
+                    fieldProps={{
+                        buttonStyle: 'solid'
+                    }}
+                    options={[
+                        {
+                            label: '填报',
+                            value: 1,
+                        },
+                        {
+                            label: '自动获取',
+                            value: 2,
+                        },
+                    ]}
+                    rules={[{ required: true, message: '默认不能为空!' }]}
+                />
+                <ProFormDependency name={['source']}>
+                    {
+                        ({ source }) => source == 2 && (
+                            <ProFormTextArea name={'sql'} label='SQL:' rules={[{ required: true, message: 'SQL不能为空!' }]} />
+                        )
+                    }
+                </ProFormDependency>
+
+            </ModalForm>
+        )
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+    }
+
+
+    useEffect(() => {
+
+    }, [])
+
+    return (
+        <BMSPagecontainer className='ManaIndicItemSet' 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('name')} />
+                            }
+                            onChange={(e) => {
+                                set_tableDataSearchKeywords(e.target.value);
+                                if (e.target.value.length == 0) {
+                                    set_tableDataFilterParams({
+                                        ...tableDataFilterParams,
+                                        name: ''
+                                    });
+                                }
+                            }}
+                            onPressEnter={(e) => {
+
+                                set_tableDataFilterParams({
+                                    ...tableDataFilterParams,
+                                    name: (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[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </BMSPagecontainer>
+    )
+}

+ 106 - 0
src/pages/setting/manaPerformanceSet/manaIndicItemSet/service.ts

@@ -0,0 +1,106 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-30 10:30:33
+ * @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 ManaIndicItemTableRowType = {
+  id:number;
+  name:string;
+  hospId:string;
+  code:string;
+  guide:number;
+  guideName:string;
+  scoreType:number;
+  scoreTypeName:string;
+  scoreCeiling:number;
+  scoreFloor:number;
+  dataType:number;
+  dataTypeName:number;
+  source:number;
+  sourceName:string;
+}
+
+
+export const getManaIndicListData = (params?:any) => {
+  return request<{
+       current:number;
+       list:ManaIndicItemTableRowType[];
+       pageSize:number;
+       totalCount:number;
+       totalPage:number;
+  }>('/performance/managerIndicator/list', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增表格数据
+export type AddTableDataType = {
+  hospId:number;
+  code:string;
+  name:string;
+  guide:number;
+  scoreType:number;
+  scoreCeiling:number;
+  scoreFloor:number;
+  dataType:number;
+  source:number;
+}
+
+export const addData = (data:AddTableDataType) => {
+  return request('/performance/managerIndicator/add', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+
+export type ManaIndicItemTableRowEditType = {
+  id:number;
+  hospId:number;
+  code:string;
+  name:string;
+  guide:number;
+  scoreType:number;
+  scoreCeiling:number;
+  scoreFloor:number;
+  dataType:number;
+  source:number;
+}
+
+export const editData = (data:ManaIndicItemTableRowEditType) => {
+  return request('/performance/managerIndicator/edit', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (id:string) => {
+  return request('/performance/managerIndicator/delete', {
+    method: 'POST',
+    params:{id}
+  });
+};
+
+
+
+
+
+
+
+

+ 43 - 0
src/pages/setting/manaPerformanceSet/manaIndicItemSet/style.less

@@ -0,0 +1,43 @@
+.ManaIndicItemSet {
+  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;
+      }
+    }
+
+  }
+}

+ 31 - 1
src/utils/tooljs.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-02-20 14:31:06
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-02-20 15:04:36
+ * @LastEditTime: 2023-03-27 10:18:39
  * @FilePath: /BudgetManaSystem/src/utils/tooljs.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -19,3 +19,33 @@ export const getDeepestTreeData:any= (tree:any,childrenName:string)=>{
 
       return  [tree,parent] 
 }
+
+
+
+
+
+/*
+ * @param x {Object} 对象1
+ * @param y {Object} 对象2
+ * @return  {Boolean} true 为相等,false 为不等
+ */
+export const deepEqual = (x: { [x: string]: any; } | null, y: { [x: string]: any; hasOwnProperty?: any; } | null) => {
+      // 指向同一内存时
+      if (x === y) {
+        return true;
+      } else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) {
+        if (Object.keys(x).length !== Object.keys(y).length) {
+          return false;
+        }
+        for (var prop in x) {
+          if (y.hasOwnProperty(prop)) {  
+            if (!deepEqual(x[prop], y[prop])) return false;
+          } else {
+            return false;
+          }
+        }
+        return true;
+      } else {
+        return false;
+      }
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 452 - 451
yarn.lock


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.