From e98b53d8ad7f88863e53ad5e55f5da6bee3193fc Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 17 Sep 2020 16:33:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4ibp=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/ningbo_03.js | 2 +- src/jmapNew/shape/Switch/ESwLocal.js | 5 +++- src/jmapNew/shape/Switch/index.js | 30 ++++++++++++++++++++---- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index 289fd99ae..22a767f1c 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -332,7 +332,7 @@ class SkinCode extends defaultStyle { spareColor: '#5b5b5b' // 区段显示颜色 }, core: { - length: 4 // 道岔单边长度 + length: 8 // 道岔单边长度 }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 diff --git a/src/jmapNew/shape/Switch/ESwLocal.js b/src/jmapNew/shape/Switch/ESwLocal.js index a5efa3275..c1efc5eb8 100644 --- a/src/jmapNew/shape/Switch/ESwLocal.js +++ b/src/jmapNew/shape/Switch/ESwLocal.js @@ -21,6 +21,8 @@ class ESwLocal extends Group { style: { fill: style.backgroundColor // fill: 'red' + // lineWidth: style.Section.line.width, + // stroke: style.backgroundColor }, cursor: model.cursor, onmouseover: model.onmouseover, @@ -47,6 +49,7 @@ class ESwLocal extends Group { setColor(color) { this.locShelter.setStyle({ fill: color }); + // this.locShelter.setStyle({ stroke: color }); } animateStyle(cb) { @@ -55,7 +58,7 @@ class ESwLocal extends Group { }); } getLocal() { - return this.locShelter; + return this.locShelter; } } diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index d17230f3a..7ed62d62d 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -1,6 +1,3 @@ -/* -* 道岔 -*/ import Group from 'zrender/src/container/Group'; import Text from 'zrender/src/graphic/Text'; import Rect from 'zrender/src/graphic/shape/Rect'; @@ -50,7 +47,7 @@ export default class Switch extends Group { const style = this.style; const switchWidth = style.Section.line.width + style.Section.line.beyondWidth * 2; // 超出宽度多少 - const swPadding = style.Switch.core.length; + const swPadding = style.Switch.core.length + style.Section.line.width / 2; const directx = this.triangle.drictx; const directy = this.triangle.dricty; const direct = -this.triangle.drictx * this.triangle.dricty; @@ -66,11 +63,33 @@ export default class Switch extends Group { const point2 = [model.intersection.x + directx * (width2 + width1) + directx * detailWidth, point1[1]]; const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding]; const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth) - directx * 2 * detailWidth, point3[1] - direct * this.triangle.getCos(switchWidth)]; + // const sectionAModel = Vue.prototype.$jlmap.mapDevice[model.sectionACode]; + // const sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); + // const sectionAPoint = { x: '', y: '' }; + // sectionAModel.points.forEach((point, sectionIndex) => { + // if (point.x == model.intersection.x && point.y == model.intersection.y) { + // sectionAPoint.x = point.x; + // sectionAPoint.y = point.y; + // this.sectionIndex = sectionIndex; + // } + // }); + // let directxA = 1; + // // const directxA = sectionATriangle.drictx; + // const drictyyA = sectionATriangle.dricty; + // if (this.sectionIndex != 0) { + // directxA = -1; + // } + // const difference = switchWidth1 * this.triangle.getCosRate(); + + // const point1 = [model.intersection.x + directx * this.triangle.getCotRate() * swPadding, model.intersection.y + directy * swPadding]; + // const point2 = [model.intersection.x, model.intersection.y]; + // const point3 = [sectionAPoint.x + directxA * (difference / sectionATriangle.getCosRate()), sectionAPoint.y + drictyyA * difference * sectionATriangle.getTanRate()]; this.locShelter = new ESwLocal({ // 定位 覆盖形状 A zlevel: this.zlevel, z: this.z, style: style, shelterPoints: [point1, point2, point3, point4], + // shelterPoints: [point1, point2, point3], cursor: 'pointer', triangle: this.triangle, onmouseover: () => { this.name.getArrowText().show(); }, @@ -291,6 +310,9 @@ export default class Switch extends Group { this.relocShelter.hide(); this.sheltertriangle.hide(); } + // this.relocShelter.show(); + // this.relocShelter.setColor('red'); + // this.locShelter.setColor('yellow'); this.setTextColor(this.style.Switch.text.locateColor); } From c2e3df8dbc4802c6dfaf2e977912578c27c0fdfc Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 17 Sep 2020 17:45:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4ibp=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 7 +++---- src/jmapNew/shape/Switch/index.js | 28 +++++++++++++--------------- src/utils/baseUrl.js | 4 ++-- src/views/ibp/ibpsystem/index.vue | 7 +------ 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 226c0b82a..6e76e9a69 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -621,11 +621,10 @@ export function getPlcGateway(group) { // }); // } -export function handlerIbpEvent(group, data) { +export function handlerIbpEvent(group, button) { return request({ - url: `/simulation/${group}/ibp/button`, - method: 'put', - data + url: `/simulation/${group}/ibp/${button}`, + method: 'put' }); } diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 7ed62d62d..c00e8f75f 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -63,27 +63,25 @@ export default class Switch extends Group { const point2 = [model.intersection.x + directx * (width2 + width1) + directx * detailWidth, point1[1]]; const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding]; const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth) - directx * 2 * detailWidth, point3[1] - direct * this.triangle.getCos(switchWidth)]; - // const sectionAModel = Vue.prototype.$jlmap.mapDevice[model.sectionACode]; - // const sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); - // const sectionAPoint = { x: '', y: '' }; - // sectionAModel.points.forEach((point, sectionIndex) => { - // if (point.x == model.intersection.x && point.y == model.intersection.y) { - // sectionAPoint.x = point.x; - // sectionAPoint.y = point.y; - // this.sectionIndex = sectionIndex; - // } - // }); // let directxA = 1; - // // const directxA = sectionATriangle.drictx; - // const drictyyA = sectionATriangle.dricty; - // if (this.sectionIndex != 0) { + // const sectionAModel = Vue.prototype.$jlmap.mapDevice[model.sectionACode]; + // let sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); + // const sectionAPoint = { x: model.intersection.x, y: model.intersection.y }; + // if (sectionAModel.points[0].x == model.intersection.x && sectionAModel.points[0].y == model.intersection.y) { + // sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); + // directxA = 1; + // } + // if (sectionAModel.points[sectionAModel.points.length - 1].x == model.intersection.x && sectionAModel.points[sectionAModel.points.length - 1].y == model.intersection.y) { + // sectionATriangle = new JTriangle(sectionAModel.points[sectionAModel.points.length - 2], sectionAModel.points[sectionAModel.points.length - 1]); // directxA = -1; // } - // const difference = switchWidth1 * this.triangle.getCosRate(); + + // const drictyyA = sectionATriangle.dricty; + // // const difference = switchWidth1 * this.triangle.getCosRate(); // const point1 = [model.intersection.x + directx * this.triangle.getCotRate() * swPadding, model.intersection.y + directy * swPadding]; // const point2 = [model.intersection.x, model.intersection.y]; - // const point3 = [sectionAPoint.x + directxA * (difference / sectionATriangle.getCosRate()), sectionAPoint.y + drictyyA * difference * sectionATriangle.getTanRate()]; + // const point3 = [sectionAPoint.x + directxA * (switchWidth1 * sectionATriangle.getCosRate()), sectionAPoint.y + drictyyA * switchWidth1 * sectionATriangle.getSinRate()]; this.locShelter = new ESwLocal({ // 定位 覆盖形状 A zlevel: this.zlevel, z: this.z, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 836771751..778caeb7b 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://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 diff --git a/src/views/ibp/ibpsystem/index.vue b/src/views/ibp/ibpsystem/index.vue index 65d076164..e9d16c2b4 100644 --- a/src/views/ibp/ibpsystem/index.vue +++ b/src/views/ibp/ibpsystem/index.vue @@ -191,15 +191,10 @@ export default { onMouseDown(em) { if (em.deviceModel.mean) { if (IbpOperation[em.deviceModel.mean]) { - handlerIbpEvent(this.$route.query.group, {button: IbpOperation[em.deviceModel.mean].event, stationCode: this.stationCode}); + handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event); } } }, - openScreenDoor(flag, buttonOperate) { - if (flag) { - handlerIbpEvent(this.$route.query.group, {button: buttonOperate, stationCode: this.stationCode}); - } - }, // 右键点击事件 onContextMenu(em) { this.$store.dispatch('ibp/setUpdateDeviceData', em.eventTarget.model);