Ei kuvausta
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.htm 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. {include file="public/layout" /}
  2. <style>
  3. .icon-link_add {
  4. background-color: #fff;
  5. position: absolute;
  6. top: 5px;
  7. right: 6px;
  8. text-align: center;
  9. border: 1px solid #e1e1e1;
  10. border-radius: 50%;
  11. cursor: pointer;
  12. }
  13. .iconfont {
  14. font-family: "iconfont" !important;
  15. font-size: 16px;
  16. font-style: normal;
  17. -webkit-font-smoothing: antialiased;
  18. -moz-osx-font-smoothing: grayscale;
  19. }
  20. .e-jiahao2 {
  21. color: #adadad;
  22. font-weight: 700;
  23. }
  24. .e-jianhao {
  25. color: #3fa9e0;
  26. font-weight: 700;
  27. }
  28. </style>
  29. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  30. <div id="append_parent"></div>
  31. <div id="ajaxwaitid"></div>
  32. <div class="page min-hg-c-10">
  33. <div class="row-bar clearfix mb10">
  34. {include file="weapp/bar" /}
  35. <div class="flexigrid fr">
  36. <form class="navbar-form form-inline" action="{:url('Weapp/index')}" method="get" onsubmit="layer_loading('正在处理');">
  37. {$searchform.hidden|default=''}
  38. <div class="ftitle">
  39. <div class="sDiv2 fl" style="">
  40. <input type="text" size="30" name="keywords" class="qsbox" placeholder="搜索应用名称..." autocomplete="off">
  41. <input type="submit" class="btn" value="搜索">
  42. <i class="iconfont e-sousuo"></i>
  43. </div>
  44. </div>
  45. </form>
  46. </div>
  47. </div>
  48. <div class="flexigrid">
  49. <div class="plug-list">
  50. {empty name="list"}
  51. <div class="bDiv" style="height: auto;">
  52. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  53. <table style="width: 100%">
  54. <tbody>
  55. <tr>
  56. <td class="no-data" align="center" axis="col0" colspan="50">
  57. <div class="no_row">
  58. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  59. </div>
  60. </td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. </div>
  65. <div class="iDiv" style="display: none;"></div>
  66. </div>
  67. {else /}
  68. <script>
  69. var update_admin_menu_url = "{:url('Ajax/update_admin_menu', ['_ajax'=>1])}"; //添加、删除入口地址
  70. var is_founder = {$is_founder};
  71. $(function(){
  72. //添加、取消成为栏目
  73. $(".bodystyle").on('click','.e-jiahao2',function (){
  74. if(is_founder !== 1){
  75. return false;
  76. }
  77. var menu_id = $(this).data('menu_id');
  78. var title = $(this).data('name');
  79. var controller_name = "Weapp" ;
  80. var action_name = "execute" ;
  81. var param = $(this).data('param');
  82. var target = $(this).data('target');
  83. var icon = "iconfont e-chajian" ;
  84. _this = this;
  85. if($(this).hasClass('e-jianhao')) { //原本为“已添加”,去除"我的菜单",修改下面块为“未添加”模式,且显示
  86. $.ajax({
  87. type: "POST",
  88. url: update_admin_menu_url,
  89. data: {title:title,controller_name:controller_name,action_name:action_name,menu_id:menu_id,icon:icon,param:param,target:target,type:2},
  90. dataType: 'json',
  91. success:function (res) {
  92. if(res.code == 1){
  93. //修改状态
  94. $(_this).removeClass('e-jianhao');
  95. //去除左侧菜单
  96. parent.$("."+controller_name+'_'+action_name+'_'+menu_id).remove();
  97. }
  98. return false;
  99. }
  100. });
  101. }else{ //原本为未添加,添加到我的菜单
  102. $.ajax({
  103. type: "POST",
  104. url: update_admin_menu_url,
  105. data: {title:title,controller_name:controller_name,action_name:action_name,menu_id:menu_id,icon:icon,param:param,target:target,type:1,is_switch:0},
  106. dataType: 'json',
  107. success:function (res) {
  108. if(res.code == 1){
  109. //修改状态
  110. $(_this).addClass('e-jianhao');
  111. //添加左侧菜单
  112. var html = '<a data-child="0" data-id="'+menu_id+ '" class="left_menu_'+menu_id+ ' '+controller_name+'_'+action_name+'_'+menu_id+'" id="'+controller_name+'_'+action_name+'" data-menu_id="' + menu_id + '" href="javascript:void(0);" data-param="'+controller_name+'|'+action_name+param+'" data-target="'+target+'" >'
  113. +'<i class="'+icon+'"></i>'+title+'</a>';
  114. if (parent.$(".left_menu_2004")){
  115. parent.$(".left_menu_2004").before(html);
  116. }else{
  117. parent.$("#sub-menu").append(html);
  118. }
  119. }
  120. return false;
  121. }
  122. });
  123. }
  124. });
  125. });
  126. </script>
  127. {foreach name="list" item="vo" key="k" }
  128. <div class="plug-item-content">
  129. <div class="plug-item-top">
  130. <div class="plug-img">
  131. <a href="{:url('Weapp/execute',array('sm'=>$vo['code'],'sc'=>$vo['code'],'sa'=>'index'))}"><img src="{$vo.config.litpic|get_default_pic=###}?v={$vo.config.version}" ></a>
  132. </div>
  133. <div class="plug-text">
  134. <div class="plug-text-title">
  135. {if condition="empty($vo['config']['management']['href'])"}
  136. <a class="title-l" href="{:url('Weapp/execute',array('sm'=>$vo['code'],'sc'=>$vo['code'],'sa'=>'index'))}">{$vo.name}</a>
  137. {else /}
  138. <a class="title-l" href="{:url('Weapp/execute',array('sm'=>$vo['code'],'sc'=>$vo['code'],'sa'=>'index'))}" target="{$vo['config']['management']['target']|default='_self'}">{$vo.name}</a>
  139. {/if}
  140. {$RenewList[$vo['code']]['maturity_text']|default=''}
  141. {notempty name="$is_founder"}
  142. {if condition="!empty($vo.config.management.href)"}
  143. <div class="icon-link_add">
  144. <div {if condition="in_array('1000'.$vo.id,$menu_id_arr)"}title="取消导航显示" class="iconfont e-jiahao2 e-jianhao"{else /}title="加入导航显示" class="iconfont e-jiahao2"{/if} data-menu_id="1000{$vo.id}" data-name="{$vo.name}" data-param="{$vo.config.management.href|handle_weapp_url=###}" data-target="{$vo.config.management.target|default='workspace'}" ></div>
  145. </div>
  146. {else /}
  147. <div class="icon-link_add">
  148. <div {if condition="in_array('1000'.$vo.id,$menu_id_arr)"}title="取消导航显示" class="iconfont e-jiahao2 e-jianhao"{else /}title="加入导航显示" class="iconfont e-jiahao2"{/if} data-menu_id="1000{$vo.id}" data-name="{$vo.name}" data-param="|sm|{$vo.code}|sc|{$vo.code}|sa|index" data-target="{$vo.config.management.target|default='workspace'}" ></div>
  149. </div>
  150. {/if}
  151. {/notempty}
  152. </div>
  153. <div class="plug-text-versions">
  154. <span>版本:{$vo.config.version|default='未知'}</span>
  155. {assign name="weapp_upgrade_info" value="$weapp_upgrade[$vo['code']]" /}
  156. {eq name="$weapp_upgrade_info['code']" value='2'}
  157. <span>
  158. <textarea id="{$vo.code}_upgrade" class="none">{$weapp_upgrade_info['msg']['upgrade']|default=''}</textarea>
  159. <textarea id="{$vo.code}_intro" class="none">{$weapp_upgrade_info['msg']['intro']|default=''}</textarea>
  160. <textarea id="{$vo.code}_notice" class="none">{$weapp_upgrade_info['msg']['notice']|default=''}</textarea>
  161. <a href="javascript:void(0);" class="a_upgrade red" data-version="{$vo.version}" data-code="{$vo.code}" data-status="{$vo.status|default='0'}" data-name="{$vo.name}" onclick="weapp_upgrade(this);">{$weapp_upgrade_info['msg']['tips']|default='[新版本更新]'}</a>
  162. </span>
  163. {/eq}
  164. </div>
  165. <div class="plug-text-des">
  166. {$vo.config.description|default='暂无描述~'}
  167. </div>
  168. </div>
  169. </div>
  170. <div class="plug-item-bottm">
  171. {empty name="$vo.status"}
  172. {empty name="$vo.is_buy"}
  173. {eq name="'Weapp@install'|is_check_access" value="1"}
  174. <a href="javascript:void(0);" onclick="install(this);" data-id="{$vo['id']}" class="btn blue">安装</a>
  175. {/eq}
  176. {eq name="'Weapp@del'|is_check_access" value="1"}
  177. <a href="javascript:void(0);" data-url="{:url('Weapp/del')}" data-id="{$vo.id}" data-name="{$vo.name}" onClick="delfun(this);">删除</a>
  178. {/eq}
  179. {else /}
  180. {eq name="'Weapp@install'|is_check_access" value="1"}
  181. <a href="javascript:void(0);" onclick="remoteInstall('{$vo['code']}', '{$vo['min_version']}');">安装</a>
  182. {/eq}
  183. {eq name="'Weapp@del_remote'|is_check_access" value="1"}
  184. <a href="javascript:void(0);" data-url="{:url('Weapp/del_remote')}" data-id="{$vo.id}" data-menu_id="1000{$vo.id}" data-name="{$vo.name}" onClick="del_remote(this);">删除</a>
  185. {/eq}
  186. {/empty}
  187. {else /}
  188. {eq name="'Weapp@execute'|is_check_access" value="1"}
  189. {if condition="empty($vo['config']['management']['href'])"}
  190. <a href="{:url('Weapp/execute',array('sm'=>$vo['code'],'sc'=>$vo['code'],'sa'=>'index'))}">管理</a>
  191. {else /}
  192. <a href="{$vo['config']['management']['href']}" target="{$vo['config']['management']['target']|default='_self'}">管理</a>
  193. {/if}
  194. {/eq}
  195. {eq name="'Weapp@uninstall'|is_check_access" value="1"}
  196. <a href="javascript:void(0);" onclick="uninstall(this);" data-id="{$vo['id']}" data-menu_id="1000{$vo.id}" data-name="{$vo.name}">卸载</a>
  197. {/eq}
  198. {/empty}
  199. <div class="plug-status">
  200. {if condition="$vo['status'] eq 1"}
  201. <span style="cursor: pointer;" class="yes" {eq name="'Weapp@disable'|is_check_access" value="1"}onClick="changeTableVal('weapp','id','{$vo.id}','status',this);"{/eq} data-value="-1" data-weapp_code="{$vo.code}" data-yestext="<i class='fa fa-check-circle'></i>已启用" data-notext="<i class='fa fa-ban'></i>已禁用"><i class="fa fa-check-circle"></i>已启用</span>
  202. {else /}
  203. <span style="cursor: pointer;" class="no" {eq name="'Weapp@disable'|is_check_access" value="1"}onClick="changeTableVal('weapp','id','{$vo.id}','status',this);"{/eq} data-value="1" data-weapp_code="{$vo.code}" data-yestext="<i class='fa fa-check-circle'></i>已启用" data-notext="<i class='fa fa-ban'></i>已禁用"><i class="fa fa-ban"></i>已禁用</span>
  204. {/if}
  205. {eq name='$vo.code' value='Diyminipro'}
  206. <script type="text/javascript">
  207. $(function(){
  208. var diymimipro_status = "{$vo['status']}";
  209. if ('1' == diymimipro_status) {
  210. $('#Diyminipro_theme_index', window.parent.document).show();
  211. } else {
  212. $('#Diyminipro_theme_index', window.parent.document).hide();
  213. }
  214. });
  215. </script>
  216. {/eq}
  217. </div>
  218. </div>
  219. </div>
  220. {/foreach}
  221. {/empty}
  222. <div class="flexigrid">
  223. <div class="footer-oper">
  224. <div class="fbuttonr">
  225. <div class="pages">
  226. {$page}
  227. </div>
  228. </div>
  229. <div style="clear:both"></div>
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. <form name="form2" id="form2" method="post" action="">
  236. <input type="hidden" name="id" value="" />
  237. <input type="hidden" name="code" value=""/>
  238. <input type="hidden" name="min_version" value=""/>
  239. <input type="hidden" name="thorough" value="1" />
  240. </form>
  241. <script>
  242. $(document).ready(function(){
  243. // 表格行点击选中切换
  244. $('#flexigrid > table>tbody >tr').click(function(){
  245. $(this).toggleClass('trSelected');
  246. });
  247. // 点击刷新数据
  248. $('.fa-refresh').click(function(){
  249. location.href = location.href;
  250. });
  251. });
  252. function weapp_upgrade(obj)
  253. {
  254. var name = $(obj).attr('data-name');
  255. var status = $(obj).attr('data-status');
  256. if (0 == status) {
  257. layer.alert('请先安装该插件!', {
  258. title:false,//name,
  259. icon: 0
  260. });
  261. return false;
  262. }
  263. var code = $(obj).attr('data-code');
  264. var v = $("#"+code+"_upgrade").val();
  265. var intro = $("#"+code+"_intro").val();
  266. intro += '<style type="text/css">.layui-layer-content{height:270px!important;text-align:left!important;}</style>';
  267. var notice = $("#"+code+"_notice").val();
  268. v = notice + intro + '<br/>' + v;
  269. //询问框
  270. layer.confirm(v, {
  271. shade: layer_shade,
  272. area: ['580px','400px'],
  273. move: false,
  274. title: '新版本更新',
  275. btnAlign:'r',
  276. closeBtn: 3,
  277. btn: ['升级','取消'], //按钮
  278. success: function () {
  279. $(".layui-layer-content").css('text-align', 'left');
  280. }
  281. }, function(){
  282. layer.closeAll();
  283. setTimeout(function(){
  284. upgrade(code); // 请求后台
  285. },200);
  286. }, function(index){
  287. layer.close(index);
  288. });
  289. }
  290. function upgrade(code){
  291. layer_loading('升级中');
  292. $.ajax({
  293. type : "GET",
  294. url : "{:url('Weapp/OneKeyUpgrade')}",
  295. timeout : 360000, //超时时间设置,单位毫秒 设置了 1小时
  296. data : {code:code, _ajax:1},
  297. error: function(request) {
  298. layer.closeAll();
  299. layer.alert("升级失败!", {icon: 5, closeBtn: false, title:false}, function(){
  300. window.location.reload();
  301. });
  302. },
  303. success: function(res) {
  304. if(1 == res.code){
  305. $.ajax({
  306. type : 'GET',
  307. url : eyou_basefile+"?m=admin&c=Weapp&a=execute&sm="+code+"&sc="+code+"&sa=afterUpgrade&lang="+__lang__,
  308. timeout : 360000, //超时时间设置,单位毫秒 设置了 1小时
  309. data : {_ajax:1},
  310. dataType : 'json',
  311. success : function(res){
  312. layer.closeAll();
  313. layer.msg('已升级最新版本!', {time:1000}, function(){
  314. window.location.reload();
  315. });
  316. },
  317. error: function(e) {
  318. layer.closeAll();
  319. layer.msg('已升级最新版本!', {time:1000}, function(){
  320. window.location.reload();
  321. });
  322. }
  323. })
  324. }
  325. else{
  326. layer.closeAll();
  327. layer.alert(res.msg, {icon: 5, closeBtn: false, title:false}, function(){
  328. window.location.reload();
  329. });
  330. }
  331. }
  332. });
  333. }
  334. function install(obj)
  335. {
  336. var id = $(obj).attr('data-id');
  337. var form2 = $('#form2');
  338. form2.find('input[name=id]').val(id);
  339. var url = "{:url('Weapp/install')}";
  340. form2.attr('action', url);
  341. layer_loading('正在处理');
  342. form2.submit();
  343. }
  344. function uninstall(obj)
  345. {
  346. //询问框
  347. var confirm = layer.confirm('数据将不可恢复,是否卸载?', {
  348. shade: layer_shade,
  349. area: ['480px', '190px'],
  350. move: false,
  351. title: '提示',
  352. btnAlign:'r',
  353. closeBtn: 3,
  354. btn: ['确定', '取消'] ,//按钮
  355. success: function () {
  356. $(".layui-layer-content").css('text-align', 'left');
  357. }
  358. }, function(){
  359. layer.close(confirm);
  360. uninstall_true(obj);
  361. }, function(){
  362. layer.close(confirm);
  363. }
  364. );
  365. return false;
  366. }
  367. function uninstall_true(obj)
  368. {
  369. var id = $(obj).attr('data-id');
  370. layer_loading('正在处理');
  371. // 确定
  372. $.ajax({
  373. type : 'post',
  374. url : "{:url('Weapp/uninstall')}",
  375. data : {id:id, thorough:0, _ajax:1},
  376. dataType : 'json',
  377. success : function(res){
  378. layer.closeAll();
  379. if(res.code == 1){
  380. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  381. var menu_id = $(obj).attr('data-menu_id');
  382. $(".Weapp_execute_" + menu_id, window.parent.document).remove();
  383. window.location.reload();
  384. });
  385. }else{
  386. layer.alert(res.msg, {icon: 5, title:false});
  387. }
  388. },
  389. error: function(e) {
  390. layer.closeAll();
  391. // 处理插件行为app_end影响到的卸载问题
  392. if (e.responseText.indexOf("\\behavior\\admin\\") >= 0 && e.responseText.indexOf("not found") >= 0) {
  393. layer.msg('卸载成功', {icon: 1, time: 1000}, function(){
  394. window.location.reload();
  395. });
  396. } else {
  397. layer.alert(e.responseText, {icon: 5, title:false});
  398. }
  399. }
  400. });
  401. }
  402. function delfun(obj){
  403. var name = $(obj).attr('data-name');
  404. layer.confirm('确认删除?', {
  405. area: ['480px', '190px'],
  406. shade: layer_shade,
  407. move: false,
  408. title: '提示',
  409. btnAlign:'r',
  410. closeBtn: 3,
  411. btn: ['确定','取消'] ,//按钮
  412. success: function () {
  413. $(".layui-layer-content").css('text-align', 'left');
  414. }
  415. }, function(){
  416. layer_loading('正在处理');
  417. // 确定
  418. $.ajax({
  419. type : 'post',
  420. url : $(obj).attr('data-url'),
  421. data : {del_id:$(obj).attr('data-id'), _ajax:1},
  422. dataType : 'json',
  423. success : function(res){
  424. layer.closeAll();
  425. if(res.code == 1){
  426. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  427. var menu_id = $(obj).attr('data-menu_id');
  428. $(".Weapp_execute_" + menu_id, window.parent.document).remove();
  429. window.location.reload();
  430. });
  431. }else{
  432. layer.alert(res.msg, {icon: 5, title:false}); //alert(res);
  433. }
  434. }
  435. })
  436. }, function(index){
  437. layer.close(index);
  438. });
  439. return false;
  440. }
  441. function del_remote(obj){
  442. var name = $(obj).attr('data-name');
  443. layer.confirm('确认移除?', {
  444. area: ['480px', '190px'],
  445. shade: layer_shade,
  446. move: false,
  447. title: '提示',
  448. btnAlign:'r',
  449. closeBtn: 3,
  450. btn: ['确定','取消'] ,//按钮
  451. success: function () {
  452. $(".layui-layer-content").css('text-align', 'left');
  453. }
  454. }, function(){
  455. layer_loading('正在处理');
  456. // 确定
  457. $.ajax({
  458. type : 'post',
  459. url : $(obj).attr('data-url'),
  460. data : {del_id:$(obj).attr('data-id'), _ajax:1},
  461. dataType : 'json',
  462. success : function(data){
  463. layer.closeAll();
  464. if(data.code == 1){
  465. layer.msg(data.msg, {icon: 1});
  466. window.location.reload();
  467. }else{
  468. layer.alert(data.msg, {icon: 5, title:false}); //alert(data);
  469. }
  470. }
  471. })
  472. }, function(index){
  473. layer.close(index);
  474. });
  475. return false;
  476. }
  477. function jump() {
  478. location.reload()
  479. }
  480. function remoteInstall(code, min_version) {
  481. var form2 = $('#form2');
  482. form2.find('input[name=code]').val(code);
  483. form2.find('input[name=min_version]').val(min_version);
  484. var url = "{:url('Weapp/remoteInstall')}";
  485. form2.attr('action', url);
  486. layer_loading('远程安装');
  487. form2.submit();
  488. }
  489. </script>
  490. {include file="public/footer" /}