Commit bbb6189b by zhaochengxiang

模型列表增加状态

parent 90714323
...@@ -282,6 +282,12 @@ const ImportActionTable = (props) => { ...@@ -282,6 +282,12 @@ const ImportActionTable = (props) => {
}); });
setEditingKey(record.iid); setEditingKey(record.iid);
if ((record.cnName||'')!=='') {
onValuesChange({ cnName: record.cnName }, record, 1, record.iid);
} else if ((record.name||'')!=='') {
onValuesChange({ name: record.name }, record, 1, record.iid);
}
}; };
const remove = (record) => { const remove = (record) => {
...@@ -294,10 +300,11 @@ const ImportActionTable = (props) => { ...@@ -294,10 +300,11 @@ const ImportActionTable = (props) => {
const cancel = () => { const cancel = () => {
const newFilterData = [...filterData]; const newFilterData = [...filterData];
const index = newFilterData.findIndex((item) => editingKey === item.iid); const _index = (data||[]).findIndex((item) => editingKey === item.iid);
const index = newFilterData.findIndex((item) => editingKey === item.iid);
const item = newFilterData[index]; const item = newFilterData[index];
if (!item.name || item.name==='') { if (_index===-1 && (!item.name || item.name==='')) {
newFilterData.splice(index, 1); newFilterData.splice(index, 1);
setFilterData(newFilterData); setFilterData(newFilterData);
} }
...@@ -361,7 +368,7 @@ const ImportActionTable = (props) => { ...@@ -361,7 +368,7 @@ const ImportActionTable = (props) => {
} }
}; };
const onValuesChange = (changedValues, allValues, offset = 1) => { const onValuesChange = (changedValues, allValues, offset = 1, iid = editingKey) => {
// console.log('changed values', changedValues); // console.log('changed values', changedValues);
// console.log('all values', allValues); // console.log('all values', allValues);
...@@ -370,10 +377,10 @@ const ImportActionTable = (props) => { ...@@ -370,10 +377,10 @@ const ImportActionTable = (props) => {
if (changedValues.hasOwnProperty('cnName') || changedValues.hasOwnProperty('name')) { if (changedValues.hasOwnProperty('cnName') || changedValues.hasOwnProperty('name')) {
const newData = [...data]; const newData = [...data];
const index = newData.findIndex((item) => editingKey === item.iid); const index = newData.findIndex((item) => iid === item.iid);
if (index === -1) { if (index === -1) {
newData.splice(0, 0, {iid: editingKey, ...allValues}); newData.splice(0, 0, { iid, ...allValues});
} else if (index !== -1) { } else if (index !== -1) {
const item = newData[index]; const item = newData[index];
newData.splice(index, 1, { ...item, ...allValues }); newData.splice(index, 1, { ...item, ...allValues });
...@@ -387,7 +394,7 @@ const ImportActionTable = (props) => { ...@@ -387,7 +394,7 @@ const ImportActionTable = (props) => {
payload: { payload: {
data: { ...modelerData, easyDataModelerDataModelAttributes: newData }, data: { ...modelerData, easyDataModelerDataModelAttributes: newData },
params: { params: {
easyDataModelerDataModelAttributeIid: editingKey, easyDataModelerDataModelAttributeIid: iid,
topN: (offset+perSuggestCount-1), topN: (offset+perSuggestCount-1),
offset offset
} }
......
...@@ -60,10 +60,18 @@ const ModelTable = (props) => { ...@@ -60,10 +60,18 @@ const ModelTable = (props) => {
{ {
title: '模型描述', title: '模型描述',
dataIndex: 'remark', dataIndex: 'remark',
width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '状态',
dataIndex: 'state',
width: 100,
ellipsis: true,
render: (_, record) => {
return record?.state?.cnName||'';
}
},
{
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 200, width: 200,
......
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