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
56c23826
Commit
56c23826
authored
Jul 07, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 采购能力中的弹出审核框增加loading效果,修复原因输入框不受控制显示
parent
2430c80c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
index.tsx
...saction/purchaseAbility/components/modalOperate/index.tsx
+14
-6
No files found.
src/pages/transaction/purchaseAbility/components/modalOperate/index.tsx
View file @
56c23826
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
Modal
}
from
'antd'
;
import
{
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
SchemaForm
,
SchemaMarkupField
as
Field
,
createAsyncFormActions
,
createAsyncFormActions
,
FormEffectHooks
,
FormEffectHooks
,
}
from
'@formily/antd'
}
from
'@formily/antd'
import
{
Input
,
Radio
,
DatePicker
,
Checkbox
}
from
'@formily/antd-components'
import
{
Input
,
Radio
,
DatePicker
,
Checkbox
}
from
'@formily/antd-components'
...
@@ -11,7 +11,7 @@ import moment from 'moment';
...
@@ -11,7 +11,7 @@ import moment from 'moment';
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
isEmpty
}
from
'lodash'
;
const
actions
=
createAsyncFormActions
()
const
actions
=
createAsyncFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
;
const
{
onFieldChange$
}
=
FormEffectHooks
;
export
interface
IProps
{
export
interface
IProps
{
...
@@ -39,11 +39,12 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
...
@@ -39,11 +39,12 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
maxNumber
,
maxNumber
,
}
=
props
;
}
=
props
;
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
);
const
useFormEffects
=
()
=>
{
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
createAsyncFormActions
()
if
(
modalType
===
'audit'
)
{
if
(
modalType
===
'audit'
)
{
onFieldChange$
(
'state'
).
subscribe
(({
value
})
=>
{
onFieldChange$
(
'state'
).
subscribe
(({
value
})
=>
{
setFieldState
(
'auditOpinion'
,
state
=>
{
actions
.
setFieldState
(
'auditOpinion'
,
state
=>
{
if
(
value
==
1
)
{
if
(
value
==
1
)
{
state
.
visible
=
false
state
.
visible
=
false
}
else
{
}
else
{
...
@@ -54,7 +55,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
...
@@ -54,7 +55,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
}
}
if
(
modalType
===
'planAudit'
)
{
if
(
modalType
===
'planAudit'
)
{
onFieldChange$
(
'status'
).
subscribe
(({
value
})
=>
{
onFieldChange$
(
'status'
).
subscribe
(({
value
})
=>
{
setFieldState
(
'cause'
,
state
=>
{
actions
.
setFieldState
(
'cause'
,
state
=>
{
if
(
value
==
1
)
{
if
(
value
==
1
)
{
state
.
visible
=
false
state
.
visible
=
false
}
else
{
}
else
{
...
@@ -206,6 +207,10 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
...
@@ -206,6 +207,10 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
},
[
visible
])
},
[
visible
])
const
handleSubmit
=
(
val
:
any
)
=>
{
const
handleSubmit
=
(
val
:
any
)
=>
{
if
(
confirmLoading
){
return
;
}
setConfirmLoading
(
true
);
let
value
=
{
...
val
}
let
value
=
{
...
val
}
let
params
:
any
=
{}
let
params
:
any
=
{}
if
(
modalType
===
'audit'
)
{
if
(
modalType
===
'audit'
)
{
...
@@ -235,6 +240,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
...
@@ -235,6 +240,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
onOk
&&
onOk
()
onOk
&&
onOk
()
}
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
})
})
}
}
...
@@ -262,6 +269,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
...
@@ -262,6 +269,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
onCancel=
{
handleClose
}
onCancel=
{
handleClose
}
onOk=
{
()
=>
actions
.
submit
()
}
onOk=
{
()
=>
actions
.
submit
()
}
afterClose=
{
()
=>
actions
.
reset
()
}
afterClose=
{
()
=>
actions
.
reset
()
}
confirmLoading=
{
confirmLoading
}
>
>
<
SchemaForm
<
SchemaForm
className=
{
styles
.
revise_style
}
className=
{
styles
.
revise_style
}
...
...
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