Ver Fonte

Merge branch 'develop'

xujunjie há 1 ano atrás
pai
commit
a3beb57abf
1 ficheiros alterados com 6 adições e 4 exclusões
  1. 6 4
      src/components/DDComponents/ManufacturerField/index.js

+ 6 - 4
src/components/DDComponents/ManufacturerField/index.js

@@ -30,10 +30,10 @@ function ManufacturerField(props) {
     setLoading(false);
   };
 
-  // 只要第一次加载即可
-  useEffect(() => {
-    getSupplier();
-  }, []);
+  // // 只要第一次加载即可
+  // useEffect(() => {
+  //   getSupplier();
+  // }, []);
 
   return (
     <Select
@@ -46,6 +46,8 @@ function ManufacturerField(props) {
         const supplier = option.find(item => item.value === val).label;
         onChange(supplier);
       }}
+      // 每次展开刷新一次数据
+      onDropdownVisibleChange={open => open && getSupplier()}
       filterOption={(input, opt) => (opt?.label ?? '').toLowerCase().includes(input.toLowerCase())}
       options={option}
     />