diff --git a/src/api/runplan.js b/src/api/runplan.js index 8876c8220..eca337ef7 100644 --- a/src/api/runplan.js +++ b/src/api/runplan.js @@ -72,9 +72,24 @@ export function queryRunPlan(planId) { }); } -/** - * 删除运行图 - */ +// 根据skinCode查询发布运行图列表 +export function queryRunPlanList(skinCode) { + return request({ + url: `/api/runPlan/template/skin/${skinCode}`, + method: 'get' + }); +} + +// 从发布运行图创建新运行图 +export function postCreatePlan(data) { + return request({ + url: `/api/runPlan/draft/createFrom/${data.templateId}`, + method: 'post', + data: data + }); +} + +// 删除运行图 export function deleteRunPlan(planId) { return request({ url: `/api/runPlan/draft/${planId}`, @@ -82,6 +97,15 @@ export function deleteRunPlan(planId) { }); } +// 修改运行图内容 +export function putRunPlanDetail(data) { + return request({ + url: `/api/runPlan/draft/${data.planId}`, + method: 'put', + data: data + }); +} + /** * 发布运行图 */ @@ -204,15 +228,6 @@ export function duplicateService(data) { }); } -/** 修改计划*/ -// export function updatePlanService(data) { -// return request({ -// url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}`, -// method: 'put', -// data: data -// }) -// } - /** 增加任务*/ export function addPlanTrip(data) { return request({ diff --git a/src/assets/ibp_images/ibp_bg.png b/src/assets/ibp_images/ibp_bg.png index 410596fe8..4aec7bb06 100644 Binary files a/src/assets/ibp_images/ibp_bg.png and b/src/assets/ibp_images/ibp_bg.png differ diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index fa74379f1..0fc343814 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -56,5 +56,6 @@ export default { userTrainingManage: 'User training management', userExamManage: 'User examination management', userSimulationManage: 'User simulation management', - existingSimulation: 'Existence simulation management' + existingSimulation: 'Existence simulation management', + ibpDraw: 'ibp Draw' }; diff --git a/src/i18n/langs/zh/scriptRecord.js b/src/i18n/langs/zh/scriptRecord.js index ec33bfae3..71e7b9023 100644 --- a/src/i18n/langs/zh/scriptRecord.js +++ b/src/i18n/langs/zh/scriptRecord.js @@ -1,22 +1,26 @@ export default { - scriptTitle: '任务录制', - saveMaplocation: '更新定位', + scriptTitle: '剧本录制', + // saveMaplocation: '更新定位', saveBackground: '保存背景', saveData: '保存数据', - roleManage: '角色管理', - targetCondition: '任务目标', - taskScript: '任务剧本', - roleName: '角色名称', - roleType: '角色类型', - deviceCode: '设备编码', - roleList: '角色列表', - operation: '操作', - roleAdd: '添加', - delete: '删除', - behaviorOperate: '行为操作', - conditionTitle: '目标条件', - deviceType: '设备类型', - deviceCondition: '设备条件', - paramDeviceType: '参数设备类型', - paramDeviceCode: '参数设备编号' + mapList: '地图列表', + createScript: '创建剧本', + scriptName: '剧本名称', + + // roleManage: '角色管理', + // targetCondition: '任务目标', + // taskScript: '任务剧本', + // roleName: '角色名称', + // roleType: '角色类型', + // deviceCode: '设备编码', + // roleList: '角色列表', + // operation: '操作', + // roleAdd: '添加', + // delete: '删除', + // behaviorOperate: '行为操作', + // conditionTitle: '目标条件', + // deviceType: '设备类型', + // deviceCondition: '设备条件', + // paramDeviceType: '参数设备类型', + // paramDeviceCode: '参数设备编号' }; diff --git a/src/ibp/constant/deviceRender.js b/src/ibp/constant/deviceRender.js index ae00893ee..38965be03 100644 --- a/src/ibp/constant/deviceRender.js +++ b/src/ibp/constant/deviceRender.js @@ -68,7 +68,8 @@ deviceRender[deviceType.AppendageBox] = { /** IbpLine渲染配置 */ deviceRender[deviceType.IbpLine] = { _type: deviceType.IbpLine, - zlevel: 3 + zlevel: 1, + z: 3 }; /** Elevator 渲染配置 */ diff --git a/src/ibp/ibpPan.js b/src/ibp/ibpPan.js index 835c8dd39..4607bfb9e 100644 --- a/src/ibp/ibpPan.js +++ b/src/ibp/ibpPan.js @@ -36,9 +36,11 @@ class IbpPan { initIbpPage(opts) { const width = opts.config.width; const height = opts.config.height; + this.isAllowDragging=false; this.$ibpZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config)); this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放 this.$mouseController = new MouseController(this); + this.$mouseController.enable(); this.$painter = new Painter(this); @@ -195,6 +197,7 @@ class IbpPan { (Object.keys(this.ibpDevice) || []).forEach(elem => { this.$painter.drawIbp(this.ibpDevice[elem]); }); + this.$mouseController.setAllowDragging(true); } pullBack(payload) { diff --git a/src/ibp/mouseController.js b/src/ibp/mouseController.js index f061602c2..b503b07d2 100644 --- a/src/ibp/mouseController.js +++ b/src/ibp/mouseController.js @@ -2,6 +2,7 @@ import deviceType from './constant/deviceType'; import Eventful from 'zrender/src/mixin/Eventful'; import * as eventTool from 'zrender/src/core/event'; import store from '@/store'; +import Group from 'zrender/src/container/Group'; class EventModel { constructor(e) { @@ -33,7 +34,10 @@ class MouseController extends Eventful { super(); this.$ibp = ibp; this.$zr = ibp.getZr(); + this.isAllowDragging=ibp.isAllowDragging||false; this.events = ibp.getEvents(); + this._draggingTarget=null; + this._dragging = false; this.initHandler(this.$zr); } @@ -54,6 +58,9 @@ class MouseController extends Eventful { zr.on('mousedown', this.mousedown, this); zr.on('mousemove', this.mousemove, this); zr.on('mouseup', this.mouseup, this); + zr.on('touchstart', this.mousedown, this); + zr.on('touchmove', this.mousemove, this); + zr.on('touchend', this.mouseup, this); zr.on('mousewheel', this.mousewheel, this); }; @@ -61,6 +68,11 @@ class MouseController extends Eventful { zr.off('mousedown', this.mousedown); zr.off('mousemove', this.mousemove); zr.off('mouseup', this.mouseup); + + zr.off('touchstart', this.mousedown); + zr.off('touchmove', this.mousemove); + zr.off('touchend', this.mouseup); + zr.off('mousewheel', this.mousewheel); }; @@ -68,6 +80,11 @@ class MouseController extends Eventful { zr.off('click', this.click); zr.off('contextmenu', this.contextmenu); zr.off('mousemove', this.moveEvent); + + zr.off('touchstart', this.mousedown); + zr.off('touchmove', this.mousemove); + zr.off('touchend', this.mouseup); + this.disable(); }; @@ -75,17 +92,41 @@ class MouseController extends Eventful { } } + setAllowDragging(data) { + this.isAllowDragging=data; + } + mousedown(e) { if (eventTool.notLeftMouse(e)) { return; } + // + const draggingTarget = e.target; + // draggingTarget.draggable + if (draggingTarget) { + if (e.target.parent.getName()=='background') { + this._draggingName='background'; + } else if (this.isAllowDragging&&e.target.parent.getName()=='simple') { + this._draggingName='simple'; + } else if (this.isAllowDragging&&e.target.parent.getName()=='group') { + this._draggingName='group'; + } else if (this.isAllowDragging&&e.target.parent.getName()=='group_child') { + this._draggingName='group_child'; + } + this._draggingTarget = draggingTarget; + // draggingTarget.dragging = true; + this._x = e.offsetX; + this._y = e.offsetY; + this._dragging = true; + // this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event); + } - var x = e.offsetX; - var y = e.offsetY; + // var x = e.offsetX; + // var y = e.offsetY; - this._x = x; - this._y = y; - this._dragging = true; + // this._x = x; + // this._y = y; + // this._dragging = true; } mousemove(e) { @@ -105,14 +146,38 @@ class MouseController extends Eventful { this._x = e.offsetX; this._y = e.offsetY; - this._preventDefaultMouseMove && eventTool.stop(e.event); + if (this._dragging) { + if (this._draggingTarget&&this._draggingName=='background') { + this._preventDefaultMouseMove && eventTool.stop(e.event); + this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); + return true; + } else if (this.isAllowDragging&&this._draggingTarget&&this._draggingName=='simple') { + this._draggingTarget.drift(dx, dy, e); + return true; + } else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group'||this._draggingName=='group_child')) { + // debugger; + if (this._draggingName=='group') { + this._draggingTarget.parent.drift(dx, dy, e); + return true; + } else { + this._draggingTarget.parent.parent.drift(dx, dy, e); + return true; + } + } + } else { + // debugger; + return true; + } - this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); } mouseup(e) { - if (!eventTool.notLeftMouse(e)) { + // debugger; + const draggingTarget = this._draggingTarget; + if (!eventTool.notLeftMouse(e)&&draggingTarget) { this._dragging = false; + this._draggingTarget = null; + this._draggingName==''; } } diff --git a/src/ibp/shape/alarm.js b/src/ibp/shape/alarm.js index d851dbd9f..d1bb3e15d 100644 --- a/src/ibp/shape/alarm.js +++ b/src/ibp/shape/alarm.js @@ -10,9 +10,11 @@ export default class alarm extends Group { this.model = device.model; this.event = device.event; this.zlevel = device.model.zlevel; + this.z = device.model.zlevel; this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -20,6 +22,7 @@ export default class alarm extends Group { const model = this.model; this.imageBg = new Image({ zlevel: this.zlevel, + z: this.z, draggable: false, style: { image: alarmpic, @@ -72,4 +75,7 @@ export default class alarm extends Group { } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/appendageBox.js b/src/ibp/shape/appendageBox.js index 7e5e7fd6f..bb55924c2 100644 --- a/src/ibp/shape/appendageBox.js +++ b/src/ibp/shape/appendageBox.js @@ -13,6 +13,7 @@ export default class AppendageBox extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -62,4 +63,7 @@ export default class AppendageBox extends Group { } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/arrow.js b/src/ibp/shape/arrow.js index c04e7e050..12185f403 100644 --- a/src/ibp/shape/arrow.js +++ b/src/ibp/shape/arrow.js @@ -12,6 +12,7 @@ class Arrow extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -78,7 +79,7 @@ class Arrow extends Group { this.event.disable(); if (e.which == 3) { store.dispatch('ibp/setUpdateDeviceData', this.model); - return; + return; } this.offsetX = e.offsetX; this.offsetY = e.offsetY; @@ -91,9 +92,12 @@ class Arrow extends Group { if (this.dragging) { this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX); this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY); - this.dragging = false; + this.dragging = false; } } + getName() { + return this.name; + } } export default Arrow; diff --git a/src/ibp/shape/background.js b/src/ibp/shape/background.js index 14968727b..9555e05fb 100644 --- a/src/ibp/shape/background.js +++ b/src/ibp/shape/background.js @@ -1,7 +1,7 @@ import Group from 'zrender/src/container/Group'; -import Image from 'zrender/src/graphic/Image'; import Rect from 'zrender/src/graphic/shape/Rect'; import ibpBg from '@/assets/ibp_images/ibp_bg.png'; +import Pattern from 'zrender/src/graphic/Pattern'; export default class background extends Group { constructor(device) { @@ -9,49 +9,49 @@ export default class background extends Group { this.model = device.model; this.zlevel = device.model.zlevel; this.z = 1; - this.imageBgArray = []; - // this.model.width = 4100; - // this.model.height = 900; + this.name='background'; this.create(); + this.createMouseEvent(); } create() { - const widthNum = Math.ceil(parseInt(this.model.width)/2048); - const heightNum = Math.ceil(parseInt(this.model.height)/1024); - for (let i = 0; i { + const pattern = new Pattern(image, 'repeat'); + this.imageBg = new Rect({ + zlevel: this.zlevel, + z: this.z, + cursor: 'default', + shape: { + x: 0, + y: 0, + width: this.model.width, + height: this.model.height + }, + style: { + fill: pattern + } + }); + this.add(this.imageBg); + }; + } - tailorBgImage() { - const _this = this; - this.imageBgArray.forEach( function(elem) { - elem.setClipPath(_this.tailorRect); - _this.add(elem); - }); + createMouseEvent() { + this.on('mousedown', this.mousedown, this); + this.on('mouseup', this.mouseup, this); + } + mousedown(e) { + if (e.which == 3) { + return; + } + this.imageBg.attr('cursor', 'pointer'); + } + mouseup() { + this.imageBg.attr('cursor', 'default'); } setDraggable() { } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/button.js b/src/ibp/shape/button.js index e95a4666c..bfcba8fdb 100644 --- a/src/ibp/shape/button.js +++ b/src/ibp/shape/button.js @@ -30,16 +30,19 @@ export default class button extends Group { this.event = device.event; this.model = device.model; this.zlevel = device.model.zlevel; + this.z = device.model.z; this.event = device.event; this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } create() { const model = this.model; this.imageBg = new Image({ zlevel: this.zlevel, + z: this.z, draggable: false, style: { image: this.getImagePic(), @@ -141,5 +144,7 @@ export default class button extends Group { const color = button.colors.get(`${this.model.color}_on`); this.imageBg.setStyle({image: color[0]}); } - + getName() { + return this.name; + } } diff --git a/src/ibp/shape/circularLamp.js b/src/ibp/shape/circularLamp.js index 82f14a1e9..2aca23d29 100644 --- a/src/ibp/shape/circularLamp.js +++ b/src/ibp/shape/circularLamp.js @@ -12,6 +12,7 @@ export default class CircularLamp extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); this.setStatus(this.model); } @@ -72,4 +73,7 @@ export default class CircularLamp extends Group { this.lamp.setStyle('fill', '#332C22'); } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/clock.js b/src/ibp/shape/clock.js index 25b3f2147..295e7d59e 100644 --- a/src/ibp/shape/clock.js +++ b/src/ibp/shape/clock.js @@ -12,6 +12,7 @@ import clock8 from '@/assets/ibp_images/clock/clock_8.png'; import clock9 from '@/assets/ibp_images/clock/clock_9.png'; import clockBg from '@/assets/ibp_images/clock/clock_bg.png'; import clockColon from '@/assets/ibp_images/clock/clock_colon.png'; +import store from '@/store'; export default class clock extends Group { constructor(device) { @@ -25,6 +26,7 @@ export default class clock extends Group { this.offsetY = 0; this.dragging = false; this.initTime = 0; + this.name='group'; this.create(); } create() { @@ -247,5 +249,18 @@ export default class clock extends Group { this.setNumPic(1, hours.charAt(0)); } setDraggable() { + this.createMouseEvent(); + } + createMouseEvent() { + this.on('mousedown', this.mousedown, this); + } + mousedown(e) { + if (e.which == 3) { + store.dispatch('ibp/setUpdateDeviceData', this.model); + return; + } + } + getName() { + return this.name; } } diff --git a/src/ibp/shape/elevator.js b/src/ibp/shape/elevator.js index 9e04ad52d..3e5378ac5 100644 --- a/src/ibp/shape/elevator.js +++ b/src/ibp/shape/elevator.js @@ -9,6 +9,7 @@ export default class elevator extends Group { super(); this.event = device.event; this.model = device.model; + this.name='group'; this.create(); } @@ -16,11 +17,11 @@ export default class elevator extends Group { const model = this.model; this.grouper=new Group({ - id: '111', + id: model.code, // width: model.width, // height: model.height, - position: [model.point.x, model.point.y], - draggable: false + position: [model.point.x, model.point.y] + // draggable: model.draggable || false }); this.elevatorBack = new ElevatorBack({model: { @@ -80,6 +81,10 @@ export default class elevator extends Group { } } + getName() { + return this.name; + } + setStatus(model) { if (model.direction=='none') { this.elevatorArrowBottom.setStatus('off'); @@ -94,36 +99,7 @@ export default class elevator extends Group { } setDraggable() { - this.grouper.attr('draggable', true); - this.createMouseEvent(); - } - - createMouseEvent() { - this.on('mousedown', this.mousedown, this); - this.on('mousemove', this.mousemove, this); - this.on('mouseup', this.mouseup, this); - } - - mousedown(e) { - this.event.disable(); - if (e.which == 3) { - store.dispatch('ibp/setUpdateDeviceData', this.model); - return; - } - this.draggroup =this.grouper; - this.deltPostion =[e.event.zrX-this.draggroup.position[0], e.event.zrY-this.draggroup.position[1]]; - } - - mousemove(e) { - if (this.draggroup !=null) { - var new_pos =[e.event.zrX, e.event.zrY]; - this.draggroup.position=[new_pos[0]-this.deltPostion[0], new_pos[1]-this.deltPostion[1]]; - this.draggroup.dirty(); - } - } - - mouseup(e) { - this.event.enable(); - this.draggroup=null; + // this.grouper.attr('draggable', true); + // this.createMouseEvent(); } } diff --git a/src/ibp/shape/elevatorArrow.js b/src/ibp/shape/elevatorArrow.js index acdcedb69..2bbd2448d 100644 --- a/src/ibp/shape/elevatorArrow.js +++ b/src/ibp/shape/elevatorArrow.js @@ -9,6 +9,7 @@ export default class elevatorArrow extends Group { super(); this.model = device.model; this.zlevel = device.model.zlevel; + this.name='group_child'; this.create(); } @@ -26,7 +27,6 @@ export default class elevatorArrow extends Group { height: 60 } }); - // debugger; this.add(this.imageBg); this.getOrientate(); this.transformScale(); @@ -89,26 +89,7 @@ export default class elevatorArrow extends Group { this.imageBg.setStyle({image: imageBack}); } - // setDraggable() { - // this.arrow.attr('draggable', true); - // this.createMouseEvent(); - // } - // createMouseEvent() { - // this.on('mousedown', this.mousedown, this); - // this.on('mousemove', this.mousemove, this); - // this.on('mouseup', this.mouseup, this); - // } - - // mousedown(e) { - // this.event.disable(); - // } - - // mousemove(e) { - // } - - // mouseup(e) { - // this.event.enable(); - // this.model.point.x = this.model.point.x + e.offsetX; - // this.model.point.y = this.model.point.y + e.offsetY; - // } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/elevatorBack.js b/src/ibp/shape/elevatorBack.js index 3b7bd3bd0..a9e59536f 100644 --- a/src/ibp/shape/elevatorBack.js +++ b/src/ibp/shape/elevatorBack.js @@ -7,11 +7,11 @@ export default class elevatorBack extends Group { super(); this.event = device.event; this.model = device.model; + this.name='group_child'; this.create(); } create() { - // debugger; const model = this.model; const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+ ' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+ @@ -31,4 +31,8 @@ export default class elevatorBack extends Group { }); this.add(this.elevatorBack); } + + getName() { + return this.name; + } } diff --git a/src/ibp/shape/ibpLine.js b/src/ibp/shape/ibpLine.js index dbddbb867..3e0cf53ae 100644 --- a/src/ibp/shape/ibpLine.js +++ b/src/ibp/shape/ibpLine.js @@ -12,6 +12,7 @@ export default class ibpLine extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } create() { @@ -46,7 +47,7 @@ export default class ibpLine extends Group { this.event.disable(); if (e.which == 3) { store.dispatch('ibp/setUpdateDeviceData', this.model); - return; + return; } this.offsetX = e.offsetX; this.offsetY = e.offsetY; @@ -64,4 +65,7 @@ export default class ibpLine extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/ibpText.js b/src/ibp/shape/ibpText.js index 96b197931..011fb40dc 100644 --- a/src/ibp/shape/ibpText.js +++ b/src/ibp/shape/ibpText.js @@ -12,6 +12,7 @@ export default class ibpText extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } create() { @@ -67,4 +68,7 @@ export default class ibpText extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/ibpTipBox.js b/src/ibp/shape/ibpTipBox.js index 276112a76..b0e8fc070 100644 --- a/src/ibp/shape/ibpTipBox.js +++ b/src/ibp/shape/ibpTipBox.js @@ -12,6 +12,7 @@ export default class ibpTipBox extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } create() { @@ -61,4 +62,7 @@ export default class ibpTipBox extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/key.js b/src/ibp/shape/key.js index c3d8ef19b..811743100 100644 --- a/src/ibp/shape/key.js +++ b/src/ibp/shape/key.js @@ -14,6 +14,7 @@ export default class key extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -121,4 +122,7 @@ export default class key extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/rotateTip.js b/src/ibp/shape/rotateTip.js index b69710dd7..ace615aa6 100644 --- a/src/ibp/shape/rotateTip.js +++ b/src/ibp/shape/rotateTip.js @@ -10,10 +10,12 @@ export default class rotateTip extends Group { super(); this.model = device.model; this.zlevel = device.model.zlevel; + this.z = device.model.z; this.event = device.event; this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -21,6 +23,7 @@ export default class rotateTip extends Group { const model = this.model; this.imageBg = new Image({ zlevel: this.zlevel, + z: this.z, draggable: false, style: { image: this.getRotateColor(), @@ -88,4 +91,7 @@ export default class rotateTip extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/rotatingButton.js b/src/ibp/shape/rotatingButton.js index b8dd4d5a4..3e49f805b 100644 --- a/src/ibp/shape/rotatingButton.js +++ b/src/ibp/shape/rotatingButton.js @@ -13,6 +13,7 @@ export default class RotatingButton extends Group { this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -61,4 +62,7 @@ export default class RotatingButton extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/shape/teleTerminal.js b/src/ibp/shape/teleTerminal.js index a59823b20..6cbdd1ea8 100644 --- a/src/ibp/shape/teleTerminal.js +++ b/src/ibp/shape/teleTerminal.js @@ -10,9 +10,11 @@ export default class alarm extends Group { this.event = device.event; this.model = device.model; this.zlevel = device.model.zlevel; + this.z = device.model.z; this.offsetX = 0; this.offsetY = 0; this.dragging = false; + this.name='simple'; this.create(); } @@ -20,6 +22,7 @@ export default class alarm extends Group { const model = this.model; this.imageBg = new Image({ zlevel: this.zlevel, + z: this.z, draggable: false, style: { image: teleTerminalPic, @@ -72,4 +75,7 @@ export default class alarm extends Group { this.dragging = false; } } + getName() { + return this.name; + } } diff --git a/src/ibp/utils/parser.js b/src/ibp/utils/parser.js index b948fa3fb..293effc7a 100644 --- a/src/ibp/utils/parser.js +++ b/src/ibp/utils/parser.js @@ -30,7 +30,7 @@ export function calculateDCenter(viewRect, zrbound) { } export function deviceFactory(type, elem) { - return Object.assign({instance: null, event: null, model: Object(elem, deviceRender[type])}); + return Object.assign({instance: null, event: null, model: Object.assign(elem, deviceRender[type])}); } export function parser(data) { @@ -38,6 +38,7 @@ export function parser(data) { if (data) { Object.assign(data.background); ibpDevice[data.background.code] = deviceFactory(deviceType.Background, data.background); + store.dispatch('ibp/setIbpBgDevice', ibpDevice[data.background.code]); zrUtil.each(data.textList || [], elem => { ibpDevice[elem.code] = deviceFactory(deviceType.IbpText, elem); }, this); diff --git a/src/jmap/utils/animation.js b/src/jmap/utils/animation.js deleted file mode 100644 index ee2d10b11..000000000 --- a/src/jmap/utils/animation.js +++ /dev/null @@ -1,13 +0,0 @@ -export const requestAnimationFrame = window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function (callback) { callback.timter = window.setTimeout(callback, 1000 / 60); }; - -export const cancelRequestAnimFrame = window.cancelAnimationFrame || - window.webkitCancelRequestAnimationFrame || - window.mozCancelRequestAnimationFrame || - window.oCancelRequestAnimationFrame || - window.msCancelRequestAnimationFrame || - function (callback) { window.clearTimeout(callback); }; diff --git a/src/store/modules/ibp.js b/src/store/modules/ibp.js index 2fd830319..631e77a98 100644 --- a/src/store/modules/ibp.js +++ b/src/store/modules/ibp.js @@ -12,7 +12,8 @@ const ibp = { ibpList: {}, // 数据列表 ibpIdList: {}, // 数据列表(以id为标识) updateDeviceData: {}, // 修改的数据 - rightClickCount: 0 // 右键点击设备 + rightClickCount: 0, // 右键点击设备 + ibpBgDevice: {} // ibp背景设备 }, getters: { @@ -31,6 +32,9 @@ const ibp = { }, updateDeviceData: (state) => { return state.updateDeviceData; + }, + ibpBgDevice: (state) => { + return state.ibpBgDevice; } }, @@ -47,6 +51,9 @@ const ibp = { }, deleteIbpDevices: (state, devices) => { Vue.prototype.$ibp && Vue.prototype.$ibp.render(devices); + }, + setIbpBgDevice: (state, ibpBgDevice) => { + state.ibpBgDevice = ibpBgDevice; } }, @@ -72,6 +79,9 @@ const ibp = { models = [models]; } commit('deleteIbpDevices', models); + }, + setIbpBgDevice: ( { commit }, device) => { + commit('setIbpBgDevice', device); } } }; diff --git a/src/views/components/progressBar/index.vue b/src/views/components/progressBar/index.vue index fd8ed3e2a..f03c80bd7 100644 --- a/src/views/components/progressBar/index.vue +++ b/src/views/components/progressBar/index.vue @@ -14,7 +14,7 @@ diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpLine.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpLine.vue index 9a830eedf..d6ef28d88 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpLine.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpLine.vue @@ -13,16 +13,16 @@ - + - + - + - + {{ buttonText }} diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpText.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpText.vue index 081902013..1edca8b09 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpText.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpText.vue @@ -13,7 +13,7 @@ - + diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue index f1f6cda87..778185cef 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/index.vue @@ -110,7 +110,8 @@ + diff --git a/src/views/planMonitor/editTool/menus/openRunPlan.vue b/src/views/planMonitor/editTool/menus/openRunPlan.vue index 15dac8d6b..2fda864f2 100644 --- a/src/views/planMonitor/editTool/menus/openRunPlan.vue +++ b/src/views/planMonitor/editTool/menus/openRunPlan.vue @@ -1,42 +1,49 @@