2019-09-26 15:08:53 +08:00
|
|
|
<template>
|
2019-11-11 13:10:36 +08:00
|
|
|
<div class="joylink-card">
|
|
|
|
<div class="lesson-header">
|
2020-05-15 14:59:53 +08:00
|
|
|
<div class="lesson-list">草稿{{ $t('lesson.courseList') }}</div>
|
2019-11-11 13:10:36 +08:00
|
|
|
<div class="but-group">
|
2019-10-23 15:01:25 +08:00
|
|
|
<el-button v-if="hasRelease" size="mini" @click="operationManage">{{ $t('lesson.trainingRule') }}</el-button>
|
2019-10-17 18:27:49 +08:00
|
|
|
<el-button v-if="hasRelease" size="mini" @click="trainingManage">{{ $t('lesson.trainingManage') }}</el-button>
|
|
|
|
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{ $t('lesson.createNewCoursesFromRelease') }}</el-button>
|
|
|
|
<el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
|
|
|
</div>
|
2019-11-11 13:10:36 +08:00
|
|
|
</div>
|
|
|
|
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
2019-10-17 18:27:49 +08:00
|
|
|
<publish-create ref="publishCreate" @refresh="refresh" />
|
|
|
|
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
|
|
|
<lesson-detail ref="lessonDetail" />
|
|
|
|
</div>
|
2019-09-26 15:08:53 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-10-21 08:59:27 +08:00
|
|
|
import { releaseOrCancel } from '@/api/designPlatform';
|
2019-10-22 13:40:42 +08:00
|
|
|
import { getLessonDrftList } from '@/api/jmap/lessondraft';
|
2020-03-30 13:07:11 +08:00
|
|
|
import { UrlConfig } from '@/scripts/ConstDic';
|
2019-10-17 18:27:49 +08:00
|
|
|
import PublishCreate from './lessoncategory/edit/create';
|
|
|
|
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
2019-10-31 15:56:07 +08:00
|
|
|
import { delLesson } from '@/api/jmap/lessondraft';
|
2020-08-10 17:40:17 +08:00
|
|
|
import LessonDetail from '@/views/approval/detail';
|
2019-10-22 13:40:42 +08:00
|
|
|
import ConstConfig from '@/scripts/ConstConfig';
|
2019-09-30 13:24:47 +08:00
|
|
|
|
2019-10-17 18:27:49 +08:00
|
|
|
export default {
|
2019-10-29 17:33:11 +08:00
|
|
|
name: 'LessonHome',
|
|
|
|
components: {
|
|
|
|
PublishCreate,
|
|
|
|
PublishLesson,
|
|
|
|
LessonDetail
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
loading: false,
|
|
|
|
pagerConfig: {
|
|
|
|
pageSize: 'pageSize',
|
|
|
|
pageIndex: 'pageNum'
|
|
|
|
},
|
|
|
|
queryForm: {
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
queryList: {
|
2019-10-31 15:56:07 +08:00
|
|
|
query: this.queryFunction,
|
2019-10-29 17:33:11 +08:00
|
|
|
selectCheckShow: false,
|
|
|
|
indexShow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: this.$t('lesson.courseName'),
|
|
|
|
prop: 'name'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('lesson.courseDescription'),
|
|
|
|
prop: 'remarks'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('global.status'),
|
|
|
|
prop: 'status',
|
|
|
|
type: 'tag',
|
|
|
|
columnValue: (row) => {
|
|
|
|
return this.$convertField(row.status, ConstConfig.ConstSelect.releaseReview, ['value', 'label']);
|
|
|
|
},
|
|
|
|
tagType: (row) => { return 'success'; }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
title: this.$t('global.operate'),
|
|
|
|
width: '400',
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
name: this.$t('lesson.courseDetails'),
|
|
|
|
handleClick: this.goDetail,
|
|
|
|
type: 'primary',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status !== '1';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('lesson.contentSorting'),
|
|
|
|
handleClick: this.treeSort,
|
|
|
|
type: 'primary',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status !== '1';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('global.release'),
|
|
|
|
handleClick: this.publish,
|
|
|
|
type: 'primary',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status === '0' && this.hasRelease;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('lesson.applicationForRelease'),
|
|
|
|
handleClick: this.publish,
|
|
|
|
type: 'primary',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status === '0' && !this.hasRelease;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('lesson.review'),
|
|
|
|
handleClick: this.review,
|
|
|
|
type: 'primary',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status === '1';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('global.delete'),
|
|
|
|
handleClick: this.deleteLesson,
|
|
|
|
type: 'danger',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status !== '1';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('lesson.withdraw'),
|
|
|
|
handleClick: this.revertLesson,
|
|
|
|
type: 'danger',
|
|
|
|
showControl: (row) => {
|
|
|
|
return row.status === '1';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2019-10-22 13:40:42 +08:00
|
|
|
|
2019-10-29 17:33:11 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
mapId() {
|
|
|
|
return this.$route.params.mapId;
|
|
|
|
},
|
|
|
|
hasRelease() {
|
|
|
|
return this.$store.state.user.roles.includes('04') ||
|
2020-06-22 10:49:41 +08:00
|
|
|
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('03');
|
2019-10-29 17:33:11 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route() {
|
|
|
|
this.refresh();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
},
|
|
|
|
methods: {
|
2019-10-31 15:56:07 +08:00
|
|
|
queryFunction(params) {
|
|
|
|
return getLessonDrftList(this.$route.params.mapId, params);
|
2019-10-29 17:33:11 +08:00
|
|
|
},
|
|
|
|
handlerStatus(row) {
|
|
|
|
let lessonStatus = '';
|
|
|
|
switch (row.status) {
|
|
|
|
case '0':
|
|
|
|
lessonStatus = this.$t('lesson.notRelease');
|
|
|
|
break;
|
|
|
|
case '1':
|
|
|
|
lessonStatus = this.$t('lesson.pendingReview');
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
lessonStatus = this.$t('lesson.published');
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
lessonStatus = this.$t('lesson.rejected');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return lessonStatus;
|
|
|
|
},
|
|
|
|
refresh() {
|
|
|
|
this.$refs.queryListPage.refresh(true);
|
|
|
|
},
|
|
|
|
lessonCreate() {
|
2020-10-26 11:07:49 +08:00
|
|
|
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode, lineCode: this.$route.query.lineCode} });
|
2019-10-29 17:33:11 +08:00
|
|
|
},
|
|
|
|
lessonCreateByPublish() {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.publishCreate.doShow();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
publish(index, row) {
|
2019-10-31 17:45:15 +08:00
|
|
|
row.mapId = this.$route.params.mapId;
|
2019-10-29 17:33:11 +08:00
|
|
|
row.cityCode = this.$route.query.cityCode;
|
|
|
|
this.$refs.publishLesson.doShow(row);
|
|
|
|
},
|
|
|
|
deleteLesson(index, row) {
|
|
|
|
delLesson(row).then(response => {
|
|
|
|
this.$message.success(this.$t('tip.successfullyDelete'));
|
|
|
|
this.loading = true;
|
|
|
|
this.refresh();
|
|
|
|
this.loading = false;
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('tip.failDelete'));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
treeSort(index, row) {
|
|
|
|
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: {id: row.id}});
|
|
|
|
},
|
|
|
|
taskManage() {
|
2019-10-31 15:56:07 +08:00
|
|
|
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId}});
|
2019-10-29 17:33:11 +08:00
|
|
|
},
|
|
|
|
trainingManage() {
|
2020-10-26 11:07:49 +08:00
|
|
|
this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}});
|
2019-10-29 17:33:11 +08:00
|
|
|
},
|
|
|
|
operationManage() {
|
2020-10-26 11:07:49 +08:00
|
|
|
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}});
|
2019-10-29 17:33:11 +08:00
|
|
|
},
|
|
|
|
revertLesson(index, row) {
|
|
|
|
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
|
|
|
|
confirmButtonText: this.$t('global.confirm'),
|
|
|
|
cancelButtonText: this.$t('global.cancel'),
|
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
releaseOrCancel(row.id, '0').then(response => {
|
|
|
|
this.loading = false;
|
|
|
|
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
|
|
|
|
this.refresh();
|
|
|
|
}).catch(() => {
|
|
|
|
this.loading = false;
|
|
|
|
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
|
|
|
this.refresh();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
review(index, row) {
|
|
|
|
this.$refs.lessonDetail.show(row.id);
|
|
|
|
},
|
|
|
|
goDetail(index, row) {
|
2020-10-26 11:07:49 +08:00
|
|
|
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, lineCode: this.$route.query.lineCode, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId}});
|
2019-10-29 17:33:11 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-17 18:27:49 +08:00
|
|
|
};
|
2019-09-26 15:08:53 +08:00
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
2019-11-11 13:10:36 +08:00
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
.joylink-card{
|
|
|
|
height: 100%;
|
|
|
|
overflow: auto;
|
2019-09-26 15:08:53 +08:00
|
|
|
}
|
2019-11-11 13:10:36 +08:00
|
|
|
.lesson-header{
|
|
|
|
display:inline-block;margin-top:40px;width: 90%;margin-left:5%;
|
|
|
|
}
|
|
|
|
.lesson-list{
|
|
|
|
display:inline-block;padding:7px 0px
|
|
|
|
}
|
|
|
|
.but-group{
|
2019-09-29 15:55:01 +08:00
|
|
|
float: right;
|
2019-11-11 13:10:36 +08:00
|
|
|
margin-right:20px;
|
2019-09-29 15:55:01 +08:00
|
|
|
}
|
2019-09-26 15:08:53 +08:00
|
|
|
</style>
|