From 32f10392ab00b07e85c0b4229037c30af7c3f28e Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 27 一月 2026 10:42:49 +0800
Subject: [PATCH] 浪潮对接单点登录:mis调整2
---
src/components/PIMTable/PIMTable.vue | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index d1b778d..52becd6 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -10,11 +10,12 @@
: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"
:summary-method="summaryMethod"
+ stripe
@row-click="rowClick"
@current-change="currentChange"
@selection-change="handleSelectionChange"
@@ -40,12 +41,22 @@
:fixed="item.fixed"
:label="item.label"
:prop="item.prop"
- show-overflow-tooltip
+ :show-overflow-tooltip="item.dataType !== 'action' && item.dataType !== 'slot'"
:align="item.align"
:sortable="!!item.sortable"
: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"
@@ -120,11 +131,10 @@
</div>
<!-- 鎸夐挳 -->
- <div v-else-if="item.dataType == 'action'">
+ <div v-else-if="item.dataType == 'action'" @click.stop>
<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"
@@ -136,7 +146,7 @@
: o.color,
}"
link
- @click="o.clickFun(scope.row)"
+ @click.stop="o.clickFun(scope.row)"
:key="key"
>
{{ o.name }}
@@ -149,7 +159,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 +187,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,8 +215,8 @@
</el-table-column>
</el-table>
<pagination
- v-show="total > 0"
- :total="total"
+ v-if="isShowPagination"
+ :total="page.total"
:layout="page.layout"
:page="page.current"
:limit="page.size"
@@ -245,7 +253,7 @@
},
height: {
type: [Number, String],
- default: "calc(100vh - 18.5em)",
+ default: "calc(100vh - 22em)",
},
expandRowKeys: {
type: Array,
@@ -270,6 +278,10 @@
isSelection: {
type: Boolean,
default: false,
+ },
+ isShowPagination: {
+ type: Boolean,
+ default: true,
},
isShowSummary: {
type: Boolean,
@@ -301,7 +313,7 @@
},
rowKey: {
type: String,
- default: undefined,
+ default: 'id',
},
page: {
type: Object,
@@ -315,6 +327,10 @@
total: {
type: Number,
default: 0,
+ },
+ tableStyle: {
+ type: [String, Object],
+ default: () => ({ width: "100%" }),
},
});
@@ -429,4 +445,9 @@
padding-right: 0 !important;
padding-left: 0 !important;
}
+
+.pim-table-header-extra :deep(.el-input),
+.pim-table-header-extra :deep(.el-select) {
+ width: 100%;
+}
</style>
--
Gitblit v1.9.3