This commit is contained in:
zyy 2019-10-22 16:29:19 +08:00
commit d97c1096b0
7 changed files with 229 additions and 151 deletions

View File

@ -39,6 +39,7 @@ import TrainingRuleEdit from '@/views/lesson/trainingRule/detail/index';
import Trainingmanage from '@/views/lesson/trainingmanage/index';
import LessonEdit from '@/views/lesson/lessoncategory/index';
import LessonHome from '@/views/lesson/home';
import LessonDetail from '@/views/lesson/details';
import ScriptmanageHome from '@/views/scriptManage/home';
import ScriptDisplay from '@/views/scriptManage/display/index';
@ -357,11 +358,11 @@ export const asyncRouter = [
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
// {
// path: 'lesson/edit/:type',
// component: LessonEdit,
// hidden: true
// },
{
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
@ -380,6 +381,18 @@ export const asyncRouter = [
component: LessonHome,
hidden: true
},
{
path: 'lesson/details',
component: LessonDetail,
hidden: true,
children: [
{
path: 'edit/:type',
component: LessonEdit,
hidden: true
}
]
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,

View File

@ -25,17 +25,18 @@
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
prop="name"
border
:label="this.$t('approval.chapterTrainingName')">
</el-table-column>
:label="this.$t('approval.chapterTrainingName')"
/>
<el-table-column
prop="remarks"
border
:label="this.$t('approval.instructions')">
</el-table-column>
:label="this.$t('approval.instructions')"
/>
</el-table>
</el-scrollbar>
</el-card>
@ -51,14 +52,6 @@
name: 'LessonApprovalDetail',
components: {
},
watch: {
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
},
data() {
return {
@ -67,7 +60,15 @@
lessonName: '',
lessonRemark: '',
showDetail: false
};
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
},
watch: {
},
created() {
},
@ -89,12 +90,12 @@
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(error=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'))
}).catch(()=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'));
});
},
doClose() {
}
}
}
};
</script>

View File

@ -1,31 +1,50 @@
<template>
<div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
<el-card>
<div slot="header" style="text-align: center;">
<b>{{ $t('lesson.courseName') + ': '+ name }}</b>
</div>
<div style="display: flex;align-items:flex-start">
<div class="tree_box">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-50) +'px' }">
<el-tree
ref="tree"
style="width: 380px"
:data="treeList"
node-key="id"
:props="defaultProps"
default-expand-all
highlight-current
:span="22"
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
/>
</el-scrollbar>
</div>
<transition>
<router-view :style="{ position:'relative', left:widthLeft+'px', width: (width - widthLeft)+'px'}" :product-list="productList" />
<router-view />
</transition>
</div>
</el-card>
</template>
<script>
import { getLessonTree } from '@/api/jmap/lessondraft';
import { DeviceMenu } from '@/scripts/ConstDic';
export default {
name: 'LessonDetail',
data() {
return {
treeList: [],
defaultProps: {
children: 'children',
label: 'name',
disabled: this.showNode
},
name: '',
lessonId: '',
expandList: []
};
},
computed: {
@ -33,7 +52,7 @@ export default {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
return this.$store.state.app.height - 120;
}
},
mounted() {
@ -41,8 +60,53 @@ export default {
},
methods: {
initPageData() {
getLessonTree(this.$route.query.lessonId);
getLessonTree(this.$route.query.lessonId || this.$route.query.id).then(resp => {
if (resp.data && resp.data[0]) {
this.name = resp.data[0].name;
this.lessonId = resp.data[0].id;
this.treeList = resp.data;
}
this.editLesson();
});
},
clickEvent(obj, node, ele) {
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
editLesson() {
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.treeList[0].id, skinCode: this.$route.query.skinCode}} );
},
showNode(obj) {
return obj.type !== 'Training';
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tree_box{
position: relative;
left: 10px;
width: 400px;
padding-right: 10px;
}
.right_box{
}
</style>

View File

@ -342,6 +342,7 @@ export default {
},
goDetail(index, row) {
// this.$refs.lessonDetail.show(row.id);
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, skinCode: this.$route.params.skinCode}});
}
}
};

View File

@ -16,7 +16,6 @@
</template>
<script>
import CourceCategory from './category/tree';
import LessonEdit from './edit/lesson/index';
import ChapterEdit from './edit/chapter/index';
import SortTree from './edit/sorttree/index';
@ -25,7 +24,6 @@ import localStore from 'storejs';
export default {
name: 'LessonDraft',
components: {
CourceCategory,
LessonEdit,
ChapterEdit,
SortTree
@ -45,7 +43,7 @@ export default {
return this.$store.state.app.width - localStore.get('LeftWidth');
},
height() {
return this.$store.state.app.height - 102;
return this.$store.state.app.height - 125;
}
},
mounted() {

View File

@ -1,6 +1,6 @@
<template>
<el-card :style="{height: height+'px'}">
<div class="runPlanHeader">
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
</div>
@ -8,7 +8,7 @@
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column :label="this.$t('global.status')">
<el-table-column :label="this.$t('global.status')" v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))">
<template slot-scope="scope">
<el-tag>{{handlerStatus(scope.row)}}</el-tag>
</template>
@ -16,6 +16,7 @@
<el-table-column
prop="explanation"
show-overflow-tooltip
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
:label="this.$t('planMonitor.explanation')">
</el-table-column>
<el-table-column :label="this.$t('planMonitor.creationDate')">