【Saas-export项目】14--(角色role授权module)页面显示、更新权限

本文介绍了SaaS-export项目中角色授权页面的显示逻辑和权限更新过程。通过RoleController打开授权页面并显示角色名称,role-module.jsp负责发送请求获取数据。在页面上使用ztree菜单,并在循环模块时根据角色权限设置checked属性。同时,文章还涉及了TestModuleService的单元测试,以及在ModuleService和ModuleDao中实现的角色权限保存操作。
摘要由CSDN通过智能技术生成



角色授权页面显示

在这里插入图片描述

RoleController

打开授权页面显示角色名称

@RequestMapping(path = "/toRoleModule",method = {
   RequestMethod.GET,RequestMethod.POST})
    public  String toRoleModule(String roleId){
   //接收页面提交的id
        //当前授权页面需要显示 角色名称
        l.info("toRoleModule roleId="+roleId);
        Role role=iRoleService.findById(roleId);

        //数据转发到页面
        request.setAttribute("role",role);
        return "system/role/role-module";
    }

role-module.jsp

页面发请求到后台获取数据

<head>
    <base href="${ctx}/">
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
    <%-- 第一步:拷贝如下引入的css/js文件到项目的ztree-test.html页面
       第二步:拷贝js导入到当前页面
       第三步:页面定义显示树的区域--%>
    <link rel="stylesheet" type="text/css" href="${path}/plugins/ztree/css/zTreeStyle/zTreeStyle.css">
    <script type="text/javascript" src="${path}/plugins/ztree/js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>

    <script type="text/javascript">


        //当前的配置信息
        var setting = {
   
            check: {
   
                enable: true
            },
            data: {
   
                simpleData: {
   
                    enable: true
                }
            }
        };
        //当前的数据
        /*var zNodes =[
            { id:1, pId:0, name:"Sass管理", open:true},
            { id:11, pId:1, name:"企业管理", open:true,checked:true},
            { id:111, pId:1, name:"模块管理"}
        ];*/

        $(document).ready(function(){
   
            var fn =function(data){
   
                //菜单的初始化
                $.fn.zTree.init($("#treeDemo"), setting, data);
                //参1 显示的标签
                //参2 设置的参数 比如支持复选 check enable = true
                //参3 数据
            }
            $.get('${path}/system/role/getZtreeData.do?roleId=${role.roleId}',fn,'json'
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值