From e9d5d234ea0f92087b8154a2a3311292cb91d0cf Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 15 九月 2025 11:05:43 +0800
Subject: [PATCH] 部署修改
---
src/components/Table/ETable.vue | 68 +++++++++++++++++++++++++++------
1 files changed, 55 insertions(+), 13 deletions(-)
diff --git a/src/components/Table/ETable.vue b/src/components/Table/ETable.vue
index a43e501..b7089d2 100644
--- a/src/components/Table/ETable.vue
+++ b/src/components/Table/ETable.vue
@@ -17,8 +17,8 @@
:row-key="rowKey"
style="width: 100%;"
>
- <el-table-column v-if="showSelection" type="selection" width="55" align="center" />
- <el-table-column v-if="showIndex" label="搴忓彿" width="60" align="center" fixed="left">
+ <el-table-column v-if="showSelection" type="selection" width="55" align="center" :show-overflow-tooltip="false" />
+ <el-table-column v-if="showIndex" label="搴忓彿" width="60" align="center" fixed="left" :show-overflow-tooltip="false">
<template #default="scope">
{{ getRowIndex(scope.$index) }}
</template>
@@ -32,20 +32,35 @@
</el-table-column>
</template>
<!-- 鎿嶄綔鍒� -->
- <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" fixed="right" align="center">
+ <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" :show-overflow-tooltip="false" fixed="right" align="center">
<template #default="scope">
<slot name="operations" :row="scope.row">
+ <!-- 鑷畾涔夋寜閽� - 鏀惧湪榛樿鎸夐挳涔嬪墠 -->
+ <el-button
+ v-for="button in customButtons"
+ :key="button.name"
+ v-show="!button.show || button.show(scope.row)"
+ :link="button.link !== false"
+ :type="button.type || 'primary'"
+ :size="button.size || 'small'"
+ :icon="button.icon"
+ :disabled="button.disabled && button.disabled(scope.row)"
+ @click="handleCustomClick(button.name, scope.row)"
+ >
+ {{ button.label }}
+ </el-button>
+
+ <!-- 榛樿鎿嶄綔鎸夐挳 -->
<el-button v-if="operations.includes('edit')" link type="primary" size="small"
@click="handleEdit(scope.row)">缂栬緫</el-button>
+ <el-button v-if="operations.includes('scheduling') && scope.row.status != 3" link type="primary" size="small"
+ @click="handleEdit(scope.row)">鎺掍骇</el-button>
+ <el-button v-if="operations.includes('work') && scope.row.status != 3" link type="primary" size="small"
+ @click="handleEdit(scope.row)">鎶ュ伐</el-button>
+ <el-button v-if="operations.includes('viewRow')" link type="primary" size="small"
+ @click="handleView(scope.row)">鏌ョ湅</el-button>
<el-button v-if="operations.includes('viewFile')" link type="primary" size="small"
- @click="handleView(scope.row)">鏌ョ湅闄勪欢</el-button>
- <!-- <el-button-->
- <!-- v-if="operations.includes('delete')"-->
- <!-- link-->
- <!-- type="danger"-->
- <!-- size="small"-->
- <!-- @click="handleDelete(scope.row)"-->
- <!-- >鍒犻櫎</el-button>-->
+ @click="handleViewFile(scope.row)">鏌ョ湅闄勪欢</el-button>
</slot>
</template>
</el-table-column>
@@ -131,7 +146,25 @@
operations: {
type: Array,
default: () => ['edit', 'delete', 'export']
- }, // 鍒犻櫎纭淇℃伅
+ },
+ // 鑷畾涔夋寜閽厤缃�
+ customButtons: {
+ type: Array,
+ default: () => []
+ // 绀轰緥閰嶇疆锛�
+ // [
+ // {
+ // name: 'return', // 鎸夐挳鏍囪瘑
+ // label: '褰掕繕', // 鎸夐挳鏄剧ず鏂囨湰
+ // type: 'success', // 鎸夐挳绫诲瀷
+ // size: 'small', // 鎸夐挳澶у皬
+ // icon: '', // 鍥炬爣(鍙��)
+ // show: (row) => true, // 鏄剧ず鏉′欢鍑芥暟(鍙��)
+ // disabled: (row) => false, // 绂佺敤鏉′欢鍑芥暟(鍙��)
+ // }
+ // ]
+ },
+ // 鍒犻櫎纭淇℃伅
deleteConfirmText: {
type: String,
default: '纭鍒犻櫎璇ヨ褰曪紵'
@@ -168,7 +201,7 @@
};
// 澶勭悊閫夋嫨鍙樺寲銆佺紪杈戙�佸垹闄ゅ拰瀵煎嚭鎿嶄綔
-const emit = defineEmits(['selection-change', 'edit', 'delete', 'export'])
+const emit = defineEmits(['selection-change', 'edit', 'delete', 'export', 'viewRow', 'viewFile', 'custom-click'])
const handleSelectionChange = (selection) => {
emit('selection-change', selection)
}
@@ -176,8 +209,17 @@
emit('edit', row)
}
const handleView = (row) => {
+ emit('viewRow', row)
+}
+const handleViewFile = (row) => {
emit('viewFile', row)
}
+
+// 澶勭悊鑷畾涔夋寜閽偣鍑�
+const handleCustomClick = (buttonName, row) => {
+ emit('custom-click', { buttonName, row })
+}
+
const handleDelete = (row) => {
ElMessageBox.confirm(
props.deleteConfirmText,
--
Gitblit v1.9.3