config_group.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {include file="common/header"/}
  2. <div class="LM-container">
  3. <div class="LM-main">
  4. <fieldset class="layui-elem-field layui-field-title">
  5. <legend>{:lang('config group')}{:lang('list')}</legend>
  6. </fieldset>
  7. <table class="layui-table layui-hide" id="list" lay-filter="list"></table>
  8. </div>
  9. </div>
  10. <script type="text/html" id="action">
  11. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
  12. </script>
  13. {include file="common/footer"/}
  14. <script>
  15. layui.use(['form', 'table'], function () {
  16. var $ = layui.jquery,
  17. form = layui.form,
  18. table = layui.table;
  19. var info = {:json_encode($info)};
  20. var tableIn = table.render({
  21. elem: '#list',
  22. data:info,
  23. cols: [[
  24. {checkbox: true, fixed: true},
  25. {field: 'id', title: 'ID', width: 80, sort: true},
  26. {field: 'title', title: '分组标题', width: 250,sort: true},
  27. {field: 'name', title: '分组名', width: 120,sort: true},
  28. {title:'操作',width:120, toolbar: '#action',align:"center"}
  29. ]],
  30. limits: [10, 15, 20, 25, 50, 100],
  31. limit: 15,
  32. page: false
  33. });
  34. table.on('tool(list)', function(obj){
  35. var data = obj.data;
  36. var id = data.id;
  37. if(obj.event === 'del'){
  38. layer.confirm('{:lang("Are you sure you want to delete it")}', function(index){
  39. loading =layer.load(1, {shade: [0.1,'#fff']});
  40. $.post("{:url('configGroupDel')}",{id:data.id},function(res){
  41. layer.close(loading);
  42. if(res.code>0){
  43. layer.msg(res.msg,{time:1000,icon:1});
  44. obj.del();
  45. }else{
  46. layer.msg(res.msg,{time:1000,icon:2});
  47. }
  48. });
  49. });
  50. }
  51. });
  52. });
  53. </script>