Commit e4910505 authored by 靳野's avatar 靳野

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

This reverts commit 91f0e1df.
parent 91f0e1df
...@@ -233,6 +233,7 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -233,6 +233,7 @@ 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());
...@@ -321,7 +322,9 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -321,7 +322,9 @@ 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 ? StaticColumns(customer) : StaticColumnsPop(customer)), ...(isGoodsManage
? StaticColumns(customerRef.current)
: StaticColumnsPop(customerRef.current)),
]; ];
setDefaultColumns(dynamicColumns); setDefaultColumns(dynamicColumns);
}; };
...@@ -476,6 +479,10 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -476,6 +479,10 @@ const FormPriceOrStock = forwardRef((props, ref) => {
}, },
})); }));
useEffect(() => {
customerRef.current = customer;
}, [customer]);
useEffect(() => { useEffect(() => {
(async () => { (async () => {
await onSpecificationEvent(); await onSpecificationEvent();
...@@ -495,7 +502,7 @@ const FormPriceOrStock = forwardRef((props, ref) => { ...@@ -495,7 +502,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.isEdit, customer.isUseCache, editData, customer.isGold]);
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