説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.htm 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page min-hg-c-10">
  6. {include file="search/bar" /}
  7. <div class="flexigrid">
  8. <div class="mDiv pt0">
  9. <div class="ftitle">
  10. {eq name="'Search@batch_add'|is_check_access" value="1"}
  11. <div class="fbutton">
  12. <a href="javascript:void(0);" data-href="{:url('Search/batch_add')}" onclick="openFullframe(this, '批量新增', '600px', '600px');">
  13. <div class="add">
  14. <span><i class="layui-icon layui-icon-addition"></i>批量新增</span>
  15. </div>
  16. </a>
  17. </div>
  18. {/eq}
  19. </div>
  20. <form class="navbar-form form-inline" id="searchForm" action="{:url('Search/index')}" method="get" onsubmit="layer_loading('正在处理');">
  21. {$searchform.hidden|default=''}
  22. <div class="sDiv">
  23. <div class="sDiv2">
  24. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="关键词搜索...">
  25. <input type="submit" class="btn" value="搜索">
  26. <i class="iconfont e-sousuo"></i>
  27. </div>
  28. <div class="fbutton">
  29. <a href="javascript:void(0);" onclick="ExcelExport(this);" data-url="{:url('Search/ajax_excel_export')}" class="bt-xin-xia ml10" style="line-height: 28px;"><i class="iconfont e-xiazai"></i>导出</a>
  30. </div>
  31. </div>
  32. </form>
  33. </div>
  34. <div class="hDiv">
  35. <div class="hDivBox">
  36. <table cellspacing="0" cellpadding="0" style="width: 100%">
  37. <thead>
  38. <tr>
  39. <th class="sign w40" axis="col0">
  40. <div class="tc"><input type="checkbox" autocomplete="off" class="checkAll"></div>
  41. </th>
  42. <th abbr="article_show" axis="col5" class="w80">
  43. <div class="tc">ID</div>
  44. </th>
  45. <th abbr="ac_id" axis="col4">
  46. <div class="text-l10">关键字</div>
  47. </th>
  48. <th abbr="article_time" axis="col6" class="w150">
  49. <div class="tc sort_style"><a href="{:getArchivesSortUrl('searchNum')}">搜索次数&nbsp;<i {eq name='$Request.param.orderby' value='searchNum'}{eq name='$Request.param.orderway' value='asc'}class="asc"{else /}class="desc"{/eq}{/eq}></i></a></div>
  50. </th>
  51. <th abbr="article_time" axis="col6" class="w80">
  52. <div class="tc">热搜</div>
  53. </th>
  54. <th abbr="article_time" axis="col6" class="w100">
  55. <div class="tc">搜索结果</div>
  56. </th>
  57. <th abbr="article_time" axis="col6" class="w150">
  58. <div class="tc">最后搜索时间</div>
  59. </th>
  60. <th axis="col1" class="w80">
  61. <div class="tc">操作</div>
  62. </th>
  63. </tr>
  64. </thead>
  65. </table>
  66. </div>
  67. </div>
  68. <div class="bDiv" style="height: auto;">
  69. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  70. <table style="width: 100%">
  71. <tbody>
  72. {empty name="list"}
  73. <tr>
  74. <td class="no-data" align="center" axis="col0" colspan="50">
  75. <i class="fa fa-exclamation-circle"></i>没有符合条件的记录
  76. </td>
  77. </tr>
  78. {else/}
  79. {foreach name="list" item="vo" key="k" }
  80. <tr>
  81. <td class="sign">
  82. <div class="w40 tc"><input type="checkbox" autocomplete="off" name="ids[]" value="{$vo.id}"></div>
  83. </td>
  84. <td class="sort">
  85. <div class="w80 tc">
  86. {$vo.id}
  87. </div>
  88. </td>
  89. <td style="width: 100%">
  90. <div class="text-l10">
  91. <input type="text" value="{$vo.word}" style="width: 95%;" data-id="{$vo.id}" onchange="c_submit('word',this);">
  92. </div>
  93. </td>
  94. <td>
  95. <div class="tc w150">
  96. <input type="text" value="{$vo.searchNum}" style="width: 100px;text-align: center;" data-id="{$vo.id}" onchange="c_submit('searchNum',this);">
  97. </div>
  98. </td>
  99. <td>
  100. <div class="tc w80">
  101. {if condition="$vo['is_hot'] eq 1"}
  102. <span class="yes" onClick="changeTableVal('search_word','id','{$vo.id}','is_hot',this);"{/eq}><i class="fa fa-check-circle"></i>是</span>
  103. {else /}
  104. <span class="no" onClick="changeTableVal('search_word','id','{$vo.id}','is_hot',this);"{/eq}><i class="fa fa-ban"></i>否</span>
  105. {/if}
  106. </div>
  107. </td>
  108. <td class="">
  109. <div class="w100 tc">
  110. {$vo.resultNum}
  111. </div>
  112. </td>
  113. <td class="">
  114. <div class="w150 tc">
  115. {$vo.update_time|date='Y-m-d H:i:s',###}
  116. </div>
  117. </td>
  118. <td class="operation">
  119. <div class="w80 tc">
  120. {eq name="'Search@del'|is_check_access" value="1"}
  121. <a class="btn red" href="javascript:void(0)" data-url="{:url('Search/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
  122. {/eq}
  123. </div>
  124. </td>
  125. </tr>
  126. {/foreach}
  127. {/empty}
  128. </tbody>
  129. </table>
  130. </div>
  131. <div class="iDiv" style="display: none;"></div>
  132. </div>
  133. {notempty name="list"}
  134. <div class="tDiv">
  135. <div class="tDiv2">
  136. <div class="fbutton checkboxall">
  137. <input type="checkbox" autocomplete="off" class="checkAll">
  138. </div>
  139. {eq name="'Search@del'|is_check_access" value="1"}
  140. <div class="fbutton">
  141. <a onclick="batch_del(this, 'ids');" data-url="{:url('Search/del')}" data-id="{$vo.id}" class="layui-btn layui-btn-primary">
  142. <span>批量删除</span>
  143. </a>
  144. </div>
  145. {/eq}
  146. {include file="public/page" /}
  147. </div>
  148. <div style="clear:both"></div>
  149. </div>
  150. {/notempty}
  151. </div>
  152. </div>
  153. <script>
  154. // AJAX调用下载
  155. function ExcelExport(obj) {
  156. layer_loading('导出中');
  157. $.ajax({
  158. type: 'post',
  159. url : $(obj).attr('data-url'),
  160. data: {
  161. _ajax: 1,
  162. },
  163. dataType: 'json',
  164. success: function(res) {
  165. layer.closeAll();
  166. if (1 == res.code) {
  167. window.location.href = res.url;
  168. } else {
  169. showErrorAlert(res.msg);
  170. }
  171. },
  172. error: function(e) {
  173. layer.closeAll();
  174. showErrorAlert(e.responseText);
  175. }
  176. });
  177. }
  178. function c_submit(field,obj){
  179. layer_loading('正在处理');
  180. $.ajax({
  181. type : 'post',
  182. url : "{:url('Search/edit')}",
  183. data :{id:$(obj).attr('data-id'),field:field,value:$(obj).val(),_ajax:1},
  184. dataType : 'json',
  185. success : function(res){
  186. layer.closeAll();
  187. if(res.code == 1){
  188. layer.msg(res.msg);
  189. }else{
  190. showErrorMsg(res.msg);
  191. }
  192. },
  193. error: function(e){
  194. layer.closeAll();
  195. layer.alert(e.responseText, {icon: 5, title:false});
  196. }
  197. })
  198. }
  199. $(function(){
  200. $('input[name*=ids]').click(function(){
  201. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  202. $('.checkAll').prop('checked','checked');
  203. } else {
  204. $('.checkAll').prop('checked', false);
  205. }
  206. });
  207. $('input[type=checkbox].checkAll').click(function(){
  208. $('input[type=checkbox]').prop('checked',this.checked);
  209. });
  210. $('#searchForm select[name=groupid]').change(function(){
  211. $('#searchForm').submit();
  212. });
  213. });
  214. $(document).ready(function(){
  215. // 表格行点击选中切换
  216. $('#flexigrid > table>tbody >tr').click(function(){
  217. $(this).toggleClass('trSelected');
  218. });
  219. // 点击刷新数据
  220. $('.fa-refresh').click(function(){
  221. location.href = location.href;
  222. });
  223. });
  224. </script>
  225. {include file="public/footer" /}