Commit f698043e authored by 武广's avatar 武广

fix: 修改类型和类目之后清空属性

parent 5e272f2d
...@@ -92,6 +92,9 @@ const FormAttr = forwardRef((props, ref) => { ...@@ -92,6 +92,9 @@ const FormAttr = forwardRef((props, ref) => {
setInitAttrData(initValue.initValue); setInitAttrData(initValue.initValue);
setCategoryAttrs(res.data); setCategoryAttrs(res.data);
}); });
} else {
setInitAttrData({});
setCategoryAttrs([]);
} }
}; };
...@@ -163,6 +166,9 @@ const FormAttr = forwardRef((props, ref) => { ...@@ -163,6 +166,9 @@ const FormAttr = forwardRef((props, ref) => {
const ids = props.categoryIds; const ids = props.categoryIds;
if (ids && ids.length) { if (ids && ids.length) {
getAttribute(ids[ids.length - 1]); getAttribute(ids[ids.length - 1]);
} else {
setInitAttrData({});
setCategoryAttrs([]);
} }
}, [props.categoryIds]); }, [props.categoryIds]);
......
...@@ -66,6 +66,7 @@ const ServiceGoods = options => { ...@@ -66,6 +66,7 @@ const ServiceGoods = options => {
const productChange = task => { const productChange = task => {
setProductType(task.type); setProductType(task.type);
setCategoryIds([]);
const timer = setTimeout(() => { const timer = setTimeout(() => {
resetForm(); resetForm();
clearTimeout(timer); clearTimeout(timer);
......
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