From 2de51b11d22291c0b204378154fc407c1ea8b691 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 14 一月 2026 14:39:11 +0800
Subject: [PATCH] fix: 参考中天的[检测标准]页面,设置总分两张表,总表代表着一个检测标准汇总(也要根据质检类型去选择),分表代表这个检测标准汇总下具体的检测参数信息。
---
src/components/PIMTable/PIMTable.vue | 38 +++++++++++++++++++++++++++++++++-----
1 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 955173d..ac4656d 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -10,7 +10,7 @@
:row-class-name="rowClassName"
:row-style="rowStyle"
:row-key="rowKey"
- style="width: 100%"
+ :style="tableStyle"
tooltip-effect="dark"
:expand-row-keys="expandRowKeys"
:show-summary="isShowSummary"
@@ -46,6 +46,16 @@
:type="item.type"
:width="item.width"
>
+ <template #header="scope">
+ <div class="pim-table-header-cell">
+ <div class="pim-table-header-title">
+ {{ item.label }}
+ </div>
+ <div v-if="item.headerSlot" class="pim-table-header-extra">
+ <slot :name="item.headerSlot" :column="scope.column" />
+ </div>
+ </div>
+ </template>
<template
v-if="item.hasOwnProperty('colunmTemplate')"
#[item.colunmTemplate]="scope"
@@ -124,7 +134,6 @@
<template v-for="(o, key) in item.operation" :key="key">
<el-button
v-show="o.type != 'upload'"
- size="small"
v-if="o.showHide ? o.showHide(scope.row) : true"
:disabled="o.disabled ? o.disabled(scope.row) : false"
:plain="o.plain"
@@ -149,7 +158,6 @@
(o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
"
ref="uploadRef"
- size="small"
:multiple="o.multiple ? o.multiple : false"
:limit="1"
:disabled="o.disabled ? o.disabled(scope.row) : false"
@@ -178,7 +186,6 @@
:show-file-list="false"
>
<el-button
- :size="o.size ? o.size : 'small'"
link
type="primary"
:disabled="o.disabled ? o.disabled(scope.row) : false"
@@ -207,7 +214,6 @@
</el-table-column>
</el-table>
<pagination
- v-if="page.total > 0"
:total="page.total"
:layout="page.layout"
:page="page.current"
@@ -315,6 +321,10 @@
total: {
type: Number,
default: 0,
+ },
+ tableStyle: {
+ type: [String, Object],
+ default: () => ({ width: "100%" }),
},
});
@@ -429,4 +439,22 @@
padding-right: 0 !important;
padding-left: 0 !important;
}
+
+.pim-table-header-cell {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 4px;
+ text-align: center;
+}
+
+.pim-table-header-title {
+ font-weight: 500;
+}
+
+.pim-table-header-extra :deep(.el-input),
+.pim-table-header-extra :deep(.el-select) {
+ width: 100%;
+}
</style>
--
Gitblit v1.9.3