产品分化调整

This commit is contained in:
fan 2019-09-24 11:05:10 +08:00
parent e2ee048f56
commit ce7decc188
11 changed files with 103 additions and 123 deletions

View File

@ -172,20 +172,19 @@ export const UrlConfig = {
}, },
teach: { teach: {
prefix: '/teach', prefix: '/teach',
detail: '/teach/detail', // detail: '/teach/detail',
practical: '/teach/practical', // practical: '/teach/practical',
pay: '/teach/pay' pay: '/teach/pay'
}, },
exam: { exam: {
prefix: '/exam', prefix: '/exam',
detail: '/exam/detail', // course: '/exam/course',
course: '/exam/course',
examRuleManage: '/exam/examRule/manage', examRuleManage: '/exam/examRule/manage',
pay: '/exam/pay' pay: '/exam/pay'
}, },
demonstration: { demonstration: {
prefix: '/demonstration', prefix: '/demonstration',
detail: '/demonstration/detail', // detail: '/demonstration/detail',
pay: '/demonstration/pay' pay: '/demonstration/pay'
}, },
dp: { dp: {
@ -252,7 +251,10 @@ export const UrlConfig = {
trainingPlatformHome: '/trainingPlatform/home', trainingPlatformHome: '/trainingPlatform/home',
prodDetail: '/trainingPlatform/detail', prodDetail: '/trainingPlatform/detail',
teachDetail: '/trainingPlatform/teach', teachDetail: '/trainingPlatform/teach',
examDetail: '/trainingPlatform/exam' examDetail: '/trainingPlatform/exam',
course: '/trainingPlatform/course',
practical: '/trainingPlatform/practical',
pay: '/trainingPlatform/pay'
} }
}; };
@ -641,17 +643,17 @@ export const asyncRouter = [
path: 'home', path: 'home',
component: ExamHome component: ExamHome
}, },
{ // {
// 试卷详情 // // 试卷详情
path: 'detail/:examId', // path: 'detail/:examId',
component: ExamDetail, // component: ExamDetail,
hidden: true // hidden: true
}, // },
{ // {
path: 'course/:lessonId', // path: 'course/:lessonId',
component: ExamCourseDetail, // component: ExamCourseDetail,
hidden: true // hidden: true
}, // },
{ {
// 规则管理 // 规则管理
path: 'examRule/manage', path: 'examRule/manage',
@ -719,6 +721,21 @@ export const asyncRouter = [
path: 'exam/:examId', path: 'exam/:examId',
component: ExamDetail, component: ExamDetail,
hidden: true hidden: true
},
{
path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
},
{
path: 'course/:lessonId',
component: ExamCourseDetail,
hidden: true
} }
] ]
} }

View File

@ -128,13 +128,13 @@ export default {
this.active = 0; this.active = 0;
const type = this.$route.query.permissionType; const type = this.$route.query.permissionType;
if (type === PermissionType.LESSON) { if (type === PermissionType.LESSON) {
this.$router.replace({ path: `${UrlConfig.teach.detail}/${this.$route.params.lessonId}` }); this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.lessonId}` });
} else if (type === PermissionType.EXAM) { } else if (type === PermissionType.EXAM) {
this.$router.replace({ path: `${UrlConfig.exam.course}/${this.orderData.lessonId}` }); this.$router.replace({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.orderData.lessonId}` });
} else if (type === PermissionType.SCREEN) { } else if (type === PermissionType.SCREEN) {
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` }); this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
} else if (type === PermissionType.SIMULATION) { } else if (type === PermissionType.SIMULATION) {
this.$router.replace({ path: `${UrlConfig.demonstration.detail}/${this.$route.params.lessonId}` }); this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.params.lessonId}` });
} else { } else {
this.$router.replace({ path: `/` }); this.$router.replace({ path: `/` });
} }

View File

@ -3,7 +3,7 @@
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span> <span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
</div> </div>
<div> <div class="simulation-detail">
<p class="list-item"> <p class="list-item">
<span class="list-label">{{ $t('demonstration.productDescription') }}</span> <span class="list-label">{{ $t('demonstration.productDescription') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span> <span class="list-elem">{{ courseModel.remarks }}</span>
@ -79,7 +79,7 @@ export default {
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow; return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow;
}, },
isInRoom() { isInRoom() {
return this.courseModel.prdType == '03' && this.hasPermssion && this.jointShow; return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow;
}, },
mapId() { mapId() {
return this.$route.params.mapId; return this.$route.params.mapId;
@ -94,10 +94,7 @@ export default {
watch: { watch: {
'$route': function (val) { '$route': function (val) {
this.loadInitData(); this.loadInitData();
}, }
// 'currentPrdCode': function (code) {
// this.initLoadPage({ id: this.mapId, code: code });
// }
}, },
async mounted() { async mounted() {
this.loadInitData(); this.loadInitData();
@ -148,54 +145,6 @@ export default {
this.$messageBox(this.$t('error.refreshFailed')); this.$messageBox(this.$t('error.refreshFailed'));
} }
}, },
async initLoadPage(data) {
this.loading = true;
if (data && parseInt(data.id) && data.code) {
try {
const resp = await getMapProductDetail(data.code);
this.tryUser = 0;
this.loading = false;
this.courseModel = {
id: resp.data.id,
name: resp.data.name,
mapId: data.id,
skinCode: resp.data.skinCode,
remarks: resp.data.remarks,
prdType: resp.data.prdType,
prdCode: resp.data.code,
pmsList: resp.data.pmsList || [],
PermissionType: PermissionType.SIMULATION
};
const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode });
this.courseModel.pmsList = rest.data;
if (!this.courseModel.pmsList) {
this.tryUser = 1;
const paras = {
mapId: data.id,
prdCode: data.code,
permissionType: PermissionType.SIMULATION
};
try {
const resr = await getGoodsTryUse(paras);
if (resr.data.tryTime <= 0) {
this.tryTime = 0;
} else {
this.tryTime = resr.data.tryTime;
this.goodsId = resr.data.goodsId;
}
} catch (error) {
this.tryTime = 0;
}
}
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
} else {
this.loading = false;
}
},
async joinRoom() { async joinRoom() {
await getjointTraining(this.jointGroup); await getjointTraining(this.jointGroup);
const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup }; const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup };
@ -303,24 +252,9 @@ export default {
} }
</style> </style>
<style> <style>
.title { .simulation-detail {
font-weight: bold margin-left: 20px;
} margin-right: 20px;
.time-item {
font-size: 24px;
color: black !important;
}
.time-label {
display: -moz-inline-box;
display: inline-block;
text-align: right;
margin-left: 14px;
}
.time-elem {
color: rgb(90, 89, 89) !important;
} }
.list-item { .list-item {

View File

@ -15,7 +15,7 @@
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail"> <template v-for="item in courseModel.detail">
<ul :key="item.code" type="circle"> <ul :key="item.code" type="circle">
<li>{{ item.name }}</li> <li @click="toExamDetail(item)">{{ item.name }}</li>
</ul> </ul>
</template> </template>
</el-scrollbar> </el-scrollbar>
@ -117,7 +117,7 @@ export default {
buy() { buy() {
this.loading = true; this.loading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.exam.pay}/${this.$route.params.lessonId}`, path: `${UrlConfig.trainingPlatform.pay}/${this.$route.params.lessonId}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } query: { permissionType: PermissionType.EXAM, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
}); });
}, },
@ -141,6 +141,9 @@ export default {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
},
toExamDetail(item) {
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${item.id}`);
} }
} }
}; };

View File

@ -30,7 +30,7 @@
show-summary show-summary
> >
<el-table-column prop="trainingName" :label="this.$t('exam.trainingName')" /> <el-table-column prop="trainingName" :label="this.$t('exam.trainingName')" />
<el-table-column prop="score" :label="this.$('exam.trainingScore')" /> <el-table-column prop="score" :label="this.$t('exam.trainingScore')" />
</el-table> </el-table>
</div> </div>
</el-scrollbar> </el-scrollbar>
@ -88,7 +88,7 @@ export default {
return prev; return prev;
} }
}, 0); }, 0);
sums[index] += this.$('exam.points'); sums[index] += this.$t('exam.points');
} else { } else {
sums[index] = 'N/A'; sums[index] = 'N/A';
} }
@ -118,7 +118,7 @@ export default {
}, },
back() { back() {
const examId = this.resultModel.examId; const examId = this.resultModel.examId;
this.$router.push(`${UrlConfig.exam.detail}/${examId}`); this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${examId}`);
} }
} }
}; };

View File

@ -120,7 +120,7 @@ export default {
await this.$store.dispatch('training/over'); await this.$store.dispatch('training/over');
await runDiagramOver(this.group); await runDiagramOver(this.group);
await deljointTrainRoom(this.group); await deljointTrainRoom(this.group);
await this.$router.push({ path: `/demonstration/detail/${this.mapId}` }); await this.$router.push({ path: `/trainingPlatform/prodDetail/${this.mapId}` });
} }
}); });
}, },

View File

@ -133,13 +133,13 @@ export default {
}, },
trainingStart(data, node) { trainingStart(data, node) {
if (node.level == 1) { // 1 id if (node.level == 1) { // 1 id
this.$router.push({ path: `${UrlConfig.teach.practical}/${data.id}/${node.data.id}` }); this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${node.data.id}` });
} else { } else {
this.trainingStart(data, node.parent); this.trainingStart(data, node.parent);
} }
}, },
lessonDetail(data) { lessonDetail(data) {
this.$router.push({ path: `${UrlConfig.teach.detail}/${data.id}` }); this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${data.id}` });
}, },
buy(data) { buy(data) {
this.$router.push({ this.$router.push({

View File

@ -13,21 +13,32 @@
<el-tab-pane :label="$t('teach.courseDetails')" name="first"> <el-tab-pane :label="$t('teach.courseDetails')" name="first">
<div :style="{ height: height - 270 +'px' }"> <div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail"> <!--<template v-for="item in courseModel.detail">-->
<ul :key="item.code" type="circle"> <!--<ul :key="item.code" type="circle">-->
<li>{{ item.name }} <!--<li>{{ item.name }}-->
<template v-for="it in item.trainingVos"> <!--<template v-for="it in item.trainingVos">-->
<ul :key="it.code" style="float:none;" type="circle"> <!--<ul :key="it.code" style="float:none;" type="circle">-->
<li :style="{color: it.trial? 'green':'' }"> <!--<li :style="{color: it.trial? 'green':'' }">-->
<span>{{ it.name }} <!--<span>{{ it.name }}-->
<span v-if="it.trial">({{ $t('teach.free') }})</span> <!--<span v-if="it.trial">({{ $t('teach.free') }})</span>-->
</span> <!--</span>-->
</li> <!--</li>-->
</ul> <!--</ul>-->
</template> <!--</template>-->
</li> <!--</li>-->
</ul> <!--</ul>-->
</template> <!--</template>-->
<el-tree
ref="tree"
:data="courseModel.detail"
node-key="id"
:props="defaultProps"
:filter-node-method="filterNode"
highlight-current
:span="22"
@node-click="clickEvent"
>
</el-tree>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -74,7 +85,11 @@ export default {
detail: [], detail: [],
pmsList: [] pmsList: []
}, },
activeName: 'first' activeName: 'first',
defaultProps: {
children: 'trainingVos',
label: 'name'
}
}; };
}, },
computed: { computed: {
@ -113,7 +128,6 @@ export default {
skinCode: response.data.skinCode, skinCode: response.data.skinCode,
PermissionType: PermissionType.LESSON PermissionType: PermissionType.LESSON
}; };
console.log('====',this.courseModel);
}).catch(error => { }).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message); this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
}); });
@ -122,7 +136,7 @@ export default {
buy() { buy() {
this.loading = true; this.loading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`, path: `${UrlConfig.trainingPlatform.pay}/${this.$route.params.lessonId}`,
query: { permissionType: PermissionType.LESSON, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } query: { permissionType: PermissionType.LESSON, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
}); });
}, },
@ -139,6 +153,16 @@ export default {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
},
clickEvent(obj, data, ele) {
console.log(obj, data, ele);
if (obj.type){
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.id}/${data.id}`});
}
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
} }
} }
}; };

View File

@ -425,7 +425,7 @@ export default {
}; };
if (data.state == '03') { // if (data.state == '03') { //
this.$router.push({ path: `/demonstration/detail/${param.mapId}` }); this.$router.push({ path: `/trainingPlatform/prodDetail/${param.mapId}` });
} else if (data.state == '01') { // } else if (data.state == '01') { //
this.starting = false; this.starting = false;
} else if (data.state == '02') { } else if (data.state == '02') {
@ -685,7 +685,7 @@ export default {
this.loading = true; this.loading = true;
await putJointTrainingExit(this.$route.query.group); await putJointTrainingExit(this.$route.query.group);
this.loading = false; this.loading = false;
this.$router.push({ path: `/demonstration/detail/${this.mapId}` }); this.$router.push({ path: `/trainingPlatform/prodDetail/${this.mapId}` });
} catch (error) { } catch (error) {
this.messageInfo( this.$t('error.operationFailure'), 'error'); this.messageInfo( this.$t('error.operationFailure'), 'error');
} }

View File

@ -91,6 +91,8 @@
} }
}, },
clickEvent(obj, data, ele) { clickEvent(obj, data, ele) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/16`});
return;
if (data.parent && data.parent.data){ if (data.parent && data.parent.data){
this.mapId = data.parent.data.id; this.mapId = data.parent.data.id;
} }