Commit f80d32d1 by zhaochengxiang

修改模型问题

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