|
|
@@ -421,7 +421,7 @@ export default {
|
|
|
userList,
|
|
|
paperTypeOptions,
|
|
|
level: level.second || level.first,
|
|
|
- deptList: deptList.filter(i => i.depth === 4),
|
|
|
+ deptList: deptList.filter(i => i.path_id.split('.')[1] && i.positionName !== '客户'),
|
|
|
title: this.readonly ? '题库明细' : this.id ? '编辑题库' : '创建题库',
|
|
|
formLabelWidth: '150px',
|
|
|
dialogVisible: this.visible,
|
|
|
@@ -496,7 +496,7 @@ export default {
|
|
|
},
|
|
|
quesIdList: {
|
|
|
handler (val, oldVal) {
|
|
|
- this.addSelectQuestion(val)
|
|
|
+ this.addSelectQuestion(val, oldVal)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -628,11 +628,13 @@ export default {
|
|
|
this.form = bank
|
|
|
})
|
|
|
},
|
|
|
- addSelectQuestion () {
|
|
|
+ addSelectQuestion (val, oldVal) {
|
|
|
const sql = `select id_ as quesId, chu_ti_ren_ as creator, bu_men_ as createDept, chu_ti_shi_jian_ as createTime, xu_hao_ as sn, ti_gan_ as content, ti_xing_ as quesType, fu_tu_ as img, xuan_xiang_lei_xi as optionType, da_an_ as answer, zheng_que_da_an_ as rightKey, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, fen_zhi_ as score, bei_zhu_ as note, xuan_xiang_shu_ as optionCount, biao_qian_ as quesTag, zhuang_tai_ as quesState,nan_du_ as questionLevel from t_questions where find_in_set(id_, '${this.quesIdList}')`
|
|
|
this.$common.request('sql', sql).then(res => {
|
|
|
const { data = [] } = res.variables || {}
|
|
|
- this.questionData = data.concat(this.questionData)
|
|
|
+ const dataList = data.filter(item => !oldVal.includes(item.quesId))
|
|
|
+ const oldeDataList = this.questionData.filter(item => val.split(',').includes(item.quesId))
|
|
|
+ this.questionData = oldeDataList.concat(dataList)
|
|
|
})
|
|
|
},
|
|
|
handleSubmit () {
|
|
|
@@ -713,12 +715,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
submitForm () {
|
|
|
+ const { deptList = [] } = this.$store.getters || {}
|
|
|
if (this.form.limitTime === '0') {
|
|
|
this.form.kao_shi_shi_chang = '不限'
|
|
|
} else {
|
|
|
this.form.kao_shi_shi_chang = (this.formatNum(this.form.hours) * 60 + this.formatNum(this.form.minutes)) * 60 * 1000
|
|
|
}
|
|
|
- this.form.bian_zhi_bu_men_ = this.form.suo_shu_fan_wei_ === '科级' ? '' : this.form.bian_zhi_bu_men_
|
|
|
+ this.form.bian_zhi_bu_men_ = this.form.suo_shu_fan_wei_ === '科级' ? deptList.filter(i => !i.path_id.split('.')[1])[0].positionId : this.form.bian_zhi_bu_men_
|
|
|
this.form.di_dian_ = this.level
|
|
|
this.form.ping_fen_ren_ = this.form.ping_fen_ren_ ? this.form.ping_fen_ren_.join(',') : ''
|
|
|
delete this.form.isLimit
|