完善基础代码(权限)
This commit is contained in:
parent
dfc1fd0025
commit
fdf4dd59b6
@ -0,0 +1,14 @@
|
||||
package ink.wgink.interfaces.permission;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: IPermissionCheckService
|
||||
* @Description: 权限检查
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/2/17 10:41 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface IPermissionCheckService {
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package ink.wgink.module.permission.controller.route;
|
||||
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: PermissionRouteController
|
||||
* @Description: 权限路由
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/2/17 10:45 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "权限路由接口")
|
||||
@Controller
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/permission")
|
||||
public class PermissionRouteController {
|
||||
|
||||
@GetMapping("save")
|
||||
public ModelAndView save() {
|
||||
return new ModelAndView("permission/save");
|
||||
}
|
||||
|
||||
@GetMapping("update")
|
||||
public ModelAndView update() {
|
||||
return new ModelAndView("permission/update");
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("permission/list");
|
||||
}
|
||||
|
||||
}
|
@ -20,6 +20,13 @@ import java.util.Map;
|
||||
@Repository
|
||||
public interface IPermissionDao {
|
||||
|
||||
/**
|
||||
* 建表
|
||||
*
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void createTable() throws UpdateException;
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
package ink.wgink.module.permission.service;
|
||||
|
||||
import ink.wgink.interfaces.permission.IPermissionCheckService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.permission.PermissionDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
@ -16,7 +17,7 @@ import java.util.Map;
|
||||
* @Date: 2020-05-27 15:58
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public interface IPermissionService {
|
||||
public interface IPermissionService extends IPermissionCheckService {
|
||||
|
||||
/**
|
||||
* 新增权限
|
||||
|
@ -0,0 +1,41 @@
|
||||
package ink.wgink.module.permission.startup;
|
||||
|
||||
import ink.wgink.module.permission.dao.IPermissionDao;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: ModulePermissionStartUp
|
||||
* @Description: 权限模块
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/2/17 10:34 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class ModulePermissionStartUp implements ApplicationRunner {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ModulePermissionStartUp.class);
|
||||
@Autowired
|
||||
private IPermissionDao permissionDao;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
initTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化表
|
||||
*/
|
||||
private void initTable() {
|
||||
LOG.debug("创建 sys_permission 表");
|
||||
permissionDao.createTable();
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.module.permission.dao.IPermissionDao">
|
||||
|
||||
<cache flushInterval="3600000"/>
|
||||
|
||||
<resultMap id="permissionDTO" type="ink.wgink.pojo.dtos.permission.PermissionDTO">
|
||||
<id column="permission_id" property="permissionId"/>
|
||||
<result column="permission_title" property="permissionTitle"/>
|
||||
@ -12,8 +14,27 @@
|
||||
<result column="is_public" property="isPublic"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `sys_permission` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
|
||||
`permission_id` char(36) NOT NULL COMMENT '主键',
|
||||
`permission_title` varchar(255) DEFAULT NULL COMMENT '权限标题',
|
||||
`permission_type` varchar(255) DEFAULT NULL COMMENT '权限类型',
|
||||
`permission_url` varchar(255) DEFAULT NULL COMMENT '权限路径',
|
||||
`permission_client_id` varchar(255) DEFAULT NULL COMMENT '客户端',
|
||||
`is_public` int(11) DEFAULT NULL COMMENT '是否公共',
|
||||
`creator` char(36) DEFAULT NULL,
|
||||
`gmt_create` datetime DEFAULT NULL,
|
||||
`modifier` char(36) DEFAULT NULL,
|
||||
`gmt_modified` datetime DEFAULT NULL,
|
||||
`is_delete` int(1) DEFAULT '0',
|
||||
PRIMARY KEY (`id`,`permission_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
</update>
|
||||
|
||||
<!-- 新增权限 -->
|
||||
<insert id="save" parameterType="map">
|
||||
<insert id="save" parameterType="map" flushCache="true">
|
||||
INSERT INTO sys_permission(
|
||||
permission_id,
|
||||
permission_title,
|
||||
@ -42,7 +63,7 @@
|
||||
</insert>
|
||||
|
||||
<!-- 删除权限 -->
|
||||
<update id="remove" parameterType="map">
|
||||
<update id="remove" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
sys_permission
|
||||
SET
|
||||
@ -57,7 +78,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 删除权限(物理) -->
|
||||
<update id="delete" parameterType="map">
|
||||
<update id="delete" parameterType="map" flushCache="true">
|
||||
DELETE FROM
|
||||
sys_permission
|
||||
WHERE
|
||||
@ -68,7 +89,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 修改权限 -->
|
||||
<update id="update" parameterType="map">
|
||||
<update id="update" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
sys_permission
|
||||
SET
|
||||
@ -94,7 +115,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 权限详情 -->
|
||||
<select id="get" parameterType="map" resultMap="permissionDTO">
|
||||
<select id="get" parameterType="map" resultMap="permissionDTO" useCache="false">
|
||||
SELECT
|
||||
t1.permission_title,
|
||||
t1.permission_type,
|
||||
@ -113,7 +134,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 权限列表 -->
|
||||
<select id="list" parameterType="map" resultMap="permissionDTO">
|
||||
<select id="list" parameterType="map" resultMap="permissionDTO" useCache="true">
|
||||
SELECT
|
||||
t1.permission_title,
|
||||
t1.permission_type,
|
||||
@ -171,7 +192,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 权限统计 -->
|
||||
<select id="count" parameterType="map" resultType="Integer">
|
||||
<select id="count" parameterType="map" resultType="Integer" useCache="true">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
|
@ -1,247 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/usercenter/">
|
||||
<meta charset="utf-8">
|
||||
<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="permissionType" name="permissionType">
|
||||
<option value="">选择权限</option>
|
||||
<option value="permissionInsert">新增权限</option>
|
||||
<option value="permissionDelete">删除权限</option>
|
||||
<option value="permissionUpdate">修改权限</option>
|
||||
<option value="permissionQuery">查询权限</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="isPublic" name="isPublic">
|
||||
<option value="">公开类型</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item" id="permissionClientIdSelectTemplateBox" lay-filter="permissionClientIdSelectTemplateBox"></div>
|
||||
<script id="permissionClientIdSelectTemplate" type="text/html">
|
||||
<select id="permissionClientId" name="permissionClientId">
|
||||
<option value="">客户端</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.clientId}}">{{item.clientName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var roleId = top.restAjax.params(window.location.href).roleId;
|
||||
var tableUrl = 'api/permission/listpagepermissionwithroleid/'+ roleId;
|
||||
|
||||
// 初始化客户端下拉选择
|
||||
function initPermissionClientIdSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/oauthclient/listoauthclient', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('permissionClientIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('permissionClientIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'permissionClientIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initPermissionClientIdSelect();
|
||||
|
||||
// 初始化表格
|
||||
var tableData;
|
||||
function initTable() {
|
||||
$.extend(table, {config: {checkName: 'checked'}});
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 60,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'permissionUrl', width: 300, title: '权限路径', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'permissionTitle', width:200, title: '权限名称', align:'center'},
|
||||
{field: 'permissionType', width: 100, title: '权限类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 'permissionInsert') {
|
||||
return '新增权限';
|
||||
} else if(rowData == 'permissionDelete') {
|
||||
return '删除权限';
|
||||
} else if(rowData == 'permissionUpdate') {
|
||||
return '更新权限';
|
||||
} else if(rowData == 'permissionQuery') {
|
||||
return '查询权限';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'permissionClientName', width: 180, title: '客户端名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isPublic', width: 100, title: '公共接口', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0') {
|
||||
return '否';
|
||||
} else if(rowData == '1') {
|
||||
return '是';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
for(var i = 0, item; item = data.rows[i++];) {
|
||||
if(item.roleId) {
|
||||
item.checked = true;
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
}
|
||||
tableData = data.rows;
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateCheckStatus(checked, dataArray) {
|
||||
var permissionIdArray = [];
|
||||
for(var i = 0, item; item = dataArray[i++];) {
|
||||
permissionIdArray.push(item.permissionId);
|
||||
}
|
||||
top.restAjax.put(top.restAjax.path('api/permission/updatepermissionbyroleId/{roleId}', [roleId]), {
|
||||
checked: checked,
|
||||
permissionIdArray: permissionIdArray
|
||||
}, null, function(code, data) {
|
||||
top.dialog.msg('修改成功');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
table.on('checkbox(dataTable)', function(obj) {
|
||||
if(obj.type === 'all') {
|
||||
updateCheckStatus(obj.checked, tableData);
|
||||
} else {
|
||||
var dataArray = [];
|
||||
dataArray.push(obj.data);
|
||||
updateCheckStatus(obj.checked, dataArray);
|
||||
}
|
||||
});
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
permissionType: $('#permissionType').val(),
|
||||
isPublic: $('#isPublic').val(),
|
||||
permissionClientId: $('#permissionClientId').val(),
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 60,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base href="/usercenter/">
|
||||
<base th:href="${#request.getContextPath() + '/'} ">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
@ -60,7 +60,7 @@
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var permissionType = top.restAjax.params(window.location.href).permissionType;
|
||||
var tableUrl = 'api/permission/listpagepermission?permissionType='+ permissionType;
|
||||
var tableUrl = 'api/permission/listpage?permissionType='+ permissionType;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
@ -179,7 +179,7 @@
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/permission/removepermission/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.restAjax.delete(top.restAjax.path('api/permission/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
@ -218,7 +218,7 @@
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/permission/save-permission.html?permissionType={permissionType}', [permissionType]),
|
||||
content: top.restAjax.path('route/permission/save?permissionType={permissionType}', [permissionType]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
@ -236,7 +236,7 @@
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/permission/update-permission.html?permissionId={permissionId}', [checkDatas[0].permissionId]),
|
||||
content: top.restAjax.path('route/permission/update?permissionId={permissionId}', [checkDatas[0].permissionId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base href="/usercenter/">
|
||||
<base th:href="${#request.getContextPath() + '/'} ">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
initPermissionClientIdSelect();
|
||||
// initPermissionClientIdSelect();
|
||||
}
|
||||
initData();
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/permission/savepermission', []), formData.field, null, function(code, data) {
|
||||
top.restAjax.post(top.restAjax.path('api/permission/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base href="/usercenter/">
|
||||
<base th:href="${#request.getContextPath() + '/'} ">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
@ -121,7 +121,7 @@
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/permission/getpermissionbyid/{permissionId}', [permissionId]), {}, null, function(code, data) {
|
||||
top.restAjax.get(top.restAjax.path('api/permission/get/{permissionId}', [permissionId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
@ -129,7 +129,7 @@
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
|
||||
initPermissionClientIdSelect(data['permissionClientId']);
|
||||
// initPermissionClientIdSelect(data['permissionClientId']);
|
||||
initPermissionType();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
@ -146,7 +146,7 @@
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/permission/updatepermission/{permissionId}', [permissionId]), formData.field, null, function(code, data) {
|
||||
top.restAjax.put(top.restAjax.path('api/permission/update/{permissionId}', [permissionId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
|
@ -4,6 +4,7 @@ import ink.wgink.interfaces.department.IDepartmentCheckService;
|
||||
import ink.wgink.interfaces.dictionary.IDictionaryCheckService;
|
||||
import ink.wgink.interfaces.group.IGroupCheckService;
|
||||
import ink.wgink.interfaces.menu.IMenuBaseService;
|
||||
import ink.wgink.interfaces.permission.IPermissionCheckService;
|
||||
import ink.wgink.interfaces.position.IPositionCheckService;
|
||||
import ink.wgink.interfaces.user.IUserCheckService;
|
||||
import ink.wgink.pojo.dtos.menu.MenuDTO;
|
||||
@ -45,6 +46,8 @@ public class ServiceMenuStartUp implements ApplicationRunner {
|
||||
private IGroupCheckService groupCheckService;
|
||||
@Autowired(required = false)
|
||||
private IPositionCheckService positionCheckService;
|
||||
@Autowired(required = false)
|
||||
private IPermissionCheckService permissionCheckService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
@ -345,8 +348,8 @@ public class ServiceMenuStartUp implements ApplicationRunner {
|
||||
if (menuDTO == null) {
|
||||
params.put("menuId", menuId);
|
||||
params.put("menuParentId", menuParentId);
|
||||
params.put("menuName", "用户组管理");
|
||||
params.put("menuSummary", "用户组管理");
|
||||
params.put("menuName", "职位管理");
|
||||
params.put("menuSummary", "职位管理");
|
||||
params.put("menuUrl", "/route/position/list-tree");
|
||||
params.put("menuType", "1");
|
||||
params.put("menuIcon", "fa-icon-color-white fa fa-users");
|
||||
@ -357,12 +360,16 @@ public class ServiceMenuStartUp implements ApplicationRunner {
|
||||
}
|
||||
}
|
||||
|
||||
private void initMenuPermission() {
|
||||
private void initPermissionManager(Map<String, Object> params, String menuParentId) {
|
||||
if(permissionCheckService == null) {
|
||||
return;
|
||||
}
|
||||
LOG.debug("初始化菜单:权限管理");
|
||||
LOG.debug("初始化菜单:角色管理");
|
||||
|
||||
}
|
||||
|
||||
private void initMenuRole() {
|
||||
LOG.debug("初始化菜单:角色管理");
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,7 @@
|
||||
top.dialog.dialogData.selectedUserIds = $('#selectedUserIds').val();
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/department/user/select-user', []),
|
||||
title: '选择组织部门人员',
|
||||
title: '选择用户',
|
||||
width: '500px',
|
||||
height: '500px',
|
||||
onClose: function() {
|
||||
@ -223,7 +223,7 @@
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/group/user/update/{groupId}', [positionId]), {
|
||||
top.restAjax.put(top.restAjax.path('api/position/user/update/{positionId}', [positionId]), {
|
||||
ids: ids
|
||||
}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.updated);
|
||||
|
Loading…
Reference in New Issue
Block a user