Commit 9282289c authored by wzy's avatar wzy

fix: 还原数量限制-关联供应商

parent a1751e04
......@@ -7,7 +7,7 @@ const { onFormMount$ } = FormEffectHooks
* @param name 待处理的表单路径
* @param service 触发的异步函数, 需返回一个{label: any, value: any}形式的数组
*/
export const useAsyncSelect = async (name, service: () => Promise<any[]>, format?: [string, string], num = 999) => {
export const useAsyncSelect = async (name, service: () => Promise<any[]>, format?: [string, string]) => {
const { dispatch, setFieldState } = createFormActions()
const linkage = useLinkageUtils()
......@@ -33,7 +33,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
linkage.loaded(name)
linkage.enum(name, enums.slice(0,num))
linkage.enum(name, enums)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch('requestAsyncSelect', {
name,
......
......@@ -576,7 +576,7 @@ const MaterialAdd: React.FC<IProps> = (props) => {
effects={($, actions) => {
useAsyncCascader('category', fetchCategoryData)
useAsyncSelect('brand', fetchBrand, ["name", "id"])
useAsyncSelect('vendor', fetchVendor, ["name", 'memberGlobalMqId'], 10)
useAsyncSelect('vendor', fetchVendor, ["name", 'memberGlobalMqId'])
useAsyncCascader('materialGroup', fetchTreeData);
useBusinessEffects()
useLinkEnumEffect('areaResponses', result => {
......
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