From aad35b2fd993a8c8894a91e30041dbb5e04e096b Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Thu, 19 May 2022 10:18:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=8D=95=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/archivesConfig/dict/dictDetail.vue | 23 +++++++++++++++++++- src/views/archivesConfig/dict/index.vue | 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/views/archivesConfig/dict/dictDetail.vue b/src/views/archivesConfig/dict/dictDetail.vue index 8d95a9c..6af6bb1 100644 --- a/src/views/archivesConfig/dict/dictDetail.vue +++ b/src/views/archivesConfig/dict/dictDetail.vue @@ -28,7 +28,7 @@ - + @@ -110,6 +110,24 @@ export default { [CRUD.HOOK.beforeRefresh]() { this.crud.query.id = this.dicPid return true + }, + clickRowHandler(row) { + this.$refs.table.clearSelection() + this.$refs.table.toggleRowSelection(row) + }, + selectionChangeHandler(val) { + let finalVal + if (val.length > 1) { + // 取出最后val的最后一个返回出来 + finalVal = val.pop() + // 清除所有选中 + this.$refs.table.clearSelection() + // 给最后一个加上选中 + this.$refs.table.toggleRowSelection(finalVal) + } else { + finalVal = val + } + this.crud.selectionChangeHandler(finalVal) } } } @@ -119,4 +137,7 @@ export default { ::v-deep .el-input-number .el-input__inner { text-align: left; } +::v-deep thead .el-table-column--selection .cell { + display: none; +} diff --git a/src/views/archivesConfig/dict/index.vue b/src/views/archivesConfig/dict/index.vue index 3834c30..0d6d2ca 100644 --- a/src/views/archivesConfig/dict/index.vue +++ b/src/views/archivesConfig/dict/index.vue @@ -24,13 +24,13 @@ - + - +