From d188a73a5eb50438a469c00aa0df9f68507f3fe5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 11 四月 2025 17:36:48 +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