diff --git a/src/App.vue b/src/App.vue index 196366903..8ba7c2533 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,8 +26,8 @@ export default { } }, watch: { - '$store.state.socket.roomInvite': function (val) { - if (val.creatorId) { + '$store.state.socket.simulationInvite': function (val) { + if (val.creator) { this.subscribeMessage(val); } }, @@ -73,7 +73,7 @@ export default { if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt' && !(getSessionStorage('project').includes('design'))) { this.$refs.deomonTopic.doShow(res); } - this.$store.dispatch('socket/setRoomInvite'); + this.$store.dispatch('socket/setSimulationInvite'); } }, subscribe() { diff --git a/src/api/chat.js b/src/api/chat.js index 34d09d360..948a4dc3d 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -360,4 +360,47 @@ export function quitCoversition(group, conversationId) { method: 'delete' }); } - +/** 发起会话 */ +export function startConversition(group, data) { + return request({ + url: `/api/simulation/${group}/conversation`, + method: 'post', + data: data + }); +} +/** 根据会话id获取仿真会话 */ +export function getSimulationConversition(group, conversationId) { + return request({ + url: `/api/simulation/${group}/conversation/${conversationId}`, + method: 'get' + }); +} +/** 发送会话消息 */ +export function sendSimulationConversition(group, conversationId, file) { + return request({ + url: `/api/simulation/${group}/conversation/${conversationId}/chat`, + method: 'post', + data: file + }); +} +/** 成员接收仿真会话邀请 */ +export function acceptConversitionInvite(group, conversationId) { + return request({ + url: `/api/simulation/${group}/conversation/${conversationId}/connect`, + method: 'post' + }); +} +/** 结束仿真会话 */ +export function overSimulationConversition(group, conversationId) { + return request({ + url: `/api/simulation/${group}/conversation/${conversationId}/over`, + method: 'put' + }); +} +/** 获取所有会话 */ +export function getAllConversition(group) { + return request({ + url: `/api/simulation/${group}/conversation/listAll`, + method: 'get' + }); +} diff --git a/src/api/jmap/map.js b/src/api/jmap/map.js index 5e034d1c1..31b9bbca4 100644 --- a/src/api/jmap/map.js +++ b/src/api/jmap/map.js @@ -208,3 +208,17 @@ export function getByGroupStationList(group) { method: 'get' }); } +/** 查询所有上线的地图信息列表 */ +export function getAllMapOnline() { + return request({ + url: `/api/map/online/all`, + method: 'get' + }); +} +/** 查询地图下所有需要值班员的车站 */ +export function getStationListNeedAttendant(id) { + return request({ + url: `/api/map/${id}/station/needSupervisor`, + method: 'get' + }); +} diff --git a/src/api/jointSimulation.js b/src/api/jointSimulation.js new file mode 100644 index 000000000..b777bba2e --- /dev/null +++ b/src/api/jointSimulation.js @@ -0,0 +1,47 @@ +import request from '@/utils/request'; + +// 分配(取消)用户角色扮演 +export function assignUsersPlayRoles(data, group) { + return request({ + url: `/api/jointSimulation/${group}/assignRoles`, + method: 'put', + data: data + }); +} +// 添加新仿真成员 +export function addSimulationMember(data, group) { + return request({ + url: `/api/jointSimulation/${group}/member`, + method: 'post', + data: data + }); +} +// 获取权限生成仿真用户 +export function jointSimulationByPermission(group) { + return request({ + url: `/api/jointSimulation/${group}/permission`, + method: 'post' + }); +} +// 生成综合仿真分享二维码 +export function getSimulationQrcode(group) { + return request({ + url: `/api/jointSimulation/${group}/qrCode`, + method: 'get' + }); +} +// 获取用户所在的综合演练 +export function getSimulationListCantainUser() { + return request({ + url: `/api/jointSimulation/list/containUser`, + method: 'get' + }); +} +// 将制定用户踢出房间 +export function kickOutMember(group, userId) { + return request({ + url: `/api/jointSimulation/${group}/kickOut?userId=${userId}`, + method: 'delete' + + }); +} diff --git a/src/api/login.js b/src/api/login.js index 61f07a331..ee13e3772 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -83,3 +83,13 @@ export function checkLoginLine() { method: 'get' }); } +// 获取登录信息(用户&设备) +export function getLoginInfo(token) { + return request({ + url: '/api/login/loginUserInfo', + method: 'get', + params: { + token + } + }); +} diff --git a/src/api/management/exam.js b/src/api/management/exam.js index b9cce0170..51d0ac757 100644 --- a/src/api/management/exam.js +++ b/src/api/management/exam.js @@ -8,6 +8,14 @@ export function setCourseList(data) { data: data }); } +/** 贵州装备 创建对应课程考题 */ +export function setCourseListGzb(data) { + return request({ + url: `/api/exam/project/GZB`, + method: 'post', + data: data + }); +} /** 获取对应课程下类型 */ export function getCourseTypeList(data) { @@ -93,3 +101,11 @@ export function getExamParperList(lessonId) { method: 'get' }); } + +/** 根据课程ID获取班级 */ +export function getExamClassList(lessonId) { + return request({ + url: `/api/lesson/${lessonId}/classes`, + method: 'get' + }); +} diff --git a/src/api/project.js b/src/api/project.js index 82d0ed706..35e2d94e2 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -99,3 +99,47 @@ export function getDevicesByType(type) { method: 'get' }); } +/** 添加/修改车站综合监控配置 */ +export function setIscsLwConfig(id, data) { + return request({ + url: `/api/device/${id}/config/iscslw`, + method: 'put', + data: data + }); +} +/** 添加/修改中心综合监控配置 */ +export function setIscsCwConfig(id, data) { + return request({ + url: `/api/device/${id}/config/iscscw`, + method: 'put', + data: data + }); +} + +/** 添加/修改大屏工作站配置 */ +export function setLswConfig(id, data) { + return request({ + url: `/api/device/${id}/config/lsw`, + method: 'put', + data: data + }); +} + +/** 添加/修改CCTV工作站配置 */ +export function setCctvConfig(id, data) { + return request({ + url: `/api/device/${id}/config/cctv`, + method: 'put', + data: data + }); +} + +/** 添加/修改CCTV工作站配置 */ +export function setVrPsdConfig(id, data) { + return request({ + url: `/api/device/${id}/config/vrpsd`, + method: 'put', + data: data + }); +} + diff --git a/src/api/simulation.js b/src/api/simulation.js index f01605202..c10812b38 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -302,13 +302,6 @@ export function getScriptMemberData(group) { method: 'get' }); } -/** 获取剧本编制的所有成员角色(新版地图)*/ -export function getScriptMemberDataNew(group) { - return request({ - url: `/api/scriptSimulation/${group}/allMember`, - method: 'get' - }); -} /** 获取剧本出演成员角色 */ export function getScriptPlayMember(group) { @@ -770,4 +763,24 @@ export function getMemberInfo(group, memberId) { method: 'get' }); } - +/** 获取新版综合仿真仿真成员列表 */ +export function getSimulationMemberList(group) { + return request({ + url: `/simulation/${group}/members`, + method: 'get' + }); +} +/** 获取仿真用户信息 */ +export function getSimulationUserInfo(group) { + return request({ + url: `/simulation/${group}/simulationUser`, + method: 'get' + }); +} +// 获取所有仿真用户 +export function getAllSimulationUser(group) { + return request({ + url: `/simulation/${group}/simulationUsers`, + method: 'get' + }); +} diff --git a/src/i18n/langs/zh/global.js b/src/i18n/langs/zh/global.js index cef890583..50aec8584 100644 --- a/src/i18n/langs/zh/global.js +++ b/src/i18n/langs/zh/global.js @@ -206,5 +206,5 @@ export default { permissionAllNum:'权限总数', set: '设 置', joinNewRoom: '加入新房间', - roomId: '房间号:' + roomId: '仿真号:' }; diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index ef8770859..0cee4be8e 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -494,7 +494,8 @@ class SkinCode extends defaultStyle { }, lamp: { radiusR: 6, // 灯大小 - controlColor: '#00FF00' // 灯颜色 + controlColor: '#00FF00', // 灯颜色 + activeColor:'#ff0000' // 控制灯激活颜色 }, mouseOverStyle: { fontSize: 10, diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index aa9e114b0..725492b1e 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -449,7 +449,8 @@ class SkinCode extends defaultStyle { }, lamp: { radiusR: 6, // 控制灯大小 - controlColor: '#00FF00' // 控制灯颜色 + controlColor: '#00FF00', // 控制灯颜色 + activeColor:'#ff0000' // 控制灯激活颜色 } }; diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 3e2aeab49..5a66a2e8a 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -487,7 +487,8 @@ class SkinCode extends defaultStyle { }, lamp: { radiusR: 6, // 控制灯大小 - controlColor: '#00FF00' // 控制灯颜色 + controlColor: '#00FF00', // 控制灯颜色 + activeColor:'#ff0000' // 控制灯激活颜色 } }; diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 659c4e500..b33d1af11 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -11,7 +11,7 @@ import { selectLineCode } from './config/deviceStyle'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deepAssign } from '@/utils/index'; import store from '@/store/index_APP_TARGET'; -import { loadPropConvert } from './theme/factory'; +import Vue from 'vue'; const renderer = 'canvas'; const devicePixelRatio = 1; @@ -27,6 +27,9 @@ class Jlmap { // 线路参数 this.lineCode = ''; + // 大屏判断 + this.screenFlag = false; + // 皮肤风格 this.style = {}; @@ -135,8 +138,12 @@ class Jlmap { setOptions(opts) { const options = this.pullBack(opts); - this.$options.update(options); - this.$painter.updateTransform(this.$options); + if (this.screenFlag) { + this.$painter.updateScreen(options); + } else { + this.$options.update(options); + this.$painter.updateTransform(this.$options); + } if (this.$options.disabled == true) { this.$mouseController.disable(); } else { @@ -148,6 +155,18 @@ class Jlmap { if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); } } + switchScreen(data, num, sum) { + const sumHalf = sum / 2; + const dx = data.width / sumHalf; + const dy = data.height / sumHalf; + const row = num <= sumHalf ? 0 : 1; + const opts = { + dx: dx * (row == 0 ? num - 1 : num - sumHalf - 1), + dy: dy * row + }; + this.$painter.updateScreenNum(opts); + } + setCenter(deviceCode) { const device = this.mapDevice[deviceCode]; if (device && device.instance) { @@ -157,20 +176,23 @@ class Jlmap { } } setRevoverBigScreen() { + this.screenFlag = false; this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY }); } setRecover(opts) { + this.screenFlag = false; this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY }); } setUpdateScreen(opts) { this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 }); - const arr = []; + this.screenFlag = true; + const screenList = []; const rectList = []; let rect = ''; for (const i in this.mapDevice) { const element = this.mapDevice[i]; - if (element.instance && element._type == 'Section') { + if (element.instance && (element._type == 'Section' || element._type == 'Station' || element._type == 'StationStand')) { if (!rect) { rect = element.instance.getBoundingRect().clone(); } else { @@ -178,18 +200,23 @@ class Jlmap { } } } - const screenSplit = opts.list.length ? opts.list : loadPropConvert(this.lineCode).screenSplit; + if (!opts.offsetList) { + opts.offsetList = []; + } + const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit; + const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160; const splitList = JSON.parse(JSON.stringify(screenSplit)); const num = screenSplit.length + 1; const offsetY = (opts.height - 100) / num; // 高度差 const maxWidth = rect.width; splitList.push(maxWidth); - const scaleWidth = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100; - const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100; - const scale = Math.min(scaleWidth, scaleHeight); + const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100; + const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100; + const scale = Math.min(scaleX, scaleY); + // console.log('scaleX', scaleX, 'scaleY', scaleY, 'scale', scale, offsetY, rect.height * scale); - // const offsetHeight = (offsetY - (rect.height * scale)) + Math.abs(rect.x * scale); // 高度差 - // console.log(offsetHeight, opts.height, screenSplit, offsetY, rect, '缩放对比>', scaleWidth, scaleHeight); + // const offsetHeight = (offsetY - (rect.height * scale)) / 2; // 高度差 + // console.log(offsetHeight, opts.height, screenSplit, offsetY, rect, '缩放对比>', scaleX, scaleY); for (let i = 0; i < splitList.length; i++) { let offsetX = ''; @@ -199,13 +226,13 @@ class Jlmap { const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值 offsetX = splitList[i - 1] * scale - dx; } - // const param = { scaleRate: scale, offsetX: offsetX, offsetY: -(offsetY * i) - offsetHeight}; - const param = { scaleRate: scale, offsetX: offsetX, offsetY: -160 - (offsetY * i) }; - arr.push(param); + const offset = opts.offsetList[i] || 0; + const param = { scaleRateX: scale, scaleRateY: scale, offsetX: offsetX, offsetY: -screenDifference - (offsetY * i) - offset }; + screenList.push(param); const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height}; rectList.push(rect); } - this.$painter.updateTransform1(arr, rectList); + this.$painter.updateTransform1(screenList, rectList); } setLevelVisible(list) { diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index 6e9c41a15..f88631836 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -199,6 +199,12 @@ class Painter { this.$transformHandle.updateTransform(opt); } + updateScreen(opt) { + this.$transformHandleScreen.updataOffset(opt); + } + updateScreenNum(opts) { + this.$transformHandleScreen.updataOffsetNum(opts); + } updateTransform1(list, opts) { this.screenFlag = true; this.$transformHandleScreen.updateTransform(list, opts); diff --git a/src/jmapNew/shape/Signal/ESigLamp.js b/src/jmapNew/shape/Signal/ESigLamp.js index 88a4dddc9..910688131 100644 --- a/src/jmapNew/shape/Signal/ESigLamp.js +++ b/src/jmapNew/shape/Signal/ESigLamp.js @@ -1,7 +1,7 @@ import Line from 'zrender/src/graphic/shape/Line'; import Arc from 'zrender/src/graphic/shape/Arc'; import Group from 'zrender/src/container/Group'; -import Path from 'zrender/src/graphic/Path'; +// import Path from 'zrender/src/graphic/Path'; import {ESigFault} from './ESigFault'; class ESigLamp extends Group { @@ -103,11 +103,11 @@ class ESigLamp extends Group { } faultShow() { - this.lampFault.show(); + this.lampFault && this.lampFault.show(); } faultHide() { - this.lampFault.hide(); + this.lampFault && this.lampFault.hide(); } setColor(color) { diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 3aec659eb..4edc37021 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -548,7 +548,9 @@ class Signal extends Group { // 恢复状态 recover() { this.lamps.forEach(item=> { item.show(); }); - this.lamps[0].faultHide(); + if (this.style.Signal.lamp.faultType && this.style.Signal.lamp.faultType == 'flash') { + this.lamps[0].faultHide(); + } this.sigName.setStyle({ textBorderWidth: 0 }); this.sigName.setColor(this.style.Signal.text.defaultColor); this.setAutoClose(); diff --git a/src/jmapNew/shape/ZcControl/index.js b/src/jmapNew/shape/ZcControl/index.js index a5bf38970..6be973b52 100644 --- a/src/jmapNew/shape/ZcControl/index.js +++ b/src/jmapNew/shape/ZcControl/index.js @@ -61,8 +61,23 @@ export default class ZcControl extends Group { // 设置状态 setState(model) { + this.recover(); + model.fault == 'FAULT' && this.fault(); if (!this.isShowShape) return; } + + recover() { + if (this.style.ZcControl.visible) { + this.control.setControlColor(this.style.ZcControl.lamp.controlColor); + } + } + + fault() { + if (this.style.ZcControl.visible) { + this.control.setControlColor(this.style.ZcControl.lamp.activeColor); + } + } + createMouseEvent() { if (this.style.ZcControl.mouseOverStyle) { this.mouseEvent = new EMouse(this); diff --git a/src/jmapNew/theme/beijing_01/menus/index.vue b/src/jmapNew/theme/beijing_01/menus/index.vue index 6b234ebdc..01a075fa4 100644 --- a/src/jmapNew/theme/beijing_01/menus/index.vue +++ b/src/jmapNew/theme/beijing_01/menus/index.vue @@ -3,7 +3,6 @@ - @@ -22,7 +21,6 @@ import { mapGetters } from 'vuex'; import MenuCancel from './menuCancel'; import MenuSignal from './menuSignal'; import MenuButton from './menuButton'; -import MenuStationControl from './menuStationControl'; import MenuStationStand from './menuStationStand'; import MenuSwitch from './menuSwitch'; import MenuSection from './menuSection'; @@ -43,7 +41,6 @@ export default { MenuSignal, MenuSwitch, MenuSection, - MenuStationControl, MenuStationStand, MenuStation, MenuTrain, diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue index 5d2977505..d72b543b0 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue @@ -170,19 +170,10 @@ export default { } } }, - // 添加计划车 + // 添加计划车(开发专用) addPlanTrain() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Train.createPlanTrain.menu.operation, - param: { - sectionCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Train.createPlanTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainAddPlan.doShow(operate); } }); diff --git a/src/jmapNew/theme/beijing_01/menus/menuStation.vue b/src/jmapNew/theme/beijing_01/menus/menuStation.vue index bc19cf50f..76326273d 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuStation.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuStation.vue @@ -4,6 +4,7 @@ + @@ -20,12 +21,15 @@ import { DeviceMenu } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus'; +// import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StationMenu', components: { PopMenu, + SetFault, StationCmdControl, StationHumanControlAll, StationSetRouteControlAll, @@ -162,42 +166,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/beijing_01/menus/menuStationControl.vue b/src/jmapNew/theme/beijing_01/menus/menuStationControl.vue deleted file mode 100644 index 6e394cecd..000000000 --- a/src/jmapNew/theme/beijing_01/menus/menuStationControl.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - diff --git a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue index 369c0acad..fe3f61fff 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue @@ -1,6 +1,7 @@  @@ -12,11 +13,14 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StationMenu', components: { PopMenu, + SetFault, NoticeInfo }, mixins: [ @@ -98,38 +102,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); } } diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/sectionDetail.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/sectionDetail.vue index ebbdd8c4c..fd3803d05 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/sectionDetail.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/sectionDetail.vue @@ -59,9 +59,6 @@ export default { }; }, computed: { - ...mapGetters('map', [ - 'signalList' - ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue index 9029a62ec..fc999e07c 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue @@ -2,7 +2,6 @@
- @@ -16,7 +15,6 @@ import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionContr import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import SectionDetail from './dialog/sectionDetail'; -import TrainCreate from './dialog/trainCreate'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; @@ -31,7 +29,6 @@ export default { PopMenu, SectionControl, SectionDetail, - TrainCreate, NoticeInfo, TrainAddPlan, SetFault diff --git a/src/jmapNew/theme/chengdu_03/menus/menuStation.vue b/src/jmapNew/theme/chengdu_03/menus/menuStation.vue index 4b9d87511..d66dc9fa0 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuStation.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuStation.vue @@ -1,6 +1,7 @@  @@ -11,13 +12,15 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import CancelMouseState from '@/mixin/CancelMouseState'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StationMenu', components: { PopMenu, + SetFault, NoticeInfo }, mixins: [ @@ -100,42 +103,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); } } diff --git a/src/jmapNew/theme/components/menus/dialog/setFault.vue b/src/jmapNew/theme/components/menus/dialog/setFault.vue index 535965719..cc702aabf 100644 --- a/src/jmapNew/theme/components/menus/dialog/setFault.vue +++ b/src/jmapNew/theme/components/menus/dialog/setFault.vue @@ -101,16 +101,25 @@ export default { this.stationName = ''; this.operation = operate.operation; this.cmdType = operate.cmdType; + if (selected._type == 'Station') { + if (selected.zcCode) { + selected = this.$store.getters['map/getDeviceByCode'](selected.zcCode); + } else { + selected._type = ''; + } + } this.deviceName = deviceType[selected._type] + '-' + selected.name; this.faultList = deviceFaultType[selected._type]; - if (this.faultList.length) { + if (this.faultList && this.faultList.length) { this.form.faultType = this.faultList[0].value; } } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); + if (selected._type) { + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + } }, doClose() { this.loading = false; diff --git a/src/jmapNew/theme/factory.js b/src/jmapNew/theme/factory.js index 3f21fcace..1cb580e17 100644 --- a/src/jmapNew/theme/factory.js +++ b/src/jmapNew/theme/factory.js @@ -34,6 +34,12 @@ class Theme { return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/index`).default); } + // // 加载菜单组件 + // loadMenuComponent(code) { + // const menuCode = code || this._code; + // return new LoadMenuComponent(menuCode); + // } + // 加载运行图计划表组件 // loadPlanComponent(code) { // return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/planSchedule/index`).default); diff --git a/src/jmapNew/theme/foshan_01/menus/menuStation.vue b/src/jmapNew/theme/foshan_01/menus/menuStation.vue index 916396b92..1c500e738 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuStation.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuStation.vue @@ -4,6 +4,7 @@ +
@@ -16,7 +17,9 @@ import StationSetRouteControlAll from './dialog/stationSetRouteControlAll'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StationMenu', @@ -25,6 +28,7 @@ export default { StationCmdControl, StationHumanControlAll, StationSetRouteControlAll, + SetFault, NoticeInfo }, props: { @@ -133,46 +137,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue index beb684f1b..79d195383 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue @@ -4,6 +4,7 @@ + @@ -15,9 +16,9 @@ import StationHumanControlAll from '@/jmapNew/theme/components/menus/dialog/stat import StationSetRouteControlAll from '@/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; @@ -28,6 +29,7 @@ export default { StationCmdControl, StationHumanControlAll, StationSetRouteControlAll, + SetFault, NoticeInfo }, props: { @@ -156,44 +158,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Station.stoppage.menu.operation, - cmdType: CMD.Station.CMD_STOPPAGE, - param: { - Station_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Station.cancelStoppage.menu.operation, - cmdType: CMD.Station.CMD_CANCEL_STOPPAGE, - param: { - Station_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/haerbin_01/menus/menuStation.vue b/src/jmapNew/theme/haerbin_01/menus/menuStation.vue index d0a34ba69..e0ec3abfc 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuStation.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuStation.vue @@ -4,6 +4,7 @@ + @@ -18,6 +19,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { @@ -26,6 +29,7 @@ export default { PopMenu, StationCmdControl, StationHumanControlAll, + SetFault, StationSetRouteControlAll, NoticeInfo }, @@ -158,44 +162,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Station.stoppage.menu.operation, - cmdType: CMD.Station.CMD_STOPPAGE, - param: { - Station_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Station.cancelStoppage.menu.operation, - cmdType: CMD.Station.CMD_CANCEL_STOPPAGE, - param: { - Station_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/haerbin_01/model.js b/src/jmapNew/theme/haerbin_01/model.js index c7d80a99e..53a250e7f 100644 --- a/src/jmapNew/theme/haerbin_01/model.js +++ b/src/jmapNew/theme/haerbin_01/model.js @@ -3,6 +3,7 @@ import deviceType from '../../constant/deviceType'; class Model { constructor() { this.screenLine = 3; + this.screenDifference = 50; // 公共字段部分默认初始值 this['public'] = {}; this['public'][deviceType.Signal] = { diff --git a/src/jmapNew/theme/ningbo_01/menus/index.vue b/src/jmapNew/theme/ningbo_01/menus/index.vue index d025dcf85..db1f223ef 100644 --- a/src/jmapNew/theme/ningbo_01/menus/index.vue +++ b/src/jmapNew/theme/ningbo_01/menus/index.vue @@ -7,7 +7,6 @@ - diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue index 681f789db..d31c404a0 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue @@ -4,6 +4,7 @@ + @@ -17,9 +18,10 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo' import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; -import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; +import { DeviceMenu } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus'; +// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StationMenu', @@ -27,6 +29,7 @@ export default { PopMenu, StationCmdControl, StationHumanControlAll, + SetFault, StationSetRouteControlAll, NoticeInfo }, @@ -85,12 +88,12 @@ export default { menuForce: [ { label: '设置ZC故障', - handler: this.undeveloped, + handler: this.setStoppage, cmdType: CMD.Station.CMD_STATION_ADD_FAULT }, { label: '取消ZC故障', - handler: this.undeveloped, + handler: this.cancelStoppage, cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT } ] @@ -142,42 +145,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/ningbo_01/model.js b/src/jmapNew/theme/ningbo_01/model.js index 89c5550cf..c00fd4260 100644 --- a/src/jmapNew/theme/ningbo_01/model.js +++ b/src/jmapNew/theme/ningbo_01/model.js @@ -4,6 +4,7 @@ class Model { constructor() { this.screenLine = 3; this.screenSplit = ['5165', '10303']; + this.screenDifference = 180; // 公共字段部分默认初始值 this['public'] = {}; this['public'][deviceType.Signal] = { diff --git a/src/jmapNew/theme/xian_01/menus/menuStation.vue b/src/jmapNew/theme/xian_01/menus/menuStation.vue index 47f1bcd8b..876168d2d 100644 --- a/src/jmapNew/theme/xian_01/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_01/menus/menuStation.vue @@ -5,6 +5,7 @@ + @@ -17,7 +18,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo' import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; @@ -28,6 +29,7 @@ export default { PopMenu, StationCmdControl, StationHumanControlAll, + SetFault, StationSetRouteControlAll, NoticeInfo }, @@ -95,13 +97,13 @@ export default { }, menuForce: [ { - label: '设置故障', - handler: this.undeveloped, + label: '设置ZC故障', + handler: this.setStoppage, cmdType: CMD.Station.CMD_STATION_ADD_FAULT }, { - label: '取消故障', - handler: this.undeveloped, + label: '取消ZC故障', + handler: this.cancelStoppage, cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT } ] @@ -157,40 +159,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(); }); }, // 全站设置联锁自动触发 diff --git a/src/jmapNew/theme/xian_02/menus/menuStation.vue b/src/jmapNew/theme/xian_02/menus/menuStation.vue index 9f196748b..cdabc0a41 100644 --- a/src/jmapNew/theme/xian_02/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_02/menus/menuStation.vue @@ -3,6 +3,7 @@ + @@ -11,9 +12,10 @@ import PopMenu from '@/components/PopMenu/index'; import StationCmdControl from './dialog/stationCmdControl'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; - +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; // import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; @@ -22,6 +24,7 @@ export default { components: { PopMenu, StationCmdControl, + SetFault, NoticeInfo }, props: { @@ -142,12 +145,12 @@ export default { }, menuForce: [ { - label: '设置故障', - handler: this.undeveloped + label: '设置ZC故障', + handler: this.setStoppage }, { - label: '取消故障', - handler: this.undeveloped + label: '取消ZC故障', + handler: this.cancelStoppage } ] }; @@ -198,39 +201,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.stoppage.menu.operation - }; - - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 所有进路自排关 diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index 07f17fc9f..0e3a9e549 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -1,6 +1,5 @@ -import {createTransform, createBoundingRect} from './utils/parser'; - +import {createTransform1, createBoundingRect} from './utils/parser'; class TransformHandle { constructor(painter) { this.$painter = painter; @@ -9,7 +8,13 @@ class TransformHandle { this.rect = { x: 0, y: 0, width: 0, height: 0 }; this.rectList = []; - this.transform = [createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 })]; + this.transformInit = []; + this.transform = [createTransform1({ scaleRateX: 1, scaleRateY: 1, offsetX: 0, offsetY: 0 })]; + } + + revisibleView(view) { + view.show(); + view.dirty(); } checkVisible(view, rect) { @@ -31,6 +36,7 @@ class TransformHandle { const rect = this.rectList[i]; if (this.checkVisible(view, rect)) { view.transform = this.transform[i]; + view.transformIndex = i; view.decomposeTransform(); // 修改 transform 后同步位置 if (view.screenShow) { view.screenShow(); @@ -44,6 +50,24 @@ class TransformHandle { } } + // 视图进行缩放/平移 + transformView1(view) { + if (view) { + view.transform = this.transform[view.transformIndex]; + view.decomposeTransform(); + if (view.screenShow) { + view.screenShow(); + } else { + view.show(); + } + view.dirty(); + } + } + // 处理所有视图缩放/平移 + transformAll1() { + this.traverse(this.transformView1, this); + } + // 处理所有视图缩放/平移 transformAll() { this.traverse(this.transformView, this); @@ -59,10 +83,26 @@ class TransformHandle { this.rectList = rectList; this.transform = []; list.forEach(item => { - this.transform.push(createTransform(item)); + this.transform.push(createTransform1(item)); }); + this.transformInit = JSON.parse(JSON.stringify(this.transform)); this.transformAll(); } + updataOffset(opt) { + this.transform.forEach(item => { + item[4] = item[4] + opt.dx; + item[5] = item[5] + opt.dy; + }); + this.transformAll1(); + } + updataOffsetNum(opts) { + this.transform = JSON.parse(JSON.stringify(this.transformInit)); + this.transform.forEach(item => { + item[4] = item[4] - opts.dx; + item[5] = item[5] - opts.dy; + }); + this.transformAll1(); + } // 更新画布尺寸 updateZrSize(opts) { diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index c803229e2..150f053ca 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -12,6 +12,13 @@ export function createTransform(opts) { return transform; } +export function createTransform1(opts) { + let transform = matrix.create(); + transform = matrix.scale(matrix.create(), transform, [opts.scaleRateX, opts.scaleRateY]); + transform = matrix.translate(matrix.create(), transform, [-opts.offsetX, -opts.offsetY]); + return transform; +} + export function createBoundingRect(view) { const rect = view.getBoundingRect().clone(); const scale = view.scale[0]; diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index bfdca93cf..d808fd3cd 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -30,7 +30,7 @@ diff --git a/src/views/demonstration/deomonTopic/index.vue b/src/views/demonstration/deomonTopic/index.vue index a73851405..eb35c69e8 100644 --- a/src/views/demonstration/deomonTopic/index.vue +++ b/src/views/demonstration/deomonTopic/index.vue @@ -18,12 +18,7 @@ + diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index e48ed9465..4d25b3cf3 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -127,6 +127,10 @@ export default { this.$router.push({ path: `/design/bigScreen/${obj.mapId}` }); break; } + case 'bigSplitScreen': { + this.$router.push({ path: `/bigSplitScreen/${obj.mapId}` }); + break; + } } }, async refresh(filterSelect) { @@ -193,6 +197,14 @@ export default { lineCode: elem.lineCode, cityCode: elem.cityCode }); + elem.children.push({ + id: '7', + name: '大屏分屏预览', + type: 'bigSplitScreen', + mapId: elem.id, + lineCode: elem.lineCode, + cityCode: elem.cityCode + }); }); this.treeData = res.data; this.treeList = this.filterText diff --git a/src/views/exam/detail/courseDetail.vue b/src/views/exam/detail/courseDetail.vue index 69607c330..5af132ec0 100644 --- a/src/views/exam/detail/courseDetail.vue +++ b/src/views/exam/detail/courseDetail.vue @@ -8,25 +8,29 @@
- - - - -  {{ node.label }} - - + + + + + + + + + + + + + + +
@@ -55,7 +59,7 @@ import { getCourseLessonDetail } from '@/api/management/exam'; import { PermissionType } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic'; import LimitList from '@/views/components/limits/index'; -import { getSessionStorage, setSessionStorage } from '@/utils/auth'; +import { getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; export default { @@ -77,15 +81,14 @@ export default { }, EffectiveTypeList: [], activeName: 'first', - defaultProps: { - children: 'children', - label: 'name' - }, expandList: [], valid: false }; }, computed: { + isGzbShow() { + return getSessionStorage('project').startsWith('gzb'); + }, hasPermssion() { let isShow = false; if (this.courseModel.pmsList && this.courseModel.pmsList.length) { @@ -184,7 +187,7 @@ export default { this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`}); }, 100); }, - clickEvent(obj, node, data) { + clickEvent(obj) { if (this.valid || obj.trial) { this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem, mapId: this.courseModel.mapId }}); } else { @@ -199,21 +202,6 @@ export default { this.buy(); }).catch(() => { }); }, - filterNode(value, data) { - if (!value) return true; - return data.name.indexOf(value) !== -1; - }, - nodeExpand(obj, node, ele) { - const key = obj.id; - this.expandList = this.expandList.filter(item => item !== key); - this.expandList.push(key); - setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList); - }, - nodeCollapse(obj, node, ele) { - const key = obj.id; - this.expandList = this.expandList.filter(item => item !== key); - setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList); - }, getExpandList(id) { let expand = getSessionStorage('trainingExamExpandList' + id); expand = expand ? (expand + '').split(',') : ''; diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue index a862bf1cf..4c96c9524 100644 --- a/src/views/exam/detail/examDetail.vue +++ b/src/views/exam/detail/examDetail.vue @@ -114,7 +114,8 @@ export default { Stand: [], Station: [], ControlConvertMenu: [], - TrainWindow: [] + TrainWindow: [], + LimitControl: [] }; let ele; for ( ele in CMD['Switch']) { @@ -132,6 +133,9 @@ export default { for ( ele in CMD['Station']) { this.trainingOperateTypeMap['Station'].push(CMD['Station'][ele]); } + for ( ele in CMD['LimitControl']) { + this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][ele]); + } for ( ele in CMD['ControlConvertMenu']) { this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][ele]); } diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index a2e512726..0fa5fe1a7 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -8,7 +8,7 @@ - + @@ -48,6 +48,11 @@ export default { userId: '' }; }, + computed: { + isGzbShow() { + return getSessionStorage('project').startsWith('gzb'); + } + }, watch: { '$route.params.subSystem': function(newVal) { this.loadInitPage(); diff --git a/src/views/ibp/ibpsystem/index.vue b/src/views/ibp/ibpsystem/index.vue index cd75d9020..18e6f3f7f 100644 --- a/src/views/ibp/ibpsystem/index.vue +++ b/src/views/ibp/ibpsystem/index.vue @@ -9,11 +9,8 @@ import Vue from 'vue'; import IbpPan from '@/ibp/ibpPan'; import { parser } from '@/ibp/utils/parser'; -// import ibpData from '@/ibp/constant/ibpData'; import { mapGetters } from 'vuex'; import { exitFullscreen } from '@/utils/screen'; -import { putJointTrainingSimulationUser } from '@/api/chat'; -import { putJointTrainingSimulationUserNew} from '@/api/jointTraining'; import { handlerIbpEvent } from '@/api/simulation'; import { IbpOperation } from '@/scripts/ConstDic'; import { getIbpInfoByStation } from '@/api/ibp'; @@ -124,8 +121,6 @@ export default { if (!deviceCode) { return; } - // console.log(deviceCode); - // const ibpDatas = ibpData[deviceCode]; try { const res = await getIbpInfoByStation(this.$route.query.mapId, deviceCode); if (res.data.data) { @@ -241,16 +236,13 @@ export default { back() { this.group = this.$route.query.group; this.$store.dispatch('training/over').then(() => { - if (this.drawWay === 'true') { - putJointTrainingSimulationUserNew(this.group).then(() => { - this.$router.replace({ path: `/trainroom`, query: { group: this.group, lineCode:this.$route.query.lineCode, drawWay: this.drawWay } }); - exitFullscreen(); + if (this.$route.query.projectDevice) { + this.$store.dispatch('LogOut').then(() => { + location.reload(); }); } else { - putJointTrainingSimulationUser(this.group).then(() => { - this.$router.replace({ path: `/trainroom`, query: { group: this.group, lineCode:this.$route.query.lineCode } }); - exitFullscreen(); - }); + history.go(-1); + exitFullscreen(); } }); }, diff --git a/src/views/iscs/iscsSystem/groupNav.vue b/src/views/iscs/iscsSystem/groupNav.vue index 4f7fc6d4a..1ab04cbd5 100644 --- a/src/views/iscs/iscsSystem/groupNav.vue +++ b/src/views/iscs/iscsSystem/groupNav.vue @@ -16,7 +16,7 @@
- +
-
返回主页面
+
{{ projectDevice? '退出': '返回主页面' }}
- - - - - diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 9b1302684..8c2b42ba6 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,28 +1,28 @@