Forráskód Böngészése

Merge branch 'test' of http://192.168.2.236:10080/zhouna/AIPlatform into test

zhangxc 5 éve
szülő
commit
32d904c01b
3 módosított fájl, 40 hozzáadás és 19 törlés
  1. 14 13
      src/css/roleManager.less
  2. 24 4
      src/js/roleManager.js
  3. 2 2
      webpack.config.js

+ 14 - 13
src/css/roleManager.less

@@ -10,23 +10,24 @@
         padding: 0 10px;
         height: 50px;
         line-height: 50px;
+        cursor: pointer;
         &:hover {
             background-color: #F0F5FF;
         }
     }
-    .editRole {
-        float: right;
-        width: 52px;
-        height: 30px;
-        line-height: 30px;
-        color: #5A8EEE;
-        border: 1px solid #5A8EEE;
-        border-radius: 4px;
-        text-align: center;
-        position: relative;
-        top: 10px;
-        cursor: pointer;
-    }
+    // .editRole {
+    //     float: right;
+    //     width: 52px;
+    //     height: 30px;
+    //     line-height: 30px;
+    //     color: #5A8EEE;
+    //     border: 1px solid #5A8EEE;
+    //     border-radius: 4px;
+    //     text-align: center;
+    //     position: relative;
+    //     top: 10px;
+    //     cursor: pointer;
+    // }
 }
 .rightMenu {
     position: absolute;

+ 24 - 4
src/js/roleManager.js

@@ -117,8 +117,8 @@ $(function(){
                             tmpPer[m].havePermission = haveMenu==0?'1':'0'
                         }
                     }
-                    
                 }else if(permissionId){//第三层
+                    let tmpNum = 0
                     for(let i = 0;i < tmpDataLis.length;i++){
                         let num = 0
                         let tmpPer = tmpDataLis[i].sysPermissionDTOList
@@ -135,20 +135,38 @@ $(function(){
                         }else{
                             tmpDataLis[i].haveMenu = '1'
                         }
+                        //二层否有选中,有则第一层选中,否则第一层不选中
+                        if(tmpDataLis[i].haveMenu == 0){
+                            ++tmpNum
+                        }
+                    }
+                    if(tmpNum == tmpDataLis.length){//二层都是取消状态,一层选中取消掉否则选中
+                        tmpData.haveMenu = 0
+                    }else{
+                        tmpData.haveMenu = 1
                     }
                 }else{//第二层,内层全选反选
+                    let tmpNum = 0
                     for(let i = 0;i < tmpDataLis.length;i++){
                         let tmpPer = tmpDataLis[i].sysPermissionDTOList
                         if(menuId&&menuId == tmpDataLis[i].menuId){//第二层,里面的全部选中或者全部取消
                             tmpSelectData = tmpDataLis[i]
-                            // console.log(tmpDataLis[i],788787878)
                             tmpDataLis[i].haveMenu = haveMenu==0?'1':'0'
                             for(let m = 0;m < tmpPer.length;m++){//所有相同id联动
                                 tmpPer[m].havePermission = haveMenu==0?'1':'0'
                             }
                         }
+                        //二层否有选中,有则第一层选中,否则第一层不选中
+                        if(tmpDataLis[i].haveMenu == 0){
+                            ++tmpNum
+                        }
+                    }
+                    if(tmpNum == tmpDataLis.length){//二层都是取消状态,一层选中取消掉否则选中
+                        tmpData.haveMenu = 0
+                    }else{
+                        tmpData.haveMenu = 1
                     }
-                    //麻烦,全选后遍历统计数据中有相同id的也要选中,三级自动选中后二级要判断是取消还是选中
+                    //全选后遍历统计数据中有相同id的也要选中,三级自动选中后二级要判断是取消还是选中
                     for(let i = 0;i < tmpDataLis.length;i++){//二级循环
                         let num = 0
                         if(menuId&&menuId != tmpDataLis[i].menuId){//第二层,没有点击,自动选中第三层相同id的
@@ -278,7 +296,7 @@ $(function(){
         let str = ''
         for(let i = 0;i < data.length;i++){
             str+=`
-                <li class="ellipsis">${data[i].name} <span class="editRole" data-id="${data[i].id}">编辑</span></li>
+                <li class="ellipsis editRole" style="background:${i == 0?'#F0F5FF':'#fff'}" data-id="${data[i].id}">${data[i].name}</li>
             `
         }
         $(".leftMenu ul").html(str)
@@ -289,6 +307,8 @@ $(function(){
             let id = $(this).attr("data-id")
             curId = id
             permissionIdLis=[],menuIdLis=[];
+            $(".rightMenu").scrollTop(0)
+            $(this).css({"background-color":"#F0F5FF"}).siblings().css("background-color","#fff")
             getRoleMenu(id)
         })
     }

+ 2 - 2
webpack.config.js

@@ -6,8 +6,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const CopyWebpackPlugin = require('copy-webpack-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
-const proxyHost = "http://192.168.2.236:5858";
-// const proxyHost = "http://192.168.2.241:5858";
+// const proxyHost = "http://192.168.2.236:5858";
+const proxyHost = "http://192.168.2.241:5858";
 // const proxyHost = "http://192.168.3.117:5858";//铁钢
 // const proxyHost = "http://192.168.3.113:5858";//王峰
 module.exports = {