From e6f62a87d840a4aae0bcc96c97c48e6ee8eec0eb Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 6 Dec 2022 17:28:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=88=97=E8=A1=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/training.js | 16 +- src/scripts/ConstDic.js | 30 ++++ src/views/newMap/display/index.vue | 10 +- .../trainingList/trainingLeftSlider.vue | 146 ++++++++++++++++++ .../display/trainingList/trainingMenu.vue | 139 ++--------------- .../organization/trainingDesign/index.vue | 1 - .../organization/trainingManage/index.vue | 45 ++---- .../publish/publishMap/editSubsystem.vue | 32 +--- 8 files changed, 216 insertions(+), 203 deletions(-) create mode 100644 src/views/newMap/display/trainingList/trainingLeftSlider.vue diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index b22d67ce5..b51e26a54 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -198,18 +198,12 @@ export function getAllPublishTrainingList(params) { params }); } -/** 根据mapId查所有的已发布单操实训的基础信息 */ -export function getPublishSingleList(mapId) { +/** 查询组织已发布实训的基础信息 */ +export function getPublishTrainingListInOrg(params) { return request({ - url: `/api/v2/training/published/${mapId}/singles`, - method: 'get' - }); -} -/** 根据mapId查所有的已发布场景实训的基础信息 */ -export function getPublishScenesList(mapId) { - return request({ - url: `/api/v2/training/published/${mapId}/scenes`, - method: 'get' + url: `/api/v2/training/published/infos`, + method: 'get', + params }); } /** 根据实训id查该已发布实训的所有信息 */ diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index e8ba90746..0ac2dfb63 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -381,3 +381,33 @@ export const SimulationUserType = { TEACHER: 'TEACHER', STUDENT: 'STUDENT' }; +/** 客户端list */ +export const ClientList = [ + { label: '中心ATS工作站', value: 'dispatchWork' }, + { label: '中心ATS大屏', value: 'bigScreen' }, + { label: '现地ATS工作站', value: 'localWork' }, + { label: 'ISCS', value: 'iscsView' }, + { label: 'IBP', value: 'ibp' }, + { label: 'PSL', value: 'psl' }, + { label: '列车驾驶', value: 'drivingPlan' }, + { label: 'CCTV', value: 'cctvView' }, + { label: '设备视图', value: 'jl3dModle' }, + { label: '数字沙盘', value: 'digitalStand' }, + { label: '车务终端', value: 'trafficTerminal' }, + { label: '车务管理终端', value: 'trafficManageTerminal' }, + { label: '调度命令', value: 'dispatchingCommand' }, + { label: '调度计划', value: 'schedulingPlan' }, + { label: '大客流策略', value: 'largePassengerStrategy' }, + { label: '大客流视图', value: 'largePassengerView' }, + { label: '行调台', value: 'dispatcherManage' }, + { label: '派班工作站', value: 'scheduleWork' }, + { label: '应急调度', value: 'emergency' }, + { label: '运行图加载', value: 'diagramLoad' }, + { label: '运行图预览', value: 'diagramPreview' }, + { label: '运行图编制', value: 'diagramEdit' } +]; +/** 实训类型list */ +export const TrainingTypeList = [ + {label: '场景', value: 'SCENE'}, + {label: '单操', value: 'SINGLE'} +]; diff --git a/src/views/newMap/display/index.vue b/src/views/newMap/display/index.vue index 71e665b5c..fe72bd4ed 100644 --- a/src/views/newMap/display/index.vue +++ b/src/views/newMap/display/index.vue @@ -11,6 +11,7 @@ + + + diff --git a/src/views/newMap/display/trainingList/trainingMenu.vue b/src/views/newMap/display/trainingList/trainingMenu.vue index 7e6ce8ed4..38af8c422 100644 --- a/src/views/newMap/display/trainingList/trainingMenu.vue +++ b/src/views/newMap/display/trainingList/trainingMenu.vue @@ -4,8 +4,7 @@
- 实训列表 - 实训菜单 + @@ -17,12 +16,12 @@
-
+

{{ $t('display.training.trainingName') }} - {{ trainingDetail.name }} + {{ trainingDetail ?trainingDetail.name:'' }}

实训模式: @@ -36,7 +35,7 @@

{{ $t('display.training.trainingInstructions') }} - {{ trainingDetail.description }} + {{ trainingDetail ?trainingDetail.description:'' }}

操作按钮: @@ -52,16 +51,6 @@

-
- - - - - - - - -
@@ -74,7 +63,7 @@ import { ScriptMode } from '@/scripts/ConstDic'; import { startTraining, endTraining } from '@/api/jmap/training'; import ScenePlayRole from './scenePlayRole'; import TestResult from './testResult'; -import { getPublishSingleList, getPublishTrainingDetail, loadPublishTraining, getPublishScenesList } from '@/api/jmap/training'; +import { EventBus } from '@/scripts/event-bus'; export default { name: 'TipTrainingDetail', components: { @@ -90,88 +79,11 @@ export default { data() { return { isShrink: true, - showSumbit: false, demoMode: ScriptMode.TEACH, TrainingMode: ScriptMode, activeName: 'first', - showMenu: false, - pagerConfig: { - pageSize: 'pageSize', - pageIndex: 'pageNum' - }, training: {}, - queryForm: { - labelWidth: '100px', - reset: true, - show:false - }, - queryList: { - query: this.queryFunction, - selectCheckShow: false, - paginationHiden: true, - indexShow: true, - height: 200, - columns: [ - { - title: this.$t('trainingManage.name'), - prop: 'name' - }, - { - title: this.$t('trainingManage.description'), - prop: 'description' - }, - { - title: this.$t('trainingManage.labelJson'), - prop: 'labelJson' - }, - { - type: 'button', - title: this.$t('trainingManage.operate'), - buttons: [ - { - name: '加载', - handleClick: this.loadScript, - type: 'primary', - showControl:(row) => { return row.id; } - } - ] - } - ] - }, - queryListScene: { - query: this.queryFunctionScene, - selectCheckShow: false, - paginationHiden: true, - indexShow: true, - height: 200, - columns: [ - { - title: this.$t('trainingManage.name'), - prop: 'name' - }, - { - title: this.$t('trainingManage.description'), - prop: 'description' - }, - { - title: this.$t('trainingManage.labelJson'), - prop: 'labelJson' - }, - { - type: 'button', - title: this.$t('trainingManage.operate'), - buttons: [ - { - name: '加载', - handleClick: this.loadScript, - type: 'primary', - showControl:(row) => { return row.id; } - } - ] - } - ] - }, - playerId: '' + trainingDesign: false }; }, computed: { @@ -192,15 +104,9 @@ export default { } }, mounted() { - this.loadInitData(); + this.trainingDesign = this.$store.state.training.domConfig.trainingDesign; }, methods: { - loadInitData() { - this.showSumbit = false; - }, - changeShow(val) { - this.showMenu = val; - }, shrink() { if (this.isShrink) { this.isShrink = false; @@ -246,35 +152,8 @@ export default { this.$message.error('结束实训失败!'); }); }, - queryFunction() { - return getPublishSingleList(this.mapId); - }, - queryFunctionScene() { - return getPublishScenesList(this.mapId); - }, - async loadScript(index, data) { - if (this.trainingSwitch) { - this.$message.error('请先结束当前实训后再加载新的实训!'); - return; - } - try { - const detailResp = await getPublishTrainingDetail(data.id); - this.training = detailResp.data; - if (detailResp.data.mapLocationJson) { - const mapLocation = JSON.parse(detailResp.data.mapLocationJson); - this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); - } - this.playerId = ''; - if (detailResp.data.playerIdJson) { - this.playerId = JSON.parse(detailResp.data.playerIdJson)[0]; - } - this.showMenu = true; - this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data); - await loadPublishTraining(this.group, data.id, {mode: this.teachMode}); - this.$message.success('加载实训成功!'); - } catch (e) { - this.$message.error('加载实训失败!'); - } + trainingListShow() { + EventBus.$emit('handleSliderShow'); } } }; diff --git a/src/views/organization/trainingDesign/index.vue b/src/views/organization/trainingDesign/index.vue index 98ecdf8dd..9540813a5 100644 --- a/src/views/organization/trainingDesign/index.vue +++ b/src/views/organization/trainingDesign/index.vue @@ -7,7 +7,6 @@ import {queryMapListByUser} from '@/api/jmap/map'; import Cookies from 'js-cookie'; import ConstConfig from '@/scripts/ConstConfig'; -// import { getPublishSingleList, getPublishScenesList } from '@/api/jmap/training'; import { deleteTraining } from '@/api/trainingManage'; import { getTrainingList } from '@/api/trainingManage'; // getPublishTrainingDetail, loadPublishTraining, diff --git a/src/views/organization/trainingManage/index.vue b/src/views/organization/trainingManage/index.vue index d2dfd1b02..81bef6279 100644 --- a/src/views/organization/trainingManage/index.vue +++ b/src/views/organization/trainingManage/index.vue @@ -10,7 +10,7 @@ import { createSimulation } from '@/api/simulation'; import ConstConfig from '@/scripts/ConstConfig'; import { getSessionStorage } from '@/utils/auth'; import { launchFullscreen } from '@/utils/screen'; -import { getPublishSingleList, getPublishScenesList, getAllPublishTrainingList } from '@/api/jmap/training'; +import { getAllPublishTrainingList, getPublishTrainingListInOrg } from '@/api/jmap/training'; export default { name:'TrainingManage', data() { @@ -25,14 +25,12 @@ export default { queryForm: { labelWidth: '100px', reset: false, - initLoadCallback: this.initLoadCallback, queryObject: { mapId: { type: 'select', label: '地图名称', config: { default: '', - noClear:true, data: [] } }, @@ -41,7 +39,6 @@ export default { label: '实训类型', config: { default: '', - noClear:true, data: [ {label: '单操实训', value: 'single'}, {label: '场景实训', value: 'scene'} @@ -64,6 +61,13 @@ export default { title: this.$t('trainingManage.description'), prop: 'description' }, + { + title:'所属地图', + prop: 'mapId', + type: 'tag', + columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); }, + tagType: (row) => { return ''; } + }, { title: this.$t('trainingManage.type'), prop: 'type', @@ -116,38 +120,13 @@ export default { hasTeachingDataManage() { return this.$route.path.includes('/teachingDataManage/'); }, - initLoadCallback(form) { - if (this.hasTeachingDataManage()) { - form.type = ''; - form.mapId = ''; - return; - } - if (!form.type) { - form.type = 'single'; - } - if (!form.mapId) { - form.mapId = this.mapList[0] ? this.mapList[0].value : ''; - } - }, queryFunction(param) { + delete param.pageSize; + delete param.pageNum; if (this.hasTeachingDataManage()) { - const params = { - ...param - }; - delete params.pageSize; - delete params.pageNum; - return getAllPublishTrainingList(params); - } else if (param.mapId) { - if (param.type == 'single') { - return getPublishSingleList(param.mapId); - } else if (param.type == 'scene') { - return getPublishScenesList(param.mapId); - } + return getAllPublishTrainingList(param); } else { - return new Promise((resolve, reject)=>{ - const result = {data:[]}; - resolve(result); - }); + return getPublishTrainingListInOrg(param); } }, getLabelJson(row) { diff --git a/src/views/publish/publishMap/editSubsystem.vue b/src/views/publish/publishMap/editSubsystem.vue index d30a41530..5d852c403 100644 --- a/src/views/publish/publishMap/editSubsystem.vue +++ b/src/views/publish/publishMap/editSubsystem.vue @@ -111,6 +111,7 @@ import { getPassengerFlowData } from '@/api/simulation'; import { queryPaperList } from '@/api/management/exam'; import { getTrainingDetailNew } from '@/api/jmap/training'; import ChooseTraining from './chooseTraining'; +import { ClientList, TrainingTypeList } from '@/scripts/ConstDic'; export default { name: 'EditSubsystem', @@ -118,33 +119,8 @@ export default { ChooseTraining }, data() { - const clientList = [ - { label: '中心ATS工作站', value: 'dispatchWork' }, - { label: '中心ATS大屏', value: 'bigScreen' }, - { label: '现地ATS工作站', value: 'localWork' }, - { label: 'ISCS', value: 'iscsView' }, - { label: 'IBP', value: 'ibp' }, - { label: 'PSL', value: 'psl' }, - { label: '列车驾驶', value: 'drivingPlan' }, - { label: 'CCTV', value: 'cctvView' }, - { label: '设备视图', value: 'jl3dModle' }, - { label: '数字沙盘', value: 'digitalStand' }, - { label: '车务终端', value: 'trafficTerminal' }, - { label: '车务管理终端', value: 'trafficManageTerminal' }, - { label: '调度命令', value: 'dispatchingCommand' }, - { label: '调度计划', value: 'schedulingPlan' }, - { label: '大客流策略', value: 'largePassengerStrategy' }, - { label: '大客流视图', value: 'largePassengerView' }, - { label: '行调台', value: 'dispatcherManage' }, - { label: '派班工作站', value: 'scheduleWork' }, - { label: '应急调度', value: 'emergency' }, - { label: '运行图加载', value: 'diagramLoad' }, - { label: '运行图预览', value: 'diagramPreview' }, - { label: '运行图编制', value: 'diagramEdit' } - ]; return { visible: false, - clientList: clientList, title: '', trainingName: '', mapSystemId: '', @@ -154,8 +130,9 @@ export default { frontTableData: [ { key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' }, { key: 'singleClient', label: '是否单客户端', value: false, type: 'checkbox' }, - { key: 'client', label: '初始客户端', value: '', type: 'select', optionList: clientList}, + { key: 'client', label: '初始客户端', value: '', type: 'select', optionList: ClientList}, { key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'}, + { key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList }, { key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' }, { key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }, { key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' }, @@ -363,8 +340,9 @@ export default { this.frontTableData = [ { key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' }, { key: 'singleClient', label: '是否单客户端', value: false, type: 'checkbox' }, - { key: 'client', label: '初始客户端', value: '', type: 'select', optionList: this.clientList}, + { key: 'client', label: '初始客户端', value: '', type: 'select', optionList: ClientList}, { key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'}, + { key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList }, { key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' }, { key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }, { key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },