修改配置

This commit is contained in:
ival 2019-08-14 10:12:51 +08:00
parent 9a4e982c08
commit 25479392ff
4 changed files with 263 additions and 243 deletions

View File

@ -38,4 +38,4 @@ new Vue({
i18n,
render: h => h(App)
});

View File

@ -455,124 +455,145 @@ export const asyncRouter = [
},
{
path: '/teach',
redirect: '/teach/home',
component: Teach,
component: Layout,
meta: {
roles: [admin, userLesson, user]
},
children: [
{
path: 'home',
component: TeachHome,
path: '',
redirect: '/teach/home',
component: Teach,
meta: {
i18n: 'router.teachSystem'
}
},
{
// 课程详情
path: 'detail/:lessonId',
component: TeachDetail,
meta: {
},
hidden: true
},
{
// 实训详情
path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
meta: {
},
hidden: true
children: [
{
path: 'home',
component: TeachHome
},
{
// 课程详情
path: 'detail/:lessonId',
component: TeachDetail,
meta: {
},
hidden: true
},
{
// 实训详情
path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
meta: {
},
hidden: true
}
]
}
]
},
{
path: '/exam',
redirect: '/exam/home',
component: Exam,
component: Layout,
meta: {
roles: [admin, userExam, user]
},
children: [
{
path: 'home',
component: ExamHome,
path: '',
redirect: '/exam/home',
component: Exam,
meta: {
i18n: 'router.examSystem'
}
},
{
// 试卷详情
path: 'detail/:examId',
component: ExamDetail,
hidden: true
},
{
path: 'course/:lessonId',
component: ExamCourseDetail,
hidden: true
},
{
// 规则管理
path: 'examRule/manage',
component: PublishExamRule,
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: PublishExamRuleDraft
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
},
{
// 开始考试
path: 'questionDetail/:examQuestionId',
component: ExamQuestionDetail,
hidden: true
},
{
// 考试结果
path: 'result/:userExamId',
component: ExamResult,
hidden: true
},
children: [
{
path: 'home',
component: ExamHome
},
{
// 试卷详情
path: 'detail/:examId',
component: ExamDetail,
hidden: true
},
{
path: 'course/:lessonId',
component: ExamCourseDetail,
hidden: true
},
{
// 规则管理
path: 'examRule/manage',
component: PublishExamRule,
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: PublishExamRuleDraft
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
},
{
// 开始考试
path: 'questionDetail/:examQuestionId',
component: ExamQuestionDetail,
hidden: true
},
{
// 考试结果
path: 'result/:userExamId',
component: ExamResult,
hidden: true
}
]
}
]
},
{
path: '/demonstration',
redirect: '/demonstration/home',
component: Demonstration,
component: Layout,
meta: {
roles: [admin, userSimulation, user]
},
children: [
{
path: 'home',
component: DemonstrationHome,
path: '',
redirect: '/demonstration/home',
component: Demonstration,
meta: {
i18n: 'router.demonstrationSystem'
}
},
{
path: 'detail/:mapId',
component: DemonstrationDetail,
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
},
children: [
{
path: 'home',
component: DemonstrationHome,
meta: {
i18n: 'router.demonstrationSystem'
}
},
{
path: 'detail/:mapId',
component: DemonstrationDetail,
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
}
]
}
]
},

View File

@ -12,12 +12,12 @@
<el-tabs v-model="activeName">
<el-tab-pane label="课程详情" name="first">
<div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail">
<ul type="circle" :key="item.code">
<ul :key="item.code" type="circle">
<li>{{ item.name }}
<template v-for="it in item.trainingVos">
<ul style="float:none;" type="circle" :key="it.code">
<ul :key="it.code" style="float:none;" type="circle">
<li :style="{color: it.trial? 'green':'' }">
<span>{{ it.name }}
<span v-if="it.trial">(免费)</span>
@ -33,8 +33,8 @@
</el-tab-pane>
<el-tab-pane label="权限详情" name="second">
<div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper">
<limit-list ref="limitList" :courseModel="courseModel" @initLoadPage="initLoadPage"></limit-list>
<el-scrollbar wrap-class="scrollbar-wrapper">
<limit-list ref="limitList" :course-model="courseModel" @initLoadPage="initLoadPage" />
</el-scrollbar>
</div>
</el-tab-pane>
@ -42,105 +42,104 @@
</div>
<div class="btn-buy">
<el-button type="success" @click="buy">购买</el-button>
<el-button type="primary" @click="distribute" v-if="hasPermssion">权限分发(上课)</el-button>
<el-button type="primary" @click="transfer" v-if="hasPermssion">权限转赠</el-button>
<el-button v-if="hasPermssion" type="primary" @click="distribute">权限分发(上课)</el-button>
<el-button v-if="hasPermssion" type="primary" @click="transfer">权限转赠</el-button>
</div>
</el-card>
</template>
<script>
import { mapGetters } from "vuex";
import { getPublishLessonDetail } from "@/api/jmap/lesson";
import { PermissionType } from "@/scripts/ConstDic";
import { UrlConfig } from '@/router/index';
import WindowResizeHandler from "@/mixin/WindowResizeHandler";
import LimitList from "@/views/components/limits/index";
import { getPublishLessonDetail } from '@/api/jmap/lesson';
import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import LimitList from '@/views/components/limits/index';
export default {
name: "LessonDetail",
components: {
LimitList
},
data() {
return {
num: 5,
height: "",
WhetherTypeList: [],
EffectiveTypeList: [],
courseModel: {
id: "",
name: "",
skinStyle: "",
price: 0,
remarks: "",
detail: [],
pmsList: []
},
activeName: 'first'
};
},
mixins: [WindowResizeHandler],
watch: {
$route(newVal) {
this.initLoadPage();
}
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.initLoadPage();
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight;
},
initLoadPage() {
let data = { id: this.$route.params.lessonId };
if (parseInt(data.id)) {
getPublishLessonDetail(data).then(response => {
this.courseModel = {
id: response.data.id,
name: response.data.name,
price: response.data.price,
remarks: response.data.remarks,
detail: response.data.chapters,
pmsList: response.data.pmsList,
prdCode: response.data.prdCode,
mapId: response.data.mapId,
skinStyle: response.data.skinStyle,
PermissionType: PermissionType.LESSON
};
}).catch(error => {
this.$message.error("获取课程信息失败:" + error.message);
});
}
},
buy() {
this.$router.push({
path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`,
query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
});
},
transfer() {
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() {
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
}
}
};
export default {
name: 'LessonDetail',
components: {
LimitList
},
mixins: [WindowResizeHandler],
data() {
return {
num: 5,
height: '',
WhetherTypeList: [],
EffectiveTypeList: [],
courseModel: {
id: '',
name: '',
skinStyle: '',
price: 0,
remarks: '',
detail: [],
pmsList: []
},
activeName: 'first'
};
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.initLoadPage();
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight;
},
initLoadPage() {
const data = { id: this.$route.params.lessonId };
if (parseInt(data.id)) {
getPublishLessonDetail(data).then(response => {
this.courseModel = {
id: response.data.id,
name: response.data.name,
price: response.data.price,
remarks: response.data.remarks,
detail: response.data.chapters,
pmsList: response.data.pmsList,
prdCode: response.data.prdCode,
mapId: response.data.mapId,
skinStyle: response.data.skinStyle,
PermissionType: PermissionType.LESSON
};
}).catch(error => {
this.$message.error('获取课程信息失败:' + error.message);
});
}
},
buy() {
this.$router.push({
path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`,
query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
});
},
transfer() {
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() {
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -160,4 +159,4 @@
justify-content: center;
transform: translateY(-20px);
}
</style>
</style>

View File

@ -1,70 +1,70 @@
<template>
<div class="app-wrapper">
<el-scrollbar wrapClass="scrollbar-wrapper">
<div class="list" v-show="treeShow" :style="{width: widthLeft+'px'}">
<lesson-tree ref="tree" :height="height"></lesson-tree>
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="treeShow" class="list" :style="{width: widthLeft+'px'}">
<lesson-tree ref="tree" :height="height" />
</div>
<drap-left :widthLeft="widthLeft" @drapWidth="drapWidth"></drap-left>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view></router-view>
<router-view />
</transition>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import LessonTree from "./category/tree";
import localStore from "storejs";
import drapLeft from "@/views/components/drapLeft/index";
import WindowResizeHandler from "@/mixin/WindowResizeHandler";
import { mapGetters } from 'vuex';
import LessonTree from './category/tree';
import localStore from 'storejs';
import drapLeft from '@/views/components/drapLeft/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: "Lesson",
components: {
LessonTree,
drapLeft
},
mixins: [WindowResizeHandler],
data() {
return {
height: 0,
treeShow: true,
widthLeft: 450
};
},
computed: {
...mapGetters(["lessonbar"])
},
watch: {
"lessonbar.opened": function (val) {
this.treeShow = val;
this.resizeHandler();
},
$route(to, from) {
if (/\/lesson\/detail/.test(to.path) && /\/lesson\/pay/.test(from.path)) {
this.$emit("refresh", [
localStore.get("cityCode") || "",
localStore.get("mapId") || ""
]);
}
}
},
mounted() {
this.widthLeft = Number(localStore.get("LeftWidth"));
},
methods: {
resizeHandler() {
this.height = this._clientHeight;
},
drapWidth(width) {
this.widthLeft = Number(width);
},
refresh(filterSelect) {
this.$refs && this.$refs.tree && this.$refs.tree.refresh(filterSelect);
}
}
};
export default {
name: 'Lesson',
components: {
LessonTree,
drapLeft
},
mixins: [WindowResizeHandler],
data() {
return {
height: 0,
treeShow: true,
widthLeft: 450
};
},
computed: {
...mapGetters(['lessonbar'])
},
watch: {
'lessonbar.opened': function (val) {
this.treeShow = val;
this.resizeHandler();
},
$route(to, from) {
if (/\/lesson\/detail/.test(to.path) && /\/lesson\/pay/.test(from.path)) {
this.$emit('refresh', [
localStore.get('cityCode') || '',
localStore.get('mapId') || ''
]);
}
}
},
mounted() {
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
resizeHandler() {
this.height = this._clientHeight;
},
drapWidth(width) {
this.widthLeft = Number(width);
},
refresh(filterSelect) {
this.$refs && this.$refs.tree && this.$refs.tree.refresh(filterSelect);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -80,4 +80,4 @@
.list {
float: left;
}
</style>
</style>