|
@@ -2,7 +2,7 @@
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Date: 2023-03-03 11:30:33
|
|
* @Date: 2023-03-03 11:30:33
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
- * @LastEditTime: 2023-04-07 12:14:31
|
|
|
|
|
|
+ * @LastEditTime: 2023-04-07 12:33:52
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
|
|
* @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
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
*/
|
|
@@ -17,7 +17,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
|
|
import { ActionType, arrayMoveImmutable, useRefFunction } from '@ant-design/pro-components';
|
|
import { ActionType, arrayMoveImmutable, useRefFunction } from '@ant-design/pro-components';
|
|
import { ModalForm, ProFormSelect, ProFormText } from '@ant-design/pro-form';
|
|
import { ModalForm, ProFormSelect, ProFormText } from '@ant-design/pro-form';
|
|
import { ProColumns } from '@ant-design/pro-table';
|
|
import { ProColumns } from '@ant-design/pro-table';
|
|
-import { Dropdown, Input, MenuProps, message, Modal,Popconfirm,Switch, Table } from 'antd';
|
|
|
|
|
|
+import { Dropdown, Input, MenuProps, message, Modal, Popconfirm, Switch, Table } from 'antd';
|
|
import { ColumnsType, TableRowSelection } from 'antd/es/table/interface';
|
|
import { ColumnsType, TableRowSelection } from 'antd/es/table/interface';
|
|
import Transfer, { TransferItem, TransferProps } from 'antd/es/transfer';
|
|
import Transfer, { TransferItem, TransferProps } from 'antd/es/transfer';
|
|
import React from 'react';
|
|
import React from 'react';
|
|
@@ -141,7 +141,7 @@ const ReportSetting = () => {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADD_LEFTDATA'|'EDIT_LEFTDATA') => {
|
|
|
|
|
|
+ const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA') => {
|
|
|
|
|
|
|
|
|
|
if (type == 'ADD_LEFTDATA') {
|
|
if (type == 'ADD_LEFTDATA') {
|
|
@@ -155,7 +155,7 @@ const ReportSetting = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
if (type == 'EDIT_LEFTDATA') {
|
|
if (type == 'EDIT_LEFTDATA') {
|
|
const resp = await editReport({
|
|
const resp = await editReport({
|
|
@@ -169,12 +169,12 @@ const ReportSetting = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(type == 'EDIT'){
|
|
|
|
|
|
+ if (type == 'EDIT') {
|
|
// console.log({dataSource,temp_dataSource});
|
|
// console.log({dataSource,temp_dataSource});
|
|
// return;
|
|
// return;
|
|
- let newDataSource = dataSource.map((a:any,index:number)=>{
|
|
|
|
- //更新排序
|
|
|
|
- return {...a,sort:index+1}
|
|
|
|
|
|
+ let newDataSource = dataSource.map((a: any, index: number) => {
|
|
|
|
+ //更新排序
|
|
|
|
+ return { ...a, sort: index + 1 }
|
|
})
|
|
})
|
|
const resp = await editReportTbaleData(newDataSource);
|
|
const resp = await editReportTbaleData(newDataSource);
|
|
set_ifEditTable(false);
|
|
set_ifEditTable(false);
|
|
@@ -187,8 +187,7 @@ const ReportSetting = () => {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADD_LEFTDATA'|'EDIT_LEFTDATA' }) => {
|
|
|
|
-
|
|
|
|
|
|
+ const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADD_LEFTDATA' | 'EDIT_LEFTDATA' }) => {
|
|
|
|
|
|
const getTrriger = () => {
|
|
const getTrriger = () => {
|
|
if (type == 'ADD') {
|
|
if (type == 'ADD') {
|
|
@@ -213,7 +212,7 @@ const ReportSetting = () => {
|
|
<ModalForm
|
|
<ModalForm
|
|
title={type == 'ADD_LEFTDATA' ? `新增医疗组` : `编辑医疗组`}
|
|
title={type == 'ADD_LEFTDATA' ? `新增医疗组` : `编辑医疗组`}
|
|
width={352}
|
|
width={352}
|
|
- initialValues={type == 'EDIT' ? { ...record } : {}}
|
|
|
|
|
|
+ initialValues={type == 'EDIT_LEFTDATA' ? { ...record } : {}}
|
|
trigger={
|
|
trigger={
|
|
getTrriger()
|
|
getTrriger()
|
|
}
|
|
}
|
|
@@ -275,10 +274,10 @@ const ReportSetting = () => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '列标题',
|
|
title: '列标题',
|
|
- width:120,
|
|
|
|
|
|
+ width: 120,
|
|
dataIndex: 'headerText',
|
|
dataIndex: 'headerText',
|
|
key: 'headerText',
|
|
key: 'headerText',
|
|
- ellipsis:true
|
|
|
|
|
|
+ ellipsis: true
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
@@ -311,17 +310,14 @@ const ReportSetting = () => {
|
|
|
|
|
|
//获取报表列管理
|
|
//获取报表列管理
|
|
const getFuncList = async () => {
|
|
const getFuncList = async () => {
|
|
- const resp = await getReportListTableData({pageSize:1000,current:1});
|
|
|
|
|
|
+ const resp = await getReportListTableData({ pageSize: 1000, current: 1 });
|
|
if (resp) {
|
|
if (resp) {
|
|
|
|
|
|
set_datasource(resp.list);
|
|
set_datasource(resp.list);
|
|
|
|
|
|
- // if (record && record.unitInfoVos) {
|
|
|
|
|
|
+ const defaultSelctedkeys = dataSource.map((item: any) => item.columnCode);
|
|
|
|
|
|
- // const defaultSelctedkeys = record.unitInfoVos.map((item: any) => item.unitCode);
|
|
|
|
-
|
|
|
|
- // setTargetKeys(defaultSelctedkeys);
|
|
|
|
- // }
|
|
|
|
|
|
+ setTargetKeys(defaultSelctedkeys);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -341,13 +337,13 @@ const ReportSetting = () => {
|
|
const needData = datasource.filter(item => targetKeys.includes(item.code));
|
|
const needData = datasource.filter(item => targetKeys.includes(item.code));
|
|
|
|
|
|
const result = needData.map(a => ({
|
|
const result = needData.map(a => ({
|
|
- reportCode:currentSelectedType.code,
|
|
|
|
- columnCode:a.code,
|
|
|
|
- columnHeaderText:a.headerText,
|
|
|
|
- columnName:a.name,
|
|
|
|
- sort:dataSource.length+1,
|
|
|
|
- primaryKey:0,
|
|
|
|
- hide:0
|
|
|
|
|
|
+ reportCode: currentSelectedType.code,
|
|
|
|
+ columnCode: a.code,
|
|
|
|
+ columnHeaderText: a.headerText,
|
|
|
|
+ columnName: a.name,
|
|
|
|
+ sort: dataSource.length + 1,
|
|
|
|
+ primaryKey: 0,
|
|
|
|
+ hide: 0
|
|
}));
|
|
}));
|
|
|
|
|
|
// console.log({result,record});
|
|
// console.log({result,record});
|
|
@@ -439,12 +435,12 @@ const ReportSetting = () => {
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
label: (
|
|
label: (
|
|
- <a onClick={async (e)=>{
|
|
|
|
- e.preventDefault();
|
|
|
|
- const resp = await delLeftReportData(currentEditLeftData.id);
|
|
|
|
- if(resp){
|
|
|
|
|
|
+ <a onClick={async (e) => {
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ const resp = await delLeftReportData(currentEditLeftData.id);
|
|
|
|
+ if (resp) {
|
|
getPageLeftReports();
|
|
getPageLeftReports();
|
|
- }
|
|
|
|
|
|
+ }
|
|
}}>
|
|
}}>
|
|
删除
|
|
删除
|
|
</a>
|
|
</a>
|
|
@@ -521,14 +517,14 @@ const ReportSetting = () => {
|
|
<Popconfirm
|
|
<Popconfirm
|
|
title="是否确认移除?"
|
|
title="是否确认移除?"
|
|
key="del"
|
|
key="del"
|
|
- onConfirm={() => {delData(record.id);getTableData({ reportCode: currentSelectedType.code });}}
|
|
|
|
|
|
+ onConfirm={() => { delData(record.id); getTableData({ reportCode: currentSelectedType.code }); }}
|
|
>
|
|
>
|
|
<a>删除</a>
|
|
<a>删除</a>
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
]
|
|
]
|
|
},
|
|
},
|
|
}])
|
|
}])
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
set_tableColumn(column);
|
|
set_tableColumn(column);
|
|
}
|
|
}
|
|
}, [ifEditTable]);
|
|
}, [ifEditTable]);
|
|
@@ -568,7 +564,16 @@ const ReportSetting = () => {
|
|
return (
|
|
return (
|
|
<div className={currentSelectedType ? currentSelectedType.id == item.id ? 'type on' : 'type' : 'type'}
|
|
<div className={currentSelectedType ? currentSelectedType.id == item.id ? 'type on' : 'type' : 'type'}
|
|
key={index}
|
|
key={index}
|
|
- onClick={() => set_currentSelectedType(item)}
|
|
|
|
|
|
+ onClick={() => {
|
|
|
|
+ if(ifEditTable){
|
|
|
|
+ //编辑状态还未保存
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title:'当前存在编辑未保存,请保存后再操作!'
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ set_currentSelectedType(item)
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
>
|
|
>
|
|
<img className='icon' src={require('../../../../../static/reportIcon.png')} alt="" />
|
|
<img className='icon' src={require('../../../../../static/reportIcon.png')} alt="" />
|
|
<div className='content'>
|
|
<div className='content'>
|
|
@@ -621,7 +626,7 @@ const ReportSetting = () => {
|
|
{
|
|
{
|
|
ifEditTable && (
|
|
ifEditTable && (
|
|
<div className='inner'>
|
|
<div className='inner'>
|
|
- <span className='save' onClick={()=>updateTable(undefined,'EDIT')}>保存</span>
|
|
|
|
|
|
+ <span className='save' onClick={() => updateTable(undefined, 'EDIT')}>保存</span>
|
|
<span className='add' onClick={() => addReportColumnHandle()}>添加列</span>
|
|
<span className='add' onClick={() => addReportColumnHandle()}>添加列</span>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|