Commit 91f0e1df authored by 靳野's avatar 靳野

fix:切换类目保留添加的状态

parent 1818abb8
......@@ -233,7 +233,6 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const editRef = useRef(null);
const packageRef = useRef(null);
const customer = useContext(ServiceContext);
const customerRef = useRef(customer);
const [form] = Form.useForm();
const [specInitValue, setSpecInitValue] = useState(initSpecReced());
......@@ -322,9 +321,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const isGoodsManage = window.location.pathname.indexOf('popGoodsManage') < 0;
const dynamicColumns = [
...columsData,
...(isGoodsManage
? StaticColumns(customerRef.current)
: StaticColumnsPop(customerRef.current)),
...(isGoodsManage ? StaticColumns(customer) : StaticColumnsPop(customer)),
];
setDefaultColumns(dynamicColumns);
};
......@@ -479,10 +476,6 @@ const FormPriceOrStock = forwardRef((props, ref) => {
},
}));
useEffect(() => {
customerRef.current = customer;
}, [customer]);
useEffect(() => {
(async () => {
await onSpecificationEvent();
......@@ -502,7 +495,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
setMergeTable(Boolean(editData.secondSpecValue && editData.secondSpecValue.length));
setTableData(fliterSkuListSortData(skuList) || []);
}
}, [customer.isEdit, customer.isUseCache, editData, customer.isGold]);
}, [customer.isEdit, customer.isUseCache, editData]);
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