You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

143 line
5.6 KiB

  1. <title>专题列表</title>
  2. <div class="layui-card layadmin-header">
  3. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  4. <a lay-href="">主页</a>
  5. <a><cite>运营管理</cite></a>
  6. <a><cite>专题管理</cite></a>
  7. <a><cite>专题列表</cite></a>
  8. </div>
  9. </div>
  10. <div class="layui-fluid">
  11. <div class="layui-card">
  12. <div id="layui-search" class="layui-form layui-form layui-card-header layuiadmin-card-header-auto"
  13. style="display: none">
  14. <div class="layui-form-item">
  15. <div id="layui-search-fields" class="layui-search-fields" style="display: inline-block">
  16. </div>
  17. <div id="layui-search-button" class="layui-inline">
  18. <button class="layui-btn layuiadmin-btn" lay-submit lay-filter="LAY-front-search">
  19. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  20. </button>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="layui-card-body">
  25. <div style="padding-bottom: 10px;" id="layui-top-button">
  26. </div>
  27. <table id="LAY-curd-table" lay-filter="LAY-curd-table"></table>
  28. <script type="text/html" id="table-curd-list">
  29. </script>
  30. </div>
  31. </div>
  32. </div>
  33. <script type="text/html" id="viewNovels">
  34. <div class="layui-form-item">
  35. <label class="layui-form-label">用户:</label>
  36. <div class="layui-input-block">
  37. <input type="text" value="{{d.data.user}}" class="layui-input" style="border: none;" disabled>
  38. </div>
  39. </div>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label">标题:</label>
  42. <div class="layui-input-block">
  43. <input type="text" value="{{d.data.title}}" class="layui-input" style="border: none;" disabled>
  44. </div>
  45. </div>
  46. <div class="layui-form-item">
  47. <label class="layui-form-label">标签:</label>
  48. <div class="layui-input-block">
  49. <input type="text" value="{{d.data.tags}}" class="layui-input" style="border: none;" disabled>
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label">描述:</label>
  54. <div class="layui-input-block">
  55. <input type="text" value="{{d.data.intro}}" class="layui-input" style="border: none;" disabled>
  56. </div>
  57. </div>
  58. <table lay-filter="viewNovelsTable">
  59. <thead>
  60. <tr>
  61. <th lay-data="{field:'create_time', width:160}">添加时间</th>
  62. <th lay-data="{field:'novel', width:160}">书名</th>
  63. <th lay-data="{field:'author', width:160}">作者</th>
  64. <th lay-data="{field:'star', width:60,align: 'center'}">评分</th>
  65. <th lay-data="{field:'comment'}">评语</th>
  66. <th lay-data="{field:'action', width:80,align: 'center'}">操作</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. {{# layui.each(d.list, function(index, item){ }}
  71. <tr>
  72. <td>{{item.create_time}}</td>
  73. <td>{{item.novel.novel.name}}</td>
  74. <td>{{item.novel.author.name}}</td>
  75. <td>{{item.star}}</td>
  76. <td>{{item.comment}}</td>
  77. <td>
  78. <button onclick="config.removeNovel(this,'{{d.data.id}}','{{item.novel_id}}');"
  79. class="layui-btn layui-btn-xs layui-btn-danger">删除
  80. </button>
  81. </td>
  82. </tr>
  83. {{# }); }}
  84. </tbody>
  85. </table>
  86. </script>
  87. <script>
  88. var config = {
  89. api: {
  90. batch: '/manage/content/special/special/batch.json',
  91. list: '/manage/content/special/special/list.json',
  92. del: '/manage/content/special/special/del.json',
  93. change: '/manage/content/special/special/change.json',
  94. },
  95. search: {
  96. user: {type: 'text', text: '用户名'},
  97. status: {type: 'select', text: '状态', data: {0: '禁用', 1: '启用'}},
  98. },
  99. topButton: {
  100. add: {},
  101. del: {},
  102. },
  103. actionButton: {
  104. novel: {
  105. text: '小说管理',
  106. icon: 'layui-icon layui-icon-list',
  107. action: function (obj) {
  108. location.hash = '/content/special/special_id=' + obj.data.id + '/novel/';
  109. }
  110. },
  111. edit: {},
  112. del: {},
  113. },
  114. table: {
  115. page: true,
  116. limit: 30,
  117. cols: [[
  118. {type: 'checkbox', fixed: 'left'},
  119. {field: 'cover', title: '封面', templet: '#table-img', width: 100,},
  120. {field: 'id', title: 'ID', align: 'center', width: 60},
  121. {field: 'user', title: '用户', align: 'center', width: 100},
  122. {field: 'title', title: '标题'},
  123. {field: 'intro', title: '描述'},
  124. {field: 'num_novel', title: '小说', align: 'center', width: 60},
  125. {field: 'num_allvisit', title: '浏览', align: 'center', width: 60},
  126. {field: 'create_time', title: '创建时间', templet: '#table-timestamp'},
  127. {
  128. field: 'status',
  129. title: '状态',
  130. templet: '#table-switch',
  131. align: 'center',
  132. width: 100,
  133. data: {text: '正常|隐藏'}
  134. },
  135. {title: '操作', width: 230, align: 'center', fixed: 'right', toolbar: '#table-curd-list'}
  136. ]]
  137. }
  138. };
  139. layui.use('curd/list', layui.factory('curd/list'));
  140. </script>