|
|
|
@ -576,6 +576,7 @@ export default { |
|
|
|
|
this.teachingObjectives = data.teachingObjectives; |
|
|
|
|
this.assessmentList = data.assessmentConfig; |
|
|
|
|
this.systemIds = data.systemIds |
|
|
|
|
this.queryProject() |
|
|
|
|
this.getStatus() |
|
|
|
|
}, |
|
|
|
|
// 记录最近使用 |
|
|
|
@ -913,43 +914,62 @@ export default { |
|
|
|
|
this.curProject = item.projectId |
|
|
|
|
}, |
|
|
|
|
// 展示选择项目弹框 |
|
|
|
|
queryProject () { |
|
|
|
|
showProjectDia () { |
|
|
|
|
this.projectVisible = true |
|
|
|
|
this.loading = true |
|
|
|
|
}, |
|
|
|
|
// 查询项目 |
|
|
|
|
queryProject () { |
|
|
|
|
this.$get(this.api.getProjectBySystemId, { |
|
|
|
|
systemId: this.systemIds, |
|
|
|
|
cId: this.courseId, // 课程id |
|
|
|
|
mallId: this.mallId, |
|
|
|
|
permissions: 0 // 0: 练习,1: 考核 |
|
|
|
|
}).then(({ projects }) => { |
|
|
|
|
this.loading = false |
|
|
|
|
this.projects = projects |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 进入实验 |
|
|
|
|
entry () { |
|
|
|
|
// 查询上次做的项目 |
|
|
|
|
this.$get(this.api.getTheMostRecentlyRunProject, { |
|
|
|
|
cid: this.courseId |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
|
if (data && data.length) { |
|
|
|
|
this.$confirm('是否要继续上次的实验?', '提示', { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否', |
|
|
|
|
type: 'success' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.toPython(data[0].projectId) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.queryProject() |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.queryProject() |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.queryProject() |
|
|
|
|
entryProject (projectId) { |
|
|
|
|
this.$confirm('是否要继续上次的实验?', '提示', { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否', |
|
|
|
|
type: 'success' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.curProject = projectId |
|
|
|
|
this.toSub() |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.showProjectDia() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 进入实验 |
|
|
|
|
entry () { |
|
|
|
|
// 查询上次做的项目(python跟沙盘接口不一样) |
|
|
|
|
if (this.systemIds.split(',').includes('19')) { // 沙盘 |
|
|
|
|
this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => { |
|
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
|
if (res.getLastCache) { |
|
|
|
|
this.entryProject(+res.getLastCache) |
|
|
|
|
} else { |
|
|
|
|
this.showProjectDia() |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.showProjectDia() |
|
|
|
|
}) |
|
|
|
|
} else { // python |
|
|
|
|
this.$get(this.api.getTheMostRecentlyRunProject, { |
|
|
|
|
cid: this.courseId |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
|
if (data && data.length) { |
|
|
|
|
this.entryProject(data[0].projectId) |
|
|
|
|
} else { |
|
|
|
|
this.showProjectDia() |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.showProjectDia() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 进入python系统 |
|
|
|
|
toPython (projectId) { |
|
|
|
|
const id = this.systemIds |
|
|
|
@ -979,8 +999,6 @@ export default { |
|
|
|
|
toSub () { |
|
|
|
|
const { systemId } = this.projects.find(e => e.projectId == this.curProject) |
|
|
|
|
let token = util.local.get(Setting.tokenKey); |
|
|
|
|
let roleId = this.roleId == 4 ? 0 : 1; |
|
|
|
|
let userName = window.btoa(encodeURIComponent(this.userName)); |
|
|
|
|
if (systemId == 11) { |
|
|
|
|
// 银行系统 |
|
|
|
|
sessionStorage.removeItem('projectId') |
|
|
|
|