diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index d3cda3d..26d3516 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -48,16 +48,12 @@
  • - - - - - +
  • { - this.curriculumList = res.data; + + // 获取课程 + async getCourse () { + const { data } = await this.$get(this.api.getSystemIdBySchool) + const res = await this.$get(this.api.getSchoolEffectiveCourse) + if (res.data.length) { + res.data.map(e => { + e.id = e.mallId + e.label = e.curriculumName + e.children = data.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 + }) + this.curs = res.data + this.mallIds = [this.mallId || res.data[0].mallId, this.systemId || data[0].id] this.getData(); - }).catch(err => { - }); + console.log("🚀 ~ file: index.vue:431 ~ getSystemData ~ res.data:", this.mallIds) + } + }, + // 课程选择回调 + curChange (val) { + const id = val[0] + if (val.length === 1) { + // 如果选择的是课程,则默认选中下面第一个系统 + this.mallIds = [id, this.curs.find(e => e.id == id).children[0].id] + } + this.$router.push({ + path: 'list', + query: { + ...this.$route.query, + mallId: this.mallIds[0], + systemId: this.mallIds[1], + } + }) + this.getData() }, + getClassData () { // 获取班级下拉框数据 this.$post(this.api.myClass).then(res => { this.classList = res.list; @@ -256,19 +283,20 @@ export default { background: "rgba(255,255,255,.6)" }); const per = this.projectPermissions - const curriculumId = this.curriculumId - const curr = this.curriculumList.find(e => e.cid == curriculumId) + const { mallIds } = this + const cur = this.curs.find(e => e.mallId == mallIds[0]) let data = { classId: this.classId, permissions: per, - curriculumId, + curriculumId: cur.cid, + mallId: mallIds[0], keyWord: this.keyword, startTime: this.startingtime, endTime: this.endTime, month: this.month, pageNum: this.page, pageSize: this.pageSize, - systemId: curr ? curr.systemId : '' + systemId: mallIds[1] }; this.$post(this.api.getAchievementInfo, data).then(res => { let list = [] diff --git a/src/pages/achievement/show/index.vue b/src/pages/achievement/show/index.vue index 03b04ff..9bbb27e 100644 --- a/src/pages/achievement/show/index.vue +++ b/src/pages/achievement/show/index.vue @@ -146,7 +146,8 @@ v-html="scope.row.referenceAnswer"> -