Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
cde6f0c7
Commit
cde6f0c7
authored
Aug 27, 2022
by
前端-吴智勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jinfa-0518' into 'jinfa-0518'
fix: 还原数量限制-关联供应商 See merge request project/jinfa-platform!314
parents
7b89b683
9282289c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
useAsyncSelect.ts
src/formSchema/effects/useAsyncSelect.ts
+2
-2
add.tsx
src/pages/commodity/material/materialPendingAdd/add.tsx
+1
-1
No files found.
src/formSchema/effects/useAsyncSelect.ts
View file @
cde6f0c7
...
@@ -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
,
...
...
src/pages/commodity/material/materialPendingAdd/add.tsx
View file @
cde6f0c7
...
@@ -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 => {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment