list.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. {% if data['page']['ajax'] == False %}
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. {%include '../inc/header.html'%}
  6. </head>
  7. <body>
  8. <div class="x-nav">
  9. <span class="layui-breadcrumb">
  10. {% block breadcrumb %}
  11. <a><cite>首页</cite></a>
  12. <a><cite><script>document.write(parent.config.parentTitle)</script></cite></a>
  13. <a><cite><script>document.write(parent.config.subTitle)</script></cite></a>
  14. {% if data['state'] != True %}
  15. <a><cite>回收站</cite></a>
  16. {% end %}
  17. {% end %}
  18. </span>
  19. <span id="currentUrl"><script>var cur = parent.config.cur;</script></span>
  20. <a class="layui-btn layui-btn-small" style="margin-top:3px;float:right" href="javascript:window.history.back();" title="返回"><i class="layui-icon">&#xe619;</i></a>
  21. </div>
  22. <div class="x-body">
  23. <form class="layui-form x-center" action="" style="width:auto">
  24. <div class="layui-form-pane" style="margin-top: 15px;">
  25. <div class="layui-form-item">
  26. {% block search %}
  27. <label class="layui-form-label">日期范围</label>
  28. <div class="layui-input-inline">
  29. <input class="layui-input" placeholder="开始时间" id="LAY_demorange_s" name="search_start">
  30. </div>
  31. <div class="layui-input-inline">
  32. <input class="layui-input" placeholder="截止时间" id="LAY_demorange_e" name="search_end">
  33. </div>
  34. <div class="layui-input-inline">
  35. <input type="text" name="search_name" placeholder="标题" autocomplete="off" class="layui-input">
  36. </div>
  37. {% end %}
  38. <div class="layui-input-inline" style="width:80px">
  39. <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
  40. </div>
  41. </div>
  42. </div>
  43. </form>
  44. <xblock>{% block button %}<button class="layui-btn" onclick="show('添加问题','question-add.html','600','500')"><i class="layui-icon">&#xe608;</i>添加</button><button class="layui-btn layui-btn-danger" onclick="showDel('')"><i class="layui-icon"></i>回收站</button>{% end %}<span class="x-right" style="line-height:40px">{% block total %}共有数据:{{data['page']['totalNum']}} 条 [每页数据:{{data['page']['num']}} 条{% end %}]</span></xblock>
  45. <table class="layui-table">
  46. <thead>
  47. <tr>
  48. {% block thead %}
  49. <th>
  50. <input type="checkbox" name="" value="">
  51. </th>
  52. <th>
  53. ID
  54. </th>
  55. <th>
  56. 标题
  57. </th>
  58. <th>
  59. 分类
  60. </th>
  61. <th>
  62. 来源
  63. </th>
  64. <th>
  65. 更新时间
  66. </th>
  67. <th>
  68. 浏览次数
  69. </th>
  70. <th>
  71. 操作
  72. </th>
  73. {% end %}
  74. </tr>
  75. </thead>
  76. <tbody id="tbody">
  77. {% end %}
  78. {% block tbody %}
  79. <tr>
  80. <td>
  81. <input type="checkbox" value="1" name="">
  82. </td>
  83. <td>
  84. 1
  85. </td>
  86. <td>
  87. <u style="cursor:pointer" onclick="question_show()">
  88. 问题标题
  89. </u>
  90. </td>
  91. <td >
  92. 新闻子类1
  93. </td>
  94. <td >
  95. xuebingsi
  96. </td>
  97. <td >
  98. 2017-01-01 11:11:42
  99. </td>
  100. <td >
  101. 34
  102. </td>
  103. <td class="td-manage">
  104. <a title="编辑" href="javascript:;" onclick="question_edit('编辑','question-edit.html','4','','510')"
  105. class="ml-5" style="text-decoration:none">
  106. <i class="layui-icon">&#xe642;</i>
  107. </a>
  108. <a title="删除" href="javascript:;" onclick="question_del(this,'1')"
  109. style="text-decoration:none">
  110. <i class="layui-icon">&#xe640;</i>
  111. </a>
  112. </td>
  113. </tr>
  114. {% end %}
  115. {% if data['page']['ajax'] == False %}
  116. </tbody>
  117. </table>
  118. <div id="page"></div>
  119. </div>
  120. {%include '../inc/footer.html'%}
  121. {%include '../inc/script.html'%}
  122. <script>
  123. layui.use(['laydate','element','laypage','layer', 'form'], function(){
  124. $ = layui.jquery;//jquery
  125. lement = layui.element();//面包导航
  126. laypage = layui.laypage;//分页
  127. layer = layui.layer;//弹出层
  128. if ($('.load').length) {
  129. $('.load').each(function()
  130. {
  131. load($(this))
  132. })
  133. }
  134. if ($('.time').length) {
  135. laydate = layui.laydate;//日期插件
  136. var start = {
  137. //min: laydate.now()
  138. max: '2099-06-16 23:59:59'
  139. ,format: 'YYYY-MM-DD hh:mm:ss'
  140. ,istoday: true
  141. ,istime: true
  142. ,choose: function(datas){
  143. end.min = datas; //开始日选好后,重置结束日的最小日期
  144. end.start = datas //将结束日的初始值设定为开始日
  145. }
  146. };
  147. var end = {
  148. //min: laydate.now()
  149. max: '2099-06-16 23:59:59'
  150. ,format: 'YYYY-MM-DD hh:mm:ss'
  151. ,istoday: true
  152. ,istime: true
  153. ,choose: function(datas){
  154. start.max = datas; //结束日选好后,重置开始日的最大日期
  155. }
  156. };
  157. $('.time').each(function()
  158. {
  159. type = $(this).attr('id').indexOf('start')
  160. $(this).click(function()
  161. {
  162. if (type > -1) {
  163. start.elem = this;
  164. laydate(start);
  165. } else {
  166. end.elem = this
  167. laydate(end);
  168. }
  169. })
  170. })
  171. }
  172. laypage({
  173. cont: 'page'
  174. ,pages: {{data['page']['total']}}
  175. ,curr: {{data['page']['current']}}
  176. ,first: 1
  177. ,last: {{data['page']['total']}}
  178. ,prev: '<em><</em>'
  179. ,next: '<em>></em>'
  180. ,skip: true
  181. ,jump: function(obj, first) {
  182. var curr = obj.curr;
  183. var url = location.href;
  184. var str = 'page='
  185. var link = '?'
  186. var page = 1
  187. if (url.indexOf(str) > -1) {
  188. var temp = url.split('page=')
  189. url = temp[0]
  190. page = temp[1]
  191. if (page.indexOf('&') > -1) {
  192. temp = page.split('&')
  193. page = temp[0]
  194. if (url.indexOf('?') > -1) {
  195. link = '&'
  196. }
  197. if (temp[1]) {
  198. url = url + link + temp[1]
  199. }
  200. }
  201. }
  202. if (url.indexOf('?') > -1) {
  203. link = '&'
  204. } else {
  205. link = '?'
  206. }
  207. url = url + link;
  208. url = url.replace('&&', '&')
  209. if (curr != {{data['page']['current']}}) {
  210. url = url + 'page=' + curr
  211. var index = layer.msg('loading...', {icon: 4});
  212. request('get', url, {}, function(msg)
  213. {
  214. layer.close(index);
  215. $('#tbody').html(msg)
  216. })
  217. }
  218. }
  219. });
  220. {% block script %}
  221. {% end %}
  222. });
  223. </script>
  224. </body>
  225. </html>
  226. {% end %}