diff --git a/.editorconfig b/.editorconfig index f669cf1f7..cfd65abe8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] charset = utf-8 -indent_style = space +indent_style = tab indent_size = 4 end_of_line = lf insert_final_newline = true diff --git a/package.json b/package.json index bd4521b4a..ca598995f 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "compression-webpack-plugin": "^3.0.0", "connect": "3.6.6", "copy-webpack-plugin": "^4.5.2", + "eslint": "5.15.3", "eslint-plugin-vue": "5.2.2", "file-loader": "^3.0.1", diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index 65802534c..8ddb3f7ba 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -4,894 +4,881 @@ import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcI import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp'; import { getToken } from '@/utils/auth'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; // 定于仿真socket接口 -export function Jl3dDriving(mixers,updatemmi,sound,translation,routegroup) { +export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) { - let scope = this; - this.map = null; - let toppic = '/app/topic/simulation/client/'+routegroup+'/drive'; - var trainlisttest = null; - var sectionlist = null; - var signallist = null; - var stationstandlist = null; - var sectionlist = null; - var materials = null; - var actions = null; - var rails = null; - var links = null; + const scope = this; + this.map = null; + const toppic = '/app/topic/simulation/client/' + routegroup + '/drive'; + var trainlisttest = null; + var sectionlist = null; + var signallist = null; + var stationstandlist = null; + var sectionlist = null; + var materials = null; + var actions = null; + var rails = null; + var links = null; - var scenes = null; + var scenes = null; - var code = null; + var code = null; - var drivingcode = null; - var drivingspeed = null; - var drivingaptspeed = null; + var drivingcode = null; + var drivingspeed = null; + var drivingaptspeed = null; - let driverswitch = false; + let driverswitch = false; - let stoptimer = null; - let num = 30; - let pointstand = null; - // run as plane = 01; - // reset = 02; - var datatype = '00'; - this.teststomp = new StompClient(); - this.topic = '/user/queue/simulation/jl3d/'+routegroup; - let header = {'X-Token': getToken() }; + const stoptimer = null; + const num = 30; + const pointstand = null; + // run as plane = 01; + // reset = 02; + var datatype = '00'; + this.teststomp = new StompClient(); + this.topic = '/user/queue/simulation/jl3d/' + routegroup; + const header = {'X-Token': getToken() }; - this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) { - // console.log(mapdata); - // console.log(newtrainlisttest); - trainlisttest = newtrainlisttest; - sectionlist = newsectionlist; - signallist = newsignallist; - stationstandlist = newstationstandlist; - materials = materiallist; - scenes = scene; - actions = nowaction; - links = newlinklist; - rails = newrails; - }; + this.updatamap = function(newsectionlist, newlinklist, newsignallist, newstationstandlist, newtrainlisttest, newrealsectionlist, newrails, materiallist, nowaction, scene) { + // console.log(mapdata); + // console.log(newtrainlisttest); + trainlisttest = newtrainlisttest; + sectionlist = newsectionlist; + signallist = newsignallist; + stationstandlist = newstationstandlist; + materials = materiallist; + scenes = scene; + actions = nowaction; + links = newlinklist; + rails = newrails; + }; - this.initdrivercode = function(code) { - drivingcode = code; - }; + this.initdrivercode = function(code) { + drivingcode = code; + }; - this.socketon = function(topic) { - try { - // console.log("teststomp"); - scope.teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); - } + this.socketon = function(topic) { + try { + // console.log("teststomp"); + scope.teststomp.subscribe(topic, callback, header); + } catch (error) { + console.error('websocket订阅失败'); + } - }; + }; - this.socketoff = function(topic) { - scope.teststomp.unsubscribe(topic); - for (let i=0; i0) { - // updatemmi.updatenowspeed(data.body[tl].v); - // } else { - - updatemmi.updatenowspeed(Math.abs(data.body[tl].v)); - // console.log(data.body[i]); - - // } - } - } - - - - if (code == drivingcode) { - // if(sound.volswitch == true){ - // sound.setVolume( data.body[tl].v/100 ); - // } - if (data.body[tl].atpv) { - updatemmi.updateatpspeed(data.body[tl].atpv); - } else { - updatemmi.updateatpspeed(-1); - } - if (data.body[tl].atov) { - updatemmi.updateatospeed(data.body[tl].atov); - } else { - updatemmi.updateatospeed(-1); - } - if(trainlisttest.list[code].progress<1){ - let syncdata = { - type: 'Train', - code: code, - linkCode: trainlisttest.list[code].nowcode, - percent: 0 - }; - if (trainlisttest.list[code].status == '02') { - if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){ - if((trainlisttest.list[code].linkOffsetPercent/trainlisttest.list[code].pc)>=trainlisttest.list[code].targetpercent){ - syncdata.percent = trainlisttest.list[code].progress; - }else{ - syncdata.percent = trainlisttest.list[code].progress*trainlisttest.list[code].pc; - } - }else{ - syncdata.percent = trainlisttest.list[code].progress; - } - - } else { - if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){ - if((trainlisttest.list[code].linkOffsetPercent/trainlisttest.list[code].pc)<=trainlisttest.list[code].targetpercent){ - syncdata.percent = (1 - trainlisttest.list[code].progress); - }else{ - syncdata.percent = (1 - trainlisttest.list[code].progress)*trainlisttest.list[code].pc; - } - }else{ - syncdata.percent = (1 - trainlisttest.list[code].progress); - } - } - // console.log("send"); - // console.log(trainlisttest.list[code]); - // - // console.log(syncdata); - // console.log("============="); - scope.teststomp.send(toppic, syncdata); - } - - } - } - } - } - - function trainstatus(data){ - // console.log(data.body); - for (let i=data.body.length-1; i>=0; i--) { - // 遍历列车对象组 - // console.log(trainlisttest); - if (trainlisttest) { - - code = data.body[i].code; - // 剔除不显示的车 - // 找到对应列车 - - if (code == drivingcode) { - - driverswitch = data.body[i].runMode; - //更新车组号 - updatemmi.updatetrainnum(data.body[i].groupNumber); - //更新列车 - if (data.body[i].parkRemainTime>0) { - updatemmi.updatestoptime(translation.stopTime+parseInt(data.body[i].parkRemainTime)); - } else { - if (data.body[i].runMode == '02') { - updatemmi.updatestoptime(translation.trainAtoOn); - } else { - if (trainlisttest.list[code].isStandTrack == true && trainlisttest.list[code].progress>0.95 && trainlisttest.list[code].speed<=0) { - // if(stoptimer){ - // - // }else{ - // stoptimer = setInterval(function(){ - // if(num >=0){ - // updatemmi.updatestoptime("停站时间:"+num); - // num --; - // } - // },1000); - // } - - } else { - updatemmi.updatestoptime(translation.trainAtoOff); - } - } - } - } - trainlisttest.list[code].runMode = data.body[i].runMode; - - // 车门开关验证 - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - 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].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // if (data.body[i].directionType == '02') { - // - // } else { - // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // // console.log("close"); - // trainlisttest.list[code].doorStatus = '01'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // // console.log("open"); - // trainlisttest.list[code].doorStatus = '02'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - - if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { - - if (rails.linkrail[data.body[i].linkCode]) { - // console.log(trainlisttest.group); - if(trainlisttest.group.children.length<1){ - trainlisttest.group.add(trainlisttest.list[code]); - drivingcode = code; - updatemmi.updatedrivingcode(drivingcode); - } - if(trainlisttest.list[code].mixerpush == false){ - for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi=0; i--) { - // 0xFFFFFF - // 0xCD0000 红 - // 0xEEEE00 黄 - // 0x32CD32 绿 - if (data.body[i]._type == 'Signal') { - if (signallist) { - signalupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'StationStand' ) { - if (actions) { - standupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'Switch') { - if (sectionlist) { - switchupdate(data.body[i]); - } - } - - } - } - - function standupdate(data) { - code = data.code; - if ( actions[code]) { - if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') { - actions[code].status = '02'; - actions[code].action.reset(); - actions[code].action.time = 0; - actions[code].action.timeScale = 1; - actions[code].action.play(); - } - - if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') { - actions[code].status = '01'; - actions[code].action.reset(); - actions[code].action.time = actions[code].action._clip.duration; - actions[code].action.timeScale = -1; - actions[code].action.play(); - } - } - - } - - function signalupdate(data) { - code = data.code; - if (data.lightType == '01') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.status = data.status; - - // 55 - // 33 - // 77 - // 关闭 - if (data.status == '01') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[0]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 开放 - if (data.status == '02') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[2]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - } - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 引导 - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[0]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 封锁 - if (data.status == '04') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 故障 - if (data.status == '05') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - - } - - } else if (data.lightType == '02') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - - } - - } - - function switchupdate(data) { - code = data.code; - for (let j=sectionlist.switchs.modellist.length-1; j>=0; j--) { - if (rails.switchrail[code]) { - if (rails.switchrail[code].locateType != data.locateType) { - // console.log("道岔变化:"+code); - if (data.locateType == '02') { - // console.log("02 反位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "02"; - - let testswitch = rails.switchrail[code]; - if(rails.switchrail[code].directtype == "1"){ - // console.log("道岔朝向1向左"); - // console.log("aleft:"+testswitch.clink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.clink; - rails.linkrail[testswitch.clink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.clink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.clink; - rails.linkrail[testswitch.clink].lconnect = testswitch.alink; - } - - } else if (data.locateType == '01') { - // console.log("01 定位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "01"; - let testswitch = rails.switchrail[code]; - if(rails.switchrail[code].directtype == "1"){ - // console.log("道岔朝向1向左"); - // console.log("aleft"+testswitch.blink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.blink; - rails.linkrail[testswitch.blink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.blink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.blink; - rails.linkrail[testswitch.blink].lconnect = testswitch.alink; - } - - } - } - j = 0; - } - } - } + function trainspeed(data) { + // console.log(data); + if (trainlisttest) { + for (let tl = 0; tl < data.body.length; tl++) { + code = data.body[tl].id; + if (trainlisttest.list[code].speed != data.body[tl].v) { + trainlisttest.list[code].speed = data.body[tl].v; + + if (trainlisttest.list[code].runMode == '02') { + + if (trainlisttest.list[code].isStandTrack == true) { + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } else { + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } else { + + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } + + if (code == drivingcode) { + // if (data.body[tl].v >0) { + // updatemmi.updatenowspeed(data.body[tl].v); + // } else { + + updatemmi.updatenowspeed(Math.abs(data.body[tl].v)); + // console.log(data.body[i]); + + // } + } + } + + if (code == drivingcode) { + // if(sound.volswitch == true){ + // sound.setVolume( data.body[tl].v/100 ); + // } + if (data.body[tl].atpv) { + updatemmi.updateatpspeed(data.body[tl].atpv); + } else { + updatemmi.updateatpspeed(-1); + } + if (data.body[tl].atov) { + updatemmi.updateatospeed(data.body[tl].atov); + } else { + updatemmi.updateatospeed(-1); + } + if (trainlisttest.list[code].progress < 1) { + const syncdata = { + type: 'Train', + code: code, + linkCode: trainlisttest.list[code].nowcode, + percent: 0 + }; + if (trainlisttest.list[code].status == '02') { + if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { + if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) >= trainlisttest.list[code].targetpercent) { + syncdata.percent = trainlisttest.list[code].progress; + } else { + syncdata.percent = trainlisttest.list[code].progress * trainlisttest.list[code].pc; + } + } else { + syncdata.percent = trainlisttest.list[code].progress; + } + + } else { + if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { + if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) <= trainlisttest.list[code].targetpercent) { + syncdata.percent = (1 - trainlisttest.list[code].progress); + } else { + syncdata.percent = (1 - trainlisttest.list[code].progress) * trainlisttest.list[code].pc; + } + } else { + syncdata.percent = (1 - trainlisttest.list[code].progress); + } + } + // console.log("send"); + // console.log(trainlisttest.list[code]); + // + // console.log(syncdata); + // console.log("============="); + scope.teststomp.send(toppic, syncdata); + } + + } + } + } + } + + function trainstatus(data) { + // console.log(data.body); + for (let i = data.body.length - 1; i >= 0; i--) { + // 遍历列车对象组 + // console.log(trainlisttest); + if (trainlisttest) { + + code = data.body[i].code; + // 剔除不显示的车 + // 找到对应列车 + + if (code == drivingcode) { + + driverswitch = data.body[i].runMode; + // 更新车组号 + updatemmi.updatetrainnum(data.body[i].groupNumber); + // 更新列车 + if (data.body[i].parkRemainTime > 0) { + updatemmi.updatestoptime(translation.stopTime + parseInt(data.body[i].parkRemainTime)); + } else { + if (data.body[i].runMode == '02') { + updatemmi.updatestoptime(translation.trainAtoOn); + } else { + if (trainlisttest.list[code].isStandTrack == true && trainlisttest.list[code].progress > 0.95 && trainlisttest.list[code].speed <= 0) { + // if(stoptimer){ + // + // }else{ + // stoptimer = setInterval(function(){ + // if(num >=0){ + // updatemmi.updatestoptime("停站时间:"+num); + // num --; + // } + // },1000); + // } + + } else { + updatemmi.updatestoptime(translation.trainAtoOff); + } + } + } + } + trainlisttest.list[code].runMode = data.body[i].runMode; + + // 车门开关验证 + if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // console.log("close"); + trainlisttest.list[code].doorStatus = '01'; + 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].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // console.log("open"); + trainlisttest.list[code].doorStatus = '02'; + for (let an = actions[code].top.length - 1; an >= 0; an--) { + actions[code].top[an].reset(); + actions[code].top[an].time = 0; + actions[code].top[an].timeScale = 1; + actions[code].top[an].play(); + } + } + // if (data.body[i].directionType == '02') { + // + // } else { + // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // // console.log("close"); + // trainlisttest.list[code].doorStatus = '01'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = actions[code].top[an]._clip.duration; + // actions[code].down[an].timeScale = -1; + // actions[code].down[an].play(); + // } + // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // // console.log("open"); + // trainlisttest.list[code].doorStatus = '02'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = 0; + // actions[code].down[an].timeScale = 1; + // actions[code].down[an].play(); + // } + // } + // } + // 遍历获取所在轨道 + + if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { + + if (rails.linkrail[data.body[i].linkCode]) { + // console.log(trainlisttest.group); + if (trainlisttest.group.children.length < 1) { + trainlisttest.group.add(trainlisttest.list[code]); + drivingcode = code; + updatemmi.updatedrivingcode(drivingcode); + } + if (trainlisttest.list[code].mixerpush == false) { + for (let mi = 0, lenmi = trainlisttest.list[code].mixer.length; mi < lenmi; mi++) { + mixers.push(trainlisttest.list[code].mixer[mi]); + } + trainlisttest.list[code].mixerpush = true; + } + // trainlisttest.group.add(trainlisttest.list[code]); + trainlisttest.list[code].position.y = 0; + trainlisttest.list[code].progress = 0; + // trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent; + trainlisttest.list[code].dispose = false; + trainlisttest.list[code].nowcode = data.body[i].linkCode; + + trainlisttest.list[code].pc = 1; + // console.log(data.body[i]); + if (data.body[i].directionType == '02') { // 向右 + + if (data.body[i].targetStation) { + + trainlisttest.list[code].stopstation = data.body[i].targetStation; + // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + } else { + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + } + + trainlisttest.list[code].status = '02'; + + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + const point = rails.linkrail[data.body[i].linkCode].lineleft.getPointAt(trainlisttest.list[code].progress); + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].position.x = point.x; + trainlisttest.list[code].position.y = 0; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = point.z; + } + } else if (data.body[i].directionType == '03') { // 向左 + + // if(trainlisttest.list[code].rname == "006"){ + // console.log("0000000000000000"); + // console.log(data.body[i].linkOffsetPercent); + // } + if (data.body[i].targetStation) { + + trainlisttest.list[code].stopstation = data.body[i].targetStation; + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + // console.log(data.body[i].targetLinkPercent); + // console.log(rails.stops[data.body[i].targetStation].direct1.percent); + // console.log(trainlisttest.list[code].pc); + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + } else { + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + } + // console.log("progress:"+trainlisttest.list[code].progress); + // console.log("linkOffsetPercent:"+trainlisttest.list[code].linkOffsetPercent); + // console.log("datatarget:"+ data.body[i].targetLinkPercent); + // console.log("directpercent:"+trainlisttest.list[code].targetpercent); + // console.log("===================="); + trainlisttest.list[code].status = '03'; + + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + const point = rails.linkrail[data.body[i].linkCode].lineright.getPointAt(trainlisttest.list[code].progress); + trainlisttest.list[code].rotation.y = Math.PI; + trainlisttest.list[code].position.x = point.x; + trainlisttest.list[code].position.y = 0; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = -point.z; + } + } + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + // trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack; + + // trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance; + + if (data.body[i].speed == 0) { + trainlisttest.list[code].speeds = data.body[i].speed; + trainlisttest.list[code].speeds = 0; + // trainlisttest.list[code].startmark = 1; + } else { + trainlisttest.list[code].speeds = data.body[i].speed; + trainlisttest.list[code].speeds = parseFloat(data.body[i].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + + } + + } else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) { + trainlisttest.group.remove(trainlisttest.list[code]); + trainlisttest.list[code].progress = null; + trainlisttest.list[code].dispose = true; + code = trainlisttest.group.children[i].name; + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].doorStatus = '01'; + trainlisttest.list[code].speed = 0; + trainlisttest.list[code].position.x = -50000; + trainlisttest.list[code].position.y = -50000; + trainlisttest.list[code].pc = 1; + } else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) { + + if (rails.linkrail[data.body[i].linkCode]) { + if (driverswitch == '02' && code == drivingcode) { + updatemmi.updatenowspeed(data.body[i].speed); + if (data.body[i].atpSpeed) { + updatemmi.updateatpspeed(data.body[i].atpSpeed); + } else { + updatemmi.updateatpspeed(-1); + } + if (data.body[i].targetSpeed) { + updatemmi.updateatospeed(data.body[i].targetSpeed); + } else { + updatemmi.updateatospeed(-1); + } + if (data.body[i].maLen) { + updatemmi.updatenowlen(data.body[i].maLen); + } else { + updatemmi.updatenowlen(0); + } + // if(trainlisttest.list[code].isStandTrack == true){ + // pointstand = null; + // if(data.body[i].directionType == "02"){ + // pointstand = trainlisttest.list[code].curve.getPointAt(data.body[i].sectionOffsetPercent); + // }else{ + // pointstand = trainlisttest.list[code].curve.getPointAt(1-data.body[i].sectionOffsetPercent); + // } + // console.log(data.body[i].sectionOffsetPercent) + // console.log(pointstand.x); + // + // trainlisttest.list[code].position.x = pointstand.x; + // } + } + if (driverswitch == '05' && code == drivingcode) { + if (data.body[i].maLen) { + updatemmi.updatenowlen(data.body[i].maLen); + } else { + updatemmi.updatenowlen(0); + } + } + if (trainlisttest.list[code].status != data.body[i].directionType) { + if (data.body[i].directionType == '02') { // 向右 + + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].position.x = rotaposx; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = rotaposz; + } + + trainlisttest.list[code].progress = (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '02'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + trainlisttest.list[code].nextcurve = null; + + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } else if (data.body[i].directionType == '03') { // 向左 + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]); + trainlisttest.list[code].rotation.y = Math.PI; + trainlisttest.list[code].position.x = rotaposx; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = -rotaposz; + } + trainlisttest.list[code].progress = 1 - (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '03'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + trainlisttest.list[code].nextcurve = null; + + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } + } + let nextcode; + + if (code == drivingcode) { + // console.log(data.body[i].targetStation); + // console.log("netpercent"); + // console.log(data.body[i].targetLinkPercent); + // console.log(data.body[i].linkOffsetPercent); + // console.log("3dpercent"); + // if(rails.stops[data.body[i].targetStation]){ + // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + // } + // + // console.log(trainlisttest.list[code].progress); + // console.log(trainlisttest.list[code].pc); + // console.log("==============="); + // console.log(data.body[i]); + if (data.body[i].directionType == '02') { + if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { + trainlisttest.list[code].stopstation = data.body[i].targetStation; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + + // trainlisttest.list[code].progress = trainlisttest.list[code].linkOffsetPercent*trainlisttest.list[code].pc; + } + } + + trainlisttest.list[code].status = '02'; + nextcode = rails.linkrail[data.body[i].linkCode].rconnect; + if (nextcode) { + // console.log(rails.linkrail[nextcode].lineleft.points); + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } else { + + trainlisttest.list[code].nextlen = 0; + } + } else if (data.body[i].directionType == '03') { + if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { + trainlisttest.list[code].stopstation = data.body[i].targetStation; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + // trainlisttest.list[code].progress = (1-trainlisttest.list[code].linkOffsetPercent)*trainlisttest.list[code].pc; + } + } + trainlisttest.list[code].status = '03'; + nextcode = rails.linkrail[data.body[i].linkCode].lconnect; + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } else { + + trainlisttest.list[code].nextlen = 0; + } + } + trainlisttest.list[code].nextcode = nextcode; + + // console.log(trainlisttest.list[code].nowcode); + // console.log(trainlisttest.list[code].nextcode); + // console.log(trainlisttest.list[code].curve.points); + // console.log(trainlisttest.list[code].nextcurve.points); + // console.log("========================="); + + } else { + + // trainlisttest.list[code].stopstation = data.body[i].targetStation; + // // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + // trainlisttest.list[code].pc = data.body[i].targetLinkPercent/rails.stops[data.body[i].targetStation].direct2.percent; + // trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + // trainlisttest.list[code].progress = data.body[i].linkOffsetPercent*trainlisttest.list[code].pc; + // trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + // trainlisttest.list[code].targetLink = data.body[i].targetLink; + + let nextcode; + if (data.body[i].directionType == '02') { + if (rails.linkrail[data.body[i].linkCode].lineleft) { + nextcode = rails.linkrail[data.body[i].linkCode].rconnect; + trainlisttest.list[code].status = '02'; + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } + trainlisttest.list[code].nowcode = data.body[i].linkCode; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + } + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } else if (data.body[i].directionType == '03') { + if (rails.linkrail[data.body[i].linkCode].lineright) { + nextcode = rails.linkrail[data.body[i].linkCode].lconnect; + trainlisttest.list[code].status = '03'; + + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } + trainlisttest.list[code].nowcode = data.body[i].linkCode; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + trainlisttest.list[code].progress = (1 - data.body[i].linkOffsetPercent) / trainlisttest.list[code].pc; + } + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } + trainlisttest.list[code].nextcode = nextcode; + } + + // console.log(data.body[i].linkOffsetPercent); + // console.log(trainlisttest.list[code].progress); + // console.log(trainlisttest.list[code].curve.points); + // console.log(trainlisttest.list[code].nextcurve.points); + // console.log(trainlisttest.list[code].len); + // console.log(trainlisttest.list[code].nextlen); + // console.log("=========================================="); + } + } + + } + } + } + + function simulationreset(data) { + // console.log(data); + for (const k in trainlisttest.list) { + trainlisttest.list[k].dispose = true; + trainlisttest.group.remove(trainlisttest.list[k]); + trainlisttest.list[k].stopstation = null; + trainlisttest.list[k].pc = null; + trainlisttest.list[k].targetpercent = null; + trainlisttest.list[k].progress = null; + trainlisttest.list[k].linkOffsetPercent = null; + trainlisttest.list[k].targetLink = null; + drivingcode = null; + } + } + + function devicestatus(data) { + for (let i = data.body.length - 1; i >= 0; i--) { + // 0xFFFFFF + // 0xCD0000 红 + // 0xEEEE00 黄 + // 0x32CD32 绿 + if (data.body[i]._type == 'Signal') { + if (signallist) { + signalupdate(data.body[i]); + } + } + + if (data.body[i]._type == 'StationStand' ) { + if (actions) { + standupdate(data.body[i]); + } + } + + if (data.body[i]._type == 'Switch') { + if (sectionlist) { + switchupdate(data.body[i]); + } + } + + } + } + + function standupdate(data) { + code = data.code; + if ( actions[code]) { + if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') { + actions[code].status = '00'; + } + if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') { + actions[code].status = '02'; + actions[code].action.reset(); + actions[code].action.time = 0; + actions[code].action.timeScale = 1; + actions[code].action.play(); + } + + if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') { + actions[code].status = '00'; + } + if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') { + actions[code].status = '01'; + actions[code].action.reset(); + actions[code].action.time = actions[code].action._clip.duration; + actions[code].action.timeScale = -1; + actions[code].action.play(); + } + } + + } + + function signalupdate(data) { + code = data.code; + if (data.lightType == '01') { + if (signallist.list[code].mesh.code) { + signallist.list[code].mesh.status = data.status; + + // 55 + // 33 + // 77 + // 关闭 + if (data.status == '01') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 开放 + if (data.status == '02') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[2]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + } + if (data.status == '03') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 引导 + if (data.status == '03') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 封锁 + if (data.status == '04') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 故障 + if (data.status == '05') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + + } + + } else if (data.lightType == '02') { + if (signallist.list[code].mesh.code) { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + + } + + } + + function switchupdate(data) { + code = data.code; + for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) { + if (rails.switchrail[code]) { + if (rails.switchrail[code].locateType != data.locateType) { + // console.log("道岔变化:"+code); + if (data.locateType == '02') { + // console.log("02 反位"); + if (actions[sectionlist.switchs.modellist[j].code]) { + sectionlist.switchs.modellist[j].locateType = data.locateType; + actions[sectionlist.switchs.modellist[j].code].reset(); + actions[sectionlist.switchs.modellist[j].code].time = 0; + actions[sectionlist.switchs.modellist[j].code].timeScale = 1; + actions[sectionlist.switchs.modellist[j].code].play(); + } + + rails.switchrail[code].locateType = '02'; + + const testswitch = rails.switchrail[code]; + if (rails.switchrail[code].directtype == '1') { + // console.log("道岔朝向1向左"); + // console.log("aleft:"+testswitch.clink); + // console.log("cright:"+testswitch.alink); + rails.linkrail[testswitch.alink].lconnect = testswitch.clink; + rails.linkrail[testswitch.clink].rconnect = testswitch.alink; + } else if (rails.switchrail[code].directtype == '2') { + // console.log("道岔朝向2向右"); + // console.log("aright:"+testswitch.clink); + // console.log("cleft:"+testswitch.alink); + rails.linkrail[testswitch.alink].rconnect = testswitch.clink; + rails.linkrail[testswitch.clink].lconnect = testswitch.alink; + } + + } else if (data.locateType == '01') { + // console.log("01 定位"); + if (actions[sectionlist.switchs.modellist[j].code]) { + sectionlist.switchs.modellist[j].locateType = data.locateType; + actions[sectionlist.switchs.modellist[j].code].reset(); + actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; + actions[sectionlist.switchs.modellist[j].code].timeScale = -1; + actions[sectionlist.switchs.modellist[j].code].play(); + } + + rails.switchrail[code].locateType = '01'; + const testswitch = rails.switchrail[code]; + if (rails.switchrail[code].directtype == '1') { + // console.log("道岔朝向1向左"); + // console.log("aleft"+testswitch.blink); + // console.log("cright:"+testswitch.alink); + rails.linkrail[testswitch.alink].lconnect = testswitch.blink; + rails.linkrail[testswitch.blink].rconnect = testswitch.alink; + } else if (rails.switchrail[code].directtype == '2') { + // console.log("道岔朝向2向右"); + // console.log("aright:"+testswitch.blink); + // console.log("cleft:"+testswitch.alink); + rails.linkrail[testswitch.alink].rconnect = testswitch.blink; + rails.linkrail[testswitch.blink].lconnect = testswitch.alink; + } + + } + } + j = 0; + } + } + } } diff --git a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js index 049c23a3e..616ac18be 100644 --- a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js +++ b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js @@ -1,7 +1,7 @@ import StompClient from '@/utils/sock'; import { displayTopic } from '@/utils/stomp'; import { getToken } from '@/utils/auth'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; // 定于仿真socket接口 export function Jlmap3dSubscribe(worker,routegroup) { diff --git a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue index 7f4caa8e5..ce4cec576 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue @@ -311,7 +311,7 @@ import { OperationEvent } from '@/scripts/ConstDic'; // import { now } from '@/utils/date'; import ConfirmTip from './childDialog/confirmTip'; import { sendCommand } from '@/api/jmap/training'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; export default { name: 'SectionCmdSpeed', diff --git a/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue b/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue index 46caafc6b..51ef2250f 100644 --- a/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue @@ -311,7 +311,7 @@ import { OperationEvent } from '@/scripts/ConstDic'; // import { now } from '@/utils/date'; import ConfirmTip from './childDialog/confirmTip'; import { sendCommand } from '@/api/jmap/training'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; export default { name: 'SectionCmdSpeed', diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 4b991511a..c7672c88e 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -394,39 +394,46 @@ class SkinCode extends defaultStyle { this[deviceType.Switch] = { text: { - show: true, // 道岔名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - offset: { x: -15, y: -10 }, // 道岔名称与区段距离 - fontSize: 10, // 字体大小 - fontColor: '#C0C0C0', // 道岔名称颜色 - fontWeight: 'normal', // 字体粗细 - borderColor: '#FE0000', // 道岔边框颜色 - lossColor: '#FFFFFF', // 道岔失去颜色 - locateColor: '#00FF00', // 道岔定位颜色 - inversionColor: '#9C9D09', // 道岔反位颜色 - monolockColor: '#870E10' // 道岔单锁颜色 + show: true, // 道岔名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: { x: -15, y: -10 }, // 道岔名称与区段距离 + fontSize: 10, // 字体大小 + fontColor: '#C0C0C0', // 道岔名称颜色 + fontWeight: 'normal', // 字体粗细 + borderColor: '#FE0000', // 道岔边框颜色 + lossColor: '#FFFFFF', // 道岔失去颜色 + locateColor: '#00FF00', // 道岔定位颜色 + inversionColor: '#9C9D09', // 道岔反位颜色 + monolockLocationColor: '#870E10', // 道岔单锁'定位'颜色 + monolockInversionColor: '#870E10', // 道岔单锁'反位'颜色 + block: true // 封锁名称 }, sectionAction: { - flag: false, // 道岔 关联区段显示 - spareColor: '#5b5b5b' // 区段显示颜色 + flag: false, // 道岔 关联区段显示 + spareColor: '#5b5b5b' // 区段显示颜色 }, core: { - length: 6 // 道岔单边长度 + length: 6 // 道岔单边长度 }, - monolock: { // 道岔单锁配置 - locationColor: '#870E10', // 道岔单锁定位颜色 (红色) - inversionColor: '#870E10', // 道岔单锁反位颜色 (红色) - rectShow: false // 道岔单锁 矩形框是否显示 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8 // 直角梯形元素默认长度 }, - block: { // 道岔封锁配置 - blockName: 'default', // 默认道岔封锁类型 - nameBorderShow: true, // 道岔名称是否有包围框 显示 - contentRectShow: false // 道岔封锁显示 + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 18, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: false, // 单锁显示 + block: false // 封锁显示 }, mouseOverStyle: { - borderBackgroundColor: '#22DFDF', // 边框背景色 - borderColor: '#fff', // 边框颜色 - textShadowColor: '#22DFDF' // 字体阴影颜色 + borderBackgroundColor: '#22DFDF', // 边框背景色 + borderColor: '#fff', // 边框颜色 + textShadowColor: '#22DFDF' // 字体阴影颜色 } }; diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 68d62c2f4..5bdd87705 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -375,7 +375,8 @@ class SkinCode extends defaultStyle { lossColor: 'lightgreen', // 道岔失去颜色 locateColor: 'lightgreen', // 道岔定位颜色 inversionColor: 'lightgreen', // 道岔反位颜色 - monolockColor: '#FFFFFF' // 道岔单锁颜色 + monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) + monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色) }, sectionAction: { flag: false, // 道岔 关联区段显示 @@ -384,18 +385,21 @@ class SkinCode extends defaultStyle { core: { length: 10 // 道岔单边长度 }, - monolock: { // 道岔单锁配置 - locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) - inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色) - rectShow: true, // 道岔单锁 矩形框是否显示 - rectWidth: 18, // 矩形框 宽高 - rectBorderColor: '#fff' // 矩形边框颜色 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8 // 直角梯形元素默认长度 }, - block: { // 道岔封锁配置 - blockName: 'default', // 默认道岔封锁类型 - nameBorderShow: false, // 道岔名称是否有包围框 显示 - contentRectShow: true, // 道岔封锁显示 - contentRectColor: 'red' // 道岔封锁边框颜色 + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 18, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: true, // 单锁显示 + block: true, // 封锁显示 + blockColor: 'red' // 封锁颜色 } }; diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 4f8698af7..64d5aefae 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -357,7 +357,8 @@ class SkinCode extends defaultStyle { lossColor: '#C00808', // 道岔失去颜色 locateColor: '#00FF00', // 道岔定位颜色 inversionColor: '#FFFF00', // 道岔反位颜色 - monolockColor: '#FFFFFF' // 道岔单锁颜色 + monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) + monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色) }, sectionAction: { flag: false, // 道岔 关联区段显示 @@ -366,18 +367,21 @@ class SkinCode extends defaultStyle { core: { length: 6 // 道岔单边长度 }, - monolock: { // 道岔单锁配置 - locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) - inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色) - rectShow: true, // 道岔单锁 矩形框是否显示 - rectWidth: 18, // 矩形框 宽高 - rectBorderColor: '#fff' // 矩形边框颜色 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8 // 直角梯形元素默认长度 }, - block: { // 道岔封锁配置 - blockName: 'default', // 默认道岔封锁类型 - nameBorderShow: false, // 道岔名称是否有包围框 显示 - contentRectShow: true, // 道岔封锁显示 - contentRectColor: 'red' // 道岔封锁边框颜色 + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 18, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: true, // 单锁显示 + block: true, // 封锁显示 + blockColor: 'red' // 封锁颜色 } }; diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 637292ef6..a731e536d 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -394,7 +394,9 @@ class SkinCode extends defaultStyle { lossColor: '#FFFFFF', // 道岔失去颜色 locateColor: '#00FF00', // 道岔定位颜色 inversionColor: '#FFFF00', // 道岔反位颜色 - monolockColor: '#870E10' // 道岔单锁颜色 + monolockLocationColor: '#c00000', // 道岔单锁'定位'颜色 (红色) + monolockInversionColor: '#c00000', // 道岔单锁'反位'颜色 (红色) + block: true // 封锁名称 }, sectionAction: { flag: false, // 道岔 关联区段显示 @@ -403,15 +405,20 @@ class SkinCode extends defaultStyle { core: { length: 6 // 道岔单边长度 }, - block: { // 道岔封锁配置 - blockName: 'foshan_01', // 默认道岔封锁类型 - nameBorderShow: true, // 道岔名称是否有包围框 显示 - contentRectShow: false // 道岔封锁显示 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8 // 直角梯形元素默认长度 }, - monolock: { // 道岔单锁配置 - locationColor: '#c00000', // 道岔单锁定位颜色 (红色) - inversionColor: '#c00000', // 道岔单锁反位颜色 (红色) - rectShow: false // 道岔单锁 矩形框是否显示 + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 22, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: false, // 单锁显示 + block: false // 封锁显示 } }; diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 00e880227..5d039fa98 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -373,34 +373,41 @@ class SkinCode extends defaultStyle { this[deviceType.Switch] = { text: { - show: true, // 道岔名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - offset: {x: 0, y: 8}, // 道岔名称与区段距离 - fontSize: 11, // 字体大小 - fontColor: '#C0C0C0', // 道岔名称颜色 + show: true, // 道岔名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: {x: 0, y: 8}, // 道岔名称与区段距离 + fontSize: 11, // 字体大小 + fontColor: '#C0C0C0', // 道岔名称颜色 fontWeight: 'bold', // 字体粗细 - borderColor: '#FE0000', // 道岔边框颜色 - lossColor: '#FFFFFF', // 道岔失去颜色 - locateColor: '#00FF00', // 道岔定位颜色 - inversionColor: '#9C9D09', // 道岔反位颜色 - monolockColor: '#870E10' // 道岔单锁颜色 + borderColor: '#FE0000', // 道岔边框颜色 + lossColor: '#FFFFFF', // 道岔失去颜色 + locateColor: '#00FF00', // 道岔定位颜色 + inversionColor: '#9C9D09', // 道岔反位颜色 + monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色 + monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色 + block: true // 封锁名称 }, sectionAction: { - flag: false, // 道岔 关联区段显示 - spareColor: '#5b5b5b' // 区段显示颜色 + flag: false, // 道岔 关联区段显示 + spareColor: '#5b5b5b' // 区段显示颜色 }, core: { - length: 6 // 道岔单边长度 + length: 6 // 道岔单边长度 }, - block: { // 道岔封锁配置 - blockName: 'default', // 默认道岔封锁类型 - nameBorderShow: true, // 道岔名称是否有包围框 显示 - contentRectShow: false // 道岔封锁显示 + block: { // 道岔封锁配置 + blockName: 'default' // 默认道岔封锁类型 }, - monolock: { // 道岔单锁配置 - locationColor: '#ea282c', // 道岔单锁定位颜色 (红色) - inversionColor: '#ea282c', // 道岔单锁反位颜色 (红色) - rectShow: false // 道岔单锁 矩形框是否显示 + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 18, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: false, // 单锁显示 + block: false // 封锁显示 } }; diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 1772562a8..018a15aa4 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -396,40 +396,49 @@ class SkinCode extends defaultStyle { this[deviceType.Switch] = { text: { - show: true, // 道岔名称显示 - position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - offset: { x: 0, y: 8 }, // 道岔名称与区段距离 - fontSize: 11, // 字体大小 + show: true, // 道岔名称显示 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: { x: 0, y: 8 }, // 道岔名称与区段距离 + fontSize: 11, // 字体大小 fontColor: '#fff', // 道岔名称颜色 fontWeight: 'bold', // 字体粗细 borderColor: 'red', // 道岔边框颜色 - lossColor: '#FFFFFF', // 道岔失去颜色 - locateColor: '#fff', // 道岔定位颜色 + lossColor: '#FFFFFF', // 道岔失去颜色 + locateColor: '#fff', // 道岔定位颜色 inversionColor: '#fff', // 道岔反位颜色 - monolockColor: '#fff' // 道岔单锁颜色 + monolock: true, // 名称单锁显示包围框 + monolockLocationColor: '#fff', // 道岔单锁'定位'颜色 + monolockInversionColor: '#fff' // 道岔单锁'反位'颜色 }, sectionAction: { - flag: true, // 道岔 关联区段显示 - spareColor: '#5b5b5b' // 区段显示颜色 (灰色) + flag: true, // 道岔 关联区段显示 + spareColor: '#5b5b5b' // 区段显示颜色 (灰色) }, core: { - splice: true, // 哈尔滨特殊显示 - length: 6 // 道岔单边长度 + splice: true, // 哈尔滨特殊显示 + length: 6 // 道岔单边长度 }, - block: { // 道岔封锁配置 - blockName: 'default', // 默认道岔封锁类型 - nameBorderShow: false, // 道岔名称是否有包围框 显示 - contentRectShow: false, // 道岔封锁显示 - contentRectColor: '#fff', // 道岔封锁名称颜色 - rhomboidShow: true // 道岔单独显示 + trapezoid: { // 直角梯形元素 + length: 16, // 默认长度 + block: true // 封锁显示 }, - monolock: { // 道岔单锁配置 - locationColor: '#fff', // 道岔单锁定位颜色 (红色) - inversionColor: '#fff', // 道岔单锁反位颜色 (红色) - nameBorderShow: true, // 道岔名称是否有包围框 显示 - rectShow: false, // 道岔单锁 矩形框是否显示 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8, // 直角梯形元素默认长度 + trapezoidBlock: true, // 梯形封锁显示 + fork: true, // 挤岔专用(如有挤岔操作 变为true) + forKColor: 'red' // 挤岔颜色 配合挤岔专用 + }, + arcBlcok: { // 圆形封锁图形 + show: false, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 rectWidth: 18, // 矩形框 宽高 - rectBorderColor: 'red' // 矩形边框颜色 + rectBorderColor: 'red', // 矩形边框颜色 + monolock: false, // 单锁显示 + block: false // 封锁显示 } }; diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index a3d450630..9f3106465 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -200,123 +200,6 @@ class SkinCode extends defaultStyle { } }; - this[deviceType.AutoTurnBack] = { - // 是否显示 - visibleConditions: '01', - text: { - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - distance: 5 // 灯跟文字距离 - }, - subtitleText: { - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - distance: 17 // 等于副标题距离 - }, - lamp: { - borderShow: true, // 是否显示边框 - lineDash: null, // 灯的包围框 - stroke: '#FFFFFF', // 框的颜色 - fill: 'rgba(0,0,0,0)', // 填充色 - radiusR: 6, // 控制灯大小 - controlColor: '#b5b3b3', // 控制灯颜色 (灰色) - lightUpColor: '#ffff00' // 点亮灯颜色 - }, - OutFrame: { - - } - }; - /** 引导总锁 */ - this[deviceType.GuideLock] = { - // 是否显示 - displayCondition: '03', // 显示条件 prdType - text: { - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - distance: 5 // 灯跟文字距离 - }, - lamp: { - fill: 'rgba(0,0,0,0)', // 填充色 - radiusR: 6, // 控制灯大小 - controlColor: '#b5b3b3', // 控制灯颜色 (灰色) - lightUpColor: '#FF0000' // 点亮灯颜色 - } - }; - this[deviceType.StationStand] = { - common: { // 通用属性 - textFontSize: 10, // 站台默认字体大小 - haveJumpShow: false, // 站台是否有列车停跳显示 - functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示) - }, - safetyDoor: { // 屏蔽门 - height: 3, // 站台屏蔽门高度 - distance: 4, // 站台和屏蔽门之间的距离 - defaultColor: 'green', // 屏蔽门默认颜色 - splitDoorColor: 'green' // 屏蔽门切除颜色 - }, - stand: { // 站台 - headFontSize: 10, // 站台首端字体大小 - spareColor: 'white', // 站台空闲颜色 - stopColor: 'yellow', // 站台列车停站颜色 - jumpStopColor: '#6260f3', // 站台跳停颜色 - designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色 - }, - standEmergent: { // 紧急关闭 - mergentR: 4, // 站台紧急关闭半径 - insideOffset: { x: 0, y: 25 }, // 内站台紧急关闭偏移量 - outsideOffset: { x: 0, y: -25 }, // 外站台紧急关闭偏移量 - closeColor: 'red' // 站台紧急关闭颜色 - }, - reentry: {}, // 站台折返策略 - detainCar: { // 扣车 - text: 'H', // 扣车显示内容 - offset: { x: -8, y: 0 }, // 扣车偏移量 - centerTrainColor: 'white', // 中心扣车颜色 - andCenterTrainColor: 'red', // 车站+中心扣车颜色 - detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色 - fontSize: 10, - fontWeight: 'normal' - }, - stopTime: { // 停站时间 - offset: { x: -8, y: -4 }, // 运行时间偏移量 - textColor: 'white', // 停站时间字体颜色 - textFontSize: 10 // 停站时间字体大小 - }, - jump: {}, - trainStop: {}, // 停车标志 - trainDepart: {}, // 停车计时 - level: { // 运行等级 - position: -1, // 运行等级方向 - offset: { x: -8, y: 4 }, // 运行等级偏移量 - textColor: '#FFF000' // 停站等级字体颜色 - }, - text: { - fontSize: 11, // 字体大小 - fontWeight: 'normal', // 字体粗细 - distance: 5 // 灯跟文字距离 - }, - lamp: { - radiusR: 6, // 控制灯大小 - lampColor: '#5A5D5A' // 功能按钮颜色 - } - }; - - this[deviceType.StationCounter] = { - text: { - distance: 2, // 计数器名称和文字的距离 - fontColor: '#FFFFFF', // 计数器字体颜色 - borderColor: '#E4EF50' // 计数器边框颜色 - } - }; - - this[deviceType.StationDelayUnlock] = { - text: { - distance: 3, // 延迟解锁和设备之间的距离 - fontColor: '#FFFFFF', // 延时解锁字体颜色 - borderColor: '#FFFFFF' // 延迟解锁边框颜色 - } - }; - this[deviceType.Station] = { // text: { // show: true // 公里标名称显示 @@ -380,39 +263,161 @@ class SkinCode extends defaultStyle { text: { show: true, // 道岔名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 - offset: { x: 5, y: -10 }, // 道岔名称与区段距离 + offset: { x: 5, y: -10 }, // 道岔名称与区段距离 fontSize: 11, // 字体大小 fontColor: '#C0C0C0', // 道岔名称颜色 fontWeight: 'normal', // 字体粗细 - borderColor: '#FE0000', // 道岔边框颜色 - lossColor: 'lightgreen', // 道岔失去颜色 + borderColor: '#FE0000', // 道岔名称边框颜色 + lossColor: 'lightgreen', // 道岔名称失去颜色 locateColor: 'lightgreen', // 道岔定位颜色 - inversionColor: '#FFFF00', // 道岔反位颜色 - monolockColor: '#FFFFFF' // 道岔单锁颜色 + inversionColor: '#FFFF00', // 道岔反位颜色 + monolockLocationColor: 'lightgreen', // 道岔单锁'定位'颜色 (浅绿色) + monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色) + block: true // 封锁名称 }, sectionAction: { - flag: false, // 道岔 关联区段显示 - spareColor: '#5b5b5b' // 区段显示颜色 + flag: false, // 道岔 关联区段显示 + spareColor: '#5b5b5b' // 区段显示颜色 }, core: { length: 6 // 道岔单边长度 }, - monolock: { // 道岔单锁配置 - locationColor: 'lightgreen', // 道岔单锁'定位'颜色 (红色) - inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (红色) - rectShow: false, // 道岔单锁 矩形框是否显示 - arcShow: true, // 道岔单锁 圆形显示 - locationArcColor: 'green', // 圆形单锁框边框颜色 定位 - inversionArcColor: '#FFFF00', // 圆形单锁框边框颜色 反位 - rectWidth: 22, // 矩形框 宽高 - rectBorderColor: '#fff' // 矩形边框颜色 + jointImg: { // 道岔 A B C D四元素属性配置 + trapezoidLength: 8, // 直角梯形元素默认长度 + block: true, // 联合图形封锁状态 + flashingColors: '#D600D5', // 联合图形封锁闪烁显示颜色 + fork: true, // 挤岔专用(如有挤岔操作 变为true) + forKColor: 'red' // 挤岔颜色 配合挤岔专用 }, - block: { // 道岔封锁配置 - blockName: 'ningbo_01', // 默认道岔封锁类型 - flashingColors: '#D600D5', // 闪烁显示颜色 - nameBorderShow: true, // 道岔名称是否有包围框 显示 - contentRectShow: false, // 道岔封锁显示 - contentRectColor: 'red' // 道岔封锁边框颜色 + arcBlcok: { // 圆形封锁图形 + show: true, // 显示 + arcBorderColor: 'green', // 默认边框颜色 + locationColor: 'green', // 定位封锁颜色 + inversionColor: '#FFFF00' // 反位封锁颜色 + }, + rectLock: { // 矩形封锁框图形 + rectWidth: 22, // 矩形框 宽高 + rectBorderColor: '#fff', // 矩形边框颜色 + monolock: false, // 单锁显示 + block: false // 封锁显示 + } + }; + this[deviceType.StationStand] = { + common: { // 通用属性 + textFontSize: 10, // 站台默认字体大小 + haveJumpShow: false, // 站台是否有列车停跳显示 + functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示) + }, + safetyDoor: { // 屏蔽门 + height: 3, // 站台屏蔽门高度 + distance: 4, // 站台和屏蔽门之间的距离 + defaultColor: 'green', // 屏蔽门默认颜色 + splitDoorColor: 'green' // 屏蔽门切除颜色 + }, + stand: { // 站台 + headFontSize: 10, // 站台首端字体大小 + spareColor: 'white', // 站台空闲颜色 + stopColor: 'yellow', // 站台列车停站颜色 + jumpStopColor: '#6260f3', // 站台跳停颜色 + designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色 + }, + standEmergent: { // 紧急关闭 + mergentR: 4, // 站台紧急关闭半径 + insideOffset: { x: 0, y: 25 }, // 内站台紧急关闭偏移量 + outsideOffset: { x: 0, y: -25 }, // 外站台紧急关闭偏移量 + closeColor: 'red' // 站台紧急关闭颜色 + }, + reentry: {}, // 站台折返策略 + detainCar: { // 扣车 + text: 'H', // 扣车显示内容 + offset: { x: -8, y: 0 }, // 扣车偏移量 + centerTrainColor: 'white', // 中心扣车颜色 + andCenterTrainColor: 'red', // 车站+中心扣车颜色 + detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色 + fontSize: 10, + fontWeight: 'normal' + }, + stopTime: { // 停站时间 + offset: { x: -8, y: -4 }, // 运行时间偏移量 + textColor: 'white', // 停站时间字体颜色 + textFontSize: 10 // 停站时间字体大小 + }, + jump: {}, + trainStop: {}, // 停车标志 + trainDepart: {}, // 停车计时 + level: { // 运行等级 + position: -1, // 运行等级方向 + offset: { x: -8, y: 4 }, // 运行等级偏移量 + textColor: '#FFF000' // 停站等级字体颜色 + }, + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + radiusR: 6, // 控制灯大小 + lampColor: '#5A5D5A' // 功能按钮颜色 + } + }; + + this[deviceType.AutoTurnBack] = { + // 是否显示 + visibleConditions: '01', + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + subtitleText: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 17 // 等于副标题距离 + }, + lamp: { + borderShow: true, // 是否显示边框 + lineDash: null, // 灯的包围框 + stroke: '#FFFFFF', // 框的颜色 + fill: 'rgba(0,0,0,0)', // 填充色 + radiusR: 6, // 控制灯大小 + controlColor: '#b5b3b3', // 控制灯颜色 (灰色) + lightUpColor: '#ffff00' // 点亮灯颜色 + }, + OutFrame: { + + } + }; + + /** 引导总锁 */ + this[deviceType.GuideLock] = { + // 是否显示 + displayCondition: '03', // 显示条件 prdType + text: { + fontSize: 11, // 字体大小 + fontWeight: 'normal', // 字体粗细 + distance: 5 // 灯跟文字距离 + }, + lamp: { + fill: 'rgba(0,0,0,0)', // 填充色 + radiusR: 6, // 控制灯大小 + controlColor: '#b5b3b3', // 控制灯颜色 (灰色) + lightUpColor: '#FF0000' // 点亮灯颜色 + } + }; + + this[deviceType.StationCounter] = { + text: { + distance: 2, // 计数器名称和文字的距离 + fontColor: '#FFFFFF', // 计数器字体颜色 + borderColor: '#E4EF50' // 计数器边框颜色 + } + }; + + this[deviceType.StationDelayUnlock] = { + text: { + distance: 3, // 延迟解锁和设备之间的距离 + fontColor: '#FFFFFF', // 延时解锁字体颜色 + borderColor: '#FFFFFF' // 延迟解锁边框颜色 } }; diff --git a/src/jmapNew/shape/Switch/ESwName.js b/src/jmapNew/shape/Switch/ESwName.js index 320d9777a..460385da0 100644 --- a/src/jmapNew/shape/Switch/ESwName.js +++ b/src/jmapNew/shape/Switch/ESwName.js @@ -24,7 +24,6 @@ class ESwName extends Group { fontSize: style.Switch.text.fontSize, fontFamily: style.fontFamily, text: model.name, - // textAlign: model.triangle.drictx === 1 ? 'left' : 'right', textAlign: 'center', textVerticalAlign: 'middle', textFill: style.Switch.text.fontColor @@ -33,9 +32,6 @@ class ESwName extends Group { const rect = this.nameText.getBoundingRect(); let textWidth = rect.width; - if (style.Switch.monolock.nameBorderShow) { - textWidth = rect.width; - } if (model.triangle.drictx !== 1) { rect.x += rect.width; textWidth = -textWidth; @@ -60,7 +56,7 @@ class ESwName extends Group { const data = LangStorage.getLang() == 'en' ? 'Turnout section' : '道岔区段名称'; - this.arrowText = new Text({ + this.arrowText = new Text({ // 移入道岔显示名称 zlevel: model.zlevel, z: model.z + 20, style: { diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index f88f24cc9..df3ebe68e 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -66,7 +66,7 @@ export default class Switch extends Group { const point2 = [model.intersection.x + directx * (width2 + width1) + directx * detailWidth, point1[1]]; const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding]; const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth) - directx * 2 * detailWidth, point3[1] - direct * this.triangle.getCos(switchWidth)]; - this.locShelter = new ESwLocal({ // 定位 覆盖形状 + this.locShelter = new ESwLocal({ // 定位 覆盖形状 A zlevel: this.zlevel, z: this.z, style: style, @@ -81,7 +81,7 @@ export default class Switch extends Group { const rpoint2 = [rpoint1[0] + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1]; const rpoint3 = [rpoint2[0] + directx * 10, rpoint2[1]]; const rpoint4 = [rpoint2[0] + directx * 10, rpoint1[1]]; - this.relocShelter = new ESwLnversion({ // 反位覆盖形状 + this.relocShelter = new ESwLnversion({ // 反位覆盖形状 B zlevel: this.zlevel, z: this.z, style: style, @@ -95,7 +95,7 @@ export default class Switch extends Group { const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]]; const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1]; const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]]; - this.rhomboid = new ERhomboid({ // 岔芯 平行四边形 + this.rhomboid = new ERhomboid({ // 岔芯 平行四边形 C zlevel: this.zlevel, z: this.z, style: style, @@ -105,16 +105,13 @@ export default class Switch extends Group { onmouseout: () => { this.name.getArrowText().hide(); } }); - let spointLength1 = 8; + const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength; const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1]; - if (this.style.Switch.block.rhomboidShow) { - spointLength1 = 16; - } - const Tspoint2 = [Tspoint1[0] - directx * spointLength1, Tspoint1[1]]; - const Tspoint3 = [Tspoint1[0] - directx * spointLength1, model.intersection.y - directy * switchWidth1]; + const Tspoint2 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]]; + const Tspoint3 = [Tspoint1[0] - directx * trapezoidWidth, model.intersection.y - directy * switchWidth1]; const Tspoint4 = [model.intersection.x + directx * width3, Tspoint3[1]]; const Tspoint5 = [Tspoint1[0], Tspoint1[1]]; - this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 (用于'挤岔') + this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 (用于'挤岔') D zlevel: this.zlevel, z: this.z, style: style, @@ -171,27 +168,28 @@ export default class Switch extends Group { this.lockRect = new ELockRect({ // 锁定矩形 zlevel: this.zlevel, z: this.z + 6, - x: this.model.intersection.x - this.style.Switch.monolock.rectWidth / 2 + offsetX, - y: this.model.intersection.y - this.style.Switch.monolock.rectWidth / 2, - width: this.style.Switch.monolock.rectWidth, + x: this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX, + y: this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2, + width: this.style.Switch.rectLock.rectWidth, lineWidth: 1.8, - stroke: this.style.Switch.monolock.rectBorderColor, + stroke: this.style.Switch.rectLock.rectBorderColor, fill: this.style.transparentColor }); - - this.lockArc = new ELockArc({ // 锁定矩形 - zlevel: this.zlevel, - z: this.z + 6, - x: this.model.intersection.x, - y: this.model.intersection.y, - lineWidth: 1.2, - stroke: this.style.Switch.monolock.arcBorderColor, - fill: this.style.transparentColor - }); - this.add(this.lockArc); this.add(this.lockRect); this.lockRect.hide(); - this.lockArc.hide(); + if (this.style.Switch.arcBlcok) { + this.lockArc = new ELockArc({ // 锁定矩形 + zlevel: this.zlevel, + z: this.z + 6, + x: this.model.intersection.x, + y: this.model.intersection.y, + lineWidth: 1.2, + stroke: this.style.Switch.arcBlcok.arcBorderColor, + fill: this.style.transparentColor + }); + this.add(this.lockArc); + this.lockArc.hide(); + } } /** 名称动画*/ @@ -277,7 +275,7 @@ export default class Switch extends Group { /** 挤叉*/ setForkAction() { this.rhomboid.hide(); // 平行四边形 - if (this.style.Switch.block.blockName == 'ningbo_01' || this.style.Switch.block.blockName == 'foshan_01') { + if (this.style.Switch.jointImg.fork) { this.recover(); this.relocShelter.show(); this.relocShelter.animateStyle(item => { @@ -308,41 +306,38 @@ export default class Switch extends Group { /** 单锁*/ setMonolock() { - if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示 + if (this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示 this.lockRect.show(); } - if (this.style.Switch.monolock.nameBorderShow) { // 单锁显示名称包围框 + if (this.style.Switch.text.monolock) { // 单锁显示名称包围框 this.setHasTextBorder(1); } - if (this.style.Switch.monolock.arcShow) { // 圆形单锁是否显示 + if (this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示 this.lockArc.show(); - this.model.normalPosition && this.lockArc.setStyle({ stroke: this.style.Switch.monolock.locationArcColor }); - !this.model.normalPosition && this.lockArc.setStyle({ stroke: this.style.Switch.monolock.inversionArcColor }); - } - if (this.model.normalPosition) { - this.setTextColor(this.style.Switch.monolock.locationColor); // 定位 设置道岔名称颜色 - } else if (this.model.reversePosition) { - this.setTextColor(this.style.Switch.monolock.inversionColor); // 反位 设置道岔名称颜色 + this.model.normalPosition && this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor }); + !this.model.normalPosition && this.lockArc.setStyle({ stroke: this.style.Switch.aBrclcok.inversionColor }); } + this.model.normalPosition && this.setTextColor(this.style.Switch.text.monolockLocationColor); // 定位 设置道岔名称颜色 + this.model.reversePosition && this.setTextColor(this.style.Switch.text.monolockInversionColor); // 反位 设置道岔名称颜色 } /** 封锁 */ block() { - if (this.style.Switch.block.blockName == 'ningbo_01') { + if (this.style.Switch.jointImg.block) { this.recover(); this.relocShelter.show(); this.relocShelter.animateStyle(item => { item.animateStyle(true) .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.block.flashingColors }) + .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) .when(2000, { fill: this.style.backgroundColor }) .start(); }); - this.sheltertriangle.show(); // 宁波线路挤叉特殊显示 + this.sheltertriangle.show(); this.sheltertriangle.animateStyle(item => { item.animateStyle(true) .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.block.flashingColors }) + .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) .when(2000, { fill: this.style.backgroundColor }) .start(); }); @@ -350,20 +345,22 @@ export default class Switch extends Group { this.locShelter.animateStyle(item => { item.animateStyle(true) .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Switch.block.flashingColors }) + .when(1000, { fill: this.style.Switch.jointImg.flashingColors }) .when(2000, { fill: this.style.backgroundColor }) .start(); }); } - if (this.style.Switch.block.nameBorderShow) { + if (this.style.Switch.text.block) { this.setHasTextBorder(1); - } else if (this.style.Switch.block.contentRectShow) { - this.lockRect.show(); - this.lockRect.setStyle({ stroke: this.style.Switch.block.contentRectColor }); - } else if (this.style.Switch.block.rhomboidShow && this.model.reversePosition) { // 范围且封锁时显示 + } + if (this.style.Switch.jointImg.trapezoidBlock && this.model.reversePosition) { // 范围且封锁时显示 this.sheltertriangle.show(); this.sheltertriangle.getSection().setStyle('fill', '#000080'); } + if (this.style.Switch.rectLock.block) { + this.lockRect.show(); + this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.blockColor }); + } } /** 延时释放*/ @@ -425,8 +422,6 @@ export default class Switch extends Group { setState(model) { if (!this.isShowShape) return; - // model.normalPosition = 0; - // model.reversePosition = 1; if (model.normalPosition) { this.setLocationAction(model); /** 定位*/ } else if (model.reversePosition) { diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue index 132292701..a34bc48c5 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue @@ -127,8 +127,11 @@ export default { // 取消列车进路 cancelTrainRoute() { this.loading = true; - commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); @@ -138,9 +141,12 @@ export default { // 信号关灯 signalClose() { this.loading = true; - commitOperate(menuOperate.Signal.signalClose, {}, 1).then((data)=>{ - this.doClose(); - this.$refs.confirmControl.doShow(data.operate); + commitOperate(menuOperate.Signal.signalClose, {}, 1).then(({valid, operate})=>{ + this.loading = false; + if (valid) { + this.doClose(); + this.$refs.confirmControl.doShow(operate); + } }).catch(() => { this.loading = false; this.doClose(); @@ -149,8 +155,11 @@ export default { // 信号重开 reopenSignal() { this.loading = true; - commitOperate(menuOperate.Signal.reopenSignal, {}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.reopenSignal, {}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue index d4d6e3abb..779d821b7 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue @@ -279,8 +279,11 @@ export default { // 进路交人工控 humanControl() { this.loading = true; - commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); @@ -290,8 +293,11 @@ export default { // 进路交自动控 atsAutoControl() { this.loading = true; - commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue index acf3dee42..f97ae03d9 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue @@ -225,8 +225,11 @@ export default { commit() { if (this.row && this.row.canSetting) { this.loading = true; - commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/sectionControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/sectionControl.vue index a4672738c..7e42d01a1 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/sectionControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/sectionControl.vue @@ -188,8 +188,11 @@ export default { }, sendCommand(operate) { // 发送指令 this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ - this.doClose(); + commitOperate(operate, {}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue index 12907020b..a1c50cec1 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standBackStrategy.vue @@ -189,8 +189,11 @@ export default { commit() { if (this.isConfirm) { this.loading = true; - commitOperate(menuOperate.StationStand.setBackStrategy, {standReentryStrategy: this.strategy}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.StationStand.setBackStrategy, {standReentryStrategy: this.strategy}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standControl.vue index cf415927c..16914ffe9 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standControl.vue @@ -266,8 +266,11 @@ export default { }, sendCommand(operate) { // 发送指令 this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ - this.doClose(); + commitOperate(operate, {}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); @@ -278,7 +281,6 @@ export default { const operate = { operation: OperationEvent.Command.cancel.menu.operation }; - this.loading = false; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standJumpStopControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standJumpStopControl.vue index f0176fb40..c10462fd9 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standJumpStopControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standJumpStopControl.vue @@ -245,8 +245,11 @@ export default { // 设置跳停 setJumpStop() { this.loading = true; - commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); @@ -257,8 +260,11 @@ export default { // 取消跳停 cancelJumpStop() { this.loading = true; - commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standRunLevel.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standRunLevel.vue index 124cddae0..0c321af96 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standRunLevel.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standRunLevel.vue @@ -214,14 +214,14 @@ export default { if (index != 0) { const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code); const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode); - this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus }); + this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus ? opts.intervalRunTimeValidStatus : true }); } } else { // 上行时,此站不是最后一站 if (index != this.stationList.length) { const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code); const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode); - this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus }); + this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: opts.intervalRunTime ? this.getLevelByTime(opts.intervalRunTime) : '0', time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus ? opts.intervalRunTimeValidStatus : true }); } } }, @@ -312,9 +312,11 @@ export default { commit() { if (this.isConfirm) { this.loading = true; - commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: this.time, runLevelTimeForever: !!this.tempData[0].check}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: Number(this.time), runLevelTimeForever: !!this.tempData[0].check}, 2).then(({ valid })=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/standStopTime.vue b/src/jmapNew/theme/beijing_01/menus/dialog/standStopTime.vue index feef06d13..11f808584 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/standStopTime.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/standStopTime.vue @@ -211,9 +211,11 @@ export default { // }, commit() { this.loading = true; - commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then(({ valid })=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/switchControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/switchControl.vue index 1846e9ba6..3c97ccbc8 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/switchControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/switchControl.vue @@ -186,8 +186,11 @@ export default { sendCommand(operate) { // 发送指令 this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ - this.doClose(); + commitOperate(operate, {}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue index 7b5538fe4..28c1f0fe3 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue @@ -199,23 +199,29 @@ export default { }, // 请求遥控 conterCommit() { - commitOperate(menuOperate.StationControl.requestCentralControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{ - this.doClose(); - this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由站控转为中控:\n' + this.stationName); + commitOperate(menuOperate.StationControl.requestCentralControl, {stationCodes:[this.stationCode]}, 0).then(({valid, operate})=>{ + if (valid) { + this.doClose(); + this.$refs.twoConfirmation.doShow(operate, '确认将如下操作区域的控制模式由站控转为中控:\n' + this.stationName); + } }); }, // 请求站控 requestCommit() { - commitOperate(menuOperate.StationControl.requestStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{ - this.doClose(); - this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName); + commitOperate(menuOperate.StationControl.requestStationControl, {stationCodes:[this.stationCode]}, 0).then(({valid, operate})=>{ + if (valid) { + this.doClose(); + this.$refs.twoConfirmation.doShow(operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName); + } }); }, // 紧急站控 emergencyCommit() { - commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{ - this.doClose(); - this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName); + commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCodes:[this.stationCode]}, 0).then(({valid, operate})=>{ + if (valid) { + this.doClose(); + this.$refs.twoConfirmation.doShow(operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName); + } }); } } diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue index 7afc3d543..fe2931434 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue @@ -173,8 +173,10 @@ export default { // }, // 故障解锁 faultUnlock(selectType) { - commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, data.selected); + commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, selectType); + } }); }, undeveloped() { @@ -187,25 +189,33 @@ export default { }, // 切除 split() { - commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, alxeEffective() { - commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.alxeEffective.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.alxeEffective.doShow(operate, this.selected); + } }); }, // 激活 active() { - commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, // 区段计轴预复位 axlePreReset(selectType) { - commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, selectType); + commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, selectType); + } }); }, // 区段计轴预复位 @@ -216,8 +226,10 @@ export default { // }, // 设置速度 setSpeed() { - commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.speedLimitControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.speedLimitControl.doShow(operate, this.selected); + } }); } } diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index b15abc755..51be75079 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -332,94 +332,109 @@ export default { }, // 设置进路 arrangementRoute() { - commitOperate(menuOperate.Signal.arrangementRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeSelection.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 现地设置进路 setRoute(route) { - commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:route.code}, [], 3).then((data)=>{ + commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:route.code}, [], 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 取消进路 cancelTrainRoute() { - commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 现地取消进路 cancelTrainRouteByLow(selectType) { - commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 现地总人解 humanTrainRoute(selectType) { - commitOperate(menuOperate.Signal.humanTrainRoute, {signalCode:selectType.code}, 0).then((data)=>{ - data.operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE; - this.$refs.password.doShow(data.operate); + commitOperate(menuOperate.Signal.humanTrainRoute, {signalCode:selectType.code}, 0).then(({valid, operate})=>{ + if (valid) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE; + this.$refs.password.doShow(operate); + } }); }, // 现地信号重开操作 reopenSignalByRoute(selectType) { - commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, - // 信号重开 reopenSignal() { - commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 信号关灯 signalClose() { - commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 现地信号关灯 signalCloseByLow(selectType) { - commitOperate(menuOperate.Signal.signalClose, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.signalClose, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 进路交人工控 humanControl() { - commitOperate(menuOperate.Signal.humanControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 进路交自动控 atsAutoControl() { - commitOperate(menuOperate.Signal.atsAutoControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 设置通过模式 singalPassModel(selectType) { - commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 取消通过模式 singalCancelPassModel(selectType) { - commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 查询进路状态 detail() { - commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeDetail.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 获取进路列表 diff --git a/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue b/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue index 2d4a13385..ca351c25e 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuStationStand.vue @@ -243,28 +243,32 @@ export default { }, // 现地设置扣车 setDetainTrainByLow(selectType) { - commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, /** 取消扣车 */ cancleDetainTrainByLow(selectType) { - commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 设置扣车 setDetainTrain() { - commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 取消扣车 cancelDetainTrain() { - commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 强制取消扣车 @@ -285,44 +289,58 @@ export default { // }, // 设置跳停 setJumpStop() { - commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standJumpStopControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({ valid, operate })=>{ + if (valid) { + this.$refs.standJumpStopControl.doShow(operate, this.selected); + } }); }, // 取消跳停 cancelJumpStop() { - commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standJumpStopControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standJumpStopControl.doShow(operate, this.selected); + } }); }, // 停站时间控制 setStopTime() { - commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standStopTime.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standStopTime.doShow(operate, this.selected, []); + } }); }, // 运行时间控制 setRunLevel() { - commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standRunLevel.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then(({ valid, operate })=>{ + if (valid) { + this.$refs.standRunLevel.doShow(operate, this.selected, []); + } }); }, // 设置提前发车 earlyDeparture() { - commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 设置折返策略 setBackStrategy() { - commitOperate(menuOperate.StationStand.setBackStrategy, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standBackStrategy.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setBackStrategy, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standBackStrategy.doShow(operate, this.selected); + } }); }, // 查询站台状态 detail() { - commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standDetail.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standDetail.doShow(operate, this.selected, []); + } }); } } diff --git a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue index ae5053bd7..d9d87027e 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue @@ -238,63 +238,76 @@ export default { }, // 道岔单锁 lock(selectType) { - commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 道岔解锁 unlock(selectType) { - commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, selectType); + commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchControl.doShow(operate, selectType); + } }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 现地道岔强扳 switchTurnoutForce(selectType) { - commitOperate(menuOperate.Switch.turnoutForce, {switchCode:selectType.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, selectType); + commitOperate(menuOperate.Switch.turnoutForce, {switchCode:selectType.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchControl.doShow(operate, selectType); + } + }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 单操到定位 locate(selectType) { - commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 单操到反位 reverse(selectType) { - commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 区段切除 split() { - commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.speedLimitControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.speedLimitControl.doShow(operate, this.selected); + } }); }, // 确认计轴有效 alxeEffective() { - commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.alxeEffective.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.alxeEffective.doShow(operate, this.selected); + } }); }, undeveloped() { diff --git a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js index 774f84e62..a4f519a67 100644 --- a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js @@ -208,6 +208,10 @@ export function commitOperate(operate, paramList, over) { }; step.param = paramList; // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } if (over != 0 && over != 3) { delete step.start; } @@ -219,8 +223,8 @@ export function commitOperate(operate, paramList, over) { store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { store.dispatch('menuOperation/handleBreakFlag', { break: true }); - resolve({operate:step}); } + resolve({ valid: valid, operate: step }); }).catch(error=>{ reject(error); }); diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue index 5fd587718..9e5ff2028 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue @@ -7,7 +7,7 @@ - + diff --git a/src/jmapNew/theme/foshan_01/menus/menuSection.vue b/src/jmapNew/theme/foshan_01/menus/menuSection.vue index e4a066f87..1da696f0f 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSection.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSection.vue @@ -133,33 +133,41 @@ export default { }, // 设置计轴失效 alxeFailure() { - commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then((data)=>{ + commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 故障解锁 fault() { - commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionUnLock.doShow(operate, this.selected); + } }); }, // 切除 split() { - commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, // 区段激活 active() { - commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); } // // 设置速度 // setSpeed() { - // commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{ - // this.$refs.speedLimitControl.doShow(data.operate, this.selected); + // commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + // if (valid) { + // this.$refs.speedLimitControl.doShow(operate, this.selected); + // } // }); // } } diff --git a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue index 4075a51ca..360080e9a 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue @@ -283,19 +283,23 @@ export default { }, // 排列进路 arrangementRoute() { - commitOperate(menuOperate.Signal.arrangementRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeSelection.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 取消进路 cancelTrainRoute() { - commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 信号封锁 lock(selectType) { - commitOperate(menuOperate.Signal.lock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.lock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.routeLock.doShow(data.operation, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -303,7 +307,7 @@ export default { }, // 信号解封 unlock(selectType) { - commitOperate(menuOperate.Signal.unlock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.unlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.routeUnLock.doShow(data.operation, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -311,31 +315,39 @@ export default { }, // 信号重开 reopenSignal() { - commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 信号关灯 signalClose() { - commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 进路交人工控 humanControl() { - commitOperate(menuOperate.Signal.humanControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 进路交自动控 atsAutoControl() { - commitOperate(menuOperate.Signal.atsAutoControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 设置通过模式 singalPassModel(selectType) { - commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.routeControl.doShow(data.operation, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -343,7 +355,7 @@ export default { }, // 取消通过模式 singalCancelPassModel(selectType) { - commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.routeControl.doShow(data.operation, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -351,20 +363,26 @@ export default { }, // 查询进路状态 detail() { - commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeDetail.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 人工解锁进路(信号机取消引导) humanTrainRoute() { - commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行人解列车进路命令?'); + commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routerCommand.doShow(operate, this.selected, '是否执行人解列车进路命令?'); + } }); }, // 进路引导 guide() { - commitOperate(menuOperate.Signal.guide, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行引导命令'); + commitOperate(menuOperate.Signal.guide, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routerCommand.doShow(operate, this.selected, '是否执行引导命令'); + } }); }, // 获取进路列表 diff --git a/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue b/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue index 1f8f107ce..f0e819add 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuStationStand.vue @@ -28,6 +28,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'StationStandMenu', @@ -236,172 +237,74 @@ export default { }, // 设置扣车 setDetainTrain() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); + this.$refs.standControl.doShow(operate, this.selected); } }); }, // 取消扣车 cancelDetainTrain() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); + this.$refs.standControl.doShow(operate, this.selected); } }); }, // 设置跳停 setJumpStop() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setJumpStop.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(step, this.selected); + this.$refs.standJumpStopControl.doShow(operate, this.selected); } }); }, // 取消跳停 cancelJumpStop() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(step, this.selected); + this.$refs.standJumpStopControl.doShow(operate, this.selected); } }); }, // 设置停站时间 setStopTime() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setStopTime.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standStopTime.doShow(step, this.selected, tempData); - // }); + this.$refs.standStopTime.doShow(operate, this.selected, []); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 设置运行等级 setRunLevel() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.setRunLevel.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standRunLevel.doShow(step, this.selected, tempData); - // }); + this.$refs.standRunLevel.doShow(operate, this.selected, []); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 设置提前发车 earlyDeparture() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation, - param: { - standCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(step, this.selected); + this.$refs.standControl.doShow(operate, this.selected); } }); }, // 全线取消扣车 cancelDetainTrainAll() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, - param: { - standCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.StationStand.cancelDetainTrainAll, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standDetainTrainAll.doShow(step, this.selected); + this.$refs.standDetainTrainAll.doShow(operate, this.selected); } }); }, // 查询站台状态 detail() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.StationStand.detail.menu.operation, - param: {} - }; - this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {standCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.standDetail.doShow(step, this.selected, tempData); - // }); + this.$refs.standDetail.doShow(operate, this.selected, []); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); } } diff --git a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue index 3af194a83..f13e3354b 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue @@ -213,7 +213,7 @@ export default { }, // 单操到定位 locate(selectType) { - commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchControl.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -221,7 +221,7 @@ export default { }, // 单操到反位 reverse(selectType) { - commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchControl.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -229,7 +229,7 @@ export default { }, // 道岔单锁 lock(selectType) { - commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchControl.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -237,7 +237,7 @@ export default { }, // 道岔解锁 unlock(selectType) { - commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchUnLock.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -245,7 +245,7 @@ export default { }, // 道岔封锁 block(selectType) { - commitOperate(menuOperate.Switch.block, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.block, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchControl.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -253,7 +253,7 @@ export default { }, // 道岔解封 unblock(selectType) { - commitOperate(menuOperate.Switch.unblock, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.unblock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ // this.$refs.switchUnLock.doShow(data.operate, this.selected); }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); @@ -261,7 +261,7 @@ export default { }, // 道岔强扳 switchTurnoutForce(selectType) { - commitOperate(menuOperate.Switch.turnoutForce, {switchCode:selectType.code}, 3).then((data)=>{ + commitOperate(menuOperate.Switch.turnoutForce, {switchCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); }); diff --git a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js index 12b652173..1572e9b73 100644 --- a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js @@ -151,70 +151,50 @@ export const menuOperate = { } }, StationStand:{ - // setDetainTrain:{ - // // 设置扣车 - // operation: OperationEvent.StationStand.setDetainTrain.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN - // }, - // cancelDetainTrain:{ - // // 取消扣车 - // operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN - // }, - // setDetainTrainAuto:{ - // // 区间列车数量限制 - // operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, - // cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO - // }, - // cancelDetainTrainAuto:{ - // // 取消区间列车数量限制 - // operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, - // cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO - // }, - // setBulkBuckleTrain:{ - // // 批量扣车 - // operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation, - // cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL - // }, - // cancelBulkBuckleTrain:{ - // // 批量取消扣车 - // operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, - // cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL - // }, - // setJumpStop:{ - // // 设置跳停 - // operation: OperationEvent.StationStand.setJumpStop.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP - // }, - // cancelJumpStop:{ - // // 取消跳停 - // operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP - // }, - // setStopTime:{ - // // 停站时间控制 - // operation: OperationEvent.StationStand.setStopTime.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME - // }, - // setRunLevel:{ - // // 运行时间控制 - // operation: OperationEvent.StationStand.setRunLevel.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME - // }, - // earlyDeparture:{ - // // 设置提前发车 - // operation: OperationEvent.StationStand.earlyDeparture.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART - // }, - // setBackStrategy:{ - // // 设置折返策略 - // operation: OperationEvent.StationStand.setBackStrategy.menu.operation, - // cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY - // }, - // detail:{ - // // 查询站台状态 - // operation: OperationEvent.StationStand.detail.menu.operation - // } + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + cancelDetainTrainAll:{ + // 全线取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, + cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } }, StationControl:{ // requestCentralControl:{ @@ -243,6 +223,10 @@ export function commitOperate(operate, paramList, over) { }; step.param = paramList; // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } if (over != 0 && over != 3) { delete step.start; } diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmControl.vue index bd9fea116..166e5c6f0 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmControl.vue @@ -130,9 +130,11 @@ export default { }, sendCommand(operate) { this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ + commitOperate(operate, {}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue index 40523ee8e..9129909ba 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue @@ -177,9 +177,11 @@ export default { }, sendCommand(operate) { this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ + commitOperate(operate, {}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue index 86eafba81..822c8b42a 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue @@ -293,9 +293,11 @@ export default { }, sendCommand(operate) { this.loading = true; - commitOperate(operate, {routeCodeList:this.selection}, 2).then((data)=>{ + commitOperate(operate, {routeCodeList:this.selection}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue index 0a3bd5b05..a1028e3bc 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue @@ -180,8 +180,11 @@ export default { commit() { if (this.row && this.row.canSetting) { this.loading = true; - commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then((data)=>{ - this.doClose(); + commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue index 7d2be30c0..b027ff4d1 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routerCommand.vue @@ -107,9 +107,11 @@ export default { }, sendCommand(operate) { this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ + commitOperate(operate, {}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/sectionControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/sectionControl.vue index fb83a264c..81dcfaa08 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/sectionControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/sectionControl.vue @@ -160,9 +160,11 @@ export default { }, sendCommand(operate) { this.loading = true; - commitOperate(operate, {}, 2).then((data)=>{ + commitOperate(operate, {}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue index 140a222ee..4dab861ce 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue @@ -328,9 +328,11 @@ export default { }, sendCommand(operate, param) { this.loading = true; - commitOperate(operate, param, 2).then((data)=>{ + commitOperate(operate, param, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch(error => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standJumpStopControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standJumpStopControl.vue index 25983a679..7bc1ba2d3 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standJumpStopControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standJumpStopControl.vue @@ -238,9 +238,11 @@ export default { // 设置跳停 setJumpStop() { this.loading = true; - commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); @@ -250,9 +252,11 @@ export default { // 取消跳停 cancelJumpStop() { this.loading = true; - commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standRunLevel.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standRunLevel.vue index 4d919a858..ab8081826 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standRunLevel.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standRunLevel.vue @@ -294,9 +294,11 @@ export default { commit() { if (this.isConfirm) { this.loading = true; - commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: this.time, runLevelTimeForever: !!this.tempData[0].check}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: this.time, runLevelTimeForever: !!this.tempData[0].check}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standStopTime.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standStopTime.vue index 19ebbf0ad..1f3e50a1e 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standStopTime.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standStopTime.vue @@ -201,9 +201,11 @@ export default { // }, commit() { this.loading = true; - commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then((data)=>{ + commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then(({valid})=>{ this.loading = false; - this.doClose(); + if (valid) { + this.doClose(); + } }).catch((error) => { this.loading = false; this.doClose(); diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/switchControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/switchControl.vue index ee131b501..f647f8e09 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/switchControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/switchControl.vue @@ -69,7 +69,7 @@ import NoticeInfo from './childDialog/childDialog/noticeInfo'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; -import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import {menuOperate, commitOperate} from '../utils/menuOperate'; export default { name: 'SwitchControl', @@ -191,67 +191,32 @@ export default { }, // 道岔单锁 lock() { - const operate = { - over: true, - operation: OperationEvent.Switch.lock.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK - }; - - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.lock); }, // 道岔封锁 block() { - const operate = { - over: true, - operation: OperationEvent.Switch.block.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_BLOCK - }; - - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.block); }, // 道岔定位 locate() { - const operate = { - over: true, - operation: OperationEvent.Switch.locate.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN - }; - - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.npChain); }, // 道岔反位 reverse() { - const operate = { - over: true, - operation: OperationEvent.Switch.reverse.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN - }; - - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.rpChain); }, // 区段切除 split() { - const operate = { - over: true, - operation: OperationEvent.Switch.split.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF - }; - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.split); }, // 区段激活 active() { - const operate = { - over: true, - operation: OperationEvent.Switch.active.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_ACTIVE - }; - this.sendCommand(operate); + this.sendCommand(menuOperate.Switch.active); }, cancel() { const operate = { operation: OperationEvent.Command.cancel.menu.operation }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); @@ -263,7 +228,7 @@ export default { sendCommand(operate) { this.loading = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(operate, {}, 2).then(({valid})=>{ this.loading = false; if (valid) { this.doClose(); @@ -271,7 +236,7 @@ export default { }).catch((error) => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate, error.message); + this.$refs.noticeInfo.doShow({}, error.message); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index da8eaf525..ce1d7d9be 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -151,51 +151,65 @@ export default { // 设置计轴失效 alxeFailure() { this.mouseCancelState(this.selected); - commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then((data)=>{ + commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ }).catch((error)=>{ this.$refs.noticeInfo.doShow({}, error.message); }); }, // 故障解锁 fault() { - commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionUnLock.doShow(operate, this.selected); + } }); }, // 切除 split() { - commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, // 确认计轴有效 alxeEffective() { - commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.alxeEffective.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.alxeEffective.doShow(operate, this.selected); + } }); }, // 区段激活 active() { - commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, // 区段封锁 lock() { - commitOperate(menuOperate.Section.lock, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.lock, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionControl.doShow(operate, this.selected); + } }); }, // 区段解锁 unlock() { - commitOperate(menuOperate.Section.unlock, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.sectionUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.unlock, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.sectionUnLock.doShow(operate, this.selected); + } }); }, // 设置速度 setSpeed() { - commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{ - this.$refs.speedLimitControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.speedLimitControl.doShow(operate, this.selected); + } }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 26a013c95..a3c0cb378 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -291,80 +291,106 @@ export default { }, // 排列进路 arrangementRoute() { - commitOperate(menuOperate.Signal.arrangementRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeSelection.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 取消进路 cancelTrainRoute() { - commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 信号封锁 lock() { - commitOperate(menuOperate.Signal.lock, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.lock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeLock.doShow(operate, this.selected); + } }); }, // 信号解封 unlock() { - commitOperate(menuOperate.Signal.unlock, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.unlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeUnLock.doShow(operate, this.selected); + } }); }, // 信号重开 reopenSignal() { - commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 信号关灯 signalClose() { - commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 进路交人工控 humanControl() { - commitOperate(menuOperate.Signal.humanControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 进路交自动控 atsAutoControl() { - commitOperate(menuOperate.Signal.atsAutoControl, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeHandControl.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 设置通过模式 singalPassModel() { - commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 取消通过模式 singalCancelPassModel() { - commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } }); }, // 查询进路状态 detail() { - commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routeDetail.doShow(data.operate, this.selected, this.getRouteList(this.selected)); + 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)); + } }); }, // 人工解锁进路(信号机取消引导) humanTrainRoute() { - commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行人解列车进路命令?'); + commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routerCommand.doShow(operate, this.selected, '是否执行人解列车进路命令?'); + } }); }, // 进路引导 guide() { - commitOperate(menuOperate.Signal.guide, {signalCode:this.selected.code}, 0).then((data)=>{ - this.$refs.routerCommand.doShow(data.operate, this.selected, '是否执行引导命令?'); + commitOperate(menuOperate.Signal.guide, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.routerCommand.doShow(operate, this.selected, '是否执行引导命令?'); + } }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue index 1ede3304d..283eaca05 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue @@ -112,14 +112,18 @@ export default { }, setCenterControl() { // 请求中控(遥控) - commitOperate(menuOperate.StationControl.requestCentralControl, {}, 0).then((data)=>{ - this.$refs.stationControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationControl.requestCentralControl, {}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.stationControl.doShow(operate, this.selected); + } }); }, setStationControl() { // 请求站控 - commitOperate(menuOperate.StationControl.requestStationControl, {}, 0).then((data)=>{ - this.$refs.stationControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationControl.requestStationControl, {}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.stationControl.doShow(operate, this.selected); + } }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue index 90fde8454..5c8c27497 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue @@ -243,74 +243,98 @@ export default { }, // 设置扣车 setDetainTrain() { - commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 取消扣车 cancelDetainTrain() { - commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 区间列车数量限制 setDetainTrainAll() { - commitOperate(menuOperate.StationStand.setDetainTrainAuto, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setDetainTrainAuto, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 取消区间列车数量限制 cancelDetainTrainAll() { - commitOperate(menuOperate.StationStand.cancelDetainTrainAuto, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelDetainTrainAuto, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected); + } }); }, // 批量扣车 setBulkBuckleTrain() { - commitOperate(menuOperate.StationStand.setBulkBuckleTrain, {}, 0).then((data)=>{ - this.$refs.standBulkBuckleTrain.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setBulkBuckleTrain, {}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standBulkBuckleTrain.doShow(operate, this.selected); + } }); }, // 批量取消扣车 cancelBulkBuckleTrain() { - commitOperate(menuOperate.StationStand.cancelBulkBuckleTrain, {}, 0).then((data)=>{ - this.$refs.standBulkBuckleTrain.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelBulkBuckleTrain, {}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standBulkBuckleTrain.doShow(operate, this.selected); + } }); }, // 设置跳停 setJumpStop() { - commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standJumpStopControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standJumpStopControl.doShow(operate, this.selected); + } }); }, // 取消跳停 cancelJumpStop() { - commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standJumpStopControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standJumpStopControl.doShow(operate, this.selected); + } }); }, // 设置停站时间 setStopTime() { - commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standStopTime.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standStopTime.doShow(operate, this.selected, []); + } }); }, // 设置运行等级 setRunLevel() { - commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standRunLevel.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standRunLevel.doShow(operate, this.selected, []); + } }); }, // 设置提前发车 earlyDeparture() { - commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standControl.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standControl.doShow(operate, this.selected, []); + } }); }, // 查询站台状态 detail() { - commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then((data)=>{ - this.$refs.standDetail.doShow(data.operate, this.selected, []); + commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.standDetail.doShow(operate, this.selected, []); + } }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 61a60cf34..50bb9253b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -228,64 +228,84 @@ export default { this.$refs.noticeInfo.doShow(operate); }); }, - // 单操到定位 + // 定操定位 locate() { - commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.npChain, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchControl.doShow(operate, this.selected); + } }); }, - // 单操到反位 + // 定操反位 reverse() { - commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.rpChain, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchControl.doShow(operate, this.selected); + } }); }, // 道岔单锁 lock() { - commitOperate(menuOperate.Switch.lock, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.switchUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchUnLock.doShow(operate, this.selected); + } }); }, // 道岔封锁 block() { - commitOperate(menuOperate.Switch.block, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.switchUnLock.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.unblock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.switchUnLock.doShow(operate, this.selected); + } }); }, // 区段切除 split() { - commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.switchControl.doShow(data.operate, this.selected); + 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((data)=>{ - this.$refs.speedLimitControl.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.speedLimitControl.doShow(operate, this.selected); + } }); }, // 确认计轴有效 alxeEffective() { - commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then((data)=>{ - this.$refs.alxeEffective.doShow(data.operate, this.selected); + commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.alxeEffective.doShow(operate, this.selected); + } }); }, undeveloped() { diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js index 51a52efd2..4a1dc427b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -144,15 +144,15 @@ export const menuOperate = { operation: OperationEvent.Switch.unblock.menu.operation, cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK }, - locate:{ - // 单操到定位 + npChain:{ + // 道岔定操(联动) operation: OperationEvent.Switch.locate.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION + cmdType:CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN }, - reverse:{ - // 单操到反位 + rpChain:{ + // 道岔反操(联动) operation: OperationEvent.Switch.reverse.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION + cmdType:CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN }, split:{ // 区段切除 @@ -268,6 +268,10 @@ export function commitOperate(operate, paramList, over) { }; step.param = paramList; // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } if (over != 0 && over != 3) { delete step.start; } diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 88403ea4d..ab699a9eb 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -20,7 +20,7 @@ + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 4e90ba429..fe927965e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -102,10 +102,9 @@ import QrcodeVue from 'qrcode.vue'; import { getLoginWmurl, checkLoginStatus } from '@/api/login'; import { LoginParams } from '@/utils/login'; import bgImg from '@/assets/bg1.jpg'; -import { loginInfo } from '@/scripts/ConstDic'; +import { loginInfo, UrlConfig } from '@/scripts/ConstDic'; import { removeToken } from '@/utils/auth'; import LangStorage from '@/utils/lang'; -import { UrlConfig } from '@/router/index'; import logoImgXty from '@/assets/logo_xty.png'; import logoImgGzb from '@/assets/logo_gzb.png'; import logoImgHyd from '@/assets/logo_hyd.png'; diff --git a/src/views/newMap/displayNew/LeftSlider.vue b/src/views/newMap/displayNew/LeftSlider.vue index 325dd9394..cd97ec8f2 100644 --- a/src/views/newMap/displayNew/LeftSlider.vue +++ b/src/views/newMap/displayNew/LeftSlider.vue @@ -39,7 +39,7 @@ import { getPublishLessonTree } from '@/api/jmap/lesson'; import { trainingNotifyNew } from '@/api/simulation'; import { launchFullscreen } from '@/utils/screen'; -import { UrlConfig } from '@/router/index'; +import { UrlConfig } from '@/scripts/ConstDic'; export default { name: 'LeftSlider', data() { diff --git a/src/views/newMap/displayNew/menuLesson.vue b/src/views/newMap/displayNew/menuLesson.vue index 8025e1ad2..be6d49fb9 100644 --- a/src/views/newMap/displayNew/menuLesson.vue +++ b/src/views/newMap/displayNew/menuLesson.vue @@ -30,7 +30,7 @@ import { startTrainingNew, endTrainingNew } from '@/api/jmap/training'; import { trainingNotifyNew } from '@/api/simulation'; import { TrainingMode } from '@/scripts/ConstDic'; import { timeFormat } from '@/utils/date'; -import { UrlConfig } from '@/router/index'; +import { UrlConfig } from '@/scripts/ConstDic'; export default { name: 'MenuLesson', diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index 868856f8f..92f0fc4df 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -34,7 +34,7 @@