index.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <div class="row-content am-cf">
  2. <div class="row">
  3. <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
  4. <div class="widget am-cf">
  5. <div class="widget-head am-cf">
  6. <div class="widget-title am-cf">文章列表</div>
  7. </div>
  8. <div class="widget-body am-fr">
  9. <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
  10. <div class="am-form-group">
  11. <div class="am-btn-toolbar">
  12. <?php if (checkPrivilege('content.article/add')): ?>
  13. <div class="am-btn-group am-btn-group-xs">
  14. <a class="am-btn am-btn-default am-btn-success am-radius"
  15. href="<?= url('content.article/add') ?>">
  16. <span class="am-icon-plus"></span> 新增
  17. </a>
  18. </div>
  19. <?php endif; ?>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="am-scrollable-horizontal am-u-sm-12">
  24. <table width="100%" class="am-table am-table-compact am-table-striped
  25. tpl-table-black am-text-nowrap">
  26. <thead>
  27. <tr>
  28. <th>文章ID</th>
  29. <th>文章标题</th>
  30. <th>封面图</th>
  31. <th>文章分类</th>
  32. <th>实际阅读量</th>
  33. <th>文章排序</th>
  34. <th>状态</th>
  35. <th>添加时间</th>
  36. <th>更新时间</th>
  37. <th>操作</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
  42. <tr>
  43. <td class="am-text-middle"><?= $item['article_id'] ?></td>
  44. <td class="am-text-middle">
  45. <p class="item-title"
  46. style="max-width: 400px;"><?= $item['article_title'] ?></p>
  47. </td>
  48. <td class="am-text-middle">
  49. <a href="<?= $item['image']['file_path'] ?>" title="点击查看大图" target="_blank">
  50. <img src="<?= $item['image']['file_path'] ?>" height="72" alt="">
  51. </a>
  52. </td>
  53. <td class="am-text-middle"><?= $item['category']['name'] ?></td>
  54. <td class="am-text-middle"><?= $item['actual_views'] ?></td>
  55. <td class="am-text-middle"><?= $item['article_sort'] ?></td>
  56. <td class="am-text-middle">
  57. <span class="am-badge am-badge-<?= $item['article_status'] ? 'success' : 'warning' ?>">
  58. <?= $item['article_status'] ? '显示' : '隐藏' ?>
  59. </span>
  60. </td>
  61. <td class="am-text-middle"><?= $item['create_time'] ?></td>
  62. <td class="am-text-middle"><?= $item['update_time'] ?></td>
  63. <td class="am-text-middle">
  64. <div class="tpl-table-black-operation">
  65. <?php if (checkPrivilege('content.article/edit')): ?>
  66. <a href="<?= url('content.article/edit',
  67. ['article_id' => $item['article_id']]) ?>">
  68. <i class="am-icon-pencil"></i> 编辑
  69. </a>
  70. <?php endif; ?>
  71. <?php if (checkPrivilege('content.article/delete')): ?>
  72. <a href="javascript:void(0);"
  73. class="item-delete tpl-table-black-operation-del"
  74. data-id="<?= $item['article_id'] ?>">
  75. <i class="am-icon-trash"></i> 删除
  76. </a>
  77. <?php endif; ?>
  78. </div>
  79. </td>
  80. </tr>
  81. <?php endforeach; else: ?>
  82. <tr>
  83. <td colspan="10" class="am-text-center">暂无记录</td>
  84. </tr>
  85. <?php endif; ?>
  86. </tbody>
  87. </table>
  88. </div>
  89. <div class="am-u-lg-12 am-cf">
  90. <div class="am-fr"><?= $list->render() ?> </div>
  91. <div class="am-fr pagination-total am-margin-right">
  92. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <script>
  101. $(function () {
  102. // 删除元素
  103. var url = "<?= url('content.article/delete') ?>";
  104. $('.item-delete').delete('article_id', url);
  105. });
  106. </script>