Commit 156b720a by zhaochengxiang

分区内容回填到表头

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