Commit cde6f0c7 authored by 前端-吴智勇's avatar 前端-吴智勇

Merge branch 'jinfa-0518' into 'jinfa-0518'

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