From c1ddb070b337194b4eb656ea52ff27984d57adf6 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期五, 21 六月 2024 16:11:26 +0800 Subject: [PATCH] 添加权限查询页面 --- WebTM/views/系统管理/用户管理/Xt_UserRightQuery.html | 356 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebTM/WebTM.csproj | 1 2 files changed, 357 insertions(+), 0 deletions(-) diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj index 6c2f102..e2e33db 100644 --- a/WebTM/WebTM.csproj +++ b/WebTM/WebTM.csproj @@ -369,6 +369,7 @@ <Content Include="views\鐢熶骇绠$悊\鎶ュ伐鍙板伐搴廫寮�宸Sc_SwipeCardStart.html" /> <Content Include="views\鐢熶骇绠$悊\鐢熶骇璁″垝骞冲彴\JIT_DayPlanPlatForm_BCP.html" /> <Content Include="views\绯荤粺绠$悊\浼氳鏈熼棿\Xt_AccountPeriodAdd.html" /> + <Content Include="views\绯荤粺绠$悊\鐢ㄦ埛绠$悊\Xt_UserRightQuery.html" /> <Content Include="views\璁惧绠$悊\璁惧鍋滄満鍗昞Sb_EquipStopBillList_PDA.html" /> <Content Include="views\璁惧绠$悊\璁惧鍋滄満鍗昞Sb_EquipStopBill_PDA.html" /> <Content Include="views\璁惧绠$悊\璁惧寮�鏈哄崟\Sb_EquipBeginBillList_PDA.html" /> diff --git "a/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserRightQuery.html" "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserRightQuery.html" new file mode 100644 index 0000000..ad3b614 --- /dev/null +++ "b/WebTM/views/\347\263\273\347\273\237\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206/Xt_UserRightQuery.html" @@ -0,0 +1,356 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>鏉冮檺鏌ヨ</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> + <script src="../../layuiadmin/layui/layui.js"></script> + <script src="../../layuiadmin/treeTable.js"></script> + <script src="../../layuiadmin/Scripts/json2.js"></script> + <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script> + <script src="../../layuiadmin/Scripts/webConfig.js"></script> + <script src="../../layuiadmin/layui/lay/modules/util.js"></script> + <style media="screen"> + .custom-tree-item-clicked { + color: #FC9003 + } + .layui-form-item .layui-inline { + margin-bottom: 5px; + margin-right: 0px; + } + </style> +</head> +<body> + <div class="layui-fluid"> + <div class="layui-col-md12"> + <div class="layui-card" style="padding: 1px"> + <div class="layui-card-body" style="padding: 1px;"> + <form class="layui-form" action="" lay-filter="component-form-group"> + <div class="layui-card-header"> + <div class="layui-btn-group"> + + <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">鎺堟潈</button> + <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button> + + </div> + + </div> + <div class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-form-item" style="border-top: solid 1px #F6F6F6;"> + <div class="layui-row" style="padding:10px 0"> + <div class="layui-col-xs3 layui-inline"> + <div id="treeUser" lay-filter="treeUser" class="demo-tree demo-tree-box" style="height:650px;overflow: scroll;"></div> + </div> + <div class="layui-col-xs9 layui-inline"> + <div> + <table class="" id="mainTable" lay-filter="mainTable"></table> + </div> + </div> + </div> + </div> + </div> + </div> + </form> + </div> + </div> + </div> + </div> + + <script src="../../layuiadmin/layui/zgqlayui.js"></script> + <script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script> + <script src="../../layuiadmin/PubCustom.js"></script> + <script> + //鑾峰彇鍙傛暟 + var params = get_UrlVars(); + if (typeof (params[params[0]]) == "undefined") { + var OperationType = 1;//鎿嶄綔绫诲瀷 + var TreeFlag = true;//鎿嶄綔绫诲瀷 + } else { + debugger; + var OperationType = params[params[0]];//鎿嶄綔绫诲瀷 + var linterid = params[params[1]];//婧愬崟id + var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷 + } + + var treeCkData = { id: 0 }; + var TagId = ""; + var TagParentId = ""; + + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laypage = layui.laypage + , laydate = layui.laydate + , util = layui.util + , tree = layui.tree + var sGnbm = ""; + if (TreeFlag == "false") { + //$(".layui-col-xs3").css("display", "none"); //闅愯棌鏍戝瀷 + //$(".layui-col-xs9").css("width", "100%"); //璁剧疆瀹藉害 + } + else { + tree.render({ + elem: '#treeUser', + data: getData(), + showCheckbox: false, //鏄惁鏄剧ず澶嶉�夋 + id: 'demoId', + isJump: false, //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆 + showLine: true,//鏄惁寮�鍚繛鎺ョ嚎 + onlyIconControl: true, //鐐瑰嚮鍚庝笉鏀剁缉 + isopen: false, //鍔犺浇瀹屾瘯鍚庣殑灞曞紑鐘舵�侊紝榛樿鍊硷細true + accordion: false, + click: function (obj) { + //鐐瑰嚮楂樺厜 + if (obj.data.id !== treeCkData.id) { + $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked"); + $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); + treeCkData = obj.data; + TagId = obj.data.id; + TagParentId = obj.data.ParentID; + } + //else { + // $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked'); + // treeCkData = { id: 0 }; + // TagId = ""; + // TagParentId = ""; + //} + sGnbm = obj.data.id; + get_Display(sGnbm); + } + }); + } + + + + var option = { + id: 'mainTable' + ,elem: '#mainTable' + //, toolbar: '#toolbarDemo' + , height: '650' + , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず + , page: false + , cellMinWidth: 90 + , cols: [[ + { type: 'checkbox', fixed: 'left', width: 60 } + , { field: 'hid', title: 'hid', sort: true, hide: true } + , { field: 'gnbm', title: 'gnbm', sort: true, hide: true } + , { field: 'AuthorityHID', title: 'AuthorityHID', edit: 'text', sort: true, hide: true } + , { + field: 'AuthorityID', title: '鏄惁鏉冮檺', templet: function (row) { + if (row.AuthorityID == 1) { + return "<span style='color:green;'>鏄�</span>"; + } + else { + return "鍚�"; + } + } + } + //, { + // field: 'AuthorityHID', title: '鏄惁鏉冮檺', templet: function (row) { + // var html = "<input type='checkbox' lay-skin='primary' lay-filter='checkboxIsSelected' table-index='" + row.LAY_TABLE_INDEX + "' class='checkboxIsSelected' value='" + row.AuthorityHID + "' "; + // if (row.AuthorityID == 1) { + // html += " checked "; + // } + // html += ">"; + // return html; + // }} + , { field: 'gnms', title: '鍔熻兘璇存槑' } + ]], done: function (res, page, count) { + + //鍙互鑷娣诲姞鍒ゆ柇鐨勬潯浠舵槸鍚﹂�変腑 + //杩欏彞鎵嶆槸鐪熸閫変腑锛岄�氳繃璁剧疆鍏抽敭瀛桳AY_CHECKED涓簍rue閫変腑锛岃繖閲屽彧瀵圭涓�琛岄�変腑 + for (var i = 0; i < res.data.length; i++) { + if (res.data[i].AuthorityID == 1) { + res.data[i]["LAY_CHECKED"] = 'true'; + //涓嬮潰涓夊彞鏄�氳繃鏇存敼css鏉ュ疄鐜伴�変腑鐨勬晥鏋� + var index = res.data[i]['LAY_TABLE_INDEX']; + $('tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true); + $('tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked'); + } + } + + } + }; + + var index = layer.load(0, { shade: false }); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + get_Display(sGnbm); + + + //閫�鍑� + form.on('submit(Exit)', function (data) { + if (OperationType == 1) { + //鍏抽棴椤电 + Pub_Close(2); + } + else { + //鍏抽棴椤电 + Pub_Close(1); + } + }); + + //鐩戝惉閫変腑鏁版嵁 + table.on('checkbox(mainTable)', function (obj) { + //console.log(obj.checked); //褰撳墠鏄惁閫変腑鐘舵�� + //console.log(obj.data); //閫変腑琛岀殑鐩稿叧鏁版嵁 + //console.log(obj.type); //濡傛灉瑙﹀彂鐨勬槸鍏ㄩ�夛紝鍒欎负锛歛ll锛屽鏋滆Е鍙戠殑鏄崟閫夛紝鍒欎负锛歰ne + if (obj.type == 'one') { + if (obj.checked) { + //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊� + obj.update({ + AuthorityHID: 1, + }); + } + else { + //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊� + obj.update({ + AuthorityHID: 0, + }); + } + } + else { + if (obj.checked) { + //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊� + var tableBak = table.cache["mainTable"]; //鑾峰彇琛ㄦ牸鏁版嵁 + buttonArr = [];//娓呯┖鏁扮粍 + for (var i = 0; i < tableBak.length; i++) { + tableBak[i].AuthorityHID = 1; + buttonArr.push(tableBak[i]); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍 + } + //table.reload("mainTable", { + // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍� + //}) + } + else { + //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊� + var tableBak = table.cache["mainTable"]; //鑾峰彇琛ㄦ牸鏁版嵁 + buttonArr = [];//娓呯┖鏁扮粍 + for (var i = 0; i < tableBak.length; i++) { + tableBak[i].AuthorityHID = 0; + buttonArr.push(tableBak[i]); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍 + } + //table.reload("mainTable", { + // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍� + //}) + + + } + } + + }); + + //淇濆瓨 + form.on('submit(Saver)', function (data) { + if (TagId == "" || TagId == null) { + layer.alert("宸︿晶鐐瑰嚮鏍戝瀷鏁版嵁宸插け鏁�!", { icon: 5 }); + return false; + } + var sSubStr = JSON.stringify(table.cache['mainTable']); + var sMainSub = TagId + ';' + sSubStr + ';' + linterid + ";" + HSouceBillType; + //console.log(sMainSub); + //return false; + $.ajax( + { + type: "POST", + url: GetWEBURL() + "/Gy_MaintenanceMode/SaverPower", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚� + async: true, + data: { "msg": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () { + //$('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); + get_Display(sGnbm); + }); + } + else { + layer.alert(data.Message); + } + layer.closeAll("loading"); + }, + error: function (err) { + layer.alert("閿欒:" + err); + } + }); + + + + }); + + //鍔犺浇鏁版嵁琛ㄦ牸 + function get_Display(sGnbm) { + $.ajax({ + url: GetWEBURL() + '/PublicPageMethod/PowerList', + type: "GET", + data: { "czybm": linterid, "sGnbm": sGnbm, "HSouceBillType": HSouceBillType}, + success: function (data1) { + if (data1.count == 1) { + option.data = data1.data; + table.render(option); + layer.close(index); + } + }, error: function () { + layer.close(index); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + + //浠ヤ笂鏄痩ayui妯″潡 + }); + + //鏌ヨ鏍戠姸鏁版嵁 + function getData() { + var treeData; + + $.ajax({ + url: GetWEBURL() + '/Gy_MaintenanceMode/PowerLoadTree', + type: "GET", + //data: { "sWhere": sWhere }, + async: false, + success: function (result) { + var data = result.data; + //鐢熸垚鏁版嵁瀵硅薄闆嗗悎 + treeData = LoadTree(data); + + } + }); + return treeData; + } + /**澶勭悊鏍戝舰灞曠ず鏁版嵁锛岃姹傛湁ID鍜孭arentID銆乼itle瀛楁**/ + function LoadTree(data) { + let map = {}; + let treeData = []; + data.forEach(it => { + map[it.id.toUpperCase()] = it; //ID涓烘瘡涓妭鐐圭殑id + }) + //鐢熸垚缁撴灉闆� + data.forEach(it => { + const parent = map[it.ParentID.toUpperCase()]; //ParentID涓虹埗鑺傜偣鐨刬d + if (parent) { + if (!Array.isArray(parent.children)) parent.children = []; + parent.children.push(it); + } else { + treeData.push(it) + } + }) + return treeData; + } + + </script> + +</body> +</html> -- Gitblit v1.9.1