From cd229f7f810169034ae99b52201537f8dbcfc9b3 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 13 May 2020 15:31:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=BC=96=E8=BE=91=EF=BC=8C=E5=AE=81=E6=B3=A2?= =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E9=81=93=E5=B2=94=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 23 ++- src/jmapNew/painter.js | 4 - src/jmapNew/shape/Automactic/index.js | 3 + src/jmapNew/shape/OutFrame/index.js | 3 + src/jmapNew/shape/StationStand/index.js | 2 +- src/jmapNew/shape/Text/index.js | 3 + .../ningbo_01/menus/dialog/switchUnLock.vue | 2 +- .../theme/ningbo_01/menus/menuSwitch.vue | 6 +- .../ningbo_01/menus/utils/menuOperate.js | 10 +- src/jmapNew/transformHandleScreen.js | 15 +- src/scripts/cmdPlugin/CommandEnum.js | 4 + src/utils/baseUrl.js | 4 +- src/views/newMap/jlmapNew/screen.vue | 135 +++------------- .../mapoperate/config/previewScreen.vue | 151 ------------------ .../newMapdraft/mapoperate/splitScreen.vue | 36 ++++- 15 files changed, 97 insertions(+), 304 deletions(-) delete mode 100644 src/views/newMap/newMapdraft/mapoperate/config/previewScreen.vue 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/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/utils/baseUrl.js b/src/utils/baseUrl.js index 568f6a628..e9046878d 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/newMap/jlmapNew/screen.vue b/src/views/newMap/jlmapNew/screen.vue index 6ffd893b0..1632342b2 100644 --- a/src/views/newMap/jlmapNew/screen.vue +++ b/src/views/newMap/jlmapNew/screen.vue @@ -1,24 +1,19 @@ - diff --git a/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue b/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue index 57595819a..d17396fb0 100644 --- a/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue +++ b/src/views/newMap/newMapdraft/mapoperate/splitScreen.vue @@ -51,22 +51,20 @@ -
+
保存 - + 预览 + 重置
-