From ceef20681f390c5bf0595899884fec4c62cbe379 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 20 Oct 2020 16:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E8=AE=BA=E9=A2=98=E8=B0=83=E6=95=B4&?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E8=B0=83=E6=95=B4&?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=AE=A4=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project.js | 8 + src/i18n/langs/en/router.js | 3 +- src/i18n/langs/zh/router.js | 3 +- src/router/index_Common.js | 9 + src/scripts/ConstConfig.js | 8 +- src/scripts/cmdPlugin/Config.js | 4 +- src/utils/baseUrl.js | 4 +- src/utils/request.js | 1 - .../bankList/dialog-modify-rich.vue | 1 - .../competitionManage/bankList/index.vue | 50 +- .../bankList/item-answer.vue | 72 +- .../bankList/item-options.vue | 2 +- .../bankList/question-form.vue | 25 +- .../bankList/question-update-page.vue | 2 +- src/views/login/index.vue | 20 +- src/views/newMap/chatView/chatBox.vue | 1 + src/views/newMap/jointTrainingNew/index.vue | 7 + .../newMap/jointTrainingNew/menuDemon.vue | 8 +- .../newMap/jointTrainingNew/menuSchema.vue | 6 +- .../system/deviceManage/editConfigGateway.vue | 483 +-------- .../system/deviceManage/editConfigIbp.vue | 986 +----------------- .../system/deviceManage/editConfigScreen.vue | 24 +- src/views/system/deviceManage/index.vue | 4 +- src/views/system/questionsRuleManage/add.vue | 167 +++ .../system/questionsRuleManage/index.vue | 177 ++++ 25 files changed, 588 insertions(+), 1487 deletions(-) create mode 100644 src/views/system/questionsRuleManage/add.vue create mode 100644 src/views/system/questionsRuleManage/index.vue diff --git a/src/api/project.js b/src/api/project.js index d80bfdab0..0d4dcf09c 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -183,3 +183,11 @@ export function setSandboxConfig(id, data) { data: data }); } +/** 添加/修改联锁工作站配置 */ +export function setIlwConfig(id, data) { + return request({ + url: `/api/device/${id}/config/ilw`, + method: 'put', + data: data + }); +} diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index 16a83c9e6..aeca8ae18 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -84,5 +84,6 @@ export default { sceneManage:'Scene manage', companyManage: 'Company manage', authorApply: 'Grant application', - AuthorList: 'Authorization code list' + AuthorList: 'Authorization code list', + questionsRuleManage: 'Question rule manage' }; diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index cd19957eb..4d60a73cf 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -89,5 +89,6 @@ export default { sceneManage:'场景列表', companyManage: '单位管理', authorApply: '授权申请', - AuthorList: '授权列表' + AuthorList: '授权列表', + questionsRuleManage: '出题规则管理' }; diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 9a767a63b..4077a1a95 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -151,6 +151,7 @@ const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeDisplay = () => import('@/views/jsxt/refereeList/display'); const Approval = () => import('@/views/approval/index'); const CompanyManage = () => import('@/views/system/companyManage/index'); +const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/index'); import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { getSessionStorage } from '@/utils/auth'; @@ -814,6 +815,14 @@ export const asyncRouter = [ i18n: 'router.companyManage' } }, + { // 出题规则管理 + path: 'questionsRuleManage', + hidden: true, + component: QuestionsRuleManage, + meta: { + i18n: 'router.questionsRuleManage' + } + }, { // 缓存管理 path: 'cache', diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 5d3f54a54..781b5d0ed 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -185,7 +185,10 @@ export default { QuestionTypeList: [ { label: '选择题', value: 'select' }, - { label: '判断题', value: 'judge' } + { label: '判断题', value: 'judge' }, + { label: '多选题', value: 'multi'}, + { label: '填空题', value: 'fill'}, + { label: '问答题', value: 'answer'} ], // 新版的产品类型枚举 prdType:[ @@ -238,7 +241,8 @@ export default { {label: 'PLC网关', value: 'PLC_GATEWAY'}, {label: '端头控制盒', value: 'PSL'}, {label: 'PSC控制柜', value: 'PSC'}, - {label: '虚拟电子沙盘', value: 'SANDBOX'} + {label: '虚拟电子沙盘', value: 'SANDBOX'}, + {label: '联锁工作站', value: 'ILW'} ] } }; diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js index 5e2394321..1dca7fcd9 100644 --- a/src/scripts/cmdPlugin/Config.js +++ b/src/scripts/cmdPlugin/Config.js @@ -36,7 +36,9 @@ export const deviceFaultType = { {label: '主灯丝熔断故障', value: 'MAIN_FILAMENT_BROKEN'} ], Switch: [ - {label: '失表', value: 'SPLIT'} + {label: '失表', value: 'SPLIT'}, + {label: '定位失表', value: 'NORMAL_SPLIT'}, + {label: '反位失表', value: 'REVERSE_SPLIT'} ], StationStand: [ {label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'} diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 5c17a46dd..db12f65e4 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - // BASE_API = 'http://192.168.3.169:9000'; // 旭强 + BASE_API = 'http://192.168.3.169:9000'; // 旭强 // BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/utils/request.js b/src/utils/request.js index e293226ee..08b9ab4e1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -43,7 +43,6 @@ service.interceptors.response.use( response => { /** code为非200是抛错 可结合自己业务进行修改*/ const res = response.data; - console.log(res, '22222222'); if (res.code != 200) { // 90005 无授权 90001 授权过期 if (res.code == 90005 || res.code == 90001) { diff --git a/src/views/competitionManage/bankList/dialog-modify-rich.vue b/src/views/competitionManage/bankList/dialog-modify-rich.vue index e41791c43..e690f8e8f 100644 --- a/src/views/competitionManage/bankList/dialog-modify-rich.vue +++ b/src/views/competitionManage/bankList/dialog-modify-rich.vue @@ -38,7 +38,6 @@ export default { doInput() { const node = this.node; node.model[node.prop] = this.content; - this.$emit('update', node.model); this.doClose(); } } diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue index aa13ca0ba..ce3c7b146 100644 --- a/src/views/competitionManage/bankList/index.vue +++ b/src/views/competitionManage/bankList/index.vue @@ -26,6 +26,7 @@ export default { queryForm: { reset: true, labelWidth: '80px', + leftSpan: 17, queryObject: { type: { type: 'select', @@ -63,7 +64,7 @@ export default { title: '答 案', prop: 'answer', type: 'tagMore', - width: '100', + width: '200', columnValue: (row) => { return this.answerTags(row); }, tagType: (row) => { return ''; @@ -77,7 +78,7 @@ export default { { type: 'button', title: '操 作', - width: '420', + width: '320', buttons: [ { name: '编辑', @@ -98,7 +99,8 @@ export default { ], actions: [ { text: '添 加', handler: this.doCreate }, - { text: '导 入', fileType: 'file', handler: this.importQuestionBank } + { text: '导 入', fileType: 'file', handler: this.importQuestionBank }, + { text: '出题规则管理', handler: this.questionsRuleManage} ] } }; @@ -149,6 +151,17 @@ export default { answer.push(el.content); } break; + case 'multi': + if (el.correct) { + answer.push(this.$asc2chart(i + 65)); + } + break; + case 'fill': + answer.push(el.content); + break; + case 'answer': + answer.push(el.content); + break; } }); return answer; @@ -161,7 +174,9 @@ export default { const questionTypeMap = { '单选': 'select', '多选': 'multi', - '判断': 'judge' + '判断': 'judge', + '填空': 'fill', + '问答': 'answer' }; if (file) { setTimeout(() => { @@ -216,13 +231,23 @@ export default { topic: dataList[topicIndex][index], optionList: [] }; - 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')}); + 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); } @@ -250,6 +275,9 @@ export default { if (!obj.files) return; const f = obj.files[0]; this.handleImport(f); + }, + questionsRuleManage() { + this.$router.push({ path: `/system/questionsRuleManage`}); } } }; diff --git a/src/views/competitionManage/bankList/item-answer.vue b/src/views/competitionManage/bankList/item-answer.vue index 9f44910e3..648eef1b6 100644 --- a/src/views/competitionManage/bankList/item-answer.vue +++ b/src/views/competitionManage/bankList/item-answer.vue @@ -11,18 +11,37 @@ × - + + + + + diff --git a/src/views/system/questionsRuleManage/index.vue b/src/views/system/questionsRuleManage/index.vue new file mode 100644 index 000000000..61d1096dc --- /dev/null +++ b/src/views/system/questionsRuleManage/index.vue @@ -0,0 +1,177 @@ + + + + +