Commit e25c31cc by zhaochengxiang

模型详情校验问题

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