diff --git a/src/api/competition.js b/src/api/competition.js index d3ef12405..da57c2d90 100644 --- a/src/api/competition.js +++ b/src/api/competition.js @@ -239,4 +239,19 @@ export function getTheroyCompetitionResult(competitionId, raceUserId) { method: 'get' }); } - +/** 项目获取试题列表 */ +export function getItemListByProjectCode(projectCode, params) { + return request({ + url: `api/v1/competitionTheory/project/${projectCode}`, + method: 'get', + params + }); +} +/** 项目提交试卷 */ +export function commitProjectTestPaper(projectCode, data, mode) { + return request({ + url: `api/v1/competitionTheory/project/${projectCode}/submit?mode=${mode}`, + method: 'post', + data + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 226c0b82a..3deeccc2b 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, stationCode) { return request({ - url: `/simulation/${group}/ibp/button`, - method: 'put', - data + url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}`, + method: 'put' }); } @@ -815,3 +814,10 @@ export function putSimulationDisconnectById(group, id) { method: 'put' }); } +// 获取IBP盘初始状态 +export function getIbpInitialState (group, stationCode) { + return request({ + url: `/simulation/${group}/${stationCode}/ibp/status`, + method: 'get' + }); +} diff --git a/src/assets/buzzer.mp3 b/src/assets/buzzer.mp3 new file mode 100644 index 000000000..b342d6ff6 Binary files /dev/null and b/src/assets/buzzer.mp3 differ diff --git a/src/ibp/ibpPan.js b/src/ibp/ibpPan.js index dbf19af1c..7f348b971 100644 --- a/src/ibp/ibpPan.js +++ b/src/ibp/ibpPan.js @@ -140,8 +140,8 @@ class IbpPan { this.$painter.delete(oDevice); if (!elem._dispose) { // this.ibpDevice[code] = nDevice; - this.mapDevice[code] = deepAssign(this.mapDevice[code] || {}, nDevice); - this.$painter.add(this.mapDevice[code]); + this.ibpDevice[code] = deepAssign(this.ibpDevice[code] || {}, nDevice); + this.$painter.add(this.ibpDevice[code]); } }); if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } @@ -189,16 +189,17 @@ class IbpPan { const oDevcie = this.ibpDevice[code].instance; oDevcie.setStatus(model); } - setDeviceStatus(list) { + setDeviceStatus(val) { const deviceList = Object.values(this.ibpDevice); deviceList.forEach(elem =>{ - (list || []).forEach(it =>{ - if (elem.model.linkDevice === it.code) { - elem.instance.setStatus(it); + for (var key in val) { + if (elem.model.mean === key) { + const state = {}; + state[key] = val[key]; + elem.instance.setStatus(state); } - }); + } }); - } drawIbpInit() { this.$mouseController.setAllowDragging(true); diff --git a/src/ibp/shape/circularLamp.js b/src/ibp/shape/circularLamp.js index 2f63d8c9a..66c528b69 100644 --- a/src/ibp/shape/circularLamp.js +++ b/src/ibp/shape/circularLamp.js @@ -40,8 +40,8 @@ export default class CircularLamp extends Group { setCircularLampColor(color) { this.lamp.setStyle({fill: color}); } - setStatus(model) { - if (this.mean && this.mean.statusValue.includes(model[this.mean.statusKey])) { + setStatus(state) { + if (state.xxkcLight || state.sxkcLight || state.jjtcLight || state.xxgmLight || state.xxkmLight || state.sxgmLight || state.sxkmLight ) { this.setCircularLampColor('#D8FCF2'); } else { this.setCircularLampColor('#332C22'); diff --git a/src/ibp/shape/clock.js b/src/ibp/shape/clock.js index b2748edb3..259f9727e 100644 --- a/src/ibp/shape/clock.js +++ b/src/ibp/shape/clock.js @@ -188,12 +188,10 @@ export default class clock extends Group { } } handleClock(_this) { - _this.initTime += 1000; - const newDate = new Date(); - newDate.setTime(_this.initTime); - let seconds = newDate.getSeconds() + ''; - let minutes = newDate.getMinutes() + ''; - let hours = newDate.getHours() + ''; + _this.initTime += 1; + let seconds = this.initTime % 60 + ''; + let minutes = Math.floor(this.initTime / 60) % 60 + ''; + let hours = Math.floor(this.initTime / 3600) + ''; if (seconds.length < 2) { seconds = '0' + seconds; } @@ -233,11 +231,9 @@ export default class clock extends Group { } setClockTime(initTime) { this.initTime = initTime; - const newDate = new Date(); - newDate.setTime(initTime); - let seconds = newDate.getSeconds() + ''; - let minutes = newDate.getMinutes() + ''; - let hours = newDate.getHours() + ''; + let seconds = this.initTime % 60 + ''; + let minutes = Math.floor(this.initTime / 60) % 60 + ''; + let hours = Math.floor(this.initTime / 3600) + ''; if (seconds.length < 2) { seconds = '0' + seconds; } @@ -253,6 +249,7 @@ export default class clock extends Group { this.setNumPic(3, minutes.charAt(0)); this.setNumPic(2, hours.charAt(1)); this.setNumPic(1, hours.charAt(0)); + this.setClockStart(true); } setModel(dx, dy) { this.model.point.x += dx; diff --git a/src/ibp/shape/key.js b/src/ibp/shape/key.js index f7303380a..a3b86bdb7 100644 --- a/src/ibp/shape/key.js +++ b/src/ibp/shape/key.js @@ -163,19 +163,12 @@ export default class key extends Group { } } setStatus(model) { - switch (model.status) { - case 'on': { - // 开放 + if (model.xxys || model.sxys) { this.keyImage.setStyle({image: keyPicOn}); this.model.status = 'on'; - break; - } - case 'off': { - // 关闭 + } else { this.keyImage.setStyle({image: keyPic}); this.model.status = 'off'; - break; - } } } setModel(dx, dy) { diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index e3c9c1ffa..815d588bd 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -296,9 +296,22 @@ deviceRender[deviceType.IscsImage] = { zlevel: 1, z: 5 }; +// 福州iscs扇门 deviceRender[deviceType.OrdinaryDoor] = { _type: deviceType.OrdinaryDoor, zlevel: 1, z: 4 }; +// 福州门禁 +deviceRender[deviceType.FuzhouDoor] = { + _type: deviceType.FuzhouDoor, + zlevel: 1, + z: 4 +}; +// 福州通讯图符 +deviceRender[deviceType.CommunicationButcher] = { + _type: deviceType.CommunicationButcher, + zlevel: 1, + z: 4 +}; export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index 848be06aa..b4295db21 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -46,7 +46,9 @@ const deviceType = { Elevator: 'Elevator', Draught: 'Draught', IscsImage: 'IscsImage', - OrdinaryDoor: 'ordinaryDoor' + OrdinaryDoor: 'OrdinaryDoor', + FuzhouDoor: 'FuzhouDoor', + CommunicationButcher: 'CommunicationButcher' }; export default deviceType; diff --git a/src/iscs/shape/communicationButcher.js b/src/iscs/shape/communicationButcher.js new file mode 100644 index 000000000..c3cdf93b4 --- /dev/null +++ b/src/iscs/shape/communicationButcher.js @@ -0,0 +1,218 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; +import Line from 'zrender/src/graphic/shape/Line'; + +export default class CommunicationButcher extends Group { + constructor(device) { + super(); + this.model = device.model; + this.zlevel = device.model.zlevel; + this.z = device.model.z; + this._type = device.model._type; + this._code = device.model.code; + this.create(); + this.setState(this.model); + } + create() { + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.add(this.grouper); + this.rect1 = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 0, + y: 0, + width: this.model.width, + height: this.model.width * 5 / 12 + }, + style: { + fill: '#0F0', + stroke: '#000', + lineWidth: 2 + } + }); + this.rect2 = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width / 30, + y: this.model.width * 5 / 12, + width: this.model.width - this.model.width / 15, + height: this.model.width / 30 + }, + style: { + fill: '#000' + } + }); + this.rect3 = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width / 4 * 3, + y: this.model.width / 8, + width: this.model.width / 7, + height: this.model.width / 12 + }, + style: { + fill: 'rgba(0,0,0,0)', + lineWidth: 1, + stroke: '#000' + } + }); + this.line1 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: 0, + x2: this.model.width * 7 / 24, + y2: this.model.width * 5 / 12 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line2 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 12, + y1: 0, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 12 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line3 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 5 / 84, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 84 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line4 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 5 / 42, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 42 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line5 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 5 / 28, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 28 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line6 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 5 / 21, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 21 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line7 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 25 / 84, + x2: this.model.width * 7 / 12, + y2: this.model.width * 25 / 84 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line8 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 7 / 24, + y1: this.model.width * 5 / 14, + x2: this.model.width * 7 / 12, + y2: this.model.width * 5 / 14 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.line9 = new Line({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + x1: this.model.width * 3 / 4, + y1: this.model.width / 6, + x2: this.model.width * 25 / 28, + y2: this.model.width / 6 + }, + style: { + stroke: '#000', + lineWidth: 1 + } + }); + this.grouper.add(this.rect1); + this.grouper.add(this.rect2); + this.grouper.add(this.rect3); + this.grouper.add(this.line1); + this.grouper.add(this.line2); + this.grouper.add(this.line3); + this.grouper.add(this.line4); + this.grouper.add(this.line5); + this.grouper.add(this.line6); + this.grouper.add(this.line7); + this.grouper.add(this.line8); + this.grouper.add(this.line9); + this.add(this.grouper); + } + setState(model) { + if (model.state === 'normal') { + this.rect1.setStyle({fill: '#0F0'}); + } else if (model.state === 'fault') { + this.rect1.setStyle({fill: '#F00'}); + } else if (model.state === 'unknow') { + this.rect1.setStyle({fill: '#00F'}); + } + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index 5284ca043..94ddc2a70 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -47,6 +47,8 @@ import Elevator from './bas/elevator'; import Draught from './bas/draught'; import IscsImage from './iscsImage'; import OrdinaryDoor from './ordinaryDoor'; +import FuzhouDoor from './fuzhouDoor'; +import CommunicationButcher from './communicationButcher'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -98,6 +100,8 @@ iscsShape[deviceType.Elevator] = Elevator; iscsShape[deviceType.Draught] = Draught; iscsShape[deviceType.IscsImage] = IscsImage; iscsShape[deviceType.OrdinaryDoor] = OrdinaryDoor; +iscsShape[deviceType.FuzhouDoor] = FuzhouDoor; +iscsShape[deviceType.CommunicationButcher] = CommunicationButcher; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/iscs/shape/fuzhouDoor.js b/src/iscs/shape/fuzhouDoor.js new file mode 100644 index 000000000..7d88dd100 --- /dev/null +++ b/src/iscs/shape/fuzhouDoor.js @@ -0,0 +1,138 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; +import Polygon from 'zrender/src/graphic/shape/Polygon'; + +export default class fuzhouDoor extends Group { + constructor(device) { + super(); + this.model = device.model; + this.zlevel = device.model.zlevel; + this.z = device.model.z; + this._type = device.model._type; + this._code = device.model.code; + this.create(); + this.setState(this.model); + } + create() { + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.door = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 0, + y: 0, + width: this.model.width, + height: this.model.width * 25 / 16 + }, + style: { + fill: '#33CC00', + stroke: '#000', + lineWidth: 2 + } + }); + this.doorWindow = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width * 2 / 17, + y: this.model.width * 6 / 17, + width: this.model.width * 13 / 17, + height: this.model.width * 4 / 17 + }, + style: { + fill: '#000' + } + }); + this.doorknob = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width * 12 / 17, + y: this.model.width * 20 / 17, + width: this.model.width / 9, + height: this.model.width / 9 + }, + style: { + fill: '#000' + } + }); + this.polygon1 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + points:[ + [0, 0], + [this.model.width * 3 / 4, this.model.width * 7 / 24], + [this.model.width * 3 / 4, this.model.width * 7 / 4], + [0, this.model.width * 25 / 16] + ] + }, + style: { + fill: '#0F0', + stroke: '#000', + lineWidth: 2 + } + }); + this.polygon2 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 2, + shape: { + points: [ + [this.model.width / 8, this.model.width / 4], + [this.model.width * 5 / 8, this.model.width * 5 / 12], + [this.model.width * 5 / 8, this.model.width * 3 / 4], + [this.model.width / 8, this.model.width * 7 / 12] + ] + }, + style: { + fill: '#000' + } + }); + this.polygon3 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 2, + shape: { + points: [ + [this.model.width * 5 / 12, this.model.width * 55 / 48], + [this.model.width * 14 / 24, this.model.width * 29 / 24], + [this.model.width * 14 / 24, this.model.width * 21 / 16], + [this.model.width * 5 / 12, this.model.width * 5 / 4] + ] + }, + style: { + fill: '#000' + } + }); + this.doorWindow.hide(); + this.doorknob.hide(); + this.polygon1.hide(); + this.polygon2.hide(); + this.polygon3.hide(); + this.grouper.add(this.door); + this.grouper.add(this.doorWindow); + this.grouper.add(this.doorknob); + this.grouper.add(this.polygon1); + this.grouper.add(this.polygon2); + this.grouper.add(this.polygon3); + this.add(this.grouper); + } + setState(model) { + if (model.doorOpen) { + this.door.setStyle({fill: '#D3D0C9'}); + this.polygon1.show(); + this.polygon2.show(); + this.polygon3.show(); + } else { + this.door.setStyle({fill: '#0F0'}); + this.doorWindow.show(); + this.doorknob.show(); + } + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/iscs/shape/ordinaryDoor.js b/src/iscs/shape/ordinaryDoor.js index b5566eb5a..e942e4358 100644 --- a/src/iscs/shape/ordinaryDoor.js +++ b/src/iscs/shape/ordinaryDoor.js @@ -22,11 +22,11 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - cx: this.model.point.x, - cy: this.model.point.y - this.model.r, + cx: 0, + cy: this.model.r, r: this.model.r, - startAngle: Math.PI / 2, - endAngle: Math.PI + startAngle: Math.PI / 2 * 3, + endAngle: 2 * Math.PI }, style: { fill: 'rgba(0, 0, 0, 0)', @@ -34,6 +34,7 @@ export default class OrdinaryDoor extends Group { lineWidth: 1 } }); + this.grouper.add(this.sector1); if (this.model.doorType === '1') { this.createLine(this.model.r); } else if (this.model.doorType === '2') { @@ -47,17 +48,20 @@ export default class OrdinaryDoor extends Group { this.createRect(this.model.r * 2); this.createLine(this.model.r * 2); } + this.grouper.origin = [0, 0]; + this.grouper.rotation = Math.PI / 180 * (this.model.rotationAngle || 0); + this.add(this.grouper); } createSector2() { this.sector2 = new Sector({ zlevel: this.zlevel, z: this.z, shape: { - cx: this.model.point.x + this.model.r * 2, - cy: this.model.point.y, + cx: this.model.r * 2, + cy: this.model.r, r: this.model.r, - startAngle: 0, - endAngle: Math.PI / 2 + startAngle: Math.PI, + endAngle: Math.PI / 2 * 3 }, style: { fill: 'rgba(0,0,0,0)', @@ -72,10 +76,10 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - x1: this.model.point.x, - y1: this.model.point.y - this.model.r, - x2: this.model.point.x + length, - y2: this.model.point.y - this.model.r + x1: 1, + y1: this.model.r, + x2: length - 1, + y2: this.model.r }, style: { stroke: '#45607B', @@ -89,8 +93,8 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - x: this.model.point.x, - y: this.model.point.y - this.model.r, + x: 0, + y: this.model.r, width: length, height: this.model.r }, @@ -102,4 +106,8 @@ export default class OrdinaryDoor extends Group { }); this.grouper.add(this.bottomRect); } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } } diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 9cf3fce92..e0addcbe7 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -187,6 +187,12 @@ export function parser(data) { zrUtil.each(data.ordinaryDoorList || [], elem => { iscsDevice[elem.code] = deviceFactory(deviceType.OrdinaryDoor, elem); }); + zrUtil.each(data.fuzhoudoorList || [], elem => { + iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouDoor, elem); + }); + zrUtil.each(data.communicationButcherList || [], elem => { + iscsDevice[elem.code] = deviceFactory(deviceType.CommunicationButcher, elem); + }); } return iscsDevice; diff --git a/src/jlmap3d/edit/testEditorModel/SectionList.js b/src/jlmap3d/edit/testEditorModel/SectionList.js index ca5153584..d2e6e56b7 100644 --- a/src/jlmap3d/edit/testEditorModel/SectionList.js +++ b/src/jlmap3d/edit/testEditorModel/SectionList.js @@ -986,23 +986,26 @@ export function SectionList() { } - + console.log(scope.sections.datalist); for(let i=0;i=trainmodel.children[rs].rotalist[0].posr.x){ @@ -547,7 +555,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri } //let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12]; - trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota; + trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz; + trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty; trainmodel.children[rs].rotalist.splice(0,1) xh--; }else{ @@ -565,7 +574,12 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri }else{ // - if(trainmodel.children[0].position.z < pos.z){ + let rotas = { + posr:null, + roty:null, + rotz:null, + }; + if(trainmodel.children[0].position.z < pos.z ){ trainmodel.children[0].up = new THREE.Vector3(-1,0,0); let tangent = trainmodel.curve.getTangentAt(data.offset).normalize(); trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize(); @@ -574,12 +588,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri trainmodel.children[0].rotation.x = -Math.PI/2; trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y; trainmodel.children[0].rotation.y = 0; - let rotas = { - posr:pos, - rota:trainmodel.children[0].rotation.z - } - trainmodel.children[1].rotalist.push(rotas); + rotas.posr = pos; + // rotas.roty = trainmodel.children[0].rotation.y; + rotas.rotz = trainmodel.children[0].rotation.z; let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z); trainmodel.children[0].position.z += offsetz; @@ -592,26 +604,56 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri trainmodel.children[0].rotation.x = -Math.PI/2; trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y; trainmodel.children[0].rotation.y = 0; - let rotas = { - posr:pos, - rota:trainmodel.children[0].rotation.z - } - trainmodel.children[1].rotalist.push(rotas); + rotas.posr = pos; + // rotas.roty = trainmodel.children[0].rotation.y; + rotas.rotz = trainmodel.children[0].rotation.z; let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z); trainmodel.children[0].position.z += offsetz; } + if(trainmodel.children[0].position.y != pos.y){ + if(rotas.posr == null){ + trainmodel.children[0].up = new THREE.Vector3(-1,0,0); + let tangent = trainmodel.curve.getTangentAt(data.offset).normalize(); + trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize(); + let radians = Math.acos(trainmodel.children[0].up.dot(tangent)); + trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians); + trainmodel.children[0].rotation.x = -Math.PI/2; + trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y; + trainmodel.children[0].rotation.y = 0; + + rotas.posr = pos; + rotas.roty = trainmodel.children[0].rotation.y; + rotas.rotz = trainmodel.children[0].rotation.z; + + let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z); + trainmodel.children[0].position.z += offsetz; + let offsety = parseFloat(pos.y) - parseFloat(trainmodel.children[0].position.y); + trainmodel.children[0].position.y += offsety; + }else{ + rotas.roty = trainmodel.children[0].rotation.y; + let offsety = parseFloat(rotas.posr.y) - parseFloat(trainmodel.children[0].position.y); + trainmodel.children[0].position.y += offsety; + } + } + + if(rotas.posr!= null){ + trainmodel.children[1].rotalist.push(rotas); + } + if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){ for(let rs = 1;rs<6;rs++){ //console.log(rs); if(trainmodel.children[rs].rotalist[0]){ let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]); - trainmodel.children[rs].position.z += offsetz; + let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].matrixWorld.elements[13]); + trainmodel.children[rs].position.y += offsety; + for(let xh=0;xh 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){ for(let rs = 1;rs<6;rs++){ @@ -299,8 +299,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) { if(trainlisttest.list[code].children[rs].rotalist[0]){ let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]); trainlisttest.list[code].children[rs].position.z += offsetz; - // let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]); - // trainlisttest.list[code].children[rs].position.y += offsety; + let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]); + trainlisttest.list[code].children[rs].position.y += offsety; for(let xh=0;xh=trainlisttest.list[code].children[rs].rotalist[0].posr.x){ @@ -316,7 +316,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) { } trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz; - // trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty; + trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty; trainlisttest.list[code].children[rs].rotalist.splice(0,1) xh--; }else{ @@ -369,7 +369,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) { let newRotationZ = trainlisttest.list[code].children[0].rotation.z; trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y; trainlisttest.list[code].children[0].rotation.y = 0; - // trainlisttest.list[code].children[0].rotation.y = -newRotationZ; + trainlisttest.list[code].children[0].rotation.y = -newRotationZ; let rotas = { posr:point, @@ -379,8 +379,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) { trainlisttest.list[code].children[1].rotalist.push(rotas); let offsetz = point.z + trainlisttest.list[code].children[0].position.z; trainlisttest.list[code].children[0].position.z -= offsetz; - // let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y); - // trainlisttest.list[code].children[0].position.y += offsety; + let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y); + trainlisttest.list[code].children[0].position.y += offsety; // trainlisttest.list[code].position.z = point.z; } @@ -392,8 +392,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) { let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z); trainlisttest.list[code].children[rs].position.z -= offsetz; - // let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]); - // trainlisttest.list[code].children[rs].position.y += offsety; + let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]); + trainlisttest.list[code].children[rs].position.y += offsety; for(let xh=0;xh { - if (child.setStyle) { - child.setStyle(styles); - } - }); - } - -} - -export default ERhomboid; diff --git a/src/jmapNew/shape/Switch/ESwLnversion.js b/src/jmapNew/shape/Switch/ESwLnversion.js index 6a1d054b1..a4e128003 100644 --- a/src/jmapNew/shape/Switch/ESwLnversion.js +++ b/src/jmapNew/shape/Switch/ESwLnversion.js @@ -1,5 +1,5 @@ import Group from 'zrender/src/container/Group'; -import Polygon from 'zrender/src/graphic/shape/Polygon'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; class ESwLnversion extends Group { constructor(model) { @@ -11,15 +11,17 @@ class ESwLnversion extends Group { create() { const model = this.model; const style = this.model.style; - this.relocShelter = new Polygon({ // 遮盖B区段范围 + this.relocShelter = new Polyline({ // 遮盖B区段范围 zlevel: model.zlevel, - z: model.z, + z: model.z + 4, shape: { points: model.shelterPoints }, style: { - fill: style.backgroundColor + // fill: style.backgroundColor // fill: 'yellow' + lineWidth: style.Section.line.width, + stroke: style.backgroundColor }, cursor: model.cursor, onmouseover: model.onmouseover, @@ -31,7 +33,7 @@ class ESwLnversion extends Group { hide() { this.relocShelter.hide(); - this.relocShelter.setStyle({ fill: this.model.style.backgroundColor }); + this.relocShelter.setStyle({ stroke: this.model.style.backgroundColor }); this.stopAnimation(false); } @@ -40,7 +42,12 @@ class ESwLnversion extends Group { } setColor(color) { - this.relocShelter.setStyle({ fill: color }); + // this.relocShelter.setStyle({ fill: color }); + this.relocShelter.setStyle({ stroke: color }); + } + + setStyle(data) { + this.relocShelter.setStyle(data); } stopAnimation(flag) { diff --git a/src/jmapNew/shape/Switch/ESwLocal.js b/src/jmapNew/shape/Switch/ESwLocal.js index a5efa3275..d7e47b717 100644 --- a/src/jmapNew/shape/Switch/ESwLocal.js +++ b/src/jmapNew/shape/Switch/ESwLocal.js @@ -1,5 +1,5 @@ import Group from 'zrender/src/container/Group'; -import Polygon from 'zrender/src/graphic/shape/Polygon'; +import Polyline from 'zrender/src/graphic/shape/Polyline'; class ESwLocal extends Group { constructor(model) { @@ -12,15 +12,17 @@ class ESwLocal extends Group { const model = this.model; const style = this.model.style; - this.locShelter = new Polygon({ + this.locShelter = new Polyline({ zlevel: model.zlevel, - z: model.z, + z: model.z + 5, shape: { points: model.shelterPoints }, style: { - fill: style.backgroundColor + // fill: style.backgroundColor, // fill: 'red' + lineWidth: style.Section.line.width, + stroke: style.backgroundColor }, cursor: model.cursor, onmouseover: model.onmouseover, @@ -33,7 +35,7 @@ class ESwLocal extends Group { hide() { this.locShelter.hide(); - this.locShelter.setStyle({ fill: this.model.style.backgroundColor }); + this.locShelter.setStyle({ stroke: this.model.style.backgroundColor }); this.stopAnimation(false); } @@ -46,7 +48,12 @@ class ESwLocal extends Group { } setColor(color) { - this.locShelter.setStyle({ fill: color }); + // this.locShelter.setStyle({ fill: color }); + this.locShelter.setStyle({ stroke: color }); + } + + setStyle(data) { + this.locShelter.setStyle(data); } animateStyle(cb) { @@ -55,7 +62,7 @@ class ESwLocal extends Group { }); } getLocal() { - return this.locShelter; + return this.locShelter; } } diff --git a/src/jmapNew/shape/Switch/ETriangle.js b/src/jmapNew/shape/Switch/ETriangle.js index 7851946d3..2a8fdd53d 100644 --- a/src/jmapNew/shape/Switch/ETriangle.js +++ b/src/jmapNew/shape/Switch/ETriangle.js @@ -13,14 +13,14 @@ class ETriangle extends Group { const style = this.model.style; this.section = new Polyline({ // 平行四边形 zlevel: model.zlevel, - z: model.z + 1, + z: model.z + 3, shape: { points: model.sectionPoints }, style: { - fill: style.Section.line.spareColor, + // fill: style.Section.line.spareColor, // fill: 'red', - lineWidth: 0, + lineWidth: style.Section.line.width, stroke: style.Section.line.spareColor }, cursor: model.cursor, @@ -41,7 +41,11 @@ class ETriangle extends Group { } setColor(color) { - this.section.setStyle({ fill: color }); + this.section.setStyle({ stroke: color }); + } + + attr(data) { + this.section.attr(data); } stopAnimation(flag) { diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index d17230f3a..be7eebb1c 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'; @@ -12,7 +9,6 @@ import ELockRect from './ELockRect'; import ELockArc from './ELockArc'; import EMouse from './EMouse'; import EHighlight from '../element/EHighlight'; -// import ERhomboid from './ERhomboid'; import ETriangle from './ETriangle'; import store from '@/store/index_APP_TARGET'; import Vue from 'vue'; @@ -49,63 +45,58 @@ export default class Switch extends Group { const model = this.model; 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; - const switchWidth1 = style.Section.line.width / 2; - const width1 = switchWidth1 * this.triangle.getSinRate(); - const height1 = switchWidth1 * this.triangle.getCosRate(); - const width2 = (height1 + switchWidth1) / this.triangle.getTanRate(); - const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1; - const detailWidth = 0.2; // 调整定位模糊宽度 - const point1 = [model.intersection.x - directx * width3 - directx * detailWidth, model.intersection.y + directy * switchWidth1]; - 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)]; - this.locShelter = new ESwLocal({ // 定位 覆盖形状 A + let directxA = 1; + const sectionAModel = Vue.prototype.$jlmap.mapDevice[model.sectionACode]; + const sectionBModel = Vue.prototype.$jlmap.mapDevice[model.sectionBCode]; + let sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); + let sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.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]); + sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.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]); + sectionBTriangle = new JTriangle(sectionBModel.points[sectionBModel.points.length - 2], sectionBModel.points[sectionBModel.points.length - 1]); + directxA = -1; + } + const drictyyA = sectionATriangle.dricty; + 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 * (switchWidth1 * sectionATriangle.getCosRate()), sectionAPoint.y + drictyyA * switchWidth1 * sectionATriangle.getSinRate()]; + this.shapeModelA = 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(); }, onmouseout: () => { this.name.getArrowText().hide(); } }); - const rpoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1]; - const rpoint2 = [rpoint1[0] + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1]; - const rpoint3 = [rpoint2[0] + directx * 10, rpoint2[1]]; - const rpoint4 = [rpoint2[0] + directx * 10, rpoint1[1]]; - this.relocShelter = new ESwLnversion({ // 反位覆盖形状 B + const relocShelterLength = 15; + const rpoint1 = [sectionAPoint.x - directxA * (relocShelterLength * sectionBTriangle.getCosRate()), sectionAPoint.y - drictyyA * relocShelterLength * sectionBTriangle.getSinRate()]; + const rpoint2 = [sectionAPoint.x, sectionAPoint.y]; + const rpoint3 = [sectionAPoint.x + directxA * (switchWidth1 * sectionATriangle.getCosRate()), sectionAPoint.y + drictyyA * switchWidth1 * sectionATriangle.getSinRate()]; + this.shapeModelB = new ESwLnversion({ // 形状 B 层级居中 定位折线覆盖 zlevel: this.zlevel, z: this.z, style: style, - shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4], + shelterPoints: [rpoint1, rpoint2, rpoint3], cursor: 'pointer', onmouseover: () => { this.name.getArrowText().show(); }, onmouseout: () => { this.name.getArrowText().hide(); } }); - // const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1]; - // const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]]; - // const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1]; - // const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]]; - // this.rhomboid = new ERhomboid({ // 岔芯 平行四边形 佛山线路专用 - // zlevel: this.zlevel, - // z: this.z, - // style: style, - // sectionPoints: [spoint1, spoint2, spoint3, spoint4], - // cursor: 'pointer', - // onmouseover: () => { this.name.getArrowText().show(); }, - // onmouseout: () => { this.name.getArrowText().hide(); } - // }); if (this.style.Switch.text.lossRect) { // 道岔失表显示红色矩形框 - const lossRect = this.locShelter.getLocal().getBoundingRect(); + const lossRect = this.shapeModelA.getLocal().getBoundingRect(); this.lossShow = new Rect({ zlevel: this.zlevel, z: this.z + 1, @@ -125,16 +116,14 @@ export default class Switch extends Group { this.add(this.lossShow); this.lossShow.hide(); } - const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1]; - const Tspoint2 = [model.intersection.x - directx * width3, Tspoint1[1]]; - const Tspoint3 = [model.intersection.x - directx * width3, model.intersection.y - directy * switchWidth1]; - const Tspoint4 = [model.intersection.x + directx * width3, Tspoint3[1]]; - const Tspoint5 = [Tspoint1[0], Tspoint1[1]]; - this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 C + + const Tspoint1 = [model.intersection.x + directx * this.triangle.getCotRate() * swPadding, model.intersection.y + directy * swPadding]; + const Tspoint2 = [model.intersection.x, model.intersection.y]; + this.shapeModelC = new ETriangle({ // 形状 C 层级最低 应用佛山反位覆盖 zlevel: this.zlevel, z: this.z, style: style, - sectionPoints: [Tspoint1, Tspoint2, Tspoint3, Tspoint4, Tspoint5], + sectionPoints: [Tspoint1, Tspoint2], cursor: 'pointer', onmouseover: () => { this.name.getArrowText().show(); }, onmouseout: () => { this.name.getArrowText().hide(); } @@ -174,10 +163,9 @@ export default class Switch extends Group { } }); - this.add(this.locShelter); - this.add(this.relocShelter); - // this.add(this.rhomboid); - this.add(this.sheltertriangle); + this.add(this.shapeModelA); + this.add(this.shapeModelB); + this.add(this.shapeModelC); this.add(this.name); this.add(this.enabledName); style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide(); @@ -264,32 +252,33 @@ export default class Switch extends Group { this.lockRect.hide(); // 矩形包围框 this.lockArc.hide(); // 圆形单锁框 this.name.getNameText().stopAnimation(false); - this.sheltertriangle.hide(); // 直角梯形覆盖图形 - this.sheltertriangle.setColor(this.style.Section.line.spareColor); - this.sheltertriangle.stopAnimation(false); + this.shapeModelC.hide(); // 形状 C + this.shapeModelA.hide(); // 形状 A + this.shapeModelB.hide(); // 形状 B this.setHasTextBorder(0); - this.locShelter.hide(); // 定位覆盖图形 - this.relocShelter.hide(); // 反位覆盖图形 - this.enabledName.hide(); // 使能隐藏 + this.shapeModelC.attr({ + z: this.z + 3 + }); + this.enabledName && this.enabledName.hide(); // 使能隐藏 this.lossShow && this.lossShow.hide(); // 道岔失去矩形 this.lossShow && this.lossShow.stopAnimation(false); } /** 定位*/ setLocationAction() { - if (this.style.Switch.core.splice) { - this.locShelter.hide(); + if (this.style.Switch.core.splice) { // 哈尔滨线路 + this.shapeModelB.hide(); + this.shapeModelC.hide(); } else { - this.locShelter.show(); + this.shapeModelB.show(); + this.shapeModelB.setColor(this.style.Section.line.spareColor); + this.shapeModelC.show(); } if (this.style.Switch.core.graphShow) { // 佛山线路显示 - this.relocShelter.show(); - this.sheltertriangle.show(); - this.relocShelter.setColor('#00FF00'); - this.sheltertriangle.setColor('#00FF00'); - } else { - this.relocShelter.hide(); - this.sheltertriangle.hide(); + this.shapeModelB.show(); + this.shapeModelB.setColor('#00FF00'); + this.shapeModelC.show(); + this.shapeModelC.setColor(this.style.backgroundColor); } this.setTextColor(this.style.Switch.text.locateColor); } @@ -298,26 +287,28 @@ export default class Switch extends Group { setInversionAction() { this.setTextColor(this.style.Switch.text.inversionColor); if (this.style.Switch.core.splice) { - this.relocShelter.hide(); + // this.shapeModelA.show(); + // this.shapeModelA.setColor(this.style.Section.line.spareColor); } else { - this.relocShelter.show(); // 反位 + this.shapeModelB.show(); } - this.locShelter.hide(); // 定位 - this.sheltertriangle.hide(); + this.shapeModelA.show(); + this.shapeModelA.setColor(this.style.Section.line.spareColor); if (this.style.Switch.core.graphShow) { // 佛山线路显示 - this.locShelter.show(); - this.locShelter.setColor('#FFFF00'); - this.sheltertriangle.show(); - this.sheltertriangle.setColor('#FFFF00'); + this.shapeModelC.show(); + this.shapeModelC.setColor('#FFFF00'); + this.shapeModelC.attr({ + z: this.z + 6 + }); } } /** 失去*/ setLossAction() { - this.locShelter.show(); - this.relocShelter.show(); - this.sheltertriangle.show(); - this.sheltertriangle.setColor(this.style.backgroundColor); + this.shapeModelA.show(); + this.shapeModelB.show(); + this.shapeModelC.show(); + this.shapeModelC.setColor(this.style.backgroundColor); this.setTextColor(this.style.Switch.text.lossColor); this.style.Switch.text.faultFlashing && this.nameTextAnimation(); @@ -329,8 +320,8 @@ export default class Switch extends Group { .start(); } setSwitchFault(split) { - if (this.style.Switch.jointImg.faultStatus && split) { - this.setForkAction(); // 道岔挤岔 宁波线失表状态 + if (this.style.Switch.jointImg.faultStatus && split) { // 宁波线失表状态 + this.setForkAction(); // 道岔挤岔 } else { if (this.model.switchFaultCode && split) { const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode); @@ -345,28 +336,28 @@ export default class Switch extends Group { setForkAction() { if (this.style.Switch.jointImg.fork) { this.recover(); - this.relocShelter.show(); - this.relocShelter.animateStyle(item => { + this.shapeModelB.show(); + this.shapeModelB.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: 'red' }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: 'red' }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); - this.sheltertriangle.show(); // 宁波线路挤叉特殊显示 - this.sheltertriangle.animateStyle(item => { + this.shapeModelC.show(); // 宁波线路挤叉特殊显示 + this.shapeModelC.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: 'red' }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: 'red' }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); - this.locShelter.show(); - this.locShelter.animateStyle(item => { + this.shapeModelA.show(); + this.shapeModelA.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: 'red' }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: 'red' }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); this.setTextColor('red'); @@ -395,28 +386,28 @@ export default class Switch extends Group { /** 封锁 */ block() { if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示 - this.relocShelter.show(); - this.relocShelter.animateStyle(item => { + this.shapeModelB.show(); + this.shapeModelB.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: this.style.Switch.jointImg.flashingColors }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); - this.sheltertriangle.show(); - this.sheltertriangle.animateStyle(item => { + this.shapeModelC.show(); + this.shapeModelC.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: this.style.Switch.jointImg.flashingColors }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); - this.locShelter.show(); - this.locShelter.animateStyle(item => { + this.shapeModelA.show(); + this.shapeModelA.animateStyle(item => { item.animateStyle(true) - .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) - .when(2000, { fill: this.style.backgroundColor }) + .when(0, { stroke: this.style.backgroundColor }) + .when(1000, { stroke: this.style.Switch.jointImg.flashingColors }) + .when(2000, { stroke: this.style.backgroundColor }) .start(); }); } @@ -427,8 +418,8 @@ export default class Switch extends Group { this.setTextColor(this.style.Switch.text.blockText); } if (this.style.Switch.jointImg.trapezoidBlock && this.model.reversePosition) { // 范围且封锁时显示 - this.sheltertriangle.show(); - this.sheltertriangle.getSection().setStyle('fill', '#000080'); + this.shapeModelC.show(); + this.shapeModelC.getSection().setStyle('fill', '#000080'); } if (this.style.Switch.rectLock.block) { this.lockRect.show(); @@ -468,35 +459,43 @@ export default class Switch extends Group { } // 处理岔芯颜色 - setSectionState(section, state) { + setSectionState(state) { + const sectionC = store.getters['map/getDeviceByCode'](state.sectionCCode); + if (sectionC && state.reversePosition) { + this.setSwitchModelStatus(this.shapeModelA, sectionC); + } const sectionA = store.getters['map/getDeviceByCode'](state.sectionACode); - if (sectionA) { - // 空闲 - section.setStyle({'fill': this.style.Section.line.spareColor}); + if (sectionA && state.normalPosition && !this.style.Switch.core.graphShow) { + this.setSwitchModelStatus(this.shapeModelB, sectionA); + } + } + // 处理道岔元素状态 + setSwitchModelStatus(section, sectionModel) { + // 空闲 + section.setStyle({'stroke': this.style.Section.line.spareColor}); + section.show(); + // 道岔保护区段锁闭 + if (sectionModel.overlapLock) { + section.setStyle({'stroke': this.style.Section.line.protectiveLockColor}); section.show(); - // 道岔保护区段锁闭 - if (sectionA.overlapLock) { - section.show(); - section.setStyle({'fill': this.style.Section.line.protectiveLockColor}); - } - // 空闲锁闭或者叫进路锁闭 - if (sectionA.routeLock) { - section.setStyle({'fill': this.style.Section.line.routeLockColor, 'stroke': this.style.Section.line.routeLockColor, 'lineWidth': this.style.Section.line.beyondWidth}); - section.show(); - } - // 非CBTC车占用 - if (sectionA.nctOccupied) { - section.show(); - section.setStyle({'fill': this.style.Section.line.unCommunicationOccupiedColor, 'stroke': this.style.Section.line.unCommunicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth}); - } - // CBTC车占用 - if (sectionA.ctOccupied) { - section.show(); - section.setStyle({'fill': this.style.Section.line.communicationOccupiedColor, 'stroke': this.style.Section.line.communicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth}); - } - if (sectionA.cutOff) { - section.hide(); - } + } + // 空闲锁闭或者叫进路锁闭 + if (sectionModel.routeLock) { + section.setStyle({'stroke': this.style.Section.line.routeLockColor}); + section.show(); + } + // 非CBTC车占用 + if (sectionModel.nctOccupied) { + section.setStyle({'stroke': this.style.Section.line.unCommunicationOccupiedColor}); + section.show(); + } + // CBTC车占用 + if (sectionModel.ctOccupied) { + section.setStyle({'stroke': this.style.Section.line.communicationOccupiedColor}); + section.show(); + } + if (sectionModel.cutOff) { + section.hide(); } } @@ -517,8 +516,8 @@ export default class Switch extends Group { model.blockade && this.block(); // 道岔封锁 model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态 const path = window.location.href; - if (!this.style.Switch.core.graphShow && !path.includes('/map/draw')) { - this.setSectionState(this.sheltertriangle, this.model); // 处理岔芯颜色 + if (!path.includes('/map/draw')) { + this.setSectionState(this.model); // 处理元素颜色 } // this.interlockingReserved(); // 联锁预留道岔 diff --git a/src/store/modules/iscs.js b/src/store/modules/iscs.js index 9e9b1dba9..e4e7802ef 100644 --- a/src/store/modules/iscs.js +++ b/src/store/modules/iscs.js @@ -161,7 +161,6 @@ const iscs = { if (!(models instanceof Array)) { models = [models]; } - commit('iscsRender', models); resolve(models); }); diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index d71a35030..20c7b9eaf 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -131,6 +131,10 @@ function handle(state, data) { break; case 'Simulation_Time_Sync': state.simulationTimeSync = msg; + break; + case 'Simulation_IbpStatus': + state.simulationIbpStatus = msg; + break; } } @@ -264,7 +268,8 @@ const socket = { runPlanReloadCount: 0, // 仿真运行图变更 memberChangeCount: 0, // 仿真成员变更 roomInvite: {}, - simulationTimeSync: '' // 仿真时间 + simulationTimeSync: '', // 仿真时间 + simulationIbpStatus: null }, getters: { }, diff --git a/src/views/ibp/ibpDraw/ibpOperate/ibpLamp.vue b/src/views/ibp/ibpDraw/ibpOperate/ibpLamp.vue index cacf22b78..2dcf607c3 100644 --- a/src/views/ibp/ibpDraw/ibpOperate/ibpLamp.vue +++ b/src/views/ibp/ibpDraw/ibpOperate/ibpLamp.vue @@ -25,9 +25,6 @@ /> - - - {{ buttonText }} {{ $t('global.delete') }} @@ -48,17 +45,20 @@ export default { buttonText: this.$t('ibp.createNow'), showDeleteButton: false, showMeanList: [ - {label: '扣车', value: 'Show_Detain'}, - {label: '屏蔽门打开', value: 'Show_Open_Screen_Door'}, - {label: '屏蔽门紧闭', value: 'Show_Close_Screen_Door'} + {label: '下行扣车', value: 'xxkcLight'}, + {label: '上行扣车', value: 'sxkcLight'}, + {label: '下行关门灯', value: 'xxgmLight'}, + {label: '下行开门灯', value: 'xxkmLight'}, + {label: '上行关门灯', value: 'sxgmLight'}, + {label: '上行开门灯', value: 'sxkmLight'}, + {label: '紧急停车灯', value: 'jjtcLight'} ], form: { code: '', r: '', x: 10, y: 10, - mean: '', - linkDevice: '' + mean: '' }, rules: { code: [ @@ -85,7 +85,6 @@ export default { this.form.x = model.point.x; this.form.y = model.point.y; this.form.mean = model.mean; - this.form.linkDevice = model.linkDevice; } } }, @@ -104,7 +103,6 @@ export default { code: this.form.code, r: this.form.r, mean: this.form.mean, - linkDevice: this.form.linkDevice, fillColor: '#332C22' }; this.$emit('createData', lampModel); @@ -125,7 +123,6 @@ export default { code: this.form.code, r: this.form.r, mean: this.form.mean, - linkDevice: this.form.linkDevice, fillColor: '#332C22' }; this.$emit('deleteDataModel', lampModel ); @@ -140,8 +137,7 @@ export default { r: '', x: 10, y: 10, - mean: '', - linkDevice: '' + mean: '' }; }, generateCode() { diff --git a/src/views/ibp/ibpsystem/index.vue b/src/views/ibp/ibpsystem/index.vue index 65d076164..24b831385 100644 --- a/src/views/ibp/ibpsystem/index.vue +++ b/src/views/ibp/ibpsystem/index.vue @@ -2,20 +2,25 @@
{{ $t('global.back') }} +
+ + diff --git a/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue b/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue new file mode 100644 index 000000000..8115304f7 --- /dev/null +++ b/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue b/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue index 5b410dd7c..4b8708839 100644 --- a/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue +++ b/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue @@ -53,6 +53,7 @@ export default { {label: '单扇有矩形', value: '3'}, {label: '双扇有矩形', value: '4'} ], + rules: {}, isUpdate: false, buttonText: '立即创建', showDeleteButton: false @@ -74,6 +75,7 @@ export default { this.form.x = model.point.x; this.form.y = model.point.y; this.form.r = model.r; + this.form.doorType = model.doorType; this.form.rotationAngle = model.rotationAngle; } } @@ -85,16 +87,14 @@ export default { if (valid) { const model = { point: { - x: this.form.x1, - y: this.form.y1 + x: this.form.x, + y: this.form.y }, code: this.isUpdate ? this.form.code : getUID('OrdinaryDoor', this.iscs.ordinaryDoorList), _type: 'OrdinaryDoor', - lineWidth: this.form.lineWidth, - fillColor: this.form.fillColor, - classify: this.form.classify, - arrowShow: this.form.arrowShow, - arrowSize: this.form.arrowSize + rotationAngle: this.form.rotationAngle, + r: this.form.r, + doorType: this.form.doorType }; this.$emit('createDataModel', model); this.initPage(); @@ -105,21 +105,15 @@ export default { }, deleteDevice() { const lineModel = { - point1: { - x: this.form.x1, - y: this.form.y1 - }, - point2: { - x: this.form.x2, - y: this.form.y2 + point: { + x: this.form.x, + y: this.form.y }, code: this.form.code, - _type: 'IscsLine', - lineWidth: this.form.lineWidth, - fillColor: this.form.fillColor, - classify: this.form.classify, - arrowShow: this.form.arrowShow, - arrowSize: this.form.arrowSize + _type: 'OrdinaryDoor', + rotationAngle: this.form.rotationAngle, + r: this.form.r, + doorType: this.form.doorType }; this.$emit('deleteDataModel', lineModel); }, @@ -129,15 +123,11 @@ export default { this.showDeleteButton = false; this.form = { code: '', - lineWidth: '', - fillColor: '#fff', - arrowShow: 'none', - arrowSize: 5, - x1: 10, - y1: 10, - x2: 20, - y2: 10, - classify:'solid' + doorType: '1', + r: 1, + rotationAngle: 0, + x: 10, + y: 10 }; } } diff --git a/src/views/newMap/displayNew/dispatherContest/index.vue b/src/views/newMap/displayNew/dispatherContest/index.vue index aa5297246..b00dadae1 100644 --- a/src/views/newMap/displayNew/dispatherContest/index.vue +++ b/src/views/newMap/displayNew/dispatherContest/index.vue @@ -67,7 +67,8 @@ - + +
@@ -80,6 +81,7 @@ import DemonChat from '../demonChat'; import SceneList from './sceneList'; import MenuSchema from '@/views/newMap/displayNew/menuSchema'; import TheoryQuiz from './quiz'; +import ThroryResult from './result'; import { getGoodsTryUse } from '@/api/management/goods'; import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { PermissionType } from '@/scripts/ConstDic'; @@ -103,7 +105,8 @@ export default { MenuSchema, DemonMenu, SceneList, - TheoryQuiz + TheoryQuiz, + ThroryResult }, props: { offset: { @@ -561,6 +564,9 @@ export default { }, goTheoryQuiz() { this.$refs.theoryQuiz.doShow(); + }, + commitResult(result) { + this.$refs.theoryResult.doShow(result); } } }; diff --git a/src/views/newMap/displayNew/dispatherContest/quiz.vue b/src/views/newMap/displayNew/dispatherContest/quiz.vue index 6edeb1c0d..3d8995d0a 100644 --- a/src/views/newMap/displayNew/dispatherContest/quiz.vue +++ b/src/views/newMap/displayNew/dispatherContest/quiz.vue @@ -27,19 +27,17 @@ + diff --git a/src/views/newMap/displayNew/dispatherContest/result.vue b/src/views/newMap/displayNew/dispatherContest/result.vue new file mode 100644 index 000000000..01b602f2d --- /dev/null +++ b/src/views/newMap/displayNew/dispatherContest/result.vue @@ -0,0 +1,185 @@ + + + diff --git a/src/views/newMap/jointTrainingNew/menuSchema.vue b/src/views/newMap/jointTrainingNew/menuSchema.vue index 195d53939..a37be507c 100644 --- a/src/views/newMap/jointTrainingNew/menuSchema.vue +++ b/src/views/newMap/jointTrainingNew/menuSchema.vue @@ -214,7 +214,8 @@ export default { mapId: this.$route.query.mapId, group: this.$route.query.group, stationCode: 'Station25166', - loadAll: true + loadAll: true, + noPreLogout: true } }); window.open(routeData.href, '_blank', 'noopener noreferrer');