|
@@ -44,31 +44,24 @@
|
|
|
<Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
|
|
|
<EventBasicInfo :info="nowActive" />
|
|
|
<div>
|
|
|
- <!-- 已提交 -->
|
|
|
- <div v-if="alreadyAnswered" style="text-align: center; padding-top: 15%;">
|
|
|
- <Icon type="md-checkmark-circle-outline" color="#00ad6c" size="80"/>
|
|
|
- <p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.already') }}</p>
|
|
|
- </div>
|
|
|
- <!-- 活动结束 -->
|
|
|
- <div v-if="!alreadyAnswered && surveyInfo.progress === 'finish'" style="text-align: center; padding-top: 15%;">
|
|
|
- <Icon type="md-stopwatch" color="#00ad6c" size="80"/>
|
|
|
- <p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.overtime') }}</p>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
<!--問卷完成後,在時間結束前仍可修改答案再提交-->
|
|
|
- <div v-if="surveyInfo.progress !== 'finish' && !alreadyAnswered">
|
|
|
+ <div style="margin-bottom: 100px;">
|
|
|
+ <div class="scoreboard" v-if="!alreadyAnswered && surveyInfo.progress === 'finish'">
|
|
|
+ <!-- 未作答 -->
|
|
|
+ <h4 style="padding: 25px;">
|
|
|
+ <svg-icon icon-class="handonHint" class="warm-icon" />
|
|
|
+ {{ $t('survey.studentWeb.noanswer') }}
|
|
|
+ </h4>
|
|
|
+ </div>
|
|
|
<!-- 描述 -->
|
|
|
<BillBoardandLightBox :activityData="surveyInfo" />
|
|
|
<!-- 内容 -->
|
|
|
- <div class="title-rect-group">
|
|
|
+ <div class="title-rect-group" style="margin-bottom: 20px;">
|
|
|
<!-- <div class="title-rect" /> -->
|
|
|
<h2 class="title-rect-name">{{ $t('survey.studentWeb.content') }}</h2>
|
|
|
</div>
|
|
|
- <br />
|
|
|
<!-- 问卷内容 -->
|
|
|
<div v-for="(item, index) in surveyInfo.items" :key="index" class="survey-item">
|
|
|
- <!-- <br /> -->
|
|
|
<div style="display: flex; font-weight: bold;">
|
|
|
<span>{{ index + 1 }}. </span>
|
|
|
<span v-html="item.question" @click="showImg($event)"></span>({{ typeList[item.type] }})<span></span>
|
|
@@ -77,7 +70,9 @@
|
|
|
<div v-if="item.type !== 'subjective'">
|
|
|
<div class="unitTestBtn" v-for="(option, optionIndex) in item.option" :key="optionIndex">
|
|
|
<div class="unitTestbg" @click="onOptionClick(item, index, option.code)"
|
|
|
- :style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent'}"
|
|
|
+ :style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent',
|
|
|
+ cursor: (alreadyAnswered || surveyInfo.progress === 'finish') ? 'not-allowed' : 'pointer'
|
|
|
+ }"
|
|
|
>
|
|
|
{{ option.code }}. <span v-html="option.value" style="margin-left: 10px;" @click="showImg($event)"></span>
|
|
|
</div>
|
|
@@ -85,13 +80,14 @@
|
|
|
</div>
|
|
|
<!-- 问答 -->
|
|
|
<div v-if="item.type === 'subjective'">
|
|
|
- <Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8" :placeholder="$t('studentWeb.exam.inputAnswers')" />
|
|
|
+ <Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8"
|
|
|
+ :placeholder="$t('studentWeb.exam.inputAnswers')"
|
|
|
+ :disabled="alreadyAnswered || surveyInfo.progress === 'finish'"
|
|
|
+ />
|
|
|
</div>
|
|
|
<Divider v-if="index != surveyInfo.items.length - 1" />
|
|
|
</div>
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- <button class="uploadBtn" @click="submitMessage()">
|
|
|
+ <button class="uploadBtn" @click="submitMessage()" v-if="!alreadyAnswered && surveyInfo.progress != 'finish'">
|
|
|
<svg-icon icon-class="quesnaire" class="uloadBtn-icon" />
|
|
|
<span>{{ $t('survey.studentWeb.submit') }}</span>
|
|
|
</button>
|
|
@@ -135,7 +131,7 @@
|
|
|
surveyInfo: { //问卷信息
|
|
|
items: []
|
|
|
},
|
|
|
- alreadyAnswered:false, //提交状态
|
|
|
+ alreadyAnswered: false, //提交状态
|
|
|
undo: 0,
|
|
|
showMessageNum: 0,
|
|
|
WarmMessageisOpen: false,
|
|
@@ -154,6 +150,7 @@
|
|
|
img: "",
|
|
|
show: false
|
|
|
},
|
|
|
+ answerRec: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -170,6 +167,9 @@
|
|
|
methods: {
|
|
|
// 非问答的答案
|
|
|
onOptionClick(item, index, code) {
|
|
|
+ if(this.alreadyAnswered || this.surveyInfo.progress === 'finish') {
|
|
|
+ return
|
|
|
+ }
|
|
|
if (this.submitArr[index].includes(code)) {
|
|
|
this.submitArr[index].splice(this.submitArr[index].indexOf(code), 1)
|
|
|
} else {
|
|
@@ -239,16 +239,18 @@
|
|
|
async getSurveyInfo() {
|
|
|
// this.surveyInfo = {}
|
|
|
this.isLoad = true
|
|
|
+ this.answerRec = []
|
|
|
if(this.getItemTitle.id) {
|
|
|
let params = {
|
|
|
"id": this.getItemTitle.id,
|
|
|
"code": this.getItemTitle.scode
|
|
|
}
|
|
|
let isAnswerd = await this.isAnswerd(params)
|
|
|
- if(!isAnswerd) {
|
|
|
+ // if(!isAnswerd) {
|
|
|
// 没有提交
|
|
|
this.$api.studentWeb.getSurveyInfo(params).then(async res => {
|
|
|
if (res) {
|
|
|
+ this.alreadyAnswered = isAnswerd
|
|
|
this.isLoad = false
|
|
|
if(res.status == 404) {
|
|
|
this.$Modal.confirm({
|
|
@@ -262,6 +264,9 @@
|
|
|
} else if(res.status == 200) {
|
|
|
this.surveyInfo = res.survey
|
|
|
this.surveyInfo.items = await this.getBlobItems(res.survey)
|
|
|
+ if(isAnswerd) {
|
|
|
+ this.answerRec = await this.getRecordItems(res.survey)
|
|
|
+ }
|
|
|
this.submitArr = []
|
|
|
this.surveyInfo.items.forEach(i => {
|
|
|
this.submitArr.push([])
|
|
@@ -272,10 +277,10 @@
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
- } else {
|
|
|
+ /* } else {
|
|
|
this.isLoad = false
|
|
|
this.alreadyAnswered = true
|
|
|
- }
|
|
|
+ } */
|
|
|
}
|
|
|
},
|
|
|
//放大图片
|
|
@@ -347,6 +352,19 @@
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ // 获取作答的内容
|
|
|
+ getRecordItems(qnItem) {
|
|
|
+ return new Promise(async (resolve, reject) => {
|
|
|
+ // let blobHost = this.$tools.getBlobHost()
|
|
|
+ let cntr = qnItem.scope === 'school' ? qnItem.school : qnItem.code.replace('Survey-','')
|
|
|
+ let sas = await this.$tools.getBlobSas(cntr)
|
|
|
+ let sasString = "?" + sas.sas
|
|
|
+ let blobHost = sas.url
|
|
|
+ let fullIndexJsonPath = blobHost + '/' + cntr + qnItem.recordUrl + sasString
|
|
|
+ let indexJson = await this.getBlobJsonFile(fullIndexJsonPath)
|
|
|
+ resolve(indexJson.urecord[0].ans)
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 获取blob里的问卷信息
|
|
|
getBlobJsonFile(indexJsonUrl) {
|
|
@@ -425,7 +443,14 @@
|
|
|
this.alreadyAnswered = false
|
|
|
this.getSurveyInfo()
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ answerRec: {
|
|
|
+ handler(n, o) {
|
|
|
+ // if(n.length) {
|
|
|
+ this.submitArr = n
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
computed: {
|