File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -415,9 +415,10 @@ const submit = async (formEl: FormInstance | undefined) => {
415415 if (! formEl ) return
416416 await formEl .validate ((valid : any ) => {
417417 if (valid ) {
418+ loading .value = true
418419 if (isEdit .value ) {
419420 loadSharedApi ({ type: ' tool' , systemType: apiType .value })
420- .putTool (form .value ?.id as string , form .value , loading )
421+ .putTool (form .value ?.id as string , form .value )
421422 .then ((res : any ) => {
422423 MsgSuccess (t (' common.editSuccess' ))
423424 emit (' refresh' , res .data )
@@ -426,13 +427,16 @@ const submit = async (formEl: FormInstance | undefined) => {
426427 .then (() => {
427428 visible .value = false
428429 })
430+ .finally (() => {
431+ loading .value = false
432+ })
429433 } else {
430434 const obj = {
431435 folder_id: folder .currentFolder ?.id ,
432436 ... form .value ,
433437 }
434438 loadSharedApi ({ type: ' tool' , systemType: apiType .value })
435- .postTool (obj , loading )
439+ .postTool (obj )
436440 .then ((res : any ) => {
437441 MsgSuccess (t (' common.createSuccess' ))
438442 emit (' refresh' )
@@ -441,6 +445,9 @@ const submit = async (formEl: FormInstance | undefined) => {
441445 .then (() => {
442446 visible .value = false
443447 })
448+ .finally (() => {
449+ loading .value = false
450+ })
444451 }
445452 }
446453 })
You can’t perform that action at this time.
0 commit comments