Commit bbb6189b by zhaochengxiang

模型列表增加状态

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