article.htm 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 __root_dir__ = "__ROOT_DIR__";
  8. var __lang__ = "{$admin_lang}";
  9. </script>
  10. <script type="text/javascript" src="__SKIN__/js/jquery.js"></script>
  11. <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js"></script>
  12. </head>
  13. <style>
  14. .gray-bg {
  15. background-color: #f3f3f4;
  16. }
  17. .wrapper-content {
  18. padding: 20px;
  19. }
  20. .ibox {
  21. clear: both;
  22. margin-bottom: 25px;
  23. margin-top: 0;
  24. padding: 0;
  25. }
  26. .ibox-content {
  27. clear: both;
  28. background-color: #ffffff;
  29. color: inherit;
  30. padding: 15px 20px 20px 20px;
  31. border-color: #e7eaec;
  32. -webkit-border-image: none;
  33. -o-border-image: none;
  34. border-image: none;
  35. border-style: solid solid none;
  36. border-width: 1px 0px;
  37. }
  38. .progress {
  39. height: 20px;
  40. margin-bottom: 20px;
  41. overflow: hidden;
  42. background-color: #f5f5f5;
  43. border-radius: 4px;
  44. -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  45. box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  46. }
  47. .progress-bar{
  48. height: 100%;
  49. }
  50. .progress-bar-success {
  51. background-color: #1c84c6;
  52. }
  53. .ncap-btn-green {
  54. margin: 20px auto 0;
  55. width: 100px;
  56. height: 36px;
  57. line-height: 36px;
  58. background-color: #4fc0e8;
  59. border:1px solid #3aa8cf;
  60. text-align: center;
  61. vertical-align: middle;
  62. display: block;
  63. padding: 0px 9px;
  64. border-radius: 3px;
  65. cursor: pointer;
  66. color: #fff;
  67. font-size: 13px;
  68. }
  69. a.ncap-btn-green:hover{
  70. background-color:#3ab0da;
  71. color: #fff;
  72. text-decoration: none;
  73. }
  74. </style>
  75. <body class="gray-bg">
  76. <div class="ibox float-e-margins">
  77. <div class="ibox-content">
  78. <div class="progress progress-striped active">
  79. <div class="progress-bar progress-bar-success" role="progressbar"
  80. aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:0%">
  81. </div>
  82. </div>
  83. <div style="text-align:center" class="success">
  84. <div class="finash" style="">
  85. <span><font id="title">正在生成</font><span class="filepath"></span>,</span>
  86. 已完成<span class="percent" style="color:#ff0000 ;font-size:14px;">0</span>%
  87. </div>
  88. </div>
  89. </div>
  90. <a href="javascript:void(0);" id="a_close_pop" onclick="parent.layer.closeAll();" class="ncap-btn-green" style="display: none;">关闭本窗口</a>
  91. <div class="ibox-content" id="error_msg" style="display: none">
  92. </div>
  93. </div>
  94. <script type="text/javascript">
  95. $('#a_close_pop').hide();
  96. var typeid = "{$typeid}";
  97. var fid = 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:__root_dir__+"/index.php?m=home&c=Buildhtml&a=buildArticle&lang="+__lang__,
  105. type:'POST',
  106. dataType:'json',
  107. data:{'id':typeid,'fid':fid,'achieve':achieve,_ajax:1},
  108. beforeSend:function(){
  109. },
  110. success:function(res){
  111. fid = res.data.fid;
  112. achieve = res.data.achievepage;
  113. allpagetotal = res.data.allpagetotal;
  114. msg += res.msg;
  115. progress = ((achieve/allpagetotal)*100).toFixed(1);
  116. $('#title').html('成功创建文档数:');
  117. $(".filepath").html(fid);
  118. $(".progress-bar").css('width',progress+'%');
  119. $(".percent").text(progress);
  120. if (achieve === allpagetotal){
  121. var timestamp2 = Date.parse(new Date());
  122. var timestamp3 = (timestamp2 - timestamp1) / 1000;
  123. if (timestamp3 < 1) timestamp3 = 1;
  124. $(".finash").remove();
  125. $(".progress-bar").css('width','100%');
  126. $(".progress").removeClass('progress-striped ').removeClass('active');
  127. $(".success").html("生成文档完成,共耗时:<font color='red'>"+timestamp3+"</font> 秒");
  128. $('#a_close_pop').show();
  129. if (msg !== ""){
  130. $("#error_msg").show();
  131. $("#error_msg").prepend(msg);
  132. }
  133. return false;
  134. }
  135. send();
  136. },
  137. error:function(){
  138. parent.layer.alert('未知错误,文档页生成失败~', {icon: 5, title:false});
  139. }
  140. });
  141. }
  142. send();
  143. </script>
  144. </body>
  145. </html>