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
shenshaokai
jinfa-platform
Commits
2c3e0ebd
Commit
2c3e0ebd
authored
Oct 21, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:useAsyncSelect
parent
c6a733f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
useAsyncSelect.ts
src/formSchema/effects/useAsyncSelect.ts
+3
-2
No files found.
src/formSchema/effects/useAsyncSelect.ts
View file @
2c3e0ebd
...
@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
...
@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
})
linkage
.
loading
(
name
)
linkage
.
loading
(
name
)
service
().
then
(
res
=>
{
service
().
then
(
res
=>
{
let
enums
=
[]
if
(
format
)
{
if
(
format
)
{
const
[
labelString
,
valueString
]
=
format
const
[
labelString
,
valueString
]
=
format
re
s
=
res
.
map
(
v
=>
({
enum
s
=
res
.
map
(
v
=>
({
label
:
v
[
labelString
],
label
:
v
[
labelString
],
value
:
v
[
valueString
]
value
:
v
[
valueString
]
}))
}))
...
@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
...
@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
})
linkage
.
loaded
(
name
)
linkage
.
loaded
(
name
)
linkage
.
enum
(
name
,
re
s
)
linkage
.
enum
(
name
,
enum
s
)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch
(
'requestAsyncSelect'
,
{
dispatch
(
'requestAsyncSelect'
,
{
name
,
name
,
...
...
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