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.

bom_index.htm 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {include file="header.htm" /}
  2. <body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;min-width: auto;">
  3. <style>
  4. body{margin:0px;}
  5. body,th,td{font: 13px Arial,Tahoma;line-height: 16px;}
  6. .alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#fff;padding:10px 10px 10px 5px;border-right: 1px solid #ddd;}
  7. .alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#fff;padding:10px 10px 10px 5px;border-right: 1px solid #ddd;vertical-align: middle;}
  8. .focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#F4FCFA;padding:10px 10px 10px 5px;border-right: 1px solid #ddd;}
  9. .head th{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#e9e9e9;padding:10px 10px 10px 5px;font-weight:bold;}
  10. .head th span{font-weight:normal;}
  11. </style>
  12. <div id="append_parent"></div>
  13. <div id="ajaxwaitid"></div>
  14. <div class="page">
  15. <div class="flexigrid">
  16. <!-- 操作说明 -->
  17. <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%; margin-bottom: 10px;">
  18. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  19. <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
  20. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  21. </div>
  22. <ul>
  23. <li>BOM只有在WINDOWS下采用“记事本”存储为UTF-8时才会有。</li>
  24. <li>在UTF-8编码文件中BOM在文件头部,占用三个字节,以暗码的形式存在,用来标示该文件属于UTF-8编码。</li>
  25. <li>现在已经有很多软件识别BOM头,但是还有些不能识别BOM头,例如PHP就不能识别BOM头,这也是用记事本编辑UTF-8编码后执行就会出错的原因了。</li>
  26. </ul>
  27. </div>
  28. <div class="mDiv pt0" style="min-height: 22px;">
  29. <div class="ftitle">
  30. <div class="fbutton">
  31. <a href="javascript:void(0);" onclick="scan();">
  32. <div class="add" title="开始扫描">
  33. <span>开始扫描</span>
  34. </div>
  35. </a>
  36. </div>
  37. <div class="fbutton">
  38. <a href="javascript:void(0);" data-href="{:weapp_url('Systemdoctor/Systemdoctor/bom_conf')}" onclick="openFullframe(this, '功能配置', '510px', '250px');">
  39. <div class="adds" title="功能配置">
  40. <span>功能配置</span>
  41. </div>
  42. </a>
  43. </div>
  44. </div>
  45. <div class="sDiv" style="padding-top: 8px;">
  46. 处理方式:
  47. <div class="sDiv2" style="font-size: 13px;border:0px; margin-right: 5px;">
  48. <label><input type="checkbox" name="is_autoclear" value="1" {notempty name="$conf_data.is_autoclear"} checked="checked" {/notempty}>&nbsp;自动清除</label>
  49. </div>
  50. </div>
  51. </div>
  52. <div style="margin:0px auto;border: 1px solid #ccc;">
  53. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  54. <tbody>
  55. <tr>
  56. <th style="vertical-align:middle; padding-left:5px; padding-top: 10px;">模板存放路径:
  57. {$tpl_theme}
  58. <input type="hidden" name="path" id="path" value="{$tpl_theme}">
  59. </th>
  60. </tr>
  61. </tbody>
  62. </table>
  63. <br>
  64. <div id="div_scanlist" style="display: ;">
  65. <div style="padding:10px; background-color:#F4F4F4">
  66. 扫描:<span id="span_scanned">0</span>&nbsp;文件&nbsp;&nbsp;
  67. |&nbsp;&nbsp;耗时:<span id="span_spent">0</span>&nbsp;&nbsp;
  68. {empty name="$conf_data.is_autoclear"}
  69. |&nbsp;&nbsp;请管理员手工清理以下带bom头部信息的文件
  70. {/empty}
  71. </div>
  72. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  73. <thead>
  74. <tr class="head">
  75. <th width="30" style="text-align: center;">No.</th>
  76. <th>带bom头部信息文件</th>
  77. <th width="300">检测结果</th>
  78. <th width="80">操作</th>
  79. </tr>
  80. </thead>
  81. <tbody id="tr_scan_html">
  82. <tr>
  83. <td class="no-data" style="width: auto !important;" align="center" axis="col0" colspan="5">
  84. <i class="fa fa-exclamation-circle"></i>请点击<a href="javascript:void(0);" onclick="scan();">开始扫描</a>
  85. </td>
  86. </tr>
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script>
  94. function scan()
  95. {
  96. var timer = '';
  97. var loading = layer.msg(
  98. '<span id="progress_speed">准备扫描</span>...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请勿刷新页面',
  99. {
  100. time: 3600000, //1小时后后自动关闭
  101. shade: [0.2] //0.1透明度的白色背景
  102. });
  103. //loading层
  104. var index = layer.load(2, {
  105. shade: [0.1,'#fff'] //0.1透明度的白色背景
  106. });
  107. var is_autoclear = $('input[name=is_autoclear]:checked').val();
  108. $.ajax({
  109. type: "POST",
  110. url: "{:weapp_url('Systemdoctor/Systemdoctor/bom_scan')}",
  111. data: {is_autoclear:is_autoclear, _ajax:1},
  112. dataType: 'json',
  113. beforeSend: function(xhr) {
  114. var html = '';
  115. html += '<tr>';
  116. html += ' <td class="no-data" style="width: auto !important;" align="center" axis="col0" colspan="5">';
  117. html += ' <i class="fa fa-exclamation-circle"></i>正在扫描中';
  118. html += ' </td>';
  119. html += '</tr>';
  120. $('#tr_scan_html').html(html);
  121. $('#div_scanlist').show();
  122. progressd(0);
  123. },
  124. success: function (res) {
  125. if(res.code == 1){
  126. $('#progress_speed').html('已扫描<font id="progress_num">100</font>%');
  127. setTimeout(function(){
  128. layer.closeAll();
  129. $('#span_scanned').html(res.data.scanned);
  130. $('#span_count').html(res.data.num_ky);
  131. $('#span_spent').html(res.data.spent);
  132. $('#tr_scan_html').html(res.data.html);
  133. showErrorAlert(res.msg, 6);
  134. },1000);
  135. }else{
  136. layer.closeAll();
  137. showErrorAlert(res.msg);
  138. }
  139. },
  140. error:function(e){
  141. layer.closeAll();
  142. showErrorAlert(e.responseText);
  143. }
  144. });
  145. }
  146. function progressd(init)
  147. {
  148. $.ajax({
  149. type: "POST",
  150. url: "{:weapp_url('Systemdoctor/Systemdoctor/bom_progressd')}",
  151. data: {init:init, _ajax:1},
  152. dataType: 'json',
  153. success: function (res) {
  154. if(res.code == 1){
  155. if (res.data.progress > 0) {
  156. $('#span_scanned').html(res.data.file_num);
  157. $('#span_count').html(res.data.file_num_ky);
  158. $('#span_spent').html('计时中');
  159. $('#tr_scan_html').html(res.data.html);
  160. $('#div_scanlist').show();
  161. var progress_num = $('#progress_num').val();
  162. if (res.data.progress > progress_num || progress_num == undefined) {
  163. $('#progress_speed').html('已扫描<font id="progress_num">' + res.data.progress + '</font>%');
  164. }
  165. }
  166. console.log(res.data.progress)
  167. if (100 > res.data.progress) {
  168. progressd(1);
  169. }
  170. }
  171. }
  172. });
  173. }
  174. function bom_clear(obj)
  175. {
  176. layer.confirm('确认要处理吗?', {
  177. shade: layer_shade,
  178. area: ['480px', '190px'],
  179. move: false,
  180. title: '提示',
  181. btnAlign:'r',
  182. closeBtn: 3,
  183. btn: ['确定', '取消'], //按钮
  184. success: function () {
  185. $(".layui-layer-content").css('text-align', 'left');
  186. }
  187. }, function(){
  188. // 确定
  189. layer_loading('正在处理');
  190. var md5key = $(obj).attr('data-md5key');
  191. $.ajax({
  192. type : 'POST',
  193. url : "{:weapp_url('Systemdoctor/Systemdoctor/bom_clear')}",
  194. data : {md5key:md5key, _ajax:1},
  195. dataType : 'json',
  196. success : function(res){
  197. layer.closeAll();
  198. if(res.code == 1){
  199. $('#msg_'+md5key).html("发现bom头部信息");
  200. $('#act_'+md5key).html("<a href='javascript:void(0);' data-md5key='"+md5key+"'>已清理</a>");
  201. // $('#tr_scan_html').find('a[data-md5key='+md5key+']').each(function(index, item){
  202. // $(item).parent().parent().remove();
  203. // });
  204. // if ($('#tr_scan_html tr').length == 0) {
  205. // var html = '';
  206. // html += '<tr>';
  207. // html += ' <td class="no-data" style="width: auto !important;" align="center" axis="col0" colspan="5">';
  208. // html += ' <i class="fa fa-exclamation-circle"></i>没有发现bom头部信息';
  209. // html += ' </td>';
  210. // html += '</tr>';
  211. // $('#tr_scan_html').html(html);
  212. // }
  213. layer.msg(res.msg, {icon: 1, time: 500});
  214. }else{
  215. showErrorAlert(res.msg);
  216. }
  217. },
  218. error:function(e){
  219. layer.closeAll();
  220. showErrorAlert(e.responseText);
  221. }
  222. })
  223. }, function(index){
  224. layer.close(index);
  225. return false;// 取消
  226. }
  227. );
  228. }
  229. </script>
  230. {include file="footer.htm" /}