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.
95 lines
2.4 KiB
95 lines
2.4 KiB
/** |
|
* 试卷管理 |
|
* */ |
|
export default { |
|
namespaced: true, |
|
state: { |
|
typeList: [ |
|
{ |
|
id: 1, |
|
name: '期中考试' |
|
},{ |
|
id: 2, |
|
name: '期末考试' |
|
},{ |
|
id: 3, |
|
name: '模拟考' |
|
} |
|
], |
|
stateList: [ |
|
{ |
|
id: 0, |
|
name: '待开始' |
|
},{ |
|
id: 1, |
|
name: '进行中' |
|
},{ |
|
id: 2, |
|
name: '已提交' |
|
} |
|
], |
|
assessmentStateList: [ |
|
{ |
|
id: 1, |
|
name: '待开始' |
|
},{ |
|
id: 2, |
|
name: '进行中' |
|
},{ |
|
id: 3, |
|
name: '已结束' |
|
} |
|
], |
|
degreeList: [ |
|
{ |
|
id: 0, |
|
label: '简单' |
|
},{ |
|
id: 1, |
|
label: '一般' |
|
},{ |
|
id: 2, |
|
label: '较难' |
|
},{ |
|
id: 3, |
|
label: '很难' |
|
}, |
|
], |
|
assessmentName: '', |
|
testPaperId: '', |
|
assessmentId: '', |
|
teacherId: '', |
|
classId: '', |
|
paperName: '', |
|
duration: '' |
|
}, |
|
getters: { |
|
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).name : '' |
|
}, |
|
getStateName: state => id => { |
|
return id != null ? state.stateList.find(n => n.id == id).name : '' |
|
}, |
|
getAssessmentStateName: state => id => { |
|
return id != null ? state.assessmentStateList.find(n => n.id == id).name : '' |
|
}, |
|
}, |
|
mutations: { |
|
SET_INFO: (state, info) => { |
|
state.assessmentName = info.assessmentName |
|
state.assessmentId = info.assessmentId |
|
state.teacherId = info.teacherId |
|
state.classId = info.classId |
|
state.testPaperId = info.testPaperId |
|
state.duration = info.duration |
|
}, |
|
}, |
|
actions: { |
|
setInfo({ commit },info) { |
|
commit('SET_INFO',info) |
|
}, |
|
} |
|
} |