@@ -34,10 +34,10 @@ export const Flex = (
34
34
start ?: boolean ;
35
35
end ?: boolean ;
36
36
} & Pick < React . CSSProperties , "marginTop" | "marginBottom" >
37
- > ,
37
+ >
38
38
) => {
39
39
const justifyContent = Object . keys ( props ) . find ( ( key ) =>
40
- justifyContentList . find ( ( prop ) => new RegExp ( key ) . test ( prop ) ) ,
40
+ justifyContentList . find ( ( prop ) => new RegExp ( key ) . test ( prop ) )
41
41
) ;
42
42
43
43
return props . hidden ? null : (
@@ -110,7 +110,7 @@ export const RowSelectionPro = (props: {
110
110
m [ i ] = true ;
111
111
return m ;
112
112
} ,
113
- { } ,
113
+ { }
114
114
) ;
115
115
const keys : ( string | number ) [ ] = [ ] ;
116
116
ds . forEach ( ( item ) => {
@@ -135,12 +135,12 @@ export interface CommonShadowPopup extends IShadowFormOptions {
135
135
act ?: string ;
136
136
onCancel ?: (
137
137
ctx : ReturnType < typeof useProArrayTableContext > ,
138
- querylistCtx : ReturnType < typeof useQueryListContext > ,
138
+ querylistCtx : ReturnType < typeof useQueryListContext >
139
139
) => void | Promise < void > ;
140
140
onOk ?: (
141
141
data : any ,
142
142
ctx : ReturnType < typeof useProArrayTableContext > ,
143
- querylistCtx : ReturnType < typeof useQueryListContext > ,
143
+ querylistCtx : ReturnType < typeof useQueryListContext >
144
144
) => void | Promise < void > ;
145
145
}
146
146
@@ -149,7 +149,7 @@ export const ArrayTableShowModal: React.FC<
149
149
CommonShadowPopup
150
150
> = ( props ) => {
151
151
const { SchemaField, form, schema } = useShadowForm (
152
- pick ( props , "schema" , "schemaFieldOptions" , "subFormOptions" ) ,
152
+ pick ( props , "schema" , "schemaFieldOptions" , "subFormOptions" )
153
153
) ;
154
154
const mySchema = useFieldSchema ( ) ;
155
155
const act = props . act ?? mySchema . name ;
@@ -189,7 +189,6 @@ export const ArrayTableShowModal: React.FC<
189
189
} , 200 ) ;
190
190
} ) . finally ( ( ) => {
191
191
pending . current = false ;
192
- setLoading ( false ) ;
193
192
} ) ;
194
193
} ;
195
194
@@ -201,9 +200,11 @@ export const ArrayTableShowModal: React.FC<
201
200
onCancel = { ( ) => {
202
201
if ( pending . current ) return ;
203
202
setLoading ( true ) ;
204
- return Promise . resolve ( props ?. onCancel ?.( ctx , queryListCtx ) ) . then ( ( ) =>
205
- reset ( ) ,
206
- ) ;
203
+ return Promise . resolve ( props ?. onCancel ?.( ctx , queryListCtx ) )
204
+ . then ( ( ) => reset ( ) )
205
+ . finally ( ( ) => {
206
+ setLoading ( false ) ;
207
+ } ) ;
207
208
} }
208
209
cancelButtonProps = { {
209
210
loading,
@@ -218,13 +219,13 @@ export const ArrayTableShowModal: React.FC<
218
219
return form
219
220
. submit ( )
220
221
. then ( ( data ) => {
221
- return Promise . resolve (
222
- props ?. onOk ?.( data , ctx , queryListCtx ) ,
223
- ) . finally ( ( ) => {
224
- pending . current = false ;
225
- } ) ;
222
+ return Promise . resolve ( props ?. onOk ?.( data , ctx , queryListCtx ) ) ;
226
223
} )
227
- . then ( ( ) => reset ( ) ) ;
224
+ . then ( ( ) => reset ( ) )
225
+ . finally ( ( ) => {
226
+ pending . current = false ;
227
+ setLoading ( false ) ;
228
+ } ) ;
228
229
} }
229
230
>
230
231
< FormProvider form = { form } >
0 commit comments