From 29f986b5e017d570ef0f96c71f5e9a30720833b5 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 21 Oct 2025 15:26:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A6=85=E9=81=93133=E6=88=90=E5=93=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scFormTable/index.vue | 19 ++++++++++++++----- src/views/wpm_bx/mlogbw_check_table.vue | 7 ++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue index a596ac6b..c2334964 100644 --- a/src/components/scFormTable/index.vue +++ b/src/components/scFormTable/index.vue @@ -124,11 +124,15 @@ }, //表格勾选事件 select(rows, row){ - var isSelect = rows.length && rows.indexOf(row) !== -1&& this.defaultValue.indexOf(row) !== -1 - if(isSelect){ - this.defaultValue.push(row) - }else{ - this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1) + var isSelect = rows.length && rows.indexOf(row) !== -1; + if(isSelect){//被选中 + if(this.defaultValue.indexOf(row) == -1){ + this.defaultValue.push(row) + } + }else{//被取消 + if(this.defaultValue.indexOf(row) !== -1){ + this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1) + } } this.$emit('selectChange', this.defaultValue); }, @@ -147,6 +151,11 @@ } this.$emit('selectAllChange', this.defaultValue); }, + clearSelection(){ + let that = this; + that.defaultValue = []; + this.$emit('selectChange', this.defaultValue); + }, setCurrentRows(row){ let that = this; that.$nextTick(() => { diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index d98feef8..bd3fef8b 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -288,6 +288,7 @@ + @@ -489,7 +490,6 @@ export default { selectChange(rows){ let that = this; that.selectWprList = rows; - console.log('selectChangerows',rows); }, selectAllChange(datas){ let that = this; @@ -989,6 +989,11 @@ export default { }); that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => { that.setVisible = false; + that.selectWprList = []; + that.$refs.mlogbwTable.clearSelection(); + that.defectlists.forEach(item => { + item.value = false; + }); that.getList(); }).catch((err) => { return err;