Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

108 rindas
4.8 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. </div>
  8. </div>
  9. <div class="layui-fluid">
  10. <div class="layui-card">
  11. <div id="layui-search" class="layui-form layui-form layui-card-header layuiadmin-card-header-auto"
  12. style="display: none">
  13. <div class="layui-form-item">
  14. <div id="layui-search-fields" class="layui-search-fields" style="display: inline-block">
  15. </div>
  16. <div id="layui-search-button" class="layui-inline">
  17. <button class="layui-btn layuiadmin-btn" lay-submit lay-filter="LAY-front-search">
  18. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  19. </button>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="layui-card-body">
  24. <div style="padding-bottom: 10px;" id="layui-top-button">
  25. </div>
  26. <table id="LAY-curd-table" lay-filter="LAY-curd-table"></table>
  27. <script type="text/html" id="table-curd-list">
  28. </script>
  29. </div>
  30. </div>
  31. </div>
  32. <script>
  33. var config = {
  34. api: {
  35. list: '/manage/content/chapter/published.json',
  36. del: '/manage/content/chapter/del.json',
  37. content: '/manage/content/chapter/content.json'
  38. },
  39. actionButton: {
  40. info: {
  41. text: '详情', style: 'layui-btn-normal', icon: 'layui-icon layui-icon-form', action: function (obj) {
  42. layui.admin.req({
  43. url: config.api.content,
  44. data: {novelid: obj.data.novel_id, chapterid: obj.data.id, type: 'published'},
  45. method: 'post',
  46. success: function (res) {
  47. layui.layer.open({
  48. type: 1,
  49. skin: 'layui-layer-rim',
  50. area: ['100%', '100%'],
  51. btn: '关闭',
  52. title: obj.data.name,
  53. content: '<style>.chapter_preview p{text-indent: 2em;margin-bottom: 5px;font-size: 16px;line-height: 32px}</style><table class="layui-table chapter_preview"></table>',
  54. success: function (layero, index) {
  55. var table = layero.find('.layui-layer-content table');
  56. table.append('<tr><td>' + res.data.content + '</td></tr>');
  57. table.append('<tr style="background-color:#f2f2f2;"><th style="text-align: center">作者附笔</th></tr>');
  58. table.append('<tr><td>' + res.data.postscript + '</td></tr>');
  59. }
  60. });
  61. }
  62. });
  63. }
  64. },
  65. del: {
  66. action: function (obj) {
  67. layui.layer.confirm('真的删除这条记录么', function (index) {
  68. layui.admin.req({
  69. url: config.api.del,
  70. data: {novelid: obj.data.novel_id, chapterid: obj.data.id},
  71. method: 'POST',
  72. success: function (res) {
  73. layer.msg('删除成功');
  74. obj.del();
  75. }
  76. });
  77. layui.layer.close(index);
  78. });
  79. }
  80. },
  81. },
  82. table: {
  83. where: {novel_id: layui.router().search.id},
  84. page: true,
  85. limit: 30,
  86. cols: [[
  87. {field: 'id', title: 'ID', align: 'center', width: 60},
  88. {field: 'order_id', title: 'OID', width: 80},
  89. {field: 'author', title: '作者名称', width: 160},
  90. {field: 'novel', title: '书籍名称', width: 160},
  91. {field: 'name', title: '章节名称'},
  92. {
  93. field: 'type',
  94. title: '类型',
  95. templet: '#table-label',
  96. data: {data: {"-1": "采集章节", "-2": "免费章节", "-3": "<span class=\"layui-badge\">收费章节</span>"}},
  97. width: 160,
  98. },
  99. {field: 'words', title: '字数', width: 80},
  100. {title: '操作', width: 160, align: 'center', fixed: 'right', toolbar: '#table-curd-list'}
  101. ]]
  102. }
  103. };
  104. layui.use('curd/list', layui.factory('curd/list'));
  105. </script>