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

chore: 试卷批阅修改为Drawer 抽屉弹出

上级 321cc967
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
controls-position="right" controls-position="right"
:min="0" :min="0"
:max="questionData.score" :max="questionData.score"
size="mini" size="mini"></el-input-number>
></el-input-number>
</div> </div>
</div> </div>
<el-input <el-input
...@@ -46,8 +45,7 @@ ...@@ -46,8 +45,7 @@
placeholder="请输入评语" placeholder="请输入评语"
v-model="questionData.comment" v-model="questionData.comment"
rows="3" rows="3"
:disabled="questionData.checked_flag" :disabled="questionData.checked_flag" />
/>
<div style="text-align: center; padding-top: 10px"> <div style="text-align: center; padding-top: 10px">
<el-button type="primary" size="mini" @click="fetchComment" :disabled="questionData.checked_flag" <el-button type="primary" size="mini" @click="fetchComment" :disabled="questionData.checked_flag"
>提交点评</el-button >提交点评</el-button
...@@ -74,7 +72,6 @@ export default { ...@@ -74,7 +72,6 @@ export default {
}, },
data() { data() {
return { return {
bc: null,
questionData: {}, questionData: {},
showComment: false, showComment: false,
comment: '' comment: ''
...@@ -98,9 +95,6 @@ export default { ...@@ -98,9 +95,6 @@ export default {
created() { created() {
this.questionData = JSON.parse(JSON.stringify(this.question.item)) this.questionData = JSON.parse(JSON.stringify(this.question.item))
}, },
destroyed() {
this.bc && this.bc.close()
},
methods: { methods: {
fetchComment() { fetchComment() {
const params = { const params = {
...@@ -116,8 +110,6 @@ export default { ...@@ -116,8 +110,6 @@ export default {
} else { } else {
this.$message.success('提交点评失败') this.$message.success('提交点评失败')
} }
this.bc = new BroadcastChannel('exam')
this.bc.postMessage({ action: 'refetch' })
}) })
} }
} }
......
...@@ -48,12 +48,9 @@ ...@@ -48,12 +48,9 @@
</el-dropdown> </el-dropdown>
</div> </div>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<router-link <el-button type="text" @click="handleView(row)" v-permission="'admin_exam_exam_sheet_detail'"
:to="{ path: 'markingPaper', query: { eid: exam_id, sid: row.student_id } }" >查看详情</el-button
v-permission="'admin_exam_exam_sheet_detail'"
> >
<el-button type="text">查看详情</el-button>
</router-link>
</template> </template>
<el-dialog title="转移考生" :visible.sync="dialogVisible" width="40%"> <el-dialog title="转移考生" :visible.sync="dialogVisible" width="40%">
<div> <div>
...@@ -73,10 +70,18 @@ ...@@ -73,10 +70,18 @@
</el-dialog> </el-dialog>
</app-list> </app-list>
<input type="text" style="opacity: 0" id="copyInput" /> <input type="text" style="opacity: 0" id="copyInput" />
<el-drawer title="批阅试卷" :visible.sync="drawer" append-to-body destroy-on-close size="80%" @close="refetchList">
<MarkingPaper
:exam_id="exam_id"
:student_id="currentRow.student_id"
style="margin: 0 20px"
v-if="currentRow && drawer"></MarkingPaper>
</el-drawer>
</app-card> </app-card>
</template> </template>
<script> <script>
import MarkingPaper from './MarkingPaper.vue'
import { import {
getExamPaperDetail, getExamPaperDetail,
deleteStudent, deleteStudent,
...@@ -96,6 +101,7 @@ const stuStatus = [ ...@@ -96,6 +101,7 @@ const stuStatus = [
] ]
export default { export default {
components: { MarkingPaper },
data() { data() {
return { return {
visible: false, visible: false,
...@@ -103,7 +109,8 @@ export default { ...@@ -103,7 +109,8 @@ export default {
dialogVisible: false, dialogVisible: false,
transferList: [], transferList: [],
transfer_exam_id: '', transfer_exam_id: '',
bc: null drawer: false,
currentRow: null
} }
}, },
computed: { computed: {
...@@ -287,20 +294,20 @@ export default { ...@@ -287,20 +294,20 @@ export default {
this.$message.success('考生转移成功') this.$message.success('考生转移成功')
this.dialogVisible = false this.dialogVisible = false
}) })
},
// 刷新列表
refetchList() {
// 刷新列表
this.$refs.list.refetch()
},
handleView(row) {
this.currentRow = row
this.drawer = true
} }
}, },
mounted() { mounted() {
// 获取转移列表 // 获取转移列表
this.getTransferList() this.getTransferList()
this.bc = new BroadcastChannel('exam')
this.bc.onmessage = ({ data }) => {
if (data.action === 'refetch') {
this.$refs.list.refetch()
}
}
},
destroyed() {
this.bc && this.bc.close()
} }
} }
</script> </script>
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
:options="{ item, sheet_id: questionData.sheet_id, question_item_id: item.question_item_id }" :options="{ item, sheet_id: questionData.sheet_id, question_item_id: item.question_item_id }"
:question_item_id="item.question_item_id" :question_item_id="item.question_item_id"
:key="item.question_item_id" :key="item.question_item_id"
v-for="item in questionList" v-for="item in questionList" />
/>
</div> </div>
</template> </template>
...@@ -13,7 +12,7 @@ ...@@ -13,7 +12,7 @@
import { getPaperDetails } from '../api.js' import { getPaperDetails } from '../api.js'
import PaperQuestion from '../components/PaperQuestion.vue' import PaperQuestion from '../components/PaperQuestion.vue'
export default { export default {
// props: { id: { type: String } }, props: { exam_id: { type: String }, student_id: { type: String } },
components: { PaperQuestion }, components: { PaperQuestion },
data() { data() {
return { return {
...@@ -23,10 +22,10 @@ export default { ...@@ -23,10 +22,10 @@ export default {
}, },
computed: { computed: {
eid() { eid() {
return this.$route.query.eid return this.exam_id || this.$route.query.eid
}, },
sid() { sid() {
return this.$route.query.sid return this.student_id || this.$route.query.sid
} }
}, },
beforeMount() { beforeMount() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论