From f9af97eb92e5927e550ba3dd51c81784d20a4957 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com>
Date: Wed, 8 Dec 2021 11:14:17 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/home2/components/empennage/index.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pages/home2/components/empennage/index.vue b/src/pages/home2/components/empennage/index.vue
index 66e7ad0ea..e4bddce2a 100644
--- a/src/pages/home2/components/empennage/index.vue
+++ b/src/pages/home2/components/empennage/index.vue
@@ -7,7 +7,7 @@
-
+
+
+
+
+
+
查询
From a5b6b9c75f73d3b44b3c7abaefe17205fb20be40 Mon Sep 17 00:00:00 2001
From: zhutianqi
Date: Wed, 8 Dec 2021 16:54:54 +0800
Subject: [PATCH 4/4] commit
---
src/components/roleTree/index.vue | 55 ++++++++++++++++++++-----------
1 file changed, 36 insertions(+), 19 deletions(-)
diff --git a/src/components/roleTree/index.vue b/src/components/roleTree/index.vue
index 64c8f8a1e..c21e09c28 100644
--- a/src/components/roleTree/index.vue
+++ b/src/components/roleTree/index.vue
@@ -143,26 +143,33 @@
}
}),
checkChange2 (row, type, c) {
- if (type) {
- this.nodeList.push(row.id)
+ if (this.checkBox) {
} else {
- for (let a = 0; a < this.nodeList.length; a ++) {
- if (row.id === this.nodeList[a]) {
- this.nodeList.splice(a, 1)
+ if (type) {
+ this.nodeList.push(row.id)
+ } else {
+ for (let a = 0; a < this.nodeList.length; a ++) {
+ if (row.id === this.nodeList[a]) {
+ this.nodeList.splice(a, 1)
+ }
}
}
}
},
checkChange (row, type, c) {
- if (type) {
- this.nodeList.push(row.id)
+ if (this.checkBox) {
} else {
- for (let a = 0; a < this.nodeList.length; a ++) {
- if (row.id === this.nodeList[a]) {
- this.nodeList.splice(a, 1)
+ if (type) {
+ this.nodeList.push(row.id)
+ } else {
+ for (let a = 0; a < this.nodeList.length; a ++) {
+ if (row.id === this.nodeList[a]) {
+ this.nodeList.splice(a, 1)
+ }
}
}
}
+
},
handleTreeDrawerCancel () {
this.filterText = ''
@@ -200,17 +207,27 @@
this.open1 = true
},
drawerCheck (data) {
- if (this.checkBox) {
+ if (this.checkBox) { // 单选
// 单选判断
- var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
- if(getlist.length == 1) {
- this.roleRow = getlist[0]
- } else {
- this.$refs.tree.setCheckedKeys([data.id]);
- this.roleRow = this.$refs.tree.getCheckedNodes()[0]
+ let getlist = this.$refs.tree.getCheckedNodes()
+ if (getlist.length > 1) {
+ this.$refs.tree.setCheckedKeys([])
+ this.$refs.tree.setCheckedKeys([data.id])
+ this.roleList = [data]
+ } else if (getlist.length === 0) {
+ this.roleList = [{}]
+ } else if (getlist.length === 1) {
+ this.roleList = [data]
}
- this.roleList = [this.roleRow]
- } else {
+ // var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
+ // if(getlist.length == 1) {
+ // this.roleRow = getlist[0]
+ // } else {
+ // this.$refs.tree.setCheckedKeys([data.id])
+ // this.roleRow = this.$refs.tree.getCheckedNodes()[0]
+ // }
+ // this.roleList = [this.roleRow]
+ } else { // 多选
this.roleList = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes())
}
},