From 113e324bd2455cafa9a54d529c30a84cd3a69a23 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Sat, 2 Apr 2022 18:51:23 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AD=89=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/project/list/index.vue | 42 ++++++++++++++++++++++++-----
src/pages/station/preview/index.vue | 5 +++-
2 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/src/pages/project/list/index.vue b/src/pages/project/list/index.vue
index 3aa006f..b1f0573 100644
--- a/src/pages/project/list/index.vue
+++ b/src/pages/project/list/index.vue
@@ -40,6 +40,17 @@
>
+
+
+
+
+
+
+
@@ -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();
diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue
index eef1759..65b617f 100644
--- a/src/pages/station/preview/index.vue
+++ b/src/pages/station/preview/index.vue
@@ -110,6 +110,7 @@ export default {
briefIntroduction: "", // 课程简介
teachingObjectives: "", // 课程目标
assessmentList: "", // 考核列表
+ systemIds: '',
curLink: "", // 当前选中
playAuth: "",
player: null,
@@ -154,6 +155,7 @@ export default {
this.briefIntroduction = data.briefIntroduction;
this.teachingObjectives = data.teachingObjectives;
this.assessmentList = data.assessmentConfig;
+ this.systemIds = data.systemIds
},
async getChapter() {
let res = await this.$get(`${this.api.curriculumChapter}/${this.courseId}`);
@@ -288,7 +290,7 @@ export default {
this.currentPage = 1;
},
goSystem() { // 进入实验系统
- let id = this.assessmentList[0].systemId;
+ const id = this.systemIds
let href = ''
let token = util.local.get(Setting.tokenKey);
let roleId = this.roleId == 4 ? 0 : 1;
@@ -313,6 +315,7 @@ export default {
util.cookies.set("stopTime", "", -1);
util.cookies.set("token", token);
util.cookies.set("courseId", this.courseId);
+ util.cookies.set("curriculumName", escape(this.curriculumName));
util.cookies.set("systemId", id);
location.href = href;
}