From eb7dd84c488c1b5eb0cf23a452301ac02ea1595a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 27 May 2020 11:07:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=AE=9E=E6=93=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/competitionManage/generatePaper.vue | 27 ++- .../competitionManage/operateQuestion.vue | 218 ++++++++++++++++++ src/views/competitionManage/theoryReview.vue | 22 +- 3 files changed, 232 insertions(+), 35 deletions(-) create mode 100644 src/views/competitionManage/operateQuestion.vue diff --git a/src/views/competitionManage/generatePaper.vue b/src/views/competitionManage/generatePaper.vue index bc4b5e10b..124c7df3f 100644 --- a/src/views/competitionManage/generatePaper.vue +++ b/src/views/competitionManage/generatePaper.vue @@ -49,7 +49,7 @@
实操试题列表 - 添加试题 + 添加试题 预览
- - + prop="name" + label="实操名称" + /> + diff --git a/src/views/competitionManage/theoryReview.vue b/src/views/competitionManage/theoryReview.vue index f7b52b3f0..efc2d4be4 100644 --- a/src/views/competitionManage/theoryReview.vue +++ b/src/views/competitionManage/theoryReview.vue @@ -57,27 +57,7 @@ export default { status: '', totalScore: 0, passScore: 10 - }, - examQuestions: [ - { - topic: 'PH玻璃电极只能在5~60℃范围内使用,而且还应通过温度校正装置来消除影响。', - type: 'judge', - optionList: [ - {id: '160', content: '√', correct: true}, - {id: '161', content: '×', correct: false} - ] - }, - { - topic: '调度工作是( ___ )工作中的一个重要组成部分。', - type: 'select', - optionList: [ - {id: '40', content: '煤矿管理', correct: false}, - {id: '41', content: '企业管理', correct: true}, - {id: '42', content: '安全生产', correct: false}, - {id: '43', content: '生产组织', correct: false} - ] - } - ] + } }; }, computed: { From a585fecf3b57e6201d31943f136e15fc104b041f Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 27 May 2020 11:15:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4focus=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/directive/focus/focus.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/directive/focus/focus.js b/src/directive/focus/focus.js index 7c3b68b65..512c0d1df 100644 --- a/src/directive/focus/focus.js +++ b/src/directive/focus/focus.js @@ -1,18 +1,21 @@ export default { - // 当被绑定的元素插入到 DOM 中时 - inserted: function (el, obj) { - // 这是需要页面刚加载就能进行聚焦操作使用的钩子函数,可以省略的,视具体需求而定 - // 对值进行判断 - if (obj.value) { - // 聚焦元素 - el.focus(); - } - }, - // 当指令所在组件的 VNode 及其子 VNode 全部更新后调用 - // 这是每当绑定的值发生改变时触发的钩子函数 - componentUpdated: function (el, obj) { - if (obj.value) { - el.focus(); - } - } + // 当被绑定的元素插入到 DOM 中时 + inserted: function (el, obj) { + // 这是需要页面刚加载就能进行聚焦操作使用的钩子函数,可以省略的,视具体需求而定 + // 对值进行判断 + const dom = el.querySelector('input') || el.querySelector('textarea'); + dom.focus(); + // el.focus(); + // if (obj.value) { + // // 聚焦元素 + // el.focus(); + // } + }, + // 当指令所在组件的 VNode 及其子 VNode 全部更新后调用 + // 这是每当绑定的值发生改变时触发的钩子函数 + componentUpdated: function (el, obj) { + if (obj.value) { + el.focus(); + } + } };