diff --git a/src/api/scheduling.js b/src/api/scheduling.js new file mode 100644 index 000000000..79d4312e1 --- /dev/null +++ b/src/api/scheduling.js @@ -0,0 +1,17 @@ +import request from '@/utils/request'; + +export function querySecheduling(group, params) { + return request({ + url: `/api/scheduling/${group}/day`, + method: 'get', + params + }); +} + +export function generateScheduling(group, params) { + return request({ + url: `/api/scheduling/${group}/generate`, + method: 'post', + params + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 5c36b1eea..b8161a02d 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -160,14 +160,6 @@ export function getEveryDayRunPlanData(group) { }); } -/** 生成手机同步仿真二维码*/ -// export function getSimulationQrCodeUrl(group) { -// return request({ -// url: `/api/simulation/${group}/qrCode`, -// method: 'post' -// }); -// } - /** 录制脚本仿真*/ export function scriptRecordNotify(scriptId) { return request({ @@ -293,85 +285,6 @@ export function modifyScriptAction(group, actionId, data) { }); } -// /** 根据成员角色查询设备列表*/ -// export function getDevicesByRole(group, params) { -// return request({ -// url: `/api/simulation/${group}/role/devices`, -// method: 'get', -// params -// }); -// } -// /** 获取任务录制的成员角色列表 */ -// export function getMembersByGroup(group) { -// return request({ -// url: `/api/simulation/${group}/questRecord/members`, -// method: 'get' -// }); -// } - -// /** 添加任务角色成员 */ -// export function postQuestMember(group, data) { -// return request({ -// url: `/api/simulation/${group}/questRecord/member`, -// method: 'post', -// data -// }); -// } - -// /** 删除任务角色成员 */ -// export function deleteQuestMember(group, memberId) { -// return request({ -// url: `/api/simulation/${group}/questRecord/member/${memberId}`, -// method: 'delete' -// }); -// } - -// // /** 添加/修改任务角色行为 */ -// export function postMemberBehavior(group, memberId, data) { -// return request({ -// url: `/api/simulation/${group}/questRecord/${memberId}/behavior`, -// method: 'post', -// data -// }); -// } -// /** 删除任务角色行为 */ -// export function deleteMemberBehavior(group, memberId, behaviorId) { -// return request({ -// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`, -// method: 'delete' -// }); -// } -// /** 删除任务角色行为动作 */ -// export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) { -// return request({ -// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`, -// method: 'delete' -// }); -// } -// /** 添加/修改任务角色行为动作 */ -// export function postMemberBehaviorAction(group, memberId, behaviorId, data) { -// return request({ -// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`, -// method: 'post', -// data -// }); -// } -// /** 添加/修改任务目标条件*/ -// export function postTargetConditionAction(group, data) { -// return request({ -// url: `/api/simulation/${group}/questRecord/targetCondition`, -// method: 'post', -// data -// }); -// } -// /** 删除任务目标条件*/ -// export function deleteTargetConditionAction(group, tcId) { -// return request({ -// url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`, -// method: 'delete' -// }); -// } - /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ @@ -396,14 +309,6 @@ export function getDeviceCodeByDeviceType(group, params) { params }); } -// /** 根据设备类型获取设备条件列表 */ -// export function getDeviceCoditionByDeviceType(params) { -// return request({ -// url: `/api/simulation/deviceType/conditions`, -// method: 'get', -// params -// }); -// } /** 获取任务录制的数据 */ export function getScriptRecord(group) { @@ -494,3 +399,12 @@ export function generateDayRunPlan(planId, group) { method: 'post' }); } + +/** 创建排班计划仿真*/ +export function schedulingNotify(params) { + return request({ + url: `/api/scheduling/simulation`, + method: 'post', + params + }); +} diff --git a/src/jmap/shape/Switch/EMouse.js b/src/jmap/shape/Switch/EMouse.js index 8d5c9ba76..5ae837984 100644 --- a/src/jmap/shape/Switch/EMouse.js +++ b/src/jmap/shape/Switch/EMouse.js @@ -42,9 +42,9 @@ class EMouse extends Group { // 创建道岔边框 craeteSwitchBorder() { - const sectionA = this.device.model.sectionAInstance.instance; - const sectionB = this.device.model.sectionBInstance.instance; - const sectionC = this.device.model.sectionCInstance.instance; + const sectionA = this.getInstanceByCode(this.device.model.sectionACode); + const sectionB = this.getInstanceByCode(this.device.model.sectionBCode); + const sectionC = this.getInstanceByCode(this.device.model.sectionCCode); const rect = this.device.getBoundingRect(); sectionA && rect.union(sectionA.getBoundingRect()); diff --git a/src/jmap/utils/parser.js b/src/jmap/utils/parser.js index 4ecbb8788..02701778b 100644 --- a/src/jmap/utils/parser.js +++ b/src/jmap/utils/parser.js @@ -160,9 +160,6 @@ export function parser(data, skinCode) { section['relSwitchCode'] = elem.code; } - mapDevice[elem.code]['sectionAInstance'] = cnodeSection; - mapDevice[elem.code]['sectionBInstance'] = lnodeSection; - mapDevice[elem.code]['sectionCInstance'] = rnodeSection; rnodeSection['layer'] = -1; } }, this); diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 10b24ee54..d793d6fdb 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -49,7 +49,7 @@ import { launchFullscreen } from '@/utils/screen'; import { queryPermissionSimulation } from '@/api/management/author'; import { postCreateRoom, getjointTraining, checkRoomExist } from '@/api/chat'; import { UrlConfig } from '@/router/index'; -import { simulationNotify } from '@/api/simulation'; +import { simulationNotify, schedulingNotify } from '@/api/simulation'; import localStore from 'storejs'; import LimitList from '@/views/components/limits/index'; import WindowResizeHandler from '@/mixin/WindowResizeHandler'; @@ -226,32 +226,37 @@ export default { const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup }; this.$router.push({ path: `/trainroom`, query: query }); }, - async start() { - if (this.courseModel.prdType == '03') { - try { - this.buttonLoading = true; - const param = { - mapId: Number(this.mapId), - prdCode: this.courseModel.prdCode - }; - const res = await postCreateRoom(param); - if (res && res.code == 200) { - const query = { skinCode: this.courseModel.skinCode, group: res.data }; - this.$router.push({ path: `/trainroom`, query: query }); - } - } catch (error) { - this.buttonLoading = false; - if (error.code == 20001) { - this.$confirm(this.$t('tip.createRoomFailedHint'), this.$t('global.tips'), { - confirmButtonText: this.$t('global.confirm'), - cancelButtonText: this.$t('global.cancel'), - type: 'warning' - }).then(() => {}).catch(() => {}); - } - if (error.code == 500009) { - this.$messageBox(error.message); - } + async createRoom() { + try { + this.buttonLoading = true; + const param = { + mapId: Number(this.mapId), + prdCode: this.courseModel.prdCode + }; + const res = await postCreateRoom(param); + if (res && res.code == 200) { + const query = { skinCode: this.courseModel.skinCode, group: res.data }; + this.$router.push({ path: `/trainroom`, query: query }); } + } catch (error) { + this.buttonLoading = false; + if (error.code == 20001) { + this.$confirm(this.$t('tip.createRoomFailedHint'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), + type: 'warning' + }).then(() => {}).catch(() => {}); + } + if (error.code == 500009) { + this.$messageBox(error.message); + } + } + }, + async start() { + if (this.courseModel.prdType == '05') { + this.jumpScheduling(); + } else if (this.courseModel.prdType == '03') { + this.createRoom(); } else { if (this.courseModel.pmsList.length) { this.jump(); @@ -270,6 +275,18 @@ export default { } } }, + jumpScheduling() { + this.buttonLoading = true; + const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode }; + schedulingNotify(data).then(resp => { + const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser }; + this.$router.push({ path: `${UrlConfig.display}/demon`, query: query }); + launchFullscreen(); + }).catch(error => { + this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + this.buttonLoading = false; + }); + }, jump() { const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode }; this.buttonLoading = true; diff --git a/src/views/demonstration/list/demonList.vue b/src/views/demonstration/list/demonList.vue index f12cda4b4..dddbcdc18 100644 --- a/src/views/demonstration/list/demonList.vue +++ b/src/views/demonstration/list/demonList.vue @@ -113,7 +113,6 @@ export default { } this.$nextTick(() => { const mapId = getSessionStorage('demonList') || null; - console.log(mapId); this.$refs.tree.setCurrentKey(mapId); this.loading = false; }); diff --git a/src/views/display/demon/scheduling.vue b/src/views/display/demon/scheduling.vue index 9beeead96..17793bf69 100644 --- a/src/views/display/demon/scheduling.vue +++ b/src/views/display/demon/scheduling.vue @@ -1,110 +1,205 @@ + diff --git a/src/views/display/index.vue b/src/views/display/index.vue index 444e85ca2..8fb2a2173 100644 --- a/src/views/display/index.vue +++ b/src/views/display/index.vue @@ -38,7 +38,7 @@ @faultChooseShow="faultChooseShow" @runQuestLoadShow="runQuestLoadShow" @switchMode="switchMode" - @handleScheduling="handleScheduling" + @schedulingShow="schedulingShow" /> @@ -52,7 +52,7 @@ - + @@ -80,9 +80,7 @@ import { getProductDetail } from '@/api/management/mapprd'; import { runDiagramQuit, loadScript, getSimulationInfo } from '@/api/simulation'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { checkLoginLine } from '@/api/login'; -// import { isFullscreen } from '@/utils/screen'; import { loadMapData, loadMapDataById } from '@/utils/loaddata'; -// import { handleToken } from '@/utils/auth'; import { EventBus } from '@/scripts/event-bus'; import Vue from 'vue'; @@ -138,12 +136,13 @@ export default { panelShow: true, simulationShow: false, drivingShow: false, - questId: 0, // 加载任务的Id + questId: 0, // 加载任务的Id group: '', prdTypeMap: { - '01': '01', // 现地 => 现地 - '02': '02', // 行调 => 行调 - '04': '02' // 司机加实 => 行调 + '01': '01', // 现地 => 现地 + '02': '02', // 行调 => 行调 + '04': '02', // 司机 => 行调 + '05': '' // 派班 => null }, ibpShow: false }; @@ -587,7 +586,7 @@ export default { faultChooseShow() { this.$refs.faultChoose.doShow(); }, - handleScheduling() { + schedulingShow() { this.$refs.scheduling.doShow(); } } diff --git a/src/views/display/menuDemon.vue b/src/views/display/menuDemon.vue index f3668d8b2..2d414d4e1 100644 --- a/src/views/display/menuDemon.vue +++ b/src/views/display/menuDemon.vue @@ -7,9 +7,9 @@
- IBP盘 + IBP盘 {{ jl3dname }} -