From 4f01a24bbcc3195085b3ba69c5e7eaf93cb57a95 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期六, 25 四月 2026 15:42:02 +0800
Subject: [PATCH] 阳光印刷web JavaUrl 配置路径
---
src/components/PIMTable/PIMTable.vue | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index a418280..bfb3c4e 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -30,7 +30,7 @@
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column
- v-for="(item, index) in column"
+ v-for="(item, index) in visibleColumns"
:key="index"
:column-key="item.columnKey"
:filter-method="item.filterHandler"
@@ -45,6 +45,7 @@
:sortable="!!item.sortable"
:type="item.type"
:width="item.width"
+ :minWidth="item.minWidth"
>
<template #header="scope">
<div class="pim-table-header-cell">
@@ -225,7 +226,7 @@
<script setup>
import pagination from "./Pagination.vue";
-import { ref, inject, getCurrentInstance } from "vue";
+import { ref, inject, getCurrentInstance, computed, unref } from "vue";
import { ElMessage } from "element-plus";
// 鑾峰彇鍏ㄥ眬鐨� uploadHeader
@@ -333,6 +334,23 @@
},
});
+const resolveColumnVisible = (visible) => {
+ if (visible === undefined) return true;
+ if (typeof visible === "function") {
+ try {
+ return !!visible();
+ } catch (error) {
+ console.warn("PIMTable column visible function error:", error);
+ return true;
+ }
+ }
+ return !!unref(visible);
+};
+
+const visibleColumns = computed(() => {
+ return (props.column || []).filter((item) => resolveColumnVisible(item?.visible));
+});
+
// Data
const uploadRefs = ref([]);
const currentFiles = ref({});
--
Gitblit v1.9.3