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

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

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