diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 094d1a958..b1b8e3a3a 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -54,7 +54,6 @@ class Jlmap { this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放 this.$painter = new Painter(this); this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()}); - this.$painter.updateTransform(this.$options); this.optionsHandler = this.setOptions.bind(this); @@ -157,9 +156,12 @@ class Jlmap { } } + setRecover(opts) { + this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY }); + } + setUpdateScreen(opts) { - const num = opts.num; - const offsetY = (opts.height - 100) / num; // 高度差 + this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 }); const arr = []; const rectList = []; let rect = ''; @@ -173,13 +175,16 @@ class Jlmap { } } } + const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code).screenSplit; + 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 splitList = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code).screenSplit; - const maxWidth = rect.width; - splitList.push(maxWidth); for (let i = 0; i < splitList.length; i++) { let offsetX = ''; if (i == 0) { @@ -533,6 +538,12 @@ class Jlmap { case this.events.Keyboard: this.$keyboardController.on(this.events.Keyboard, cb, context); break; + case this.events.__Pan: + this.$mouseController.on(this.events.__Pan, this.optionsHandler); + break; + case this.events.__Zoom: + this.$mouseController.on(this.events.__Zoom, this.optionsHandler); + break; } } } diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index 66eee626b..e057d87ff 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -202,10 +202,6 @@ class Painter { this.screenFlag = true; this.$transformHandleScreen.updateTransform(list, opts); } - - // trainScreen() { - // this.$transformHandleScreen.updateTransform(list, opts); - // } /** * 更新zrender尺寸 * @param {*} opt diff --git a/src/jmapNew/shape/Automactic/index.js b/src/jmapNew/shape/Automactic/index.js index 48a5cf1b6..942029bab 100644 --- a/src/jmapNew/shape/Automactic/index.js +++ b/src/jmapNew/shape/Automactic/index.js @@ -209,4 +209,7 @@ export default class Automactic extends Group { this.text.setStyle('textFill', color); } } + screenShow() { + this.hideMode(); + } } diff --git a/src/jmapNew/shape/OutFrame/index.js b/src/jmapNew/shape/OutFrame/index.js index ef39d016f..23875e2dd 100644 --- a/src/jmapNew/shape/OutFrame/index.js +++ b/src/jmapNew/shape/OutFrame/index.js @@ -71,4 +71,7 @@ export default class OutFrame extends Group { this.isShowShape = false; } } + screenShow() { + this.box && this.box.hide(); + } } diff --git a/src/jmapNew/shape/Section/EMouse.js b/src/jmapNew/shape/Section/EMouse.js index 375efe15e..6b51b4889 100644 --- a/src/jmapNew/shape/Section/EMouse.js +++ b/src/jmapNew/shape/Section/EMouse.js @@ -147,10 +147,8 @@ class EMouse extends Group { points.unshift(param); } else { const param = [ele.x + directx * this.triangle.getAbsSin(switchWidth), ele.y - directy * this.triangle.getAbsCos(switchWidth)]; - points.unshift(param); } - }); this.lineBorder = new Polygon({ zlevel: this.device.zlevel, diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index 1c334e498..2ce6b4d69 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -42,7 +42,7 @@ class StationStand extends Group { create() { const model = this.model; const style = this.style; - const drict = 1; + // const drict = 1; /** 列车站台*/ const standX = model.position.x - model.width / 2; diff --git a/src/jmapNew/shape/Text/index.js b/src/jmapNew/shape/Text/index.js index cb08c7846..56b3d4a22 100644 --- a/src/jmapNew/shape/Text/index.js +++ b/src/jmapNew/shape/Text/index.js @@ -77,4 +77,7 @@ export default class Text2 extends Group { this.isShowShape = false; } } + screenShow() { + this.text && this.text.hide(); + } } diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue index 4ab887b2e..19a9f14dd 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue @@ -227,7 +227,7 @@ export default { }; if (this.operation == OperationEvent.Switch.unlock.menu.operation) { operate.operation = OperationEvent.Switch.unlock.confirm2.operation; - operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK; + operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN; } else if (this.operation == OperationEvent.Switch.unblock.menu.operation) { operate.operation = OperationEvent.Switch.unblock.confirm2.operation; operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 3e79b0650..6cbcd77fc 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -60,12 +60,12 @@ export default { { label: '道岔单锁', handler: this.lock, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN }, { label: '道岔单解', handler: this.unlock, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN }, { label: '道岔封锁', @@ -252,7 +252,7 @@ export default { } }); }, - // 道岔解锁 + // 道岔单解 unlock() { commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js index 5dcae4248..cac3beffe 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -125,14 +125,16 @@ export const menuOperate = { }, Switch:{ lock:{ - // 道岔单锁 + // 道岔单锁(联锁) operation: OperationEvent.Switch.lock.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN }, unlock:{ - // 道岔解锁 + // 道岔解锁(联锁) operation: OperationEvent.Switch.unlock.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN }, block:{ // 道岔封锁 diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index d655a4390..07f17fc9f 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -1,7 +1,5 @@ import {createTransform, createBoundingRect} from './utils/parser'; -import Vue from 'vue'; -import store from '@/store/index_APP_TARGET'; class TransformHandle { constructor(painter) { @@ -34,12 +32,12 @@ class TransformHandle { if (this.checkVisible(view, rect)) { view.transform = this.transform[i]; view.decomposeTransform(); // 修改 transform 后同步位置 - const propConvert = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code); - if (propConvert.handleScreenProps && propConvert.handleScreenProps(view)) { - view.hide(); - return; + if (view.screenShow) { + view.screenShow(); + } else { + view.show(); } - view.show(); return; + return; } } view.dirty(); // 更新 @@ -53,12 +51,11 @@ class TransformHandle { // 重新计算显示图形 revisibleAll() { - this.traverse(this.revisibleView, this); + this.traverse(this.transformView, this); } // 更新偏移量 updateTransform(list, rectList) { - // this.rect = { x: opts.x, y: opts.y, width: opts.width, height: opts.height }; this.rectList = rectList; this.transform = []; list.forEach(item => { diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 05f0a4760..13bde0d94 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -8,6 +8,10 @@ export default { CMD_SWITCH_SINGLE_LOCK: {value:'Switch_Single_Lock', label: '单锁'}, /** 单解 */ CMD_SWITCH_SINGLE_UNLOCK: {value:'Switch_Single_Unlock', label: '单解'}, + /** 单锁(联动) */ + CMD_SWITCH_SINGLE_LOCK_CHAIN: {value:'Switch_Single_Lock_Chain', label: '单锁(联动)'}, + /** 单解(联动) */ + CMD_SWITCH_SINGLE_UNLOCK_CHAIN: {value:'Switch_Single_Unlock_Chain', label: '单解(联动)'}, /** 封锁 */ CMD_SWITCH_BLOCK: {value:'Switch_Block', label: '封锁'}, /** 解封 */ diff --git a/src/store/modules/map.js b/src/store/modules/map.js index ac70accf7..eb5687328 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -367,6 +367,13 @@ const map = { return []; } }, + bigScreenSplitConfig: (state) => { + if (state.map) { + return state.map.bigScreenSplitConfig || []; + } else { + return []; + } + }, indicatorLightList: (state) => { if (state.map) { return state.map.indicatorLightList || []; diff --git a/src/views/designPlatform/bigScreen.vue b/src/views/designPlatform/bigScreen.vue index c4b191f2d..f3a8ba32d 100644 --- a/src/views/designPlatform/bigScreen.vue +++ b/src/views/designPlatform/bigScreen.vue @@ -1,7 +1,8 @@