Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
ac0fafebc0
@ -82,13 +82,13 @@ export function rejectedLessonRelease(data, id) {
|
||||
});
|
||||
}
|
||||
|
||||
// /** 普通用户申请课程发布和撤销申请 */
|
||||
// export function releaseOrCancel(id, status) {
|
||||
// return request({
|
||||
// url: `/api/review/lesson/releaseOrCancel/${id}/${status}`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
/** 普通用户申请课程发布和撤销申请 */
|
||||
export function releaseOrCancel(id, status) {
|
||||
return request({
|
||||
url: `/api/review/lesson/releaseOrCancel/${id}/${status}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员获取需审核的剧本列表 ok */
|
||||
export function reviewScriptList(params) {
|
||||
|
@ -8,11 +8,10 @@ export function getPublishLessonList() {
|
||||
});
|
||||
}
|
||||
/** 获取发布列表树*/
|
||||
export function getPublishLessonTree(params) {
|
||||
export function getPublishLessonTree(id) {
|
||||
return request({
|
||||
url: '/api/lesson/tree',
|
||||
method: 'get',
|
||||
params: params || {}
|
||||
url: `/api/lesson/${id}/tree`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -102,3 +102,11 @@ export function getLessonNameByMapIdAndLessonId(model) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function getLessonDrftList(params) {
|
||||
return request({
|
||||
url: `/api/lessonDraft`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
@ -1,14 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取考试列表树*/
|
||||
export function getCourseLessonTree(params) {
|
||||
return request({
|
||||
url: '/api/exam/tree',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建对应课程考题 */
|
||||
export function setCourseList(data) {
|
||||
return request({
|
||||
|
@ -67,3 +67,12 @@ export function createMapSubSystem(data) {
|
||||
});
|
||||
}
|
||||
|
||||
export function updateSubSystem(id, data) {
|
||||
/** 查询子系统信息 */
|
||||
return request({
|
||||
url: `/api/mapSystem/${id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ export default {
|
||||
return this.choose;
|
||||
},
|
||||
refresh(flag) {
|
||||
if (flag){
|
||||
if (flag) {
|
||||
this.commitQuery();
|
||||
}
|
||||
this.queryList.data = [...this.queryList.data];
|
||||
|
@ -100,5 +100,8 @@ export default {
|
||||
publishScriptSuccess: 'Publish Script Success',
|
||||
publishScriptFailed: 'Publish Script Failed',
|
||||
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'
|
||||
};
|
||||
|
@ -18,5 +18,9 @@ export default {
|
||||
customized: 'Project',
|
||||
selectProject: 'Please select project',
|
||||
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'
|
||||
};
|
||||
|
@ -101,5 +101,8 @@ export default {
|
||||
publishScriptSuccess: '发布成功',
|
||||
publishScriptFailed: '发布失败',
|
||||
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?'
|
||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
|
||||
inputScriptName: '请输入剧本',
|
||||
selectMap: '请选择地图',
|
||||
inputScriptDescription: '请输入剧本描述'
|
||||
};
|
||||
|
@ -18,6 +18,10 @@ export default {
|
||||
customized: '项目',
|
||||
selectProject: '请选择项目',
|
||||
createMapSystemSuccess: '创建地图系统成功',
|
||||
createMapSystemFail: '创建地图系统失败'
|
||||
createMapSystemFail: '创建地图系统失败',
|
||||
getSubSystemInfoFail: '获取子系统信息失败',
|
||||
updateMapSystemSuccess: '更新地图系统成功',
|
||||
updateMapSystemFail: '更新地图系统失败',
|
||||
generation: '一键生成'
|
||||
|
||||
};
|
||||
|
@ -43,8 +43,10 @@ import ScriptDisplay from '@/views/scriptManage/display/index';
|
||||
|
||||
import TeachDetail from '@/views/teach/detail/index';
|
||||
import TeachPractical from '@/views/teach/practical/index';
|
||||
import TeachHome from '@/views/teach/index';
|
||||
import Pay from '@/views/components/pay/index';
|
||||
import ExamDetail from '@/views/exam/detail/examDetail';
|
||||
import ExamHome from '@/views/exam/index';
|
||||
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
|
||||
import ExamResult from '@/views/exam/result';
|
||||
|
||||
@ -251,7 +253,9 @@ export const UrlConfig = {
|
||||
trainingPlatformHome: '/trainingPlatform/home',
|
||||
prodDetail: '/trainingPlatform/detail',
|
||||
teachDetail: '/trainingPlatform/teach',
|
||||
teachHome: '/trainingPlatform/teachHome',
|
||||
examDetail: '/trainingPlatform/exam',
|
||||
examHome: '/trainingPlatform/examHome',
|
||||
examRuleManage: '/trainingPlatform/examRule/manage',
|
||||
examRuleDraft: '/trainingPlatform/examRule/Draft',
|
||||
course: '/trainingPlatform/course',
|
||||
@ -610,11 +614,21 @@ export const asyncRouter = [
|
||||
component: DemonstrationDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'teachHome/:subSystem',
|
||||
component: TeachHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'teach/:subSystem',
|
||||
component: TeachDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'examHome/:subSystem',
|
||||
component: ExamHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'exam/:examId',
|
||||
component: ExamDetail,
|
||||
|
@ -127,7 +127,7 @@ export default {
|
||||
this.active = 0;
|
||||
const type = this.$route.query.permissionType;
|
||||
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) {
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
|
||||
} else if (type === PermissionType.SCREEN) {
|
||||
|
@ -21,10 +21,10 @@
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span v-if="node.data.valid" class="el-icon-goods" />
|
||||
<span slot-scope="{ node }">
|
||||
<span v-if="valid||node.data.trial" class="el-icon-goods" />
|
||||
<span v-else class="el-icon-sold-out" />
|
||||
<span :style="{color: node.data.valid?'green':'black'}"> {{ node.label }}</span>
|
||||
<span :style="{color: node.data.trial||valid ?'green':'black'}"> {{ node.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
@ -51,12 +51,11 @@
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
// import { getCourseLessonDetail } from '@/api/management/exam';
|
||||
import { getCourseLessonDetail } from '@/api/management/exam';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||
|
||||
export default {
|
||||
name: 'ExamDetailView',
|
||||
@ -81,7 +80,8 @@ export default {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
expandList: []
|
||||
expandList: [],
|
||||
valid: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -110,28 +110,29 @@ export default {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.EffectiveTypeList = list;
|
||||
});
|
||||
this.loadInitPage(this.$route.query.prodId, this.$route.query.type);
|
||||
this.loadInitPage();
|
||||
},
|
||||
methods: {
|
||||
loadInitPage() {
|
||||
if (this.$route.params.subSystem) {
|
||||
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
|
||||
if (resp.data.lesson) {
|
||||
getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{
|
||||
if (resp.data) {
|
||||
this.courseModel = {
|
||||
id: resp.data.lesson.id,
|
||||
name: resp.data.lesson.name,
|
||||
id: resp.data.id,
|
||||
name: resp.data.name,
|
||||
pmsList: resp.data.permissionList || [],
|
||||
prdCode: resp.data.lesson.prdCode,
|
||||
mapId: resp.data.lesson.mapId,
|
||||
prdCode: resp.data.prdCode,
|
||||
mapId: resp.data.mapId,
|
||||
PermissionType: PermissionType.EXAM,
|
||||
treeList: resp.data.tree
|
||||
treeList: resp.data.examDefinitionList
|
||||
};
|
||||
}
|
||||
this.getExpandList(this.courseModel.id);
|
||||
}).catch((error)=>{
|
||||
this.$messageBox('获取考试信息失败!'+error);
|
||||
});
|
||||
if (this.courseModel.pmsList && this.courseModel.pmsList.length >0) {
|
||||
this.valid = true;
|
||||
}
|
||||
this.getExpandList(this.courseModel.id);
|
||||
}).catch(()=>{
|
||||
this.$messageBox('获取考试信息失败!');
|
||||
});
|
||||
},
|
||||
buy() {
|
||||
this.loading = true;
|
||||
@ -162,8 +163,7 @@ export default {
|
||||
}
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
if (obj.type === 'Exam') {
|
||||
if (obj.valid) {
|
||||
if (this.valid || obj.trial) {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }});
|
||||
} else {
|
||||
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
||||
@ -173,8 +173,6 @@ export default {
|
||||
this.buy();
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
|
@ -215,7 +215,7 @@ export default {
|
||||
}
|
||||
},
|
||||
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
69
src/views/exam/index.vue
Normal 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>
|
21
src/views/lesson/details.vue
Normal file
21
src/views/lesson/details.vue
Normal 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>
|
@ -10,85 +10,86 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
border
|
||||
:label="this.$t('lesson.lesson')"
|
||||
/>
|
||||
<el-table-column
|
||||
:label="this.$t('global.status')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ handlerStatus(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="explanation"
|
||||
show-overflow-tooltip
|
||||
:label="this.$t('lesson.rejectReason')"
|
||||
/>
|
||||
<el-table-column
|
||||
width="500"
|
||||
:label="this.$t('global.operate')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="createChapter(scope.row)"
|
||||
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status==='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="goDetail(scope.row)"
|
||||
>
|
||||
{{ $t('lesson.review') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
plain
|
||||
@click="treeSort(scope.row)"
|
||||
>{{ $t('lesson.contentSorting') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="editLesson(scope.row)"
|
||||
>{{ $t('lesson.editCourse') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="publish(scope.row)"
|
||||
>{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="deleteLesson(scope.row)"
|
||||
>{{ $t('global.delete') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status ==='1'"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="revertLesson(scope.row)"
|
||||
>
|
||||
{{ $t('lesson.withdraw') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--<el-table-->
|
||||
<!--:data="tableData"-->
|
||||
<!--row-key="id"-->
|
||||
<!--border-->
|
||||
<!--default-expand-all-->
|
||||
<!--:tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
|
||||
<!-->-->
|
||||
<!--<el-table-column-->
|
||||
<!--prop="name"-->
|
||||
<!--border-->
|
||||
<!--:label="this.$t('lesson.lesson')"-->
|
||||
<!--/>-->
|
||||
<!--<el-table-column-->
|
||||
<!--:label="this.$t('global.status')"-->
|
||||
<!-->-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<span>{{ handlerStatus(scope.row) }}</span>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column-->
|
||||
<!--prop="explanation"-->
|
||||
<!--show-overflow-tooltip-->
|
||||
<!--:label="this.$t('lesson.rejectReason')"-->
|
||||
<!--/>-->
|
||||
<!--<el-table-column-->
|
||||
<!--width="500"-->
|
||||
<!--:label="this.$t('global.operate')"-->
|
||||
<!-->-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.status!=='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="primary"-->
|
||||
<!--@click="createChapter(scope.row)"-->
|
||||
<!-->{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.status==='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="primary"-->
|
||||
<!--@click="goDetail(scope.row)"-->
|
||||
<!-->-->
|
||||
<!--{{ $t('lesson.review') }}-->
|
||||
<!--</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="primary"-->
|
||||
<!--plain-->
|
||||
<!--@click="treeSort(scope.row)"-->
|
||||
<!-->{{ $t('lesson.contentSorting') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="info"-->
|
||||
<!--@click="editLesson(scope.row)"-->
|
||||
<!-->{{ $t('lesson.editCourse') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="primary"-->
|
||||
<!--@click="publish(scope.row)"-->
|
||||
<!-->{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="danger"-->
|
||||
<!--@click="deleteLesson(scope.row)"-->
|
||||
<!-->{{ $t('global.delete') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.status ==='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="danger"-->
|
||||
<!--@click="revertLesson(scope.row)"-->
|
||||
<!-->-->
|
||||
<!--{{ $t('lesson.withdraw') }}-->
|
||||
<!--</el-button>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--</el-table>-->
|
||||
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" />
|
||||
</el-card>
|
||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
@ -98,11 +99,13 @@
|
||||
|
||||
<script>
|
||||
import { releaseOrCancel } from '@/api/designPlatform';
|
||||
import { getLessonDrftList } from '@/api/jmap/lessondraft';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import PublishCreate from './lessoncategory/edit/create';
|
||||
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
||||
import { delLesson, getLessonTree } from '@/api/jmap/lessondraft';
|
||||
import LessonDetail from '@/views/approval/lesson/detail';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
export default {
|
||||
name: 'LessonHome',
|
||||
@ -115,7 +118,98 @@ export default {
|
||||
return {
|
||||
tableData: [],
|
||||
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: {
|
||||
@ -133,8 +227,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
@ -185,8 +277,7 @@ export default {
|
||||
return lessonStatus;
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
editLesson(row) {
|
||||
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();
|
||||
});
|
||||
},
|
||||
publish(row) {
|
||||
publish(index, row) {
|
||||
row.skinCode = this.$route.params.skinCode;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(row) {
|
||||
deleteLesson(index, row) {
|
||||
delLesson(row).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
this.refresh();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
createChapter(row) {
|
||||
createChapter(index, row) {
|
||||
if (row.type === 'Lesson') {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
||||
} else if (row.type === 'Chapter') {
|
||||
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});
|
||||
},
|
||||
taskManage() {
|
||||
@ -232,7 +323,7 @@ export default {
|
||||
operationManage() {
|
||||
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'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
@ -241,16 +332,16 @@ export default {
|
||||
releaseOrCancel(row.id, '0').then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
|
||||
this.refuse();
|
||||
this.refresh();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
||||
this.refuse();
|
||||
this.refresh();
|
||||
});
|
||||
});
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
goDetail(index, row) {
|
||||
// this.$refs.lessonDetail.show(row.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
308
src/views/lesson/trainingrecord/category/draft.vue
Normal file
308
src/views/lesson/trainingrecord/category/draft.vue
Normal 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>
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<!--<training-draft ref="draft" :node="node" @refresh="refresh" />-->
|
||||
<training-draft ref="draft" :node="node" @refresh="refresh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
// import TrainingDraft from '../../draft';
|
||||
import TrainingDraft from './draft';
|
||||
|
||||
export default {
|
||||
name: 'TrainingOperateMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
// TrainingDraft
|
||||
TrainingDraft
|
||||
},
|
||||
props: {
|
||||
point: {
|
||||
@ -54,10 +54,10 @@ export default {
|
||||
node: function (val, old) {
|
||||
if (val && val.data) {
|
||||
switch (val.data.type) {
|
||||
case 'trainingType':
|
||||
case 'TrainingType':
|
||||
this.menu = this.menuCreate;
|
||||
break;
|
||||
case 'training':
|
||||
case 'Training':
|
||||
this.menu = this.menuEdit;
|
||||
break;
|
||||
}
|
||||
@ -84,6 +84,7 @@ export default {
|
||||
doShow(point) {
|
||||
this.closeEvent();
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
console.log('22222222333')
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
this.menuShow = true;
|
||||
|
@ -91,6 +91,7 @@ export default {
|
||||
}
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
|
||||
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
|
@ -22,7 +22,7 @@
|
||||
style="float: left; width: calc(100% - 80px);"
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
<span style="width:80px; display: block;float: left; text-align: center;"> {{$t('publish.durationMinutes')}}</span>
|
||||
<span style="width:80px; display: block;float: left; text-align: center;"> {{ $t('publish.durationMinutes') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.testDate')">
|
||||
<el-col :span="11">
|
||||
@ -59,8 +59,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-if="trialShow" :label="$t('publish.whetherToTry')" required>
|
||||
<el-radio-group v-model="trial">
|
||||
<el-radio label="1">{{$t('publish.trialNo')}}</el-radio>
|
||||
<el-radio label="2">{{$t('publish.trialYes')}}</el-radio>
|
||||
<el-radio label="1">{{ $t('publish.trialNo') }}</el-radio>
|
||||
<el-radio label="2">{{ $t('publish.trialYes') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.testDescription')" prop="desc">
|
||||
@ -76,7 +76,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishLessonTree } from '@/api/jmap/lesson';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
|
||||
|
||||
export default {
|
||||
@ -268,7 +268,7 @@ export default {
|
||||
|
||||
},
|
||||
refresh() {
|
||||
getPublishLessonTree({ mapId: '' }).then(response => {
|
||||
getPublishLessonList().then(response => {
|
||||
this.options = response.data;
|
||||
if (parseInt(this.$route.params.lessonId)) {
|
||||
this.form.region = this.$route.params.lessonId;
|
||||
|
@ -32,7 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishLessonTree } from '@/api/jmap/lesson';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import RuleFrom from './rule';
|
||||
import ExamFrom from './examFrom';
|
||||
|
||||
@ -72,7 +72,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
getPublishLessonTree({ mapId: '' }).then(response => {
|
||||
getPublishLessonList().then(response => {
|
||||
this.OrganizationList = response.data;
|
||||
this.OrganizationList.forEach(elem => {
|
||||
if (elem.id == this.$route.params.lessonId) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<script>
|
||||
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';
|
||||
|
||||
export default {
|
||||
@ -197,7 +197,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.queryForm.queryObject.lessonId.config.data.length = 0;
|
||||
getPublishLessonTree({ mapId: '' }).then(response => {
|
||||
getPublishLessonList().then(response => {
|
||||
this.OrganizationList = response.data;
|
||||
this.OrganizationList.forEach(elem => {
|
||||
if (elem.id == this.$route.query.lessonId) {
|
||||
|
@ -48,13 +48,13 @@
|
||||
rules() {
|
||||
let crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入剧本', trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' },
|
||||
{ required: true, message: this.$t('scriptRecord.selectMap'), trigger: 'change' },
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
return crules
|
||||
|
@ -243,13 +243,22 @@ export default {
|
||||
},
|
||||
covertData(row){
|
||||
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){
|
||||
let rolename=element.value;
|
||||
if(lastData.status==rolename){
|
||||
lastData.status=element.label;
|
||||
}
|
||||
});
|
||||
}
|
||||
return lastData.status;
|
||||
// let explanation=lastData.explanation?'{ 说明:'+lastData.explanation+'}':'';
|
||||
// return lastData.status+explanation;
|
||||
|
@ -20,6 +20,7 @@
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapList: [],
|
||||
disabled:null,
|
||||
productList:[],
|
||||
mapInfoList:[],
|
||||
projectList:[],
|
||||
@ -28,7 +29,8 @@
|
||||
mapId:'',
|
||||
name: "",
|
||||
prdCode: "",
|
||||
type: ""
|
||||
type: "",
|
||||
id:null,
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -37,10 +39,13 @@
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
operateType:String
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form={
|
||||
let form={};
|
||||
if(this.operateType=="add"){
|
||||
form={
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ 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},
|
||||
]
|
||||
}
|
||||
}
|
||||
else{
|
||||
form={
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
|
||||
]
|
||||
}
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules ={
|
||||
customized:[
|
||||
let crules ={};
|
||||
if(this.operateType=="add"){
|
||||
crules ={customized:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
|
||||
],
|
||||
mapId:[
|
||||
@ -71,6 +86,14 @@
|
||||
{ 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
|
||||
},
|
||||
},
|
||||
@ -103,7 +126,11 @@
|
||||
this.formModel.prdCode="";
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
doShow(data) {
|
||||
if(data){
|
||||
this.formModel.name=data.name;
|
||||
this.formModel.id=data.id;
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doCreate() {
|
||||
|
@ -20,7 +20,7 @@
|
||||
formModel:{
|
||||
mapId:'',
|
||||
},
|
||||
title: '一键生成',
|
||||
title: this.$t('systemGenerate.generation')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -5,8 +5,8 @@
|
||||
</div> -->
|
||||
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<once-generate ref="generate" @create="generateMapSystem"></once-generate>
|
||||
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate"></createMapSystem>
|
||||
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify"></createMapSystem>
|
||||
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate" operateType="add"></createMapSystem>
|
||||
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify" operateType="modify"></createMapSystem>
|
||||
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
|
||||
<el-select v-model="mapId" clearable placeholder="请选择地图">
|
||||
<el-option
|
||||
@ -25,7 +25,7 @@
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
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 OnceGenerate from './generate';
|
||||
import createMapSystem from './create';
|
||||
@ -133,10 +133,14 @@
|
||||
},
|
||||
methods: {
|
||||
updateData(index,row){
|
||||
|
||||
getSubSystemInfo(row.id).then(response => {
|
||||
this.$refs.modifyMapSystem.doShow(response.data);
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
|
||||
});
|
||||
},
|
||||
handleCreate(data){
|
||||
debugger;
|
||||
delete data.id;
|
||||
createMapSubSystem(data).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));
|
||||
this.reloadTable();
|
||||
@ -144,8 +148,14 @@
|
||||
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(){
|
||||
this.$refs.createMapSystem.doShow();
|
||||
|
@ -4,11 +4,6 @@
|
||||
<b>{{ $t('teach.courseName') }}: {{ courseModel.name }}</b>
|
||||
</div>
|
||||
<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-tab-pane :label="$t('teach.courseDetails')" name="first">
|
||||
<div :style="{ height: height - 270 +'px' }">
|
||||
@ -22,18 +17,15 @@
|
||||
highlight-current
|
||||
:default-expanded-keys="expandList"
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}"> {{ node.label }}</span>
|
||||
<span v-else class="el-icon-sold-out"> {{ node.label }}</span>
|
||||
<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 slot-scope="{ node }">
|
||||
<span v-if="node.data.type === 'Training'" class="el-icon-goods" />
|
||||
<span v-if="node.data.valid" :style="{color: 'green'}"> {{ node.label }}</span>
|
||||
<span v-else> {{ node.label }}</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@ -56,11 +48,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||
import { getPublishLessonTree } from '@/api/jmap/lesson';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
|
||||
export default {
|
||||
name: 'LessonDetail',
|
||||
@ -76,10 +70,6 @@ export default {
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
skinCode: '',
|
||||
price: 0,
|
||||
remarks: '',
|
||||
detail: [],
|
||||
pmsList: []
|
||||
},
|
||||
activeName: 'first',
|
||||
@ -111,20 +101,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
if (this.$route.params.subSystem) {
|
||||
getSubSystemDetail(this.$route.params.subSystem).then(response => {
|
||||
if (response.data.lesson) {
|
||||
getPublishLessonTree(this.$route.query.lessonId).then(response => {
|
||||
if (response.data.tree && response.data.tree.length>0) {
|
||||
this.courseModel = {
|
||||
id: response.data.lesson.id,
|
||||
name: response.data.lesson.name,
|
||||
price: response.data.lesson.price,
|
||||
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,
|
||||
id: response.data.tree[0].id,
|
||||
name: response.data.tree[0].name,
|
||||
pmsList: response.data.permissionList || [],
|
||||
treeList: response.data.tree,
|
||||
prdCode: this.$route.query.prdCode,
|
||||
mapId: this.$route.query.mapId,
|
||||
PermissionType: PermissionType.LESSON
|
||||
};
|
||||
}
|
||||
@ -132,7 +117,6 @@ export default {
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
transfer() {
|
||||
this.loading = false;
|
||||
@ -148,10 +132,20 @@ export default {
|
||||
this.$refs.limitList.distribute(this.courseModel);
|
||||
}
|
||||
},
|
||||
/* clickEvent(obj, node, ele) {
|
||||
clickEvent(obj, node, ele) {
|
||||
if (obj && obj.type==='Training') {
|
||||
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 {
|
||||
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
@ -161,7 +155,7 @@ export default {
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
},*/
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
@ -169,7 +163,7 @@ export default {
|
||||
buy() {
|
||||
this.$router.push({
|
||||
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) {
|
||||
|
74
src/views/teach/index.vue
Normal file
74
src/views/teach/index.vue
Normal 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>
|
@ -117,11 +117,13 @@ export default {
|
||||
switch (resp.data.type) {
|
||||
case 'Exam':
|
||||
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;
|
||||
case 'Lesson':
|
||||
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;
|
||||
case 'Simulation':
|
||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
||||
|
Loading…
Reference in New Issue
Block a user