123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <!DOCTYPE html>
- <html class="x-admin-sm">
-
- <head>
- <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,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
- <link rel="shortcut icon" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="bookmark" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/font.css">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/xadmin.css">
- <script src="https://osscold.baozhida.cn/lib/layui/layui.js" charset="utf-8"></script>
- <script type="text/javascript" src="https://osscold.baozhida.cn/js/xadmin.js"></script>
- </head>
-
- <body>
- <div class="x-nav">
- <span class="layui-breadcrumb">
- <a href="">首页</a>
- <a><cite>宝智达</cite></a>
- </span>
- <a class="layui-btn layui-btn-normal" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
- <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
- </a>
- </div>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-body ">
- <form class="layui-form layui-col-space5">
- <div class="layui-input-inline layui-show-xs-block">
- <input value="{{.Name}}" type="text" name="Name" placeholder="请输入 名称" autocomplete="off" class="layui-input"></div>
- <div class="layui-input-inline layui-show-xs-block">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
- <i class="layui-icon"></i></button>
- </div>
- </form>
- </div>
- <div class="layui-card-header">
- <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()">-->
- <!-- <i class="layui-icon"></i>批量删除</button>-->
- <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加','Power_',800,600,true);">
- <i class="layui-icon"></i>添加</button></div>
- <div class="layui-card-body ">
- <table class="layui-table layui-form">
- <thead>
- <tr>
- <th>权限名称</th>
- <th>内部人员</th>
- <th>用户管理</th>
- <th>设备管理</th>
- <th>系统管理</th>
- <th>操作</th></tr>
- </thead>
- <tbody>
- {{range $index, $elem := .List}}
- <tr>
- <td>{{$elem.Power_name}}</td>
- <td>
- {{if eq $elem.Power_Administration 0 }}×{{end}}
- {{if eq $elem.Power_Administration 1 }}✔{{end}}
- </td>
- <td>
- 用户管理:
- {{if eq $elem.Power_User_r 0 }}×{{end}}
- {{if eq $elem.Power_User_r 1 }}✔{{end}}
- 无钥匙进入:
- {{if eq $elem.Power_User_entry 0 }}×{{end}}
- {{if eq $elem.Power_User_entry 1 }}✔{{end}}
- </td>
- <td>
- 设备管理:
- {{if eq $elem.Power_Device_r 0 }}×{{end}}
- {{if eq $elem.Power_Device_r 1 }}✔{{end}}
- 设备添加:
- {{if eq $elem.Power_Device_a 0 }}×{{end}}
- {{if eq $elem.Power_Device_a 1 }}✔{{end}}
- 设备参数操作:
- {{if eq $elem.Power_Device_Parameter_e 0 }}×{{end}}
- {{if eq $elem.Power_Device_Parameter_e 1 }}✔{{end}}
- 传感器参数操作:
- {{if eq $elem.Power_DeviceSensor_Parameter_e 0 }}×{{end}}
- {{if eq $elem.Power_DeviceSensor_Parameter_e 1 }}✔{{end}}
- 二级报警:
- {{if eq $elem.Power_DeviceSensor_Compensate_e 0 }}×{{end}}
- {{if eq $elem.Power_DeviceSensor_Compensate_e 1 }}✔{{end}}
- 设备绑定:
- {{if eq $elem.Power_Device_Bind_e 0 }}×{{end}}
- {{if eq $elem.Power_Device_Bind_e 1 }}✔{{end}}
- 传感器分类:
- {{if eq $elem.Power_DeviceSensor_Class 0 }}×{{end}}
- {{if eq $elem.Power_DeviceSensor_Class 1 }}✔{{end}}
- </td>
- <td>
- 系统日志:
- {{if eq $elem.Logs_Sys_r 0 }}×{{end}}
- {{if eq $elem.Logs_Sys_r 1 }}✔{{end}}
- 用户日志:
- {{if eq $elem.Logs_User_r 0 }}×{{end}}
- {{if eq $elem.Logs_User_r 1 }}✔{{end}}
- </td>
- <td class="td-manage">
- <a title="编辑" onclick="xadmin.open('编辑','Power_?id={{$elem.Id}}');" href="javascript:;">
- <i class="layui-icon"></i></a>
- <a title="删除" onclick="member_del(this,'{{$elem.Id}}')" href="javascript:;">
- <i class="layui-icon"></i></a>
- </td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- <div class="layui-card-body ">
- <div class="page">
- <div>
- {{range $index, $elem := .Pages}}
- {{if eq $elem.A 1}}
- <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}"><<</a>
- {{end}}
- {{if eq $elem.A 2}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 3}}
- <span class="current">{{$elem.V}}</span>
- {{end}}
- {{if eq $elem.A 4}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 5}}
- <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}">>></a>
- {{end}}
- {{end}}
- </div>
- Page:{{.Page}}-
- Page_size:{{.Page_size}}-
- cnt:{{.cnt}}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script>
- layui.use(['laydate', 'form'],
- function() {
- var laydate = layui.laydate;
- //执行一个laydate实例
- laydate.render({
- elem: '#start' //指定元素
- });
- //执行一个laydate实例
- laydate.render({
- elem: '#end' //指定元素
- });
- });
- /*用户-删除*/
- function member_del(obj, id) {
- layer.confirm('确认要删除吗?',
- function(index) {
- //发异步删除数据
- $(obj).parents("tr").remove();
- $.ajax({
- type: 'POST',
- url: 'Power_Del',//发送请求
- data: {Id:id},
- success: function(result) {
- console.log(result)
- if (result.Code == 200 ){
- layer.msg('已删除!', {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }else if (result.Code == 203 ){
- layer.msg('没有权限', {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }else if (result.Code == 205 ){
- layer.msg(result.Msg, {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }else {
- layer.msg('删除失败!', {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }
- }
- });
- });
- }
- </script>
- </html>
|