From 33014449a9af8c53863a3952a06781c36862abd0 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Tue, 28 Jul 2026 10:31:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sampleTracking/projectProofTracking.vue | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/views/modules/sampleTracking/projectProofTracking.vue b/src/views/modules/sampleTracking/projectProofTracking.vue index f1dc6c7..f248098 100644 --- a/src/views/modules/sampleTracking/projectProofTracking.vue +++ b/src/views/modules/sampleTracking/projectProofTracking.vue @@ -185,7 +185,7 @@ }" >{{ processTooltip.content }} - + @@ -217,7 +217,7 @@ - + @@ -234,11 +234,6 @@ - - - - - @@ -895,6 +890,7 @@ export default { pageSize: 20, totalPage: 0, currentRow: null, + manualSelectedTrackingId: null, selectionRows: [], batchEditMode: false, processHistoryMap: {}, @@ -1253,11 +1249,19 @@ export default { this.cancelCommentsEdit() } } - if (this.dataList.length > 0) { - this.currentRow = this.dataList[0] - } else { - this.currentRow = null + const manualSelectedId = this.manualSelectedTrackingId + const previousCurrentId = this.currentRow && this.currentRow.trackingId + let nextCurrentRow = null + if (manualSelectedId != null) { + // 只要用户没有手动点新行,刷新后始终尝试回选上次手动选中的那一行 + nextCurrentRow = this.dataList.find(item => item && item.trackingId === manualSelectedId) || null + } else if (previousCurrentId != null) { + nextCurrentRow = this.dataList.find(item => item && item.trackingId === previousCurrentId) || null + } + if (!nextCurrentRow && manualSelectedId == null && this.dataList.length > 0) { + nextCurrentRow = this.dataList[0] } + this.currentRow = nextCurrentRow this.$nextTick(() => { if (this.$refs.trackingTable && typeof this.$refs.trackingTable.setCurrentRow === 'function') { this.$refs.trackingTable.setCurrentRow(this.currentRow || null) @@ -1366,6 +1370,7 @@ export default { }, rowClick (row) { this.currentRow = row + this.manualSelectedTrackingId = row && row.trackingId ? row.trackingId : null }, sizeChangeHandle (val) { this.pageSize = val