From 9dc386edb187837f52cdf58f8aa13439c3097615 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 16 Apr 2024 11:32:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=84=E4=B8=8A=E4=BC=A0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E9=99=90=E6=94=B9=E5=AE=8C=E5=A4=9A=E4=BA=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/evaluation/evaluationUpload.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/evaluation/evaluationUpload.vue b/src/views/evaluation/evaluationUpload.vue index e4537f8d..6ee35355 100644 --- a/src/views/evaluation/evaluationUpload.vue +++ b/src/views/evaluation/evaluationUpload.vue @@ -752,7 +752,7 @@ import {downLoadZip} from "@/utils/zipdownload"; const state = reactive({ activeUrl: process.env.VUE_APP_ACT_API + '/evaluation/import', uploadTypes: true, - selectedRow: null, + selectedRows: [], uploadStatusType: true, saveNotUpload: true, stateUpload: true, @@ -905,12 +905,18 @@ import {downLoadZip} from "@/utils/zipdownload"; // 添加权限 const customRow = (record) => ({ onClick: () => { - state.selectedRow = record - state.saveList.push(record) + // 添加或移除记录,以确保其在选中数组中的状态 + const index = state.selectedRows.findIndex((item) => JSON.stringify(item) === JSON.stringify(record)); + if (index === -1) { + state.selectedRows.push(record); + } else { + state.selectedRows.splice(index, 1); + } + state.saveList = state.selectedRows } }) const getRowClassName = (record, index) => { - return state.selectedRow === record ? 'highlight-row' : ''; + return state.selectedRows.some((selected) => JSON.stringify(selected) === JSON.stringify(record)) ? 'highlight-row' : ''; } const paginationAdd = computed(() => ({ total: state.totalAdd, @@ -1556,6 +1562,7 @@ import {downLoadZip} from "@/utils/zipdownload"; state.searchParam.createName = '' state.tableDataAdd = [] state.saveList = [] + state.selectedRows = [] } //搜索权限 const searchSave = async () => {