Commit 3114ba3c authored by 邓超's avatar 邓超

fix: 修改表字段分组排序

parent 425183f2
Pipeline #55838 passed with stages
...@@ -53,6 +53,7 @@ import AffiliateAdd from './components/Field/affiliateAdd'; ...@@ -53,6 +53,7 @@ import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup'; import LoadGroup from './components/Field/loadGroup';
import LoadGroupNew from './components/Field/loadGroupNew'; import LoadGroupNew from './components/Field/loadGroupNew';
import { defaultFields } from './components/defaultFields'; import { defaultFields } from './components/defaultFields';
import { Ellipse } from 'bizcharts/lib/g-components';
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
const placeholder = '请输入表名'; const placeholder = '请输入表名';
...@@ -245,11 +246,21 @@ const TableManager = props => { ...@@ -245,11 +246,21 @@ const TableManager = props => {
let newArr = []; let newArr = [];
let aa = []; let aa = [];
let bb = []; let bb = [];
Object.keys(groupData).map((item, index) => { console.log(groupData, 'groupData');
newArr.push({ type: item, key: index, page: 1, pageSize: 20 }); // 对分组进行排序
aa.push({ name: item, key: index, ID: index, children: groupData[item] }); const sortNameArr = ['事件表', '工单表', '台账表', '设备表', '反馈表', '其他表'];
bb.push(item); const sortList = [];
sortNameArr.forEach(ele => {
Object.keys(groupData).map((item, index) => {
if (item === ele) {
newArr.push({ type: item, key: index, page: 1, pageSize: 20 });
aa.push({ name: item, key: index, ID: index, children: groupData[item] });
bb.push(item);
}
});
}); });
console.log(sortList, 'sortList');
setAllData(groupData); setAllData(groupData);
if (!props.history.location.query || initNum.current > 0) { if (!props.history.location.query || initNum.current > 0) {
if (newArr.length > 0 && (!select || isSearch)) { if (newArr.length > 0 && (!select || isSearch)) {
...@@ -471,8 +482,12 @@ const TableManager = props => { ...@@ -471,8 +482,12 @@ const TableManager = props => {
const getNewGroup = () => { const getNewGroup = () => {
regroupTableType().then(res => { regroupTableType().then(res => {
if (res.code === 0) { if (res.code === 0) {
setFlag(flag + 1); // setFlag(flag + 1);
setgGroupPopVisible(false); setgGroupPopVisible(false);
loadTable(searchValue, 'search');
setSelectTableName('');
setPickIndex(0);
setSelect(groupArr[0].type);
notification.success({ message: '提示', duration: 3, description: '执行成功' }); notification.success({ message: '提示', duration: 3, description: '执行成功' });
} }
}); });
...@@ -498,7 +513,7 @@ const TableManager = props => { ...@@ -498,7 +513,7 @@ const TableManager = props => {
<div style={{ display: `${treeVisible ? 'block' : 'none'}` }}> <div style={{ display: `${treeVisible ? 'block' : 'none'}` }}>
<span className={styles.processTitle}> <span className={styles.processTitle}>
表分组 表分组
<Tooltip title="检查表类型重分组"> <Tooltip title="表类型重新分组检查">
<ToolOutlined <ToolOutlined
onClick={() => checkGroup()} onClick={() => checkGroup()}
style={{ style={{
...@@ -689,7 +704,7 @@ const TableManager = props => { ...@@ -689,7 +704,7 @@ const TableManager = props => {
/> />
)} )}
<Modal <Modal
title="重分组表类型" title="确定要进行表类型重新分组吗?"
visible={groupPopVisible} visible={groupPopVisible}
onOk={getNewGroup} onOk={getNewGroup}
onCancel={() => setgGroupPopVisible(false)} onCancel={() => setgGroupPopVisible(false)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment