123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <?php /*a:2:{s:56:"D:\phpstudy_pro\WWW\caiping\app\admin\view\role\add.html";i:1723541257;s:59:"D:\phpstudy_pro\WWW\caiping\app\admin\view\common\base.html";i:1723541257;}*/ ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
- <script src="/static/dist/xm-select.js"></script>
- <link rel="mobile-prefetch" href=""/>
- <title><?php echo get_system_config('web','admin_title'); ?></title>
- <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
- <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
- <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
- <style>
- .footer{
- display: none;
- }
-
- .left-note{vertical-align:top; padding-top:20px!important; text-align:center}
- .checkbox14 .layui-form-checkbox span{font-size:15px;font-weight:800;}
- .right-note .layui-checkbox-disabled span {color: #666666!important;}
- </style>
- </head>
- <body class="main-body">
- <!-- 主体 -->
-
- <form class="layui-form p-4">
- <h3 class="pb-3">权限角色</h3>
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray">角色名称<font>*</font>
- </td>
- <td>
- <input type="hidden" name="id" value="<?php echo htmlentities($id); ?>" />
- <input class="layui-input" type="text" name="title" lay-verify="required" lay-reqText="请输入角色名称" <?php if(!(empty($role['title']) || (($role['title'] instanceof \think\Collection || $role['title'] instanceof \think\Paginator ) && $role['title']->isEmpty()))): ?>value="<?php echo htmlentities($role['title']); ?>" <?php endif; ?> placeholder="请输入角色名称" autocomplete="off" />
- </td>
- <td class="layui-td-gray">状态<font>*</font>
- </td>
- <td>
- <?php if($id == 0): ?>
- <input type="radio" name="status" value="1" title="正常" checked>
- <input type="radio" name="status" value="-1" title="禁用">
- <?php else: ?>
- <input type="radio" name="status" value="1" title="正常" <?php if($role['status'] == '1'): ?>checked<?php endif; ?>>
- <input type="radio" name="status" value="-1" title="禁用" <?php if($role['status'] == '-1'): ?>checked<?php endif; ?>>
- <?php endif; ?>
- </td>
- </tr>
- <?php if($permission == 1): ?>
- <tr>
- <td class="layui-td-gray">权限组类型<font>*</font></td>
- <?php if($id == 0): ?>
- <td>
- <select name="unit_name" lay-verify="required" lay-reqText="请选择权限组单位">
- <option value="">请选择权限组单位</option>
- <?php if(is_array($department) || $department instanceof \think\Collection || $department instanceof \think\Paginator): $i = 0; $__LIST__ = $department;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
- <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['title']); ?></option>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </select>
- </td>
- <?php else: ?>
- <td>
- <select name="unit_name" lay-verify="required" lay-reqText="请选择权限组单位">
- <option value="">请选择权限组单位</option>
- <?php if($role['unit_name'] >= 1): if(is_array($department) || $department instanceof \think\Collection || $department instanceof \think\Paginator): $i = 0; $__LIST__ = $department;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
- <option value="<?php echo htmlentities($v['id']); ?>" <?php if($v['id'] == $role['unit_name']): ?>selected<?php endif; ?>><?php echo htmlentities($v['title']); ?></option>
- <?php endforeach; endif; else: echo "" ;endif; else: if(is_array($department) || $department instanceof \think\Collection || $department instanceof \think\Paginator): $i = 0; $__LIST__ = $department;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
- <option value="<?php echo htmlentities($v['id']); ?>"><?php echo htmlentities($v['title']); ?></option>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- <?php endif; ?>
- </select>
- </td>
- <?php endif; ?>
- </tr>
- <?php endif; ?>
- <tr>
- <td class="layui-td-gray-2">权限配置说明<font>*</font></td>
- <td colspan="3"><strong class="red">注意:如果右侧子级权限有节点被勾选了,左侧的顶级权限就必须勾选,否则无法查看右侧的子级菜单。</strong></td>
- </tr>
- <tr>
- <td colspan="4">
- <table style="width:100%" id="rule">
- <tr>
- <td style="text-align:center; background-color:#f8f8f8; width:160px;">选择可操作的顶级权限 <font style="color:red">↓</font></td>
- <td style="text-align:left; background-color:#f8f8f8;">选择可操作的子级权限 <font style="color:red">↓</font></td>
- </tr>
- <?php if(is_array($role_rule) || $role_rule instanceof \think\Collection || $role_rule instanceof \think\Paginator): $i = 0; $__LIST__ = $role_rule;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
- <tr>
- <td class="left-note">
- <input type="checkbox" name="rule[]" value="<?php echo htmlentities($vo['id']); ?>" title="<?php echo htmlentities($vo['title']); ?>" class="aaa" <?php if($vo['checked'] == 'true'): ?>checked<?php endif; ?>>
- </td>
- <?php if(!(empty($vo['children']) || (($vo['children'] instanceof \think\Collection || $vo['children'] instanceof \think\Paginator ) && $vo['children']->isEmpty()))): ?>
- <td class="right-note">
- <div style="padding:0 0 0 10px;">
- <?php if(is_array($vo['children']) || $vo['children'] instanceof \think\Collection || $vo['children'] instanceof \think\Paginator): $k = 0; $__LIST__ = $vo['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voo): $mod = ($k % 2 );++$k;?>
- <div class="checkbox15" style="padding:10px 0;">
- <input type="checkbox" lay-filter="rule" name="rule[]" value="<?php echo htmlentities($voo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($voo['title']); ?>" <?php if($voo['checked'] == 'true'): ?>checked<?php endif; ?>>
- <?php if($voo['title'] == "造价项目"): if($voo['src'] == "admin/project.cost_company/datalist"): ?>
- <!-- <input id="company_field" type="button" class="layui-btn layui-btn-xs" lay-filter="rule" name="field_id" value="<?php echo htmlentities($field_id); ?>" lay-skin="primary" title="属性设置"> -->
- <button id="company_field" type="button" class="layui-btn layui-btn-xs">属性设置</button>
- <input id="company_field_id" hidden type="text" name="field_id" value="<?php echo htmlentities($field_id); ?>">
- <?php endif; if($voo['src'] == "admin/project.cost/datalist"): ?>
- <!-- <input id="finance_field" type="button" class="layui-btn layui-btn-xs" lay-filter="rule" name="field_id" value="<?php echo htmlentities($field_id); ?>" lay-skin="primary" title="属性设置"> -->
- <button id="finance_field" type="button" class="layui-btn layui-btn-xs">属性设置</button>
- <input id="finance_field_id" hidden type="text" name="field_id" value="<?php echo htmlentities($field_id); ?>">
- <?php endif; if($voo['src'] == "admin/project.costproprietor/datalist"): ?>
- <!-- <input id="proprietor_field" type="button" class="layui-btn layui-btn-xs" lay-filter="rule" name="field_id" value="<?php echo htmlentities($field_id); ?>" lay-skin="primary" title="属性设置"> -->
- <button id="proprietor_field" type="button" class="layui-btn layui-btn-xs">属性设置</button>
- <input id="proprietor_field_id" hidden type="text" name="field_id" value="<?php echo htmlentities($field_id); ?>">
- <?php endif; ?>
- <?php endif; ?>
- </div>
- <?php if(!(empty($voo['children']) || (($voo['children'] instanceof \think\Collection || $voo['children'] instanceof \think\Paginator ) && $voo['children']->isEmpty()))): ?>
- <div style="padding:0 0 3px; <?php if($k != count($vo['children'])): ?>margin-bottom:3px; padding-bottom:16px; border-bottom:1px solid #eee;<?php endif; ?>">
- <?php if(is_array($voo['children']) || $voo['children'] instanceof \think\Collection || $voo['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $voo['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vooo): $mod = ($i % 2 );++$i;?>
- <div class="layui-input-inline" style="margin-right:10px;">
- <input type="checkbox" data-rule="<?php echo htmlentities($voo['id']); ?>" name="rule[]" value="<?php echo htmlentities($vooo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vooo['title']); ?>" <?php if($vooo['checked'] == 'true'): ?>checked<?php endif; ?>>
- </div>
- <?php if(!(empty($vooo['children']) || (($vooo['children'] instanceof \think\Collection || $vooo['children'] instanceof \think\Paginator ) && $vooo['children']->isEmpty()))): ?>
- <div style="padding:0 0 3px; <?php if($k != count($vo['children'])): ?>margin-bottom:3px; padding-bottom:16px; border-bottom:1px solid #eee;<?php endif; ?>">
- <?php if(is_array($vooo['children']) || $vooo['children'] instanceof \think\Collection || $vooo['children'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vooo['children'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voooo): $mod = ($i % 2 );++$i;?>
- <div class="layui-input-inline" style="margin-right:10px;">
- <input type="checkbox" data-rule="<?php echo htmlentities($vooo['id']); ?>" name="rule[]" value="<?php echo htmlentities($voooo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($voooo['title']); ?>" <?php if($voooo['checked'] == 'true'): ?>checked<?php endif; ?>>
- </div>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </div>
- <?php endif; ?>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </div>
- <?php endif; ?>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </div>
- </td>
- <?php endif; ?>
- </tr>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </table>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray" style="vertical-align: top;">备注内容</td>
- <td colspan="3">
- <textarea name="desc" placeholder="请输入备注" class="layui-textarea"><?php if(!(empty($role['desc']) || (($role['desc'] instanceof \think\Collection || $role['desc'] instanceof \think\Paginator ) && $role['desc']->isEmpty()))): ?><?php echo htmlentities($role['desc']); ?><?php endif; ?></textarea>
- </td>
- </tr>
- </table>
- <div style="padding: 10px 0">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </form>
- <!-- /主体 -->
- <!-- 底部 -->
-
- <div class="footer">
- 逸管工程项目管理系统 © www.yiguanfep.com
- <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
- <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\"noreferrer'target=\”blank\"" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
- <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
- </div>
-
-
- <!-- /底部 -->
-
- <!-- 脚本 -->
-
- <script>
- const moduleInit = ['tool'];
- function gouguInit() {
- var form = layui.form,tool=layui.tool, tree = layui.tree;
- parent.layui.field_id = 0;
- //监听提交
- form.on('submit(webform)', function (obj) {
- //字段的id
- console.log(parent.layui.field_id)
- console.log(1);
- obj.field.field_id = parent.layui.field_id
- $.ajax({
- url: "/admin/role/add",
- data: obj.field,
- type: 'post',
- success: function (e) {
- layer.msg(e.msg);
- if (e.code == 0) {
- parent.layui.tool.close(1000);
- }
- }
- });
- return false;
- });
-
- // $("#l1").click(parent.layui.tool.side("../field.field/add",callback));
- // 跳转公司
- $("#company_field").click(function(e){
- var field_id = $('[name="field_id"]').val();
- parent.layui.tool.side("../field.fieldcompany/add?id=" + field_id);
- });
- // 跳转财政局
- $("#finance_field").click(function(e){
- var field_id = $('[name="field_id"]').val();
- parent.layui.tool.side("../field.field/add?id=" + field_id);
- });
- // 跳转业主
- $("#proprietor_field").click(function(e){
- var field_id = $('[name="field_id"]').val();
- parent.layui.tool.side("../field.fieldproprietor/add?id=" + field_id);
- });
-
- //监听多选框点击事件 通过 lay-filter="menu"来监听
- form.on('checkbox(menu)', function (data) {
- let val = data.value;
- if(data.elem.checked){
- //判断当前多选框是选中还是取消选中
- $("input[data-menu='"+val+"']").prop("checked", true);//true:选中 false:不选中
- }
- else{
- $("input[data-menu='"+val+"']").prop("checked", false);
- }
- form.render();//实时渲染选中和不选中的样式
- });
- $('[lay-filter="rule"]').click(function (){
- console.log(1);
- })
- //监听多选框点击事件 通过 lay-filter="rule"来监听
- form.on('checkbox(rule)', function (data) {
- let val = data.value;
- if(data.elem.checked){
- //判断当前多选框是选中还是取消选中
- $("input[data-rule='"+val+"']").prop("checked", true);//true:选中 false:不选中
- }
- else{
- $("input[data-rule='"+val+"']").prop("checked", false);
- }
- form.render();//实时渲染选中和不选中的样式
- });
- // $("#l1").click(console.log("role_rule"));
- }
- </script>
- <!-- /脚本 -->
-
- <!-- <script src="/static/assets/layui/layui.js"></script> -->
- <script src="/static/assets/layui/layui.js"></script>
- <script src="/static/assets/third_party/echart/echarts.min.js"></script>
- <script src="/static/assets/gougu/gouguInit.js"></script>
- <script src="https://unpkg.com/pinyin-pro"></script>
- <script>
-
- var { pinyin } = pinyinPro;
- </script>
-
-
- <!-- 统计代码 -->
-
- <!-- /统计代码 -->
- </body>
- </html>
|