From c8e9849cb5f24848df0174c13bfbbff37bb08a5a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 七月 2026 15:45:30 +0800
Subject: [PATCH] 维护
---
src/components/MaintainComponents/BloodRoutinePanel.vue | 147 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 147 insertions(+), 0 deletions(-)
diff --git a/src/components/MaintainComponents/BloodRoutinePanel.vue b/src/components/MaintainComponents/BloodRoutinePanel.vue
index b91ec14..0f545ee 100644
--- a/src/components/MaintainComponents/BloodRoutinePanel.vue
+++ b/src/components/MaintainComponents/BloodRoutinePanel.vue
@@ -65,6 +65,43 @@
header-align="center"
align="center"
>
+ <!-- 鑷畾涔夊垪澶� -->
+ <template #header>
+ <div class="custom-column-header">
+ <div class="header-content" @click.stop="handleEditColumn(index)">
+ <span class="header-label">{{
+ col.label.replace("\n", " ")
+ }}</span>
+ <el-tooltip
+ v-if="col.remark"
+ :content="col.remark"
+ placement="top"
+ >
+ <i class="el-icon-info header-remark-icon"></i>
+ </el-tooltip>
+ </div>
+ <div class="header-actions" v-if="isEditing">
+ <el-tooltip content="缂栬緫鏃堕棿" placement="top">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-edit"
+ class="header-btn"
+ @click.stop="handleEditColumn(index)"
+ />
+ </el-tooltip>
+ <el-tooltip content="鍒犻櫎姝ゅ垪" placement="top">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ class="header-btn delete-btn"
+ @click.stop="handleDeleteColumnByIndex(index)"
+ />
+ </el-tooltip>
+ </div>
+ </div>
+ </template>
<template #default="scope">
<div class="cell-content-wrapper">
<el-input
@@ -411,7 +448,57 @@
this.attachments = [...this.internalData.attachments];
}
},
+// 缂栬緫鎸囧畾绱㈠紩鐨勫垪
+handleEditColumn(index) {
+ if (!this.isEditing) return;
+ this.editingColumnIndex = index;
+ const column = this.dynamicColumns[index];
+ this.columnForm = {
+ date: column.date || '',
+ time: column.time || '',
+ remark: column.remark || ''
+ };
+ this.columnDialogVisible = true;
+ this.$nextTick(() => {
+ this.$refs.columnFormB && this.$refs.columnFormB.clearValidate();
+ });
+},
+// 閫氳繃绱㈠紩鍒犻櫎鍒楋紙甯︾‘璁わ級
+handleDeleteColumnByIndex(index) {
+ this.$confirm(
+ `纭畾瑕佸垹闄ゃ��${this.dynamicColumns[index].label.replace('\n', ' ')}銆嶈繖涓椂闂寸偣鐨勬墍鏈夋暟鎹悧锛焋,
+ '鍒犻櫎纭',
+ {
+ confirmButtonText: '纭畾鍒犻櫎',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }
+ ).then(() => {
+ // 鍒犻櫎鍒�
+ this.dynamicColumns.splice(index, 1);
+
+ // 鍚屾鍒犻櫎姣忚瀵瑰簲鐨勬暟鎹�
+ this.tableData.forEach(row => {
+ if (row.values && row.values.length > index) {
+ row.values.splice(index, 1);
+ }
+ });
+
+ // 瑙﹀彂閲嶆柊娓叉煋
+ this.tableKey += 1;
+
+ // 淇濆瓨鏁版嵁鍙樻洿
+ this.saveData();
+
+ this.$message({
+ type: 'success',
+ message: '鏃堕棿鐐瑰凡鍒犻櫎'
+ });
+ }).catch(() => {
+ // 鍙栨秷鍒犻櫎锛屼笉鍋氫换浣曟搷浣�
+ });
+},
// 鍒濆鍖栭粯璁よ〃鏍兼暟鎹�
initTableData() {
const medicalItems = this.getMedicalItems();
@@ -983,7 +1070,67 @@
font-size: 13px;
margin-left: 8px;
}
+/* 鑷畾涔夊垪澶存牱寮� */
+.custom-column-header {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 4px;
+ padding: 4px 0;
+}
+.header-content {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ cursor: pointer;
+ transition: color 0.2s;
+ white-space: nowrap;
+}
+
+.header-content:hover {
+ color: #409eff;
+}
+
+.header-label {
+ font-size: 13px;
+ line-height: 1.4;
+}
+
+.header-remark-icon {
+ color: #909399;
+ font-size: 12px;
+ cursor: help;
+}
+
+.header-actions {
+ display: flex;
+ gap: 4px;
+ opacity: 0;
+ transition: opacity 0.2s;
+}
+
+.custom-column-header:hover .header-actions {
+ opacity: 1;
+}
+
+.header-btn {
+ padding: 2px 4px !important;
+ font-size: 14px !important;
+}
+
+.header-btn.delete-btn {
+ color: #f56c6c !important;
+}
+
+.header-btn.delete-btn:hover {
+ color: #c0392b !important;
+}
+
+/* 鍒楀ご缂栬緫鎸夐挳鍦ㄧ紪杈戞ā寮忎笅濮嬬粓鏄剧ず */
+.is-editing .header-actions {
+ opacity: 1;
+}
/* 鍝嶅簲寮忚璁� */
@media (max-width: 768px) {
.medical-panel {
--
Gitblit v1.9.3