Michael Wang 3 years ago
parent
commit
54da76280e
62 changed files with 0 additions and 943 deletions
  1. 0 0
      src/features/ExamList/ExamList.vue
  2. 0 0
      src/features/ExamList/img/logo.png
  3. 0 0
      src/features/ExamList/img/logo_blue.png
  4. 0 0
      src/features/Home/Home.vue
  5. 0 0
      src/features/Home/img/back.png
  6. 0 0
      src/features/Home/img/bg.jpg
  7. 0 0
      src/features/Home/img/close.png
  8. 0 0
      src/features/Home/img/data_btn.png
  9. 0 0
      src/features/Home/img/enter.png
  10. 0 0
      src/features/Home/img/error.png
  11. 0 0
      src/features/Home/img/error_small.png
  12. 0 0
      src/features/Home/img/icon1.png
  13. 0 0
      src/features/Home/img/icon2.png
  14. 0 0
      src/features/Home/img/icon3.png
  15. 0 0
      src/features/Home/img/id.png
  16. 0 0
      src/features/Home/img/logo.png
  17. 0 0
      src/features/Home/img/logo_blue.png
  18. 0 0
      src/features/Home/img/pic_btn.png
  19. 0 0
      src/features/Home/img/radio.png
  20. 0 0
      src/features/Home/img/select.png
  21. 0 0
      src/features/Home/img/success.png
  22. 0 0
      src/features/Home/img/success_small.png
  23. 0 0
      src/features/Image/Image.vue
  24. 0 0
      src/features/Image/img/logo.png
  25. 0 0
      src/features/Image/img/logo_blue.png
  26. 0 0
      src/features/ImageDownload/ImageDownload.vue
  27. 0 0
      src/features/ImageDownload/img/logo.png
  28. 0 0
      src/features/ImageDownload/img/logo_blue.png
  29. 0 0
      src/features/Login/Login.vue
  30. 0 0
      src/features/Login/img/back.png
  31. 0 0
      src/features/Login/img/bg.jpg
  32. 0 0
      src/features/Login/img/close.png
  33. 0 0
      src/features/Login/img/data_btn.png
  34. 0 0
      src/features/Login/img/enter.png
  35. 0 0
      src/features/Login/img/error.png
  36. 0 0
      src/features/Login/img/error_small.png
  37. 0 0
      src/features/Login/img/icon1.png
  38. 0 0
      src/features/Login/img/icon2.png
  39. 0 0
      src/features/Login/img/icon3.png
  40. 0 0
      src/features/Login/img/id.png
  41. 0 0
      src/features/Login/img/logo.png
  42. 0 0
      src/features/Login/img/logo_blue.png
  43. 0 0
      src/features/Login/img/pic_btn.png
  44. 0 0
      src/features/Login/img/radio.png
  45. 0 0
      src/features/Login/img/select.png
  46. 0 0
      src/features/Login/img/success.png
  47. 0 0
      src/features/Login/img/success_small.png
  48. 0 0
      src/features/Sync/Sync.vue
  49. 0 0
      src/features/Sync/img/logo.png
  50. 0 0
      src/features/Sync/img/logo_blue.png
  51. 0 0
      src/features/SyncRun/SyncRun.vue
  52. 0 0
      src/features/SyncRun/img/logo.png
  53. 0 0
      src/features/SyncRun/img/logo_blue.png
  54. 0 96
      src/view/check.html
  55. 0 138
      src/view/exam-list.html
  56. 0 97
      src/view/image-check.html
  57. 0 104
      src/view/image-download.html
  58. 0 206
      src/view/image.html
  59. 0 53
      src/view/index.html
  60. 0 91
      src/view/login.html
  61. 0 101
      src/view/sync-run.html
  62. 0 57
      src/view/sync.html

+ 0 - 0
src/views/features/ExamList/ExamList.vue → src/features/ExamList/ExamList.vue


+ 0 - 0
src/views/features/ExamList/img/logo.png → src/features/ExamList/img/logo.png


+ 0 - 0
src/views/features/ExamList/img/logo_blue.png → src/features/ExamList/img/logo_blue.png


+ 0 - 0
src/views/features/Home/Home.vue → src/features/Home/Home.vue


+ 0 - 0
src/views/features/Home/img/back.png → src/features/Home/img/back.png


+ 0 - 0
src/views/features/Home/img/bg.jpg → src/features/Home/img/bg.jpg


+ 0 - 0
src/views/features/Home/img/close.png → src/features/Home/img/close.png


+ 0 - 0
src/views/features/Home/img/data_btn.png → src/features/Home/img/data_btn.png


+ 0 - 0
src/views/features/Home/img/enter.png → src/features/Home/img/enter.png


+ 0 - 0
src/views/features/Home/img/error.png → src/features/Home/img/error.png


+ 0 - 0
src/views/features/Home/img/error_small.png → src/features/Home/img/error_small.png


+ 0 - 0
src/views/features/Home/img/icon1.png → src/features/Home/img/icon1.png


+ 0 - 0
src/views/features/Home/img/icon2.png → src/features/Home/img/icon2.png


+ 0 - 0
src/views/features/Home/img/icon3.png → src/features/Home/img/icon3.png


+ 0 - 0
src/views/features/Home/img/id.png → src/features/Home/img/id.png


+ 0 - 0
src/views/features/Home/img/logo.png → src/features/Home/img/logo.png


+ 0 - 0
src/views/features/Home/img/logo_blue.png → src/features/Home/img/logo_blue.png


+ 0 - 0
src/views/features/Home/img/pic_btn.png → src/features/Home/img/pic_btn.png


+ 0 - 0
src/views/features/Home/img/radio.png → src/features/Home/img/radio.png


+ 0 - 0
src/views/features/Home/img/select.png → src/features/Home/img/select.png


+ 0 - 0
src/views/features/Home/img/success.png → src/features/Home/img/success.png


+ 0 - 0
src/views/features/Home/img/success_small.png → src/features/Home/img/success_small.png


+ 0 - 0
src/views/features/Image/Image.vue → src/features/Image/Image.vue


+ 0 - 0
src/views/features/Image/img/logo.png → src/features/Image/img/logo.png


+ 0 - 0
src/views/features/Image/img/logo_blue.png → src/features/Image/img/logo_blue.png


+ 0 - 0
src/views/features/ImageDownload/ImageDownload.vue → src/features/ImageDownload/ImageDownload.vue


+ 0 - 0
src/views/features/ImageDownload/img/logo.png → src/features/ImageDownload/img/logo.png


+ 0 - 0
src/views/features/ImageDownload/img/logo_blue.png → src/features/ImageDownload/img/logo_blue.png


+ 0 - 0
src/views/features/Login/Login.vue → src/features/Login/Login.vue


+ 0 - 0
src/views/features/Login/img/back.png → src/features/Login/img/back.png


+ 0 - 0
src/views/features/Login/img/bg.jpg → src/features/Login/img/bg.jpg


+ 0 - 0
src/views/features/Login/img/close.png → src/features/Login/img/close.png


+ 0 - 0
src/views/features/Login/img/data_btn.png → src/features/Login/img/data_btn.png


+ 0 - 0
src/views/features/Login/img/enter.png → src/features/Login/img/enter.png


+ 0 - 0
src/views/features/Login/img/error.png → src/features/Login/img/error.png


+ 0 - 0
src/views/features/Login/img/error_small.png → src/features/Login/img/error_small.png


+ 0 - 0
src/views/features/Login/img/icon1.png → src/features/Login/img/icon1.png


+ 0 - 0
src/views/features/Login/img/icon2.png → src/features/Login/img/icon2.png


+ 0 - 0
src/views/features/Login/img/icon3.png → src/features/Login/img/icon3.png


+ 0 - 0
src/views/features/Login/img/id.png → src/features/Login/img/id.png


+ 0 - 0
src/views/features/Login/img/logo.png → src/features/Login/img/logo.png


+ 0 - 0
src/views/features/Login/img/logo_blue.png → src/features/Login/img/logo_blue.png


+ 0 - 0
src/views/features/Login/img/pic_btn.png → src/features/Login/img/pic_btn.png


+ 0 - 0
src/views/features/Login/img/radio.png → src/features/Login/img/radio.png


+ 0 - 0
src/views/features/Login/img/select.png → src/features/Login/img/select.png


+ 0 - 0
src/views/features/Login/img/success.png → src/features/Login/img/success.png


+ 0 - 0
src/views/features/Login/img/success_small.png → src/features/Login/img/success_small.png


+ 0 - 0
src/views/features/Sync/Sync.vue → src/features/Sync/Sync.vue


+ 0 - 0
src/views/features/Sync/img/logo.png → src/features/Sync/img/logo.png


+ 0 - 0
src/views/features/Sync/img/logo_blue.png → src/features/Sync/img/logo_blue.png


+ 0 - 0
src/views/features/SyncRun/SyncRun.vue → src/features/SyncRun/SyncRun.vue


+ 0 - 0
src/views/features/SyncRun/img/logo.png → src/features/SyncRun/img/logo.png


+ 0 - 0
src/views/features/SyncRun/img/logo_blue.png → src/features/SyncRun/img/logo_blue.png


+ 0 - 96
src/view/check.html

@@ -1,96 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="login.html">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title cl">
-                <span class="y"><a href="index.html">返回考试主页</a></span>
-                <h2>图片检查</h2>
-            </div>
-            <div class="picture cl">
-                <table cellpadding="0" cellspacing="0" width="100%">
-                    <tr>
-                        <th>结果保存目录:</th>
-                        <td>
-                            <input id="path-text" type="text" style="width: 400px" class="filetext" />
-                            <a href="##" id="path-select" class="filebtn">选择</a>
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>并发数:</th>
-                        <td><input id="concurrent-input" type="text" style="width: 100px" value="1" /></td>
-                    </tr>
-                    <tr id="message-tr" style="display: none">
-                        <th></th>
-                        <td>
-                            <p class="error-tetx" id="message-text"></p>
-                        </td>
-                    </tr>
-                    <tr>
-                        <th></th>
-                        <td><a id="run-button" href="##" class="start-btn"><span>开始检查</span></a></td>
-                    </tr>
-                </table>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const config = require('../lib/config.js')
-        const {
-            dialog
-        } = require('electron').remote
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            $('#path-select').click(() => {
-                dialog.showOpenDialog({
-                    title: '请选择保存目录',
-                    properties: ['openDirectory']
-                }, filePaths => {
-                    $('#path-text').val(filePaths[0])
-                })
-            })
-
-            $('#run-button').click(() => {
-                let dir = $('#path-text').val()
-                let concurrent = $('#concurrent-input').val()
-                if (dir == undefined || dir == '') {
-                    alert('请选择保存目录')
-                    return false
-                }
-                if (concurrent == undefined || concurrent == '') {
-                    alert('请填写并发数')
-                    return false
-                }
-                window.localStorage.setItem('check-config', JSON.stringify({
-                    dir: dir.trim(),
-                    concurrent: parseInt(concurrent)
-                }))
-                window.location.href = 'image-check.html'
-            })
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 138
src/view/exam-list.html

@@ -1,138 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="login.html">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title cl" style="background:#FFF;">
-                <span class="y">共有<b id="total-count">0</b>场考试,请选择</span>
-                <h2>考试列表</h2>
-            </div>
-            <table cellpadding="0" cellspacing="0" width="100%" class="tablelist">
-                <thead>
-                    <th>ID</th>
-                    <th>考试名称</th>
-                    <th>创建时间</th>
-                    <th>操作</th>
-                </thead>
-                <tbody id="exam-list">
-                </tbody>
-            </table>
-            <div class="page">
-                <span class="back" id="previous-button">上页</span>
-                <div id="page-list">
-                </div>
-                <span class="next" id="next-button">下页</span>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const api = require('../lib/api.js')
-        const mustache = require('mustache')
-        const examTemplate = '<tr><td>{{id}}</td>\
-            <td>{{name}}</td><td>{{examTime}}</td>\
-            <td><a href="##" data-index="{{index}}">进入考试</a></td></tr>'
-        const pageTemplate = '<a href="##" data-number="{{number}}">{{number}}</a>'
-        const pageSize = 10
-
-        let examList = []
-        let currentPage
-        let pageCount
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            api.getExams(1, 1000).then(list => {
-                examList = list
-                initPage()
-            }).catch(err => {
-                alert('获取考试列表失败\n' + (err || ''))
-            })
-        })
-
-        function initPage() {
-            let totalCount = examList.length
-            if (totalCount > 0) {
-                pageCount = totalCount % pageSize == 0 ? parseInt(totalCount / pageSize) : parseInt(totalCount /
-                    pageSize) + 1
-            } else {
-                pageCount = 0
-            }
-            $('#total-count').html(totalCount)
-
-            $('#page-list').empty()
-            for (let i = 1; i <= pageCount; i++) {
-                let dom = $(mustache.render(pageTemplate, {
-                    number: i
-                }))
-                $('#page-list').append(dom)
-
-                dom.click(function () {
-                    changePage(parseInt($(this).attr('data-number')))
-                })
-            }
-            $('#previous-button').click(() => {
-                if (currentPage > 1) {
-                    changePage(currentPage - 1)
-                }
-            })
-            $('#next-button').click(() => {
-                if (currentPage < pageCount) {
-                    changePage(currentPage + 1)
-                }
-            })
-            if (pageCount > 0) {
-                changePage(1)
-            }
-        }
-
-        function render() {
-            $('#page-list').find('a').removeClass('on')
-            $('#page-list').find('a[data-number="' + currentPage + '"]').addClass('on')
-
-            $('#exam-list').empty()
-            let start = (currentPage - 1) * pageSize
-            let end = start + pageSize
-            for (let i = start; i < end && i < examList.length; i++) {
-                examList[i].index = i
-                let dom = $(mustache.render(examTemplate, examList[i]))
-                $('#exam-list').append(dom)
-
-                dom.find('a').click(selectExam)
-            }
-        }
-
-        function selectExam() {
-            let exam = examList[parseInt($(this).attr('data-index'))]
-            env.exam = exam
-            env.examId = exam.id
-            window.localStorage.setItem('env', JSON.stringify(env))
-            window.location.href = 'index.html'
-        }
-
-        function changePage(pageNumber) {
-            currentPage = pageNumber
-            render()
-        }
-    </script>
-</body>
-
-</html>

+ 0 - 97
src/view/image-check.html

@@ -1,97 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="##">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title title_grey cl">
-                <h2>图片检查中 …</h2>
-            </div>
-            <div class="progress-box">
-                <h3>正在检查图片,请耐心等候 ~</h3>
-                <div class="progress">
-                    <div class="progress-outer">
-                        <div id="progress" class="progress-inner" style="width: 0%;"><span class="progress-text"></span>
-                        </div>
-                    </div>
-                </div>
-                <p>已检查人数:<b id="finish-count"></b> / 全部人数:<b id="total-count"></b></p>
-            </div>
-        </div>
-        <div class="xcConfirm" id="popup" style="display: none">
-            <div class="xc_layer"></div>
-            <div class="popbox">
-                <a href="##" id="popup-close"><span class="close"></span></a>
-                <div class="txtbox">
-                    <div id="popup-error" class="icon error" style="display: none"></div>
-                    <div id="popup-success" class="icon success" style="display: none"></div>
-                    <div id="popup-text" class="text"></div>
-                </div>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const imageUtil = require('../lib/image.js')()
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            let config = JSON.parse(window.localStorage.getItem('check-config'))
-            let totalCount;
-            imageUtil.on('total', (count) => {
-                totalCount = count
-                $('#total-count').html(count)
-            })
-            imageUtil.on('count', (count) => {
-                $('#finish-count').html(count)
-                let rate = parseInt(count * 100 / totalCount)
-                $('#progress').css('width', rate + '%')
-                $('.progress-text').html(rate + '%')
-            })
-            imageUtil.on('finish', () => {
-                $('#popup-success').show()
-                $('#popup-text').html('图片检查完成')
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'check.html'
-                })
-                $('#popup').show()
-            })
-            imageUtil.on('error', (err) => {
-                $('#popup-error').show()
-                $('#popup-text').html('图片检查出错\n' + (err || ''))
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'check.html'
-                })
-                $('#popup').show()
-            })
-            if (config.concurrent == 1) {
-                imageUtil.checkSliceSerial(config.dir)
-            } else {
-                imageUtil.checkSlice(config.dir, config.concurrent)
-            }
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 104
src/view/image-download.html

@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="##">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title title_grey cl">
-                <h2>图片下载中 …</h2>
-            </div>
-            <div class="progress-box">
-                <h3>正在下载图片,请耐心等候 ~</h3>
-                <div class="progress">
-                    <div class="progress-outer">
-                        <div id="progress" class="progress-inner" style="width: 0%;"><span class="progress-text"></span>
-                        </div>
-                    </div>
-                </div>
-                <p>已下载图片:<b id="finish-count"></b> / 全部图片:<b id="total-count"></b></p>
-            </div>
-        </div>
-        <div class="xcConfirm" id="popup" style="display: none">
-            <div class="xc_layer"></div>
-            <div class="popbox">
-                <a href="##" id="popup-close"><span class="close"></span></a>
-                <div class="txtbox">
-                    <div id="popup-error" class="icon error" style="display: none"></div>
-                    <div id="popup-success" class="icon success" style="display: none"></div>
-                    <div id="popup-text" class="text"></div>
-                </div>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-        <div style="display:none">
-            <canvas id="canvas"></canvas>
-        </div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const imageUtil = require('../lib/image.js')()
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            let config = JSON.parse(window.localStorage.getItem('image-config'))
-            let totalCount;
-            imageUtil.on('total', (count) => {
-                totalCount = count
-                $('#total-count').html(count)
-            })
-            imageUtil.on('count', (count) => {
-                $('#finish-count').html(count)
-                let rate = parseInt(count * 100 / totalCount)
-                $('#progress').css('width', rate + '%')
-                $('.progress-text').html(rate + '%')
-            })
-            imageUtil.on('finish', () => {
-                $('#popup-success').show()
-                $('#popup-text').html('图片下载完成')
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'image.html'
-                })
-                $('#popup').show()
-            })
-            imageUtil.on('error', (err) => {
-                $('#popup-error').show()
-                $('#popup-text').html('图片下载出错\n' + (err || ''))
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'image.html'
-                })
-                $('#popup').show()
-            })
-            if (config.type == '1') {
-                imageUtil.downloadSheet(config.dir, config.template, config.append, config.failover, config
-                    .watermark, config.trackMode, {
-                    examNumberIn: config.examNumber,
-                    subjectCode: config.subjectCode
-                })
-            } else {
-                imageUtil.downloadPackage(config.dir, config.template, config.append, config.failover)
-            }
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 206
src/view/image.html

@@ -1,206 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="login.html">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title cl">
-                <span class="y"><a href="index.html">返回考试主页</a></span>
-                <h2>图片下载</h2>
-            </div>
-            <div class="picture cl">
-                <table cellpadding="0" cellspacing="0" width="100%">
-                    <tr>
-                        <th>下载内容:</th>
-                        <td>
-                            <div class="input-radio">
-                                <label><input type="radio" name="type" value="1"><span></span><em>考生原图</em></label>
-                                <label><input type="radio" name="type" value="2"><span></span><em>签到表图片</em></label>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>本地保存地址:</th>
-                        <td>
-                            <input id="path-text" type="text" style="width: 400px" class="filetext" />
-                            <a href="##" id="path-select" class="filebtn">选择</a>
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>图片转存规则:</th>
-                        <td><input id="template-input" type="text" style="width: 600px" /></td>
-                    </tr>
-                    <tr id="append-select">
-                        <th>是否续传:</th>
-                        <td>
-                            <div class="input-radio">
-                                <label><input type="radio" name="append" value="1"><span></span><em>是</em></label>
-                                <label><input type="radio" name="append" value="2"><span></span><em>否</em></label>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr id="exception-select">
-                        <th>异常处理:</th>
-                        <td>
-                            <div class="input-radio">
-                                <label><input type="radio" name="exception" value="1"><span></span><em>终止</em></label>
-                                <label><input type="radio" name="exception" value="2"><span></span><em>跳过</em></label>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr id="watermark-select" style="display: none">
-                        <th>添加分数水印:</th>
-                        <td>
-                            <div class="input-radio">
-                                <label><input type="radio" name="watermark" value="1"><span></span><em>是</em></label>
-                                <label><input type="radio" name="watermark" value="2"><span></span><em>否</em></label>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr id="track-mode-select" style="display: none">
-                        <th>水印模式:</th>
-                        <td>
-                            <div class="input-radio">
-                                <label><input type="radio" name="trackMode" value="1"><span></span><em>普通</em></label>
-                                <label><input type="radio" name="trackMode" value="2"><span></span><em>研究生</em></label>
-                            </div>
-                        </td>
-                    </tr>
-                    <tr id="examNumber-select" style="display: none">
-                        <th>准考证号:</th>
-                        <td><input id="examNumber-input" type="text" style="width: 600px" placeholder="多个准考证号用逗号分隔" />
-                        </td>
-                    </tr>
-                    <tr id="subjectCode-select" style="display: none">
-                        <th>科目代码:</th>
-                        <td><input id="subjectCode-input" type="text" style="width: 600px" /></td>
-                    </tr>
-
-                    <tr id="message-tr" style="display: none">
-                        <th></th>
-                        <td>
-                            <p class="error-tetx" id="message-text"></p>
-                        </td>
-                    </tr>
-                    <tr>
-                        <th></th>
-                        <td><a id="run-button" href="##" class="start-btn"><span>开始图片下载</span></a></td>
-                    </tr>
-                </table>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const config = require('../lib/config.js')
-        const { dialog } = require('electron').remote
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            $('input:radio[name="type"]').change(() => {
-                let type = $('input:radio:checked').val()
-                if (type == '1') {
-                    $('#message-text').html('转存规则范例: ' + config.imageUrl.sheet)
-                    $('#message-tr').show()
-                    $('#watermark-select').show()
-                    $('#track-mode-select').show()
-                    $('#subjectCode-select').show()
-                    $('#examNumber-select').show()
-                } else if (type == '2') {
-                    $('#message-text').html('转存规则范例: ' + config.imageUrl.package)
-                    $('#message-tr').show()
-                    $('#watermark-select').hide()
-                    $('#track-mode-select').hide()
-                    $('#examNumber-select').hide()
-                    $('#subjectCode-select').hide()
-                } else {
-                    $('#message-tr').hide()
-                    $('#watermark-select').hide()
-                    $('#track-mode-select').hide()
-                    $('#examNumber-select').hide()
-                    $('#subjectCode-select').hide()
-                }
-            })
-
-            $('#path-select').click(() => {
-                dialog.showOpenDialog({
-                    title: '请选择保存目录',
-                    properties: ['openDirectory']
-                }).then(result => {
-                    if (result && result.filePaths) {
-                        $('#path-text').val(result.filePaths[0])
-                    }
-                })
-            })
-
-            $('#run-button').click(() => {
-                let type = $('input:radio[name="type"]:checked').val()
-                let append = $('input:radio[name="append"]:checked').val()
-                let exceptionHandle = $('input:radio[name="exception"]:checked').val()
-                let watermark = $('input:radio[name="watermark"]:checked').val()
-                let trackMode = $('input:radio[name="trackMode"]:checked').val()
-                let examNumber = $('#examNumber-input').val()
-                let subjectCode = $('#subjectCode-input').val()
-                let template = $('#template-input').val()
-                let dir = $('#path-text').val()
-                if (type == undefined || type == '') {
-                    alert('请选择图片类型')
-                    return false
-                }
-                if (template == undefined || template == '') {
-                    alert('请填写图片转存规则')
-                    return false
-                }
-                if (dir == undefined || dir == '') {
-                    alert('请选择图片转存目录')
-                    return false
-                }
-                if (append == undefined || append == '') {
-                    alert('请选择是否续传')
-                    return false
-                }
-                if (exceptionHandle == undefined || exceptionHandle == '') {
-                    alert('请选择异常处理方法')
-                    return false
-                }
-                if (type == '1' && (trackMode == undefined || trackMode == '')) {
-                    alert('请选择水印模式')
-                    return false
-                }
-                window.localStorage.setItem('image-config', JSON.stringify({
-                    type: type,
-                    template: template.trim(),
-                    dir: dir.trim(),
-                    append: append == '1',
-                    failover: exceptionHandle == '1',
-                    watermark: watermark == '1',
-                    trackMode: trackMode,
-                    examNumber: examNumber,
-                    subjectCode: subjectCode
-                }))
-                window.location.href = 'image-download.html'
-            })
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 53
src/view/index.html

@@ -1,53 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="login.html">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title cl" id="exam-title">
-                <em class="id"></em><span class="name"></span><span class="pipe">|</span>
-                <span class="time"></span>
-            </div>
-            <div class="list">
-                <h3>功能选择</h3>
-                <ul class="cl">
-                    <li class="l1"><a href="exam-list.html"><span></span>考试切换</a></li>
-                    <li class="l2"><a href="sync.html"><span></span>数据同步</a></li>
-                    <li class="l3"><a href="image.html"><span></span>图片下载</a></li>
-                    <!--<li class="l2"><a href="check.html"><span></span>图片检查</a></li>-->
-                </ul>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            $('#exam-title').find('.id').html(env.exam.id)
-            $('#exam-title').find('.name').html(env.exam.name)
-            $('#exam-title').find('.time').html(env.exam.examTime)
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 91
src/view/login.html

@@ -1,91 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-    <style type="text/css">
-        body {
-            background: #F2F4F9;
-        }
-    </style>
-</head>
-
-<body>
-    <div class="login-flex">
-        <div class="login">
-            <div class="logo"><img src="img/logo_blue.png" /></div>
-            <form>
-                <div>
-                    <select id="server-select">
-                        <option value="">请选择服务地址</option>
-                    </select>
-                </div>
-                <div>
-                    <input id="loginName-input" type="text" placeholder="请输入账号">
-                </div>
-                <div>
-                    <input id="password-input" type="password" placeholder="请输入密码">
-                </div>
-                <div><a href="##" id="login-button">登录</a></div>
-            </form>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-    <script>
-        const config = require('../lib/config.js')
-        const env = require('../lib/env.js')
-        const api = require('../lib/api.js')
-        const $ = require('jquery')
-
-        $(document).ready(() => {
-            window.localStorage.clear()
-            for (let i = 0; i < config.servers.length; i++) {
-                let server = config.servers[i];
-                $('<option value="' + i + '">' + server.name + '</option>').appendTo($('#server-select'))
-            }
-        })
-
-        document.onkeydown = function (event) {
-            var e = event || window.event;
-            if (e && e.keyCode == 13) { //回车键的键值为13
-                $('#login-button').click() //调用登录按钮的登录事件
-            }
-        }
-
-        $('#login-button').click(() => {
-            let index = $('#server-select').val()
-            if (index != '') {
-                env.server = config.servers[parseInt(index)]
-            } else {
-                env.server = undefined
-            }
-            env.loginName = $('#loginName-input').val()
-            env.password = $('#password-input').val()
-            if (env.server == undefined) {
-                alert('请选择服务地址')
-                return
-            }
-            if (env.loginName == '') {
-                alert('请输入账号')
-                return
-            }
-            if (env.password == '') {
-                alert('请输入密码')
-                return
-            }
-            api.login().then(user => {
-                env.user = user
-                window.localStorage.setItem('env', JSON.stringify(env))
-                window.location.href = 'exam-list.html'
-            }).catch(err => {
-                alert('登陆失败,用户名或密码错误')
-            })
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 101
src/view/sync-run.html

@@ -1,101 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="##">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title title_grey cl">
-                <h2>数据同步中 …</h2>
-            </div>
-            <div class="progress-box">
-                <h3 id="message">正在下载考生...</h3>
-                <div class="progress">
-                    <div class="progress-outer">
-                        <div id="progress" class="progress-inner" style="width: 0%;"><span class="progress-text"></span>
-                        </div>
-                    </div>
-                </div>
-                <p>已数据同步考生:<b id="finish-count"></b> / 全部考生:<b id="total-count"></b></p>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-    <div class="xcConfirm" id="popup" style="display: none">
-        <div class="xc_layer"></div>
-        <div class="popbox">
-            <a href="##" id="popup-close"><span class="close"></span></a>
-            <div class="txtbox">
-                <div id="popup-error" class="icon error" style="display: none"></div>
-                <div id="popup-success" class="icon success" style="display: none"></div>
-                <div id="popup-text" class="text"></div>
-            </div>
-        </div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const config = require('../lib/config.js')
-        const sync = require('../lib/sync.js')()
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            var totalCount = 0;
-            sync.on('total', (count) => {
-                totalCount = count
-                $('#total-count').html(count)
-            })
-            sync.on('student', (count) => {
-                $('#finish-count').html(count)
-                let rate = parseInt(count * 100 / totalCount)
-                $('#progress').css('width', rate + '%')
-                $('.progress-text').html(rate + '%')
-            })
-            sync.on('campus', (count) => {
-                $('#message').html('正在下载学习中心,已完成' + count)
-            })
-            sync.on('package', (count) => {
-                $('#message').html('正在下载签到表,已完成' + count)
-            })
-            sync.on('finish', () => {
-                $('#popup-success').show()
-                $('#popup-text').html('数据同步完成')
-                config.updateSyncTime()
-
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'sync.html'
-                })
-                $('#popup').show()
-            })
-            sync.on('error', (err) => {
-                $('#popup-error').show()
-                $('#popup-text').html('数据同步出错\n' + (err || ''))
-                $('#popup-close').click(() => {
-                    $('#popup').hide()
-                    window.location.href = 'sync.html'
-                })
-                $('#popup').show()
-            })
-            sync.start()
-        })
-    </script>
-</body>
-
-</html>

+ 0 - 57
src/view/sync.html

@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <title>云阅卷本地代理工具</title>
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
-    <link rel="stylesheet" href="css/style.css">
-</head>
-
-<body>
-    <div class="wp">
-        <div class="hd">
-            <div class="logo"><img src="img/logo.png" /></div>
-            <span class="y"> 欢迎您,<span id="user-name"></span>
-                <span class="pipe">|</span><a href="login.html">退出</a>
-            </span>
-        </div>
-        <div class="cont">
-            <div class="title cl">
-                <span class="y"><a href="index.html">返回考试主页</a></span>
-                <h2>数据同步</h2>
-            </div>
-            <div class="data">
-                <p>本地已下载考生数量:<b id="student-count"></b></p>
-                <p>上次下载完成时间:<b id="last-time"></b></p>
-                <div class="btn"><a href="sync-run.html"><span>开始同步数据</span></a></div>
-            </div>
-        </div>
-        <div class="ft">Copyright © 2011-2020 www.qmth.com.cn, All Rights Reserved</div>
-    </div>
-
-    <script>
-        const $ = require('jquery')
-        const env = require('../lib/env.js')
-        const config = require('../lib/config.js')
-        const db = require('../lib/db.js')
-
-        $(document).ready(() => {
-            env.merge(JSON.parse(window.localStorage.getItem('env')))
-            $('#user-name').html(env.user.userName)
-
-            $('#last-time').html(config['syncTime'][env.server.host + '_' + env.exam.id])
-
-            db.init()
-            db.query('select count(*) as count from eb_exam_student where exam_id=?', [env.exam.id]).then((
-                results) => {
-                $('#student-count').html(results[0].count)
-            }).catch(err => {
-                alert('数据库查询失败\n' + (err || ''))
-            })
-        })
-    </script>
-</body>
-
-</html>