From 9b00b80c926b3d1b38b7ef9b682ee097345dde3f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 17 四月 2025 11:09:31 +0800
Subject: [PATCH] 代码初始化
---
admin/src/components/base/BaseTable.vue | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/admin/src/components/base/BaseTable.vue b/admin/src/components/base/BaseTable.vue
index 79e9171..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,7 +169,7 @@
* @param row 琛屽璞�
* @param childConfirm 鍒犻櫎瀛愯妭鐐规椂鏄惁杩涜浜屾纭
*/
- deleteById (row, childConfirm = true) {
+ deleteById (row, childConfirm = true, call) {
this.__checkApi()
let message = `纭鍒犻櫎${this.module}鍚�?`
if (childConfirm && row.children != null && row.children.length > 0) {
@@ -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