|
|
|
@ -40,6 +40,17 @@ |
|
|
|
|
></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>课程</label> |
|
|
|
|
<el-select v-model="queryData.cid" @change="courseChange"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in curriculumList" |
|
|
|
|
:key="item.cid" |
|
|
|
|
:label="item.curriculumName" |
|
|
|
|
:value="item.cid"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>系统</label> |
|
|
|
|
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
|
|
|
@ -132,11 +143,15 @@ export default { |
|
|
|
|
roleIdEd: this.roleId ? 13 : this.roleId,// 管理员的roleId是13,老师的roleId是14,1个用户也可能是两个角色,就是13,14,当一个用户是两个角色的话,就取权重大的一个,就是管理员,即13;管理员>老师 |
|
|
|
|
systemId: "", |
|
|
|
|
systemList: [], |
|
|
|
|
systemListAll: [], |
|
|
|
|
curriculumId: '', |
|
|
|
|
curriculumList: [], |
|
|
|
|
queryData: { |
|
|
|
|
platformId: 1, // 平台:职站:1 中台:3 |
|
|
|
|
founder: 2, // 创建人角色(0:系统 1:老师 2:全部) |
|
|
|
|
state: "", // 状态(0:草稿箱 1:已发布) |
|
|
|
|
permissions: "" // 项目权限(0:练习 1:考核 2:竞赛) |
|
|
|
|
permissions: "", // 项目权限(0:练习 1:考核 2:竞赛) |
|
|
|
|
cid: '' |
|
|
|
|
}, |
|
|
|
|
keyword: "", |
|
|
|
|
status: "", |
|
|
|
@ -247,13 +262,10 @@ export default { |
|
|
|
|
}), |
|
|
|
|
getSystemData() { |
|
|
|
|
this.$get(this.api.getSystemIdBySchool).then(res => { |
|
|
|
|
|
|
|
|
|
if (res.status == 200){ |
|
|
|
|
this.systemList = res.data; |
|
|
|
|
console.log(this.systemList) |
|
|
|
|
this.systemListAll = res.data; |
|
|
|
|
// 如果systemId有历史记录,就取历史记录里的systemId,否则就取默认的systemId |
|
|
|
|
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id; |
|
|
|
|
this.getData(); |
|
|
|
|
this.getschoolCourse() |
|
|
|
|
}else{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -274,6 +286,24 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getschoolCourse() { // 获取课程下拉框数据 |
|
|
|
|
this.$get(this.api.schoolCourseByAchievement).then(res => { |
|
|
|
|
const { data } = res |
|
|
|
|
this.curriculumList = data |
|
|
|
|
const { cid } = this.queryData |
|
|
|
|
if (data.length) { |
|
|
|
|
this.queryData.cid = cid || data[0].cid |
|
|
|
|
this.courseChange() |
|
|
|
|
} |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 课程选择回调 |
|
|
|
|
courseChange(val) { |
|
|
|
|
const systemIds = this.curriculumList.find(e => e.cid == this.queryData.cid).systemId.split(',') // 获取选取的课程的systemId |
|
|
|
|
this.systemList = this.systemListAll.filter(e => systemIds.includes(e.id + '')) // 筛选出该课程下的系统 |
|
|
|
|
this.systemId = this.systemList[0].id |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|