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