From 936633659148e800a8d09322a9f1e646104010a7 Mon Sep 17 00:00:00 2001 From: yichenxi <yichenxi0601@163.com> Date: Mon, 12 Dec 2022 14:14:57 +0800 Subject: [PATCH] 1、尘负荷走航路段报告 --- src/views/personnel/role.vue | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/views/personnel/role.vue b/src/views/personnel/role.vue index 65fe391..9aef9fc 100644 --- a/src/views/personnel/role.vue +++ b/src/views/personnel/role.vue @@ -151,7 +151,8 @@ children: 'children', label: 'label' }, - visibleDel: false + visibleDel: false, + parentIds: [] } }, // ������������ ���������data������ @@ -269,6 +270,12 @@ // console.log('������������������������������') // console.log(res) this.menuData = res.data.menus + // ������������������id + this.parentIds = [] + res.data.menus.map(v => { + this.parentIds.push(v.id) + }) + this.parentIds = JSON.parse(JSON.stringify(this.parentIds)) }).catch(err => { console.log(err) }) @@ -287,8 +294,16 @@ }).then(res => { // console.log('���������������������������') // console.log(res) - this.checkedData = res.data - console.log(this.checkedData) + var allIds = res.data + // ���������id + for (let i = 0; i < allIds.length; i++) { + for (let j = 0; j < this.parentIds.length; j++) { + if (allIds[i] === this.parentIds[j]) { + allIds.splice(i, 1) + } + } + } + this.checkedData = allIds }).catch(err => { console.log(err) }) @@ -300,10 +315,10 @@ method: 'post', data: { groupId: this.currentGroupId, - menuIds:this.$refs.tree.getCheckedKeys() + menuIds: this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys()) + // menuIds: this.$refs.tree.getCheckedKeys() } }).then(res => { - console.log(res) if (res.code === 0) { this.$message({ message: '������������', -- Gitblit v1.8.0