From f4d2b0cbb786c1755d082ab9cf7d54bb6bc57e2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com>
Date: Mon, 12 Oct 2026 15:06:13 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E7=AE=A1=E7=90=86=E7=AB=AF):=20SchemaTable?=
=?UTF-8?q?=20=E8=A1=8C=E6=93=8D=E4=BD=9C=E6=94=B9=E6=96=87=E5=AD=97?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=B9=B6=E7=BB=9F=E4=B8=80=E6=93=8D=E4=BD=9C?=
=?UTF-8?q?=E5=88=97=E5=9B=BA=E5=AE=9A=E5=8F=B3=E4=BE=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SchemaPage/components/SchemaTable.vue | 52 ++++++-------------
.../financialRecords/recharge/index.vue | 2 +-
.../pages/marketing/integral/record/index.vue | 2 +-
.../admin/src/pages/system/crontab/index.vue | 2 +-
.../admin/src/pages/system/event/index.vue | 2 +-
5 files changed, 20 insertions(+), 40 deletions(-)
diff --git a/frontend/admin/src/components/SchemaPage/components/SchemaTable.vue b/frontend/admin/src/components/SchemaPage/components/SchemaTable.vue
index f2371e79c..991306f3f 100644
--- a/frontend/admin/src/components/SchemaPage/components/SchemaTable.vue
+++ b/frontend/admin/src/components/SchemaPage/components/SchemaTable.vue
@@ -25,19 +25,12 @@
-
+
-
-
- {{ actionItem.label }}
-
+
+
+ {{ actionItem.label }}
@@ -51,7 +44,7 @@
/**
* 通用页面表格(独立组件)
*
- * 基于 el-table 封装:按列定义分发渲染(SchemaTableCell),操作列按行操作配置输出链接按钮。
+ * 基于 el-table 封装:按列定义分发渲染(SchemaTableCell),操作列按行操作配置输出文字链接。
*/
import { computed } from 'vue';
import SchemaTableCell from './SchemaTableCell.vue';
@@ -88,10 +81,10 @@ const props = defineProps({
const emit = defineEmits(['row-action', 'switch-change', 'sort-change', 'selection-change']);
-/** 操作列宽度:按按钮数量与文案长度估算 */
+/** 操作列宽度:按链接文案长度与分隔线数量估算 */
const actionColumnWidth = computed(() => {
const totalChars = props.rowActions.reduce((sum, item) => sum + (item.label || '').length, 0);
- return Math.max(100, totalChars * 15 + 60);
+ return Math.max(100, totalChars * 13 + 20 * props.rowActions.length + 40);
});
/** 超长文本列的气泡配置:通过 popperClass 限定最大宽度(样式见文件底部全局样式块) */
@@ -132,6 +125,15 @@ function isActionVisible(actionItem, row) {
});
}
+/**
+ * 当前行可见的行操作列表(模板按序渲染链接,分隔线插在相邻可见动作之间)
+ * @param {object} row 行数据
+ * @returns {Array}
+ */
+function visibleRowActions(row) {
+ return props.rowActions.filter((item) => isActionVisible(item, row));
+}
+
/** 开关列切换透传 */
function onSwitchChange(payload) {
emit('switch-change', payload);
@@ -154,28 +156,6 @@ function onSortChange({ prop, order }) {
}
-
-