Commit beb7f1a2 by zhaochengxiang

新增字段默认放在最后

parent 22690d50
...@@ -309,10 +309,11 @@ const ImportActionIndex = (props) => { ...@@ -309,10 +309,11 @@ const ImportActionIndex = (props) => {
const onAddClick = () => { const onAddClick = () => {
const newFilterData = [{name: ''}, ...filterData]; const newFilterData = [...filterData, {name: ''}];
setFilterData(newFilterData); setFilterData(newFilterData);
edit(newFilterData[0]); edit(newFilterData[newFilterData.length-1]);
} }
const edit = (record) => { const edit = (record) => {
...@@ -544,7 +545,7 @@ const ImportActionIndex = (props) => { ...@@ -544,7 +545,7 @@ const ImportActionIndex = (props) => {
{ {
shortCauses && shortCauses.map((shortCause, index) => { shortCauses && shortCauses.map((shortCause, index) => {
return ( return (
<Tooltip title={shortCause}> <Tooltip key={index} title={shortCause}>
<div className='textOverflow' style={{ width: 130, color: '#f5222d' }} title={shortCause} key={index}> <div className='textOverflow' style={{ width: 130, color: '#f5222d' }} title={shortCause} key={index}>
<span>{shortCause||''}</span> <span>{shortCause||''}</span>
</div> </div>
......
...@@ -207,7 +207,10 @@ const ImportActionPartition = (props) => { ...@@ -207,7 +207,10 @@ const ImportActionPartition = (props) => {
useEffect(() => { useEffect(() => {
setAttributes(modelerData.easyDataModelerDataModelAttributes||[]); setAttributes(modelerData.easyDataModelerDataModelAttributes||[]);
if (modelerData?.pagination) {
setData(modelerData.partition); setData(modelerData.partition);
}
}, [modelerData]) }, [modelerData])
...@@ -297,7 +300,7 @@ const ImportActionPartition = (props) => { ...@@ -297,7 +300,7 @@ const ImportActionPartition = (props) => {
{ {
title: '分区类型', title: '分区类型',
width: 200, width: 200,
dataIndex: 'partitionType', dataIndex: 'type',
editable: true, editable: true,
ellipsis: true, ellipsis: true,
render: (text, record, index) => { render: (text, record, index) => {
......
...@@ -269,10 +269,14 @@ const ImportActionTable = (props) => { ...@@ -269,10 +269,14 @@ const ImportActionTable = (props) => {
const onAddClick = () => { const onAddClick = () => {
const newFilterData = [{iid: generateUUID()}, ...filterData]; const iid = generateUUID();
const newFilterData = [...filterData, {iid}];
setFilterData(newFilterData); setFilterData(newFilterData);
edit(newFilterData[0]); edit(newFilterData[newFilterData.length-1]);
setTimeout(() => {
document.getElementById(`field-${iid}`)?.scrollIntoView();
}, 200)
} }
const edit = (record) => { const edit = (record) => {
...@@ -982,10 +986,13 @@ const ImportActionTable = (props) => { ...@@ -982,10 +986,13 @@ const ImportActionTable = (props) => {
return 'editable-row'; return 'editable-row';
}} }}
onRow={(record, index) => { onRow={(record, index) => {
if (!editable || editingKey!=='' || keyword.length>0) return null; if (!editable || editingKey!=='' || keyword.length>0) return {
id: `field-${record.iid}`
};
return { return {
index, index,
id: `field-${record.iid}`,
moveRow moveRow
} }
}} }}
......
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