From 91bba8de8a192b95827d0839827c7f5a68f13af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czhuzihan=E2=80=9D=E2=80=83?= <“772644120@qq.com”> Date: Sat, 12 Jul 2025 15:08:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LabDetail.vue | 2 +- src/config.js | 2 +- upload.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/LabDetail.vue b/src/components/LabDetail.vue index 12433c7..7984f40 100644 --- a/src/components/LabDetail.vue +++ b/src/components/LabDetail.vue @@ -152,7 +152,7 @@ class="default-table score-comparison-table" :row-class-name="tableRowClassName" > - + Date: Sat, 12 Jul 2025 16:08:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B6=85=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LabDetail.vue | 83 +++++++++++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 5 deletions(-) diff --git a/src/components/LabDetail.vue b/src/components/LabDetail.vue index 7984f40..d7305e2 100644 --- a/src/components/LabDetail.vue +++ b/src/components/LabDetail.vue @@ -113,7 +113,14 @@
-
评估摘要:{{ lab.abstracts }}
+
+
评估摘要:{{ lab.abstracts }}
+
+ {{ currentTooltip.content }} +
+
@@ -213,6 +220,26 @@ const scoreComparisonDialogVisible = ref(false); // 控制得分比较弹窗显 // 存储 Echarts 实例,用于销毁 const chartInstances = new Map(); +// Tooltip 相关 +const currentTooltip = ref({ + labId: null, + content: '', + visible: false +}); + +const showTooltip = (labId, content) => { + currentTooltip.value = { + labId: labId, + content: content, + visible: true + }; +}; + +const hideTooltip = () => { + currentTooltip.value.visible = false; +}; + + // 打开添加评估抽屉 const openAddEvaluationDrawer = () => { isEditMode.value = false; @@ -488,7 +515,7 @@ const scoreComparisonTableData = computed(() => { return selectedLabs.value.map(lab => { const row = { - category: lab.basicInformation.name2 // 纵向表头是中心名称 + category: `${lab.basicInformation.name0}-${lab.basicInformation.name2}` // 纵向表头是年份-中心名称 }; // 将 radarData 映射到 row 的动态属性上 lab.result.forEach((score, index) => { @@ -907,7 +934,7 @@ watch(filteredLabs, () => { min-height: 350px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; - position: relative; + position: relative; /* 添加此行,以便tooltip定位 */ } .lab-card:hover { @@ -1129,7 +1156,53 @@ watch(filteredLabs, () => { .searchbox{ display: flex; } -.evaluation-info{ - padding: 20px 15px; + +/* 评估摘要的容器,用于定位tooltip */ +.evaluation-info-wrapper { + position: relative; + padding: 20px 15px; /* 保持原有的padding */ +} + +/* 评估摘要文本样式 */ +.evaluation-info { + white-space: normal; /* 允许文本正常换行 */ + overflow: hidden; /* 隐藏超出容器的内容 */ + text-overflow: ellipsis; /* 显示省略号 */ + display: -webkit-box; + -webkit-line-clamp: 2; /* 限制文本为2行 */ + -webkit-box-orient: vertical; + font-size: 12px; +} + +/* 鼠标悬停时显示的气泡样式 */ +.tooltip { + position: absolute; + bottom: 100%; /* 定位在文本上方 */ + left: 50%; + transform: translateX(-50%); + background-color: rgba(0, 0, 0, 0.85); + color: #fff; + padding: 8px 12px; + border-radius: 4px; + white-space: pre-wrap; /* 保持文本换行 */ + z-index: 100; + max-width: 90%; /* 限制最大宽度 */ + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); + font-size: 14px; + line-height: 1.5; + pointer-events: none; /* 确保不影响鼠标事件 */ + margin-bottom: 10px; /* 与文本的距离 */ +} + +/* 气泡的小箭头 */ +.tooltip::after { + content: ''; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent; } \ No newline at end of file