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

bug fixes

上级 8fcb7a6a
......@@ -73,7 +73,9 @@ export default {
if (this.isRequestRemote || !list.length) {
list = await this.$store.dispatch('getQuestionCategory', { project_prefix: this.activeProject.tag })
}
this.$refs.select.options = list
if (this.$refs.select) {
this.$refs.select.options = list
}
this.options = list
this.$nextTick(this.setChecked)
},
......
......@@ -96,7 +96,7 @@ export default {
prop: 'paper_uses',
computed: ({ row }) => {
const map = { 1: '考试', 2: '课后作业', 3: '课程测试' }
return map[row.paper_type] || row.paper_type
return map[row.paper_uses] || row.paper_uses
}
},
{ label: '试卷分类', prop: 'paper_category.name', minWidth: 200 },
......
......@@ -154,14 +154,21 @@ export default {
// 提交
submitForm() {
this.ruleForm.children = this.chidrenList
// 子题目排序
const params = this.ruleForm
if (params.children && params.children.length) {
params.children = params.children.map((item, index) => {
return { ...item, question_order: index }
})
}
if (this.$route.query.id) {
updateQuestion(this.$route.query.id, this.ruleForm).then(res => {
updateQuestion(this.$route.query.id, params).then(res => {
this.$router.push({
path: '/question/list'
})
})
} else {
addQuestion(this.ruleForm).then(res => {
addQuestion(params).then(res => {
this.$router.push({
path: '/question/list'
})
......
......@@ -55,7 +55,7 @@ httpRequest.interceptors.response.use(
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}
// 没有权限
if (data.code === 4008) {
if (data.code === 4008 || data.code === 5018) {
router.push('/401')
}
// 题库分类修改
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论