修改配置

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, i18n,
render: h => h(App) render: h => h(App)
}); });

View File

@ -455,124 +455,145 @@ export const asyncRouter = [
}, },
{ {
path: '/teach', path: '/teach',
redirect: '/teach/home', component: Layout,
component: Teach,
meta: { meta: {
roles: [admin, userLesson, user] roles: [admin, userLesson, user]
}, },
children: [ children: [
{ {
path: 'home', path: '',
component: TeachHome, redirect: '/teach/home',
component: Teach,
meta: { meta: {
i18n: 'router.teachSystem' i18n: 'router.teachSystem'
}
},
{
// 课程详情
path: 'detail/:lessonId',
component: TeachDetail,
meta: {
}, },
hidden: true children: [
}, {
{ path: 'home',
// 实训详情 component: TeachHome
path: 'practical/:trainingId/:lessonId', },
component: TeachPractical, {
meta: { // 课程详情
}, path: 'detail/:lessonId',
hidden: true component: TeachDetail,
}, meta: {
{ },
path: 'pay/:lessonId', hidden: true
component: Pay, },
meta: { {
}, // 实训详情
hidden: true path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
meta: {
},
hidden: true
}
]
} }
] ]
}, },
{ {
path: '/exam', path: '/exam',
redirect: '/exam/home', component: Layout,
component: Exam,
meta: { meta: {
roles: [admin, userExam, user] roles: [admin, userExam, user]
}, },
children: [ children: [
{ {
path: 'home', path: '',
component: ExamHome, redirect: '/exam/home',
component: Exam,
meta: { meta: {
i18n: 'router.examSystem' i18n: 'router.examSystem'
} },
}, children: [
{ {
// 试卷详情 path: 'home',
path: 'detail/:examId', component: ExamHome
component: ExamDetail, },
hidden: true {
}, // 试卷详情
{ path: 'detail/:examId',
path: 'course/:lessonId', component: ExamDetail,
component: ExamCourseDetail, hidden: true
hidden: true },
}, {
{ path: 'course/:lessonId',
// 规则管理 component: ExamCourseDetail,
path: 'examRule/manage', hidden: true
component: PublishExamRule, },
hidden: true {
}, // 规则管理
{ path: 'examRule/manage',
path: 'examRule/draft/:mode/:ruleId/:lessonId', component: PublishExamRule,
hidden: true, hidden: true
component: PublishExamRuleDraft },
}, {
{ path: 'examRule/draft/:mode/:ruleId/:lessonId',
path: 'pay/:lessonId', hidden: true,
component: Pay, component: PublishExamRuleDraft
hidden: true },
}, {
{ path: 'pay/:lessonId',
// 开始考试 component: Pay,
path: 'questionDetail/:examQuestionId', hidden: true
component: ExamQuestionDetail, },
hidden: true {
}, // 开始考试
{ path: 'questionDetail/:examQuestionId',
// 考试结果 component: ExamQuestionDetail,
path: 'result/:userExamId', hidden: true
component: ExamResult, },
hidden: true {
// 考试结果
path: 'result/:userExamId',
component: ExamResult,
hidden: true
}
]
} }
] ]
}, },
{ {
path: '/demonstration', path: '/demonstration',
redirect: '/demonstration/home', component: Layout,
component: Demonstration,
meta: { meta: {
roles: [admin, userSimulation, user] roles: [admin, userSimulation, user]
}, },
children: [ children: [
{ {
path: 'home', path: '',
component: DemonstrationHome, redirect: '/demonstration/home',
component: Demonstration,
meta: { meta: {
i18n: 'router.demonstrationSystem' i18n: 'router.demonstrationSystem'
} },
}, children: [
{ {
path: 'detail/:mapId', path: 'home',
component: DemonstrationDetail, component: DemonstrationHome,
hidden: true meta: {
}, i18n: 'router.demonstrationSystem'
{ }
path: 'pay/:lessonId', },
component: Pay, {
hidden: true 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-tabs v-model="activeName">
<el-tab-pane label="课程详情" name="first"> <el-tab-pane label="课程详情" name="first">
<div :style="{ height: height - 270 +'px' }"> <div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail"> <template v-for="item in courseModel.detail">
<ul type="circle" :key="item.code"> <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 style="float:none;" type="circle" :key="it.code"> <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">(免费)</span> <span v-if="it.trial">(免费)</span>
@ -33,8 +33,8 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="权限详情" name="second"> <el-tab-pane label="权限详情" name="second">
<div :style="{ height: height - 270 +'px' }"> <div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<limit-list ref="limitList" :courseModel="courseModel" @initLoadPage="initLoadPage"></limit-list> <limit-list ref="limitList" :course-model="courseModel" @initLoadPage="initLoadPage" />
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -42,105 +42,104 @@
</div> </div>
<div class="btn-buy"> <div class="btn-buy">
<el-button type="success" @click="buy">购买</el-button> <el-button type="success" @click="buy">购买</el-button>
<el-button type="primary" @click="distribute" v-if="hasPermssion">权限分发(上课)</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">权限分发(上课)</el-button>
<el-button type="primary" @click="transfer" v-if="hasPermssion">权限转赠</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">权限转赠</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { getPublishLessonDetail } from '@/api/jmap/lesson';
import { getPublishLessonDetail } from "@/api/jmap/lesson"; import { PermissionType } from '@/scripts/ConstDic';
import { PermissionType } from "@/scripts/ConstDic"; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import WindowResizeHandler from "@/mixin/WindowResizeHandler"; import LimitList from '@/views/components/limits/index';
import LimitList from "@/views/components/limits/index";
export default { export default {
name: "LessonDetail", name: 'LessonDetail',
components: { components: {
LimitList LimitList
}, },
data() { mixins: [WindowResizeHandler],
return { data() {
num: 5, return {
height: "", num: 5,
WhetherTypeList: [], height: '',
EffectiveTypeList: [], WhetherTypeList: [],
courseModel: { EffectiveTypeList: [],
id: "", courseModel: {
name: "", id: '',
skinStyle: "", name: '',
price: 0, skinStyle: '',
remarks: "", price: 0,
detail: [], remarks: '',
pmsList: [] detail: [],
}, pmsList: []
activeName: 'first' },
}; activeName: 'first'
}, };
mixins: [WindowResizeHandler], },
watch: { computed: {
$route(newVal) { hasPermssion() {
this.initLoadPage(); return this.courseModel.pmsList.length > 0;
} }
}, },
computed: { watch: {
hasPermssion() { $route(newVal) {
return this.courseModel.pmsList.length > 0; this.initLoadPage();
} }
}, },
mounted() { mounted() {
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list; this.EffectiveTypeList = list;
}); });
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
resizeHandler: function () { resizeHandler: function () {
this.height = this._clientHeight; this.height = this._clientHeight;
}, },
initLoadPage() { initLoadPage() {
let data = { id: this.$route.params.lessonId }; const data = { id: this.$route.params.lessonId };
if (parseInt(data.id)) { if (parseInt(data.id)) {
getPublishLessonDetail(data).then(response => { getPublishLessonDetail(data).then(response => {
this.courseModel = { this.courseModel = {
id: response.data.id, id: response.data.id,
name: response.data.name, name: response.data.name,
price: response.data.price, price: response.data.price,
remarks: response.data.remarks, remarks: response.data.remarks,
detail: response.data.chapters, detail: response.data.chapters,
pmsList: response.data.pmsList, pmsList: response.data.pmsList,
prdCode: response.data.prdCode, prdCode: response.data.prdCode,
mapId: response.data.mapId, mapId: response.data.mapId,
skinStyle: response.data.skinStyle, skinStyle: response.data.skinStyle,
PermissionType: PermissionType.LESSON PermissionType: PermissionType.LESSON
}; };
}).catch(error => { }).catch(error => {
this.$message.error("获取课程信息失败:" + error.message); this.$message.error('获取课程信息失败:' + error.message);
}); });
} }
}, },
buy() { buy() {
this.$router.push({ this.$router.push({
path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`, path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`,
query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
}); });
}, },
transfer() { transfer() {
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel); this.$refs.limitList.transfer(this.courseModel);
} }
}, },
distribute() { distribute() {
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -160,4 +159,4 @@
justify-content: center; justify-content: center;
transform: translateY(-20px); transform: translateY(-20px);
} }
</style> </style>

View File

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