提交 11a39ecc authored 作者: matian's avatar matian

chore:考试结束时间超过2037年,默认为2037-01-01 00:00:00

上级 a638f279
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
<el-checkbox v-model="config.enabled_after">限制结束 </el-checkbox> <el-checkbox v-model="config.enabled_after">限制结束 </el-checkbox>
开考后 开考后
<el-input v-model="config.after_login" class="input_time" :disabled="config.enabled_after === false"></el-input <el-input
v-model="config.after_login"
class="input_time"
:disabled="config.enabled_after === false"
></el-input
>分钟,不允许考生入场,考中退出的考生不受此影响。 >分钟,不允许考生入场,考中退出的考生不受此影响。
</el-row> </el-row>
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
...@@ -44,7 +48,12 @@ ...@@ -44,7 +48,12 @@
<v-editor v-model="config.welcome_message" class="editor"></v-editor> <v-editor v-model="config.welcome_message" class="editor"></v-editor>
</el-row> </el-row>
<el-row :span="24" class="btn_next row_margin"> <el-row :span="24" class="btn_next row_margin">
<el-button type="primary" v-if="$route.query.isEdit === '2'" @click="saveExamInfo">保存</el-button> <el-button
type="primary"
v-if="$route.query.isEdit === '2'"
@click="saveExamInfo"
>保存</el-button
>
<div v-if="isEdit === '1'"> <div v-if="isEdit === '1'">
<el-button type="primary" disabled>上一步</el-button> <el-button type="primary" disabled>上一步</el-button>
<el-button type="primary" @click="nextStep">下一步</el-button> <el-button type="primary" @click="nextStep">下一步</el-button>
...@@ -83,7 +92,14 @@ export default { ...@@ -83,7 +92,14 @@ export default {
return this.exam_time[0] return this.exam_time[0]
}, },
end_time() { end_time() {
if (
new Date('2037-01-01 00:00:00').getTime() <
new Date(this.exam_time[1]).getTime()
) {
return '2037-01-01 00:00:00'
} else {
return this.exam_time[1] return this.exam_time[1]
}
}, },
exam_id() { exam_id() {
return this.$route.query.exam_id return this.$route.query.exam_id
...@@ -96,7 +112,7 @@ export default { ...@@ -96,7 +112,7 @@ export default {
}, },
methods: { methods: {
getDetailInfo() { getDetailInfo() {
getExamPaperDetail({ id: this.exam_id }).then(res => { getExamPaperDetail({ id: this.exam_id }).then((res) => {
console.log(res) console.log(res)
const detailList = res.data.exam_info const detailList = res.data.exam_info
this.exam_time = [detailList.start_time, detailList.end_time] this.exam_time = [detailList.start_time, detailList.end_time]
...@@ -116,7 +132,11 @@ export default { ...@@ -116,7 +132,11 @@ export default {
this.$message.warning('请输入考试名称') this.$message.warning('请输入考试名称')
return return
} }
if ((!this.start_time && !this.end_time) || !this.start_time || !this.end_time) { if (
(!this.start_time && !this.end_time) ||
!this.start_time ||
!this.end_time
) {
this.$message.warning('请选择考试时间') this.$message.warning('请选择考试时间')
return return
} }
...@@ -162,7 +182,7 @@ export default { ...@@ -162,7 +182,7 @@ export default {
} }
} }
updateExam(params).then(res => { updateExam(params).then((res) => {
history.go(-1) history.go(-1)
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论