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

bug fixes

上级 05ff60fb
...@@ -68,17 +68,7 @@ ...@@ -68,17 +68,7 @@
</div> </div>
</div> </div>
<div class="buttons"> <div class="buttons">
<!-- 驳回的提交 --> <el-tooltip :content="$t('viewerWork.workSubmitButtonTips')" placement="right">
<el-popover placement="bottom" width="170" v-model="popoverVisible" v-if="detail.status === 1">
<p>本次作业提交后不可修改,您确认提交吗?</p>
<div style="text-align: right; margin-top: 10px">
<el-button size="mini" type="text" @click="popoverVisible = false">取消</el-button>
<el-button type="primary" size="mini" @click="onSubmit">确定提交</el-button>
</div>
<el-button type="primary" :disabled="disabled" slot="reference">{{ submitText }}</el-button>
</el-popover>
<!-- 正常提交 -->
<el-tooltip :content="$t('viewerWork.workSubmitButtonTips')" placement="right" v-else>
<el-button type="primary" :disabled="disabled" :loading="submitLoading" @click="onSubmit">{{ <el-button type="primary" :disabled="disabled" :loading="submitLoading" @click="onSubmit">{{
submitText submitText
}}</el-button> }}</el-button>
...@@ -343,6 +333,18 @@ export default { ...@@ -343,6 +333,18 @@ export default {
this.messageInstance = this.$message.error(this.$t('viewerWork.examSubmitError')) this.messageInstance = this.$message.error(this.$t('viewerWork.examSubmitError'))
return return
} }
// 驳回提交
if (this.detail.status === 1) {
this.$confirm('本次作业提交后不可修改,您确认提交吗?', '提示', {
confirmButtonText: '确定提交',
type: 'warning'
}).then(this.handleSubmit)
} else {
// 正常提交
this.handleSubmit()
}
},
handleSubmit() {
// 计算答题时间 // 计算答题时间
const duration = Math.floor((new Date().getTime() - this.startTime) / 1000) const duration = Math.floor((new Date().getTime() - this.startTime) / 1000)
// 提交的答案数据 // 提交的答案数据
...@@ -390,10 +392,12 @@ export default { ...@@ -390,10 +392,12 @@ export default {
// 重新编辑 // 重新编辑
onReEdit() { onReEdit() {
this.dialogVisible = false this.dialogVisible = false
if (this.detail.status === 1) {
window.location.hash = '#work'
return
}
if (this.detail.status2 === 1) { if (this.detail.status2 === 1) {
window.location.hash = '#comment' window.location.hash = '#comment'
} else {
window.location.hash = '#work'
} }
} }
}, },
......
...@@ -21,19 +21,7 @@ ...@@ -21,19 +21,7 @@
></el-form> ></el-form>
</template> </template>
<div class="button"> <div class="button">
<!-- 驳回的提交 --> <el-button type="primary" :disabled="disabled" @click="handleSubmit">{{
<el-popover placement="bottom" width="170" v-model="popoverVisible" v-if="status === 1">
<p>本次作业提交后不可修改,您确认提交吗?</p>
<div style="text-align: right; margin-top: 10px">
<el-button size="mini" type="text" @click="popoverVisible = false">取消</el-button>
<el-button type="primary" size="mini" @click="handleSubmit">确定提交</el-button>
</div>
<el-button type="primary" :disabled="disabled" slot="reference">{{
$t('viewerWork.commentSubmitText')
}}</el-button>
</el-popover>
<!-- 正常提交 -->
<el-button type="primary" :disabled="disabled" @click="handleSubmit" v-else>{{
$t('viewerWork.commentSubmitText') $t('viewerWork.commentSubmitText')
}}</el-button> }}</el-button>
<p>{{ $t('viewerWork.commentSubmitTips', { date: endDate }) }}</p> <p>{{ $t('viewerWork.commentSubmitTips', { date: endDate }) }}</p>
...@@ -121,7 +109,16 @@ export default { ...@@ -121,7 +109,16 @@ export default {
this.messageInstance = this.$message.error(this.$t('viewerWork.examSubmitError')) this.messageInstance = this.$message.error(this.$t('viewerWork.examSubmitError'))
return return
} }
this.handleSubmitReqeuest() // 驳回提交
if (this.status === 1) {
this.$confirm('本次作业提交后不可修改,您确认提交吗?', '提示', {
confirmButtonText: '确定提交',
type: 'warning'
}).then(this.handleSubmitReqeuest)
} else {
// 正常提交
this.handleSubmitReqeuest()
}
}, },
handleSubmitReqeuest() { handleSubmitReqeuest() {
const params = this.list.map(({ id, comment }) => { const params = this.list.map(({ id, comment }) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论