From 30e858fa504b268b9b436afca0a1259cf6e8c488 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 19 八月 2025 11:01:40 +0800
Subject: [PATCH] 优化

---
 admin/src/components/base/BaseTable.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/admin/src/components/base/BaseTable.vue b/admin/src/components/base/BaseTable.vue
index de550e8..515df9e 100644
--- a/admin/src/components/base/BaseTable.vue
+++ b/admin/src/components/base/BaseTable.vue
@@ -1,6 +1,6 @@
 <script>
 import BasePage from './BasePage'
-import {mapState} from "vuex";
+import { isFunction } from 'element-ui'
 
 export default {
   name: 'BaseTable',
@@ -102,6 +102,9 @@
       this.$refs.searchForm.resetFields()
       this.search()
     },
+    refresh () {
+     window.location.reload()
+    },
     /**
      * 椤靛閲忓彉鏇村鐞嗭紙鍒囨崲椤靛閲忔椂瑙﹀彂锛�
      *
@@ -166,9 +169,9 @@
      * @param row 琛屽璞�
      * @param childConfirm 鍒犻櫎瀛愯妭鐐规椂鏄惁杩涜浜屾纭
      */
-    deleteById (row, childConfirm = true) {
+    deleteById (row, childConfirm = true, call) {
       this.__checkApi()
-      let message = `纭鍒犻櫎${this.module}銆�${row[this.configData['field.main']]}銆戝悧?`
+      let message = `纭鍒犻櫎${this.module}鍚�?`
       if (childConfirm && row.children != null && row.children.length > 0) {
         message = `纭鍒犻櫎${this.module}銆�${row[this.configData['field.main']]}銆戝強鍏跺瓙${this.module}鍚�?`
       }
@@ -178,6 +181,9 @@
           this.api.deleteById(row[this.configData['field.id']])
             .then(() => {
               this.__afterDelete()
+              if (call) {
+                call()
+              }
             })
             .catch(e => {
               this.$tip.apiFailed(e)
@@ -193,7 +199,7 @@
      *
      * @param childConfirm 鍒犻櫎瀛愯妭鐐规椂鏄惁杩涜浜屾纭
      */
-    deleteByIdInBatch (childConfirm = true) {
+    deleteByIdInBatch (childConfirm = true, call) {
       this.__checkApi()
       if (this.tableData.selectedRows.length === 0) {
         this.$tip.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
@@ -217,6 +223,9 @@
           this.api.deleteByIdInBatch(this.tableData.selectedRows.map(row => row[this.configData['field.id']]).join(','))
             .then(() => {
               this.__afterDelete(this.tableData.selectedRows.length)
+              if (call) {
+                call()
+              }
             })
             .catch(e => {
               this.$tip.apiFailed(e)

--
Gitblit v1.9.3