Commit f80d32d1 by zhaochengxiang

修改模型问题

parent 1d74834f
......@@ -22,35 +22,42 @@ const ImportAction = (props) => {
useEffect(() =>{
if (mountRef.current) {
mountRef.current = false;
if (action === 'detail') {
getCurrentDataModel();
} else {
dispatchLatest({
type: 'datamodel.getAllConstraints',
callback: data => {
setConstraints(data||[]);
if (action === 'add') {
setConstraint((data||[]).length>0?data[0]:{});
getDraft((data||[]).length>0?data[0]:{}, hints);
} else if(action === 'edit') {
getCurrentDataModel();
}
if (action==='add' && (hints||[]).length === 0) return;
//初始化form状态
if (action==='add'||action==='edit') {
form.setFieldsValue({
cnName: '',
name: '',
remark: '',
});
}
if (action === 'detail') {
getCurrentDataModel();
} else {
dispatchLatest({
type: 'datamodel.getAllConstraints',
callback: data => {
setConstraints(data||[]);
if (action === 'add') {
setConstraint((data||[]).length>0?data[0]:{});
getDraft((data||[]).length>0?data[0]:{}, hints);
} else if(action === 'edit') {
getCurrentDataModel();
}
})
}
}
})
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [action, hints, modelerId ]);
const getDraft = (_constraint, _hints) => {
dispatchLatest({
type: 'datamodel.getDraft',
payload: {
data: {
hints,
hints: _hints,
modelerModelingConstraint: _constraint
}
},
......
......@@ -150,9 +150,6 @@ const ImportModal = (props) => {
setHints([]);
setModelerData({});
setConfirmLoading(false);
if (form && form.resetFields) {
form.resetFields();
}
}
const onActionChange = (data) => {
......@@ -256,7 +253,7 @@ const ImportModal = (props) => {
<>
{
step===0 && <>
<Radio.Group onChange={onRadioChange}>
<Radio.Group value={radioValue} onChange={onRadioChange}>
{
modes && modes.map((mode, index) => {
return (
......
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