From 4c185346cda738c6b906cecc80d89ec8f1d48b80 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 26 Oct 2020 17:50:35 +0800 Subject: [PATCH 01/97] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/dispatherContest/theoryExam.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue index 1bda55faf..c3dd6a794 100644 --- a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue +++ b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue @@ -155,7 +155,7 @@ export default { currentMode = '02'; } this.mode = type; - getItemListByProjectCode('drts', {mode:currentMode}).then(res=>{ + getItemListByProjectCode('DRTS', {mode:currentMode}).then(res=>{ this.questionList = res.data; if (this.isTest) { this.questionList.forEach((question, index)=>{ @@ -163,7 +163,7 @@ export default { }); } if (this.mode == 'practice') { - getPracticeQuestionProgress('drts').then(res=>{ + getPracticeQuestionProgress('DRTS').then(res=>{ this.currentQuestionNum = res.data.questionIndex; this.loading = false; }).catch(error=>{ From 3ac4945d71da5ae8c41753ff1bb056397dae0d94 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 26 Oct 2020 18:41:10 +0800 Subject: [PATCH 02/97] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/map.js | 4 ++-- src/utils/loaddata.js | 4 ++++ src/views/newMap/displayNew/dispatherContest/theoryExam.vue | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/store/modules/map.js b/src/store/modules/map.js index b05d06c77..9633d0a7b 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -795,7 +795,7 @@ const map = { state.routeStartSignalData[data.startSignalCode] = [data]; } }); - state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => { + state.map && state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => { state.routeData[item.automaticRouteCode].automaticRouteCode = item.code; }); state.routeList = routeDataList; @@ -812,7 +812,7 @@ const map = { autoReentryList.forEach(data => { state.autoReentryData[data.code] = data; }); - state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => { + state.map && state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => { state.autoReentryData[item.cycleCode].cycleButtonCode = item.code; }); state.autoReentryList = autoReentryList; diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index c0bac5f53..594b1d12d 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -68,6 +68,10 @@ export function covertData(resp, type, resolve) { resolve(); }); }); + } else if (type == 'mapId') { + store.dispatch('map/setMapData', mapData).then(() => { + resolve(); + }); } const routeData = resp.data.logicDataNew.routeList; // 设置进路数据 diff --git a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue index c3dd6a794..75d7932c2 100644 --- a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue +++ b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue @@ -287,7 +287,7 @@ export default { }, submitConfirmExam(submitData) { this.loading = true; - submitPracticeQuestionData('drts', {mode:'02', theoryAnswers:submitData}).then(res=>{ + submitPracticeQuestionData('DRTS', {mode:'02', theoryAnswers:submitData}).then(res=>{ this.loading = false; this.isResult = true; this.$message.success('提交成功'); @@ -369,7 +369,7 @@ export default { } } this.isSelect = true; - updatePracticeQuestionProgress('drts', {index:this.currentQuestionNum}).then(res=>{ + updatePracticeQuestionProgress('DRTS', {index:this.currentQuestionNum}).then(res=>{ }).catch(error=>{ console.log(error.message); }); From 0a6852fb270c2773f1334d7b557b77b615146134 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 27 Oct 2020 10:43:55 +0800 Subject: [PATCH 03/97] =?UTF-8?q?=E7=90=86=E8=AE=BA=E9=A2=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/management/user.js | 4 +- src/api/race.js | 4 +- src/components/QueryListPage/DataForm.vue | 1 + src/components/QueryListPage/QueryForm.vue | 1 + src/i18n/langs/en/system.js | 2 +- src/i18n/langs/zh/system.js | 2 +- .../competitionManage/bankList/index.vue | 245 +++++++++++------ .../bankList/item-answer.vue | 63 +++-- .../competitionManage/bankList/preImport.vue | 43 ++- .../bankList/question-create-page.vue | 9 +- .../bankList/question-form.vue | 23 +- .../bankList/question-update-page.vue | 13 +- src/views/system/companyManage/add.vue | 2 +- src/views/system/companyManage/index.vue | 6 +- src/views/system/questionsRuleManage/add.vue | 29 +- .../system/questionsRuleManage/index.vue | 251 ++++++++++-------- src/views/system/userControl/edit.vue | 17 +- 17 files changed, 444 insertions(+), 271 deletions(-) diff --git a/src/api/management/user.js b/src/api/management/user.js index 62f0f5af3..403615804 100644 --- a/src/api/management/user.js +++ b/src/api/management/user.js @@ -85,10 +85,10 @@ export function saveUserSubscribe(data) { }); } -// 修改用户权限 +// 修改用户信息 export function putRoles(data) { return request({ - url: `/api/user/${data.id}/role`, + url: `/api/user/${data.id}/info`, method: 'put', data: data }); diff --git a/src/api/race.js b/src/api/race.js index a99547f86..7e4e43cc2 100644 --- a/src/api/race.js +++ b/src/api/race.js @@ -34,9 +34,9 @@ export function updateRace(id, data) { // }); // } /** 导入项目试题库 */ -export function importQuestionBand(data) { +export function importQuestionBand(data, companyId) { return request({ - url: `/api/questionBank/questions/import`, + url: `/api/questionBank/questions/import?id=${companyId}`, method: 'post', data }); diff --git a/src/components/QueryListPage/DataForm.vue b/src/components/QueryListPage/DataForm.vue index f4a9a984d..f9edadf9c 100644 --- a/src/components/QueryListPage/DataForm.vue +++ b/src/components/QueryListPage/DataForm.vue @@ -214,6 +214,7 @@ { + resp.data.forEach(item => { + this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name }); + }); + }); + }, methods: { doCreate() { this.$router.push({path: `${UrlConfig.bank.questionCreate}`}); @@ -178,100 +196,104 @@ export default { '问答': 'answer' }; if (file) { - setTimeout(() => { - const that = this; - const reader = new FileReader(); - if (reader) { - reader.onload = function (e) { - let wb; - const data = e.target.result; - if (that.rABS) { - wb = XLSX.read(btoa(that.fixdata(data)), { // 手动转化 - type: 'base64' - }); - } else { - wb = XLSX.read(data, { - type: 'binary' - }); - } - const questionList = []; - if (wb && wb.Sheets) { - for (const index in wb.Sheets) { - const dataList = convertSheetToList(wb.Sheets[index], true); - let questionTypeIndex; - let topicIndex; - let option1Index; - let option2Index; - let option3Index; - let option4Index; - let answerIndex; - dataList.forEach((item, index) => { - if (item[0] === '题型') { - questionTypeIndex = index; - } else if (item[0] === '题目') { - topicIndex = index; - } else if ( item[0] === '选项' && item[1] === 'A') { - option1Index = index; - } else if (!item[0] && item[1] === 'B') { - option2Index = index; - } else if (!item[0] && item[1] === 'C') { - option3Index = index; - } else if (!item[0] && item[1] === 'D') { - option4Index = index; - } else if (item[0] === '答案') { - answerIndex = index; - } + try { + setTimeout(() => { + const that = this; + const reader = new FileReader(); + if (reader) { + reader.onload = function (e) { + let wb; + const data = e.target.result; + if (that.rABS) { + wb = XLSX.read(btoa(that.fixdata(data)), { // 手动转化 + type: 'base64' }); - if (questionTypeIndex || questionTypeIndex === 0) { - dataList[questionTypeIndex].forEach((item, index) => { - if (item && item !== '题型') { - const param = { - type: questionTypeMap[item], - topic: dataList[topicIndex][index], - optionList: [] - }; - if (param.type === 'fill') { - const answer = dataList[answerIndex][index]; - const answerList = answer.split('&&'); - answerList && answerList.forEach(item => { - param.optionList.push({content: item, correct: true}); - }); - } else if (param.type === 'answer') { - param.optionList.push({content: dataList[answerIndex][index]}); - } else { - param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' }); - param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' }); - if (dataList[option3Index][index]) { - param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')}); - } - if (dataList[option4Index][index]) { - param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')}); - } - } - questionList.push(param); + } else { + wb = XLSX.read(data, { + type: 'binary' + }); + } + const questionList = []; + if (wb && wb.Sheets) { + for (const index in wb.Sheets) { + const dataList = convertSheetToList(wb.Sheets[index], true); + let questionTypeIndex; + let topicIndex; + let option1Index; + let option2Index; + let option3Index; + let option4Index; + let answerIndex; + dataList.forEach((item, index) => { + if (item[0] === '题型') { + questionTypeIndex = index; + } else if (item[0] === '题目') { + topicIndex = index; + } else if ( item[0] === '选项' && item[1] === 'A') { + option1Index = index; + } else if (!item[0] && item[1] === 'B') { + option2Index = index; + } else if (!item[0] && item[1] === 'C') { + option3Index = index; + } else if (!item[0] && item[1] === 'D') { + option4Index = index; + } else if (item[0] === '答案') { + answerIndex = index; } }); + if (questionTypeIndex || questionTypeIndex === 0) { + dataList[questionTypeIndex].forEach((item, index) => { + if (item && item !== '题型') { + const param = { + type: questionTypeMap[item], + topic: dataList[topicIndex][index], + optionList: [] + }; + if (param.type === 'fill') { + const answer = dataList[answerIndex][index]; + const answerList = answer.split('&&'); + answerList && answerList.forEach(item => { + param.optionList.push({content: item, correct: true}); + }); + } else if (param.type === 'answer') { + param.optionList.push({content: dataList[answerIndex][index]}); + } else { + param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' }); + param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' }); + if (dataList[option3Index][index]) { + param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')}); + } + if (dataList[option4Index][index]) { + param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')}); + } + } + questionList.push(param); + } + }); + } } + that.$store.dispatch('race/setPreTheoryData', questionList).then(() => { + that.$router.push({ path: `/system/preTheoryImport`}); + }).catch((e) => { + that.$message.error('导入题库失败!'); + }); + // importQuestionBand(questionList, 'DRTS').then(resp => { + // this.$message.success('导入题库成功!'); + // }).catch(()=>{ + // this.$message.error('导入题库失败!'); + // }); } - that.$store.dispatch('race/setPreTheoryData', questionList).then(() => { - that.$router.push({ path: `/system/preTheoryImport`}); - }).catch((e) => { - that.$message.error('导入题库失败!'); - }); - // importQuestionBand(questionList, 'DRTS').then(resp => { - // this.$message.success('导入题库成功!'); - // }).catch(()=>{ - // this.$message.error('导入题库失败!'); - // }); + }; + if (that.rABS) { + reader.readAsArrayBuffer(file); + } else { + reader.readAsBinaryString(file); } - }; - if (that.rABS) { - reader.readAsArrayBuffer(file); - } else { - reader.readAsBinaryString(file); } - } - }, 200); + }, 200); + } catch (e) { + this.$message.error('请根据下载模板导入题目!'); + } } }, importQuestionBank() { @@ -282,6 +304,53 @@ export default { }, questionsRuleManage() { this.$router.push({ path: `/system/questionsRuleManage`}); + }, + exportTemplate() { + const wb = XLSX.utils.book_new(); + const data1 = [{A: '序号', B: '题型', C:'题目', D:'选项', E: '', F: '', G: '', H: '答案'}]; + const data2 = [{A: '', B: '', C:'', D:'A', E: 'B', F: 'C', G: 'D', H: ''}]; + const data3 = [{A: '1', B: '判断', C:'题目一', D:'', E: '', F: '', G: '', H: '√'}]; + const data4 = [{A: '2', B: '判断', C:'题目二', D:'', E: '', F: '', G: '', H: '×'}]; + const data5 = [{A: '3', B: '单选', C:'题目三', D:'选项A', E: '选项B', F: '选项C', G: '选项D', H: 'A'}]; + const data6 = [{A: '4', B: '多选', C:'题目四', D:'选项A', E: '选项B', F: '选项C', G: '选项D', H: 'ABCD'}]; + const data7 = [{A: '5', B: '填空', C:'题目五', D:'', E: '', F: '', G: '', H: '第一空答案&&第二空答案&&第三空答案'}]; + const data8 = [{A: '6', B: '问答', C:'题目六', D:'', E: '', F: '', G: '', H: '问答题答案'}]; + const data = [...data1, ...data2, ...data3, ...data4, ...data5, ...data6, ...data7, ...data8]; + const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true}); + ws['!merges'] = [ + { + s: {c: 3, r: 0}, + e: {c: 6, r: 0} + }, + { + s: {c: 0, r: 0}, + e: {c: 0, r: 1} + }, + { + s: {c: 1, r: 0}, + e: {c: 1, r: 1} + }, + { + s: {c: 2, r: 0}, + e: {c: 2, r: 1} + }, + { + s: {c: 7, r: 0}, + e: {c: 7, r: 1} + } + ]; + ws['!cols'] = [ + {width: 10}, + {width: 10}, + {width: 50}, + {width: 15}, + {width: 15}, + {width: 15}, + {width: 15}, + {width: 15} + ]; + XLSX.utils.book_append_sheet(wb, ws, 'file'); + XLSX.writeFile(wb, '题库模板' + '.xlsx'); } } }; diff --git a/src/views/competitionManage/bankList/item-answer.vue b/src/views/competitionManage/bankList/item-answer.vue index 3eb163cf5..d23557c0e 100644 --- a/src/views/competitionManage/bankList/item-answer.vue +++ b/src/views/competitionManage/bankList/item-answer.vue @@ -18,8 +18,16 @@ @@ -36,11 +44,7 @@ diff --git a/src/views/planMonitor/editToolAUS/drawer.vue b/src/views/planMonitor/editToolAUS/drawer.vue new file mode 100644 index 000000000..d162ebf4a --- /dev/null +++ b/src/views/planMonitor/editToolAUS/drawer.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/views/planMonitor/editToolAUS/export.vue b/src/views/planMonitor/editToolAUS/export.vue new file mode 100644 index 000000000..f2bce0803 --- /dev/null +++ b/src/views/planMonitor/editToolAUS/export.vue @@ -0,0 +1,268 @@ + + + + + diff --git a/src/views/planMonitor/editToolAUS/index.vue b/src/views/planMonitor/editToolAUS/index.vue index 0d2cf61a3..5c0b3ac9f 100644 --- a/src/views/planMonitor/editToolAUS/index.vue +++ b/src/views/planMonitor/editToolAUS/index.vue @@ -19,8 +19,10 @@ + + + + + + + + - +
-