zh 7 bulan lalu
induk
melakukan
5873fc3708
1 mengubah file dengan 8 tambahan dan 10 penghapusan
  1. 8 10
      src/common/components/sd-data-table.vue

+ 8 - 10
src/common/components/sd-data-table.vue

@@ -484,7 +484,7 @@ export default {
       },
       immediate: true,
     },
-    'pagination.pageSize': function (p) {
+    'pagination.pageSize': function(p) {
       this.refresh()
     },
 
@@ -710,17 +710,15 @@ export default {
     doAction(action, ...args) {
       // 调用callback,并处理loading状态
       this.btnIsLoading = { ...this.btnIsLoading, [action.id]: true }
-      Promise.resolve(action.callback(...args, { loadingStatus: this.btnIsLoading })).finally(
-        () => {
-          if (action.label.includes('导出')) {
-            setTimeout(() => {
-              this.btnIsLoading = { ...this.btnIsLoading, [action.id]: false }
-            }, 3000)
-          } else {
+      Promise.resolve(action.callback(...args)).finally(() => {
+        if (action.label.includes('导出')) {
+          setTimeout(() => {
             this.btnIsLoading = { ...this.btnIsLoading, [action.id]: false }
-          }
+          }, 3000)
+        } else {
+          this.btnIsLoading = { ...this.btnIsLoading, [action.id]: false }
         }
-      )
+      })
     },
     /**
      * 导出Excel