暂时提交

This commit is contained in:
fan 2019-09-29 14:27:58 +08:00
parent a88cbe11d6
commit 6c8a8574da
4 changed files with 88 additions and 168 deletions

10
src/api/designPlatform.js Normal file
View 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
});
}

View File

@ -415,7 +415,7 @@ export const asyncRouter = [
hidden: true hidden: true
}, },
{ {
path: 'lesson/home', path: 'lesson/home/:mapId',
component: LessonHome, component: LessonHome,
hidden: true hidden: true
}, },

View File

@ -145,7 +145,7 @@
break; break;
} }
case 'lessonDesign': { case 'lessonDesign': {
this.$router.push({ path: `${UrlConfig.design.lessonHome}` }); this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.mapId}` });
break; break;
} }
case 'runPlanDesign': { case 'runPlanDesign': {
@ -153,7 +153,7 @@
break; break;
} }
} }
this.$refs.menu.doClose(); // this.$refs.menu.doClose();
}, },
// async myrefresh(filterSelect){ // async myrefresh(filterSelect){

View File

@ -1,188 +1,98 @@
<template> <template>
<el-card> <div>
<div slot="header" style="text-align: center;"> <el-table
<b>课程管理系统</b> :data="tableData"
</div> style="margin-bottom: 20px;"
<div style="margin:50px" :style="{ height: height - 190 +'px' }"> row-key="id"
<p style="font-size: 14px; margin-bottom: 20px"> 课程管理说明: border
<span style="color: #808080 !important;">{{ courseModel.remarks }}</span> default-expand-all
</p> :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<div :style="{ height: height - 270 +'px' }"> <el-table-column
<el-scrollbar wrap-class="scrollbar-wrapper"> prop="date"
<el-tree label="日期"
ref="tree" sortable
:data="courseModel.detail" width="180">
node-key="id" </el-table-column>
:props="defaultProps" <el-table-column
:filter-node-method="filterNode" prop="name"
highlight-current label="姓名"
@node-contextmenu="showContextMenu" sortable
:span="22" width="180">
@node-click="clickEvent" </el-table-column>
> <el-table-column
<span slot-scope="{ node, data }"> prop="address"
<span v-if="node.data.trial" class="el-icon-goods" :style="{color: 'green'}">&nbsp;{{ node.label +'免费'}}</span> label="地址">
<span v-else class="el-icon-sold-out">&nbsp;{{ node.label }}</span> </el-table-column>
</span> </el-table>
</el-tree> </div>
</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>
</template> </template>
<script> <script>
import { getPublishLessonDetail } from '@/api/jmap/lesson'; import { getDraftLesson } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index';
import { DeviceMenu } from '@/scripts/ConstDic';
import TreeOperateMenu from './lessoncategory/category/operateMenu';
export default { export default {
name: 'LessonDetail', name: 'LessonHome',
components: { components: {
TreeOperateMenu, },
computed: {
mapId() {
return this.$route.params.mapId;
}
}, },
data() { data() {
return { return {
num: 5, tableData: [{
loading: false, id: 1,
WhetherTypeList: [], date: '2016-05-02',
EffectiveTypeList: [], name: '王小虎',
courseModel: { address: '上海市普陀区金沙江路 1518 弄'
id: '', }, {
name: 'test', id: 2,
skinCode: '', date: '2016-05-04',
price: 0, name: '王小虎',
remarks: '创建课程的一套工具', address: '上海市普陀区金沙江路 1517 弄'
detail: [], }, {
pmsList: [] id: 3,
}, date: '2016-05-01',
activeName: 'first', name: '王小虎',
defaultProps: { address: '上海市普陀区金沙江路 1519 弄',
children: 'children', children: [{
label: 'name' id: 31,
}, date: '2016-05-01',
point: { name: '王小虎',
x: 0, address: '上海市普陀区金沙江路 1519 弄'
y: 0 }, {
}, id: 32,
selected: {}, 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() { mounted() {
this.$Dictionary.effectiveType().then(list => { console.log('==============');
this.EffectiveTypeList = list; this.loadInitData();
});
this.initLoadPage();
}, },
methods: { methods: {
initLoadPage() { loadInitData() {
this.courseModel.detail = [ getDraftLesson({},this.mapId).then(response=> {
{ console.log(response);
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}`})
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; .draft {
width: 400px;
.menu li {
border-right: solid white 1px;
}
ul {
line-height: 22px;
margin: 5px;
}
.btn-buy {
position: relative;
text-align: center; text-align: center;
justify-content: center; margin: 20px auto;
transform: translateY(-20px);
} }
</style> </style>