No Description
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.

index_archives.htm 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. {include file="public/layout" /}
  2. <body style="background: #F5F5F5; overflow: auto; cursor: default; -moz-user-select: inherit;min-width:auto;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div style="height: 10px;"></div>
  6. <div class="page min-hg-c-66">
  7. <div style="width:100%;float:left;height: 0px;overflow-y: scroll;margin-bottom:5px;display: none;">
  8. <span>职称产品</span>
  9. </div>
  10. <div style="width:100%;float:left;">
  11. <div class="flexigrid" style="margin-top: 0px;min-height: 600px;">
  12. <div class="mDiv">
  13. <div class="ftitle">
  14. {include file="archives/tags_btn" /}
  15. </div>
  16. <!--<div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>-->
  17. <form id="searchForm" class="navbar-form form-inline" action="{:url('Archives/index_archives')}" method="get" onSubmit="layer_loading('正在处理');">
  18. {$searchform.hidden|default=''}
  19. <div class="sDiv">
  20. {include file="archives/flag_btn" /}
  21. <div class="sDiv2">
  22. <input type="hidden" name="typeid" value="{$typeid}">
  23. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="标题搜索..." {if condition="!empty($arctype_info['typename'])"}title="仅搜索“{$arctype_info['typename']}”栏目下的文档"{/if}>
  24. <input type="submit" class="btn" value="搜索">
  25. <i class="iconfont e-sousuo"></i>
  26. </div>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="hDiv">
  31. <div class="hDivBox">
  32. <table cellspacing="0" cellpadding="0" style="width: 100%">
  33. <thead>
  34. <tr>
  35. <th class="sign w40" axis="col0">
  36. <div class="tc"><input type="checkbox" class="checkAll" autocomplete="off"></div>
  37. </th>
  38. <th abbr="article_title" axis="col3" class="w70">
  39. <div class="tc">ID</div>
  40. </th>
  41. <th abbr="article_title" axis="col3" class="">
  42. <div style="text-align: left;" class="text-l10">标题</div>
  43. </th>
  44. <!-- <th abbr="article_time" axis="col6" class="w120">
  45. <div class="tc">付费限制</div>
  46. </th> -->
  47. <th abbr="article_time" axis="col6" class="w120">
  48. <div class="tc">栏目</div>
  49. </th>
  50. <th abbr="article_time" axis="col6" class="w60">
  51. <div class="tc sort_style"><a href="{:getArchivesSortUrl('arcrank')}">审核&nbsp;<i {eq name='$Request.param.orderby' value='arcrank'}{eq name='$Request.param.orderway' value='asc'}class="asc"{else /}class="desc"{/eq}{/eq}></i></a></div>
  52. </th>
  53. <th abbr="article_time" axis="col6" class="w60">
  54. <div class="tc">点击</div>
  55. </th>
  56. {if !empty($arctype_info) && $arctype_info['current_channel'] == 4}
  57. <th abbr="download_time" axis="col6" class="w60">
  58. <div class="tc">下载</div>
  59. </th>
  60. {/if}
  61. <th abbr="article_time" axis="col6" class="w100">
  62. <div class="tc">发布时间</div>
  63. </th>
  64. <th axis="col1" class="w160">
  65. <div class="tc">操作</div>
  66. </th>
  67. <th abbr="article_time" axis="col6" class="w60">
  68. <div class="tc sort_style"><a href="{:getArchivesSortUrl('sort_order')}">排序&nbsp;<i {eq name='$Request.param.orderby' value='sort_order'}{eq name='$Request.param.orderway' value='asc'}class="asc"{else /}class="desc"{/eq}{/eq}></i></a></div>
  69. </th>
  70. </tr>
  71. </thead>
  72. </table>
  73. </div>
  74. </div>
  75. <div class="bDiv" style="height: auto;">
  76. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  77. <table style="width: 100%;">
  78. <tbody>
  79. {empty name="list"}
  80. <tr>
  81. <td class="no-data" align="center" axis="col0" colspan="50">
  82. <div class="no_row">
  83. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  84. </div>
  85. </td>
  86. </tr>
  87. {else/}
  88. {foreach name="list" item="vo" key="k" }
  89. <tr>
  90. <td class="sign">
  91. <div id="aid_{$vo.aid}" data-typeid="{$vo.typeid}" class="tc w40"><input type="checkbox" name="ids[]" value="{$vo.aid}" autocomplete="off"></div>
  92. </td>
  93. <td class="sort">
  94. <div class="tc w70">
  95. {$vo.aid}
  96. </div>
  97. </td>
  98. <td class="" style="width: 100%;">
  99. <div class="tl pdl10" >
  100. {notempty name="$vo.is_litpic"}
  101. <i class="fa fa-picture-o color_z" onmouseover="layer_tips=layer.tips('<img src={$vo.litpic} class=\'layer_tips_img\'>',this,{tips: [3, '#fff'],skin:'layer-yourskin-mt0'});" onmouseout="layer.close(layer_tips);"></i>
  102. {/notempty}
  103. {eq name="'Archives@edit'|is_check_access" value="1"}
  104. {if condition="empty($channelRow[$vo['channel']]['ifsystem'])"}
  105. <a href="{:url('Custom/edit',array('id'=>$vo['aid'],'typeid'=>$Request.param.typeid, 'channel'=>$vo.channel, 'callback_url'=>$callback_url))}" style="{eq name="vo.is_b" value="1"} font-weight: bold;{/eq}">{$vo.title}</a>
  106. {elseif condition="'Product' == $channelRow[$vo['channel']]['ctl_name']" /}
  107. <a href="JavaScript:void(0);" data-url="{:url('Product/edit', ['id'=>$vo['aid'], 'typeid'=>$Request.param.typeid, 'callback_url'=>$callback_url])}" onclick="productEdit(this, {$shopOpen|default='0'}, {$vo.aid});" style="{eq name="vo.is_b" value="1"} font-weight: bold; {/eq}">{$vo.title}</a>
  108. {else/}
  109. <a href="{:url($channelRow[$vo['channel']]['ctl_name'].'/edit',array('id'=>$vo['aid'],'typeid'=>$Request.param.typeid, 'callback_url'=>$callback_url))}" style="{eq name="vo.is_b" value="1"} font-weight: bold; {/eq}">{$vo.title}</a>
  110. {/if}
  111. {else /}
  112. {$vo.title}
  113. {/eq}
  114. {assign name='showArcFlagData' value='$vo|showArchivesFlagStr'}
  115. {volist name='$showArcFlagData' id="vo1"}
  116. {eq name='$i' value='1'}<span style="color: red;">[{/eq}
  117. <i style="font-size: 12px;">{$vo1['small_name']}</i>
  118. {eq name='$i' value='$showArcFlagData|count'}]</span>{/eq}
  119. {/volist}
  120. </div>
  121. </td>
  122. <!-- <td class="">
  123. <div class="w120 tc">
  124. <span style="display: block;">高级会员</span>
  125. <span class="red">¥10.00</span>
  126. </div>
  127. </td> -->
  128. <td class="">
  129. <div class="w120 tc ellipsis"><a href="{:url('Archives/index_archives', array('typeid'=>$vo['typeid']))}" title="{$vo.typename}">{$vo.typename|default='<i class="red">数据出错!</i>'}</a></div>
  130. </td>
  131. <td>
  132. <div class="tc w60">
  133. {if condition="$vo['arcrank'] eq -1"}
  134. <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"} data-typeid="{$vo.typeid}" data-seo_pseudo="{$seo_pseudo|default='1'}" onClick="changeTableVal('archives','aid','{$vo.aid}','arcrank',this);" {/eq} ><i class="fa fa-ban"></i>否</span>
  135. {else /}
  136. <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"} data-typeid="{$vo.typeid}" data-seo_pseudo="{$seo_pseudo|default='1'}" onClick="changeTableVal('archives','aid','{$vo.aid}','arcrank',this);" {/eq} ><i class="fa fa-check-circle"></i>是</span>
  137. {/if}
  138. </div>
  139. </td>
  140. <td>
  141. <div class="tc w60">
  142. {$vo.click}
  143. </div>
  144. </td>
  145. {if !empty($arctype_info) && $arctype_info['current_channel'] == 4}
  146. <td>
  147. <div class="tc w60">
  148. {$vo.downcount}
  149. </div>
  150. </td>
  151. {/if}
  152. <td>
  153. <div class="w100 tc">
  154. {$vo.add_time|date='Y-m-d',###}
  155. </div>
  156. </td>
  157. <td class="operation">
  158. <div class="w160 tc">
  159. {eq name="'Archives@edit'|is_check_access" value="1"}
  160. {if condition="empty($channelRow[$vo['channel']]['ifsystem'])"}
  161. <a href="{:url('Custom/edit',array('id'=>$vo['aid'],'typeid'=>$Request.param.typeid, 'channel'=>$vo.channel, 'callback_url'=>$callback_url))}" class="btn blue">编辑</a>
  162. {elseif condition="'Product' == $channelRow[$vo['channel']]['ctl_name']" /}
  163. <a href="JavaScript:void(0);" data-url="{:url('Product/edit', ['id'=>$vo['aid'], 'typeid'=>$Request.param.typeid, 'callback_url'=>$callback_url])}" onclick="productEdit(this, {$shopOpen|default='0'}, {$vo.aid});" class="btn blue">编辑</a>
  164. {else/}
  165. <a href="{:url($channelRow[$vo['channel']]['ctl_name'].'/edit',array('id'=>$vo['aid'], 'typeid'=>$Request.param.typeid, 'callback_url'=>$callback_url))}" class="btn blue">编辑</a>
  166. {/if}
  167. <i></i>
  168. {/eq}
  169. {eq name="'Archives@del'|is_check_access" value="1"}
  170. <a class="btn red" href="javascript:void(0);" data-url="{:url('Archives/del')}" data-id="{$vo.aid}" {eq name="$global['web_recycle_switch']" value='1'} data-deltype="del" {else /} data-deltype="pseudo" {/eq} onClick="delfun(this);">删除</a>
  171. <i></i>
  172. {/eq}
  173. <a href="{$vo.arcurl}" target="_blank" class="btn blue">浏览</a>
  174. </div>
  175. </td>
  176. <td class="sort">
  177. <div class="w60 tc">
  178. {eq name="'Archives@edit'|is_check_access" value="1"}
  179. <input type="text" onChange="changeTableVal('archives','aid','{$vo.aid}','sort_order',this);" size="4" value="{$vo.sort_order}" />
  180. {else /}
  181. {$vo.sort_order}
  182. {/eq}
  183. </div>
  184. </td>
  185. </tr>
  186. {/foreach}
  187. {/empty}
  188. </tbody>
  189. </table>
  190. </div>
  191. <div class="iDiv" style="display: none;"></div>
  192. </div>
  193. {notempty name="list"}
  194. <div class="footer-oper">
  195. <span class="ml15">
  196. <input type="checkbox" class="checkAll" autocomplete="off">
  197. </span>
  198. <div class="nav-dropup">
  199. <button class="layui-btn layui-btn-primary dropdown-bt">批量操作<i class="layui-icon layui-icon-up"></i></button>
  200. <div class="dropdown-menus" style="display:none; {if condition='0 < $pager->totalRows && ($pager->totalRows < 4 || $pager->listRows < 4)'}top:28px;bottom:unset;border-bottom:1px solid rgba(0,0,0,.15);border-top:none; min-height: 250px;{/if}">
  201. {eq name="'Archives@batch_attr'|is_check_access" value="1"}
  202. <a href="javascript:void(0);" onclick="batch_attr(this, 'ids', '批量新增属性');" data-url="{:url('Archives/batch_attr', ['opt'=>'add'])}">新增属性</a>
  203. <a href="javascript:void(0);" onclick="batch_attr(this, 'ids', '批量删除属性');" data-url="{:url('Archives/batch_attr', ['opt'=>'del'])}">删除属性</a>
  204. <hr class="layui-bg-gray">
  205. {/eq}
  206. {eq name="'Archives@batch_copy'|is_check_access" value="1"}
  207. <a href="javascript:void(0);" onclick="func_batch_copy(this, 'ids');" data-url="{:url('Archives/batch_copy', array('typeid'=>$Request.param.typeid))}">复制文档</a>
  208. {/eq}
  209. {eq name="'Archives@move'|is_check_access" value="1"}
  210. <a href="javascript:void(0);" onclick="func_move(this, 'ids');" data-url="{:url('Archives/move', array('typeid'=>$Request.param.typeid))}">移动文档</a>
  211. {/eq}
  212. {eq name="'Archives@del'|is_check_access" value="1"}
  213. <a href="javascript:void(0);" onclick="batch_del(this, 'ids');" data-url="{:url('Archives/del')}" {eq name="$global['web_recycle_switch']" value='1'} data-deltype="del" {else /} data-deltype="pseudo" {/eq}>删除文档</a>
  214. {/eq}
  215. {eq name="'Archives@check'|is_check_access" value="1"}
  216. <hr class="layui-bg-gray">
  217. <a href="javascript:void(0);" onclick="batch_check(this, 'ids');" data-type="check" data-url="{:url('Archives/check')}">审核文档</a>
  218. <a href="javascript:void(0);" onclick="batch_check(this, 'ids');" data-type="uncheck" data-url="{:url('Archives/uncheck')}">取消审核</a>
  219. {/eq}
  220. </div>
  221. </div>
  222. {eq name="'Archives@index_draft'|is_check_access" value="1"}
  223. <a data-url="{:url('Archives/index_draft')}" onclick="recycleBin(this)" href="javascript:;" class="layui-btn layui-btn-primary" title="待审核文档">待审核文档</a>
  224. {/eq}
  225. {eq name="'RecycleBin@archives_index'|is_check_access" value="1"}
  226. {neq name="$global['web_recycle_switch']" value='1'}
  227. <a data-url="{:url('RecycleBin/archives_index')}" onclick="recycleBin(this)" href="javascript:;" class="layui-btn layui-btn-primary" title="回收站">回收站</a>
  228. {/neq}
  229. {/eq}
  230. {include file="public/page" /}
  231. </div>
  232. {/notempty}
  233. </div>
  234. </div>
  235. </div>
  236. <script type="text/javascript">
  237. function recycleBin(obj) {
  238. var url = $(obj).data("url");
  239. parent.location = url;
  240. }
  241. $(function(){
  242. $('input[name*=ids]').click(function(){
  243. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  244. $('.checkAll').prop('checked','checked');
  245. } else {
  246. $('.checkAll').prop('checked', false);
  247. }
  248. });
  249. $('input[type=checkbox].checkAll').click(function(){
  250. $('input[type=checkbox]').prop('checked',this.checked);
  251. });
  252. });
  253. $(document).ready(function(){
  254. // 表格行点击选中切换
  255. $('#flexigrid > table>tbody >tr').click(function(){
  256. $(this).toggleClass('trSelected');
  257. });
  258. // 点击刷新数据
  259. $('.fa-refresh').click(function(){
  260. location.href = location.href;
  261. });
  262. // 选择栏目检索出相应文档列表
  263. $('#typeid').change(function(){
  264. $('#searchForm').submit();
  265. });
  266. // 批量操作
  267. $(".dropdown-bt").click(function(){
  268. $(".dropdown-menus").slideToggle(200);
  269. event.stopPropagation();
  270. })
  271. $(document).click(function(){
  272. $(".dropdown-menus").slideUp(200);
  273. event.stopPropagation();
  274. })
  275. });
  276. var aids = '';
  277. function func_move(obj, name)
  278. {
  279. var a = [];
  280. var k = 0;
  281. aids = '';
  282. $('input[name^='+name+']').each(function(i,o){
  283. if($(o).is(':checked')){
  284. a.push($(o).val());
  285. if (k > 0) {
  286. aids += ',';
  287. }
  288. aids += $(o).val();
  289. k++;
  290. }
  291. })
  292. if(a.length == 0){
  293. layer.alert('请至少选择一项', {
  294. shade: layer_shade,
  295. area: ['480px', '190px'],
  296. move: false,
  297. title: '提示',
  298. btnAlign:'r',
  299. closeBtn: 3,
  300. success: function () {
  301. $(".layui-layer-content").css('text-align', 'left');
  302. }
  303. });
  304. return;
  305. }
  306. var url = $(obj).attr('data-url');
  307. //iframe窗
  308. layer.open({
  309. type: 2,
  310. title: '移动文档',
  311. fixed: true, //不固定
  312. shadeClose: false,
  313. shade: layer_shade,
  314. maxmin: false, //开启最大化最小化按钮
  315. area: ['480px', '360px'],
  316. content: url
  317. });
  318. }
  319. /**
  320. * 获取修改之前的内容
  321. */
  322. function get_aids()
  323. {
  324. return aids;
  325. }
  326. var typeid_arr = []; //已经生成过静态的typeid
  327. var build_finish = false; //是否已经全部生成静态
  328. //检查是否已经生成静态,刷新页面
  329. function build_finish_polling(){
  330. if(build_finish === true){
  331. layer.closeAll();
  332. layer.msg('操作成功', {icon: 1});
  333. window.location.reload();
  334. }
  335. }
  336. /**
  337. * 批量审核
  338. */
  339. function batch_check(obj, name) {
  340. var url = $(obj).attr('data-url');
  341. var data_type = $(obj).attr('data-type');//uncheck
  342. var a = [];
  343. $('input[name^='+name+']').each(function(i,o){
  344. if($(o).is(':checked')){
  345. a.push($(o).val());
  346. }
  347. });
  348. if(a.length == 0){
  349. layer.alert('请至少选择一项', {
  350. shade: layer_shade,
  351. area: ['480px', '190px'],
  352. move: false,
  353. title: '提示',
  354. btnAlign:'r',
  355. closeBtn: 3,
  356. success: function () {
  357. $(".layui-layer-content").css('text-align', 'left');
  358. }
  359. });
  360. return;
  361. }
  362. // title = '批量审核';
  363. // btn = ['确定', '取消']; //按钮
  364. // // 删除按钮
  365. // layer.confirm(title, {
  366. // title: false,
  367. // btn: btn //按钮
  368. // }, function () {
  369. layer_loading('正在处理');
  370. $.ajax({
  371. type: "POST",
  372. url: url,
  373. data: {ids:a, _ajax:1},
  374. dataType: 'json',
  375. success: function (data) {
  376. if(data.code == 1){
  377. var last = false;
  378. if (data_type === 'check'){
  379. for(var i=0;i<a.length;i++){
  380. var id_value = a[i];
  381. var typeid =$("#aid_"+id_value).data('typeid');
  382. if ((i+1) == a.length){
  383. last = true;
  384. }
  385. up_html(id_value,typeid,last);
  386. }
  387. window.setTimeout(build_finish_polling, 3000);
  388. }else{
  389. layer.closeAll();
  390. layer.msg(data.msg, {icon: 1});
  391. window.location.reload();
  392. }
  393. }else{
  394. layer.closeAll();
  395. layer.alert(data.msg, {icon: 2, title:false});
  396. }
  397. },
  398. error:function(e){
  399. layer.closeAll();
  400. layer.alert(e.responseText, {icon: 2, title:false});
  401. }
  402. });
  403. // }, function (index) {
  404. // layer.closeAll(index);
  405. // });
  406. }
  407. //生成静态页面
  408. function up_html(id_value,typeid,last){
  409. $.ajax({
  410. url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml&lang="+__lang__+"&id="+id_value+"&t_id="+typeid+"&type=view&ctl_name=Archives&_ajax=1",
  411. type:'GET',
  412. dataType:'json',
  413. data:{},
  414. success:function(res1){
  415. // layer.closeAll();
  416. // layer.msg('生成完成', {icon: 1, time: 1500});
  417. if (typeid_arr.indexOf(typeid) === -1){
  418. typeid_arr.push(typeid);
  419. $.ajax({
  420. url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml&lang="+__lang__+"&id="+id_value+"&t_id="+typeid+"&type=lists&ctl_name=Archives&_ajax=1",
  421. type:'GET',
  422. dataType:'json',
  423. data:{},
  424. success:function(res2){
  425. if (last === true){
  426. build_finish = true;
  427. }
  428. // layer.closeAll();
  429. // layer.msg('生成完成', {icon: 1, time: 1500});
  430. },
  431. error: function(e){
  432. layer.closeAll();
  433. layer.alert('生成当前栏目HTML失败,请手工生成栏目静态!', {icon: 5, title: false});
  434. }
  435. });
  436. }else{
  437. if (last === true){
  438. build_finish = true;
  439. }
  440. }
  441. },
  442. error: function(e){
  443. layer.closeAll();
  444. layer.alert('生成HTML失败,请手工生成静态HTML!', {icon: 5, title: false});
  445. }
  446. });
  447. }
  448. </script>
  449. {include file="public/footer" /}