Commit e25c31cc by zhaochengxiang

模型详情校验问题

parent 02443bd4
......@@ -4,7 +4,6 @@
background-color: #fff;
border-radius: 2px;
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15) \9;
.yy-tabs-nav {
padding: 0 10px !important;
......@@ -36,7 +35,6 @@
background-color: #fff;
border-radius: 2px;
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15) \9;
.no-record-content {
width: 100%;
......
import React, { useState, useEffect } from 'react';
import { Select } from 'antd';
import { Select, Spin } from 'antd';
import ImportActionHeader from './ImportActionHeader';
import ImportActionTable from './ImportActionTable';
......@@ -19,6 +19,7 @@ const ImportAction = (props) => {
const [ modelerData, setModelerData ] = useState(null);
const [ supportedDatatypes, setSupportedDatatypes ] = useState([]);
const [ validateReports, setValidateReports ] = useState([]);
const [ loading, setLoading ] = useState(false);
useEffect(() =>{
......@@ -34,6 +35,10 @@ const ImportAction = (props) => {
});
}
if (action !== 'add') {
setLoading(true);
}
dispatch({
type: 'datamodel.getAllConstraintsAndTemplates',
callback: data => {
......@@ -46,6 +51,9 @@ const ImportAction = (props) => {
} else if(action === 'edit' || action === 'detail') {
getCurrentDataModel();
}
},
error: () => {
setLoading(false);
}
})
//eslint-disable-next-line react-hooks/exhaustive-deps
......@@ -100,6 +108,7 @@ const ImportAction = (props) => {
id: modelerId||''
},
callback: data => {
setLoading(false);
setModelerData(data||{});
setConstraint(data.easyDataModelerModelingConstraint||{});
setTemplate(data.easyDataModelerModelingTemplate||{});
......@@ -115,6 +124,9 @@ const ImportAction = (props) => {
easyDataModelerModelingTemplate: data.easyDataModelerModelingTemplate||''
});
}
},
error: () => {
setLoading(false);
}
})
}
......@@ -199,7 +211,7 @@ const ImportAction = (props) => {
dispatch({
type: 'datamodel.validateDataModel',
payload: {
data: { ...data, name: row.name||'', cnName: row.cnName||'' },
data: action==='detail'?data:{ ...data, name: row.name||'', cnName: row.cnName||'' },
},
callback: _data => {
setValidateReports(_data||[]);
......@@ -241,7 +253,7 @@ const ImportAction = (props) => {
}
return (
<>
<Spin spinning={loading}>
{
<div className='d-flex mb-5' style={{ alignItems: 'center' }}>
<span style={{ marginLeft: 'auto' }}>规范:</span>
......@@ -282,7 +294,7 @@ const ImportAction = (props) => {
onChange={onIndexChange}
editable={action!=='detail'}
/>
</>
</Spin>
);
};
......
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