This commit is contained in:
fan 2021-09-15 16:58:27 +08:00
commit 6bc79aca79
49 changed files with 1831 additions and 932 deletions

View File

@ -51,6 +51,14 @@ export function deleteMap(data) {
});
}
/** 删除所有草稿地图 */
export function deleteAllMap() {
return request({
url: `/api/mapBuild/delete/all`,
method: 'delete'
})
}
/** 保存草稿地图*/
export function saveMap(data) {
return request({

View File

@ -5,6 +5,7 @@ export default {
pleaseEnter: 'please input',
sketchMap: 'Draft map list',
newConstruction: 'Create',
deleteAllMap: 'Delete All',
importMap: 'Import the map',
createNewMap: 'A new map',
normalCreate: 'The normal to create',

View File

@ -5,6 +5,7 @@ export default {
pleaseEnter: '请输入',
sketchMap: '草稿地图列表',
newConstruction: '新建',
deleteAllMap: '清空',
bothCreate: '批量生成',
importMap: '导入',
createNewMap: '新建地图',

View File

@ -662,15 +662,16 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
//根据数据切换设备样式
this.updateaction = function (data) {
if (data.type == "SWITCH") {
if (data.normal == "0") {
scope.modelmanager.switchmodel.normalPosition = "0";
if (data.command == 'NP') {
scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play();
} else if (data.normal == "1") {
scope.modelmanager.switchmodel.normalPosition = "1";
} else if (data.command == 'RP') {
scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = -1;
@ -678,36 +679,79 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
}
if (data.type == "SIGNAL") {//从上往下红绿黄
if(data.red == 1){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"];
/** 无显示,灭灯 */
if(data.command == 'No'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
}
if(data.yellow == 1){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
}
if(data.green == 1){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 红 */
if(data.command == 'R'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["green"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
}
if (data.type == "PSD" || data.type == "STAND") {
if (data.code == scope.nowcode) {
if (data.open == "1" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
if (data.command == 'K' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
@ -717,8 +761,8 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
localVoicePlay("开往"+psdVoiceStationList[data.code].finlStationName+"方向的列车进站了!");
}
if (data.open == "0" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
if (data.command == 'G' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;

View File

@ -81,7 +81,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
return;
}
if(data.type == "DeviceCtrl_3D"){
// console.log(data);
if (data.body.type== 'SIGNAL' && signallist) {
@ -822,12 +821,12 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
// console.log("direct:"+trainmodel.right);
// console.log(trainmodel.openleft);
// console.log(trainmodel.openright);
if(trainmodel.code == data.code){
if(trainmodel.code == data.trainCode){
if(trainmodel.right == "0"){
if(data.doorCode == "2"){
if(data.code == "2"){
if(trainmodel.openleft != data.open && data.open == "0"){
trainmodel.openleft = "0";
if(trainmodel.openleft != data.command && data.command == "G"){
trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
@ -835,8 +834,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
actions["traindoor"].top[an].play();
}
}else if(trainmodel.openleft != data.open && data.open == "1"){
trainmodel.openleft = "1";
}else if(trainmodel.openleft != data.command && data.command == "K"){
trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
@ -847,16 +846,16 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}else{
if (trainmodel.openright != data.open && data.open == '0') {
trainmodel.openright = '0';
if (trainmodel.openright != data.command && data.command == 'G') {
trainmodel.openright = data.command;
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
} else if (trainmodel.openright != data.open && data.open == '1') {
trainmodel.openright = "1";
} else if (trainmodel.openright != data.command && data.command == 'K') {
trainmodel.openright = data.command;
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
@ -867,18 +866,18 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
}else{
if(data.doorCode == "1"){
if(data.code == "1"){
if(trainmodel.openleft != data.open && data.open == "0"){
trainmodel.openleft = "0";
if(trainmodel.openleft != data.command && data.command == "G"){
trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else if(trainmodel.openleft != data.open && data.open == "1"){
trainmodel.openleft = "1";
}else if(trainmodel.openleft != data.command && data.command == "K"){
trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
@ -887,16 +886,16 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
}
}else{
if (trainmodel.openright != data.open && data.open == '0') {
trainmodel.openright = '0';
if (trainmodel.openright != data.command && data.command == 'G') {
trainmodel.openright = data.command;
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
} else if (trainmodel.openright != data.open && data.open == '1') {
trainmodel.openright = "1";
} else if (trainmodel.openright != data.command && data.command == 'K') {
trainmodel.openright = data.command;
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
@ -969,15 +968,15 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
function initstand(data) {
code = data.code;
if ( actions[code]) {
if (data.close == '1') {
actions[code].status = '1';
if (data.command == 'K') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.close == '0') {
actions[code].status = '0';
if (data.command == 'G') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
@ -987,17 +986,17 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
function standupdate(data) {
code = data.code;
console.log(data);
if ( actions[code]) {
if (data.open == '1') {
actions[code].status = '1';
if (data.command == 'K') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.open == '0') {
actions[code].status = '0';
if (data.command == 'G') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
@ -1008,72 +1007,107 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
function signalupdate(data) {
code = data.code;
console.log(data);
if(data.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
if(data.command == 'No'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红 */
if(data.command == 'R'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
}
function initswitch(data) {
code = data.code;
if (data.routeLock == '0') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.routeLock == '1') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
}
if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].command = data.command;
} else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].command = data.command;
}
}
function switchupdate(data) {
code = data.code;
if (actions[code].normal != data.normal) {
if (data.normal == '02') {
if (actions[code].command != data.command) {
if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.normal == '01') {
actions[code].command = data.command;
} else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
actions[code].command = data.command;
}
}
}

View File

@ -434,14 +434,14 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
this.updateaction = function (data) {
if (data.type == "SWITCH") {
if (data.normal == "0") {
scope.modelmanager.switchmodel.normalPosition = "0";
if (data.command == 'NP') {
scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play();
} else if (data.normal == "1") {
scope.modelmanager.switchmodel.normalPosition = "1";
} else if (data.command == 'RP') {
scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = -1;
@ -450,34 +450,77 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
}
if (data.type == "SIGNAL") {//从上往下红绿黄
if(data.red == 1){
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"];
if(data.command == 'No'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}
if(data.yellow == 1){
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}
if(data.green == 1){
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 红 */
if(data.command == 'R'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
}
if (data.type == "PSD") {
if (data.code == scope.nowcode) {
if (data.open == "1" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
if (data.command == 'K' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
@ -485,8 +528,8 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
scope.modelmanager.standmodel.action.play();
}
if (data.open == "0" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
if (data.command == 'G' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;

View File

@ -33,7 +33,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "PSD"){
if(data.body.code == passerStation.nowStation.toppsd){
if(data.body.open == 0){
if(data.body.command == 'G'){
deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration;
@ -48,7 +48,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
}
}
if(data.body.code == passerStation.nowStation.downpsd){
if(data.body.open == 0){
if(data.body.command == 'G'){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
@ -64,24 +64,24 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
}
}
if(data.body.type == "TRAIN_DOOR"){
if(toptrain.nowcode == data.body.code){
if(toptrain.nowcode == data.body.trainCode){
if(data.body.open == "0"){
closetraindoor(toptrain,data.body.doorCode,"top");
if(data.body.command == 'G'){
closetraindoor(toptrain,data.body.code,"top");
}else{
opentraindoor(toptrain,data.body.doorCode,"top");
opentraindoor(toptrain,data.body.code,"top");
}
}
if(downtrain.nowcode == data.body.code){
if(downtrain.nowcode == data.body.trainCode){
// console.log(data.body);
if(data.body.open == "0"){
closetraindoor(downtrain,data.body.doorCode,"down");
if(data.body.command == 'G'){
closetraindoor(downtrain,data.body.code,"down");
}else{
opentraindoor(downtrain,data.body.doorCode,"down");
opentraindoor(downtrain,data.body.code,"down");
}

View File

@ -165,7 +165,6 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function trainRunNew(data){
let code = data.code;
if(trainlisttest.list[code].right != data.right){
if(data.right == "0"){
@ -609,20 +608,20 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}
function traindoorupdate(data){
let code = data.code;
let code = data.trainCode;
if(trainlisttest.list[code].right == "0"){
if(data.doorCode == "2"){
if(data.code == "2"){
if(trainlisttest.list[code].openleft != data.open && data.open == "0"){
trainlisttest.list[code].openleft = "0";
if(trainlisttest.list[code].openleft != data.command && data.command == "G"){
trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
}else if(trainlisttest.list[code].openleft != data.open && data.open == "1"){
trainlisttest.list[code].openleft = "1";
}else if(trainlisttest.list[code].openleft != data.command && data.command == "K"){
trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = 0;
@ -633,16 +632,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}else{
if (trainlisttest.list[code].openright != data.open && data.open == '0') {
trainlisttest.list[code].openright = '0';
if (trainlisttest.list[code].openright != data.command && data.command == 'G') {
trainlisttest.list[code].openright = data.command;
for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1;
actions[code].down[an].play();
}
} else if (trainlisttest.list[code].openright != data.open && data.open == '1') {
trainlisttest.list[code].openright = "1";
} else if (trainlisttest.list[code].openright != data.command && data.command == 'K') {
trainlisttest.list[code].openright = data.command;
for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset();
actions[code].down[an].time = 0;
@ -653,18 +652,18 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}
}else{
if(data.doorCode == "1"){
if(data.code == "1"){
if(trainlisttest.list[code].openleft != data.open && data.open == "0"){
trainlisttest.list[code].openleft = "0";
if(trainlisttest.list[code].openleft != data.command && data.command == "G"){
trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
}else if(trainlisttest.list[code].openleft != data.open && data.open == "1"){
trainlisttest.list[code].openleft = "1";
}else if(trainlisttest.list[code].openleft != data.command && data.command == "K"){
trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = 0;
@ -675,16 +674,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}else{
if (trainlisttest.list[code].openright != data.open && data.open == '0') {
trainlisttest.list[code].openright = '0';
if (trainlisttest.list[code].openright != data.command && data.command == 'G') {
trainlisttest.list[code].openright = data.command;
for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1;
actions[code].down[an].play();
}
} else if (trainlisttest.list[code].openright != data.open && data.open == '1') {
trainlisttest.list[code].openright = "1";
} else if (trainlisttest.list[code].openright != data.command && data.command == 'K') {
trainlisttest.list[code].openright = data.command;
for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset();
actions[code].down[an].time = 0;
@ -696,6 +695,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}
}
}
function trainstatus(data){
@ -758,15 +759,15 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function initstand(data) {
code = data.code;
if ( actions[code]) {
if (data.close == '1') {
actions[code].status = '1';
if (data.command == 'K') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.close == '0') {
actions[code].status = '0';
if (data.command == 'G') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
@ -776,17 +777,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}
function standupdate(data) {
code = data.code;
if ( actions[code]) {
if (data.open == '1') {
actions[code].status = '1';
if (data.command == 'K') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.open == '0') {
actions[code].status = '0';
if (data.command == 'G') {
actions[code].status = data.command;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
@ -797,33 +797,70 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function signalupdate(data) {
code = data.code;
if(signallist.list[code]){
if(data.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
/** 无显示,灭灯 */
if(data.command == 'No'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红 */
if(data.command == 'R'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
}
@ -831,40 +868,40 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function initswitch(data) {
code = data.code;
if (data.routeLock == '0') {
if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.routeLock == '1') {
actions[code].command = data.command;
} else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
actions[code].command = data.command;
}
}
function switchupdate(data) {
code = data.code;
if (actions[code].normal != data.normal) {
if (data.normal == '1') {
if (actions[code].command != data.command) {
if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "1";
} else if (data.normal == '0') {
actions[code].command = data.command;
} else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "0";
actions[code].command = data.command;
}
}
}

View File

@ -60,6 +60,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/traffi
//老版本临时ai控制
let olddataai = false;
//北交大车站管理
export function Jl3dStationManager(dom,skinCode,routegroup,initCode) {
// let stats = new Stats();

View File

@ -60,6 +60,8 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/sta
//老版本临时ai控制
let olddataai = false;
//北交大列车管理
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// let stats = new Stats();

View File

@ -52,6 +52,7 @@ export function SwitchListN() {
let mixer = new THREE.AnimationMixer( autoswitch );
actions[autoswitch.code] = {
normal:"00",
command:"",
action:mixer.clipAction( autoswitch.animations[0])
};
actions[autoswitch.code].action.setLoop(THREE.LoopOnce);

View File

@ -32,8 +32,7 @@ deviceState[deviceType.Switch] = {
blockade: 0, // 是否封锁
routeLock: 0, // 是否进路锁闭
overlapLock: 0, // 是否进路延续保护锁闭
normalPosition: 1, // 是否定位
reversePosition: 0, // 是否反位
pos:'N', // // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
isCiConfirm: 0, // 是否进行联锁确认
/** 定位状态*/
// locateType: {
@ -72,9 +71,7 @@ deviceState[deviceType.Switch] = {
deviceState[deviceType.Signal] = {
blockade: 0, // 是否锁闭
logicLight: 0, // 逻辑点灯
greenOpen: 0, // 绿灯开放
yellowOpen: 0, // 黄灯开放
redOpen: 1, // 红灯开放(默认状态)
aspect:'R', // 信号机颜色默认状态
delayTime: 0, // 信号机延迟解锁倒计时
atsControl: 1, // 0是人工1是自动
checkConflict:0, // 0是不检查冲突1是检测冲突检测冲突进路

View File

@ -45,8 +45,7 @@ class Status {
blockade: device.blockade, // 是否封锁
routeLock: device.routeLock, // 是否进路锁闭
overlapLock: device.overlapLock, // 是否进路延续保护锁闭
normalPosition: device.normalPosition, // 是否定位
reversePosition: device.reversePosition, // 是否反位
pos:device.pos, // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
fault: device.fault /** 非故障*/
};
}
@ -56,9 +55,7 @@ class Status {
atsControl: device.atsControl, /** 0是人工控制1是自动控制 */
blockade: device.blockade,
logicLight: device.logicLight,
greenOpen: device.greenOpen,
redOpen: device.redOpen,
yellowOpen: device.yellowOpen,
aspect:device.aspect, // 信号机颜色默认状态 R-红 G-绿 Y-黄 W-月白 B-蓝 RY-红黄 RW-红白 GG-绿绿 GY-绿黄 YY-黄黄 RF-红闪 YF-黄闪 GF-绿闪 WF-白闪
ciControl: device.ciControl || 0,
canSetCi: !!device.canSetCi
};

View File

@ -93,12 +93,12 @@ export default class EBadShunt extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -93,12 +93,12 @@ export default class ELimitLines extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -396,17 +396,18 @@ export default class Section extends Group {
const sectionB = this.mapDevice[switchModel.sectionBCode];
const sectionC = this.mapDevice[switchModel.sectionCCode];
const sectionA = this.mapDevice[switchModel.sectionACode];
if (switchModel && switchModel.normalPosition === 1) {
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (switchModel && switchModel.pos === 'N') {
this.setSwitchSectionColor(sectionC, sectionB);// 定位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionC, sectionB);// 反位转定位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
this.setSwitchSectionColor(sectionC, sectionB);// 定位变失表或定位失表
} else if (switchModel && switchModel.reversePosition === 1) {
} else if (switchModel && switchModel.pos === 'R') {
this.setSwitchSectionColor(sectionB, sectionC); // 反位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionB, sectionC); // 定位转反位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
this.setSwitchSectionColor(sectionB, sectionC);// 反位变失表后反位失表
}
if (this.style.Section.switchFault && switchModel.fault === 'SQUEEZE') {

View File

@ -825,8 +825,6 @@ class Signal extends Group {
}
if (this.style.Signal.post.autoRouteColor) {
this.sigPost.setColor(this.style.Signal.post.autoRouteColor);
} else if (this.style.Signal.post.autoRouteVerColor) {
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
}
}
@ -975,10 +973,33 @@ class Signal extends Group {
model.isRouteSignal && this.setLowButtonShow();
/** 设置灯的颜色 */
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
switch (model.aspect) {
// 红
case 'R': {
this.close(model.logicLight); // 信号关闭
break;
}
// 绿
case 'G': {
this.openPositive(model.logicLight); // 信号正向开放
break;
}
// 黄
case 'Y': {
this.openLateral(model.logicLight); // 信号侧向开放
break;
}
// 红黄
case 'RY': {
this.guid(); // 引导信号显示
break;
}
default: {
this.close(model.logicLight); // 信号关闭
break;
}
}
if (model.remainTime) {
this.showRemainTime(model.remainTime);
} else {
@ -1043,12 +1064,15 @@ class Signal extends Group {
});
}
}
// LEVEL_Close = 0;---关闭 LEVEL_Guide = 1;-----引导级 LEVEL_Atp = 2;-----ATP级 LEVEL_Main = 3-----主信号级
if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.mainSignalVerColor);
} else if (model.level === 1 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
} else if (model.level === 0 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.closeSignalVerColor);
} else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
} else if (model.level === 1 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor);
} else if (model.level === 2 && this.style.Signal.post.autoRouteVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
}
if (this.style.Signal.lamp.special) {
@ -1068,7 +1092,7 @@ class Signal extends Group {
this.tText && this.tText.show();
}
// 设置灰显
if (model.noStatus || model.level === 0) {
if (model.noStatus) {
this.setAshShow();
}

View File

@ -77,22 +77,22 @@ class EMouse extends Group {
});
this.textRect && this.textRect.show();
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.show();
this.device.shapeModelB.show();
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
this.device.shapeModelA.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
this.device.shapeModelB.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
}
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.show();
this.device.shapeModelB.show();
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
this.device.shapeModelA.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
});
this.device.shapeModelB.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
});
}
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
@ -102,33 +102,34 @@ class EMouse extends Group {
}
}
mouseout(e) {
mouseout(e) {
if (!this.device.__down) {
this.switchBorder && this.switchBorder.hide();
this.device.setTextStyle({
textFill: this.device.style.backgroundColor
});
this.textRect && this.textRect.hide();
this.device.setState(this.device.model);
this.switchBorder && this.switchBorder.hide();
this.device.setTextStyle({
textFill: this.device.style.backgroundColor
});
this.textRect && this.textRect.hide();
this.device.setState(this.device.model);
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
if (this.device.model.normalPosition) {
this.device.shapeModelA.hide();
this.device.shapeModelB.show();
} else {
this.device.shapeModelA.show();
this.device.shapeModelB.show();
}
}
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
// if (this.device.model.normalPosition) {
if (this.device.model.pos == 'N') {
this.device.shapeModelA.hide();
this.device.shapeModelB.show();
} else {
this.device.shapeModelA.show();
this.device.shapeModelB.show();
}
}
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseEvent.mouseLeave(e);
}
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseEvent.mouseLeave(e);
}
}
}

View File

@ -434,15 +434,17 @@ export default class Switch extends Group {
.when(1000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(fault, normalPosition, reversePosition) {
if (this.style.Switch.jointImg.faultStatus && fault && !reversePosition && !normalPosition ) { // 宁波线失表状态
this.setForkAction(); // 道岔挤岔
// N-定位 R-反位 NO-无(失表) EX-挤叉
setSwitchFault(fault, pos) {
if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态
this.setForkAction(fault); // 道岔挤岔
} else if (this.style.Switch.faultNoHandle ) {
this.shapeModelA.hide();
this.shapeModelB.hide();
this.shapeModelC.hide();
} else {
if (this.model.switchFaultCode && (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))) {
// (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
if (this.model.switchFaultCode && (pos == 'NO' || pos == 'EX') ) {
const switchFault = this.mapDevice[this.model.switchFaultCode];
switchFault.instance.setControlColor('#F00', true);
} else if (this.model.switchFaultCode) {
@ -456,7 +458,7 @@ export default class Switch extends Group {
}
}
/** 挤叉*/
setForkAction() {
setForkAction(fault) {
if (this.style.Switch.jointImg.fork) {
this.recover();
this.shapeModelB.show();
@ -484,11 +486,13 @@ export default class Switch extends Group {
.start();
});
this.setTextColor('red');
} else {
this.setLossAction(fault); // 若不是具有特殊的挤岔,则显示状态和失表一样
}
}
/** 单锁*/
setMonolock(normalPosition, reversePosition) {
setMonolock(pos) {
if (this.style.Switch.rectLock &&
this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示
this.lockRect.show();
@ -504,9 +508,9 @@ export default class Switch extends Group {
if (this.style.Switch.arcBlcok &&
this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示
this.lockArc.show();
if (normalPosition) {
if (pos == 'N') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor });
} else if (reversePosition) {
} else if (pos == 'R') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
}
}
@ -514,7 +518,7 @@ export default class Switch extends Group {
}
/** 封锁 */
block(normalPosition, reversePosition) {
block(pos) {
if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示
this.shapeModelB.show();
this.shapeModelB.animateStyle(item => {
@ -548,10 +552,10 @@ export default class Switch extends Group {
this.setTextColor(this.style.Switch.text.blockText);
}
if (this.style.Switch.jointImg.trapezoidBlock) { // 范围且封锁时显示
if (normalPosition) {
if ( pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor('#000080');
} else if (reversePosition) {
} else if ( pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor('#000080');
}
@ -601,11 +605,11 @@ export default class Switch extends Group {
// 处理岔芯颜色
setSectionState(state) {
const sectionC = this.mapDevice[state.sectionCCode];
if (sectionC && state.reversePosition && !state.blockade) {
if (sectionC && state.pos == 'R' & !state.blockade) {
this.setSwitchModelStatus(this.shapeModelA, sectionC);
}
const sectionA = this.mapDevice[state.sectionACode];
if (sectionA && state.normalPosition && !this.style.Switch.core.graphShow && !state.blockade) {
if (sectionA && state.pos == 'N' && !this.style.Switch.core.graphShow && !state.blockade) {
this.setSwitchModelStatus(this.shapeModelB, sectionA);
}
}
@ -651,23 +655,23 @@ export default class Switch extends Group {
this.shapeModelC.setColor('#7F7F7F');
this.name.getNameText().setStyle({textFill: '#7F7F7F'});
}
preReset(normalPosition, reversePosition ) {
preReset(pos) {
const coverBlock = this.style.Switch.coverBlock;
if (coverBlock && coverBlock.preResetColor) { // 范围且封锁时显示
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(coverBlock.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(coverBlock.preResetColor);
}
} else {
const sectionReset = this.style.Section.sectionMiddle;
if (sectionReset && sectionReset.preResetColor) {
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(sectionReset.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(sectionReset.preResetColor);
}
@ -682,13 +686,13 @@ export default class Switch extends Group {
} else if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => { item.hide(); });
} else if (model._free) {
if (model.normalPosition) {
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
if (model.routeLock) {
@ -698,23 +702,26 @@ export default class Switch extends Group {
this.setAshShow();
}
} else {
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
if (model.normalPosition) {
this.setSwitchFault(model.fault, model.pos);
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else {
} else if (model.pos == 'NO') {
this.setLossAction(model.fault); // 失去
if (model.switchSplit) {
this.setForkAction();
}
} else if (model.pos == 'EX') {
this.setForkAction(model.fault); // 挤岔
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
model.blockade && this.block(model.pos); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
if (!path.includes('/map/draw')) {
@ -724,7 +731,7 @@ export default class Switch extends Group {
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
model.preReset && this.preReset(model.pos); // 道岔预复位
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];

View File

@ -243,7 +243,7 @@ export default {
}
case OperationEvent.Signal.reopenSignal.button.operation: {
//
if (selectType.greenOpen) {
if (selectType.aspect == 'G') { // 绿
this.$refs.noticeInfo.doShow(`信号机[${selectType.name}(${selectType.code})]已开启,无需重开信号机`);
} else {
//

View File

@ -173,14 +173,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -316,7 +316,7 @@ export default {
},
checkRoutes(routes) {
const route = routes.filter(route => {
return route.greenOpen;
return route.aspect == 'G';
});
return route[0].code;
},

View File

@ -222,7 +222,7 @@ export default {
methods: {
passWordCommit(data) {
let operate = {};
if (data.overNext) {
if (data.overNext) {
operate = {
over: true,
code: data.code,
@ -348,7 +348,7 @@ export default {
}
}
//
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { //
if (signal.aspect == 'R' && isArrangementRoute) { //
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
operate.code = deviceList[0].code;
@ -538,7 +538,7 @@ export default {
this.deviceList = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
operate['operation'] = this.Command.close.password.operation;
operate['operation'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
}).catch((error) => {
@ -550,7 +550,7 @@ export default {
const operate = {
over: true,
code: deviceList[1].code,
cmdType: this.cmdType,
cmdType: this.cmdType,
operation: this.$store.state.menuOperation.buttonOperation,
overNext: true
};
@ -575,12 +575,12 @@ export default {
handleTotalHumanSolution(model) {
const operate = {
send: true,
overNext: true,
code: model.code,
overNext: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation
};
if (model.yellowOpen && model.redOpen) {
if (model.aspect == 'RY') {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE;
operate.param = {signalCode: model.code};
this.deviceList = [];
@ -588,7 +588,7 @@ export default {
} else {
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
operate.param = {signalCode: model.code};
operate.val = model.code;
operate.val = model.code;
this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
console.error(error);
@ -744,7 +744,7 @@ export default {
},
clearOperate() {
Handler.clear(); //
this.deviceList = [];
this.deviceList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}

View File

@ -446,6 +446,10 @@ export const menuOperate = {
restartInterlockMachine: {
operation: OperationEvent.Station.restartInterlockMachine.menu.operation,
cmdType: CMD.Station.CMD_STATION_RESTART_INTERLOCK_MACHINE
},
guideLock:{
operation: OperationEvent.Station.guideLock.button.operation,
cmdType: CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK
}
},
// 设置/取消强制点灯

View File

@ -146,7 +146,7 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
@ -193,19 +193,32 @@ export default {
}
},
operationHandler(buttonOperation, selectType) {
debugger;
switch (buttonOperation) {
case OperationEvent.Section.fault.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
this.locate(selectType);
}
debugger;
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
case OperationEvent.Section.axlePreReset.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
this.reverse(selectType);
}
debugger;
commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
}

View File

@ -213,14 +213,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -1,6 +1,7 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<menu-deplot-button ref="menuDeplotButton" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
@ -15,6 +16,7 @@
<script>
import { mapGetters } from 'vuex';
import MenuDeplotButton from './menuDeplotButton';
import MenuSignal from './menuSignal';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
@ -30,6 +32,7 @@ export default {
name: 'Menus',
components: {
MenuBar,
MenuDeplotButton,
MenuSignal,
MenuSwitch,
MenuSection,
@ -53,7 +56,7 @@ export default {
'width'
]),
isShowBar() {
return this.$store.state.training.prdType && this.$store.state.training.prdType !== '07';
return this.$store.state.training.prdType && this.$store.state.training.prdType !== '07' && this.$store.state.training.prdType != '09';
}
},
watch: {

View File

@ -0,0 +1,471 @@
<template>
<div v-if="isShowBtn">
<div id="menuButtons_box" class="menu menuButton" :style="{ left: point.x + 'px', top: point.y + 'px' }">
<!-- style="height: 45px;" -->
<button
:id="Switch.locate.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.locate.button.operation)"
>
<span class="buttonColor">总定</span>
<span v-if="operation==Switch.locate.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Switch.reverse.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.reverse.button.operation)"
>
<span class="buttonColor">总反</span>
<span v-if="operation==Switch.reverse.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Switch.lock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.lock.button.operation)"
>
<span class="buttonColor">单锁</span>
<span v-if="operation==Switch.lock.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Switch.unlock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.unlock.button.operation)"
>
<span class="buttonColor">单解</span>
<span v-if="operation==Switch.unlock.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Switch.block.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.block.button.operation)"
>
<span class="buttonColor">岔封</span>
<span v-if="operation==Switch.block.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Switch.unblock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Switch.unblock.button.operation)"
>
<span class="buttonColor">岔解</span>
<span v-if="operation==Switch.unblock.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Signal.lock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Signal.lock.button.operation)"
>
<span class="buttonColor">钮封</span>
<span v-if="operation==Signal.lock.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Signal.unlock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Signal.unlock.button.operation)"
>
<span class="buttonColor">钮解</span>
<span v-if="operation==Signal.unlock.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Signal.cancelTrainRoute.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)"
>
<span class="buttonColor">取消</span>
<span v-if="operation==Signal.cancelTrainRoute.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Section.fault.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor, color: '#DA2D29' }"
@click="buttonDown(Section.fault.button.operation)"
>
<span class="buttonColor">区解</span>
<span v-if="operation==Section.fault.button.operation">{{ '('+delayTime+')' }}</span>
</button>
<!-- 引导总锁暂时 -->
<button
:id="Station.guideLock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor, color: '#DA2D29' }"
@click="buttonDown(Station.guideLock.button.operation)"
>
<span class="buttonColor">总锁</span>
<!-- // -->
</button>
<!-- 人解列车进路 (总人解) -->
<button
:id="Signal.humanTrainRoute.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor, color: '#DA2D29' }"
@click="buttonDown(Signal.humanTrainRoute.button.operation)"
>
<span class="buttonColor">人解</span>
<span v-if="operation==Signal.humanTrainRoute.button.operation&&delayTime">{{ '('+delayTime+')' }}</span>
</button>
<button
:id="Station.powerUnLock.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor, color: '#DA2D29' }"
@click="buttonDown(Station.powerUnLock.button.operation)"
>
<span class="buttonColor">上电解锁</span>
</button>
<!-- <button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor,color:'#DA2D29'}" @click="buttonDown(Section.fault.button.operation)">
<span class="buttonColor">分路不良</span>
</button> -->
</div>
<div id="menuButton">
<div class="promptInfo">
<span class="status_lable">提示<br>信息</span>
<span class="status_detailInfo" style="color: #fd00f4">{{ promptInfo }}</span>
</div>
<div class="alamMessage">
<span class="status_lable">报警<br>信息</span>
<span class="status_detailInfo" style="color: #e61013">{{ alamMessage }}</span>
</div>
<div class="delayTime">
<span class="status_lable">延时<br>时间</span>
<span class="status_detailInfo" style="color: #e61013">{{ '' }}</span>
<!-- {{ delayInfo }} -->
<!-- {{ delayTime }} -->
</div>
</div>
<password-box ref="password" pop-class="fuzhou-01__systerm" @checkOver="passWordCommit" />
<notice-info ref="noticeInfo" pop-class="fuzhou-01__systerm" />
</div>
</template>
<script>
import PasswordBox from '@/jmapNew/theme/components/menus/childDialog/passwordInputBox';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import Handler from '@/scripts/cmdPlugin/Handler';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'MenuDeplotButton',
components: {
PasswordBox,
NoticeInfo
},
data() {
return {
point: {
x: 130,
y: 0
},
inter: null,
operation: '0',
delayTime: '',
// delayInfo: '',
promptInfo: '',
alamMessage: '',
deviceList: [],
buttonDownColor: '#A8A8A8',
buttonUpColor: '#F0F0F0',
width: 85
};
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Signal() {
return OperationEvent.Signal;
},
Command() {
return OperationEvent.Command;
},
Section() {
return OperationEvent.Section;
},
Station() {
return OperationEvent.Station;
},
isShowBtn() {
return this.$store.state.training.prdType == '09';
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
}
},
beforeDestroy() {
this.resetMbmButton();
Handler.clear(); //
},
methods: {
updateButtonShow(val, old) {
if (old) {
//
// this.promptInfo = '';
const domId = OperationHandler.getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = OperationHandler.getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
// this.promptInfo = dom.innerText;
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
//
trainingOperation(operate) {
const that = this;
that.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
const stationCode = this.$store.state.training.roleDeviceCode;
if (stationCode) {
switch (that.operation) {
case that.Station.guideLock.button.operation: {
commitOperate(menuOperate.Station.guideLock, { stationCode: stationCode }, 3)
.then(({ valid, operate }) => {
if (valid) {
// this.$refs.routeLock.doShow(operate, this.selected);
} else {
this.$refs.noticeInfo.doShow();
}
that.operation = '';
that.resetMbmButton();
})
.catch((error) => {
that.resetMbmButton();
that.operation = '';
console.error(error);
that.$refs.noticeInfo.doShow();
});
break;
}
case that.Station.powerUnLock.button.operation: {
commitOperate(menuOperate.Station.powerUnLock, { stationCode: stationCode }, 3)
.then(({ valid, operate }) => {
if (valid) {
// this.$refs.routeLock.doShow(operate, this.selected);
} else {
that.$refs.noticeInfo.doShow();
}
that.operation = '';
that.resetMbmButton();
})
.catch((error) => {
that.operation = '';
that.resetMbmButton();
console.error(error);
that.$refs.noticeInfo.doShow();
});
break;
}
default: {
that.setCountDown({ time: 10 }, () => {});
break;
}
}
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
passWordCommit(data) {
let operate = {};
if (data.overNext) {
operate = {
over: true,
code: data.code,
operation: data.operation,
cmdType: this.cmdType,
param: data.param
};
} else if (data.nextCmdType) {
operate = {
over: true,
operation: data.operation,
cmdType: data.nextCmdType
};
} else {
operate = {
operation: data.operateNext
};
}
this.trainingOperation(operate);
},
resetMbmButton() {
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
buttonDown(operation) {
//
this.deviceList = [];
// if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation
};
// ()
const operationList = [
this.Section.fault.button.operation,
this.Signal.humanTrainRoute.button.operation,
this.Station.guideLock.button.operation,
this.Station.powerUnLock.button.operation
];
// Section.fault.button.operation
const operationDelayList = [
this.Switch.locate.button.operation,
this.Switch.reverse.button.operation,
this.Switch.lock.button.operation,
this.Switch.unlock.button.operation,
this.Switch.block.button.operation,
this.Switch.unblock.button.operation,
this.Signal.lock.button.operation,
this.Signal.unlock.button.operation,
this.Signal.cancelTrainRoute.button.operation
];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.operation = operation;
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
//
if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
//
if (operationDelayList.includes(operation)) {
// info: ''
this.setCountDown({ time: 10 }, () => {});
}
this.$store.dispatch('training/emitTipFresh');
}
});
},
/**
* 设定倒计时
* @param {Object} option
* @param {Number} option.time 倒计时时间()
* @param {String} option.info 提示信息
* @param {Function} cb Callback
*/
setCountDown({ time }, cb) {
this.delayTime = time;
clearInterval(this.timer);
this.timer = setInterval(() => {
this.delayTime = --time;
if (this.delayTime === 0) {
this.clearCountDown();
cb();
}
}, 1000);
},
/**
* 取消并清理倒计时
*/
clearCountDown() {
this.delayTime = '';
this.operation = '';
clearInterval(this.timer);
this.resetMbmButton();
this.timer = null;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;
$hoverBg: #f5f7fa;
.button_box {
display: block;
cursor: pointer;
float: left;
padding-top: 5px;
padding-bottom: 5px;
outline: none;
border-right-color: #a8a8a8;
border-bottom: none;
border-left: none;
color: #7574c0;
.buttonColor {
}
}
.menu {
background-color: $bg;
position: fixed;
z-index: 10;
display: block;
.dsp-block {
display: block;
text-align: center;
border-radius: unset;
width: 100%;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
#menuButton {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
z-index: 2;
background: #f0f0f0;
box-shadow: 0px -3px 6px #909090;
}
.promptInfo {
width: 33%;
float: left;
font-size: 15px;
padding: 5px 0px;
padding-left: 10px;
}
.alamMessage {
width: 33%;
float: left;
font-size: 15px;
padding: 5px 0px;
}
.delayTime {
font-size: 15px;
padding: 5px 0px;
}
.status_lable {
color: #1815b1;
display: inline-block;
}
.status_detailInfo {
margin-left: 10px;
display: inline-block;
vertical-align: top;
margin-top: 10px;
font-size: 16px;
font-weight: bold;
letter-spacing: 3px;
}
</style>

View File

@ -169,6 +169,11 @@ export default {
} else {
this.doClose();
}
},
'$store.state.menuOperation.selectedCount': function (val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
},
mounted() {
@ -252,6 +257,26 @@ export default {
}
});
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
//
case OperationEvent.Section.fault.button.operation: {
commitOperate(menuOperate.Section.fault, {sectionCode: selectType.code}, 3).then(({valid, operate}) => {
if (valid) {
} else {
this.$refs.noticeInfo.doShow();
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
}
default: {
break;
}
}
},
//
fault() {
commitOperate(menuOperate.Section.fault, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {

View File

@ -26,7 +26,8 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SignalMenu',
@ -52,6 +53,8 @@ export default {
data() {
return {
menu: [],
clickNum:0,
oldSelected:null,
menuNormal: {
Local: [
{
@ -208,16 +211,9 @@ export default {
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
]),
...mapGetters('map', [
'routeList'
]),
...mapGetters('training', ['mode', 'operatemode']),
...mapGetters('menuOperation', ['buttonOperation']),
...mapGetters('map', ['routeList']),
group() {
return this.$route.query.group;
}
@ -229,6 +225,76 @@ export default {
} else {
this.doClose();
}
},
'$store.state.menuOperation.selectedCount': function (val) {
if (this.$store.state.menuOperation.selected._type == 'Signal') {
if (this.buttonOperation) {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
this.$parent.$refs.menuDeplotButton.clearCountDown();
} else {
//
const signal = this.$store.state.menuOperation.selected;
if (this.clickNum >= 1) {
let route = null;
this.routeList.forEach(elem => {
if (elem.startSignalCode === this.oldSelected.code) {
if (elem.endSignalCode === signal.code) {
route = elem;
}
// const signalCode = this.$store.getters['map/getDeviceByCode'](elem.endSignalCode);
// const data = Object.assign({_type: 'Signal'}, signalCode);
// data.isRouteActive = false;
// this.$store.dispatch('map/updateMapDevices', data);
}
});
if (route) {
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:route.code}, 3).then(({valid, operate})=>{
}).catch(error=>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
} else {
this.$refs.noticeInfo.doShow(`没有以[${this.oldSelected.name}(${this.oldSelected.code})]为始端信号机,以[${signal.name}(${signal.code})] 为终端信号机的进路`);
}
this.clickNum = 0;
} else {
let isArrangementRoute = false;
const sectionModel = this.$store.getters['map/getDeviceByCode'](signal.sectionCode);
if (sectionModel) {
//
const sectionLeft = this.$store.getters['map/getDeviceByCode'](sectionModel.leftSectionCode);
const sectionRight = this.$store.getters['map/getDeviceByCode'](sectionModel.rightSectionCode);
if (sectionLeft.routeLock || sectionRight.routeLock) {
isArrangementRoute = true;
}
}
//
if (signal.aspect == 'R' && isArrangementRoute) { //
commitOperate(menuOperate.Signal.reopenSignal, { signalCode: signal.code }, 3).then(({ valid, operate }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
} else {
this.oldSelected = signal;
// this.routeList.forEach(elem => {
// if (elem.startSignalCode === this.oldSelected.code) {
// const signalCode = this.$store.getters['map/getDeviceByCode'](elem.endSignalCode);
// const data = Object.assign({_type: 'Signal'}, signalCode);
// data.isRouteActive = true;
// this.$store.dispatch('map/updateMapDevices', data);
// }
// });
this.clickNum++;
}
}
}
this.$parent.$refs.menuDeplotButton.clearCountDown();
}
}
},
methods: {
@ -239,6 +305,80 @@ export default {
this.menu = this.menuForce;
}
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
//
case OperationEvent.Signal.lock.button.operation: {
commitOperate(menuOperate.Signal.lock, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
}
//
case OperationEvent.Signal.unlock.button.operation: {
// this.unlock(selectType);
commitOperate(menuOperate.Signal.unlock, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
}
//
case OperationEvent.Signal.cancelTrainRoute.button.operation: {
commitOperate(menuOperate.Signal.cancelTrainRoute, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
}
//
case OperationEvent.Signal.humanTrainRoute.button.operation: {
commitOperate(menuOperate.Signal.humanTrainRoute, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
}
// Signal_Human_Release_Route
default: {
break;
}
}
},
doShow(point) {
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
@ -252,7 +392,7 @@ export default {
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
@ -260,7 +400,7 @@ export default {
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
@ -269,7 +409,7 @@ export default {
//
getRouteList(selectType) {
const routes = [];
this.routeList.forEach(elem => {
this.routeList.forEach((elem) => {
if (elem.startSignalCode === selectType.code) {
routes.push(elem);
}
@ -278,7 +418,7 @@ export default {
},
//
arrangementRoute() {
commitOperate(menuOperate.Signal.arrangementRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.arrangementRoute, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected));
}
@ -286,7 +426,7 @@ export default {
},
//
cancelTrainRoute() {
commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.cancelTrainRoute, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -294,7 +434,7 @@ export default {
},
//
lock() {
commitOperate(menuOperate.Signal.lock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.lock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeLock.doShow(operate, this.selected);
}
@ -302,7 +442,7 @@ export default {
},
//
unlock() {
commitOperate(menuOperate.Signal.unlock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.unlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected);
}
@ -310,7 +450,7 @@ export default {
},
//
reopenSignal() {
commitOperate(menuOperate.Signal.reopenSignal, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.reopenSignal, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -318,7 +458,7 @@ export default {
},
//
guide() {
commitOperate(menuOperate.Signal.guide, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.guide, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected);
}
@ -326,7 +466,7 @@ export default {
},
//
setAutoInterlock() {
commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.setAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -334,7 +474,7 @@ export default {
},
//
cancelAutoInterlock() {
commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.cancelAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -342,7 +482,7 @@ export default {
},
//
setAutoTrigger() {
commitOperate(menuOperate.Signal.setAutoTrigger, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.setAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -350,7 +490,7 @@ export default {
},
//
cancelAutoTrigger() {
commitOperate(menuOperate.Signal.cancelAutoTrigger, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.cancelAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -358,7 +498,7 @@ export default {
},
//
signalClose() {
commitOperate(menuOperate.Signal.signalClose, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.signalClose, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
@ -366,7 +506,7 @@ export default {
},
// ()
humanControl() {
commitOperate(menuOperate.Signal.humanControl, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.humanControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
}
@ -374,7 +514,7 @@ export default {
},
// ATS
atsAutoControl() {
commitOperate(menuOperate.Signal.atsAutoControl, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Signal.atsAutoControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
}
@ -382,7 +522,7 @@ export default {
},
//
detail() {
commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.Signal.detail, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeDetail.doShow(operate, this.selected, this.getRouteList(this.selected));
}

View File

@ -11,340 +11,364 @@
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import SwitchCmdControl from './dialog/switchCmdControl';
import SpeedCmdControl from '@/jmapNew/theme/components/menus/dialog/speedCmdControl';
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import PopMenu from '@/components/PopMenu'
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl'
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'
import SwitchCmdControl from './dialog/switchCmdControl'
import SpeedCmdControl from '@/jmapNew/theme/components/menus/dialog/speedCmdControl'
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock'
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum'
import { mapGetters } from 'vuex'
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'
export default {
name: 'SwitchMenu',
components: {
PopMenu,
SwitchControl,
SwitchCmdControl,
SpeedCmdControl,
NoticeInfo,
SetFault,
SwitchHookLock
name: 'SwitchMenu',
components: {
PopMenu,
SwitchControl,
SwitchCmdControl,
SpeedCmdControl,
NoticeInfo,
SetFault,
SwitchHookLock,
},
props: {
selected: {
type: Object,
default() {
return null
},
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '道岔单锁',
handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: '道岔单解',
handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
label: '道岔封锁',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: '故障解锁',
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: '计轴预复位',
handler: this.axlePreReset,
cmdType:CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}
],
Center: [
{
label: '道岔单锁',
handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: '道岔单解',
handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
label: '道岔封锁',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
{
label: '故障解锁',
handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}
//
]
},
menuForce: [
{
label: this.$t('menu.menuSwitch.setFault'),
handler: this.setStoppage
},
{
label: this.$t('menu.menuSwitch.cancelFault'),
handler: this.cancelStoppage
},
{
label: this.$t('menu.menuSection.triggerFaultManagement'),
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
//
if (this.operatemode === OperateMode.FAULT) {
// if (!this.$store.state.scriptRecord.bgSet) {
const menuHook = [{
label: '道岔钩锁',
handler: this.hookLock
}];
this.menu = [...this.menuForce, ...menuHook];
// } else {
// this.menu = this.menuForce;
// }
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
},
{
label: '道岔封锁',
handler: this.block,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
},
{
label: '道岔解封',
handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType: CMD.Switch.CMD_SWITCH_TURN,
},
{
label: '故障解锁',
handler: this.fault,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
},
{
label: '计轴预复位',
handler: this.axlePreReset,
cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET,
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
},
],
Center: [
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
},
{
label: '道岔封锁',
handler: this.block,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
},
{
label: '道岔解封',
handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
},
{
label: '道岔转动',
handler: this.switchTurnout,
cmdType: CMD.Switch.CMD_SWITCH_TURN,
},
{
label: '故障解锁',
handler: this.fault,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
},
{
label: this.$t('menu.menuSwitch.sectionResection'),
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
},
{
label: this.$t('menu.menuSwitch.sectionActive'),
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
},
//
],
},
menuForce: [
{
label: this.$t('menu.menuSwitch.setFault'),
handler: this.setStoppage,
},
doShow(point) {
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
{
label: this.$t('menu.menuSwitch.cancelFault'),
handler: this.cancelStoppage,
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
{
label: this.$t('menu.menuSection.triggerFaultManagement'),
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT,
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
},
//
lock() {
commitOperate(menuOperate.Switch.lock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
unlock() {
commitOperate(menuOperate.Switch.unlock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected);
}
});
},
//
block() {
commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
unblock() {
commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected);
}
});
},
//
switchTurnoutForce() {
commitOperate(menuOperate.Switch.turnoutForce, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
switchTurnout() {
commitOperate(menuOperate.Switch.turnout, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
fault() {
commitOperate(menuOperate.Switch.fault, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected);
}
});
},
//
axlePreReset() {
commitOperate(menuOperate.Switch.axlePreReset, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected);
}
});
},
//
split() {
commitOperate(menuOperate.Switch.split, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
active() {
commitOperate(menuOperate.Switch.active, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
setSpeed() {
commitOperate(menuOperate.Switch.setSpeed, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.speedCmdControl.doShow(operate, this.selected);
}
});
},
//
cancelSpeed() {
commitOperate(menuOperate.Switch.cancelSpeed, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) {
this.$refs.speedCmdControl.doShow(operate, this.selected);
}
});
},
//
hookLock() {
this.$refs.switchHookLock.doShow(this.selected);
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
}
],
}
};
},
computed: {
...mapGetters('training', ['mode', 'operatemode']),
...mapGetters('menuOperation', ['buttonOperation']),
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition)
} else {
this.doClose()
}
},
'$store.state.menuOperation.selectedCount': function (val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected)
this.$parent.$refs.menuDeplotButton.clearCountDown()
}
},
},
methods: {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal)
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
// if (!this.$store.state.scriptRecord.bgSet) {
const menuHook = [
{
label: '道岔钩锁',
handler: this.hookLock,
},
]
this.menu = [...this.menuForce, ...menuHook]
// } else {
// this.menu = this.menuForce;
// }
}
},
operationHandler(buttonOperation, selected) {
const map = new Map([
[OperationEvent.Switch.locate.button.operation, menuOperate.Switch.locate],
[OperationEvent.Switch.reverse.button.operation, menuOperate.Switch.reverse],
[OperationEvent.Switch.lock.button.operation, menuOperate.Switch.lock],
[OperationEvent.Switch.unlock.button.operation, menuOperate.Switch.unlock],
[OperationEvent.Switch.block.button.operation, menuOperate.Switch.block],
[OperationEvent.Switch.unblock.button.operation, menuOperate.Switch.unblock],
])
commitOperate(map.get(buttonOperation), { switchCode: selected.code }, 3)
.then(({ valid }) => {
if (valid) {
} else {
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
},
doShow(point) {
this.initMenu()
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point)
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close()
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected)
}
})
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected)
}
})
},
//
lock() {
commitOperate(menuOperate.Switch.lock, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
unlock() {
commitOperate(menuOperate.Switch.unlock, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected)
}
})
},
//
block() {
commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
unblock() {
commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected)
}
})
},
//
switchTurnoutForce() {
commitOperate(menuOperate.Switch.turnoutForce, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
switchTurnout() {
commitOperate(menuOperate.Switch.turnout, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
fault() {
commitOperate(menuOperate.Switch.fault, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected)
}
})
},
//
axlePreReset() {
commitOperate(menuOperate.Switch.axlePreReset, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchCmdControl.doShow(operate, this.selected)
}
})
},
//
split() {
commitOperate(menuOperate.Switch.split, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
active() {
commitOperate(menuOperate.Switch.active, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected)
}
})
},
//
setSpeed() {
commitOperate(menuOperate.Switch.setSpeed, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.speedCmdControl.doShow(operate, this.selected)
}
})
},
//
cancelSpeed() {
commitOperate(menuOperate.Switch.cancelSpeed, { switchCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.speedCmdControl.doShow(operate, this.selected)
}
})
},
//
hookLock() {
this.$refs.switchHookLock.doShow(this.selected)
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected)
},
},
}
</script>

View File

@ -33,7 +33,7 @@
</el-row>
</el-col>
<el-col v-show="showExpand" :span="showExpand? 18: 0">
<map-visual ref="map" :mapData="mapData" :width="780" :height="600" />
<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -98,9 +98,9 @@ export default {
title() {
return '进路设置';
},
expandTitle() {
return this.showExpand? '收起进路预览' : '展开进路预览'
},
expandTitle() {
return this.showExpand ? '收起进路预览' : '展开进路预览';
},
commitDisabled() {
let disabled = true;
if (this.row) {
@ -124,7 +124,7 @@ export default {
this.showExpand = !this.showExpand;
},
doShow(operate, selected, tempData) {
this.$root.$emit('dialogOpen', selected);
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
//
if (!this.dialogShow) {
@ -166,7 +166,7 @@ export default {
this.dialogShow = false;
this.row = null;
this.restoreBeforeDevices();
this.$root.$emit('dialogClose', this.selected);
this.$root.$emit('dialogClose', this.selected);
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
@ -183,8 +183,8 @@ export default {
if (this.beforeSwitchList && this.beforeSwitchList.length) {
this.beforeSwitchList.forEach(el => {
el.normalPosition = false;
el.reversePosition = false;
// N- R- NO-() EX-
el.pos = 'NO';
el.routeLock = false;
});
}
@ -208,7 +208,7 @@ export default {
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
const signal = diff > 0? signalEnd: signalBegin;
const signal = diff > 0 ? signalEnd : signalBegin;
const switchCodeList = [];
this.$refs.map.setCenterWithOffset(code, 50, signal.position.y);
@ -235,7 +235,8 @@ export default {
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
// normalPosition: el.normal, reversePosition: !el.normal
containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos });
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });

View File

@ -132,17 +132,8 @@ export default {
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[signalEle.aspect] || '';
},
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -134,17 +134,8 @@ export default {
},
getSignalShow(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
} else {
return '';
}
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[elem.aspect] || '';
},
cancel() {
const operate = {

View File

@ -245,17 +245,8 @@ export default {
},
getSignalShow(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
}
return '';
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[elem.aspect] || '';
},
getCanGuide(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -13,7 +13,8 @@
<el-table-column prop="name" label="ID" />
<el-table-column prop="status" label="信号指示模式">
<template slot-scope="scope">
<span v-if="scope.row.redOpen">灭灯模式</span>
<!-- <span v-if="scope.row.redOpen">灭灯模式</span> -->
<span v-if="scope.row.aspect=='R'">灭灯模式</span>
<span v-else>开灯模式</span>
</template>
</el-table-column>
@ -109,7 +110,7 @@ export default {
'selected': function(val) {
if (val) {
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
if (signal && signal.redOpen) {
if (signal && signal.aspect == 'R') {
this.status = true;
} else {
this.status = false;

View File

@ -36,8 +36,8 @@
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.normalPosition || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.reversePosition || selectedSwitch.auto)" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.pos=='N' || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.pos=='R' || selectedSwitch.auto)" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
@ -208,9 +208,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -109,9 +109,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -101,7 +101,8 @@ export default {
simulationRole: [
{ label: '行调操作', value: 'Center' },
{ label: '现地操作', value: 'Local' }
{ label: '现地操作', value: 'Local' },
{ label: '车辆段操作', value: 'Depot_IL'}
],
deviceTypeList: [

View File

@ -17,6 +17,7 @@ class CommandHandle {
this.definitionMap = {
Center: {},
Local: {},
Depot_IL:{},
Common: {
Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},

View File

@ -1,7 +1,8 @@
/** 系统类型 */
export const State2SimulationMap = {
'01': 'Local', // 现地工作站
'02': 'Center' // 中心调度工作站
'02': 'Center', // 中心调度工作站
'09':'Depot_IL' // 车辆段工作站
};
export const State2ControlMap = {

View File

@ -2641,6 +2641,10 @@ export const OperationEvent = {
stop: {
operation: '6035',
domId: '_Tips-Station-PowerUnLock-Stop'
},
button:{
operation: '6036',
domId: '_Tips-Station-PowerUnLock-Button'
}
},
// 执行关键操作测试

View File

@ -7,24 +7,16 @@ export default function parseStatus(deviceStatus) {
elem.deviceType = deviceType.Switch;
switch (msg[1]) {
case 0:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'NO'; // 失表
break;
case 1:
elem.normalPosition = 1;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'N'; // 定位
break;
case 2:
elem.normalPosition = 0;
elem.reversePosition = 1;
elem.switchSplit = 0;
elem.pos = 'R'; // 反位
break;
case 4:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 1;
elem.pos = 'EX'; // 挤岔
break;
}
elem.blockade = msg[2];

View File

@ -30,10 +30,10 @@
<el-button type="danger" size="small" @click="handleQuitQuest">退出剧本</el-button>
</template>
<template v-else-if="!projectDevice">
<el-button type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button v-if="!isDepoltSim" type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<!-- isDisable&& -->
<el-button v-if="isAdmin" v-loading="pauseLoading" :type="simulationPaused?'warning':'primary'" size="small" @click="startOrPause">{{ simulationPaused?'开始':'暂停' }}</el-button>
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
<el-button v-if="isAdmin&&!isDepoltSim" v-loading="pauseLoading" :type="simulationPaused?'warning':'primary'" size="small" @click="startOrPause">{{ simulationPaused?'开始':'暂停' }}</el-button>
<el-button v-if="!isDepoltSim" type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
</template>
</template>
<el-button v-if="project !='bjd'" type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
@ -163,6 +163,9 @@ export default {
},
simulationPaused() {
return this.$store.state.socket.simulationPause;
},
isDepoltSim() {
return this.$route.query.prdType === '09';
}
},
watch: {

View File

@ -2,7 +2,7 @@
<div>
<div class="schema" :style="{top: offset+'px'}">
<select-station v-if="isShowSelectStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange">
<el-select v-if="!isDepoltSim" v-model="speed" style="width: 100px;" size="small" @change="speedChange">
<el-option
v-for="item in speedList"
:key="item.value"
@ -10,7 +10,7 @@
:value="item.value"
/>
</el-select>
<template v-if="!dataError">
<template v-if="!dataError && !isDepoltSim">
<el-button-group v-if="project !== 'bjd'">
<el-button v-if="isLocalStation && $route.query.lineCode!='08'" size="small" @click="goIbp">IBP盘</el-button>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button>
@ -107,6 +107,9 @@ export default {
isScheduling() {
return this.$route.query.prdType === '05';
},
isDepoltSim() {
return this.$route.query.prdType === '09';
},
isLocalStation() {
return this.$store.state.training.prdType === '01';
},

View File

@ -3,7 +3,7 @@
<el-select v-if="$store.state.training.prdType === '01'" v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode">
<el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select v-else-if="$store.state.training.prdType === '09'" v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode">
<el-select v-else-if="$store.state.training.prdType === '09'" v-model="oldShowMemberId" :style="styleCss" size="small" style="margin-right:20px;" @change="switchStationMode">
<el-option v-for="item in depotListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</span>

View File

@ -6,18 +6,30 @@
<div class="text_item">
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div class="tree_box">
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" current-node-key highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent" @node-contextmenu="showContextMenu">
<span slot-scope="{ node:tnode, data }">
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
current-node-key
highlight-current
:span="22"
:filter-node-method="filterNode"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
>
<span slot-scope="{ node: tnode, data }">
<span class="el-icon-tickets" :style="{ color: data.valid ? 'green' : '' }" />
<span>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</div>
<div class="buttonList">
<el-button size="small" type="primary" class="eachButton uploadDemo " @click="importMap">
<el-button size="small" type="primary" class="eachButton uploadDemo" @click="importMap">
{{ $t('map.importMap') }}
</el-button>
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
<el-button size="small" type="danger" class="eachButton" @click="deleteAllMap">{{ $t('map.deleteAllMap') }}</el-button>
</div>
<map-import ref="mapImport" @loadInitData="loadInitData" />
<map-operate-menu
@ -33,193 +45,219 @@
</div>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { listMap } from '@/api/jmap/mapdraft';
import { UrlConfig } from '@/scripts/ConstDic';
import { removeSessionStorage } from '@/utils/auth';
import MapOperateMenu from './mapmanage/operateMenu';
import MapImport from './mapmanage/mapImport';
import { getSessionStorage } from '@/utils/auth';
import { DeviceMenu } from '@/scripts/ConstDic'
import { listMap, deleteAllMap } from '@/api/jmap/mapdraft'
import { UrlConfig } from '@/scripts/ConstDic'
import { removeSessionStorage } from '@/utils/auth'
import MapOperateMenu from './mapmanage/operateMenu'
import MapImport from './mapmanage/mapImport'
import { getSessionStorage } from '@/utils/auth'
export default {
name: 'UserMapList',
components: {
MapOperateMenu,
MapImport
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
editModel: {},
lineCode: '',
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
};
},
computed: {
project() {
return getSessionStorage('project');
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
mounted() {
this.loadInitData();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
createMap() {
this.$emit('createMap');
},
async loadInitData() {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await listMap({ drawWay:true});
res.data && res.data.forEach(elem=>{
elem.type = 'map';
elem.children = [
{
id: '1',
name: this.$t('designPlatform.mapDesign'),
type: 'mapDesign',
mapId: elem.id,
mapName: elem.name,
lineCode: elem.lineCode
},
{
id: '2',
name: '系统配置绘图',
type: 'mapSystem',
mapId: elem.id,
mapName: elem.name,
lineCode: elem.lineCode
}
];
});
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
this.loading = false;
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
},
clickEvent(obj, data, ele) {
switch (obj.type) {
case 'mapDesign': {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `${UrlConfig.newDesignuser.mapDraw}/${obj.mapId}/draft`, query: { name: obj.mapName, lineCode:obj.lineCode } });
break;
}
case 'mapSystem': {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `/design/usermap/map/systemDraw/${obj.mapId}/draft`, query: { name: obj.mapName, lineCode:obj.lineCode } });
break;
}
}
},
showContextMenu(e, obj, node, vueElem) {
this.$refs.tree.setCurrentKey(obj.id);
this.$refs.tree.currentNode = node;
if (obj && obj.type == 'map') {
e.preventDefault();
const menu = DeviceMenu.Map;
this.point = {
x: e.clientX,
y: e.clientY
};
this.editModel = obj;
this.editModel.lineCode = obj.lineCode;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
jlmap3d() {
this.$router.push({ path: '/design/jlmap3d/edit', query: { mapid: this.editModel.id } });
},
assetmanager3d() {
this.$router.push({ path: '/design/jlmap3d/assetmanager' });
},
importMap() {
this.$refs.mapImport.show();
}
name: 'UserMapList',
components: {
MapOperateMenu,
MapImport,
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name',
},
point: {
x: 0,
y: 0,
},
editModel: {},
lineCode: '',
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts'],
}
};
},
computed: {
project() {
return getSessionStorage('project')
},
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
},
beforeDestroy() {
removeSessionStorage('demonList')
},
mounted() {
this.loadInitData()
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
createMap() {
this.$emit('createMap')
},
deleteAllMap() {
this.$confirm('确定删除全部地图数据?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
deleteAllMap().then(res => {
this.$message({
type: 'success',
message: '删除成功!',
})
this.loadInitData()
})
})
.catch(e => {})
},
async loadInitData() {
this.loading = true
this.treeData = this.treeList = []
try {
const res = await listMap({ drawWay: true })
res.data &&
res.data.forEach(elem => {
elem.type = 'map'
elem.children = [
{
id: '1',
name: this.$t('designPlatform.mapDesign'),
type: 'mapDesign',
mapId: elem.id,
mapName: elem.name,
lineCode: elem.lineCode,
},
{
id: '2',
name: '系统配置绘图',
type: 'mapSystem',
mapId: elem.id,
mapName: elem.name,
lineCode: elem.lineCode,
},
]
})
this.treeData = res.data
this.treeList = this.filterText
? res.data.filter(elem => {
return elem.name.includes(this.filterText)
})
: res.data
this.loading = false
} catch (error) {
this.loading = false
this.$messageBox(this.$t('error.refreshFailed'))
}
},
clickEvent(obj, data, ele) {
switch (obj.type) {
case 'mapDesign': {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations')
}
this.$router.push({
path: `${UrlConfig.newDesignuser.mapDraw}/${obj.mapId}/draft`,
query: { name: obj.mapName, lineCode: obj.lineCode },
})
break
}
case 'mapSystem': {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations')
}
this.$router.push({
path: `/design/usermap/map/systemDraw/${obj.mapId}/draft`,
query: { name: obj.mapName, lineCode: obj.lineCode },
})
break
}
}
},
showContextMenu(e, obj, node, vueElem) {
this.$refs.tree.setCurrentKey(obj.id)
this.$refs.tree.currentNode = node
if (obj && obj.type == 'map') {
e.preventDefault()
const menu = DeviceMenu.Map
this.point = {
x: e.clientX,
y: e.clientY,
}
this.editModel = obj
this.editModel.lineCode = obj.lineCode
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu })
}
},
jlmap3d() {
this.$router.push({ path: '/design/jlmap3d/edit', query: { mapid: this.editModel.id } })
},
assetmanager3d() {
this.$router.push({ path: '/design/jlmap3d/assetmanager' })
},
importMap() {
this.$refs.mapImport.show()
},
},
}
</script>
<style lang="scss" scoped>
.clearfix{
padding: 0 20px;
border-bottom: 1px solid #EBEEF5;
box-sizing: border-box;
height: 47px;
line-height: 47px;
position: absolute;
width:100%;
}
.text_item{
height: 100%;
padding-top: 47px;
.tree_box{
height: calc(100% - 89px);
overflow-y: auto;
}
}
.buttonList{
padding: 8px 0px 8px 0px;
border-top: 1px #ccc solid;
}
.eachButton{
margin-left:10px;
}
.uploadDemo {
position: relative;
overflow: hidden;
// float: right;
padding: 9px 15px;
margin-right: 3px;
cursor: pointer;
input {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
}
.map-list-main{
text-align:left;
height: 100%;
position: relative;
}
.clearfix {
padding: 0 20px;
border-bottom: 1px solid #ebeef5;
box-sizing: border-box;
height: 47px;
line-height: 47px;
position: absolute;
width: 100%;
}
.text_item {
height: 100%;
padding-top: 47px;
.tree_box {
height: calc(100% - 89px);
overflow-y: auto;
}
}
.buttonList {
padding: 8px 0px 8px 0px;
border-top: 1px #ccc solid;
}
.eachButton {
margin-left: 10px;
}
.uploadDemo {
position: relative;
overflow: hidden;
// float: right;
padding: 9px 15px;
margin-right: 3px;
cursor: pointer;
input {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
}
.map-list-main {
text-align: left;
height: 100%;
position: relative;
}
</style>

View File

@ -77,7 +77,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
@ -135,7 +136,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);

View File

@ -687,8 +687,6 @@ function timedCount() {
function callback(Response) {
data = JSON.parse(Response.body);
//
// console.log(data);
// console.log(data.type);
if(data.type == "Train_Position"){
postMessage(data);
@ -716,7 +714,7 @@ function timedCount() {
return;
}
if (data.body.type== "PSD") {
if (data.body.deviceType== "PSD") {
postMessage(data);
return;
}