Commit 4eb1cf41 by zhaochengxiang

数据表类型问题

parent 954189ba
...@@ -168,6 +168,14 @@ const ImportAction = (props) => { ...@@ -168,6 +168,14 @@ const ImportAction = (props) => {
onChange && onChange(newModelerData); onChange && onChange(newModelerData);
validateDataModel(newModelerData); validateDataModel(newModelerData);
},
error: () => {
form.setFieldsValue({
easyDataModelerModelingTemplate: modelerDataRef.current.easyDataModelerModelingTemplate,
tableType: modelerDataRef.current.tableType
});
setTemplate(modelerDataRef.current.easyDataModelerModelingTemplate);
} }
}) })
} }
...@@ -295,18 +303,8 @@ const ImportAction = (props) => { ...@@ -295,18 +303,8 @@ const ImportAction = (props) => {
}); });
} }
form.setFieldsValue({
easyDataModelerModelingTemplate: currentTemplate||{},
tableType: value
});
const newModelerData = {...modelerData, easyDataModelerModelingTemplate: currentTemplate, tableType: currentTemplate ? currentTemplate.cnName : value }; const newModelerData = {...modelerData, easyDataModelerModelingTemplate: currentTemplate, tableType: currentTemplate ? currentTemplate.cnName : value };
setModelerData(newModelerData);
modelerDataRef.current = newModelerData;
onChange && onChange(newModelerData);
setTemplate(currentTemplate); setTemplate(currentTemplate);
getConsult(newModelerData); getConsult(newModelerData);
} }
......
...@@ -275,6 +275,8 @@ const ImportActionHeader = (props) => { ...@@ -275,6 +275,8 @@ const ImportActionHeader = (props) => {
} }
const onValuesChange = (changedValues, allValues) => { const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('tableType')) return;
onChange && onChange(changedValues, allValues); onChange && onChange(changedValues, allValues);
//有手动编辑过英文名称并且有内容的情况下, 不能通过编辑中文名称自动翻译 //有手动编辑过英文名称并且有内容的情况下, 不能通过编辑中文名称自动翻译
......
...@@ -1297,16 +1297,13 @@ export const ImportActionTable = (props) => { ...@@ -1297,16 +1297,13 @@ export const ImportActionTable = (props) => {
}, },
}} }}
rowClassName={(record, index) => { rowClassName={(record, index) => {
if (type==='model' && record?.modelingTemplateTag && record?.modelingTemplateTag!=={} && !isEditing(record)) {
return 'editable-row template-highlight-row';
}
if (type==='model' && !isEditing(record)) { if (type==='model' && !isEditing(record)) {
if (record?.needAttention) { if (record?.partOfPrimaryKeyLogically) {
return 'editable-row attention-row';
} else if (record?.partOfPrimaryKeyLogically) {
return 'editable-row primary-row'; return 'editable-row primary-row';
} }
if (record?.modelingTemplateTag?.id) {
return 'editable-row template-highlight-row';
}
} }
return 'editable-row'; return 'editable-row';
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
.template-highlight-row { .template-highlight-row {
.yy-table-cell { .yy-table-cell {
background-color: #e7f7ff !important; background-color: #f7f7f7 !important;
} }
} }
......
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