Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

htmlfilename_handel.htm 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css?v={$version}">
  6. <script type="text/javascript">
  7. var eyou_basefile = "{$Request.baseFile}";
  8. var __root_dir__ = "__ROOT_DIR__";
  9. var __lang__ = "{$admin_lang}";
  10. </script>
  11. <script type="text/javascript" src="__SKIN__/js/jquery.js?v={$version}"></script>
  12. <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js?v={$version}"></script>
  13. </head>
  14. <style>
  15. .gray-bg {
  16. background-color: #f3f3f4;
  17. }
  18. .wrapper-content {
  19. padding: 20px;
  20. }
  21. .ibox {
  22. clear: both;
  23. margin-bottom: 25px;
  24. margin-top: 0;
  25. padding: 0;
  26. }
  27. .ibox-content {
  28. clear: both;
  29. background-color: #ffffff;
  30. color: inherit;
  31. padding: 15px 20px 20px 20px;
  32. border-color: #e7eaec;
  33. -webkit-border-image: none;
  34. -o-border-image: none;
  35. border-image: none;
  36. border-style: solid solid none;
  37. border-width: 1px 0px;
  38. }
  39. .progress {
  40. height: 20px;
  41. margin-bottom: 20px;
  42. overflow: hidden;
  43. background-color: #f5f5f5;
  44. border-radius: 4px;
  45. -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  46. box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  47. }
  48. .progress-bar{
  49. height: 100%;
  50. }
  51. .progress-bar-success {
  52. background-color: #1c84c6;
  53. }
  54. .ncap-btn-green {
  55. margin: 20px auto 0;
  56. width: 100px;
  57. height: 36px;
  58. line-height: 36px;
  59. background-color: #4fc0e8;
  60. border:1px solid #3aa8cf;
  61. text-align: center;
  62. vertical-align: middle;
  63. display: block;
  64. padding: 0px 9px;
  65. border-radius: 3px;
  66. cursor: pointer;
  67. color: #fff;
  68. font-size: 13px;
  69. }
  70. a.ncap-btn-green:hover{
  71. background-color:#3ab0da;
  72. color: #fff;
  73. text-decoration: none;
  74. }
  75. </style>
  76. <body class="gray-bg">
  77. <div class="ibox float-e-margins">
  78. <div class="ibox-content">
  79. <div class="progress progress-striped active">
  80. <div class="progress-bar progress-bar-success" role="progressbar"
  81. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:0%">
  82. </div>
  83. </div>
  84. <div style="text-align:center" class="success">
  85. <div class="finash" style="">
  86. <span><font id="title">正在更新</font><span class="filepath"></span>,</span>
  87. 已完成<span class="percent" style="color:#ff0000 ;font-size:14px;">0</span>%
  88. </div>
  89. </div>
  90. </div>
  91. <a href="javascript:void(0);" id="a_close_pop" onclick="closeWindow();" class="ncap-btn-green" style="display: none;">关闭本窗口</a>
  92. <div class="ibox-content" id="error_msg" style="display: none">
  93. </div>
  94. </div>
  95. <script type="text/javascript">
  96. $('#a_close_pop').hide();
  97. var foreign_htmlfilename_mode = {$foreign_htmlfilename_mode|default=0};
  98. var achieve = 0; // 已完成文档数
  99. var allpagetotal = 0;
  100. var msg = "";
  101. var timestamp1 = Date.parse(new Date());
  102. function send(){
  103. $.ajax({
  104. url:"{:url('Foreign/htmlfilename_handel')}",
  105. type:'POST',
  106. dataType:'json',
  107. data:{foreign_htmlfilename_mode:foreign_htmlfilename_mode, achieve:achieve, _ajax:1},
  108. beforeSend:function(){
  109. },
  110. success:function(res){
  111. if (res.code ==0) {
  112. parent.layer.alert(res.msg, {icon: 5, title:false});
  113. return false;
  114. }
  115. achieve = res.data.achievepage;
  116. allpagetotal = res.data.allpagetotal;
  117. msg += res.msg;
  118. progress = ((achieve/allpagetotal)*100).toFixed(1);
  119. $('#title').html('更新文档数:');
  120. $(".filepath").html(achieve);
  121. $(".progress-bar").css('width',progress+'%');
  122. $(".percent").text(progress);
  123. if (achieve === allpagetotal){
  124. clear_cache_htmlfilename();
  125. var timestamp2 = Date.parse(new Date());
  126. var timestamp3 = (timestamp2 - timestamp1) / 1000;
  127. if (timestamp3 < 1) timestamp3 = 1;
  128. $(".finash").remove();
  129. $(".progress-bar").css('width','100%');
  130. $(".progress").removeClass('progress-striped ').removeClass('active');
  131. $(".success").html("已完成更新,共耗时:<font color='red'>"+timestamp3+"</font> 秒");
  132. $('#a_close_pop').show();
  133. if (msg !== ""){
  134. $("#error_msg").show();
  135. $("#error_msg").prepend(msg);
  136. }
  137. return false;
  138. }
  139. send();
  140. },
  141. error:function(e){
  142. parent.layer.alert(e.responseText, {icon: 5, title:false});
  143. }
  144. });
  145. }
  146. send();
  147. // 清除缓存
  148. function clear_cache_htmlfilename()
  149. {
  150. $.ajax({
  151. url : "{:url('Foreign/clear_cache_htmlfilename')}",
  152. type: 'post',
  153. dataType: 'JSON',
  154. data: {_ajax:1},
  155. success: function(res){
  156. }
  157. });
  158. }
  159. function closeWindow()
  160. {
  161. parent.layer.closeAll();
  162. parent.location.reload();
  163. }
  164. </script>
  165. </body>
  166. </html>