You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

81 lines
1.9 KiB

/**
* 试卷管理
* */
export default {
namespaced: true,
state: {
statusList: [
{
id: 0,
name: '未发布'
},{
id: 1,
name: '已发布'
}
],
effectList: [
{
id: 0,
label: '考试'
},{
id: 1,
label: '练习'
}
],
degreeList: [
{
id: 0,
label: '简单'
},{
id: 1,
label: '一般'
},{
id: 2,
label: '较难'
},{
id: 3,
label: '很难'
},
],
typeList: [
{
id: 0,
label: '手动组卷'
},{
id: 1,
label: '智能组卷'
}
],
id: '',
paperName: '',
totalDuration: '',
score: 100
},
getters: {
getStatusName: state => id => {
return id != null ? state.statusList.find(n => n.id == id).name : ''
},
getEffectName: state => id => {
return id != null ? state.effectList.find(n => n.id == id).label : ''
},
getDegreeName: state => id => {
return id != null ? state.degreeList.find(n => n.id == id).label : ''
},
getTypeName: state => id => {
return id != null ? state.typeList.find(n => n.id == id).label : ''
},
},
mutations: {
SET_INFO: (state, info) => {
state.id = info.id
state.paperName = info.paperName
state.totalDuration = info.totalDuration
state.score = info.score
},
},
actions: {
setInfo({ commit },info) {
commit('SET_INFO',info)
},
}
}