提交 286ac677 authored 作者: 王鹏飞's avatar 王鹏飞

fix: viewer模块样式问题

上级 8601259f
<template>
<container :title="chapter.name" v-loading="loading">
<div class="exam-form">
......@@ -14,7 +13,7 @@
></exam-item>
</el-form>
</div>
<p style="color:red;" v-if="deadline">请于截止日期 {{deadline}} 前提交</p>
<p style="color:red;" v-if="deadline">请于截止日期 {{ deadline }} 前提交</p>
<!-- 驳回状态 -->
<template v-if="detail && detail.status === 1">
<div class="work-bottom">
......@@ -23,7 +22,7 @@
<h4>作业被驳回,点击“重新编辑”按钮重新编辑内容再次提交</h4>
<div class="paper-check-item">
<b>驳回时间:</b>
{{detail.checker_time}}
{{ detail.checker_time }}
</div>
<div class="paper-check-item">
<b>驳回说明:</b>
......@@ -33,7 +32,9 @@
</div>
</div>
<div class="buttons">
<el-button type="primary" @click="onReEdit" :disabled="!isWorkTime">重新编辑</el-button>
<el-button type="primary" @click="onReEdit" :disabled="!isWorkTime"
>重新编辑</el-button
>
</div>
</template>
<!-- 正常状态 -->
......@@ -42,10 +43,10 @@
<div class="info">
<template v-if="isRevised">
<div class="paper-check">
<p>批改时间:{{detail.checker_time}}</p>
<p>批改时间:{{ detail.checker_time }}</p>
<div class="paper-check-item">
<b>评分:</b>
{{detail.score}}
{{ detail.score }}
</div>
<div class="paper-check-item">
<b>评语:</b>
......@@ -54,20 +55,31 @@
</div>
</template>
<template v-else-if="detail.created_time">
<p class="help">已于 {{detail.created_time}} 提交,等待老师批改中。</p>
<template v-if="detail.updated_time && detail.updated_time !== detail.created_time">
<p class="help">最近提交时间: {{detail.updated_time}}</p>
<p class="help">
已于 {{ detail.created_time }} 提交,等待老师批改中。
</p>
<template
v-if="
detail.updated_time &&
detail.updated_time !== detail.created_time
"
>
<p class="help">最近提交时间: {{ detail.updated_time }}</p>
</template>
</template>
</div>
</div>
<div class="buttons">
<el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right">
<el-tooltip
content="在获老师批改之前,可以多次提交,将以最后一次提交为准"
placement="right"
>
<el-button
type="primary"
@click="onSubmit"
:disabled="disabled || !isWorkTime"
>{{submitText}}</el-button>
>{{ submitText }}</el-button
>
</el-tooltip>
</div>
</template>
......@@ -165,7 +177,7 @@ export default {
getDeadline() {
api
.getChapterHomeworkDeadline(this.sid, this.cid, this.pid)
.then(response => {
.then((response) => {
this.deadline = response.dead_line
})
},
......@@ -174,16 +186,16 @@ export default {
this.loading = true
api
.getChapterHomework(this.sid, this.cid, this.resourceId)
.then(response => {
.then((response) => {
this.detail = Array.isArray(response) ? null : response
if (this.detail) {
// -1未处理 0已处理 1驳回
this.disabled = [0, 1].includes(this.detail.status)
const parseAnswers = JSON.parse(this.detail.work_contents)
// 设置答案
this.questions = this.questions.map(item => {
this.questions = this.questions.map((item) => {
const found = parseAnswers.find(
answer => answer.question_id === item.id
(answer) => answer.question_id === item.id
)
if (found) {
item.user_answer = found.descreption
......@@ -203,7 +215,7 @@ export default {
if (!list) {
return []
}
return list.map(item => {
return list.map((item) => {
let temp = null
if (item.question_type === 1) {
// 单选
......@@ -264,7 +276,7 @@ export default {
(new Date().getTime() - this.startTime) / 1000
)
// 提交的答案数据
const answers = this.questions.map(item => {
const answers = this.questions.map((item) => {
return {
question_id: item.id,
descreption:
......@@ -291,7 +303,7 @@ export default {
handleSubmitRequest(params) {
api
.sbumitChapterHomework(params)
.then(response => {
.then((response) => {
if (response.status) {
this.$message.success('提交成功,等待批改')
this.getDetail()
......@@ -299,7 +311,7 @@ export default {
this.$message.error(response.data.error)
}
})
.catch(error => {
.catch((error) => {
this.$message.error(error.message)
})
},
......@@ -340,5 +352,8 @@ export default {
}
.paper-check-item {
display: flex;
b {
white-space: nowrap;
}
}
</style>
......@@ -231,5 +231,8 @@ p {
}
.paper-check-item {
display: flex;
b {
white-space: nowrap;
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论