提交 5b56bd37 authored 作者: matian's avatar matian

Merge remote-tracking branch 'origin/master'

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