暂时提交

This commit is contained in:
fan 2019-09-29 15:55:01 +08:00
parent dae0ceff57
commit c9570a4631
4 changed files with 53 additions and 66 deletions

View File

@ -421,7 +421,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

@ -189,7 +189,7 @@
break; break;
} }
case 'lessonDesign': { case 'lessonDesign': {
this.$router.push({ path: `${UrlConfig.designUser.lessonHome}` }); this.$router.push({ path: `${UrlConfig.designUser.lessonHome}/${this.mapId}` });
break; break;
} }
case 'runPlanDesign': { case 'runPlanDesign': {

View File

@ -1,29 +1,41 @@
<template> <template>
<div> <div style="height: 100%; overflow: hidden">
<el-card>
<div class="button_group">
<el-button type="primary" >查询</el-button>
</div>
</el-card>
<el-card v-loading="loading">
<el-table <el-table
:data="tableData" :data="tableData"
style="margin-bottom: 20px;"
row-key="id" row-key="id"
border border
default-expand-all default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
prop="date"
label="日期"
sortable
width="180">
</el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="姓名" border
sortable label="课程">
width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" label="操作">
label="地址"> <template slot-scope="scope">
<el-button
size="mini"
type="primary"
>创建章节</el-button>
<el-button
size="mini"
type="primary" plain
v-if="scope.row.type === 'lesson'"
>内容排序</el-button>
<el-button size="mini"
type="info"
>{{ scope.row.type==='lesson'? '编辑课程':'更新章节' }}</el-button>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card>
</div> </div>
</template> </template>
@ -41,49 +53,20 @@
}, },
data() { data() {
return { return {
tableData: [{ tableData: [],
id: 1, loading: 'false'
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 弄'
}],
}; };
}, },
mounted() { mounted() {
console.log('=============='); this.loading = true;
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
getDraftLesson({},this.mapId).then(response=> { getDraftLesson({},this.mapId).then(response=> {
console.log(response); this.tableData = response.data;
this.loading = false;
}); });
} }
} }
@ -95,4 +78,8 @@
text-align: center; text-align: center;
margin: 20px auto; margin: 20px auto;
} }
.button_group {
float: right;
margin: 10px 10px;
}
</style> </style>