Power.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!DOCTYPE html>
  2. <html class="x-admin-sm">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="renderer" content="webkit">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  8. <link rel="shortcut icon" href="https://osscold.baozhida.cn/favicon.ico">
  9. <link rel="bookmark" href="https://osscold.baozhida.cn/favicon.ico">
  10. <link rel="stylesheet" href="https://osscold.baozhida.cn/css/font.css">
  11. <link rel="stylesheet" href="https://osscold.baozhida.cn/css/xadmin.css">
  12. <script src="https://osscold.baozhida.cn/lib/layui/layui.js" charset="utf-8"></script>
  13. <script type="text/javascript" src="https://osscold.baozhida.cn/js/xadmin.js"></script>
  14. </head>
  15. <body>
  16. <div class="x-nav">
  17. <span class="layui-breadcrumb">
  18. <a href="">首页</a>
  19. <a><cite>宝智达</cite></a>
  20. </span>
  21. <a class="layui-btn layui-btn-normal" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
  22. <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
  23. </a>
  24. </div>
  25. <div class="layui-fluid">
  26. <div class="layui-row layui-col-space15">
  27. <div class="layui-col-md12">
  28. <div class="layui-card">
  29. <div class="layui-card-body ">
  30. <form class="layui-form layui-col-space5">
  31. <div class="layui-input-inline layui-show-xs-block">
  32. <input value="{{.Name}}" type="text" name="Name" placeholder="请输入 名称" autocomplete="off" class="layui-input"></div>
  33. <div class="layui-input-inline layui-show-xs-block">
  34. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
  35. <i class="layui-icon">&#xe615;</i></button>
  36. </div>
  37. </form>
  38. </div>
  39. <div class="layui-card-header">
  40. <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()">-->
  41. <!-- <i class="layui-icon"></i>批量删除</button>-->
  42. <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加','Power_',800,600,true);">
  43. <i class="layui-icon"></i>添加</button></div>
  44. <div class="layui-card-body ">
  45. <table class="layui-table layui-form">
  46. <thead>
  47. <tr>
  48. <th>权限名称</th>
  49. <th>内部人员</th>
  50. <th>用户管理</th>
  51. <th>设备管理</th>
  52. <th>系统管理</th>
  53. <th>操作</th></tr>
  54. </thead>
  55. <tbody>
  56. {{range $index, $elem := .List}}
  57. <tr>
  58. <td>{{$elem.Power_name}}</td>
  59. <td>
  60. {{if eq $elem.Power_Administration 0 }}×{{end}}
  61. {{if eq $elem.Power_Administration 1 }}✔{{end}}
  62. </td>
  63. <td>
  64. 用户管理:
  65. {{if eq $elem.Power_User_r 0 }}×{{end}}
  66. {{if eq $elem.Power_User_r 1 }}✔{{end}}
  67. 无钥匙进入:
  68. {{if eq $elem.Power_User_entry 0 }}×{{end}}
  69. {{if eq $elem.Power_User_entry 1 }}✔{{end}}
  70. </td>
  71. <td>
  72. 设备管理:
  73. {{if eq $elem.Power_Device_r 0 }}×{{end}}
  74. {{if eq $elem.Power_Device_r 1 }}✔{{end}}
  75. 设备添加:
  76. {{if eq $elem.Power_Device_a 0 }}×{{end}}
  77. {{if eq $elem.Power_Device_a 1 }}✔{{end}}
  78. 设备参数操作:
  79. {{if eq $elem.Power_Device_Parameter_e 0 }}×{{end}}
  80. {{if eq $elem.Power_Device_Parameter_e 1 }}✔{{end}}
  81. 传感器参数操作:
  82. {{if eq $elem.Power_DeviceSensor_Parameter_e 0 }}×{{end}}
  83. {{if eq $elem.Power_DeviceSensor_Parameter_e 1 }}✔{{end}}
  84. 二级报警:
  85. {{if eq $elem.Power_DeviceSensor_Compensate_e 0 }}×{{end}}
  86. {{if eq $elem.Power_DeviceSensor_Compensate_e 1 }}✔{{end}}
  87. 设备绑定:
  88. {{if eq $elem.Power_Device_Bind_e 0 }}×{{end}}
  89. {{if eq $elem.Power_Device_Bind_e 1 }}✔{{end}}
  90. 传感器分类:
  91. {{if eq $elem.Power_DeviceSensor_Class 0 }}×{{end}}
  92. {{if eq $elem.Power_DeviceSensor_Class 1 }}✔{{end}}
  93. </td>
  94. <td>
  95. 系统日志:
  96. {{if eq $elem.Logs_Sys_r 0 }}×{{end}}
  97. {{if eq $elem.Logs_Sys_r 1 }}✔{{end}}
  98. 用户日志:
  99. {{if eq $elem.Logs_User_r 0 }}×{{end}}
  100. {{if eq $elem.Logs_User_r 1 }}✔{{end}}
  101. </td>
  102. <td class="td-manage">
  103. <a title="编辑" onclick="xadmin.open('编辑','Power_?id={{$elem.Id}}');" href="javascript:;">
  104. <i class="layui-icon">&#xe63c;</i></a>
  105. <a title="删除" onclick="member_del(this,'{{$elem.Id}}')" href="javascript:;">
  106. <i class="layui-icon">&#xe640;</i></a>
  107. </td>
  108. </tr>
  109. {{end}}
  110. </tbody>
  111. </table>
  112. </div>
  113. <div class="layui-card-body ">
  114. <div class="page">
  115. <div>
  116. {{range $index, $elem := .Pages}}
  117. {{if eq $elem.A 1}}
  118. <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}">&lt;&lt;</a>
  119. {{end}}
  120. {{if eq $elem.A 2}}
  121. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}">{{$elem.V}}</a>
  122. {{end}}
  123. {{if eq $elem.A 3}}
  124. <span class="current">{{$elem.V}}</span>
  125. {{end}}
  126. {{if eq $elem.A 4}}
  127. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}">{{$elem.V}}</a>
  128. {{end}}
  129. {{if eq $elem.A 5}}
  130. <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}">&gt;&gt;</a>
  131. {{end}}
  132. {{end}}
  133. </div>
  134. Page:{{.Page}}-
  135. Page_size:{{.Page_size}}-
  136. cnt:{{.cnt}}
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </body>
  144. <script>
  145. layui.use(['laydate', 'form'],
  146. function() {
  147. var laydate = layui.laydate;
  148. //执行一个laydate实例
  149. laydate.render({
  150. elem: '#start' //指定元素
  151. });
  152. //执行一个laydate实例
  153. laydate.render({
  154. elem: '#end' //指定元素
  155. });
  156. });
  157. /*用户-删除*/
  158. function member_del(obj, id) {
  159. layer.confirm('确认要删除吗?',
  160. function(index) {
  161. //发异步删除数据
  162. $(obj).parents("tr").remove();
  163. $.ajax({
  164. type: 'POST',
  165. url: 'Power_Del',//发送请求
  166. data: {Id:id},
  167. success: function(result) {
  168. console.log(result)
  169. if (result.Code == 200 ){
  170. layer.msg('已删除!', {
  171. icon: 1,
  172. time: 2000
  173. });
  174. window.location.reload();
  175. }else if (result.Code == 203 ){
  176. layer.msg('没有权限', {
  177. icon: 1,
  178. time: 2000
  179. });
  180. window.location.reload();
  181. }else if (result.Code == 205 ){
  182. layer.msg(result.Msg, {
  183. icon: 1,
  184. time: 2000
  185. });
  186. window.location.reload();
  187. }else {
  188. layer.msg('删除失败!', {
  189. icon: 1,
  190. time: 2000
  191. });
  192. window.location.reload();
  193. }
  194. }
  195. });
  196. });
  197. }
  198. </script>
  199. </html>