image-check.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>云阅卷本地代理工具</title>
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
  8. <link rel="stylesheet" href="css/style.css">
  9. </head>
  10. <body>
  11. <div class="wp">
  12. <div class="hd">
  13. <div class="logo"><img src="img/logo.png" /></div>
  14. <span class="y"> 欢迎您,<span id="user-name"></span>
  15. <span class="pipe">|</span><a href="##">退出</a>
  16. </span>
  17. </div>
  18. <div class="cont">
  19. <div class="title title_grey cl">
  20. <h2>图片检查中 …</h2>
  21. </div>
  22. <div class="progress-box">
  23. <h3>正在检查图片,请耐心等候 ~</h3>
  24. <div class="progress">
  25. <div class="progress-outer">
  26. <div id="progress" class="progress-inner" style="width: 0%;"><span class="progress-text"></span>
  27. </div>
  28. </div>
  29. </div>
  30. <p>已检查人数:<b id="finish-count"></b> / 全部人数:<b id="total-count"></b></p>
  31. </div>
  32. </div>
  33. <div class="xcConfirm" id="popup" style="display: none">
  34. <div class="xc_layer"></div>
  35. <div class="popbox">
  36. <a href="##" id="popup-close"><span class="close"></span></a>
  37. <div class="txtbox">
  38. <div id="popup-error" class="icon error" style="display: none"></div>
  39. <div id="popup-success" class="icon success" style="display: none"></div>
  40. <div id="popup-text" class="text"></div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
  45. </div>
  46. <script>
  47. const $ = require('jquery')
  48. const env = require('../lib/env.js')
  49. const imageUtil = require('../lib/image.js')()
  50. $(document).ready(() => {
  51. env.merge(JSON.parse(window.localStorage.getItem('env')))
  52. $('#user-name').html(env.user.userName)
  53. let config = JSON.parse(window.localStorage.getItem('check-config'))
  54. let totalCount;
  55. imageUtil.on('total', (count) => {
  56. totalCount = count
  57. $('#total-count').html(count)
  58. })
  59. imageUtil.on('count', (count) => {
  60. $('#finish-count').html(count)
  61. let rate = parseInt(count * 100 / totalCount)
  62. $('#progress').css('width', rate + '%')
  63. $('.progress-text').html(rate + '%')
  64. })
  65. imageUtil.on('finish', () => {
  66. $('#popup-success').show()
  67. $('#popup-text').html('图片检查完成')
  68. $('#popup-close').click(() => {
  69. $('#popup').hide()
  70. window.location.href = 'check.html'
  71. })
  72. $('#popup').show()
  73. })
  74. imageUtil.on('error', (err) => {
  75. $('#popup-error').show()
  76. $('#popup-text').html('图片检查出错\n' + (err || ''))
  77. $('#popup-close').click(() => {
  78. $('#popup').hide()
  79. window.location.href = 'check.html'
  80. })
  81. $('#popup').show()
  82. })
  83. if (config.concurrent == 1) {
  84. imageUtil.checkSliceSerial(config.dir)
  85. } else {
  86. imageUtil.checkSlice(config.dir, config.concurrent)
  87. }
  88. })
  89. </script>
  90. </body>
  91. </html>