提交 169282e9 编写于 作者: doc_wei's avatar doc_wei

角色管理整改为低代码

上级 f52e8c11
...@@ -18,11 +18,11 @@ layui.config({ ...@@ -18,11 +18,11 @@ layui.config({
form.on('submit(formAddBean)', function (data) { form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
roleName: $("#roleName").val(), name: $("#name").val(),
roleDesc: $("#roleDesc").val() remark: $("#remark").val()
}; };
AjaxPostUtil.request({url: reqBasePath + "sys015", params: params, type: 'json', method: "POST", callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "writeSysRole", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index); parent.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
}}); }});
......
...@@ -60,10 +60,10 @@ layui.config({ ...@@ -60,10 +60,10 @@ layui.config({
/********* tree 处理 start *************/ /********* tree 处理 start *************/
var tree; var tree;
AjaxPostUtil.request({url: reqBasePath + "sys038", params: {rowId: parent.rowId}, type: 'json', callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
$("#roleName").text(json.bean.roleName); $("#name").text(json.bean.name);
$("#roleDesc").text(json.bean.roleDesc); $("#remark").text(json.bean.remark);
checkeRows = json.rows; checkeRows = json.bean.appMenuIds;
tree = fsTree.render({ tree = fsTree.render({
id: "treeDemo", id: "treeDemo",
...@@ -80,7 +80,7 @@ layui.config({ ...@@ -80,7 +80,7 @@ layui.config({
var zTree = zTreeObj.getCheckedNodes(false); var zTree = zTreeObj.getCheckedNodes(false);
for (var i = 0; i < zTree.length; i++) { for (var i = 0; i < zTree.length; i++) {
for(var j = 0; j < checkeRows.length; j++){ for(var j = 0; j < checkeRows.length; j++){
if(zTree[i].id == checkeRows[j].menuId){ if(zTree[i].id == checkeRows[j]){
zTreeObj.checkNode(zTree[i], true); zTreeObj.checkNode(zTree[i], true);
} }
} }
......
...@@ -11,9 +11,9 @@ layui.config({ ...@@ -11,9 +11,9 @@ layui.config({
form = layui.form, form = layui.form,
textool = layui.textool; textool = layui.textool;
AjaxPostUtil.request({url: reqBasePath + "sys016", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
$("#roleName").val(json.bean.roleName); $("#name").val(json.bean.name);
$("#roleDesc").val(json.bean.roleDesc); $("#remark").val(json.bean.remark);
textool.init({eleId: 'roleDesc', maxlength: 250}); textool.init({eleId: 'roleDesc', maxlength: 250});
}}); }});
...@@ -22,12 +22,12 @@ layui.config({ ...@@ -22,12 +22,12 @@ layui.config({
form.on('submit(formEditBean)', function (data) { form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
roleName: $("#roleName").val(), name: $("#name").val(),
roleDesc: $("#roleDesc").val(), remark: $("#remark").val(),
rowId: parent.rowId id: parent.rowId
}; };
AjaxPostUtil.request({url: reqBasePath + "sys017", params: params, type: 'json', method: "PUT", callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "writeSysRole", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index); parent.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
}}); }});
......
...@@ -25,11 +25,12 @@ layui.config({ ...@@ -25,11 +25,12 @@ layui.config({
limit: getLimit(), limit: getLimit(),
cols: [[ cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'roleName', title: '角色名称', width: 120 }, { field: 'name', title: '角色名称', width: 120 },
{ field: 'roleDesc', title: '角色描述', width: 520 }, { field: 'remark', title: '角色描述', width: 520 },
{ field: 'userNum', title: '使用用户数量', width: 150 }, { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'parentName', title: '父角色', width: 150 }, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar' } { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar' }
]], ]],
done: function(json) { done: function(json) {
...@@ -58,7 +59,7 @@ layui.config({ ...@@ -58,7 +59,7 @@ layui.config({
function del(data, obj) { function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], { icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType] }, function (index) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], { icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType] }, function (index) {
layer.close(index); layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "sys018", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "deleteRoleById", params: {id: data.id}, type: 'json', method: "DELETE", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable(); loadTable();
}}); }});
...@@ -87,7 +88,9 @@ layui.config({ ...@@ -87,7 +88,9 @@ layui.config({
title: "手机端菜单授权", title: "手机端菜单授权",
pageId: "sysEveRoleAppMenu", pageId: "sysEveRoleAppMenu",
area: ['90vw', '90vh'], area: ['90vw', '90vh'],
callBack: function (refreshCode) {}}); callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
}});
} }
// PC端菜单授权 // PC端菜单授权
...@@ -98,7 +101,9 @@ layui.config({ ...@@ -98,7 +101,9 @@ layui.config({
title: "PC端菜单授权", title: "PC端菜单授权",
pageId: "sysEveRolePCMenu", pageId: "sysEveRolePCMenu",
area: ['90vw', '90vh'], area: ['90vw', '90vh'],
callBack: function (refreshCode) {}}); callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
}});
} }
// 新增角色 // 新增角色
...@@ -115,7 +120,6 @@ layui.config({ ...@@ -115,7 +120,6 @@ layui.config({
}); });
form.render(); form.render();
// 刷新数据
$("body").on("click", "#reloadTable", function() { $("body").on("click", "#reloadTable", function() {
loadTable(); loadTable();
}); });
......
...@@ -25,8 +25,8 @@ layui.config({ ...@@ -25,8 +25,8 @@ layui.config({
menuIds.push(nodes[i].id); menuIds.push(nodes[i].id);
} }
var params = { var params = {
roleName: $("#roleName").html(), name: $("#name").html(),
roleDesc: $("#roleDesc").html(), remark: $("#remark").html(),
menuIds: JSON.stringify(menuIds), menuIds: JSON.stringify(menuIds),
rowId: parent.rowId rowId: parent.rowId
}; };
...@@ -42,10 +42,10 @@ layui.config({ ...@@ -42,10 +42,10 @@ layui.config({
/********* tree 处理 start *************/ /********* tree 处理 start *************/
var tree; var tree;
AjaxPostUtil.request({url: reqBasePath + "sys016", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) { AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
$("#roleName").text(json.bean.roleName); $("#name").text(json.bean.name);
$("#roleDesc").text(json.bean.roleDesc); $("#remark").text(json.bean.remark);
checkeRows = json.rows; checkeRows = json.bean.menuIds;
tree = fsTree.render({ tree = fsTree.render({
id: "treeDemo", id: "treeDemo",
...@@ -61,8 +61,8 @@ layui.config({ ...@@ -61,8 +61,8 @@ layui.config({
var zTreeObj = $.fn.zTree.getZTreeObj(id); var zTreeObj = $.fn.zTree.getZTreeObj(id);
var zTree = zTreeObj.getCheckedNodes(false); var zTree = zTreeObj.getCheckedNodes(false);
for (var i = 0; i < zTree.length; i++) { for (var i = 0; i < zTree.length; i++) {
for(var j = 0; j < checkeRows.length; j++){ for (var j = 0; j < checkeRows.length; j++) {
if(zTree[i].id == checkeRows[j].menuId){ if (zTree[i].id == checkeRows[j]) {
zTreeObj.checkNode(zTree[i], true); zTreeObj.checkNode(zTree[i], true);
} }
} }
......
...@@ -9,19 +9,19 @@ ...@@ -9,19 +9,19 @@
<body> <body>
<div style="margin:0 auto;padding:20px;"> <div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off"> <form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">角色名称<i class="red">*</i></label> <label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="roleName" name="roleName" win-verify="required" placeholder="请输入角色名称" class="layui-input" /> <input type="text" id="name" name="name" win-verify="required" placeholder="请输入名称" class="layui-input" />
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">角色描述</label> <label class="layui-form-label">描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="roleDesc" name="roleDesc" class="layui-textarea" style="height: 100px;"></textarea> <textarea id="remark" name="remark" class="layui-textarea" style="height: 100px;"></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<div class="layui-input-block"> <div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button> <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button> <button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">角色名称:</label> <label class="layui-form-label">角色名称:</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
<span id="roleName"></span> <span id="name"></span>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">角色描述:</label> <label class="layui-form-label">角色描述:</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
<span id="roleDesc"></span> <span id="remark"></span>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
......
...@@ -9,19 +9,19 @@ ...@@ -9,19 +9,19 @@
<body> <body>
<div style="margin:0 auto;padding:20px;"> <div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off"> <form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">角色名称<i class="red">*</i></label> <label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="roleName" name="roleName" win-verify="required" placeholder="请输入角色名称" class="layui-input" /> <input type="text" id="name" name="name" win-verify="required" placeholder="请输入名称" class="layui-input" />
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">角色描述</label> <label class="layui-form-label">描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="roleDesc" name="roleDesc" class="layui-textarea" style="height: 100px;"></textarea> <textarea id="remark" name="remark" class="layui-textarea" style="height: 100px;"></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item layui-col-xs12">
<div class="layui-input-block"> <div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button> <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button> <button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
<div style="margin:auto 10px;"> <div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar"> <script type="text/html" id="tableBar">
{{# if(auth('1552900944072')) { }} {{# if(auth('1552954959607')) { }}
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }} {{# } }}
{{# if(d.userNum == 0 && auth('1552877034665')) { }} {{# if(auth('1552877034665')) { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><language showName="com.skyeye.deleteBtn"></language></a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }} {{# } }}
{{# if(auth('1644726632357')) { }} {{# if(auth('1644726632357')) { }}
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">角色名称:</label> <label class="layui-form-label">角色名称:</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
<span id="roleName"></span> <span id="name"></span>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">角色描述:</label> <label class="layui-form-label">角色描述:</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
<span id="roleDesc"></span> <span id="remark"></span>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
......
...@@ -284,11 +284,11 @@ function auth(urlNum) { ...@@ -284,11 +284,11 @@ function auth(urlNum) {
return true; return true;
} else { } else {
// 数据权限分组不为空 // 数据权限分组不为空
if (authList[i].children.length > 0) { if (!isNull(authList[i].children) && authList[i].children.length > 0) {
var dataGroup = authList[i].children; var dataGroup = authList[i].children;
for (var j = 0; j < dataGroup.length; j++) { for (var j = 0; j < dataGroup.length; j++) {
// 数据权限不为空 // 数据权限不为空
if (dataGroup[j].children.length > 0) { if (!isNull(dataGroup[j].children) && dataGroup[j].children.length > 0) {
var dataAuthPoint = dataGroup[j].children; var dataAuthPoint = dataGroup[j].children;
for (var k = 0; k < dataAuthPoint.length; k++) { for (var k = 0; k < dataAuthPoint.length; k++) {
if (dataAuthPoint[k].menuNum === urlNum) { if (dataAuthPoint[k].menuNum === urlNum) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册