代码调整

This commit is contained in:
fan 2019-10-22 13:40:42 +08:00
parent 81edd3c5c2
commit 515a9a60ae
22 changed files with 853 additions and 282 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

@ -454,9 +454,9 @@ export default {
return this.choose; return this.choose;
}, },
refresh(flag) { refresh(flag) {
if (flag){ if (flag) {
this.commitQuery(); this.commitQuery();
} }
this.queryList.data = [...this.queryList.data]; this.queryList.data = [...this.queryList.data];
} }
} }

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.id,
id: resp.data.lesson.id, name: resp.data.name,
name: resp.data.lesson.name, pmsList: resp.data.permissionList || [],
pmsList: resp.data.permissionList || [], prdCode: resp.data.prdCode,
prdCode: resp.data.lesson.prdCode, mapId: resp.data.mapId,
mapId: resp.data.lesson.mapId, PermissionType: PermissionType.EXAM,
PermissionType: PermissionType.EXAM, treeList: resp.data.examDefinitionList
treeList: resp.data.tree };
}; }
} if (this.courseModel.pmsList && this.courseModel.pmsList.length >0) {
this.getExpandList(this.courseModel.id); this.valid = true;
}).catch((error)=>{ }
this.$messageBox('获取考试信息失败!'+error); this.getExpandList(this.courseModel.id);
}); }).catch(()=>{
} this.$messageBox('获取考试信息失败!');
});
}, },
buy() { buy() {
this.loading = true; this.loading = true;
@ -162,19 +163,16 @@ 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'), { confirmButtonText: this.$t('tip.confirm'),
confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel')
cancelButtonText: this.$t('tip.cancel') }).then(() => {
}).then(() => { 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

@ -22,7 +22,7 @@
style="float: left; width: calc(100% - 80px);" style="float: left; width: calc(100% - 80px);"
:disabled="isEdit" :disabled="isEdit"
/> />
<span style="width:80px; display: block;float: left; text-align: center;">&nbsp;{{$t('publish.durationMinutes')}}</span> <span style="width:80px; display: block;float: left; text-align: center;">&nbsp;{{ $t('publish.durationMinutes') }}</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('publish.testDate')"> <el-form-item :label="$t('publish.testDate')">
<el-col :span="11"> <el-col :span="11">
@ -59,8 +59,8 @@
</el-form-item> </el-form-item>
<el-form-item v-if="trialShow" :label="$t('publish.whetherToTry')" required> <el-form-item v-if="trialShow" :label="$t('publish.whetherToTry')" required>
<el-radio-group v-model="trial"> <el-radio-group v-model="trial">
<el-radio label="1">{{$t('publish.trialNo')}}</el-radio> <el-radio label="1">{{ $t('publish.trialNo') }}</el-radio>
<el-radio label="2">{{$t('publish.trialYes')}}</el-radio> <el-radio label="2">{{ $t('publish.trialYes') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('publish.testDescription')" prop="desc"> <el-form-item :label="$t('publish.testDescription')" prop="desc">
@ -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 {
@ -177,7 +177,7 @@ export default {
], ],
actions: [ actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleNormalAdd }, { text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleNormalAdd },
{ text: this.$t('global.back'), btnCode: 'employee_back', handler: this.handlerBack } { text: this.$t('global.back'), btnCode: 'employee_back', handler: this.handlerBack }
] ]
} }
}; };
@ -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) {
@ -317,9 +317,9 @@ export default {
}); });
}).catch(() => { }); }).catch(() => { });
}, },
handlerBack() { handlerBack() {
this.$router.back(); this.$router.back();
} }
} }
}; };
</script> </script>

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,28 +101,22 @@ 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.tree[0].id,
id: response.data.lesson.id, name: response.data.tree[0].name,
name: response.data.lesson.name, pmsList: response.data.permissionList || [],
price: response.data.lesson.price, treeList: response.data.tree,
remarks: response.data.lesson.remarks, prdCode: this.$route.query.prdCode,
detail: response.data.lesson.chapters, mapId: this.$route.query.mapId,
pmsList: response.data.lesson.pmsList || [], PermissionType: PermissionType.LESSON
prdCode: response.data.lesson.prdCode, };
mapId: response.data.lesson.mapId, }
skinCode: response.data.lesson.skinCode, this.getExpandList(this.courseModel.id);
treeList: response.data.tree, }).catch(error => {
PermissionType: PermissionType.LESSON this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
}; });
}
this.getExpandList(this.courseModel.id);
}).catch(error => {
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}`);

View File

@ -1,72 +1,72 @@
<template> <template>
<div class="app-wrapper"> <div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}"> <div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" /> <demon-list ref="demonList" :height="height" />
</div> </div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" /> <drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition> <transition>
<router-view :style="{ position:'relative', left:widthLeft+'px', width: (width - widthLeft)+'px'}" :product-list="productList" /> <router-view :style="{ position:'relative', left:widthLeft+'px', width: (width - widthLeft)+'px'}" :product-list="productList" />
</transition> </transition>
</el-scrollbar> </el-scrollbar>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import demonList from './demonList'; import demonList from './demonList';
import drapLeft from '@/views/components/drapLeft/index'; import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs'; import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth'; import { getSessionStorage, setSessionStorage } from '@/utils/auth';
export default { export default {
name: 'TrainingPlatform', name: 'TrainingPlatform',
components: { components: {
demonList, demonList,
drapLeft drapLeft
}, },
data() { data() {
return { return {
listShow: true, listShow: true,
widthLeft: 450, widthLeft: 450,
productList: [] productList: []
}; };
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'lessonbar' 'lessonbar'
]), ]),
height() { height() {
return this.$store.state.app.height - 50; return this.$store.state.app.height - 50;
}, },
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
} }
}, },
watch: { watch: {
'lessonbar.opened': function (val) { 'lessonbar.opened': function (val) {
this.listShow = val; this.listShow = val;
} }
}, },
mounted() { mounted() {
const againEnter = getSessionStorage('againEnter') || null; const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter){ if (!againEnter) {
launchFullscreen(); launchFullscreen();
setSessionStorage('againEnter',true); setSessionStorage('againEnter', true);
} }
this.widthLeft = Number(localStore.get('LeftWidth'))?Number(localStore.get('LeftWidth')):450; this.widthLeft = Number(localStore.get('LeftWidth'))?Number(localStore.get('LeftWidth')):450;
}, },
methods: { methods: {
refresh() { refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh(); this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
}, },
drapWidth(width) { drapWidth(width) {
this.widthLeft = Number(width); this.widthLeft = Number(width);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";