From 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229 Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Mon, 12 Dec 2022 13:24:57 +0800
Subject: [PATCH] 1.浑南区走航车报告下载;2.菜单分配可以选择某个子菜单,但必须选择实时风场页面;3.空气质量报告模板更新;

---
 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