|
|
@ -52,8 +52,8 @@ |
|
|
|
<div class="catalog"> |
|
|
|
<div class="catalog"> |
|
|
|
<div class="m-b-20"> |
|
|
|
<div class="m-b-20"> |
|
|
|
<el-button v-if="!overdue" class="entry" type="primary" size="small" @click="showBuy">续费</el-button> |
|
|
|
<el-button v-if="!overdue" class="entry" type="primary" size="small" @click="showBuy">续费</el-button> |
|
|
|
<el-button v-if="practiceTheoreticalPaper" class="entry" type="primary" @click="entry">进入理论</el-button> |
|
|
|
<el-button v-if="practiceTheoreticalPaper" class="entry" type="primary" @click="entry(1)">进入理论</el-button> |
|
|
|
<el-button v-if="practicePracticeProject" class="entry" type="primary" @click="entry">进入实训</el-button> |
|
|
|
<el-button v-if="practicePracticeProject" class="entry" type="primary" @click="entry(0)">进入实训</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="list"> |
|
|
|
<div class="list"> |
|
|
|
<h4 class="title">{{ curriculumName || courseName }}</h4> |
|
|
|
<h4 class="title">{{ curriculumName || courseName }}</h4> |
|
|
@ -278,11 +278,20 @@ |
|
|
|
<el-dialog title="请选择项目" v-loading="loading" :visible.sync="projectVisible" width="828px" custom-class="project-dia" |
|
|
|
<el-dialog title="请选择项目" v-loading="loading" :visible.sync="projectVisible" width="828px" custom-class="project-dia" |
|
|
|
:close-on-click-modal="false"> |
|
|
|
:close-on-click-modal="false"> |
|
|
|
<ul class="projects"> |
|
|
|
<ul class="projects"> |
|
|
|
<li v-for="(item, i) in projects" :key="i" :class="{ active: curProject == item.projectId }" |
|
|
|
<template v-if="isTheory"> |
|
|
|
@click="selectProject(item)"> |
|
|
|
<li v-for="(item, i) in papers" :key="i" :class="{ active: curPaper == item.paperId }" |
|
|
|
<img src="@/assets/img/project.png" alt=""> |
|
|
|
@click="selectPaper(item)"> |
|
|
|
<span>{{ i + 1 }}. {{ item.projectName }}</span> |
|
|
|
<img src="@/assets/img/project.png" alt=""> |
|
|
|
</li> |
|
|
|
<span>{{ i + 1 }}. {{ item.paperName }}</span> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
|
|
|
<li v-for="(item, i) in projects" :key="i" :class="{ active: curProject == item.projectId }" |
|
|
|
|
|
|
|
@click="selectProject(item)"> |
|
|
|
|
|
|
|
<img src="@/assets/img/project.png" alt=""> |
|
|
|
|
|
|
|
<span>{{ i + 1 }}. {{ item.projectName }}</span> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
</template> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
@ -358,8 +367,11 @@ export default { |
|
|
|
videoSrc: '', |
|
|
|
videoSrc: '', |
|
|
|
desShrink: false, |
|
|
|
desShrink: false, |
|
|
|
projectVisible: false, |
|
|
|
projectVisible: false, |
|
|
|
|
|
|
|
isTheory: 0, |
|
|
|
projects: [], |
|
|
|
projects: [], |
|
|
|
|
|
|
|
papers: [], |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
|
|
|
|
curPaper: '', |
|
|
|
curProject: '', |
|
|
|
curProject: '', |
|
|
|
overdue: 0, //是否过期 |
|
|
|
overdue: 0, //是否过期 |
|
|
|
buyVisible: false, |
|
|
|
buyVisible: false, |
|
|
@ -466,7 +478,7 @@ export default { |
|
|
|
this.$get(this.api.whetherToRenewTheFee, { |
|
|
|
this.$get(this.api.whetherToRenewTheFee, { |
|
|
|
mallId: this.mallId |
|
|
|
mallId: this.mallId |
|
|
|
}).then(({ isRenew }) => { |
|
|
|
}).then(({ isRenew }) => { |
|
|
|
// 1正常显示资源,0显示续费 |
|
|
|
// 1正常显示资源,0显示续费,-1试用 |
|
|
|
this.overdue = isRenew |
|
|
|
this.overdue = isRenew |
|
|
|
this.getChapter() |
|
|
|
this.getChapter() |
|
|
|
this.getProgress() |
|
|
|
this.getProgress() |
|
|
@ -698,7 +710,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
preview (row, chapterName, showDia = 0) { |
|
|
|
preview (row, chapterName, showDia = 0) { |
|
|
|
// 如果没过期,则正常预览,否则显示购买弹框 |
|
|
|
// 如果没过期,则正常预览,否则显示购买弹框 |
|
|
|
if (this.overdue || showDia) { |
|
|
|
if (this.overdue === 1 || showDia) { |
|
|
|
this.curLink = `${chapterName}${row.name}`; // 章节名称+小节名称,小节名称有重复的情况,如果只用小节名称判断,会有同时选中多个的情况 |
|
|
|
this.curLink = `${chapterName}${row.name}`; // 章节名称+小节名称,小节名称有重复的情况,如果只用小节名称判断,会有同时选中多个的情况 |
|
|
|
this.playAuth = '' |
|
|
|
this.playAuth = '' |
|
|
|
this.coverUrl = '' |
|
|
|
this.coverUrl = '' |
|
|
@ -795,12 +807,17 @@ export default { |
|
|
|
fullScreen () { |
|
|
|
fullScreen () { |
|
|
|
this.pdfVisible = true |
|
|
|
this.pdfVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择试卷 |
|
|
|
|
|
|
|
selectPaper (item) { |
|
|
|
|
|
|
|
this.curPaper = item.paperId |
|
|
|
|
|
|
|
}, |
|
|
|
// 选择项目 |
|
|
|
// 选择项目 |
|
|
|
selectProject (item) { |
|
|
|
selectProject (item) { |
|
|
|
this.curProject = item.projectId |
|
|
|
this.curProject = item.projectId |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 展示选择项目弹框 |
|
|
|
// 展示选择项目弹框 |
|
|
|
showProjectDia () { |
|
|
|
showProjectDia (isTheory) { |
|
|
|
|
|
|
|
this.isTheory = isTheory |
|
|
|
this.projectVisible = true |
|
|
|
this.projectVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询项目 |
|
|
|
// 查询项目 |
|
|
@ -810,8 +827,9 @@ export default { |
|
|
|
cId: this.courseId, // 课程id |
|
|
|
cId: this.courseId, // 课程id |
|
|
|
mallId: this.mallId, |
|
|
|
mallId: this.mallId, |
|
|
|
permissions: 0 // 0: 练习,1: 考核 |
|
|
|
permissions: 0 // 0: 练习,1: 考核 |
|
|
|
}).then(({ projects }) => { |
|
|
|
}).then(res => { |
|
|
|
this.projects = projects |
|
|
|
this.projects = res.projects // 实训项目 |
|
|
|
|
|
|
|
this.papers = res.exercisePaperList // 理论试卷 |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 进入实验 |
|
|
|
// 进入实验 |
|
|
@ -829,41 +847,47 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 进入实验 |
|
|
|
// 进入实验 |
|
|
|
entry () { |
|
|
|
entry (isTheory) { |
|
|
|
// 查询上次做的项目(python跟沙盘接口不一样) |
|
|
|
if (isTheory) { |
|
|
|
if (this.systemIds.split(',').includes('19')) { // 沙盘 |
|
|
|
// 理论试卷 |
|
|
|
this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => { |
|
|
|
this.showProjectDia(1) |
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
} else { |
|
|
|
if (res.getLastCache) { |
|
|
|
// 实训系统 |
|
|
|
this.entryProject(+res.getLastCache) |
|
|
|
// 查询上次做的项目(python跟沙盘接口不一样) |
|
|
|
} else { |
|
|
|
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() |
|
|
|
this.showProjectDia() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(res => { |
|
|
|
} else { // python |
|
|
|
this.showProjectDia() |
|
|
|
// python只能存在一个打开的窗口 |
|
|
|
}) |
|
|
|
// const opened = +localStorage.getItem('opened') |
|
|
|
} else { // python |
|
|
|
// if (opened) { |
|
|
|
// python只能存在一个打开的窗口 |
|
|
|
// Util.errorMsg('Python系统限单页活跃,请切换至当前已有的活跃实验页面。', 5000) |
|
|
|
// const opened = +localStorage.getItem('opened') |
|
|
|
// return false |
|
|
|
// if (opened) { |
|
|
|
// } else { |
|
|
|
// Util.errorMsg('Python系统限单页活跃,请切换至当前已有的活跃实验页面。', 5000) |
|
|
|
// localStorage.setItem('opened', 1) |
|
|
|
// return false |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
|
|
|
|
// localStorage.setItem('opened', 1) |
|
|
|
this.$get(this.api.getTheMostRecentlyRunProject, { |
|
|
|
// } |
|
|
|
cid: this.courseId |
|
|
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
this.$get(this.api.getTheMostRecentlyRunProject, { |
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
cid: this.courseId |
|
|
|
if (data && data.length) { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.entryProject(data[0].projectId) |
|
|
|
// 返回了data则提示是否继续,否则,显示选择项目的弹框 |
|
|
|
} else { |
|
|
|
if (data && data.length) { |
|
|
|
this.showProjectDia() |
|
|
|
this.entryProject(data[0].projectId) |
|
|
|
} |
|
|
|
} else { |
|
|
|
}).catch(res => { |
|
|
|
this.showProjectDia() |
|
|
|
this.showProjectDia() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(res => { |
|
|
|
} |
|
|
|
this.showProjectDia() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 进入python系统 |
|
|
|
// 进入python系统 |
|
|
@ -895,29 +919,35 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 进入子系统 |
|
|
|
// 进入子系统 |
|
|
|
async toSub () { |
|
|
|
async toSub () { |
|
|
|
let curProject = this.projects.find(e => e.projectId == this.curProject) |
|
|
|
// 理论试卷 |
|
|
|
if (!curProject && this.projects.length) { |
|
|
|
if (this.isTheory) { |
|
|
|
curProject = this.projects[0] |
|
|
|
window.open(this.$router.resolve(`/theoryExam?paperId=${this.curPaper}&cid=${this.courseId}&mallId=${this.mallId}&curriculumName=${this.curriculumName}`).href) |
|
|
|
this.curProject = curProject.projectId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const { systemId } = curProject |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let token = Util.local.get(Setting.tokenKey); |
|
|
|
|
|
|
|
this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : '' |
|
|
|
|
|
|
|
if (systemId == 11) { |
|
|
|
|
|
|
|
// 银行系统 |
|
|
|
|
|
|
|
sessionStorage.removeItem('projectId') |
|
|
|
|
|
|
|
sessionStorage.removeItem('submited') |
|
|
|
|
|
|
|
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1` |
|
|
|
|
|
|
|
} else if (systemId == 12) { |
|
|
|
|
|
|
|
// 众筹系统 |
|
|
|
|
|
|
|
window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`); |
|
|
|
|
|
|
|
} else if (systemId == 19) { |
|
|
|
|
|
|
|
// 沙盘 |
|
|
|
|
|
|
|
location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}` |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// python系统 |
|
|
|
// 实训 |
|
|
|
this.toPython(this.curProject) |
|
|
|
let curProject = this.projects.find(e => e.projectId == this.curProject) |
|
|
|
|
|
|
|
if (!curProject && this.projects.length) { |
|
|
|
|
|
|
|
curProject = this.projects[0] |
|
|
|
|
|
|
|
this.curProject = curProject.projectId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const { systemId } = curProject |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let token = Util.local.get(Setting.tokenKey); |
|
|
|
|
|
|
|
this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : '' |
|
|
|
|
|
|
|
if (systemId == 11) { |
|
|
|
|
|
|
|
// 银行系统 |
|
|
|
|
|
|
|
sessionStorage.removeItem('projectId') |
|
|
|
|
|
|
|
sessionStorage.removeItem('submited') |
|
|
|
|
|
|
|
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1` |
|
|
|
|
|
|
|
} else if (systemId == 12) { |
|
|
|
|
|
|
|
// 众筹系统 |
|
|
|
|
|
|
|
window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`); |
|
|
|
|
|
|
|
} else if (systemId == 19) { |
|
|
|
|
|
|
|
// 沙盘 |
|
|
|
|
|
|
|
location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}` |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// python系统 |
|
|
|
|
|
|
|
this.toPython(this.curProject) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|