Commit 848f7482 by zhaochengxiang

修改模型问题

parent 4ff996a4
......@@ -19,7 +19,7 @@ import ImportModal from './view/Manage/Model/Component/ImportModal';
export default class App extends React.Component {
render() {
const { params, callback } = this.props;
const { params } = this.props;
let message = '', id = '';
if (params) {
......
import React from 'react';
import { Row, Col, Breadcrumb, Slider, Select, Typography } from 'antd';
import { Row, Col, Breadcrumb, Select, Typography } from 'antd';
import { HomeOutlined } from '@ant-design/icons';
import SquareItem from './Component/SquareItem';
......
......@@ -87,7 +87,7 @@ const ImportAction = (props) => {
setModelerData(newModelerData)
onChange && onChange(newModelerData);
validateDataModel(newModelerData);
validateDataModel({ ...newModelerData, ...(form.getFieldsValue()) });
}
})
}
......
......@@ -11,6 +11,13 @@ class ImportExcel extends React.Component {
};
}
componentDidUpdate(preProps, preState) {
const { visible } = this.props;
if (!visible && visible !== preProps.visible) {
this.setState({ fileList: [] });
}
}
downloadTemplate = () => {
window.open("/data-govern/docs/DataModel.xlsx");
}
......
......@@ -10,6 +10,13 @@ class ImportExcelCopy extends React.Component {
};
}
componentDidUpdate(preProps, preState) {
const { visible } = this.props;
if (!visible && visible !== preProps.visible) {
this.setState({ inputValue: '' });
}
}
onInputChange = (e) => {
const { onChange } = this.props;
this.setState({ inputValue: e.target.value }, () => {
......@@ -22,7 +29,7 @@ class ImportExcelCopy extends React.Component {
const { inputValue } = this.state;
const _placeholder = '支持两种方式创建\n方式一: excel内容复制粘贴(中文字段名)\n方式二: 手动输入中文字段,多个字段按行分割(每行一个)';
const _placeholder = '支持两种方式创建\n方式一: Excel内容复制粘贴(中文字段名)\n方式二: 手动输入中文字段,多个字段按行分割(每行一个)';
return (
<Input.TextArea
......
......@@ -46,7 +46,6 @@ const ImportModal = (props) => {
type: 'datamodel.extractExcelContent',
payload: { fileList: excelFiles },
callback: data => {
setExcelFiles([]);
setConfirmLoading(false);
setHints(data||[]);
setStep(step+1);
......@@ -143,13 +142,13 @@ const ImportModal = (props) => {
let title = '';
if (action === 'add') {
if (step===0 && addMode==='excel') {
title = 'excel导入';
title = 'Excel导入';
} else if (step===0 && addMode==='excel-copy') {
title = 'excel复制粘贴导入';
title = 'Excel复制粘贴导入';
} else if (step===1 && addMode==='excel') {
title = '模型创建-excel导入';
title = '模型创建-Excel导入';
} else if (step===1 && addMode=== 'excel-copy') {
title = '模型创建-excel复制粘贴导入';
title = '模型创建-Excel复制粘贴导入';
}
} else if (action === 'edit') {
title = '模型编辑';
......@@ -234,10 +233,18 @@ const ImportModal = (props) => {
>
<>
{
step===0 && addMode==='excel' && <ImportExcel onChange={onImportExcelChange} />
addMode==='excel' && (
<div style={{ display: step===0?'':'none' }}>
<ImportExcel onChange={onImportExcelChange} {...props} />
</div>
)
}
{
step===0 && addMode==='excel-copy' && <ImportExcelCopy onChange={onImportExcelCopyChange} />
addMode==='excel-copy' && (
<div style={{ display: step===0?'':'none' }}>
<ImportExcelCopy onChange={onImportExcelCopyChange} {...props} />
</div>
)
}
{
step===0 && addMode==='erwin' && <></>
......
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