Commit 156b720a by zhaochengxiang

分区内容回填到表头

parent 8ee9f26c
......@@ -309,6 +309,19 @@ const ImportAction = (props) => {
const onPartitionChange = (data, validate=false) => {
const newModelerData = {...modelerData, partition: data};
//数据表分区内容回填到基本信息分区键中
let newPartitionDesc = '';
(data?.keys||[]).forEach((item, index) => {
if (index > 0) {
newPartitionDesc += ','
}
newPartitionDesc += item.name||'';
})
newPartitionDesc += '/' + data?.partitionType?.name||'';
newModelerData.partitionsDescription = newPartitionDesc;
setModelerData(newModelerData);
onChange && onChange(newModelerData);
......
......@@ -34,7 +34,7 @@ const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps })
return (
<Select
onChange={onChange}
value={value.name || ''}
value={value?.name || ''}
placeholder='请选择生成表类型'
allowClear
{...restProps}
......@@ -82,7 +82,9 @@ const ImportActionHeader = (props) => {
useEffect(() => {
setAutoTranslate((modelerData.name||'')==='');
if (modelerData) {
form.setFieldsValue(modelerData);
}
}, [modelerData])
const formItemLayout = {
......
......@@ -414,7 +414,6 @@ const ImportActionPartition = (props) => {
dataSource={data?[data]:[]}
columns={mergedColumns()}
size='small'
rowKey='name'
rowClassName="editable-row"
pagination={false}
sticky
......
......@@ -617,25 +617,25 @@ const ImportActionTable = (props) => {
return '';
}
},
// {
// title: '分布键',
// width: 60,
// dataIndex: 'partOfDistributionKey',
// editable: (type==='model'?true:false),
// render: (partOfDistributionKey, record, index) => {
// if (!partOfDistributionKey) {
// return (
// <CloseOutlined />
// );
// } else if (partOfDistributionKey === true) {
// return (
// <CheckOutlined />
// )
// }
// return '';
// }
// },
{
title: '分布键',
width: 60,
dataIndex: 'partOfDistributionKey',
editable: (type==='model'?true:false),
render: (partOfDistributionKey, record, index) => {
if (!partOfDistributionKey) {
return (
<CloseOutlined />
);
} else if (partOfDistributionKey === true) {
return (
<CheckOutlined />
)
}
return '';
}
},
{
title: '外键',
width: 50,
......
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