课程发布审批流程暂存

This commit is contained in:
fan 2019-10-11 08:55:02 +08:00
parent e31bd2730f
commit 5a21420a18
7 changed files with 169 additions and 21 deletions

View File

@ -58,7 +58,7 @@ export function runUserPlanNotify({ planId }) {
/** 管理员获取需审核的课程列表 */ /** 管理员获取需审核的课程列表 */
export function reviewLessonList(params) { export function reviewLessonList(params) {
return request({ return request({
url: `/api/review/lesson`, url: `/api/review/query/lesson`,
method: 'get', method: 'get',
params params
}); });
@ -76,7 +76,7 @@ export function adminPublishLesson(data, id) {
/** 管理员驳回课程发布申请 */ /** 管理员驳回课程发布申请 */
export function rejectedLessonRelease(data, id) { export function rejectedLessonRelease(data, id) {
return request({ return request({
url: `/api/review/${id}`, url: `/api/review/lesson/${id}`,
method: 'post', method: 'post',
data: data data: data
}); });
@ -85,7 +85,7 @@ export function rejectedLessonRelease(data, id) {
/** 普通用户申请发布和撤销申请 */ /** 普通用户申请发布和撤销申请 */
export function releaseOrCancel(id, status) { export function releaseOrCancel(id, status) {
return request({ return request({
url: `/api/review/releaseOrCancel/${id}/${status}`, url: `/api/review/lesson/releaseOrCancel/${id}/${status}`,
method: 'get' method: 'get'
}); });
} }

View File

@ -36,7 +36,8 @@
</el-table-column> </el-table-column>
<template v-for="(column, index) in queryList.columns"> <template v-for="(column, index) in queryList.columns">
<el-table-column <el-table-column
v-if="checkColumnTyep(column, 'basic')" v-if="
(column, 'basic')"
:key="index" :key="index"
:prop="column.prop" :prop="column.prop"
:label="column.title" :label="column.title"

View File

@ -108,9 +108,10 @@ import UserTraining from '@/views/management/userTraining/index';
import UserExam from '@/views/management/userExam/index'; import UserExam from '@/views/management/userExam/index';
import UserSimulation from '@/views/management/userSimulation/index'; import UserSimulation from '@/views/management/userSimulation/index';
import ExistingSimulation from '@/views/management/existingSimulation/index'; import ExistingSimulation from '@/views/management/existingSimulation/index';
import CacheControl from '@/views/management/cacheControl/index'; import CacheControl from '@/views/management/cacheControl/index';
import LessonApproval from '@/views/approval/lesson/index';
/** /**
* Note: sub-menu only appear when route children.length >= 1 * Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@ -1046,7 +1047,7 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'lesson', path: 'lesson',
component: SkinCode, component: LessonApproval,
meta: { meta: {
i18n: 'router.courseApplication' i18n: 'router.courseApplication'
} }

View File

@ -1,24 +1,110 @@
<template> <template>
<div> <div>
<QueryListPage></QueryListPage> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'LessonApproval', name: 'LessonApproval',
components: { components: {
}, },
data() { data() {
formModel = { return{
name: '', formModel: {
creator: '', name: '',
data: '' creator: '',
data: ''
},
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图:',
config: {
data: []
}
},
lessonName: {
type: 'text',
label: this.$t('lesson.courseName')
},
userName: {
type: 'text',
label: '申请人:'
}
}
},
queryList: {
query: reviewLessonList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('lesson.courseName'),
prop: 'name'
},
{
title: '地图',
prop: 'mapId ',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: '课程说明',
prop: 'remarks'
},
{
title: '申请人',
prop: 'userName'
},
{
title: '申请时间',
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return this.handleTime(row.uploadTime)},
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: '通过',
handleClick: this.pass,
type: ''
},
{
name: '驳回',
handleClick: this.noPass,
type: ''
}
]
}
]
}
} }
}, },
created(){ created(){
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
}, },
mounted(){ mounted(){
@ -35,6 +121,16 @@
}, },
goDetail() { goDetail() {
this.$router.push({path:``}); this.$router.push({path:``});
},
pass(index,row) {
},
noPass(index,row) {
},
handleTime(time) {
let timeList = time.split("T");
return timeList[0] + ' ' +timeList[1];
} }
} }
} }

View File

@ -0,0 +1,32 @@
<template>
<div>
</div>
</template>
<script>
export default {
name: 'LessonApprovalReject',
components: {
},
watch: {
},
data() {
},
created() {
},
mounted() {
},
beforeDestroy(){
},
methods: {
}
}
</script>

View File

@ -21,33 +21,39 @@
border border
:label="this.$t('lesson.lesson')"> :label="this.$t('lesson.lesson')">
</el-table-column> </el-table-column>
<el-table-column
prop="status"
label="状态"
>
</el-table-column>
<el-table-column <el-table-column
:label="this.$t('global.operate')"> :label="this.$t('global.operate')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
v-if="scope.row.status!=='1'"
@click="createChapter(scope.row)" @click="createChapter(scope.row)"
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter')}}</el-button> >{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter')}}</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" plain type="primary" plain
v-if="scope.row.type === 'lesson'" v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
@click="treeSort(scope.row)" @click="treeSort(scope.row)"
>{{$t('lesson.contentSorting')}}</el-button> >{{$t('lesson.contentSorting')}}</el-button>
<el-button size="mini" <el-button size="mini"
type="info" type="info"
v-if="scope.row.type === 'lesson'" v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
@click="editLesson(scope.row)" @click="editLesson(scope.row)"
>{{$t('lesson.editCourse')}}</el-button> >{{$t('lesson.editCourse')}}</el-button>
<el-button size="mini" <el-button size="mini"
type="primary" type="primary"
v-if="scope.row.type === 'lesson'" v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
@click="publish(scope.row)" @click="publish(scope.row)"
>{{hasRelease?$t('global.release'):$t('lesson.applicationForRelease')}}</el-button> >{{hasRelease?$t('global.release'):$t('lesson.applicationForRelease')}}</el-button>
<el-button size="mini" <el-button size="mini"
type="danger" type="danger"
v-if="scope.row.type === 'lesson'" v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
@click="deleteLesson(scope.row)" @click="deleteLesson(scope.row)"
>{{$t('global.delete')}}</el-button> >{{$t('global.delete')}}</el-button>
</template> </template>

View File

@ -16,7 +16,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name"> <el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name"></el-input> <el-input v-model="editModel.name" :disabled="this.disabled"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -30,8 +30,7 @@
<script> <script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map'; import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft'; import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
import { publishLesson } from '@/api/jmap/lessondraft'; import { adminPublishLesson,releaseOrCancel } from '@/api/designPlatform';
import { adminPublishLesson } from '@/api/designPlatform';
export default { export default {
name: 'LessonPublish', name: 'LessonPublish',
@ -68,6 +67,10 @@
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
], ],
} }
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
} }
}, },
methods: { methods: {
@ -119,8 +122,17 @@
doSave() { doSave() {
this.loading = true; this.loading = true;
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid && this.hasRelease) {
publishLesson(this.editModel).then(response => { adminPublishLesson(this.editModel,this.editModel.id).then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
}else if(valid && !this.hasRelease){
releaseOrCancel(this.editModel.id,"1").then(response => {
this.loading = false; this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful')); this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose(); this.doClose();