yujialong 3 months ago
parent 24e44b22ca
commit 499ff58275
  1. 16
      src/layouts/navbar/index.vue
  2. 6
      src/pages/ques/detail/index.vue
  3. 15
      src/pages/testPaper/detail/index.vue

@ -53,7 +53,6 @@ export default {
// title: '' // title: ''
// }, // },
{ {
icon: 'user',
index: 'ques', index: 'ques',
title: '题库管理', title: '题库管理',
subs: [ subs: [
@ -68,7 +67,6 @@ export default {
] ]
}, },
{ {
icon: 'annex',
index: 'testPaper', index: 'testPaper',
title: '试卷管理', title: '试卷管理',
subs: [ subs: [
@ -91,6 +89,12 @@ export default {
]) ])
}, },
created () { created () {
const { path } = this.$route
if (path.includes('ques/') || path.includes('knowledge')) {
this.active = '/quesBank'
} else if (path.includes('testPaper/')) {
this.active = '/testPaperLibrary'
}
this.initMenu() this.initMenu()
}, },
methods: { methods: {
@ -100,13 +104,7 @@ export default {
// //
menuSelect (index) { menuSelect (index) {
this.collapse = false this.collapse = false
// this.$router.push(index)
if (index.includes('/')) {
this.$router.push(index)
} else {
this.active = '/user/list'
this.$router.push('/user/list')
}
}, },
// //
initMenu () { initMenu () {

@ -796,18 +796,18 @@ export default {
paperEdit && this.$emit('updateQues', form) paperEdit && this.$emit('updateQues', form)
Util.successMsg('保存成功') Util.successMsg('保存成功')
!form.questionId && this.keep ? this.init(form) : this.back() !form.questionId && this.keep ? this.init(form) : this.back(form.questionId)
this.repeatVisible = false this.repeatVisible = false
} finally { } finally {
this.submiting = false this.submiting = false
} }
}, },
back () { back (cache) {
if (this.paperType) { if (this.paperType) {
// //
this.$emit('closeAdd') this.$emit('closeAdd')
} else { } else {
this.questionId ? this.$router.push(this.$store.state.user.referrer2 || 'list') : this.$router.back() cache ? this.$router.push(this.$store.state.user.referrer2 || 'list') : this.$router.back()
} }
}, },
} }

@ -766,6 +766,7 @@ export default {
cur >= 0 && item.examQuestions.splice(cur, 1) cur >= 0 && item.examQuestions.splice(cur, 1)
}) })
item.checkAll = false item.checkAll = false
this.afterDelQues()
this.calcDifficult() this.calcDifficult()
} else { } else {
Util.warningMsg('请选择数据') Util.warningMsg('请选择数据')
@ -790,6 +791,17 @@ export default {
e.serialNumber = i + 1 e.serialNumber = i + 1
}) })
}, },
// ()
afterDelQues () {
if (this.repeatQues.length) {
const result = []
this.form.paperOutline.forEach(e => {
result.push(...e.examQuestions)
})
result.map(e => e.repeat = false)
this.hasRepeatQues(result)
}
},
// //
async delQues (item, i, noConfirm) { async delQues (item, i, noConfirm) {
try { try {
@ -803,6 +815,7 @@ export default {
} }
item.examQuestions.splice(i, 1) item.examQuestions.splice(i, 1)
item.checkAll = false item.checkAll = false
this.afterDelQues()
this.calcDifficult() this.calcDifficult()
} catch (e) { } } catch (e) { }
}, },
@ -1029,7 +1042,7 @@ export default {
}, },
// //
back () { back () {
this.$router.push(this.$store.state.user.referrer || 'list') this.$router.push(this.$store.state.user.referrer2 || 'list')
}, },
// //
drag () { drag () {

Loading…
Cancel
Save