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

fix: viewer模块样式问题

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