{"version":3,"sources":["webpack:///./src/utils/upload.ts","webpack:///./src/views/print/downloadNotify.vue?283b","webpack:///./src/views/print/downloadNotify.vue","webpack:///./src/views/print/downloadNotify.vue?48ff","webpack:///./src/views/print/downloadNotify.vue?7d06","webpack:///./src/api/exam/room.ts","webpack:///./src/components/select/ExamSelect.vue?5a96","webpack:///./src/components/select/ExamSelect.vue","webpack:///./src/components/select/ExamSelect.vue?a75a","webpack:///./src/components/select/ExamSelect.vue?6e08","webpack:///./src/views/print/downloadNotify.vue?a47d","webpack:///./src/api/exam/examinees.ts","webpack:///./node_modules/core-js/modules/es.array.find.js","webpack:///./src/api/exam/index.ts","webpack:///./src/api/exam/invigilator.ts","webpack:///./src/service/exam/index.ts","webpack:///./src/views/print/downloadNotify.vue?23fa","webpack:///./src/api/exam/upload.ts"],"names":["createProcessHandler","option","e","onProgress","percent","Math","round","loaded","total","render","_vm","this","_h","$createElement","_c","_self","class","$style","wrap","steps","attrs","active","directives","name","rawName","value","expression","form","exam","on","$event","$set","handleNext","url","_v","toolbar","isMinStep","handleLast","isMaxStep","staticRenderFns","loading","baseUrl","res","components","ExamSelect","injectStyles","context","locals","component","get","examId","params","data","post","id","file","onUploadProgress","handleSelectChange","_l","item","key","randKey","exams","re","$emit","find","a","type","String","curryGet","patch","$","$find","addToUnscopables","FIND","SKIPS_HOLES","Array","target","proto","forced","callbackfn","arguments","length","undefined","handle","postDoc","QUERY_EXAM_ID","Intl","DateTimeFormat","year","month","day","hour","minute","second","hour12","validForm","el","validate","createExam","time","subjects","extraParam","map","router","push","path","query","upload","count","uploadRoom","uploadExaminee","uploadInvigilator","uploadInvigilatorDoc","fetchExamList","current","pageSize","rows","formated","Date","toDateString","validExamByRoute","currentRoute","includes","validExamAsync","result","validExam","Error","validNotifyExam","start","module","exports","FormData","append","headers"],"mappings":"kKAEaA,EAAuB,SAACC,GAAD,OAAgC,SAClEC,GAEAD,EAAOE,WAAP,iCACKD,GADL,IAEEE,QAASC,KAAKC,MAAkB,I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,8DAAO,WACLpD,EACAsB,EACAC,GAHK,kGAKC7B,EAAO,IAAIyG,SACjBzG,EAAK0G,OAAO,OAAQ9E,EAAMA,EAAKhC,MAC/BI,EAAK0G,OAAO,OAAQ9E,EAAKhC,MAPpB,SASkB,OAAM8B,KAAKpB,EAAKN,EAAM,CAC3C2G,QAAS,CAAE,eAAgB,uBAC3B9E,qBAXG,uBASGJ,EATH,EASGA,KATH,kBAaEA,GAbF,2C","file":"js/chunk-f5f39fb6.415f4a4a.js","sourcesContent":["import { HttpRequestOptions } from 'element-ui/types/upload'\r\n\r\nexport const createProcessHandler = (option: HttpRequestOptions) => (\r\n e: any\r\n) => {\r\n option.onProgress({\r\n ...e,\r\n percent: Math.round((e.loaded * 100) / e.total)\r\n })\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:_vm.$style.wrap},[_c('el-steps',{class:_vm.$style.steps,attrs:{\"active\":_vm.active,\"finish-status\":\"success\"}},[_c('el-step',{attrs:{\"title\":\"请选择考试\"}}),_c('el-step',{attrs:{\"title\":\"上传考场信息\"}})],1),_c('el-form',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.active === 0),expression:\"active === 0\"}]},[_c('el-form-item',{attrs:{\"label\":\"请选择考试\"}},[_c('ExamSelect',{attrs:{\"exam\":_vm.form.exam},on:{\"update:exam\":function($event){return _vm.$set(_vm.form, \"exam\", $event)},\"change\":_vm.handleNext}})],1)],1),_c('el-form',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.active === 1),expression:\"active === 1\"}]},[_c('a',{attrs:{\"href\":_vm.url,\"target\":\"_blank\"}},[_vm._v(\"下载监考通知\")])]),_c('el-form',{class:_vm.$style.toolbar,attrs:{\"inline\":\"\"}},[_c('el-form-item',[_c('el-button',{attrs:{\"disabled\":_vm.isMinStep},on:{\"click\":_vm.handleLast}},[_vm._v(\"上一步\")])],1),_c('el-form-item',[_c('el-button',{attrs:{\"disabled\":_vm.isMaxStep},on:{\"click\":_vm.handleNext}},[_vm._v(\"下一步\")])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Vue, Component, Prop, Watch } from 'vue-property-decorator'\r\nimport ExamSelect from '@/components/select/ExamSelect.vue'\r\nimport { Nilable } from '@/models/helpers/common'\r\nimport { alert, notify } from '@/utils/notification'\r\nimport { validNotifyExam } from '@/service/exam'\r\n@Component({\r\n components: { ExamSelect }\r\n})\r\nexport default class downloadNotify extends Vue {\r\n active = 0\r\n loading = false\r\n form = {\r\n exam: null as Nilable\r\n }\r\n url = ''\r\n baseUrl = process.env.VUE_APP_BASE_API\r\n\r\n get isMinStep() {\r\n return this.active === 0\r\n }\r\n\r\n get isMaxStep() {\r\n return this.active === 1\r\n }\r\n\r\n handleLast() {\r\n if (!this.isMinStep) this.active -= 1\r\n }\r\n\r\n async handleNext() {\r\n var res = await validNotifyExam(this.form.exam as string)\r\n if (!res) return\r\n if (!this.isMaxStep) {\r\n this.active += 1\r\n this.url = `${this.baseUrl}/exam/${this.form.exam}/invigilator/downLoad/doc`\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./downloadNotify.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./downloadNotify.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./downloadNotify.vue?vue&type=template&id=c8eaf05c&\"\nimport script from \"./downloadNotify.vue?vue&type=script&lang=ts&\"\nexport * from \"./downloadNotify.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./downloadNotify.vue?vue&type=style&index=0&lang=scss&module=true&\"\n\n\n\n\nfunction injectStyles (context) {\n \n this[\"$style\"] = (style0.locals || style0)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n \n)\n\nexport default component.exports","import { axios } from '@/utils/http'\r\nimport { TableResponse, Params } from '@/components/table'\r\nimport { ExamRoom } from '@/models/exam/room'\r\nimport { post as upload } from './upload'\r\nimport { paramsApdapter } from '@/utils/apdapter'\r\n\r\nexport async function get(examId: string, params?: Params) {\r\n const { data } = await axios.get(`exam/${examId}/room`, {\r\n params: paramsApdapter(params)\r\n })\r\n return data as TableResponse\r\n}\r\n\r\nexport async function post(\r\n id: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n return await upload(`exam/${id}/room/xls`, file, onUploadProgress)\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-select',{attrs:{\"value\":_vm.exam,\"loading\":_vm.loading,\"placeholder\":\"请选择考试信息\",\"filterable\":\"\",\"clearable\":\"\"},on:{\"change\":_vm.handleSelectChange}},_vm._l((_vm.exams),function(item){return _c('el-option',{key:item.id + _vm.randKey,attrs:{\"label\":item.name,\"value\":item.id}})}),1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Vue, Component, Prop } from 'vue-property-decorator'\r\nimport { fetchExamList, validExamByRoute } from '@/service/exam'\r\nimport { randKey } from '@/utils/random'\r\nimport { Exam } from '@/models/exam'\r\n\r\n@Component\r\nexport default class ExamSelect extends Vue {\r\n @Prop({ type: String }) exam!: number\r\n exams = [] as Exam[]\r\n randKey = randKey()\r\n loading = true\r\n\r\n async created() {\r\n this.exams = await fetchExamList()\r\n const re = await validExamByRoute(this.exams)\r\n if (re) this.handleSelectChange(re)\r\n this.loading = false\r\n }\r\n\r\n handleSelectChange(id: string) {\r\n this.$emit('update:exam', id)\r\n\r\n const exam = this.exams.find(a => a.id === id)\r\n if (exam) this.$emit('change', exam)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ExamSelect.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ExamSelect.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ExamSelect.vue?vue&type=template&id=a62702f2&\"\nimport script from \"./ExamSelect.vue?vue&type=script&lang=ts&\"\nexport * from \"./ExamSelect.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export { default } from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./downloadNotify.vue?vue&type=style&index=0&lang=scss&module=true&\"; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./downloadNotify.vue?vue&type=style&index=0&lang=scss&module=true&\"","import { axios } from '@/utils/http'\r\nimport { TableResponse, Params } from '@/components/table'\r\nimport { Examinees } from '@/models/exam/examinees'\r\nimport { post as upload } from './upload'\r\nimport { paramsApdapter } from '@/utils/apdapter'\r\n\r\nexport async function post(\r\n id: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n return await upload(`/exam/${id}/examinees/xls`, file, onUploadProgress)\r\n}\r\n\r\nexport const curryGet = (examId: string) => async (params?: Params) => {\r\n const { data } = await axios.get(`/exam/${examId}/examinees`, {\r\n params: paramsApdapter(params)\r\n })\r\n return data as TableResponse\r\n}\r\n\r\nexport const get = async (examId: string, params?: Params) =>\r\n curryGet(examId)(params)\r\n\r\nexport const patch = async (examId: string) => {\r\n const { data } = await axios.patch(`exam/${examId}/examinees`)\r\n}\r\n","'use strict';\nvar $ = require('../internals/export');\nvar $find = require('../internals/array-iteration').find;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\nvar FIND = 'find';\nvar SKIPS_HOLES = true;\n\n// Shouldn't skip holes\nif (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.find` method\n// https://tc39.es/ecma262/#sec-array.prototype.find\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND);\n","import { axios } from '@/utils/http'\r\nimport { Exam, BaseExam } from '@/models/exam'\r\nimport { TableResponse, Params } from '@/components/table'\r\nimport { paramsApdapter } from '@/utils/apdapter'\r\n\r\nexport async function get(id: string): Promise\r\nexport async function get(params?: Params): Promise>\r\nexport async function get(params?: string | Params) {\r\n const handle =\r\n typeof params === 'string'\r\n ? axios.get(`exam/${params}`)\r\n : axios.get(`exam`, { params: paramsApdapter(params) })\r\n const { data } = await handle\r\n return data\r\n}\r\n\r\nexport async function post(exam: BaseExam) {\r\n const { data } = await axios.post(`exam`, exam)\r\n return data as Exam\r\n}\r\n","import { post as upload } from './upload'\r\nimport { postDoc as uploadDoc } from './upload'\r\nexport async function post(\r\n id: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n return await upload(`/exam/${id}/invigilator/xls`, file, onUploadProgress)\r\n}\r\n\r\nexport async function postDoc(\r\n id: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n return await uploadDoc(`/exam/${id}/invigilator/doc`, file, onUploadProgress)\r\n}\r\n","import { ElForm } from 'element-ui/types/form'\r\nimport { HttpRequestOptions } from 'element-ui/types/upload'\r\nimport { post, get } from '@/api/exam'\r\nimport { post as postRoom } from '@/api/exam/room'\r\nimport { post as postExaminees, patch } from '@/api/exam/examinees'\r\nimport { post as postInvigilator } from '@/api/exam/invigilator'\r\nimport { postDoc as postInvigilatorDoc } from '@/api/exam/invigilator'\r\nimport { alert, notify } from '@/utils/notification'\r\nimport { createProcessHandler } from '@/utils/upload'\r\nimport { Exam, UploadFunc } from '@/models/exam'\r\nimport { Nilable } from '@/models/helpers/common'\r\nimport { router } from '@/router'\r\nimport { toDateString } from '@/utils/formatter/date'\r\n\r\nexport type Subject = { name: string; time: Date }\r\n\r\nexport type Payload = {\r\n name: string\r\n time: Date\r\n subjects: Subject[]\r\n}\r\n\r\nconst QUERY_EXAM_ID = 'exam_id'\r\n\r\nconst formater = new Intl.DateTimeFormat('zh-CN', {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric',\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n second: 'numeric',\r\n hour12: false\r\n})\r\n\r\nexport async function validForm(el: ElForm) {\r\n try {\r\n await el.validate()\r\n return true\r\n } catch (e) {\r\n return false\r\n }\r\n}\r\n\r\nexport async function createExam({ name, time, subjects }: Payload) {\r\n try {\r\n const exam = await post({\r\n extraParam: '',\r\n name,\r\n time: toDateString(time),\r\n subjects: subjects.map(a => ({\r\n name: a.name,\r\n time: toDateString(a.time)\r\n }))\r\n })\r\n notify(`创建考试成功`)\r\n router.push({ path: '/exam/upload', query: { [QUERY_EXAM_ID]: exam.id } })\r\n return true\r\n } catch (e) {\r\n return false\r\n }\r\n}\r\n\r\nconst curryUpload = (upload: UploadFunc) => (id: string) => async (\r\n option: HttpRequestOptions\r\n) => {\r\n try {\r\n const { count } = await upload(\r\n id,\r\n option.file,\r\n createProcessHandler(option)\r\n )\r\n notify(`上传成功, 共${count}条数据`)\r\n return true\r\n } catch (e) {\r\n notify('上传失败', e)\r\n return false\r\n }\r\n}\r\n\r\n/**\r\n * 上传考场信息\r\n * @param id 考试ID\r\n */\r\nexport const uploadRoom = curryUpload(postRoom)\r\n\r\n/**\r\n * 上传考生信息\r\n * @param id 考试ID\r\n */\r\nexport const uploadExaminee = curryUpload(postExaminees)\r\n\r\n/**\r\n * 上传监考信息\r\n * @param id 考试ID\r\n */\r\nexport const uploadInvigilator = curryUpload(postInvigilator)\r\n\r\n/**\r\n * 上传监考通知模板\r\n * @param id 考试ID\r\n */\r\nexport const uploadInvigilatorDoc = curryUpload(postInvigilatorDoc)\r\n\r\nexport async function fetchExamList() {\r\n try {\r\n const data = await get({ current: 1, pageSize: 99999 })\r\n const rows = (data && data.rows) || []\r\n const formated = rows.map(a => ({\r\n ...a,\r\n time: new Date(a.time).toDateString()\r\n }))\r\n return formated\r\n } catch (e) {\r\n notify(`获取考试列表失败`, e)\r\n return []\r\n }\r\n}\r\n\r\n/** 异步校验 URL QUERY 中是否存在有效 ExamId */\r\nexport async function validExamByRoute(): Promise\r\n/** 异步校验 URL QUERY 中 ExamId 是否位于数组中 */\r\nexport async function validExamByRoute(exams?: Exam[]): Promise\r\nexport async function validExamByRoute(exams?: Exam[]) {\r\n const exam = router.currentRoute.query[QUERY_EXAM_ID]\r\n if (typeof exam !== 'string') return null\r\n\r\n const result = exams\r\n ? exams.map(a => a.id).includes(exam)\r\n : await validExamAsync(exam)\r\n return result ? exam : null\r\n}\r\n\r\nasync function validExamAsync(examId: string) {\r\n try {\r\n await get(examId)\r\n return true\r\n } catch (e) {\r\n return false\r\n }\r\n}\r\n\r\nexport function validExam(examId?: Nilable): examId is string {\r\n if (!examId) alert(`请先选择考试`, new Error())\r\n return !!examId\r\n}\r\n\r\nexport async function validNotifyExam(examId: string) {\r\n if (!examId) {\r\n alert(`请先选择考试`, new Error())\r\n return false\r\n }\r\n var exam = await get(examId as string)\r\n if (!exam.extraParam) {\r\n alert(`所选考试未上传通知模板`, new Error())\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport async function start(examId?: Nilable) {\r\n if (!validExam(examId)) return\r\n\r\n try {\r\n await patch(examId)\r\n router.push({\r\n path: '/print/exam-download',\r\n query: { [QUERY_EXAM_ID]: examId }\r\n })\r\n notify('排考完成')\r\n return true\r\n } catch (e) {\r\n notify(`排考可能失败, 如果多次失败, 请联系管理员`, e)\r\n return false\r\n }\r\n}\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"downloadNotify_wrap_FaPqS\",\"steps\":\"downloadNotify_steps_LJzsA\",\"toolbar\":\"downloadNotify_toolbar_3ospL\"};","import { axios } from '@/utils/http'\r\nimport { UploadResult } from '@/models/exam'\r\n\r\nexport async function post(\r\n url: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n const form = new FormData()\r\n form.append('sheet', file, file.name)\r\n form.append('name', file.name)\r\n\r\n const { data } = await axios.post(url, form, {\r\n headers: { 'Content-Type': 'multipart/form-data' },\r\n onUploadProgress\r\n })\r\n return data as UploadResult\r\n}\r\n\r\nexport async function postDoc(\r\n url: string,\r\n file: File,\r\n onUploadProgress?: (progressEvent: any) => void\r\n) {\r\n const form = new FormData()\r\n form.append('file', file, file.name)\r\n form.append('name', file.name)\r\n\r\n const { data } = await axios.post(url, form, {\r\n headers: { 'Content-Type': 'multipart/form-data' },\r\n onUploadProgress\r\n })\r\n return data as UploadResult\r\n}\r\n"],"sourceRoot":""}