This commit is contained in:
zyy 2019-10-22 13:41:29 +08:00
commit ac0fafebc0
31 changed files with 927 additions and 287 deletions

View File

@ -82,13 +82,13 @@ 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}`,
// method: 'get' method: 'get'
// }); });
// } }
/** 管理员获取需审核的剧本列表 ok */ /** 管理员获取需审核的剧本列表 ok */
export function reviewScriptList(params) { export function reviewScriptList(params) {

View File

@ -8,11 +8,10 @@ export function getPublishLessonList() {
}); });
} }
/** 获取发布列表树*/ /** 获取发布列表树*/
export function getPublishLessonTree(params) { export function getPublishLessonTree(id) {
return request({ return request({
url: '/api/lesson/tree', url: `/api/lesson/${id}/tree`,
method: 'get', method: 'get'
params: params || {}
}); });
} }

View File

@ -102,3 +102,11 @@ export function getLessonNameByMapIdAndLessonId(model) {
method: 'get' method: 'get'
}); });
} }
export function getLessonDrftList(params) {
return request({
url: `/api/lessonDraft`,
method: 'get',
params: params
});
}

View File

@ -1,14 +1,5 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 获取考试列表树*/
export function getCourseLessonTree(params) {
return request({
url: '/api/exam/tree',
method: 'get',
params: params
});
}
/** 创建对应课程考题 */ /** 创建对应课程考题 */
export function setCourseList(data) { export function setCourseList(data) {
return request({ return request({

View File

@ -67,3 +67,12 @@ export function createMapSubSystem(data) {
}); });
} }
export function updateSubSystem(id, data) {
/** 查询子系统信息 */
return request({
url: `/api/mapSystem/${id}`,
method: 'put',
data: data
});
}

View File

@ -100,5 +100,8 @@ export default {
publishScriptSuccess: 'Publish Script Success', publishScriptSuccess: 'Publish Script Success',
publishScriptFailed: 'Publish Script Failed', publishScriptFailed: 'Publish Script Failed',
releaseScriptTip: 'This action will apply to release script, whether to continue?', releaseScriptTip: 'This action will apply to release script, whether to continue?',
revokeScriptTip: 'This action will undo release script, whether to continue?' revokeScriptTip: 'This action will undo release script, whether to continue?',
inputScriptName: 'Please input script name',
selectMap: 'Please select map',
inputScriptDescription: 'Please input script description'
}; };

View File

@ -18,5 +18,9 @@ export default {
customized: 'Project', customized: 'Project',
selectProject: 'Please select project', selectProject: 'Please select project',
createMapSystemSuccess: 'Create map system success', createMapSystemSuccess: 'Create map system success',
createMapSystemFail: 'Create map system fail' createMapSystemFail: 'Create map system failed',
getSubSystemInfoFail: 'Get subsystem infomation failed',
updateMapSystemSuccess: 'Update map system success',
updateMapSystemFail: 'Update map system failed',
generation: 'One-click Generation'
}; };

View File

@ -101,5 +101,8 @@ export default {
publishScriptSuccess: '发布成功', publishScriptSuccess: '发布成功',
publishScriptFailed: '发布失败', publishScriptFailed: '发布失败',
releaseScriptTip: '此操作将申请发布剧本, 是否继续?', releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?' revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
inputScriptName: '请输入剧本',
selectMap: '请选择地图',
inputScriptDescription: '请输入剧本描述'
}; };

View File

@ -18,6 +18,10 @@ export default {
customized: '项目', customized: '项目',
selectProject: '请选择项目', selectProject: '请选择项目',
createMapSystemSuccess: '创建地图系统成功', createMapSystemSuccess: '创建地图系统成功',
createMapSystemFail: '创建地图系统失败' createMapSystemFail: '创建地图系统失败',
getSubSystemInfoFail: '获取子系统信息失败',
updateMapSystemSuccess: '更新地图系统成功',
updateMapSystemFail: '更新地图系统失败',
generation: '一键生成'
}; };

View File

@ -43,8 +43,10 @@ import ScriptDisplay from '@/views/scriptManage/display/index';
import TeachDetail from '@/views/teach/detail/index'; import TeachDetail from '@/views/teach/detail/index';
import TeachPractical from '@/views/teach/practical/index'; import TeachPractical from '@/views/teach/practical/index';
import TeachHome from '@/views/teach/index';
import Pay from '@/views/components/pay/index'; import Pay from '@/views/components/pay/index';
import ExamDetail from '@/views/exam/detail/examDetail'; import ExamDetail from '@/views/exam/detail/examDetail';
import ExamHome from '@/views/exam/index';
import ExamCourseDetail from '@/views/exam/detail/courseDetail'; import ExamCourseDetail from '@/views/exam/detail/courseDetail';
import ExamResult from '@/views/exam/result'; import ExamResult from '@/views/exam/result';
@ -251,7 +253,9 @@ export const UrlConfig = {
trainingPlatformHome: '/trainingPlatform/home', trainingPlatformHome: '/trainingPlatform/home',
prodDetail: '/trainingPlatform/detail', prodDetail: '/trainingPlatform/detail',
teachDetail: '/trainingPlatform/teach', teachDetail: '/trainingPlatform/teach',
teachHome: '/trainingPlatform/teachHome',
examDetail: '/trainingPlatform/exam', examDetail: '/trainingPlatform/exam',
examHome: '/trainingPlatform/examHome',
examRuleManage: '/trainingPlatform/examRule/manage', examRuleManage: '/trainingPlatform/examRule/manage',
examRuleDraft: '/trainingPlatform/examRule/Draft', examRuleDraft: '/trainingPlatform/examRule/Draft',
course: '/trainingPlatform/course', course: '/trainingPlatform/course',
@ -610,11 +614,21 @@ export const asyncRouter = [
component: DemonstrationDetail, component: DemonstrationDetail,
hidden: true hidden: true
}, },
{
path: 'teachHome/:subSystem',
component: TeachHome,
hidden: true
},
{ {
path: 'teach/:subSystem', path: 'teach/:subSystem',
component: TeachDetail, component: TeachDetail,
hidden: true hidden: true
}, },
{
path: 'examHome/:subSystem',
component: ExamHome,
hidden: true
},
{ {
path: 'exam/:examId', path: 'exam/:examId',
component: ExamDetail, component: ExamDetail,

View File

@ -127,7 +127,7 @@ export default {
this.active = 0; this.active = 0;
const type = this.$route.query.permissionType; const type = this.$route.query.permissionType;
if (type === PermissionType.LESSON) { if (type === PermissionType.LESSON) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`}); this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdCode: this.$route.query.prdCode}});
} else if (type === PermissionType.EXAM) { } else if (type === PermissionType.EXAM) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`}); this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
} else if (type === PermissionType.SCREEN) { } else if (type === PermissionType.SCREEN) {

View File

@ -21,10 +21,10 @@
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
> >
<span slot-scope="{ node, data }"> <span slot-scope="{ node }">
<span v-if="node.data.valid" class="el-icon-goods" /> <span v-if="valid||node.data.trial" class="el-icon-goods" />
<span v-else class="el-icon-sold-out" /> <span v-else class="el-icon-sold-out" />
<span :style="{color: node.data.valid?'green':'black'}">&nbsp;{{ node.label }}</span> <span :style="{color: node.data.trial||valid ?'green':'black'}">&nbsp;{{ node.label }}</span>
</span> </span>
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>
@ -51,12 +51,11 @@
</el-card> </el-card>
</template> </template>
<script> <script>
// import { getCourseLessonDetail } from '@/api/management/exam'; import { getCourseLessonDetail } from '@/api/management/exam';
import { PermissionType } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import LimitList from '@/views/components/limits/index'; import LimitList from '@/views/components/limits/index';
import { getSessionStorage, setSessionStorage } from '@/utils/auth'; import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import { getSubSystemDetail } from '@/api/trainingPlatform';
export default { export default {
name: 'ExamDetailView', name: 'ExamDetailView',
@ -81,7 +80,8 @@ export default {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
expandList: [] expandList: [],
valid: false
}; };
}, },
computed: { computed: {
@ -110,28 +110,29 @@ export default {
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list; this.EffectiveTypeList = list;
}); });
this.loadInitPage(this.$route.query.prodId, this.$route.query.type); this.loadInitPage();
}, },
methods: { methods: {
loadInitPage() { loadInitPage() {
if (this.$route.params.subSystem) { getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{ if (resp.data) {
if (resp.data.lesson) {
this.courseModel = { this.courseModel = {
id: resp.data.lesson.id, id: resp.data.id,
name: resp.data.lesson.name, name: resp.data.name,
pmsList: resp.data.permissionList || [], pmsList: resp.data.permissionList || [],
prdCode: resp.data.lesson.prdCode, prdCode: resp.data.prdCode,
mapId: resp.data.lesson.mapId, mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM, PermissionType: PermissionType.EXAM,
treeList: resp.data.tree treeList: resp.data.examDefinitionList
}; };
} }
this.getExpandList(this.courseModel.id); if (this.courseModel.pmsList && this.courseModel.pmsList.length >0) {
}).catch((error)=>{ this.valid = true;
this.$messageBox('获取考试信息失败!'+error);
});
} }
this.getExpandList(this.courseModel.id);
}).catch(()=>{
this.$messageBox('获取考试信息失败!');
});
}, },
buy() { buy() {
this.loading = true; this.loading = true;
@ -162,8 +163,7 @@ export default {
} }
}, },
clickEvent(obj, node, data) { clickEvent(obj, node, data) {
if (obj.type === 'Exam') { if (this.valid || obj.trial) {
if (obj.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }}); this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }});
} else { } else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
@ -173,8 +173,6 @@ export default {
this.buy(); this.buy();
}).catch(() => { }); }).catch(() => { });
} }
}
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;

View File

@ -215,7 +215,7 @@ export default {
} }
}, },
back() { back() {
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`}); this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
} }
} }
}; };

69
src/views/exam/index.vue Normal file
View File

@ -0,0 +1,69 @@
<template>
<div style="height: 100%; padding-bottom: 20px">
<el-card>
<div slot="header" style="text-align: center;">
<b>考试系统</b>
</div>
</el-card>
<el-card v-loading="loading">
<el-table
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="name"
label="课程"
/>
<el-table-column
prop="remarks"
show-overflow-tooltip
label="说明"
/>
<el-table-column
label="操作"
>
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
进入考试
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getSubSystemDetail } from '@/api/trainingPlatform';
import { UrlConfig } from '@/router/index';
export default {
name: 'ExamHome',
data() {
return {
tableData: [],
loading: false
};
},
mounted() {
this.loadInitPage();
},
methods: {
loadInitPage() {
if (this.$route.params.subSystem) {
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
if (resp.data) {
this.tableData = resp.data.lessonList;
}
}).catch(()=>{
this.$messageBox('获取考试信息失败!');
});
}
},
goLesson(row) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}`, query: {lessonId: row.id}});
}
}
};
</script>

View File

@ -0,0 +1,21 @@
<template>
<div>
<transition>
<router-view :style="{ position:'relative', left:widthLeft+'px', width: (width - widthLeft)+'px'}" :product-list="productList" />
</transition>
</div>
</template>
<script>
export default {
name: 'LessonDetail',
data() {
return {
};
},
methods: {
}
};
</script>

View File

@ -10,85 +10,86 @@
</div> </div>
</el-card> </el-card>
<el-card v-loading="loading"> <el-card v-loading="loading">
<el-table <!--<el-table-->
:data="tableData" <!--:data="tableData"-->
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'}"-->
> <!--&gt;-->
<el-table-column <!--<el-table-column-->
prop="name" <!--prop="name"-->
border <!--border-->
:label="this.$t('lesson.lesson')" <!--:label="this.$t('lesson.lesson')"-->
/> <!--/>-->
<el-table-column <!--<el-table-column-->
:label="this.$t('global.status')" <!--:label="this.$t('global.status')"-->
> <!--&gt;-->
<template slot-scope="scope"> <!--<template slot-scope="scope">-->
<span>{{ handlerStatus(scope.row) }}</span> <!--<span>{{ handlerStatus(scope.row) }}</span>-->
</template> <!--</template>-->
</el-table-column> <!--</el-table-column>-->
<el-table-column <!--<el-table-column-->
prop="explanation" <!--prop="explanation"-->
show-overflow-tooltip <!--show-overflow-tooltip-->
:label="this.$t('lesson.rejectReason')" <!--:label="this.$t('lesson.rejectReason')"-->
/> <!--/>-->
<el-table-column <!--<el-table-column-->
width="500" <!--width="500"-->
:label="this.$t('global.operate')" <!--:label="this.$t('global.operate')"-->
> <!--&gt;-->
<template slot-scope="scope"> <!--<template slot-scope="scope">-->
<el-button <!--<el-button-->
v-if="scope.row.status!=='1'" <!--v-if="scope.row.status!=='1'"-->
size="mini" <!--size="mini"-->
type="primary" <!--type="primary"-->
@click="createChapter(scope.row)" <!--@click="createChapter(scope.row)"-->
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button> <!--&gt;{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.status==='1'" <!--v-if="scope.row.status==='1'"-->
size="mini" <!--size="mini"-->
type="primary" <!--type="primary"-->
@click="goDetail(scope.row)" <!--@click="goDetail(scope.row)"-->
> <!--&gt;-->
{{ $t('lesson.review') }} <!--{{ $t('lesson.review') }}-->
</el-button> <!--</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'" <!--v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"-->
size="mini" <!--size="mini"-->
type="primary" <!--type="primary"-->
plain <!--plain-->
@click="treeSort(scope.row)" <!--@click="treeSort(scope.row)"-->
>{{ $t('lesson.contentSorting') }}</el-button> <!--&gt;{{ $t('lesson.contentSorting') }}</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'" <!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
size="mini" <!--size="mini"-->
type="info" <!--type="info"-->
@click="editLesson(scope.row)" <!--@click="editLesson(scope.row)"-->
>{{ $t('lesson.editCourse') }}</el-button> <!--&gt;{{ $t('lesson.editCourse') }}</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'" <!--v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"-->
size="mini" <!--size="mini"-->
type="primary" <!--type="primary"-->
@click="publish(scope.row)" <!--@click="publish(scope.row)"-->
>{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button> <!--&gt;{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'" <!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
size="mini" <!--size="mini"-->
type="danger" <!--type="danger"-->
@click="deleteLesson(scope.row)" <!--@click="deleteLesson(scope.row)"-->
>{{ $t('global.delete') }}</el-button> <!--&gt;{{ $t('global.delete') }}</el-button>-->
<el-button <!--<el-button-->
v-if="scope.row.status ==='1'" <!--v-if="scope.row.status ==='1'"-->
size="mini" <!--size="mini"-->
type="danger" <!--type="danger"-->
@click="revertLesson(scope.row)" <!--@click="revertLesson(scope.row)"-->
> <!--&gt;-->
{{ $t('lesson.withdraw') }} <!--{{ $t('lesson.withdraw') }}-->
</el-button> <!--</el-button>-->
</template> <!--</template>-->
</el-table-column> <!--</el-table-column>-->
</el-table> <!--</el-table>-->
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" />
</el-card> </el-card>
<publish-create ref="publishCreate" @refresh="refresh" /> <publish-create ref="publishCreate" @refresh="refresh" />
<publish-lesson ref="publishLesson" @refresh="refresh" /> <publish-lesson ref="publishLesson" @refresh="refresh" />
@ -98,11 +99,13 @@
<script> <script>
import { releaseOrCancel } from '@/api/designPlatform'; import { releaseOrCancel } from '@/api/designPlatform';
import { getLessonDrftList } from '@/api/jmap/lessondraft';
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, getLessonTree } from '@/api/jmap/lessondraft'; import { delLesson, getLessonTree } from '@/api/jmap/lessondraft';
import LessonDetail from '@/views/approval/lesson/detail'; import LessonDetail from '@/views/approval/lesson/detail';
import ConstConfig from '@/scripts/ConstConfig';
export default { export default {
name: 'LessonHome', name: 'LessonHome',
@ -115,7 +118,98 @@ export default {
return { return {
tableData: [], tableData: [],
loading: false, loading: false,
showEdit: false showEdit: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
show: false
},
queryList: {
query: getLessonDrftList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '课程名称',
prop: 'name'
},
{
title: '课程说明',
prop: 'remarks'
},
{
title: '状态',
prop: 'status',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.status, ConstConfig.ConstSelect.releaseReview, ['value', 'label']);
},
tagType: (row) => { return 'success'; }
},
{
title: '驳回说明',
prop: 'explanation'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '400',
buttons: [
{
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('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';
}
},
{
name: '课程详情',
handleClick: this.goDetail,
type: 'primary'
}
]
}
],
actions: [
/* { text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }*/
]
}
}; };
}, },
computed: { computed: {
@ -133,8 +227,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.loading = true;
this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
@ -185,8 +277,7 @@ export default {
return lessonStatus; return lessonStatus;
}, },
refresh() { refresh() {
this.loading = true; this.$refs.queryListPage.refresh(true);
this.loadInitData();
}, },
editLesson(row) { editLesson(row) {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} ); this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} );
@ -199,28 +290,28 @@ export default {
this.$refs.publishCreate.doShow(); this.$refs.publishCreate.doShow();
}); });
}, },
publish(row) { publish(index, row) {
row.skinCode = this.$route.params.skinCode; row.skinCode = this.$route.params.skinCode;
row.cityCode = this.$route.query.cityCode; row.cityCode = this.$route.query.cityCode;
this.$refs.publishLesson.doShow(row); this.$refs.publishLesson.doShow(row);
}, },
deleteLesson(row) { deleteLesson(index, row) {
delLesson(row).then(response => { delLesson(row).then(response => {
this.$message.success(this.$t('tip.successfullyDelete')); this.$message.success(this.$t('tip.successfullyDelete'));
this.loading = true; this.loading = true;
this.loadInitData(); this.refresh();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.failDelete')); this.$messageBox(this.$t('tip.failDelete'));
}); });
}, },
createChapter(row) { createChapter(index, row) {
if (row.type === 'Lesson') { if (row.type === 'Lesson') {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}}); this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
} else if (row.type === 'Chapter') { } else if (row.type === 'Chapter') {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} ); this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
} }
}, },
treeSort(row) { treeSort(index, row) {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row}); this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
}, },
taskManage() { taskManage() {
@ -232,7 +323,7 @@ export default {
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) { revertLesson(index, row) {
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), { this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
@ -241,16 +332,16 @@ export default {
releaseOrCancel(row.id, '0').then(response => { releaseOrCancel(row.id, '0').then(response => {
this.loading = false; this.loading = false;
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease')); this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
this.refuse(); this.refresh();
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed')); this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
this.refuse(); this.refresh();
}); });
}); });
}, },
goDetail(row) { goDetail(index, row) {
this.$refs.lessonDetail.show(row.id); // this.$refs.lessonDetail.show(row.id);
} }
} }
}; };

View File

@ -0,0 +1,308 @@
<template>
<el-dialog v-dialogDrag :title="operation.title" :visible.sync="dialogShow" width="30%" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="120px" :rules="rules" size="mini">
<el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" />
</el-form-item>
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
<el-option
v-for="option in productTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.trainingType')+':'" prop="type">
<el-select v-model="operateModel.type" placeholder="" :disabled="true">
<el-option
v-for="option in trainTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.operationType')+':'">
<el-select v-model="operateModel.operateType">
<el-option
v-for="(option, index) in operationList"
:key="index"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.minTime')" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item :label="this.$t('lesson.maxTime')" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item :label="this.$t('lesson.trainingDescription')" prop="remarks">
<el-input
v-model="operateModel.remarks"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
:placeholder="this.$t('rules.pleaseEnterContent')"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleDeal">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { addTraining, updateTraining, getTrainingDetail } from '@/api/jmap/training';
import localStore from 'storejs';
export default {
name: 'TreeDraft',
props: {
node: {
type: Object,
required: true
}
},
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
callback();
}
}, 100);
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error(this.$t('rules.greaterThanMinTime')));
} else {
callback();
}
}
}, 100);
};
return {
dialogShow: false,
productTypesList: [],
trainTypesList: [],
operationList: [],
trainingOperateTypeMap: {},
operation: {
title: '',
event: ''
},
operateModel: {
id: '',
name: '',
type: '',
prdCode: '',
skinCode: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
},
rules: {
name: [
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'change' }
],
minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' }
],
maxDuration: [
{ required: true, validator: maxDurations, trigger: 'blur' }
],
remarks: [
{ required: true, message: this.$t('rules.inputTrainingRemark'), trigger: 'change' }
]
}
};
},
computed: {
},
watch: {
node: function (val, old) {
this.initLoadData();
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.operationList = [];
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
},
methods: {
initLoadData() {
const node = this.node;
if (this.$refs && this.$refs.form) {
this.$refs['form'].resetFields();
}
if (node && node.data) {
switch (node.data.type) {
case 'trainingType':
if (node.parent) {
this.operateModel.type = node.data.id;
this.operateModel.prdCode = node.parent.data.id;
this.operateModel.skinCode = node.parent.parent.data.id;
this.productTypesList = [{
code: node.parent.data.id,
name: node.parent.data.name
}];
}
this.operateModel.id = '';
this.operateModel.name = '';
this.operateModel.minDuration = '';
this.operateModel.maxDuration = '';
this.operateModel.remarks = '';
this.operateModel.operateType = '';
this.operationList = this.trainingOperateTypeMap[node.data.id] || [];
break;
case 'training':
if (node.parent && node.parent.parent) {
this.operateModel.type = node.parent.data.id;
this.operateModel.prdCode = node.parent.parent.data.id;
this.operateModel.skinCode = node.parent.parent.parent.data.id;
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
this.productTypesList = [{
code: node.parent.parent.data.id,
name: node.parent.parent.data.name
}];
}
this.operateModel.id = node.data.id;
this.operateModel.name = node.data.name;
getTrainingDetail(node.data.id).then(response => {
this.operateModel.minDuration = response.data.minDuration;
this.operateModel.maxDuration = response.data.maxDuration;
this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks;
}).catch(() => {
this.$messageBox(this.$t('error.obtainStepDataFailed'));
});
break;
}
}
},
show(data) {
this.operation = data;
this.initLoadData();
this.dialogShow = true;
},
close() {
this.dialogShow = false;
},
handleDeal() {
const operation = this.operation;
if (operation) {
const event = operation.event;
switch (event) {
case '01': this.addTraining(); break;
case '02': this.edtTraining(); break;
}
}
},
handleClose() {
this.dialogShow = false;
this.operateModel = {
id: '',
name: '',
type: '',
prdCode: '',
skinCode: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
};
this.$refs['form'].resetFields();
},
addTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success(this.$t('tip.addTrainingSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.addTrainingFailed'));
});
}
});
},
edtTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
id: this.operateModel.id,
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success(this.$t('tip.updateTrainingSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateTrainingFailed'));
});
}
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<!--<training-draft ref="draft" :node="node" @refresh="refresh" />--> <training-draft ref="draft" :node="node" @refresh="refresh" />
</div> </div>
</template> </template>
@ -9,13 +9,13 @@
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
// import TrainingDraft from '../../draft'; import TrainingDraft from './draft';
export default { export default {
name: 'TrainingOperateMenu', name: 'TrainingOperateMenu',
components: { components: {
PopMenu, PopMenu,
// TrainingDraft TrainingDraft
}, },
props: { props: {
point: { point: {
@ -54,10 +54,10 @@ export default {
node: function (val, old) { node: function (val, old) {
if (val && val.data) { if (val && val.data) {
switch (val.data.type) { switch (val.data.type) {
case 'trainingType': case 'TrainingType':
this.menu = this.menuCreate; this.menu = this.menuCreate;
break; break;
case 'training': case 'Training':
this.menu = this.menuEdit; this.menu = this.menuEdit;
break; break;
} }
@ -84,6 +84,7 @@ export default {
doShow(point) { doShow(point) {
this.closeEvent(); this.closeEvent();
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
console.log('22222222333')
this.$refs.popMenu.resetShowPosition(point); this.$refs.popMenu.resetShowPosition(point);
} }
this.menuShow = true; this.menuShow = true;

View File

@ -91,6 +91,7 @@ export default {
} }
}, },
showContextMenu(e, obj, node, vueElem) { showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') { if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault(); e.preventDefault();
this.point = { this.point = {

View File

@ -76,7 +76,7 @@
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam'; import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
export default { export default {
@ -268,7 +268,7 @@ export default {
}, },
refresh() { refresh() {
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonList().then(response => {
this.options = response.data; this.options = response.data;
if (parseInt(this.$route.params.lessonId)) { if (parseInt(this.$route.params.lessonId)) {
this.form.region = this.$route.params.lessonId; this.form.region = this.$route.params.lessonId;

View File

@ -32,7 +32,7 @@
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonList } from '@/api/jmap/lesson';
import RuleFrom from './rule'; import RuleFrom from './rule';
import ExamFrom from './examFrom'; import ExamFrom from './examFrom';
@ -72,7 +72,7 @@ export default {
}, },
methods: { methods: {
loadInitData() { loadInitData() {
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonList().then(response => {
this.OrganizationList = response.data; this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => { this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.params.lessonId) { if (elem.id == this.$route.params.lessonId) {

View File

@ -19,7 +19,7 @@
<script> <script>
import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam'; import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam';
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonList } from '@/api/jmap/lesson';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
@ -197,7 +197,7 @@ export default {
methods: { methods: {
loadInitData() { loadInitData() {
this.queryForm.queryObject.lessonId.config.data.length = 0; this.queryForm.queryObject.lessonId.config.data.length = 0;
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonList().then(response => {
this.OrganizationList = response.data; this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => { this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.query.lessonId) { if (elem.id == this.$route.query.lessonId) {

View File

@ -48,13 +48,13 @@
rules() { rules() {
let crules = { let crules = {
name: [ name: [
{ required: true, message: '请输入剧本', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
], ],
mapId: [ mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }, { required: true, message: this.$t('scriptRecord.selectMap'), trigger: 'change' },
], ],
description:[ description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
] ]
} }
return crules return crules

View File

@ -244,12 +244,21 @@ export default {
covertData(row){ covertData(row){
let releaseReview=ConstConfig.ConstSelect.releaseReview; let releaseReview=ConstConfig.ConstSelect.releaseReview;
let lastData=Object.assign({}, row); let lastData=Object.assign({}, row);
if(Cookies.get("user_lang")=="en"){
releaseReview.forEach(function(element){
let rolename=element.value;
if(lastData.status==rolename){
lastData.status=element.enlabel;
}
});
}else{
releaseReview.forEach(function(element){ releaseReview.forEach(function(element){
let rolename=element.value; let rolename=element.value;
if(lastData.status==rolename){ if(lastData.status==rolename){
lastData.status=element.label; lastData.status=element.label;
} }
}); });
}
return lastData.status; return lastData.status;
// let explanation=lastData.explanation?'{ '+lastData.explanation+'}':''; // let explanation=lastData.explanation?'{ '+lastData.explanation+'}':'';
// return lastData.status+explanation; // return lastData.status+explanation;

View File

@ -20,6 +20,7 @@
return { return {
dialogVisible: false, dialogVisible: false,
mapList: [], mapList: [],
disabled:null,
productList:[], productList:[],
mapInfoList:[], mapInfoList:[],
projectList:[], projectList:[],
@ -28,7 +29,8 @@
mapId:'', mapId:'',
name: "", name: "",
prdCode: "", prdCode: "",
type: "" type: "",
id:null,
} }
} }
}, },
@ -37,10 +39,13 @@
}, },
props: { props: {
title: String, title: String,
operateType:String
}, },
computed: { computed: {
form() { form() {
let form={ let form={};
if(this.operateType=="add"){
form={
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList}, { prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList},
@ -50,11 +55,21 @@
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true,options: this.typeList}, { prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true,options: this.typeList},
] ]
} }
}
else{
form={
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
]
}
}
return form return form
}, },
rules() { rules() {
let crules ={ let crules ={};
customized:[ if(this.operateType=="add"){
crules ={customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'}, { required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
], ],
mapId:[ mapId:[
@ -71,6 +86,14 @@
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'}, { required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'},
] ]
} }
}else{
crules ={
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
};
}
return crules return crules
}, },
}, },
@ -103,7 +126,11 @@
this.formModel.prdCode=""; this.formModel.prdCode="";
}); });
}, },
doShow() { doShow(data) {
if(data){
this.formModel.name=data.name;
this.formModel.id=data.id;
}
this.dialogVisible = true this.dialogVisible = true
}, },
doCreate() { doCreate() {

View File

@ -20,7 +20,7 @@
formModel:{ formModel:{
mapId:'', mapId:'',
}, },
title: '一键生成', title: this.$t('systemGenerate.generation')
} }
}, },
mounted() { mounted() {

View File

@ -5,8 +5,8 @@
</div> --> </div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<once-generate ref="generate" @create="generateMapSystem"></once-generate> <once-generate ref="generate" @create="generateMapSystem"></once-generate>
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate"></createMapSystem> <createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate" operateType="add"></createMapSystem>
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify"></createMapSystem> <createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify" operateType="modify"></createMapSystem>
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }"> <!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图"> <el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option <el-option
@ -25,7 +25,7 @@
<script> <script>
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem,getMapSystemPageList,createMapSubSystem } from '@/api/trainingPlatform'; import { generateMapSystem,getMapSystemPageList,createMapSubSystem,getSubSystemInfo,updateSubSystem} from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import OnceGenerate from './generate'; import OnceGenerate from './generate';
import createMapSystem from './create'; import createMapSystem from './create';
@ -133,10 +133,14 @@
}, },
methods: { methods: {
updateData(index,row){ updateData(index,row){
getSubSystemInfo(row.id).then(response => {
this.$refs.modifyMapSystem.doShow(response.data);
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
});
}, },
handleCreate(data){ handleCreate(data){
debugger; delete data.id;
createMapSubSystem(data).then(response => { createMapSubSystem(data).then(response => {
this.$message.success(this.$t('systemGenerate.createMapSystemSuccess')); this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));
this.reloadTable(); this.reloadTable();
@ -144,8 +148,14 @@
this.$messageBox(this.$t('systemGenerate.createMapSystemFail')); this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));
}); });
}, },
handleModify(){ handleModify(data){
let datainfo={'name':data.name};
updateSubSystem(data.id,datainfo).then(response => {
this.$message.success(this.$t('systemGenerate.updateMapSystemSuccess'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.updateMapSystemFail'));
});
}, },
handleAdd(){ handleAdd(){
this.$refs.createMapSystem.doShow(); this.$refs.createMapSystem.doShow();

View File

@ -4,11 +4,6 @@
<b>{{ $t('teach.courseName') }}: {{ courseModel.name }}</b> <b>{{ $t('teach.courseName') }}: {{ courseModel.name }}</b>
</div> </div>
<div style="margin:50px" :style="{ height: height - 190 +'px' }"> <div style="margin:50px" :style="{ height: height - 190 +'px' }">
<p style="font-size: 14px; margin-bottom: 20px"> {{ $t('teach.courseDescription') }}:
<span style="color: #808080 !important;">
{{ courseModel.remarks }}
</span>
</p>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane :label="$t('teach.courseDetails')" name="first"> <el-tab-pane :label="$t('teach.courseDetails')" name="first">
<div :style="{ height: height - 270 +'px' }"> <div :style="{ height: height - 270 +'px' }">
@ -22,18 +17,15 @@
highlight-current highlight-current
:default-expanded-keys="expandList" :default-expanded-keys="expandList"
:span="22" :span="22"
@node-click="clickEvent"
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
> >
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node }">
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}">&nbsp;{{ node.label }}</span> <span v-if="node.data.type === 'Training'" class="el-icon-goods" />
<span v-else class="el-icon-sold-out">&nbsp;{{ node.label }}</span> <span v-if="node.data.valid" :style="{color: 'green'}">&nbsp;{{ node.label }}</span>
<span> <span v-else>&nbsp;{{ node.label }}</span>
<el-button v-if="node.data.type ==='Training'&&node.data.valid" type="text" size="mini" @click="startTraining(data)">开始实训</el-button>
<el-button v-if="node.data.type ==='Lesson'&& !node.data.valid" type="text" size="mini" @click="buy(node)">购买</el-button>
</span> </span>
</span>
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>
</div> </div>
@ -56,11 +48,13 @@
</template> </template>
<script> <script>
import { getSubSystemDetail } from '@/api/trainingPlatform'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import { PermissionType } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import LimitList from '@/views/components/limits/index'; import LimitList from '@/views/components/limits/index';
import { getSessionStorage, setSessionStorage } from '@/utils/auth'; import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import { trainingNotify } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
export default { export default {
name: 'LessonDetail', name: 'LessonDetail',
@ -76,10 +70,6 @@ export default {
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
skinCode: '',
price: 0,
remarks: '',
detail: [],
pmsList: [] pmsList: []
}, },
activeName: 'first', activeName: 'first',
@ -111,20 +101,15 @@ export default {
}, },
methods: { methods: {
initLoadPage() { initLoadPage() {
if (this.$route.params.subSystem) { getPublishLessonTree(this.$route.query.lessonId).then(response => {
getSubSystemDetail(this.$route.params.subSystem).then(response => { if (response.data.tree && response.data.tree.length>0) {
if (response.data.lesson) {
this.courseModel = { this.courseModel = {
id: response.data.lesson.id, id: response.data.tree[0].id,
name: response.data.lesson.name, name: response.data.tree[0].name,
price: response.data.lesson.price, pmsList: response.data.permissionList || [],
remarks: response.data.lesson.remarks,
detail: response.data.lesson.chapters,
pmsList: response.data.lesson.pmsList || [],
prdCode: response.data.lesson.prdCode,
mapId: response.data.lesson.mapId,
skinCode: response.data.lesson.skinCode,
treeList: response.data.tree, treeList: response.data.tree,
prdCode: this.$route.query.prdCode,
mapId: this.$route.query.mapId,
PermissionType: PermissionType.LESSON PermissionType: PermissionType.LESSON
}; };
} }
@ -132,7 +117,6 @@ export default {
}).catch(error => { }).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message); this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
}); });
}
}, },
transfer() { transfer() {
this.loading = false; this.loading = false;
@ -148,10 +132,20 @@ export default {
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
}, },
/* clickEvent(obj, node, ele) { clickEvent(obj, node, ele) {
if (obj && obj.type==='Training') { if (obj && obj.type==='Training') {
if (obj.valid) { if (obj.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.id}/${this.courseModel.id}`}); this.loading = true;
trainingNotify({ trainingId: obj.id }).then(resp => {
const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
});
} else { } else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
@ -161,7 +155,7 @@ export default {
}).catch(() => { }); }).catch(() => { });
} }
} }
},*/ },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.name.indexOf(value) !== -1; return data.name.indexOf(value) !== -1;
@ -169,7 +163,7 @@ export default {
buy() { buy() {
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query: path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem } { permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {

74
src/views/teach/index.vue Normal file
View File

@ -0,0 +1,74 @@
<template>
<div style="height: 100%; padding-bottom: 20px;">
<el-card>
<div slot="header" style="text-align: center;">
<b>教学系统</b>
</div>
</el-card>
<el-card v-loading="loading">
<el-table
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="name"
label="课程"
/>
<el-table-column
prop="remarks"
show-overflow-tooltip
label="说明"
/>
<el-table-column
label="操作"
>
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
进入课程
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getSubSystemDetail } from '@/api/trainingPlatform';
import { UrlConfig } from '@/router/index';
export default {
name: 'TeachHome',
data() {
return {
tableData: [],
loading: false
};
},
watch: {
$route(newVal) {
this.loadInitPage();
}
},
mounted() {
this.loadInitPage();
},
methods: {
loadInitPage() {
if (this.$route.params.subSystem) {
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
if (resp.data) {
this.tableData = resp.data.lessonList;
}
}).catch(()=>{
this.$messageBox('获取课程信息失败!');
});
}
},
goLesson(row) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}});
}
}
};
</script>

View File

@ -117,11 +117,13 @@ export default {
switch (resp.data.type) { switch (resp.data.type) {
case 'Exam': case 'Exam':
this.setLocalRoute(`${UrlConfig.trainingPlatform.course}/${obj.id}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.course}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${obj.id}`}); // this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${obj.id}`});
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
break; break;
case 'Lesson': case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`}); // this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
break; break;
case 'Simulation': case 'Simulation':
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);