a8ba287c844b92a9904d92bc00486605.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php /*a:3:{s:58:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\auth\group.html";i:1581911356;s:61:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\common\header.html";i:1582014448;s:61:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\common\footer.html";i:1581911356;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo config('admin.sys_name'); ?>后台管理</title>
  7. <meta name="renderer" content="webkit">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <meta name="apple-mobile-web-app-capable" content="yes">
  12. <meta name="format-detection" content="telephone=no">
  13. <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
  14. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7/css/bootstrap.css" media="all" />-->
  15. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css" media="all" />-->
  16. <link rel="stylesheet" href="/static/admin/css/main.css?v=<?php echo time(); ?>" media="all">
  17. <link rel="stylesheet" href="/static/plugins/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
  18. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-select/less/bootstrap-select.less">-->
  19. <!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">-->
  20. <!--[if lt IE 9]>
  21. <!--<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>-->
  22. <!--<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>-->
  23. <!--<![endif]&ndash;&gt;-->
  24. <style id="LM-bg-color">
  25. </style>
  26. </head>
  27. <div class="LM-container">
  28. <div class="LM-main">
  29. <div class="admin-main layui-anim layui-anim-upbit">
  30. <fieldset class="layui-elem-field layui-field-title">
  31. <legend>权限组<?php echo lang('list'); ?></legend>
  32. <blockquote class="layui-elem-quote">
  33. <div class="LM-table">
  34. <form class="layui-form layui-form-pane">
  35. <div class="layui-inline">
  36. <input type="text" name="title" lay-verify="required" placeholder="<?php echo lang('pleaseEnter'); ?>添加" autocomplete="off" class="layui-input">
  37. </div>
  38. <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="add"><?php echo lang('add'); ?></button>
  39. </form>
  40. </div>
  41. </blockquote>
  42. </fieldset>
  43. <table class="layui-table" id="list" lay-filter="list"></table>
  44. </div>
  45. </div>
  46. </div>
  47. <script type="text/html" id="action">
  48. <a href="<?php echo url('groupAccess'); ?>?id={{d.id}}" class="layui-btn layui-btn-xs layui-btn-normal">配置规则</a>
  49. <a href="<?php echo url('groupEdit'); ?>?id={{d.id}}" class="layui-btn layui-btn-warm layui-btn-xs"><?php echo lang('edit'); ?></a>
  50. {{# if(d.id==1){ }}
  51. <a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><?php echo lang('del'); ?></a>
  52. {{# }else{ }}
  53. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><?php echo lang('del'); ?></a>
  54. {{# } }}
  55. </script>
  56. <script type="text/html" id="status">
  57. {{# if(d.id==1){ }}
  58. <input type="checkbox" disabled name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" checked>
  59. {{# }else{ }}
  60. <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
  61. {{# } }}
  62. </script>
  63. <script type="text/html" id="create_time">
  64. {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
  65. </script>
  66. <script type="text/html" id="update_time">
  67. {{layui.util.toDateString(d.update_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
  68. </script>
  69. <script src="/static/plugins/layui/layui.js" charset="utf-8"></script>
  70. <!--<script src="/static/plugins/bootstrap-3.3.7/js/bootstrap.js" charset="utf-8"></script>-->
  71. <script>
  72. layui.use(['form', 'table'], function () {
  73. var $ = layui.jquery,
  74. form = layui.form,
  75. table = layui.table;
  76. var tableIn = table.render({
  77. elem: '#list',
  78. url: '<?php echo url("group"); ?>',
  79. method: 'post',
  80. cols: [[
  81. {checkbox: true, fixed: true},
  82. {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
  83. {field: 'title', title: '组名', width: 150, fixed: true,},
  84. {field: 'status', title: '状态', width: 180, templet:'#status'},
  85. {field: 'create_time', title: '添加时间', width: 180,templet:'#create_time'},
  86. {field: 'update_time', title: '修改时间', width: 180,templet:'#update_time'},
  87. {title:'操作',width:250, toolbar: '#action',align:"center"},
  88. ]],
  89. });
  90. // 监听添加操作
  91. form.on('submit(add)', function (data) {
  92. var result = data.field;
  93. loading =layer.load(1, {shade: [0.1,'#fff']});
  94. $.post("<?php echo url('groupAdd'); ?>", result, function (res) {
  95. layer.close(loading);
  96. if (res.code > 0) {
  97. layer.msg(res.msg, {time: 2000, icon: 1});
  98. tableIn.reload();
  99. } else {
  100. layer.msg(res.msg, {time: 2000, icon: 2});
  101. return false;
  102. }
  103. });
  104. return false;
  105. })
  106. table.on('tool(list)', function(data){
  107. console.log(data);
  108. var obj = data.data;
  109. if(data.event === 'del'){
  110. layer.confirm('<?php echo lang("Are you sure you want to delete it"); ?>', function(index){
  111. loading =layer.load(1, {shade: [0.1,'#fff']});
  112. $.post("<?php echo url('groupDel'); ?>",{id:obj.id},function(res){
  113. layer.close(loading);
  114. layer.close(index);
  115. if(res.code>0){
  116. layer.msg(res.msg,{time:1000,icon:1});
  117. data.del();
  118. }else{
  119. layer.msg(res.msg,{time:1000,icon:2});
  120. }
  121. });
  122. });
  123. }
  124. });
  125. form.on('switch(status)', function(data){
  126. loading =layer.load(1, {shade: [0.1,'#fff']});
  127. $.post("<?php echo url('groupState'); ?>",{id:data.value},function(res){
  128. layer.close(loading);
  129. if(res.code>0){
  130. layer.msg(res.msg,{time:1000,icon:1});
  131. }else{
  132. layer.msg(res.msg,{time:1000,icon:2});
  133. }
  134. });
  135. });
  136. });
  137. </script>