Commit af66ac75 authored by 皮倩雯's avatar 皮倩雯

fix: '表字段合并单元格'

parent 137e1ffb
Pipeline #47257 passed with stages
in 7 minutes 11 seconds
......@@ -190,14 +190,14 @@ const LoadGroupNew = props => {
text: form.getFieldsValue().groupName,
fieldData: [],
};
if (form.getFieldsValue().groupName.length > 9) {
notification.error({
message: '提示',
duration: 3,
description: '组名请在10个字以内',
});
return;
}
// if (form.getFieldsValue().groupName.length > 9) {
// notification.error({
// message: '提示',
// duration: 3,
// description: '组名请在10个字以内',
// });
// return;
// }
// 判断是否有重复的组名
let isRepeat = groupData.some(item => item.text === form.getFieldsValue().groupName);
if (isRepeat) {
......
/* eslint-disable indent */
/* eslint-disable prefer-destructuring */
/* eslint-disable import/order */
/* eslint-disable default-case */
......@@ -195,6 +196,7 @@ const AddModal = props => {
};
useEffect(() => {
console.log(isVisible);
if (keepTreeFirst.indexOf(itemData.name) != -1) {
setShow('none');
} else {
......@@ -246,10 +248,16 @@ const AddModal = props => {
}
setPramData({ ...res[0].data.root, coordinates, must, picture });
console.log(pramData);
// 清空表单数据
if (isVisible == false) {
console.log(123);
setPramData([]);
form.resetFields();
}
let index = res[2].data.root.find(item => {
return item.Name == res[0].data.root.ExceptionEvent;
});
console.log('index', index);
console.log(index);
getFieldData(index.TableName);
}
});
......
......@@ -57,7 +57,7 @@ const AddModal = props => {
const [selectTreeData, setSelectTreeData] = useState([]);
const [selectDataFirst, setSelectDataFirst] = useState([]);
const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选字段配置数,机构改变时重置
const [selectedRowKeys, setSelectedRowKeys] = useState(['13926', '13941']); // 已选字段配置数,机构改变时重置
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除
const [checkStrictly, setCheckStrictly] = useState(false);
const [selectGroup, setSelectGroup] = useState([]);
......@@ -101,27 +101,22 @@ const AddModal = props => {
key: 'name',
align: 'left',
width: 300,
onCell: (_, index) => ({
colSpan: index < 1 ? 8 : 1,
// if (index === 0) {
// // console.log(record);
// console.log(index);
// return { colSpan: 3 };
// }
}),
render: (text, record) => (
<Space>
{record.children ? (
render: (text, record) => {
let aa = (
<div style={{ fontWeight: 'bold' }}>
<span style={{ color: 'rgb(63 163 255)' }}>
{text}(共{allData[text] ? allData[text].length : ''}条)
</span>
</div>
) : (
<div style={{ color: styleConfig(record) }}>{text}</div>
)}
</Space>
),
);
let bb = <div style={{ color: styleConfig(record) }}>{text}</div>;
const obj = {
children: record.children ? aa : bb,
props: {},
};
obj.props.colSpan = record.children ? 8 : 1;
return obj;
},
},
{
title: '别名',
......@@ -129,7 +124,14 @@ const AddModal = props => {
key: 'alias',
align: 'center',
width: 300,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
title: '字段类型',
......@@ -137,7 +139,14 @@ const AddModal = props => {
key: 'storeType',
align: 'center',
width: 150,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
title: '形态',
......@@ -145,7 +154,14 @@ const AddModal = props => {
key: 'shape',
align: 'center',
width: 150,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
title: '配置',
......@@ -153,7 +169,14 @@ const AddModal = props => {
key: 'config',
align: 'center',
width: 250,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
......@@ -162,7 +185,14 @@ const AddModal = props => {
key: 'readOnly',
align: 'center',
width: 100,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
title: '同步',
......@@ -170,13 +200,22 @@ const AddModal = props => {
key: 'syncEvent',
align: 'center',
width: 100,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
render: (text, record) => {
const obj = {
children: <span style={{ color: styleConfig(record) }}>{text} </span>,
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
{
title: '操作',
ellipsis: true,
align: 'center',
render: (text, record) => (
render: (text, record) => {
const obj = {
children: (
<Space>
{record.children ? (
<span />
......@@ -212,6 +251,11 @@ const AddModal = props => {
)}
</Space>
),
props: {},
};
obj.props.colSpan = record.children ? 0 : 1;
return obj;
},
},
];
......@@ -380,15 +424,24 @@ const AddModal = props => {
});
};
const onUnfold = (expanded, record) => {
if (record.children) {
const data = [...selectGroup];
let index = data.findIndex(i => i.type == record.name);
// let index = data.indexOf(record);
// let index = selectGroup.find(i => i.type || i.name == record.name);
if (expanded) {
data.push(record);
setSelectGroup(data);
} else {
data.splice(index, 1);
let aa = [];
data.map(i => {
if (i.name && i.name != record.name) {
aa.push(i);
} else if (i.type && i.type != record.name) {
aa.push(i);
}
});
setSelectGroup(aa);
}
}
setSelectGroup(data);
};
// 附加
const add = record => {
......@@ -428,6 +481,7 @@ const AddModal = props => {
};
const treeSelectOnchange = e => {
setTreeLoading(true);
console.log('切换');
setSelectedRowKeys([]);
setMultiOperate(true);
......
......@@ -173,7 +173,7 @@
.userContainer {
height: calc(100vh - 74px) !important;
z-index: 999;
// min-width: 800px;
min-width: 800px;
background: white;
width: 100%;
position: relative;
......
......@@ -1422,7 +1422,7 @@ const UserManage = () => {
color: '#1890FF',
fontSize: '25px',
verticalAlign: 'middle',
marginLeft: '67%',
marginLeft: '64%',
}}
/>
</Tooltip>
......@@ -1461,8 +1461,8 @@ const UserManage = () => {
{/* 右侧用户表 */}
<div
className={classnames({
[styles.userContainerHide]: !treeVisible,
[styles.userContainer]: true,
[styles.userContainerHide]: !treeVisible,
})}
>
<div style={{ height: '50px' }}>
......@@ -1501,11 +1501,12 @@ const UserManage = () => {
>
<div
className={classnames({
[styles.boxH]: treeVisible,
[styles.cardBoxR]: true,
[styles.boxH]: treeVisible,
})}
> */}
<Table
// style={{ width: treeVisible ? '81%' : '100%' }}
rowSelection={{
type: 'checkbox',
...rowSelection,
......
......@@ -220,9 +220,9 @@
white-space: nowrap;
text-overflow: ellipsis;
}
// .userContainerHide {
// width: 100%;
// }
.userContainerHide {
width: 100%;
}
.userContainer {
height: calc(100vh - 74px) !important;
z-index: 999;
......@@ -286,7 +286,7 @@
transition: width 2s;
}
.cardBoxR {
min-width: 600px;
min-width: 800px;
}
.ant-modal-root {
.ant-tree-switcher {
......
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