12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <div class="layui-form" lay-filter="layuiadmin-form-role" style="padding: 20px 30px 0 0;">
- <div class="layui-form-item">
- <label class="layui-form-label">角色</label>
- <div class="layui-input-block">
- <script type="text/html" template>
- <select name="position">
- <option value="管理员" {{ d.params.role === '管理员' ? 'selected' : '' }}>管理员</option>
- <option value="超级管理员" {{ d.params.role === '超级管理员' ? 'selected' : '' }}>超级管理员</option>
- <option value="纠错员" {{ d.params.role === '纠错员' ? 'selected' : '' }}>纠错员</option>
- <option value="采购员" {{ d.params.role === '采购员' ? 'selected' : '' }}>采购员</option>
- <option value="推销员" {{ d.params.role === '推销员' ? 'selected' : '' }}>推销员</option>
- <option value="运营人员" {{ d.params.role === '运营人员' ? 'selected' : '' }}>运营人员</option>
- <option value="文章撰写员" {{ d.params.role === '文章撰写员' ? 'selected' : '' }}>文章撰写员</option>
- </select>
- </script>
- </div>
- </div>
- <script type="text/html" template>
- <div class="layui-form-item">
- <label class="layui-form-label">姓名</label>
- <div class="layui-input-block">
- <input type="text" name="name" value="{{ d.params.name || '' }}" required lay-verify="required" autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">用户名</label>
- <div class="layui-input-block">
- <input type="text" name="username" value="{{ d.params.username || '' }}" {{ typeof(d.params.username) == 'undefined' ? '' : 'readonly' }} required lay-verify="required" autocomplete="off" class="layui-input">
- </div>
- </div>
- </script>
- <div class="layui-form-item">
- <label class="layui-form-label">权限范围</label>
- <div class="layui-input-block">
- <div id="role-tree" class="layui-tree"></div>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"></label>
- <div class="layui-input-inline">
- <input type="button" lay-submit lay-filter="LAY-user-role-submit" value="确认" class="layui-btn">
- </div>
- </div>
- </div>
- <script>
- layui.use(['admin', 'form', 'tree'], function(){
- var $ = layui.$
- ,form = layui.form
- ,tree = layui.tree;
- $.ajax({
- url:"/login/getRoleTree",
- success:function (res) {
- var data = res;
- tree.render({
- elem: '#role-tree'
- ,data: data
- // ,spread: true
- ,showCheckbox: true //是否显示复选框
- ,id: 'demoId1'
- // ,isJump: true //是否允许点击节点时弹出新窗口跳转
- ,oncheck: function(obj){
- var data = obj.data; //获取当前点击的节点数据
- console.log(data)
- }
- });
- }
- })
- });
- </script>
|