index.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-title">
  7. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加分类</button>
  8. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('setting.systemConfig/create',['type'=>0])}')">添加配置</button>
  9. <div class="ibox-tools">
  10. </div>
  11. </div>
  12. <div class="ibox-content">
  13. <div class="row">
  14. <div class="m-b m-l">
  15. <form action="" class="form-inline">
  16. <select name="status" aria-controls="editable" class="form-control input-sm">
  17. <option value="">状态</option>
  18. <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>显示</option>
  19. <option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>不显示</option>
  20. </select>
  21. <div class="input-group" style="margin-top: 5px;">
  22. <input type="text" placeholder="请输入分类昵称" name="title" value="{$where.title}" class="input-sm form-control"> <span class="input-group-btn">
  23. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search"></i>搜索</button> </span>
  24. </div>
  25. </form>
  26. </div>
  27. </div>
  28. <div class="table-responsive">
  29. <table class="table table-striped table-bordered">
  30. <thead>
  31. <tr>
  32. <th>编号</th>
  33. <th>分类昵称</th>
  34. <th>分类字段</th>
  35. <th>是否显示</th>
  36. <th>操作</th>
  37. </tr>
  38. </thead>
  39. <tbody class="">
  40. {volist name="list" id="vo"}
  41. <tr>
  42. <td class="text-center">
  43. {$vo.id}
  44. </td>
  45. <td class="text-center">
  46. <a href="{:url('index',array('pid'=>$vo['id']))}" style="cursor: pointer">{$vo.title}</a>
  47. </td>
  48. <td class="text-center">
  49. {$vo.eng_title}
  50. </td>
  51. <td class="text-center">
  52. {if condition="$vo.status eq 1"}
  53. <i class="fa fa-check text-navy"></i>
  54. {elseif condition="$vo.status eq 2"/}
  55. <i class="fa fa-close text-danger"></i>
  56. {/if}
  57. </td>
  58. <td class="text-center">
  59. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('查看字段','{:Url('sonConfigTab',array('tab_id'=>$vo['id']))}',{w:900})"><i class="fa fa-edit"></i> 配置字段</button>
  60. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  61. {if condition="$vo['id'] > 2"}
  62. <button class="btn btn-danger btn-xs del_config_tab" data-id="{$vo.id}" type="button" data-url="{:Url('delete',array('id'=>$vo['id']))}" ><i class="fa fa-times"></i> 删除
  63. </button>
  64. {/if}
  65. </td>
  66. </tr>
  67. {/volist}
  68. </tbody>
  69. </table>
  70. </div>
  71. {include file="public/inner_page"}
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. {/block}
  77. {block name="script"}
  78. <script>
  79. $('.del_config_tab').on('click',function(){
  80. var _this = $(this),url =_this.data('url');
  81. $eb.$swal('delete',function(){
  82. $eb.axios.get(url).then(function(res){
  83. if(res.status == 200 && res.data.code == 200) {
  84. $eb.$swal('success',res.data.msg);
  85. _this.parents('tr').remove();
  86. }else
  87. return Promise.reject(res.data.msg || '删除失败')
  88. }).catch(function(err){
  89. $eb.$swal('error',err);
  90. });
  91. })
  92. });
  93. </script>
  94. {/block}