This commit is contained in:
joylink_cuiweidong 2021-01-15 10:33:15 +08:00
commit 4e28468ad9
19 changed files with 300 additions and 231 deletions

View File

@ -54,6 +54,17 @@ export function Jl3dSandBoxTest(dom,textUi,skinCode,routegroup,token) {
renderer.render( scene, camera ); renderer.render( scene, camera );
controls.update(); controls.update();
const dist = camera.position.y;
const vFOV = THREE.Math.degToRad(camera.fov);
const size = 1 * Math.tan(vFOV / 2) * dist;
const scaleFactor = 130;
const scale = size / scaleFactor;
for(let i=0;i<manager.station.children.length;i++){
manager.station.children[i].scale.set(scale,scale,scale);
}
for(let i=0;i<manager.train.trainGroup.children.length;i++){
manager.train.trainGroup.children[i].scale.set(scale,scale,scale);
}
requestAnimationFrame(animate); requestAnimationFrame(animate);
} }

View File

@ -21,9 +21,9 @@ export function dataManager(scene,textUi,camera,routegroup) {
let section = new sectionModel(scene); let section = new sectionModel(scene);
let signal = new signalModel(scene); let signal = new signalModel(scene);
let station = new THREE.Group(); this.station = new THREE.Group();
scene.add( station ); scene.add( scope.station );
let train = new trainModel(scene); this.train = new trainModel(scene);
this.topCurve = ""; this.topCurve = "";
this.downCurve = ""; this.downCurve = "";
console.log(routegroup); console.log(routegroup);
@ -54,10 +54,10 @@ export function dataManager(scene,textUi,camera,routegroup) {
console.log(data); console.log(data);
return loadMapData(skinCode); return loadMapData(skinCode);
}).then(function(data){ }).then(function(data){
scope.nowConnect = new sandBoxConnect(scope,routegroup,section,signal,station,train); scope.nowConnect = new sandBoxConnect(scope,routegroup,section,signal,scope.station,scope.train);
document.addEventListener( 'mousemove', onDocumentMouseMove, false ); document.addEventListener( 'mousemove', onDocumentMouseMove, false );
raycasterList.push(station); raycasterList.push(scope.station);
raycasterList.push(train.trainGroup); raycasterList.push(scope.train.trainGroup);
}); });
@ -119,7 +119,7 @@ export function dataManager(scene,textUi,camera,routegroup) {
console.log(netdata); console.log(netdata);
section.init(netdata.data.sectionList,netdata.data.switchList,stationData); section.init(netdata.data.sectionList,netdata.data.switchList,stationData);
signal.init(netdata.data.signalList,section.topData,section.downData,scope.topCurve,scope.downCurve,modelmanager.signal); signal.init(netdata.data.signalList,section.topData,section.downData,scope.topCurve,scope.downCurve,modelmanager.signal);
train.init(netdata.data.trainList); scope.train.init(netdata.data.trainList);
resolve("loadMap"); resolve("loadMap");
}); });
}); });
@ -175,35 +175,10 @@ export function dataManager(scene,textUi,camera,routegroup) {
curveTop.closed = false; curveTop.closed = false;
scope.topCurve = curveTop; scope.topCurve = curveTop;
let pointsArray = [];
let greenMaterial =new THREE.MeshBasicMaterial({color: 0xffff00,opacity: 0.75});
for(var i = 0.00; i <= 1.00; i += 0.005){
var point = curveTop.getPointAt(i);
var tangent = curveTop.getTangent(i);
var extension1 = new THREE.Vector3(tangent.x*2,0,tangent.z*2);
var extension2 = new THREE.Vector3(extension1.x*2,0,extension1.y*2);
var tangentGeometry = new THREE.Geometry();
tangentGeometry.vertices.push(tangent, extension1, extension2);
var tangentLine = new THREE.Line(tangentGeometry,greenMaterial);
tangentLine.position.set(point.x, point.y, point.z);
tangentLine.updateMatrixWorld(); // VERY IMPORTANT
var normal = tangentLine.clone();
normal.rotateZ(Math.PI/2);
var normalLastVertex = normal.geometry.vertices[2].clone();
normalLastVertex.applyMatrix4(normal.matrixWorld); //convert to world coords.
pointsDown.push(normalLastVertex); //for using them out of the loop
}
var curveDown = new THREE.CatmullRomCurve3(pointsDown );
var curveDown = new THREE.CatmullRomCurve3(pointsTop );
curveDown.curveType = "chordal"; curveDown.curveType = "chordal";
curveDown.tension = 0.15; curveDown.tension = 0.15;
curveDown.closed = false; curveDown.closed = false;
@ -217,33 +192,33 @@ export function dataManager(scene,textUi,camera,routegroup) {
extrudePath : curveTop, extrudePath : curveTop,
}; };
var extrudeSettingsDown = { // var extrudeSettingsDown = {
steps : pointsDown.length*2, // steps : pointsDown.length*2,
curveSegments : 1, // curveSegments : 1,
bevelSegments : 1, // bevelSegments : 1,
bevelEnabled : false, // bevelEnabled : false,
extrudePath : curveDown, // extrudePath : curveDown,
}; // };
var shapeTop = new THREE.Shape(); var shapeTop = new THREE.Shape();
shapeTop.moveTo( 0,-1 ); shapeTop.moveTo( 0,-1 );
shapeTop.lineTo( 0,1 ); shapeTop.lineTo( 0,1 );
var shapeDown = new THREE.Shape(); // var shapeDown = new THREE.Shape();
shapeDown.moveTo( 0,-1 ); // shapeDown.moveTo( 0,-1 );
shapeDown.lineTo( 0,1 ); // shapeDown.lineTo( 0,1 );
let materialSection1 = new THREE.MeshPhongMaterial( { color : 0x3366ff } ); let materialSection1 = new THREE.MeshPhongMaterial( { color : 0x3366ff } );
let materialSection2 = new THREE.MeshPhongMaterial( { color : 0x336600 } ); // let materialSection2 = new THREE.MeshPhongMaterial( { color : 0x336600 } );
var geometryTop = new THREE.ExtrudeBufferGeometry( shapeTop, extrudeSettingsTop ); var geometryTop = new THREE.ExtrudeBufferGeometry( shapeTop, extrudeSettingsTop );
var curveTopMesh = new THREE.Mesh( geometryTop,materialSection1) ; var curveTopMesh = new THREE.Mesh( geometryTop,materialSection1) ;
scene.add(curveTopMesh); scene.add(curveTopMesh);
var geometryDown = new THREE.ExtrudeBufferGeometry( shapeDown, extrudeSettingsDown ); // var geometryDown = new THREE.ExtrudeBufferGeometry( shapeDown, extrudeSettingsDown );
var curveDownMesh = new THREE.Mesh( geometryDown,materialSection2) ; // var curveDownMesh = new THREE.Mesh( geometryDown,materialSection2) ;
scene.add(curveDownMesh); // scene.add(curveDownMesh);
for(let j=0;j<stationListData.stations.length;j++){ for(let j=0;j<stationListData.stations.length;j++){
@ -253,10 +228,10 @@ export function dataManager(scene,textUi,camera,routegroup) {
let pos = stationListData.stations[j].xy_coords.split(";"); let pos = stationListData.stations[j].xy_coords.split(";");
cube.name = stationListData.stations[j].name; cube.name = stationListData.stations[j].name;
cube.position.set((pos[0] -originX+0.0005)*double,0.2,-(pos[1]-originY+0.0005)*double); cube.position.set((pos[0] -originX)*double,0.2,-(pos[1]-originY)*double);
cube.rotation.x = Math.PI/2; cube.rotation.x = Math.PI/2;
// console.log(cube.position); // console.log(cube.position);
station.add(cube); scope.station.add(cube);
} }
resolve("loadJson"); resolve("loadJson");

View File

@ -2,15 +2,20 @@ export function signalModel(scene) {
let scope = this; let scope = this;
this.init = function(signalData,topData,downData,topCurve,downCurve,originMesh){ this.init = function(signalData,topData,downData,topCurve,downCurve,originMesh){
console.log(originMesh);
for(let i=0;i<signalData.length;i++){ for(let i=0;i<signalData.length;i++){
if(signalData[i].right == true){ if(signalData[i].right == true){
for(let j=0;j<topData.length;j++){ for(let j=0;j<topData.length;j++){
if(signalData[i].sectionCode == topData[j].code){ if(signalData[i].sectionCode == topData[j].code){
let newsignal = originMesh.mesh.clone(true); let newsignal = originMesh.mesh.clone(true);
newsignal.up = new THREE.Vector3(0,0,-1);
let tangent = topCurve.getTangent(topData[j].rightProgress);
let rotenum = newsignal.up.angleTo(tangent);
newsignal.rotation.z = rotenum;
newsignal.position.copy(topCurve.getPoint(topData[j].rightProgress)); newsignal.position.copy(topCurve.getPoint(topData[j].rightProgress));
newsignal.position.x +=-2;
newsignal.position.z +=-2;
scene.add( newsignal ); scene.add( newsignal );
j = topData.length; j = topData.length;
} }
@ -20,18 +25,14 @@ export function signalModel(scene) {
for(let j=0;j<downData.length;j++){ for(let j=0;j<downData.length;j++){
if(signalData[i].sectionCode == downData[j].code){ if(signalData[i].sectionCode == downData[j].code){
let newsignal = originMesh.mesh.clone(true); let newsignal = originMesh.mesh.clone(true);
newsignal.up = new THREE.Vector3(0,0,1);
let tangent = downCurve.getTangent(topData[j].leftProgress);
let rotenum = newsignal.up.angleTo(tangent);
newsignal.rotation.z = rotenum;
newsignal.position.copy(downCurve.getPoint(downData[j].leftProgress)); newsignal.position.copy(downCurve.getPoint(downData[j].leftProgress));
newsignal.position.x +=2;
newsignal.up = new THREE.Vector3(1,0,0); newsignal.position.z +=2;
newsignal.axis = new THREE.Vector3();
let tangent = downCurve.getTangentAt(downData[j].leftProgress).normalize();
newsignal.axis.crossVectors(newsignal.up, tangent).normalize();
let radians = Math.acos(newsignal.up.dot(tangent));
newsignal.quaternion.setFromAxisAngle(newsignal.axis, radians);
scene.add( newsignal ); scene.add( newsignal );
j = downData.length; j = downData.length;
} }

View File

@ -6,7 +6,7 @@ export function trainModel(scene) {
this.init = function(trainData){ this.init = function(trainData){
for(let i=0;i<trainData.length;i++){ for(let i=0;i<trainData.length;i++){
var geometry = new THREE.BoxGeometry( 30, 10, 10 ); var geometry = new THREE.BoxGeometry( 15, 5, 5 );
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} ); var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
var trainBox = new THREE.Mesh( geometry, material ); var trainBox = new THREE.Mesh( geometry, material );
trainBox.code = trainData[i].code; trainBox.code = trainData[i].code;
@ -15,7 +15,7 @@ export function trainModel(scene) {
trainBox.dispose = false; trainBox.dispose = false;
trainBox.up = new THREE.Vector3(1, 0, 0); trainBox.up = new THREE.Vector3(1, 0, 0);
trainBox.axis = new THREE.Vector3(); trainBox.axis = new THREE.Vector3();
trainBox.position.y = 5; trainBox.position.y = 2.5;
scope.trainlist[trainData[i].groupNumber] = trainBox; scope.trainlist[trainData[i].groupNumber] = trainBox;
} }
} }

View File

@ -527,6 +527,10 @@ class SkinCode extends defaultStyle {
rectBorderColor: 'red', // 矩形边框颜色 rectBorderColor: 'red', // 矩形边框颜色
monolock: false, // 单锁显示 monolock: false, // 单锁显示
block: false // 封锁显示 block: false // 封锁显示
},
coverBlock: { // 道岔封锁 遮盖物
show: true, // 显示
coverBlockColor: '#000080'// 遮挡物颜色
} }
}; };

View File

@ -559,6 +559,10 @@ class SkinCode extends defaultStyle {
rectBorderColor: 'red', // 矩形边框颜色 rectBorderColor: 'red', // 矩形边框颜色
monolock: false, // 单锁显示 monolock: false, // 单锁显示
block: false // 封锁显示 block: false // 封锁显示
},
coverBlock: { // 道岔封锁 遮盖物
show: true, // 显示
coverBlockColor: '#000080'// 遮挡物颜色
} }
}; };

View File

@ -173,7 +173,7 @@ export default class Section extends Group {
/** 封锁 06*/ /** 封锁 06*/
block() { block() {
if (this.sectionBlock) { if (this.sectionBlock) {
this.sectionBlock.show(); this.model.type !== '03' && this.sectionBlock.show();
} else { } else {
this.line && this.line.setStyle({ this.line && this.line.setStyle({
stroke: this.style.Section.line.blockColor, stroke: this.style.Section.line.blockColor,
@ -302,9 +302,9 @@ export default class Section extends Group {
model.overlapLock && this.protectiveLock(model.lockRight); model.overlapLock && this.protectiveLock(model.lockRight);
/** 空闲锁闭或者叫进路锁闭 */ /** 空闲锁闭或者叫进路锁闭 */
model.routeLock && this.routeLock(model.lockRight); model.routeLock && this.routeLock(model.lockRight);
/** 轨道封锁 */
model.invalid && this.invalid();
/** 计轴故障 */ /** 计轴故障 */
model.invalid && this.invalid();
/** 轨道封锁 */
model.blockade && this.block(); model.blockade && this.block();
/** 非通信车占用状态 */ /** 非通信车占用状态 */
model.nctOccupied && this.unCommunicationOccupied(); model.nctOccupied && this.unCommunicationOccupied();

View File

@ -0,0 +1,68 @@
import Group from 'zrender/src/container/Group';
import Polyline from 'zrender/src/graphic/shape/Polyline';
class ESwBlock extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
this.blockCover = new Polyline({ // 道岔锁闭遮盖物
zlevel: model.zlevel,
z: model.z + 4,
z2: 2,
shape: {
points: model.coverPoints
},
style: {
lineWidth: style.Section.line.width,
stroke: '#fff'// style.backgroundColor
},
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
});
this.hide();
this.add(this.blockCover);
}
hide() {
this.blockCover.hide();
this.blockCover.setStyle({ stroke: this.model.style.backgroundColor });
this.stopAnimation(false);
}
show() {
this.blockCover.show();
}
setColor(color) {
this.blockCover.setStyle({ stroke: color });
}
setStyle(data) {
this.blockCover.setStyle(data);
}
stopAnimation(flag) {
this.blockCover.stopAnimation(flag);
}
getSection() {
return this.blockCover;
}
animateStyle(color1, color2) {
this.blockCover.animateStyle(true)
.when(0, {stroke: color1})
.when(500, {stroke: color2})
.when(1000, {stroke: color1}).start();
}
}
export default ESwBlock;

View File

@ -14,6 +14,7 @@ class ESwLnversion extends Group {
this.relocShelter = new Polyline({ // 遮盖B区段范围 this.relocShelter = new Polyline({ // 遮盖B区段范围
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z + 4, z: model.z + 4,
z2: 1,
shape: { shape: {
points: model.shelterPoints points: model.shelterPoints
}, },

View File

@ -7,6 +7,7 @@ import ESwLocal from './ESwLocal.js';
import ESwLnversion from './ESwLnversion'; import ESwLnversion from './ESwLnversion';
import ELockRect from './ELockRect'; import ELockRect from './ELockRect';
import ELockArc from './ELockArc'; import ELockArc from './ELockArc';
import ESwBlock from './ESwBlock';
import EMouse from './EMouse'; import EMouse from './EMouse';
import EHighlight from '../element/EHighlight'; import EHighlight from '../element/EHighlight';
import ETriangle from './ETriangle'; import ETriangle from './ETriangle';
@ -134,7 +135,18 @@ export default class Switch extends Group {
onmouseover: () => { this.name.getArrowText().show(); }, onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); } onmouseout: () => { this.name.getArrowText().hide(); }
}); });
const coverPoint1 = [sectionAPoint.x - 2 * directxA * (relocShelterLength * sectionBTriangle.getCosRate()), sectionAPoint.y - drictyyA * relocShelterLength * sectionBTriangle.getSinRate()];
const coverPoint2 = [sectionAPoint.x, sectionAPoint.y];
this.shapeBlockCover = new ESwBlock({
zlevel: this.zlevel,
z: this.z,
style: style,
coverPoints: [coverPoint1, coverPoint2],
cursor: 'pointer',
triangle: this.triangle,
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
const arrowTextX = model.intersection.x + 10; const arrowTextX = model.intersection.x + 10;
const arrowTextY = model.intersection.y + 15; const arrowTextY = model.intersection.y + 15;
const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate(); const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate();
@ -173,6 +185,7 @@ export default class Switch extends Group {
this.add(this.shapeModelA); this.add(this.shapeModelA);
this.add(this.shapeModelB); this.add(this.shapeModelB);
this.add(this.shapeModelC); this.add(this.shapeModelC);
this.add(this.shapeBlockCover);
this.add(this.name); this.add(this.name);
this.add(this.enabledName); this.add(this.enabledName);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide(); style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
@ -262,6 +275,7 @@ export default class Switch extends Group {
this.shapeModelC.hide(); // 形状 C this.shapeModelC.hide(); // 形状 C
this.shapeModelA.hide(); // 形状 A this.shapeModelA.hide(); // 形状 A
this.shapeModelB.hide(); // 形状 B this.shapeModelB.hide(); // 形状 B
this.shapeBlockCover.hide(); // 封锁覆盖
this.setHasTextBorder(0); this.setHasTextBorder(0);
this.shapeModelC.attr({ this.shapeModelC.attr({
z: this.z + 3 z: this.z + 3
@ -469,6 +483,10 @@ export default class Switch extends Group {
this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.blockColor, fill: this.style.Switch.rectLock.blockFillColor }); this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.blockColor, fill: this.style.Switch.rectLock.blockFillColor });
} }
} }
if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) {
this.shapeBlockCover.show();
this.shapeBlockCover.setColor(this.style.Switch.coverBlock.coverBlockColor);
}
} }
blockMonolock() { blockMonolock() {
if (this.style.Switch.rectLock.block && this.style.Switch.rectLock.monolock) { if (this.style.Switch.rectLock.block && this.style.Switch.rectLock.monolock) {

View File

@ -255,13 +255,6 @@ export default {
this.classB = this.tempClassB; this.classB = this.tempClassB;
} }
}, },
'$store.state.training.prdType': function (val) {
if (val == '01' && this.centralizedStationList1.length) {
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationList1[0].code);
} else {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
}
},
'$store.state.training.centerStationCode': function(code) { '$store.state.training.centerStationCode': function(code) {
if (code) { if (code) {
this.stationCode = code; this.stationCode = code;
@ -358,16 +351,12 @@ export default {
}); });
this.colsNum = 24 / this.centralizedStationList1.length; this.colsNum = 24 / this.centralizedStationList1.length;
if (centralizedStationList.length) { if (centralizedStationList.length) {
if (this.$store.state.training.centerStationCode) { if (this.$store.state.map.showCentralizedStationCode) {
this.stationCode = this.$store.state.training.centerStationCode; this.stationCode = this.$store.state.map.showCentralizedStationCode;
} else { } else {
this.stationCode = centralizedStationList[0].code; this.stationCode = centralizedStationList[0].code;
} }
} }
if (this.$store.state.training.prdType == '01') {
this.$store.dispatch('map/setShowCentralizedStationCode', this.stationCode);
}
}, },
switchShowStation(stationCode) { switchShowStation(stationCode) {
this.stationCode = stationCode; this.stationCode = stationCode;

View File

@ -253,13 +253,6 @@ export default {
this.classB = this.tempClassB; this.classB = this.tempClassB;
} }
}, },
'$store.state.training.prdType': function (val) {
if (val == '01' && this.centralizedStationList1.length) {
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationList1[0].code);
} else {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
}
},
'$store.state.training.centerStationCode': function(code) { '$store.state.training.centerStationCode': function(code) {
if (code) { if (code) {
this.stationCode = code; this.stationCode = code;
@ -356,16 +349,12 @@ export default {
}); });
this.colsNum = 24 / this.centralizedStationList1.length; this.colsNum = 24 / this.centralizedStationList1.length;
if (centralizedStationList.length) { if (centralizedStationList.length) {
if (this.$store.state.training.centerStationCode) { if (this.$store.state.map.showCentralizedStationCode) {
this.stationCode = this.$store.state.training.centerStationCode; this.stationCode = this.$store.state.map.showCentralizedStationCode;
} else { } else {
this.stationCode = centralizedStationList[0].code; this.stationCode = centralizedStationList[0].code;
} }
} }
if (this.$store.state.training.prdType == '01') {
this.$store.dispatch('map/setShowCentralizedStationCode', this.stationCode);
}
}, },
switchShowStation(stationCode) { switchShowStation(stationCode) {
this.stationCode = stationCode; this.stationCode = stationCode;

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="haerbin-01__systerm"> <div class="haerbin-01__systerm">
<div v-if="isLocal" id="menuButton"> <div v-if="isLocal" id="menuButton">
<div class="menuButton"> <div class="__menuButton">
<el-row> <el-row>
<el-col v-if="!trainOperationShow" :span="11"> <el-col v-if="!trainOperationShow" :span="11">
<div v-if="secondConfirm" class="nav-border"> <div v-if="secondConfirm" class="nav-border">
@ -34,9 +34,9 @@
<template v-for="(item, index) in centralizedStationList"> <template v-for="(item, index) in centralizedStationList">
<div :key="index" class="nav-border-row row-width-box flex-row"> <div :key="index" class="nav-border-row row-width-box flex-row">
<div v-if="item.name && item.disabled" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div> <div v-if="item.name && item.disabled" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div>
<div v-else-if="item.name && !item.securityCommand " :id="item.operate.domId" class="fake-button" :class="item.show? 'active': ''" @click="clickCommand(item)">{{ item.name }}</div> <div v-else-if="item.name && !item.securityCommand " :id="item.operate.domId" :class="[item.cmdType? 'fake-button': 'fake-button-disabled', item.next && paramIndex == index ? 'active': '']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" class="fake-button-active" :class="item.show? 'active': ''" @click="clickCommand(item)">{{ item.name }}</div> <div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" class="fake-button-active" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else class="fake-button" style="cursor: not-allowed;" /> <div v-else class="fake-button-black" />
</div> </div>
</template> </template>
</el-row> </el-row>
@ -48,27 +48,12 @@
<el-button :id="commandId" class="fl" :class="{'disabled': canCommand || secondConfirm}" style="line-height: 18px; margin-top: 4px;" plain :disabled="canCommand || secondConfirm" @click="command">执行</el-button> <el-button :id="commandId" class="fl" :class="{'disabled': canCommand || secondConfirm}" style="line-height: 18px; margin-top: 4px;" plain :disabled="canCommand || secondConfirm" @click="command">执行</el-button>
<el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="cancle">取消</el-button> <el-button class="fr" style="line-height: 18px; margin-top: 4px;" plain @click="cancle">取消</el-button>
</div> </div>
<div v-if="!speedShow" class="nav-border-bottom"> <div
<el-table class="el-print"
ref="table"
:data="tempData"
border
:cell-style="tableStyle"
style="width: 100%;border: none;outline: none; height: 56px"
size="mini"
class="haerbin_table"
highlight-current-row highlight-current-row
:show-header="false"
> >
<el-table-column prop="name" style="margin-left:10px" class-name="abc" /> <div v-for="(el,i) in tempData" :key="i" style="margin-left:10px;text-align: left;line-height: 22px">
</el-table> {{ el.name }}
</div>
<div v-if="speedShow" class="nav-border-bottom">
<div style="height: 56px;width: 100%;background: #fff;overflow-y: scroll;text-align: left;">
<div class="speed-value-box" :style="{background: speedLimitValue===15? '#87CEFA': '#FFF'}" @click="setSpeedLimitValue(15)">15</div>
<div class="speed-value-box" :style="{background: speedLimitValue===25? '#87CEFA': '#FFF'}" @click="setSpeedLimitValue(25)">25</div>
<div class="speed-value-box" :style="{background: speedLimitValue===40? '#87CEFA': '#FFF'}" @click="setSpeedLimitValue(40)">40</div>
<div class="speed-value-box" :style="{background: speedLimitValue===60? '#87CEFA': '#FFF'}" @click="setSpeedLimitValue(60)">60</div>
</div> </div>
</div> </div>
</div> </div>
@ -134,7 +119,8 @@
<el-dialog <el-dialog
v-else v-else
v-dialogDrag v-dialogDrag
class="haerbin-01__systerm menuButton" class="haerbin-01__systerm __menuButton"
style="pointer-events: none"
title="Dialog" title="Dialog"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:modal="false" :modal="false"
@ -146,7 +132,7 @@
<div style="margin-bottom: 30px"> <div style="margin-bottom: 30px">
<template v-if="secondConfirm"> <template v-if="secondConfirm">
<el-row> <el-row>
<div style="text-align: center"> <div style="display: flex;justify-content: space-between;margin: 10px 3px">
<el-button :id="cr1ConfrimId" class="fl" :class="{'disabled': cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="cr1Confrim" plain @click="clickCr1Confirm">CR1</el-button> <el-button :id="cr1ConfrimId" class="fl" :class="{'disabled': cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="cr1Confrim" plain @click="clickCr1Confirm">CR1</el-button>
<el-button :id="cr2ConfirmId" class="fr" :class="{'disabled': !cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="!cr1Confrim" plain @click="clickCr2Confirm">CR2</el-button> <el-button :id="cr2ConfirmId" class="fr" :class="{'disabled': !cr1Confrim}" style="line-height: 18px; margin-top: 4px;" :disabled="!cr1Confrim" plain @click="clickCr2Confirm">CR2</el-button>
</div> </div>
@ -174,9 +160,9 @@
<template v-for="(item, index) in centralizedStationList"> <template v-for="(item, index) in centralizedStationList">
<div :key="index" class="nav-border-row row-width-box flex-row"> <div :key="index" class="nav-border-row row-width-box flex-row">
<div v-if="item.name && item.disabled" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div> <div v-if="item.name && item.disabled" :id="item.operate.domId" class="fake-button-disabled">{{ item.name }}</div>
<div v-else-if="item.name && !item.securityCommand " :id="item.operate.domId" class="fake-button" :class="item.show? 'active': ''" @click="clickCommand(item)">{{ item.name }}</div> <div v-else-if="item.name && !item.securityCommand " :id="item.operate.domId" :class="[item.cmdType? 'fake-button': 'fake-button-disabled', item.next && paramIndex == index ? 'active': '']" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" class="fake-button-active" :class="item.show? 'active': ''" @click="clickCommand(item)">{{ item.name }}</div> <div v-else-if="item.name && item.securityCommand" :id="item.operate.domId" class="fake-button-active" @click="clickCommand(item, index)">{{ item.name }}</div>
<div v-else class="fake-button-disabled" /> <div v-else class="fake-button-black" />
</div> </div>
</template> </template>
</el-row> </el-row>
@ -224,11 +210,6 @@ export default {
securityCommand: '', securityCommand: '',
switchRelevanceSectionList: [], // switchRelevanceSectionList: [], //
param: {}, param: {},
tableStyle: {
'border-bottom': 'none',
'border-right': 'none',
'padding': 0
},
selectedObj: null, selectedObj: null,
oldClickObj: null, // oldClickObj: null, //
route: null, // route: null, //
@ -237,8 +218,6 @@ export default {
guideRoute:null, guideRoute:null,
centralizedStationList: new Array(15).fill({}), centralizedStationList: new Array(15).fill({}),
ciStationParamList: [], ciStationParamList: [],
// startVirtual: false,
// endVirtual: false,
atp:false, atp:false,
ground:false, ground:false,
guide:false, guide:false,
@ -250,7 +229,9 @@ export default {
standParamList: [], standParamList: [],
routeParamList: [], routeParamList: [],
directionRodParamList: [], directionRodParamList: [],
paramConfirm: false,
secondConfirm: false, secondConfirm: false,
paramIndex: -1,
banIcon: BanIcon, banIcon: BanIcon,
timer: null, timer: null,
trainOperationShow: false, trainOperationShow: false,
@ -258,7 +239,6 @@ export default {
formModelTripNum: '', formModelTripNum: '',
formModelSectionName: '', formModelSectionName: '',
formModelNewTrip: '', formModelNewTrip: '',
speedShowCon: false,
dialogVisible: false dialogVisible: false
}; };
}, },
@ -276,9 +256,6 @@ export default {
cr2ConfirmId() { cr2ConfirmId() {
return OperationEvent.Command.commandHaerbin.confrimCr2.domId; return OperationEvent.Command.commandHaerbin.confrimCr2.domId;
}, },
speedShow() {
return (this.cmdType == CMD.Section.CMD_SECTION_SET_LIMIT_SPEED || this.cmdType == CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED) && this.speedShowCon;
},
isLocal() { isLocal() {
return this.$store.state.training.prdType == '01'; return this.$store.state.training.prdType == '01';
} }
@ -323,7 +300,6 @@ export default {
} }
} }
this.selectedObj = this.selected; this.selectedObj = this.selected;
this.speedShowCon = false;
if (this.selectedObj._type) { if (this.selectedObj._type) {
if (this.selectedObj._type == 'Section' && (this.selectedObj.type == '03' || this.selectedObj.type == '04')) { // if (this.selectedObj._type == 'Section' && (this.selectedObj.type == '03' || this.selectedObj.type == '04')) { //
this.selectedObj = this.selectedObj.switch; this.selectedObj = this.selectedObj.switch;
@ -438,45 +414,6 @@ export default {
} }
return control; return control;
}, },
clickCommand(row) {
this.clearAllMenuShow();
const commandList = ['ATP进路', '取消ATP', '联锁进路', '取消联锁', '引导进路', '取消引导'];
const routeList = [this.atpRoute, this.groundRoute, this.guideRoute];
const commandIndex = commandList.indexOf(row.name);
const currentIndex = Math.floor(commandIndex / 2);
const step = {};
if (currentIndex >= 0) {
this.route = routeList[currentIndex];
this.tempData = [];
this.tempData.push(this.route);
step.param = {
routeCode: this.route.code
};
// if (currentIndex == 2) {
// step.param = {
// signalCode: this.route.startSignalCode
// };
// } else {
// }
}
if (this.tempData.length) {
row.show = true;
this.operate = row.operate.operation;
this.cmdType = row.cmdType;
this.speedShowCon = true;
this.canCommand = false;
this.securityCommand = row.securityCommand;
step.operation = this.operate;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
}
},
clearAllMenuShow() { clearAllMenuShow() {
this.centralizedStationList.forEach(item => { this.centralizedStationList.forEach(item => {
if (item.name) { if (item.name) {
@ -683,12 +620,13 @@ export default {
standCode: this.selectedObj.code standCode: this.selectedObj.code
}; };
}, },
handleParam() { checkConfirmParam() {
if (this.operate == OperationEvent.Signal.cancelTrainRoute.menuButton.operation || this.operate == OperationEvent.Signal.humanTrainRoute.menuButton.operation) { if (this.operate == OperationEvent.Signal.cancelTrainRoute.menuButton.operation || this.operate == OperationEvent.Signal.humanTrainRoute.menuButton.operation) {
this.param = { this.param = {
signalCode: this.route.startSignalCode signalCode: this.route.startSignalCode
}; };
} }
if (this.operate == OperationEvent.Signal.humanControl.menuButton.operation || this.operate == OperationEvent.Signal.atsAutoControl.menuButton.operation) { if (this.operate == OperationEvent.Signal.humanControl.menuButton.operation || this.operate == OperationEvent.Signal.atsAutoControl.menuButton.operation) {
const routeCodeList = []; const routeCodeList = [];
this.routeList.forEach(item => { this.routeList.forEach(item => {
@ -698,6 +636,7 @@ export default {
}); });
this.param.routeCodeList = routeCodeList; this.param.routeCodeList = routeCodeList;
} }
if (this.cmdType == CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER || this.cmdType == CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER) { if (this.cmdType == CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER || this.cmdType == CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER) {
if (this.selectedObj.centralized) { if (this.selectedObj.centralized) {
this.param = { stationCode: this.selectedObj.code }; this.param = { stationCode: this.selectedObj.code };
@ -709,20 +648,66 @@ export default {
}); });
} }
} }
if (this.cmdType == CMD.Section.CMD_SECTION_SET_LIMIT_SPEED || this.cmdType == CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED) { if (this.cmdType == CMD.Section.CMD_SECTION_SET_LIMIT_SPEED || this.cmdType == CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED) {
this.param.speedLimitValue = this.speedLimitValue; this.param.speedLimitValue = this.speedLimitValue;
this.centralizedStationList = new Array(15).fill({ name: '' });
[15, 25, 40, 60].forEach((el, i) => {
this.centralizedStationList[i] = {
name: `${el} s`,
cmdType: this.cmdType,
operate: OperationEvent.StationControl.requestStationControl.menu,
next: true,
value: el
};
});
}
},
clickCommand(row, index) {
this.clearAllMenuShow();
this.paramIndex = row.next ? index : -1;
const commandList = ['ATP进路', '取消ATP', '联锁进路', '取消联锁', '引导进路', '取消引导'];
const routeList = [this.atpRoute, this.groundRoute, this.guideRoute];
const commandIndex = commandList.indexOf(row.name);
const currentIndex = Math.floor(commandIndex / 2);
const step = {};
if (currentIndex >= 0) {
this.route = routeList[currentIndex];
step.param = { routeCode: this.route.code };
}
if (this.tempData.length) {
row.show = true;
this.operate = row.operate.operation;
this.cmdType = row.cmdType;
this.canCommand = false;
step.operation = this.operate;
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.checkConfirmParam();
this.securityCommand = row.securityCommand || row.next;
} else if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
} }
}, },
command() { command() {
this.handleParam();
const step = { const step = {
operation: OperationEvent.Command.commandHaerbin.confirm.operation, operation: OperationEvent.Command.commandHaerbin.confirm.operation,
param: this.param param: this.param
}; };
if (!this.securityCommand) { if (!this.securityCommand) {
step.over = true; step.over = true;
step.cmdType = this.cmdType; step.cmdType = this.cmdType;
} }
this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid && this.securityCommand) { if (valid && this.securityCommand) {
this.secondConfirm = true; this.secondConfirm = true;
@ -732,10 +717,12 @@ export default {
}, 15000); }, 15000);
} else if (valid) { } else if (valid) {
this.doClose(); this.doClose();
this.handleClose();
} }
}).catch((error) => { }).catch((error) => {
console.error(error); console.error(error);
this.doClose(); this.doClose();
this.handleClose();
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
}, },
@ -765,13 +752,16 @@ export default {
cmdType: this.cmdType, cmdType: this.cmdType,
operation: OperationEvent.Command.commandHaerbin.confrimCr2.operation operation: OperationEvent.Command.commandHaerbin.confrimCr2.operation
}; };
this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.handleClose();
} }
}).catch((error) => { }).catch((error) => {
console.error(error); console.error(error);
this.doClose(); this.doClose();
this.handleClose();
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
}, },
@ -954,14 +944,14 @@ export default {
{ name: '' }, { name: '' },
{ name: '' }, { name: '' },
{ name: '' }, { name: '' },
{ name: '强行站控', operate: OperationEvent.StationControl.requestStationControl.menu }, { name: '强行站控', cmdType: '', operate: OperationEvent.StationControl.requestStationControl.menu },
{ name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' }, { name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' },
{ name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' }, { name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' },
{ name: '' }, { name: '' },
{ name: '' }, { name: '' },
{ name: '' }, { name: '' },
{ name: '' }, { name: '' },
{ name: '关闭索引', operate: OperationEvent.StationControl.requestStationControl.menu } { name: '关闭索引', cmdType: '', operate: OperationEvent.StationControl.requestStationControl.menu }
// { name: '', cmdType: CMD.Station.CMD_STATION_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.closeAllSignal.menu, show: false } // { name: '', cmdType: CMD.Station.CMD_STATION_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.closeAllSignal.menu, show: false }
] : [ ] : [
@ -1013,10 +1003,14 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .el-input--mini .el-input__inner{ /deep/ {
.el-input--mini
.el-input__inner{
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
} }
}
.speed-value-box{ .speed-value-box{
height: 18px; height: 18px;
padding-left: 20px; padding-left: 20px;
@ -1024,6 +1018,13 @@ export default {
width: 100%; width: 100%;
line-height: 18px; line-height: 18px;
} }
.separator {
display: flex;
justify-content: flex-end;
margin: 15px;
border-top: 1px solid #000;
}
</style> </style>
<style lang="scss"> <style lang="scss">
#menuButton{ #menuButton{
@ -1035,8 +1036,8 @@ export default {
background: #FFFFFF; background: #FFFFFF;
z-index: 2; z-index: 2;
} }
.nav-border { .nav-border {
font-size: 12px;
color: #000; color: #000;
height: 90px; height: 90px;
text-align: center; text-align: center;
@ -1086,86 +1087,96 @@ export default {
align-items: center; align-items: center;
} }
.fake-button{ .fake-button{
font-size: 12px;
width: 80px; width: 80px;
height: 20px; height: 20px;
border-radius: 1px !important; border-radius: 1px !important;
border: 1px solid #426688; border: 1px solid #426688;
background: #DDDDDD; background: #DDDDDD;
color: #000;
line-height: 18px; line-height: 18px;
cursor: pointer; cursor: pointer;
&:hover, &.active{
background: #CFE8FC;
} }
}
.fake-button-black {
font-size: 12px;
width: 80px;
height: 20px;
border-radius: 1px !important;
border: 1px solid #426688;
background: #DDDDDD;
color: #DDDDDD;
line-height: 18px;
cursor: not-allowed;
}
.fake-button-active{ .fake-button-active{
font-size: 12px;
width: 80px; width: 80px;
height: 20px; height: 20px;
border-radius: 1px !important; border-radius: 1px !important;
line-height: 18px; line-height: 18px;
border: 1px solid #426688; border: 1px solid #426688;
cursor: pointer;
background: #77DBF0; background: #77DBF0;
color: #000;
cursor: pointer; cursor: pointer;
&:hover, &.active{ &:hover, &.active{
background: #77DBF0; background: #CFE8FC;
} }
} }
.fake-button-disabled{ .fake-button-disabled{
font-size: 12px;
width: 80px; width: 80px;
height: 20px; height: 20px;
border-radius: 1px !important; border-radius: 1px !important;
line-height: 18px; line-height: 18px;
border: 1px solid #9B9B9B; border: 1px solid #9B9B9B;
cursor: not-allowed; background: #DDDDDD;
color: #a0a0a0; color: #a0a0a0;
cursor: not-allowed;
&:hover, &.active{
background: none;
}
} }
.menuButton .abc:hover{ .__menuButton .el-button {
background-color:#2b68c3!important;
color: #fff;
}
.menuButton .el-table {
background: #fff;
}
.menuButton .el-table__body tr.current-row .abc{
background-color: #2b68c3!important;
color: #fff;
}
.menuButton .el-table__row {
background: #eee;
}
.menuButton .el-button {
background: #DDDDDD; background: #DDDDDD;
border: 1px solid #000 !important; border: 1px solid #000 !important;
cursor: pointer; cursor: pointer;
&.disabled { &.disabled {
cursor: not-allowed; cursor: not-allowed;
border: 1px solid #D0CEC5 !important; border: 1px solid #D0CEC5 !important;
/*background: #DDDDDD !important;*/
color: #a0a0a0!important; color: #a0a0a0!important;
} }
&:hover, &.active{ &:hover, &.active{
background: #eeeeee; background: #CFE8FC;
} }
} }
.__menuButton .el-print {
font-size: 12px;
height: 52px;
margin: 0px 20px;
border: 1px solid #d1d1d1;
width: auto;
}
.__menuButton {
.el-dialog, .el-dialog,
.el-dialog__wrapper { .el-dialog__wrapper {
pointer-events: none; pointer-events: none !important;
} }
.el-dialog__header, .el-dialog__header,
.el-dialog__body { .el-dialog__body {
pointer-events: all; pointer-events: all !important;
}
} }
.separator {
display: flex;
justify-content: flex-end;
margin: 15px;
border-top: 1px solid #000;
}
.color-strip-container{ .color-strip-container{
display: flex; display: flex;

View File

@ -141,7 +141,7 @@ import axios from 'axios';
methods: { methods: {
changeTrainSelect(mode){ changeTrainSelect(mode){
if(mode == "isTraining"){ if(mode == "isTraining"){
// this.isTraining = false; this.isTraining = false;
} }
}, },
currentsel(selVal){ currentsel(selVal){

View File

@ -391,7 +391,6 @@ export default {
onSelected(em) { onSelected(em) {
const path = window.location.href; const path = window.location.href;
if (path.includes('/practiceDisplay')) { if (path.includes('/practiceDisplay')) {
if (em.deviceType == 'StationStand') { if (em.deviceType == 'StationStand') {
runPassenger(this.$route.query.group, em.deviceCode).then(netdata => { runPassenger(this.$route.query.group, em.deviceCode).then(netdata => {
console.log(netdata); console.log(netdata);

View File

@ -96,6 +96,7 @@ export default {
// deviceType.Signal, // deviceType.Signal,
// deviceType.StationStand // deviceType.StationStand
// ]; // ];
const lineCode = this.$store.getters['map/lineCode']; const lineCode = this.$store.getters['map/lineCode'];
if (em.deviceType === 'StationStand' && lineCode === '01') { if (em.deviceType === 'StationStand' && lineCode === '01') {
const menu = getDeviceMenuByDeviceType(device._type) || []; const menu = getDeviceMenuByDeviceType(device._type) || [];
@ -112,7 +113,8 @@ export default {
// } // }
// } // }
} }
this.selected = device;
this.selected = { ...device };
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
this.$store.dispatch('menuOperation/setLeftClickCount'); this.$store.dispatch('menuOperation/setLeftClickCount');
if (this.$route.query.lineCode == '07' || this.$route.query.lineCode == '14') { if (this.$route.query.lineCode == '07' || this.$route.query.lineCode == '14') {

View File

@ -147,7 +147,7 @@ export default {
overflow: hidden; overflow: hidden;
.title { .title {
Responder-align: right; text-align: right;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
line-height: 40px; line-height: 40px;

View File

@ -106,7 +106,7 @@ export default {
overflow: hidden; overflow: hidden;
.title { .title {
Responder-align: right; text-align: right;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
line-height: 40px; line-height: 40px;

View File

@ -89,9 +89,6 @@ export default {
sectionCode: [ sectionCode: [
{ required: true, message: '请关联物理区段', trigger: 'blur' } { required: true, message: '请关联物理区段', trigger: 'blur' }
], ],
stationCode: [
{ required: true, message: '请选择关联集中站', trigger: 'blur' }
],
'position.x': [ 'position.x': [
{ required: true, message: '请输入应答器坐标x', trigger: 'blur' } { required: true, message: '请输入应答器坐标x', trigger: 'blur' }
], ],
@ -178,7 +175,7 @@ export default {
overflow: hidden; overflow: hidden;
.title { .title {
Responder-align: right; text-align: right;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
line-height: 40px; line-height: 40px;