|
@@ -2,50 +2,70 @@
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Date: 2022-07-12 11:14:21
|
|
* @Date: 2022-07-12 11:14:21
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
- * @LastEditTime: 2024-12-02 14:05:44
|
|
|
|
|
|
+ * @LastEditTime: 2025-02-28 14:52:26
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/indicatorMana/index.tsx
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/indicatorMana/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
|
|
*/
|
|
*/
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
import { ActionType, ProColumns } from '@ant-design/pro-table';
|
|
import { ActionType, ProColumns } from '@ant-design/pro-table';
|
|
-import React, { useEffect, useRef, useState } from 'react'
|
|
|
|
-import { Button, Divider, Dropdown, Popconfirm } from 'antd'
|
|
|
|
|
|
+import React, { useEffect, useRef, useState } from 'react';
|
|
|
|
+import { Dropdown, Empty, Input, Popconfirm, Tabs } from 'antd';
|
|
|
|
|
|
import DrawerForm from './DrawerForm/drawer';
|
|
import DrawerForm from './DrawerForm/drawer';
|
|
-import { DownOutlined } from '@ant-design/icons';
|
|
|
|
-import { addIndicatorManaList, delIndicatorManaList, editIndicatorManaList, getIndicatorCateList, getIndicatorManaList, IndicatorManaItemType } from '@/service/indicator';
|
|
|
|
-import TreeDirectory from './TreeDirectory';
|
|
|
|
|
|
+import { createFromIconfontCN, DownOutlined } from '@ant-design/icons';
|
|
|
|
+import {
|
|
|
|
+ addIndicatorManaList,
|
|
|
|
+ delIndicatorManaList,
|
|
|
|
+ editIndicatorManaList,
|
|
|
|
+ getIndicatorCateList,
|
|
|
|
+ getIndicatorDetailReq,
|
|
|
|
+ getIndicatorManaList,
|
|
|
|
+ IndicatorManaItemType,
|
|
|
|
+ saveIndicatorBindItems,
|
|
|
|
+} from '@/service/indicator';
|
|
|
|
|
|
import './style.less';
|
|
import './style.less';
|
|
import { getIndicatorDictionary, IndicatorDictionaryDataType } from '@/service/dictionary';
|
|
import { getIndicatorDictionary, IndicatorDictionaryDataType } from '@/service/dictionary';
|
|
-import { useLocation } from 'umi';
|
|
|
|
|
|
+import { useHistory, useLocation, useModel, useParams } from 'umi';
|
|
import { KCIMLeftList } from '../../components/KCIMLeftList';
|
|
import { KCIMLeftList } from '../../components/KCIMLeftList';
|
|
import KCTable from '@/components/kcTable';
|
|
import KCTable from '@/components/kcTable';
|
|
import { KCInput } from '@/components/KCInput';
|
|
import { KCInput } from '@/components/KCInput';
|
|
|
|
+import generateTableData from '../dataFilling/fillingMana/generateTableData';
|
|
|
|
+import { DATAFILL_PERIODTYPE } from '../dataFilling/fillingMana';
|
|
|
|
|
|
|
|
+const defaultYear = new Date().getFullYear();
|
|
|
|
+let table_columns: any[] = [];
|
|
|
|
+let total_tableDataSource: any[] = [];
|
|
|
|
|
|
-const IndicatorMana = () => {
|
|
|
|
|
|
+const IconFont = createFromIconfontCN({
|
|
|
|
+ scriptUrl: '',
|
|
|
|
+});
|
|
|
|
|
|
|
|
+const IndicatorMana = () => {
|
|
const [reloadTable, set_reloadTable] = useState(false);
|
|
const [reloadTable, set_reloadTable] = useState(false);
|
|
const [drawerVisible, set_drawerVisible] = useState(false);
|
|
const [drawerVisible, set_drawerVisible] = useState(false);
|
|
const [indicateType, set_indicateType] = useState<IndicatorDictionaryDataType[]>([]);
|
|
const [indicateType, set_indicateType] = useState<IndicatorDictionaryDataType[]>([]);
|
|
const [currentEditRowData, set_currentEditRowData] = useState<any | undefined>(undefined);
|
|
const [currentEditRowData, set_currentEditRowData] = useState<any | undefined>(undefined);
|
|
const [indicatorCateTreeData, set_indicatorCateTreeData] = useState<any[]>([]);
|
|
const [indicatorCateTreeData, set_indicatorCateTreeData] = useState<any[]>([]);
|
|
const [defaultExpandedRowKeys, set_defaultExpandedRowKeys] = useState<string[]>([]);
|
|
const [defaultExpandedRowKeys, set_defaultExpandedRowKeys] = useState<string[]>([]);
|
|
- const [tableData, set_tableData] = useState<any[]>([]);
|
|
|
|
- const [cateId, set_cateId] = useState<string>();
|
|
|
|
|
|
|
|
|
|
+ const [cateId, set_cateId] = useState<string>();
|
|
|
|
+ const [tableColumns, set_tableColumns] = useState<ProColumns[]>([]);
|
|
const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
|
|
const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
- const [currentSelectedLeft,set_currentSelectedLeft] = useState<any>(undefined);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT'>('ADD');
|
|
|
|
-
|
|
|
|
|
|
+ const [currentSelectedLeft, set_currentSelectedLeft] = useState<any>(undefined);
|
|
|
|
+ const [actionType, set_actionType] = useState<'NORMAL' | 'DETAIL' | undefined>('NORMAL');
|
|
|
|
+ const [drawerActype, set_drawerActype] = useState<'ADD' | 'EDIT' | 'DATAMANA' | undefined>(undefined);
|
|
|
|
+ const [tableDataSource, set_tableDataSource] = useState<any[]>([]);
|
|
|
|
+ const [currentYear, set_currentYear] = useState(defaultYear);
|
|
|
|
+ const [currentEditRow, set_currentEditRow] = useState<any>(undefined);
|
|
|
|
+ const detailTableRef = useRef<ActionType>();
|
|
|
|
+
|
|
|
|
+ const [currentBigTab, set_currentBigTab] = useState('2');
|
|
const indicatorTableRef = useRef<ActionType>();
|
|
const indicatorTableRef = useRef<ActionType>();
|
|
-
|
|
|
|
|
|
+ const history: any = useHistory();
|
|
|
|
+ const [currentTab, set_currentTab] = useState('1');
|
|
|
|
+ const { indicatorType: indicatorUrlType }: { id: string; indicatorType: string } = history.location.query;
|
|
|
|
|
|
const columns: ProColumns<any>[] = [
|
|
const columns: ProColumns<any>[] = [
|
|
{
|
|
{
|
|
@@ -53,7 +73,6 @@ const IndicatorMana = () => {
|
|
dataIndex: 'name',
|
|
dataIndex: 'name',
|
|
hideInSearch: false,
|
|
hideInSearch: false,
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
-
|
|
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// title: '指标编码',
|
|
// title: '指标编码',
|
|
@@ -79,22 +98,21 @@ const IndicatorMana = () => {
|
|
request: async () => {
|
|
request: async () => {
|
|
const resp = await getIndicatorDictionary();
|
|
const resp = await getIndicatorDictionary();
|
|
if (resp) {
|
|
if (resp) {
|
|
- const data = resp.filter(t => t.code == 'IndicatorType');
|
|
|
|
|
|
+ const data = resp.filter((t) => t.code == 'IndicatorType');
|
|
if (data.length > 0) {
|
|
if (data.length > 0) {
|
|
- return data[0].children.map(t => ({ label: t.name, value: t.code }))
|
|
|
|
|
|
+ return data[0].children.map((t) => ({ label: t.name, value: t.code }));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return []
|
|
|
|
|
|
+ return [];
|
|
},
|
|
},
|
|
render: (text, record) => {
|
|
render: (text, record) => {
|
|
if (record) {
|
|
if (record) {
|
|
const { indicatorBoolean, indicatorTypeList } = record;
|
|
const { indicatorBoolean, indicatorTypeList } = record;
|
|
- return indicatorBoolean && indicatorTypeList ? (indicatorTypeList.map((t: any) => t.name)).join('/') : ''
|
|
|
|
|
|
+ return indicatorBoolean && indicatorTypeList ? indicatorTypeList.map((t: any) => t.name).join('/') : '';
|
|
} else {
|
|
} else {
|
|
- return ''
|
|
|
|
|
|
+ return '';
|
|
}
|
|
}
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '外部指标',
|
|
title: '外部指标',
|
|
@@ -105,28 +123,27 @@ const IndicatorMana = () => {
|
|
valueType: 'cascader',
|
|
valueType: 'cascader',
|
|
fieldProps: {
|
|
fieldProps: {
|
|
fieldNames: { label: 'name', value: 'code' },
|
|
fieldNames: { label: 'name', value: 'code' },
|
|
- placeholder: '请选择'
|
|
|
|
|
|
+ placeholder: '请选择',
|
|
},
|
|
},
|
|
|
|
|
|
request: async () => {
|
|
request: async () => {
|
|
const resp = await getIndicatorDictionary();
|
|
const resp = await getIndicatorDictionary();
|
|
if (resp) {
|
|
if (resp) {
|
|
- const data = resp.filter(t => t.code == 'IndicatorExternal');
|
|
|
|
|
|
+ const data = resp.filter((t) => t.code == 'IndicatorExternal');
|
|
if (data.length > 0) {
|
|
if (data.length > 0) {
|
|
- return data[0].children
|
|
|
|
|
|
+ return data[0].children;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return []
|
|
|
|
|
|
+ return [];
|
|
},
|
|
},
|
|
render: (text, record) => {
|
|
render: (text, record) => {
|
|
if (record) {
|
|
if (record) {
|
|
const { indicatorBoolean, indicatorExternalList } = record;
|
|
const { indicatorBoolean, indicatorExternalList } = record;
|
|
- return indicatorBoolean ? indicatorExternalList ? (indicatorExternalList.map((t: any) => t.name)).join('/') : '-' : ''
|
|
|
|
|
|
+ return indicatorBoolean ? (indicatorExternalList ? indicatorExternalList.map((t: any) => t.name).join('/') : '-') : '';
|
|
} else {
|
|
} else {
|
|
- return ''
|
|
|
|
|
|
+ return '';
|
|
}
|
|
}
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '指标编码',
|
|
title: '指标编码',
|
|
@@ -134,14 +151,12 @@ const IndicatorMana = () => {
|
|
width: 80,
|
|
width: 80,
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
-
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '指标定义',
|
|
title: '指标定义',
|
|
dataIndex: 'targetDefinition',
|
|
dataIndex: 'targetDefinition',
|
|
hideInSearch: true,
|
|
hideInSearch: true,
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
-
|
|
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
{
|
|
@@ -152,86 +167,98 @@ const IndicatorMana = () => {
|
|
render: (text, record) => {
|
|
render: (text, record) => {
|
|
const items = [
|
|
const items = [
|
|
{
|
|
{
|
|
- key: '1', label: <a key="linka" href={record.indicatorPath} target='_blank'>
|
|
|
|
- 数据展示
|
|
|
|
- </a>
|
|
|
|
|
|
+ key: '1',
|
|
|
|
+ label: (
|
|
|
|
+ <a
|
|
|
|
+ key="link"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ set_currentEditRow(record);
|
|
|
|
+ set_actionType('DETAIL');
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 相关数据
|
|
|
|
+ </a>
|
|
|
|
+ ),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ key: '2',
|
|
|
|
+ label: (
|
|
|
|
+ <a key="linka" href={record.indicatorPath} target="_blank">
|
|
|
|
+ 统计分析
|
|
|
|
+ </a>
|
|
|
|
+ ),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: '3', label: <Popconfirm
|
|
|
|
- title="是否确定删除?"
|
|
|
|
- onConfirm={() => delHandle(record)}
|
|
|
|
- okText="确定"
|
|
|
|
- cancelText="取消"
|
|
|
|
- key="link2"
|
|
|
|
- >
|
|
|
|
- <a>删除</a>
|
|
|
|
- </Popconfirm>
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ key: '3',
|
|
|
|
+ label: (
|
|
|
|
+ <Popconfirm title="是否确定删除?" onConfirm={() => delHandle(record)} okText="确定" cancelText="取消" key="link2">
|
|
|
|
+ <a>删除</a>
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ ),
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
|
|
if (record && record.indicatorBoolean) {
|
|
if (record && record.indicatorBoolean) {
|
|
return [
|
|
return [
|
|
<a key="link3" onClick={() => actionHandle('EDIT', record)}>
|
|
<a key="link3" onClick={() => actionHandle('EDIT', record)}>
|
|
- 管理
|
|
|
|
|
|
+ 管理
|
|
</a>,
|
|
</a>,
|
|
<Dropdown menu={{ items }}>
|
|
<Dropdown menu={{ items }}>
|
|
<a>
|
|
<a>
|
|
- <DownOutlined />
|
|
|
|
|
|
+ <DownOutlined />
|
|
</a>
|
|
</a>
|
|
- </Dropdown>
|
|
|
|
- ]
|
|
|
|
|
|
+ </Dropdown>,
|
|
|
|
+ ];
|
|
}
|
|
}
|
|
|
|
|
|
- return []
|
|
|
|
- }
|
|
|
|
- ,
|
|
|
|
|
|
+ return [];
|
|
|
|
+ },
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+ const IconFont = createFromIconfontCN({
|
|
|
|
+ scriptUrl: '',
|
|
|
|
+ });
|
|
|
|
|
|
const getIndicatorDir = async () => {
|
|
const getIndicatorDir = async () => {
|
|
const resp = await getIndicatorDictionary();
|
|
const resp = await getIndicatorDictionary();
|
|
if (resp) {
|
|
if (resp) {
|
|
set_indicateType(resp);
|
|
set_indicateType(resp);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const getData = async (params: any) => {
|
|
const getData = async (params: any) => {
|
|
const { current = 1, name, indicatorType, outsideIndexes } = params;
|
|
const { current = 1, name, indicatorType, outsideIndexes } = params;
|
|
if (cateId) {
|
|
if (cateId) {
|
|
const resp = await getIndicatorManaList({
|
|
const resp = await getIndicatorManaList({
|
|
- current: 1,
|
|
|
|
- pageSize: 0,
|
|
|
|
menuCode: cateId as string,
|
|
menuCode: cateId as string,
|
|
|
|
+ menuType: indicatorUrlType,
|
|
indicatorName: name,
|
|
indicatorName: name,
|
|
indicatorType: indicatorType,
|
|
indicatorType: indicatorType,
|
|
- outsideIndexes: outsideIndexes && outsideIndexes.length > 0 ? outsideIndexes[outsideIndexes.length - 1] : ''
|
|
|
|
|
|
+ outsideIndexes: outsideIndexes && outsideIndexes.length > 0 ? outsideIndexes[outsideIndexes.length - 1] : '',
|
|
});
|
|
});
|
|
|
|
|
|
if (resp && resp[0]) {
|
|
if (resp && resp[0]) {
|
|
|
|
+ // const getName: any = (obj: any) => {
|
|
|
|
|
|
- const getName: any = (obj: any) => {
|
|
|
|
-
|
|
|
|
- let isArr = Array.isArray(obj);
|
|
|
|
- let reslut = [];
|
|
|
|
- if (isArr) {
|
|
|
|
- obj.forEach((item: any) => {
|
|
|
|
- reslut.push(...getName(item));
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- reslut.push(obj.menuId)
|
|
|
|
-
|
|
|
|
- if (obj.children) {
|
|
|
|
- reslut.push(...getName(obj.children));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return reslut;
|
|
|
|
- }
|
|
|
|
|
|
+ // let isArr = Array.isArray(obj);
|
|
|
|
+ // let reslut = [];
|
|
|
|
+ // if (isArr) {
|
|
|
|
+ // obj.forEach((item: any) => {
|
|
|
|
+ // reslut.push(...getName(item));
|
|
|
|
+ // });
|
|
|
|
+ // } else {
|
|
|
|
+ // reslut.push(obj.menuId)
|
|
|
|
|
|
- set_tableData(resp[0].children as unknown as []);
|
|
|
|
|
|
+ // if (obj.children) {
|
|
|
|
+ // reslut.push(...getName(obj.children));
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // return reslut;
|
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
|
- set_defaultExpandedRowKeys(getName(resp[0].children));
|
|
|
|
|
|
+ // set_defaultExpandedRowKeys(getName(resp[0].children));
|
|
|
|
|
|
return {
|
|
return {
|
|
data: resp[0].children as unknown as [],
|
|
data: resp[0].children as unknown as [],
|
|
@@ -251,254 +278,371 @@ const IndicatorMana = () => {
|
|
data: [],
|
|
data: [],
|
|
success: false,
|
|
success: false,
|
|
total: 0,
|
|
total: 0,
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
|
|
const getIndicatorCateTree = async () => {
|
|
const getIndicatorCateTree = async () => {
|
|
- // console.log(location.search);
|
|
|
|
- let menuId = '';
|
|
|
|
- if (location.search.length > 0) {
|
|
|
|
- const searchArr = location.search.split('=');
|
|
|
|
- // console.log({ searchArr });
|
|
|
|
- if (searchArr[1]) {
|
|
|
|
- const resp = await getIndicatorCateList({ menuCode: searchArr[1] });
|
|
|
|
- if (resp) {
|
|
|
|
- set_indicatorCateTreeData(resp);
|
|
|
|
- }
|
|
|
|
|
|
+ if (indicatorUrlType) {
|
|
|
|
+ const resp = await getIndicatorCateList({ menuType: indicatorUrlType });
|
|
|
|
+ if (resp) {
|
|
|
|
+ set_indicatorCateTreeData(resp);
|
|
|
|
+ } else {
|
|
|
|
+ set_indicatorCateTreeData([]);
|
|
|
|
+ indicatorTableRef.current?.reload();
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const actionHandle = async (key: 'EDIT' | 'DEL', record: IndicatorDictionaryDataType) => {
|
|
const actionHandle = async (key: 'EDIT' | 'DEL', record: IndicatorDictionaryDataType) => {
|
|
-
|
|
|
|
set_currentEditRowData(record);
|
|
set_currentEditRowData(record);
|
|
if (key == 'EDIT') {
|
|
if (key == 'EDIT') {
|
|
set_drawerActype('EDIT');
|
|
set_drawerActype('EDIT');
|
|
set_drawerVisible(true);
|
|
set_drawerVisible(true);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const addHandle = () => {
|
|
const addHandle = () => {
|
|
set_drawerActype('ADD');
|
|
set_drawerActype('ADD');
|
|
set_currentEditRowData(undefined);
|
|
set_currentEditRowData(undefined);
|
|
set_drawerVisible(true);
|
|
set_drawerVisible(true);
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const delHandle = async (record: IndicatorDictionaryDataType) => {
|
|
const delHandle = async (record: IndicatorDictionaryDataType) => {
|
|
-
|
|
|
|
const resp = await delIndicatorManaList({ id: record.id });
|
|
const resp = await delIndicatorManaList({ id: record.id });
|
|
if (resp) {
|
|
if (resp) {
|
|
indicatorTableRef.current?.reload();
|
|
indicatorTableRef.current?.reload();
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const onVisibleChangeHandle = (bool: boolean) => {
|
|
const onVisibleChangeHandle = (bool: boolean) => {
|
|
-
|
|
|
|
if (!bool) {
|
|
if (!bool) {
|
|
set_drawerVisible(false);
|
|
set_drawerVisible(false);
|
|
}
|
|
}
|
|
if (bool) {
|
|
if (bool) {
|
|
set_drawerVisible(true);
|
|
set_drawerVisible(true);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const drawerFormCommitHanndle = async (data: any) => {
|
|
const drawerFormCommitHanndle = async (data: any) => {
|
|
- // const formData = Object.assign({}, data[0].baseInfoformRef, data[1].manaInfoformRef, data[2].showSetInfoformRef, data[3].adminInfoformRef);
|
|
|
|
- //const _formData = {...data[0].baseInfoformRef,...data[1].manaInfoformRef,...data[2].showSetInfoformRef,...data[3].adminInfoformRef}
|
|
|
|
-
|
|
|
|
- let formData: any;
|
|
|
|
- data.forEach((element: any) => {
|
|
|
|
- if (element.baseInfoformRef) {
|
|
|
|
- formData = { ...formData, ...element.baseInfoformRef }
|
|
|
|
- }
|
|
|
|
- if (element.manaInfoformRef) {
|
|
|
|
- formData = { ...formData, ...element.manaInfoformRef }
|
|
|
|
- }
|
|
|
|
- if (element.showSetInfoformRef) {
|
|
|
|
- formData = { ...formData, ...element.showSetInfoformRef }
|
|
|
|
- }
|
|
|
|
- if (element.adminInfoformRef) {
|
|
|
|
- formData = { ...formData, ...element.adminInfoformRef }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (drawerActype == 'ADD') {
|
|
|
|
- const resp = await addIndicatorManaList({
|
|
|
|
- ...formData,
|
|
|
|
- caseBreakdown: formData.caseBreakdown ? formData.caseBreakdown.join('/') : '',
|
|
|
|
- dataDownload: formData.dataDownload ? formData.dataDownload.join('/') : '',
|
|
|
|
- drillLevel: formData.drillLevel ? formData.drillLevel.join('/') : '',
|
|
|
|
- dataSum: formData.dataSum ? formData.dataSum.join('/') : '',
|
|
|
|
- chartType: formData.chartType ? formData.chartType.join('/') : '',
|
|
|
|
-
|
|
|
|
- indicatorMenuList: formData.indicatorMenuList ? formData.indicatorMenuList : [],
|
|
|
|
- indicatorTypeList: formData.indicatorTypeList ? formData.indicatorTypeList : [],
|
|
|
|
- indicatorExternalList: formData.indicatorExternalList ? formData.indicatorExternalList : [],
|
|
|
|
- divisionId: `${formData.divisionId}`,
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ if (drawerActype == 'DATAMANA') {
|
|
|
|
+ const resp = await saveIndicatorBindItems(data);
|
|
if (resp) {
|
|
if (resp) {
|
|
set_drawerVisible(false);
|
|
set_drawerVisible(false);
|
|
- indicatorTableRef.current?.reload();
|
|
|
|
|
|
+ getIndicatorDetail();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (drawerActype == 'EDIT') {
|
|
|
|
- const resp = await editIndicatorManaList({
|
|
|
|
- ...currentEditRowData,
|
|
|
|
- ...formData,
|
|
|
|
- caseBreakdown: formData.caseBreakdown ? formData.caseBreakdown.join('/') : '',
|
|
|
|
- dataDownload: formData.dataDownload ? formData.dataDownload.join('/') : '',
|
|
|
|
- drillLevel: formData.drillLevel ? formData.drillLevel.join('/') : '',
|
|
|
|
- dataSum: formData.dataSum ? formData.dataSum.join('/') : '',
|
|
|
|
- chartType: formData.chartType ? formData.chartType.join('/') : '',
|
|
|
|
|
|
+ if (drawerActype != 'DATAMANA') {
|
|
|
|
+ let formData: any;
|
|
|
|
+ data.forEach((element: any) => {
|
|
|
|
+ if (element.baseInfoformRef) {
|
|
|
|
+ formData = { ...formData, ...element.baseInfoformRef };
|
|
|
|
+ }
|
|
|
|
+ if (element.manaInfoformRef) {
|
|
|
|
+ formData = { ...formData, ...element.manaInfoformRef };
|
|
|
|
+ }
|
|
|
|
+ if (element.showSetInfoformRef) {
|
|
|
|
+ formData = { ...formData, ...element.showSetInfoformRef };
|
|
|
|
+ }
|
|
|
|
+ if (element.adminInfoformRef) {
|
|
|
|
+ formData = { ...formData, ...element.adminInfoformRef };
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- if (resp) {
|
|
|
|
- set_drawerVisible(false);
|
|
|
|
- indicatorTableRef.current?.reload();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ if (drawerActype == 'ADD') {
|
|
|
|
+ const resp = await addIndicatorManaList({
|
|
|
|
+ ...formData,
|
|
|
|
+ caseBreakdown: formData.caseBreakdown ? formData.caseBreakdown.join('/') : '',
|
|
|
|
+ dataDownload: formData.dataDownload ? formData.dataDownload.join('/') : '',
|
|
|
|
+ drillLevel: formData.drillLevel ? formData.drillLevel.join('/') : '',
|
|
|
|
+ dataSum: formData.dataSum ? formData.dataSum.join('/') : '',
|
|
|
|
+ chartType: formData.chartType ? formData.chartType.join('/') : '',
|
|
|
|
+
|
|
|
|
+ indicatorMenuList: formData.indicatorMenuList ? formData.indicatorMenuList : [],
|
|
|
|
+ indicatorTypeList: formData.indicatorTypeList ? formData.indicatorTypeList : [],
|
|
|
|
+ indicatorExternalList: formData.indicatorExternalList ? formData.indicatorExternalList : [],
|
|
|
|
+ divisionId: `${formData.divisionId}`,
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ if (resp) {
|
|
|
|
+ set_drawerVisible(false);
|
|
|
|
+ indicatorTableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (drawerActype == 'EDIT') {
|
|
|
|
+ const resp = await editIndicatorManaList({
|
|
|
|
+ ...currentEditRowData,
|
|
|
|
+ ...formData,
|
|
|
|
+ caseBreakdown: formData.caseBreakdown ? formData.caseBreakdown.join('/') : '',
|
|
|
|
+ dataDownload: formData.dataDownload ? formData.dataDownload.join('/') : '',
|
|
|
|
+ drillLevel: formData.drillLevel ? formData.drillLevel.join('/') : '',
|
|
|
|
+ dataSum: formData.dataSum ? formData.dataSum.join('/') : '',
|
|
|
|
+ chartType: formData.chartType ? formData.chartType.join('/') : '',
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+ set_drawerVisible(false);
|
|
|
|
+ indicatorTableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
|
|
const onSelectChangehandle = (currentSelected: any) => {
|
|
const onSelectChangehandle = (currentSelected: any) => {
|
|
set_currentSelectedLeft(currentSelected);
|
|
set_currentSelectedLeft(currentSelected);
|
|
currentSelected && set_cateId(currentSelected.code);
|
|
currentSelected && set_cateId(currentSelected.code);
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
const tableDataSearchHandle = (paramName: string) => {
|
|
const tableDataSearchHandle = (paramName: string) => {
|
|
set_tableDataFilterParams({
|
|
set_tableDataFilterParams({
|
|
...tableDataFilterParams,
|
|
...tableDataFilterParams,
|
|
- current:1,
|
|
|
|
|
|
+ current: 1,
|
|
[`${paramName}`]: tableDataSearchKeywords,
|
|
[`${paramName}`]: tableDataSearchKeywords,
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
- if (tableData) {
|
|
|
|
- const keys = tableData.map((t: any) => t ? t.code : '');
|
|
|
|
|
|
+ const detailTableDataSearchHandle = (paramName: string) => {
|
|
|
|
+ const result = total_tableDataSource.filter((a: any) => a[`${paramName}`].indexOf(tableDataSearchKeywords) != -1);
|
|
|
|
+ set_tableDataSource(result);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const tabChangeHandle = (key: string) => {
|
|
|
|
+ set_currentTab(key);
|
|
|
|
+ };
|
|
|
|
|
|
|
|
+ const getIndicatorDetail = async () => {
|
|
|
|
+ if (currentEditRow) {
|
|
|
|
+ set_tableColumns([]);
|
|
|
|
+ set_tableDataSource([]);
|
|
|
|
+ const resp = await getIndicatorDetailReq({ indicatorCode: currentEditRow.code, dataYear: `${currentYear}`, periodType: currentTab });
|
|
|
|
+ if (resp) {
|
|
|
|
+ const { itemTitles, itemDatas } = resp;
|
|
|
|
+ const { columns, dataSource } = generateTableData(itemTitles, itemDatas);
|
|
|
|
+ table_columns = columns;
|
|
|
|
+ total_tableDataSource = dataSource;
|
|
|
|
+ set_tableColumns(columns);
|
|
|
|
+ set_tableDataSource(dataSource);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }, [tableData]);
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
+ const dataManaBtnHandle = () => {
|
|
|
|
+ set_drawerActype('DATAMANA');
|
|
|
|
+ set_currentEditRowData({ ...currentEditRow });
|
|
|
|
+ set_drawerVisible(true);
|
|
|
|
+ };
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- // console.log({ cateId });
|
|
|
|
- // set_reloadTable(true);
|
|
|
|
- indicatorTableRef.current?.reload();
|
|
|
|
|
|
+ if (cateId) {
|
|
|
|
+ indicatorTableRef.current?.reload();
|
|
|
|
+ }
|
|
}, [cateId]);
|
|
}, [cateId]);
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (!currentEditRow) {
|
|
|
|
+ set_actionType('NORMAL');
|
|
|
|
+ }
|
|
|
|
+ }, [currentEditRow]);
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (actionType == 'DETAIL' && currentBigTab === '2') {
|
|
|
|
+ getIndicatorDetail();
|
|
|
|
+ }
|
|
|
|
+ }, [actionType, currentBigTab]);
|
|
|
|
+
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ getIndicatorDetail();
|
|
|
|
+ }, [currentTab, currentYear]);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
+ set_cateId(undefined);
|
|
|
|
+ set_actionType(undefined);
|
|
|
|
+ set_drawerActype(undefined);
|
|
|
|
+ set_currentBigTab('1');
|
|
|
|
+ set_currentEditRow(undefined);
|
|
|
|
+ set_tableColumns([]);
|
|
|
|
+ set_tableDataSource([]);
|
|
|
|
+ set_currentEditRowData(undefined);
|
|
|
|
+
|
|
getIndicatorCateTree();
|
|
getIndicatorCateTree();
|
|
}, [location.search]);
|
|
}, [location.search]);
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (!drawerVisible) {
|
|
|
|
+ set_drawerActype(undefined);
|
|
|
|
+ set_currentEditRowData(undefined);
|
|
|
|
+ }
|
|
|
|
+ }, [drawerVisible]);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getIndicatorDir();
|
|
getIndicatorDir();
|
|
getIndicatorCateTree();
|
|
getIndicatorCateTree();
|
|
- }, [])
|
|
|
|
|
|
+ }, []);
|
|
|
|
|
|
return (
|
|
return (
|
|
- <div className='IndicatorMana'>
|
|
|
|
- <DrawerForm actType={drawerActype} visible={drawerVisible} onVisibleChange={onVisibleChangeHandle} onFinish={data => drawerFormCommitHanndle(data)} record={currentEditRowData} />
|
|
|
|
- <div className='content'>
|
|
|
|
- <div className='left'>
|
|
|
|
- {/* <TreeDirectory data={indicatorCateTreeData} onSelectChange={(info) => onSelectChangehandle(info)} /> */}
|
|
|
|
- <KCIMLeftList searchKey={'name'} listType='tree' dataSource={indicatorCateTreeData}
|
|
|
|
- fieldNames={{ title: 'name', key: 'code' }} contentH={'100%'}
|
|
|
|
- onChange={(info) => onSelectChangehandle(info)}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div className='right'>
|
|
|
|
- <div className='tableTitle'>{currentSelectedLeft&¤tSelectedLeft.name}</div>
|
|
|
|
- <div className="toolBar">
|
|
|
|
- <div className="filter">
|
|
|
|
- <div className="filterItem">
|
|
|
|
- <KCInput
|
|
|
|
- placeholder={'指标名称'}
|
|
|
|
- style={{ width: 240 }}
|
|
|
|
- search
|
|
|
|
- allowClear
|
|
|
|
- onChange={(e) => {
|
|
|
|
- set_tableDataSearchKeywords(e.target.value);
|
|
|
|
- if (e.target.value.length == 0) {
|
|
|
|
- set_tableDataFilterParams({
|
|
|
|
- ...tableDataFilterParams,
|
|
|
|
- current:1,
|
|
|
|
- name: '',
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- onSearch={() => tableDataSearchHandle('name')}
|
|
|
|
- />
|
|
|
|
|
|
+ <div className="IndicatorMana">
|
|
|
|
+ <DrawerForm actType={drawerActype} visible={drawerVisible} onVisibleChange={onVisibleChangeHandle} onFinish={(data) => drawerFormCommitHanndle(data)} record={currentEditRowData} />
|
|
|
|
+
|
|
|
|
+ {actionType == 'DETAIL' && (
|
|
|
|
+ <div className="FillingMana-detail">
|
|
|
|
+ <div className="FillingMana-detail-header">
|
|
|
|
+ <div className="FillingMana-detail-header-title">
|
|
|
|
+ <div className="backBtn" onClick={() => set_currentEditRow(undefined)}>
|
|
|
|
+ <IconFont style={{ fontSize: 15 }} type={'iconfanhui'} />
|
|
</div>
|
|
</div>
|
|
|
|
+ <span>{currentEditRow?.name}</span>
|
|
</div>
|
|
</div>
|
|
- <div className="btnGroup">
|
|
|
|
- <span className="add" onClick={addHandle}>
|
|
|
|
- 新增
|
|
|
|
- </span>
|
|
|
|
|
|
+ <div className="FillingMana-detail-header-title-sub">
|
|
|
|
+ <span>指标编码:{currentEditRow?.code}</span>
|
|
|
|
+ <span>指标定义:{currentEditRow?.targetDefinition}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- {
|
|
|
|
- cateId && (
|
|
|
|
|
|
+ <div className="bigTab" title={`${currentBigTab == '1'}`}>
|
|
|
|
+ <div className={currentBigTab === '1' ? 'tab on' : 'tab'} onClick={() => set_currentBigTab('1')}>
|
|
|
|
+ 线上数据
|
|
|
|
+ </div>
|
|
|
|
+ <div className={currentBigTab === '2' ? 'tab on' : 'tab'} onClick={() => set_currentBigTab('2')}>
|
|
|
|
+ 填报数据
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ {currentBigTab === '1' && (
|
|
|
|
+ <div className="currentBigTab1content">
|
|
|
|
+ <img src={require('../../../../../public/images/empty_bigger.png')} alt="" />
|
|
|
|
+ <div className="detail-noAuthRecord-title">暂无内容</div>
|
|
|
|
+ </div>
|
|
|
|
+ )}
|
|
|
|
+
|
|
|
|
+ {currentBigTab === '2' && (
|
|
|
|
+ <div className="FillingMana-detail-content">
|
|
|
|
+ <div className="tabBar">
|
|
|
|
+ <Tabs defaultActiveKey={currentTab} onChange={tabChangeHandle} items={DATAFILL_PERIODTYPE.map((a) => ({ label: a.label, key: `${a.value}` }))} />
|
|
|
|
+ <div className="dataManaBtn" onClick={() => dataManaBtnHandle()}>
|
|
|
|
+ <IconFont type={'iconpeizhi'} style={{ position: 'relative', top: 1, paddingRight: 4 }} />
|
|
|
|
+ 数据管理
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
+ <div className="toolBar">
|
|
|
|
+ <div className="filter">
|
|
|
|
+ <div className="filterItem">
|
|
|
|
+ <span className="label" style={{ whiteSpace: 'nowrap' }}>
|
|
|
|
+ {' '}
|
|
|
|
+ 检索:
|
|
|
|
+ </span>
|
|
|
|
+ <Input
|
|
|
|
+ placeholder={'填报科室'}
|
|
|
|
+ allowClear
|
|
|
|
+ autoComplete="off"
|
|
|
|
+ suffix={<IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => detailTableDataSearchHandle('fillItemName')} />}
|
|
|
|
+ onChange={(e) => {
|
|
|
|
+ set_tableDataSearchKeywords(e.target.value);
|
|
|
|
+ if (e.target.value.length == 0) {
|
|
|
|
+ set_tableDataSource(total_tableDataSource);
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ onPressEnter={(e: any) => {
|
|
|
|
+ const result = total_tableDataSource.filter((a: any) => a.fillItemName.indexOf(e.target.value) != -1);
|
|
|
|
+ set_tableDataSource(result);
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div className="btnGroup">
|
|
|
|
+ <div className="changeBtn">
|
|
|
|
+ <div className="actBtn" onClick={() => set_currentYear(currentYear - 1)}>
|
|
|
|
+ <IconFont type={'iconshuangzuo'} />
|
|
|
|
+ </div>
|
|
|
|
+ <span style={{ padding: '0 8px' }}>{currentYear}</span>
|
|
|
|
+ <div className="actBtn" onClick={() => set_currentYear(currentYear + 1)}>
|
|
|
|
+ <IconFont type={'iconshuangyou'} />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <KCTable newVer actionRef={detailTableRef} columns={[...tableColumns]} scroll={{ y: 'calc(100vh - 232px)' }} rowKey="id" dataSource={tableDataSource} pagination={false} />
|
|
|
|
+ </div>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ )}
|
|
|
|
+ {actionType != 'DETAIL' && (
|
|
|
|
+ <div className="content">
|
|
|
|
+ <div className="left">
|
|
|
|
+ {/* <TreeDirectory data={indicatorCateTreeData} onSelectChange={(info) => onSelectChangehandle(info)} /> */}
|
|
|
|
+ <KCIMLeftList
|
|
|
|
+ searchKey={'name'}
|
|
|
|
+ listType="tree"
|
|
|
|
+ dataSource={indicatorCateTreeData}
|
|
|
|
+ fieldNames={{ title: 'name', key: 'code' }}
|
|
|
|
+ contentH={'100%'}
|
|
|
|
+ onChange={(info) => onSelectChangehandle(info)}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div className="right">
|
|
|
|
+ <div className="tableTitle">{currentSelectedLeft && currentSelectedLeft.name}</div>
|
|
|
|
+ <div className="toolBar">
|
|
|
|
+ <div className="filter">
|
|
|
|
+ <div className="filterItem">
|
|
|
|
+ <KCInput
|
|
|
|
+ placeholder={'指标名称'}
|
|
|
|
+ style={{ width: 240 }}
|
|
|
|
+ search
|
|
|
|
+ allowClear
|
|
|
|
+ onChange={(e) => {
|
|
|
|
+ set_tableDataSearchKeywords(e.target.value);
|
|
|
|
+ if (e.target.value.length == 0) {
|
|
|
|
+ set_tableDataFilterParams({
|
|
|
|
+ ...tableDataFilterParams,
|
|
|
|
+ current: 1,
|
|
|
|
+ name: '',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ onSearch={() => tableDataSearchHandle('name')}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div className="btnGroup">
|
|
|
|
+ <span className="add" onClick={addHandle}>
|
|
|
|
+ 新增
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ {cateId && (
|
|
<KCTable
|
|
<KCTable
|
|
newVer
|
|
newVer
|
|
rowKey="menuId"
|
|
rowKey="menuId"
|
|
columns={columns}
|
|
columns={columns}
|
|
params={tableDataFilterParams}
|
|
params={tableDataFilterParams}
|
|
actionRef={indicatorTableRef}
|
|
actionRef={indicatorTableRef}
|
|
- scroll={{y:`calc(100vh - 228px)`}}
|
|
|
|
|
|
+ scroll={{ y: `calc(100vh - 228px)` }}
|
|
expandable={{
|
|
expandable={{
|
|
expandedRowKeys: defaultExpandedRowKeys,
|
|
expandedRowKeys: defaultExpandedRowKeys,
|
|
onExpand: (expanded, record) => {
|
|
onExpand: (expanded, record) => {
|
|
// console.log({expanded, record});
|
|
// console.log({expanded, record});
|
|
let _expandedKeys = [...defaultExpandedRowKeys];
|
|
let _expandedKeys = [...defaultExpandedRowKeys];
|
|
if (expanded) {
|
|
if (expanded) {
|
|
- _expandedKeys.push(record.menuId)
|
|
|
|
|
|
+ _expandedKeys.push(record.menuId);
|
|
} else {
|
|
} else {
|
|
- const index = _expandedKeys.findIndex(t => t == `${record.menuId}`);
|
|
|
|
|
|
+ const index = _expandedKeys.findIndex((t) => t == `${record.menuId}`);
|
|
if (index != -1) {
|
|
if (index != -1) {
|
|
_expandedKeys.splice(index, 1);
|
|
_expandedKeys.splice(index, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
set_defaultExpandedRowKeys([..._expandedKeys]);
|
|
set_defaultExpandedRowKeys([..._expandedKeys]);
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ },
|
|
}}
|
|
}}
|
|
reload={reloadTable}
|
|
reload={reloadTable}
|
|
pagination={false}
|
|
pagination={false}
|
|
- // toolBarRender={() => [
|
|
|
|
- // // <Button key="1" onClick={addHandle}>
|
|
|
|
- // // 上传
|
|
|
|
- // // </Button>,
|
|
|
|
- // // <Button key="2" onClick={addHandle}>
|
|
|
|
- // // 下载
|
|
|
|
- // // </Button>,
|
|
|
|
- // <Button key="3" type="primary" onClick={addHandle}>
|
|
|
|
- // 新增
|
|
|
|
- // </Button>,
|
|
|
|
- // ]}
|
|
|
|
options={false}
|
|
options={false}
|
|
request={(params) => getData(params)}
|
|
request={(params) => getData(params)}
|
|
/>
|
|
/>
|
|
- )
|
|
|
|
- }
|
|
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ )}
|
|
</div>
|
|
</div>
|
|
- )
|
|
|
|
-}
|
|
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
|
|
-export default IndicatorMana
|
|
|
|
|
|
+export default IndicatorMana;
|