From 36ee391002b46deca205c3c9cdf63de5f8a0861e Mon Sep 17 00:00:00 2001 From: 阳洁 <2077506045@qq.com> Date: 星期四, 29 二月 2024 16:01:20 +0800 Subject: [PATCH] 修改APIFan为API_Fan --- src/views/exam/paper/personality.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/views/exam/paper/personality.vue b/src/views/exam/paper/personality.vue index aaaf683..4422e2a 100644 --- a/src/views/exam/paper/personality.vue +++ b/src/views/exam/paper/personality.vue @@ -142,12 +142,10 @@ _this.initAnswer() _this.formLoading = false _this.memberName = _this.form.memberName - examPaperApi.selectTokenId(_this.memberToken).then(re => { _this.answered = re.response.examItemOrderAndContentList _this.doTime = re.response.doTime _this.timeReduce() - if (_this.answered !== null) { _this.answered.forEach(it => { _this.answer.answerItems[parseInt(it.itemOrder) - 1].content = it.content @@ -166,7 +164,7 @@ } if (_this.isForFinish(i)) { - _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg') } }) + _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg'), tokenId: _this.memberToken } }) } } // 濡傛灉涓婁竴棰樹笉鏄湰娈碉紝鍒欎笉鑳借繑鍥炰笂涓�娈� @@ -187,11 +185,26 @@ ).catch(e => { }) } + }, mounted () { }, beforeDestroy () { window.clearInterval(this.timer) + }, + watch: { + guideDescirption: function (newVal, oldVal) { + // 澶勭悊鎸囧璇紝鏇存崲鍙橀噺 + if (newVal) { + if (this.form) { + let productType = this.form.productType + if (productType === 'API_Fan') { + newVal = newVal.replace('%%company%%', this.form.reportCompany) + this.guideDescirption = newVal + } + } + } + } }, methods: { formatSeconds (theTime) { @@ -402,6 +415,13 @@ let _this = this _this.isShowGuide(false) if (_this.order > 0) { + // 娓呯┖鏈鐨勯�夋嫨 + _this.answer.answerItems[_this.order].content = null + _this.answer.answerItems[_this.order].completed = false + _this.answer.answerItems[_this.order].questionReport = null + _this.answer.answerItems[_this.order].readOnly = false + + // 璁剧疆鍥炲埌涓婁竴棰� let num = --_this.order _this.itemOrder = _this.form.titleItems[0].questionItems[num].itemOrder _this.questionItem = _this.form.titleItems[0].questionItems[num] @@ -420,7 +440,9 @@ for (let i = 0; i < _this.answer.answerItems.length; i++) { if (_this.answer.answerItems[i].content === null) { unFinish = true - _this.answer.finish = 0 + // 鏈夋湭瀹屾垚鐨勭瓟棰樺簲璇ユ槸 2绛旈涓� + // 涔嬪墠鏄�0鏈鐞� + _this.answer.finish = 2 } } if (unFinish) { @@ -440,7 +462,16 @@ } else { _this.answer.verifyStatus = 1 _this.answer.finish = 1 - _this.submitAnswer(_this.$t('finishPersonalityInfo')) + if (this.form) { + let productType = this.form.productType + if (productType === 'API_Fan') { + _this.submitAnswer(_this.$t('finishPersonalityInfo_apifan')) + } else { + _this.submitAnswer(_this.$t('finishPersonalityInfo')) + } + } else { + _this.submitAnswer(_this.$t('finishPersonalityInfo')) + } } }, startDo: function () { @@ -462,7 +493,18 @@ examPaperAnswerApi.answerSubmit(answerSubmit, _this.memberToken).then(re => { loading.close() if (re.code === 1) { - _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } }) + // 鐗规畩澶勭悊 LAQ娴嬭瘯鍖� MAQ+CAQ + if (_this.form.name.indexOf('LAQ') !== -1) { + console.log('绛斿畬棰�,鐪嬬湅瑕佷笉瑕佸幓CAQ1') + examPaperApi.select(_this.memberToken, _this.langType).then(re => { + _this.form = re.response + _this.$router.push({ path: '/guide/index', query: { formDo: _this.form } }) + }).catch(e => { + _this.$message.error(_this.$t('noquestionMsg')) + }) + } else { + _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } }) + } } else { _this.$message.error(re.message + '/exam/finish') } -- Gitblit v1.9.1