Merge branch 'dev_product' of https://git.qcloud.com/joylink/jl-nclient into dev_product

# Conflicts:
#	src/api/designPlatform.js
#	src/i18n/langs/en/approval.js
#	src/i18n/langs/zh/approval.js
This commit is contained in:
joylink_cuiweidong 2019-10-14 13:12:30 +08:00
commit a622effdde
20 changed files with 453 additions and 226 deletions

View File

@ -82,7 +82,7 @@ export function rejectedLessonRelease(data, id) {
}); });
} }
/** 普通用户申请发布和撤销申请 */ /** 普通用户申请课程发布和撤销申请 */
export function releaseOrCancel(id, status) { export function releaseOrCancel(id, status) {
return request({ return request({
url: `/api/review/lesson/releaseOrCancel/${id}/${status}`, url: `/api/review/lesson/releaseOrCancel/${id}/${status}`,
@ -98,22 +98,6 @@ export function reviewScriptList(params) {
params params
}); });
} }
/** 管理员发布剧本 */
export function publishScript(id, data) {
return request({
url: `/api/review/${id}/publishScript`,
method: 'post',
data: data
});
}
/** 管理员剧本申请驳回 */
export function rejectScript(id, data) {
return request({
url: `/api/review/script/${id}`,
method: 'post',
data: data
});
}
/** 管理员获取需审核的运行图列表 */ /** 管理员获取需审核的运行图列表 */
export function reviewRunPlanList(params) { export function reviewRunPlanList(params) {
return request({ return request({
@ -131,6 +115,13 @@ export function publishRunPlan(planId, data) {
data: data data: data
}); });
} }
/** 普通用户申请或撤销运行图发布 */
export function releaseOrCancelRunPlan(planId, status) {
return request({
url: `/api/review/runPlan/releaseOrCancel/${planId}/${status}`,
method: 'get'
});
}
/** 管理员运行图申请驳回 */ /** 管理员运行图申请驳回 */
export function rejectRunPlan(id, data) { export function rejectRunPlan(id, data) {
return request({ return request({
@ -148,3 +139,17 @@ export function releaseScript(id, status) {
}); });
} }
/** 查看课程详情 */
export function reviewLessonDetail(id) {
return request({
url: `/api/review/previewLesson/${id}`,
method: 'get'
});
}
/** 管理员预览草稿运行图*/
export function previewRunPlan(planId) {
return request({
url: `/api/review/previewRunPlan/${planId}`,
method: 'get'
});
}

View File

@ -27,5 +27,10 @@ export default {
runPlanPreview: 'RunPlan Preview', runPlanPreview: 'RunPlan Preview',
inputRunPlanName: 'Please input run plan name', inputRunPlanName: 'Please input run plan name',
releaseScriptSuccess: 'release script success', releaseScriptSuccess: 'release script success',
releaseScriptFailed: 'release script failed' releaseScriptFailed: 'release script failed',
courseDescription: 'Course description',
lookOver: 'Look over',
courseDetails: 'Course details',
instructions: 'Instructions',
chapterTrainingName: 'Chapter/training name'
}; };

View File

@ -91,5 +91,7 @@ export default {
getRunGraphDataFailed: 'Failed to get run graph data', getRunGraphDataFailed: 'Failed to get run graph data',
getStationListFail: 'Failed to get station list', getStationListFail: 'Failed to get station list',
obtainTrainGroupNumberFailed: 'Failed to obtain train group number', obtainTrainGroupNumberFailed: 'Failed to obtain train group number',
getTrainListFailed: 'Failed to get train list' getTrainListFailed: 'Failed to get train list',
getDraftCourseDataFailed: 'Failed to get draft course data!',
failedToGetCourseData: 'Failed to get course data!'
}; };

View File

@ -104,5 +104,12 @@ export default {
trainingRule: 'Training rule', trainingRule: 'Training rule',
trainingManage: 'Training manage', trainingManage: 'Training manage',
newConstruction: 'New', newConstruction: 'New',
applicationForRelease: 'Application for release' applicationForRelease: 'Application for release',
rejectReason: 'Reason for rejection',
withdraw: 'Withdraw',
notRelease: 'Not release',
pendingReview: 'Pending review',
published: 'Published',
rejected: 'Rejected',
review: 'Review'
}; };

View File

@ -301,5 +301,6 @@ export default {
enterTheElevatorCode: 'Please enter the elevator code', enterTheElevatorCode: 'Please enter the elevator code',
enterTheElevatorWidth: 'Please enter the elevator width', enterTheElevatorWidth: 'Please enter the elevator width',
enterTheElevatorHeight: 'Please enter the elevator height', enterTheElevatorHeight: 'Please enter the elevator height',
enterTheElevatorColor: 'Please enter the elevator color' enterTheElevatorColor: 'Please enter the elevator color',
enterRejectReason: 'Please enter reject reason'
}; };

View File

@ -198,5 +198,11 @@ export default {
runGraphNameModifiedSuccessfully: 'Run graph name modified successfully!', runGraphNameModifiedSuccessfully: 'Run graph name modified successfully!',
modifyRunGraphNameFailed: 'Modify run graph name failed!', modifyRunGraphNameFailed: 'Modify run graph name failed!',
planCreationSuccessful: 'Plan creation successful!', planCreationSuccessful: 'Plan creation successful!',
createPlanFailed: 'Failed to create plan!' createPlanFailed: 'Failed to create plan!',
cancelCoursePublicationHint: 'This action will cancel the course publication application, is it OK?',
cancelTheSuccessfulApplicationOfTheCourseRelease: 'Cancel the successful application of the course release!',
cancellationOfCoursePublicationApplicationFailed: 'Cancellation of course publication application failed!',
publishTheCourseHint: 'This operation will publish the course. Are you sure?',
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!'
}; };

View File

@ -27,5 +27,10 @@ export default {
runPlanPreview: '预览', runPlanPreview: '预览',
inputRunPlanName: '请输入运行图名称', inputRunPlanName: '请输入运行图名称',
releaseScriptSuccess: '申请发布成功', releaseScriptSuccess: '申请发布成功',
releaseScriptFailed: '申请发布失败' releaseScriptFailed: '申请发布失败',
courseDescription: '课程说明',
lookOver: '查看',
courseDetails: '课程详情',
instructions: '说明',
chapterTrainingName: '章节/课程名称'
}; };

View File

@ -91,5 +91,7 @@ export default {
getRunGraphDataFailed: '获取运行图数据失败', getRunGraphDataFailed: '获取运行图数据失败',
getStationListFail: '获取车站列表失败', getStationListFail: '获取车站列表失败',
obtainTrainGroupNumberFailed: '获取列车车组号失败', obtainTrainGroupNumberFailed: '获取列车车组号失败',
getTrainListFailed: '获取列车列表失败' getTrainListFailed: '获取列车列表失败',
getDraftCourseDataFailed: '获取草稿课程数据失败!',
failedToGetCourseData: '获取课程数据失败!'
}; };

View File

@ -103,6 +103,13 @@ export default {
trainingRule: '操作定义', trainingRule: '操作定义',
trainingManage: '实训管理', trainingManage: '实训管理',
newConstruction: '新建', newConstruction: '新建',
applicationForRelease: '申请发布' applicationForRelease: '申请发布',
rejectReason: '驳回原因',
withdraw: '撤销',
notRelease: '未发布',
pendingReview: '待审核',
published: '已发布',
rejected: '已驳回',
review: '查看'
}; };

View File

@ -303,5 +303,6 @@ export default {
enterTheElevatorCode: '请输入电梯编号', enterTheElevatorCode: '请输入电梯编号',
enterTheElevatorWidth: '请输入电梯宽度', enterTheElevatorWidth: '请输入电梯宽度',
enterTheElevatorHeight: '请输入电梯高度', enterTheElevatorHeight: '请输入电梯高度',
enterTheElevatorColor: '请输入电梯颜色' enterTheElevatorColor: '请输入电梯颜色',
enterRejectReason: '请输入驳回说明'
}; };

View File

@ -198,5 +198,11 @@ export default {
runGraphNameModifiedSuccessfully: '修改运行图名称成功!', runGraphNameModifiedSuccessfully: '修改运行图名称成功!',
modifyRunGraphNameFailed: '修改运行图名称失败!', modifyRunGraphNameFailed: '修改运行图名称失败!',
planCreationSuccessful: '创建计划成功!', planCreationSuccessful: '创建计划成功!',
createPlanFailed: '创建计划失败!' createPlanFailed: '创建计划失败!',
cancelCoursePublicationHint: '此操作将撤销课程发布申请,是否确定?',
cancelTheSuccessfulApplicationOfTheCourseRelease: '撤销课程发布申请成功!',
cancellationOfCoursePublicationApplicationFailed: '撤销课程发布申请失败!',
publishTheCourseHint: '此操作将发布课程,是否确定?',
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!'
}; };

View File

@ -1,10 +1,52 @@
<template> <template>
<div> <el-dialog
<QueryListPage></QueryListPage> :title="this.$t('approval.courseDetails')"
</div> :visible.sync="showDetail"
top="20px"
width="90%"
:before-do-close="doClose"
:close-on-click-modal="false"
>
<div>
<el-card v-loading="loading">
<div slot="header" style="text-align: center;">
<b>{{ $t('global.courseName') }}: {{ lessonName }}</b>
</div>
<div style="margin:50px">
<p style="font-size: 14px; margin-bottom: 20px"> {{ $t('approval.courseDescription')}}:
<span style="color: #808080 !important;">{{ lessonRemark }}</span>
</p>
</div>
</el-card>
<el-card v-loading="loading">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height -60 + 'px'}">
<el-table
:data="tableData"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
prop="name"
border
:label="this.$t('approval.chapterTrainingName')">
</el-table-column>
<el-table-column
prop="remarks"
border
:label="this.$t('approval.instructions')">
</el-table-column>
</el-table>
</el-scrollbar>
</el-card>
</div>
</el-dialog>
</template> </template>
<script> <script>
import {reviewLessonDetail} from '@/api/designPlatform';
export default { export default {
name: 'LessonApprovalDetail', name: 'LessonApprovalDetail',
components: { components: {
@ -12,21 +54,47 @@
}, },
watch: { watch: {
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
}, },
data() { data() {
return{
loading: false,
tableData: [],
lessonName: '',
lessonRemark: '',
showDetail: false
}
}, },
created() { created() {
}, },
mounted() { mounted() {
// this.loadInitData();
}, },
beforeDestroy(){ beforeDestroy(){
}, },
methods: { methods: {
show(lessonId){
this.showDetail = true;
this.loadInitData(lessonId);
},
loadInitData(lessonId) {
this.loading =true;
reviewLessonDetail(lessonId).then(response =>{
this.tableData = response.data[0].children;
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(error=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'))
});
},
doClose() {
}
} }
} }
</script> </script>

View File

@ -1,20 +1,39 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage>
<el-dialog :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible">
<el-input type="textarea"
:rows="2"
:placeholder="this.$t('rules.enterRejectReason')"
@focus="inputFocus"
@blur="inputBlur"
v-model="textarea"></el-input>
<span v-show="needReason" style="color: red">{{'*'+$t('rules.enterRejectReason')}}</span>
<div slot="footer" class="dialog-footer">
<el-button @click="rejectCancel">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="rejectConfirm">{{$t('global.confirm')}}</el-button>
</div>
</el-dialog>
<lesson-detail ref="lessonDetail"></lesson-detail>
</div> </div>
</template> </template>
<script> <script>
import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform'; import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import LessonDetail from './detail';
export default { export default {
name: 'LessonApproval', name: 'LessonApproval',
components: { components: {
LessonDetail
}, },
data() { data() {
return{ return{
dialogFormVisible: false,
rejectId: '',
textarea: '',
needReason: false,
formModel: { formModel: {
name: '', name: '',
creator: '', creator: '',
@ -31,7 +50,7 @@
queryObject: { queryObject: {
mapId: { mapId: {
type: 'select', type: 'select',
label: '地图:', label: this.$t('approval.map')+this.$t('global.colon'),
config: { config: {
data: [] data: []
} }
@ -42,7 +61,7 @@
}, },
userName: { userName: {
type: 'text', type: 'text',
label: '申请人:' label: this.$t('approval.applicant')+this.$t('global.colon'),
} }
} }
}, },
@ -56,22 +75,22 @@
prop: 'name' prop: 'name'
}, },
{ {
title: '地图', title: this.$t('approval.map'),
prop: 'mapId ', prop: 'mapId ',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: '课程说明', title: this.$t('approval.courseDescription'),
prop: 'remarks' prop: 'remarks'
}, },
{ {
title: '申请人', title: this.$t('approval.applicant'),
prop: 'userName' prop: 'userName'
}, },
{ {
title: '申请时间', title: this.$t('approval.applyTime'),
prop: 'uploadTime', prop: 'uploadTime',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.handleTime(row.uploadTime)}, columnValue: (row) => { return this.handleTime(row.uploadTime)},
@ -83,12 +102,17 @@
width: '250', width: '250',
buttons: [ buttons: [
{ {
name: '通过', name: this.$t('approval.lookOver'),
handleClick: this.goDetail,
type: ''
},
{
name: this.$t('approval.applyPassed'),
handleClick: this.pass, handleClick: this.pass,
type: '' type: ''
}, },
{ {
name: '驳回', name: this.$t('approval.applyReject'),
handleClick: this.noPass, handleClick: this.noPass,
type: '' type: ''
} }
@ -116,21 +140,81 @@
}, },
methods: { methods: {
refresh() { goDetail(index,row) {
this.$refs.lessonDetail.show(row.id);
},
goDetail() {
this.$router.push({path:``});
}, },
pass(index,row) { pass(index,row) {
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
const params = {
cityCode: row.cityCode,
mapId: row.mapId,
name: row.name,
prdCode: row.prdCode
};
adminPublishLesson(params,row.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'));
})
});
}, },
noPass(index,row) { noPass(index,row) {
this.needReason = false;
this.textarea = '';
this.dialogFormVisible = true;
this.rejectId = row.id;
}, },
handleTime(time) { handleTime(time) {
let timeList = time.split("T"); let timeList = time.split("T");
return timeList[0] + ' ' +timeList[1]; return timeList[0] + ' ' +timeList[1];
},
doClose() {
this.$refs.queryListPage.refresh(true);
},
rejectConfirm() {
if (!this.textarea){
this.needReason = true;
return;
}
if (this.rejectId){
rejectedLessonRelease({explanation:this.textarea},this.rejectId).then(rep =>{
this.loading = false;
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.textarea = '';
this.doClose();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.textarea = '';
this.doClose();
})
}
},
rejectCancel() {
this.dialogFormVisible = false;
this.rejectId = '';
this.textarea = '';
},
inputFocus() {
this.needReason = false;
},
inputBlur() {
if (this.textarea){
this.needReason = false;
}else {
this.needReason = true;
}
} }
} }
} }

View File

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

View File

@ -9,8 +9,10 @@
</template> </template>
<script> <script>
import RunPlanOperate from './operate'; import RunPlanOperate from './operate';
import { reviewRunPlanList,publishRunPlan,rejectRunPlan } from '@/api/designPlatform'; import { reviewRunPlanList,publishRunPlan,rejectRunPlan,previewRunPlan } from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ScriptApproval', name: 'ScriptApproval',
components: { components: {
@ -142,7 +144,15 @@
this.$refs.applyReject.doShow(row); this.$refs.applyReject.doShow(row);
}, },
runPlanPreview(index,row){ runPlanPreview(index,row){
debugger; previewRunPlan(row.id).then(resp => {
const query = {
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id,from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
});
}, },
handleConfirmPass(data){ handleConfirmPass(data){
publishRunPlan(data.id,data).then(resp => { publishRunPlan(data.id,data).then(resp => {

View File

@ -22,11 +22,19 @@
:label="this.$t('lesson.lesson')"> :label="this.$t('lesson.lesson')">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="status" :label="this.$t('global.status')"
label="状态"
> >
<template slot-scope="scope">
<span>{{handlerStatus(scope.row)}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="explanation"
show-overflow-tooltip
:label="this.$t('lesson.rejectReason')">
</el-table-column>
<el-table-column
width="500"
:label="this.$t('global.operate')"> :label="this.$t('global.operate')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -35,6 +43,14 @@
v-if="scope.row.status!=='1'" 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
size="mini"
type="primary"
v-if="scope.row.status==='1'"
@click="goDetail(scope.row)"
>
{{$t('lesson.review')}}
</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" plain type="primary" plain
@ -48,7 +64,7 @@
>{{$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'&& scope.row.status!=='1'" v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
@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"
@ -56,28 +72,37 @@
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'" 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>
<el-button size="mini"
type="danger"
v-if="scope.row.status ==='1'"
@click="revertLesson(scope.row)"
>
{{$t('lesson.withdraw')}}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<publish-create @refresh="refresh" ref="publishCreate" /> <publish-create @refresh="refresh" ref="publishCreate" />
<publish-lesson ref="publishLesson" /> <publish-lesson ref="publishLesson" @refresh="refresh" />
<lesson-detail ref="lessonDetail"/>
</div> </div>
</template> </template>
<script> <script>
import { getDraftLesson } from '@/api/designPlatform'; import { getDraftLesson,releaseOrCancel } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import PublishCreate from './lessoncategory/edit/create'; import PublishCreate from './lessoncategory/edit/create';
import PublishLesson from './lessoncategory/edit/lesson/publish'; import PublishLesson from './lessoncategory/edit/lesson/publish';
import { delLesson } from '@/api/jmap/lessondraft'; import { delLesson } from '@/api/jmap/lessondraft';
import LessonDetail from '@/views/approval/lesson/detail';
export default { export default {
name: 'LessonHome', name: 'LessonHome',
components: { components: {
PublishCreate, PublishCreate,
PublishLesson PublishLesson,
LessonDetail
}, },
computed: { computed: {
mapId() { mapId() {
@ -116,8 +141,42 @@
}); });
this.tableData = response.data; this.tableData = response.data;
this.loading = false; this.loading = false;
}).catch(error=>{
this.$messageBox(this.$t('error.getDraftCourseDataFailed'))
}); });
}, },
refuse() {
this.loading = true;
getDraftLesson({},this.mapId).then(response=> {
response.data.forEach(elem => {
if (elem.children) {
elem.children.forEach( it => {
it.parentId = elem.id;
} )
}
});
this.tableData = response.data;
this.loading = false;
});
},
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() { refresh() {
this.loading = true; this.loading = true;
this.loadInitData(); this.loadInitData();
@ -165,6 +224,26 @@
}, },
operationManage() { operationManage() {
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}}) this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
},
revertLesson(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.refuse();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
this.refuse();
});
});
},
goDetail(row) {
this.$refs.lessonDetail.show(row.id);
} }
} }
}; };

View File

@ -118,6 +118,7 @@
doClose() { doClose() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.dialogShow = false; this.dialogShow = false;
this.$emit('refresh')
}, },
doSave() { doSave() {
this.loading = true; this.loading = true;

View File

@ -30,6 +30,9 @@
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>
</el-card> </el-card>
<div class="draft">
<el-button type="primary" @click="goBack">{{$t('global.back')}}</el-button>
</div>
</div> </div>
</template> </template>
@ -50,7 +53,7 @@ export default {
}, },
computed: { computed: {
height() { height() {
return this.$store.state.app.height - 140; return this.$store.state.app.height - 180;
} }
}, },
methods: { methods: {
@ -112,7 +115,10 @@ export default {
this.$emit('refresh'); this.$emit('refresh');
}); });
} }
} },
goBack() {
this.$router.go(-1);
}
} }
}; };
</script> </script>
@ -145,4 +151,9 @@ export default {
margin: 0 auto; margin: 0 auto;
margin-top: 10px; margin-top: 10px;
} }
.draft {
width: 300px;
text-align: center;
margin: 20px auto;
}
</style> </style>

View File

@ -77,7 +77,7 @@ export default {
const self = this; const self = this;
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
if (this.isShow) { if (this.isShow) {
this.$confirm(this.$t('global.wellClearOperate'), this.$t('global.tips'), { this.$confirm(this.$t('lesson.wellClearOperate'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'

View File

@ -1,25 +1,5 @@
<template> <template>
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<!-- <div slot="header" style="text-align: center;">
<span class=" title">{{ $t('global.line')+courseModel.name }}</span>
</div>
<div style="margin:50px; overflow-x: auto;" :style="{ height: height - 150 +'px' }">
<p class="list-item">
<span class="list-label">{{ $t('global.updateTime') }}</span>
<span class="list-elem">{{ courseModel.updateTime }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ $t('global.permissionList') }}</span>
</p>
<limit-list ref="limitList" :course-model="courseModel" @initLoadPage="getScreenLists" />
<p style="display: flex; justify-content: center;">
<span class="list-label" />
<el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
<el-button type="primary" @click="start">{{ $t('planMonitor.offlineMappingSoftware') }}</el-button>
</p>
</div> -->
<div class="runPlanHeader"> <div class="runPlanHeader">
<div class="runPlanList">运行图列表</div> <div class="runPlanList">运行图列表</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">创建运行图</el-button> <el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">创建运行图</el-button>
@ -28,12 +8,28 @@
border border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"> style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column prop="name" label="运行图名称" /> <el-table-column prop="name" label="运行图名称" />
<el-table-column prop="createTime" label="创建日期" width="180" /> <el-table-column label="状态">
<el-table-column label="操作"> <template slot-scope="scope">
<span>{{handlerStatus(scope.row)}}</span>
</template>
</el-table-column>
<el-table-column
prop="explanation"
show-overflow-tooltip
label="驳回说明">
</el-table-column>
<el-table-column label="创建日期">
<template slot-scope="scope">
<span>{{handleTime(scope.row.createTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="500">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" class="button_box" @click="handleConfirm(scope.row)">加载</el-button> <el-button size="mini" class="button_box" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">加载</el-button>
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)" v-if="isCreate">修改名称</el-button> <el-button size="mini" class="button_box" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">修改名称</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate">删除</el-button> <el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate && scope.row.status !=='1'">删除</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?'发布':'申请发布'}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >撤销</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -42,112 +38,9 @@
</el-card> </el-card>
</template> </template>
<script> <script>
// import { getPublishMapInfo } from '@/api/jmap/map';
// import { PermissionType } from '@/scripts/ConstDic';
// import { UrlConfig } from '@/router/index';
// import LimitList from '@/views/components/limits/index';
// export default {
// name: 'ExamDetailList',
// components: {
// LimitList
// },
// filters: {
// },
// data() {
// return {
// courseModel: {
// mapId: '',
// name: '',
// skinCode: '',
// updateTime: '',
// pmsList: []
// },
// EffectiveTypeList: [],
// screenList: []
// };
// },
// computed: {
// hasPermssion() {
// let isShow = false;
// this.courseModel.pmsList.forEach(item => {
// if (item.canDistribute) {
// isShow = true;
// }
// });
// return isShow;
// },
// height() {
// return this.$store.state.app.height;
// }
// },
// watch: {
// $route(newVal) {
// this.initLoadPage();
// }
// },
// async mounted() {
// this.$Dictionary.effectiveType().then(list => {
// this.EffectiveTypeList = list;
// });
// await this.getScreenLists();
// this.initLoadPage();
// },
// methods: {
// async getScreenLists() {
// },
// async initLoadPage() {
// const that = this;
// const data = { id: this.$route.params.lessonId };
// if (parseInt(data.id)) {
// try {
// const res = await getPublishMapInfo(data.id);
// this.tryUser = 0;
// that.courseModel = {
// name: res.data.name,
// mapId: res.data.id,
// skinCode: res.data.skinCode,
// updateTime: res.data.updateTime,
// pmsList: that.screenList || [],
// PermissionType: PermissionType.PLAN
// };
// this.$store.dispatch('training/setPrdType', res.data.prdType);
// } catch (error) {
// this.$messageBox(this.$t('error.refreshFailed'));
// }
// }
// },
// buy() {
// this.$router.push({
// path: `${UrlConfig.plan.pay}/${this.$route.params.lessonId}`,
// query: { permissionType: PermissionType.SCREEN, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
// });
// },
// transfer() {
// if (this.$refs) {
// this.$refs.limitList.transfer(this.courseModel);
// }
// },
// distribute() {
// if (this.$refs) {
// this.$refs.limitList.distribute(this.courseModel);
// }
// },
// jump() {
// const query = {
// skinCode: this.courseModel.skinCode, mapId: this.courseModel.mapId
// };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// },
// start() {
// this.jump();
// }
// }
// };
import EditPlanName from './editTool/menus/editPlanName'; import EditPlanName from './editTool/menus/editPlanName';
import CreateEmptyPlan from './editTool/menus/createEmptyPlan'; import CreateEmptyPlan from './editTool/menus/createEmptyPlan';
import { getRpListByUserMapId} from '@/api/designPlatform'; import { getRpListByUserMapId, publishRunPlan, releaseOrCancelRunPlan} from '@/api/designPlatform';
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan'; import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
@ -184,6 +77,10 @@ export default {
skinCode() { skinCode() {
return this.$route.query.skinCode || '02'; return this.$route.query.skinCode || '02';
}, },
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
}
}, },
created(){ created(){
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode); this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
@ -282,7 +179,69 @@ export default {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
}); });
}).catch(() => { }); }).catch(() => { });
} },
handlePublish(row) {
this.$confirm(this.hasRelease? '此操作将发布运行图,是否继续?':'此操作将发起运行图发布申请,是否继续?',this.$t('tip.hint'),{
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
if (this.hasRelease){
publishRunPlan(row.id,{runPlanName: name}).then(resp => {
this.$message.success('发布运行图成功!');
this.refresh();
}).catch(() => {
this.$messageBox('发布运行图失败!');
this.refresh();
})
} else {
releaseOrCancelRunPlan(row.id, '1').then(resp => {
this.$message.success('提交运行图发布申请成功!');
this.refresh();
}).catch(() => {
this.$messageBox('提交运行图发布申请失败!');
this.refresh();
})
}
});
},
handelRevert(row) {
this.$confirm('此操作将撤销发布运行图申请,是否继续?',this.$t('tip.hint'),{
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type:'warning'
}).then(() => {
releaseOrCancelRunPlan(row.id,'0').then(resp=> {
this.$message.success('撤销运行图发布申请成功!');
this.refresh();
}).catch(() => {
this.$messageBox('撤销运行图发布申请失败!')
this.refresh();
})
})
},
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;
},
handleTime(time) {
let timeList = time.split("T");
return timeList[0] + ' ' +timeList[1];
}
} }
}; };
</script> </script>