产品分化调整

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: {
prefix: '/teach',
detail: '/teach/detail',
practical: '/teach/practical',
// detail: '/teach/detail',
// practical: '/teach/practical',
pay: '/teach/pay'
},
exam: {
prefix: '/exam',
detail: '/exam/detail',
course: '/exam/course',
// course: '/exam/course',
examRuleManage: '/exam/examRule/manage',
pay: '/exam/pay'
},
demonstration: {
prefix: '/demonstration',
detail: '/demonstration/detail',
// detail: '/demonstration/detail',
pay: '/demonstration/pay'
},
dp: {
@ -252,7 +251,10 @@ export const UrlConfig = {
trainingPlatformHome: '/trainingPlatform/home',
prodDetail: '/trainingPlatform/detail',
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',
component: ExamHome
},
{
// 试卷详情
path: 'detail/:examId',
component: ExamDetail,
hidden: true
},
{
path: 'course/:lessonId',
component: ExamCourseDetail,
hidden: true
},
// {
// // 试卷详情
// path: 'detail/:examId',
// component: ExamDetail,
// hidden: true
// },
// {
// path: 'course/:lessonId',
// component: ExamCourseDetail,
// hidden: true
// },
{
// 规则管理
path: 'examRule/manage',
@ -719,6 +721,21 @@ export const asyncRouter = [
path: 'exam/:examId',
component: ExamDetail,
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;
const type = this.$route.query.permissionType;
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) {
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) {
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
} 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 {
this.$router.replace({ path: `/` });
}

View File

@ -3,7 +3,7 @@
<div slot="header" style="text-align: center;">
<span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
</div>
<div>
<div class="simulation-detail">
<p class="list-item">
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span>
@ -79,7 +79,7 @@ export default {
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow;
},
isInRoom() {
return this.courseModel.prdType == '03' && this.hasPermssion && this.jointShow;
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow;
},
mapId() {
return this.$route.params.mapId;
@ -94,10 +94,7 @@ export default {
watch: {
'$route': function (val) {
this.loadInitData();
},
// 'currentPrdCode': function (code) {
// this.initLoadPage({ id: this.mapId, code: code });
// }
}
},
async mounted() {
this.loadInitData();
@ -148,54 +145,6 @@ export default {
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() {
await getjointTraining(this.jointGroup);
const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup };
@ -303,24 +252,9 @@ export default {
}
</style>
<style>
.title {
font-weight: bold
}
.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;
.simulation-detail {
margin-left: 20px;
margin-right: 20px;
}
.list-item {

View File

@ -15,7 +15,7 @@
<el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail">
<ul :key="item.code" type="circle">
<li>{{ item.name }}</li>
<li @click="toExamDetail(item)">{{ item.name }}</li>
</ul>
</template>
</el-scrollbar>
@ -117,7 +117,7 @@ export default {
buy() {
this.loading = true;
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 }
});
},
@ -141,6 +141,9 @@ export default {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
},
toExamDetail(item) {
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${item.id}`);
}
}
};

View File

@ -30,7 +30,7 @@
show-summary
>
<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>
</div>
</el-scrollbar>
@ -88,7 +88,7 @@ export default {
return prev;
}
}, 0);
sums[index] += this.$('exam.points');
sums[index] += this.$t('exam.points');
} else {
sums[index] = 'N/A';
}
@ -118,7 +118,7 @@ export default {
},
back() {
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 runDiagramOver(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) {
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 {
this.trainingStart(data, node.parent);
}
},
lessonDetail(data) {
this.$router.push({ path: `${UrlConfig.teach.detail}/${data.id}` });
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${data.id}` });
},
buy(data) {
this.$router.push({

View File

@ -13,21 +13,32 @@
<el-tab-pane :label="$t('teach.courseDetails')" name="first">
<div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail">
<ul :key="item.code" type="circle">
<li>{{ item.name }}
<template v-for="it in item.trainingVos">
<ul :key="it.code" style="float:none;" type="circle">
<li :style="{color: it.trial? 'green':'' }">
<span>{{ it.name }}
<span v-if="it.trial">({{ $t('teach.free') }})</span>
</span>
</li>
</ul>
</template>
</li>
</ul>
</template>
<!--<template v-for="item in courseModel.detail">-->
<!--<ul :key="item.code" type="circle">-->
<!--<li>{{ item.name }}-->
<!--<template v-for="it in item.trainingVos">-->
<!--<ul :key="it.code" style="float:none;" type="circle">-->
<!--<li :style="{color: it.trial? 'green':'' }">-->
<!--<span>{{ it.name }}-->
<!--<span v-if="it.trial">({{ $t('teach.free') }})</span>-->
<!--</span>-->
<!--</li>-->
<!--</ul>-->
<!--</template>-->
<!--</li>-->
<!--</ul>-->
<!--</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>
</div>
</el-tab-pane>
@ -74,7 +85,11 @@ export default {
detail: [],
pmsList: []
},
activeName: 'first'
activeName: 'first',
defaultProps: {
children: 'trainingVos',
label: 'name'
}
};
},
computed: {
@ -113,7 +128,6 @@ export default {
skinCode: response.data.skinCode,
PermissionType: PermissionType.LESSON
};
console.log('====',this.courseModel);
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
@ -122,7 +136,7 @@ export default {
buy() {
this.loading = true;
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 }
});
},
@ -139,6 +153,16 @@ export default {
this.activeName = 'second';
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') { //
this.$router.push({ path: `/demonstration/detail/${param.mapId}` });
this.$router.push({ path: `/trainingPlatform/prodDetail/${param.mapId}` });
} else if (data.state == '01') { //
this.starting = false;
} else if (data.state == '02') {
@ -685,7 +685,7 @@ export default {
this.loading = true;
await putJointTrainingExit(this.$route.query.group);
this.loading = false;
this.$router.push({ path: `/demonstration/detail/${this.mapId}` });
this.$router.push({ path: `/trainingPlatform/prodDetail/${this.mapId}` });
} catch (error) {
this.messageInfo( this.$t('error.operationFailure'), 'error');
}

View File

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