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
9282289c
Commit
9282289c
authored
Aug 27, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 还原数量限制-关联供应商
parent
a1751e04
Show 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 @
9282289c
...
...
@@ -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
,
...
...
src/pages/commodity/material/materialPendingAdd/add.tsx
View file @
9282289c
...
...
@@ -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 => {
...
...
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