From 1676510d4de948294c8cf3862afd0a8990f2f6c8 Mon Sep 17 00:00:00 2001 From: sunhaoyuan Date: Fri, 28 Nov 2025 16:38:30 +0800 Subject: [PATCH] 11.28 --- src/views/rescue/businessStatistics.vue | 10 ++++++---- src/views/rescue/index.vue | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/rescue/businessStatistics.vue b/src/views/rescue/businessStatistics.vue index c9b68a3..df59066 100644 --- a/src/views/rescue/businessStatistics.vue +++ b/src/views/rescue/businessStatistics.vue @@ -50,7 +50,7 @@ start-placeholder="开始日期" end-placeholder="结束日期" @change="fetchDriverStats" class="full-width-picker" /> - @@ -305,12 +305,13 @@ export default { methods: { /** 手风琴式展开:只保留当前这一行,其他全部收起 */ onExpandChange(row) { + const key = row._rowKey // ← 改这里 // 如果当前就是这行在展开,说明用户想收起 → 清空 - if (this.expandedRows[0] === row.driverId) { + if (this.expandedRows[0] === key) { this.expandedRows = [] } else { // 否则只展开这一行 - this.expandedRows = [row.driverId] + this.expandedRows = [key] } }, @@ -359,7 +360,8 @@ export default { const { data } = await request.get('/app/rescueInfo/getRescueStatisticsInfoByDriver', { params }); /* ③③ 后端金额单位是“分” => 前端显示“元”,同时把字段名转成表格用的 */ - this.driverList = (data || []).map(driver => ({ + this.driverList = (data || []).map((driver,idx) => ({ + _rowKey: `${driver.driverId}-${idx}`, // 👈 新增 driverId: driver.driverId, driverName: driver.driverName, diff --git a/src/views/rescue/index.vue b/src/views/rescue/index.vue index ff098f2..c23c963 100644 --- a/src/views/rescue/index.vue +++ b/src/views/rescue/index.vue @@ -304,7 +304,7 @@ -