暂时提交
This commit is contained in:
parent
a88cbe11d6
commit
6c8a8574da
10
src/api/designPlatform.js
Normal file
10
src/api/designPlatform.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function getDraftLesson(params, mapId) {
|
||||
/** 根据mapId获取草稿课程 */
|
||||
return request({
|
||||
url: `/api/mapSystem/findDraftLessonBy/${mapId}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
@ -415,7 +415,7 @@ export const asyncRouter = [
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/home',
|
||||
path: 'lesson/home/:mapId',
|
||||
component: LessonHome,
|
||||
hidden: true
|
||||
},
|
||||
|
@ -145,7 +145,7 @@
|
||||
break;
|
||||
}
|
||||
case 'lessonDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}` });
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.mapId}` });
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
@ -153,7 +153,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.$refs.menu.doClose();
|
||||
// this.$refs.menu.doClose();
|
||||
},
|
||||
// async myrefresh(filterSelect){
|
||||
|
||||
|
@ -1,188 +1,98 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<div slot="header" style="text-align: center;">
|
||||
<b>课程管理系统</b>
|
||||
</div>
|
||||
<div style="margin:50px" :style="{ height: height - 190 +'px' }">
|
||||
<p style="font-size: 14px; margin-bottom: 20px"> 课程管理说明:
|
||||
<span style="color: #808080 !important;">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
<div :style="{ height: height - 270 +'px' }">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="courseModel.detail"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
@node-contextmenu="showContextMenu"
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span v-if="node.data.trial" class="el-icon-goods" :style="{color: 'green'}"> {{ node.label +'(免费)'}}</span>
|
||||
<span v-else class="el-icon-sold-out"> {{ node.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-buy">
|
||||
<el-button type="success" @click="lessonEdit">课程编辑</el-button>
|
||||
<el-button type="primary" >实训录制</el-button>
|
||||
<el-button type="primary" >任务管理</el-button>
|
||||
<el-button type="primary" >操作定义</el-button>
|
||||
<el-button type="primary" >实训管理</el-button>
|
||||
<el-button type="primary" >从发布课程新建</el-button>
|
||||
</div>
|
||||
<tree-operate-menu ref="treeOperateMenu" :point="point" :selected="selected" @refresh="refresh"
|
||||
@lessonCreate="lessonCreate" @chapterCreate="chapterCreate" @treeSort="treeSort"></tree-operate-menu>
|
||||
</el-card>
|
||||
<div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="margin-bottom: 20px;"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="日期"
|
||||
sortable
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="姓名"
|
||||
sortable
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="地址">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import TreeOperateMenu from './lessoncategory/category/operateMenu';
|
||||
import { getDraftLesson } from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
name: 'LessonDetail',
|
||||
name: 'LessonHome',
|
||||
components: {
|
||||
TreeOperateMenu,
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
num: 5,
|
||||
loading: false,
|
||||
WhetherTypeList: [],
|
||||
EffectiveTypeList: [],
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: 'test',
|
||||
skinCode: '',
|
||||
price: 0,
|
||||
remarks: '创建课程的一套工具',
|
||||
detail: [],
|
||||
pmsList: []
|
||||
},
|
||||
activeName: 'first',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
selected: {},
|
||||
tableData: [{
|
||||
id: 1,
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄'
|
||||
}, {
|
||||
id: 2,
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄'
|
||||
}, {
|
||||
id: 3,
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄',
|
||||
children: [{
|
||||
id: 31,
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄'
|
||||
}, {
|
||||
id: 32,
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄'
|
||||
}]
|
||||
}, {
|
||||
id: 4,
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄'
|
||||
}],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasPermssion() {
|
||||
return this.courseModel.pmsList.length > 0;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(newVal) {
|
||||
this.initLoadPage();
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.EffectiveTypeList = list;
|
||||
});
|
||||
this.initLoadPage();
|
||||
console.log('==============');
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
this.courseModel.detail = [
|
||||
{
|
||||
id:'1',
|
||||
name:'地图设计',
|
||||
type:'lesson',
|
||||
children: [
|
||||
{
|
||||
id: '9',
|
||||
name: '测试章节',
|
||||
type: 'lesson'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:'2',
|
||||
name:'课程设计',
|
||||
type:'lesson'
|
||||
},
|
||||
{
|
||||
id:'3',
|
||||
name:'剧本设计',
|
||||
type:'lesson'
|
||||
},
|
||||
{
|
||||
id:'4',
|
||||
name:'运行图设计',
|
||||
type:'lesson'
|
||||
},
|
||||
]
|
||||
},
|
||||
clickEvent(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;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
let menu = DeviceMenu.Lesson;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
},
|
||||
refresh() {
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}`})
|
||||
},
|
||||
treeSort() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}`})
|
||||
},
|
||||
chapterCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}`})
|
||||
},
|
||||
lessonEdit() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonManage}`})
|
||||
loadInitData() {
|
||||
getDraftLesson({},this.mapId).then(response=> {
|
||||
console.log(response);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.menu li {
|
||||
border-right: solid white 1px;
|
||||
}
|
||||
|
||||
ul {
|
||||
line-height: 22px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.btn-buy {
|
||||
position: relative;
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
transform: translateY(-20px);
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user