Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2020-09-02 10:19:25 +08:00
commit 529dce5d2c
37 changed files with 563 additions and 621 deletions

View File

@ -556,7 +556,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
// let netDataAssets = JSON.parse(netdata.data.assets); // let netDataAssets = JSON.parse(netdata.data.assets);
// setpsdstationmap(JSON.parse(netdata.data.stands)); // setpsdstationmap(JSON.parse(netdata.data.stands));
scope.modelmanager.loadpromise(mixers).then(function (data) { scope.modelmanager.loadpromise(mixers).then(function (data) {
switchModel = scope.modelmanager.otherDevice.mesh.getObjectByName("SWITCH"); switchModel = scope.modelmanager.otherDevice.mesh.getObjectByName("SWITCH1");
moveanima.initlistnew(switchModel); moveanima.initlistnew(switchModel);
scope.devicetext.initdevicetext(switchModel); scope.devicetext.initdevicetext(switchModel);
@ -891,6 +891,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
if(navMesh){ if(navMesh){
scope.scene.remove( navMesh ); scope.scene.remove( navMesh );
} }
if(navStatus){ if(navStatus){
navStatus = false; navStatus = false;
}else{ }else{
@ -899,7 +900,8 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
let startPoint = new THREE.Vector3(human.position.x,human.position.y-0.6,human.position.z); let startPoint = new THREE.Vector3(human.position.x,human.position.y-0.6,human.position.z);
pathPoints.push(new THREE.Vector3(human.position.x,human.position.y,human.position.z)); pathPoints.push(new THREE.Vector3(human.position.x,human.position.y,human.position.z));
groupID = pathFinder.getGroup( ZONE, startPoint ); groupID = pathFinder.getGroup( ZONE, startPoint );
targetPosition = new THREE.Vector3(switchModel.matrixWorld.elements[12],-5.596,switchModel.matrixWorld.elements[14]); targetPosition = new THREE.Vector3(switchModel.matrixWorld.elements[12],switchModel.matrixWorld.elements[13],switchModel.matrixWorld.elements[14]);
// //
// console.log(pathPoints[0]); // console.log(pathPoints[0]);
// console.log(targetPosition); // console.log(targetPosition);
@ -1211,6 +1213,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
}; };
this.updateaction = function (data) { this.updateaction = function (data) {
console.log(data);
if (data.type == "SWITCH") { if (data.type == "SWITCH") {
if (data.normal == "0") { if (data.normal == "0") {
scope.modelmanager.otherDevice.normalPosition = "0"; scope.modelmanager.otherDevice.normalPosition = "0";

View File

@ -212,6 +212,10 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
initall(event.data.body); initall(event.data.body);
return; return;
} }
if (event.data.type == 'Simulation_Over') {
window.close();
return;
}
}; };
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) { this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {

View File

@ -20,7 +20,7 @@ export function MoveanimateVr(main){
scope.animatelist[switchmodel.animacode+"chaijie"] = []; scope.animatelist[switchmodel.animacode+"chaijie"] = [];
scope.animatelist[switchmodel.animacode+"fuwei"] = []; scope.animatelist[switchmodel.animacode+"fuwei"] = [];
for(let i=0,leni=switchmodel.children.length;i<leni;i++){ for(let i=0,leni=switchmodel.children.length;i<leni;i++){
if(switchmodel.children[i].name == "DDJ"){ if(switchmodel.children[i].name == "DDJ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
@ -32,7 +32,7 @@ export function MoveanimateVr(main){
} }
if(switchmodel.children[i].name == "DJZ"){ if(switchmodel.children[i].name == "DJZ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
@ -42,7 +42,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"Lxingoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"Lxingoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "DINGK"){ if(switchmodel.children[i].name == "DINGK011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+9,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+9,switchmodel.children[i].position.z));
@ -53,7 +53,7 @@ export function MoveanimateVr(main){
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiaoxingxiantieoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiaoxingxiantieoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "SZ"){ if(switchmodel.children[i].name == "SZ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z-1)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z-1));
@ -63,7 +63,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"zhongchuipianoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"zhongchuipianoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "JSQ"){ if(switchmodel.children[i].name == "JSQ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
@ -73,7 +73,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"laganoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"laganoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "YWJCQ"){ if(switchmodel.children[i].name == "YWJCQ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z+3)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z+3));
@ -83,7 +83,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dongjiedianzhouoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dongjiedianzhouoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "ESWCJJ"){ if(switchmodel.children[i].name == "ESWCJJ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
@ -93,7 +93,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"neibuoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"neibuoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "AQJD"){ if(switchmodel.children[i].name == "AQJD011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-2)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-2));
@ -104,7 +104,7 @@ export function MoveanimateVr(main){
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiedianoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiedianoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "QDP"){ if(switchmodel.children[i].name == "QDP011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-3)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-3));
@ -114,7 +114,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"yapianoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"yapianoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "SDP"){ if(switchmodel.children[i].name == "SDP011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
@ -126,7 +126,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"fanghuozhaooff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"fanghuozhaooff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "ZDKBQ"){ if(switchmodel.children[i].name == "ZDKBQ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
@ -136,7 +136,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dianyuanpianoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dianyuanpianoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name == "ZZ"){ if(switchmodel.children[i].name == "ZZ011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x+3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x+3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
@ -146,7 +146,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"xinpianoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"xinpianoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name =="BSG"){ if(switchmodel.children[i].name =="BSG011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x+1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x+1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
@ -156,7 +156,7 @@ export function MoveanimateVr(main){
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jueyuanzhouoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jueyuanzhouoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name =="DZG"){ if(switchmodel.children[i].name =="DZG011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
@ -167,7 +167,7 @@ export function MoveanimateVr(main){
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"cigangoff",points2,0.5,true,0); scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"cigangoff",points2,0.5,true,0);
} }
if(switchmodel.children[i].name =="CTK"){ if(switchmodel.children[i].name =="CTK011"){
let points1 = []; let points1 = [];
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z)); points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
@ -188,21 +188,21 @@ export function MoveanimateVr(main){
modelorderlist[switchmodel.animacode] = [ modelorderlist[switchmodel.animacode] = [
{name:"SZ",pos:[-1.5,0,-1]},//锁子 {name:"SZ011",pos:[-1.5,0,-1]},//锁子
{name:"DINGK",pos:[0,0,9]},//顶盖 {name:"DINGK011",pos:[0,0,9]},//顶盖
{name:"DJZ",pos:[-3,0,0]}, {name:"DJZ011",pos:[-3,0,0]},
{name:"DDJ",pos:[-1.5,0,0]}, {name:"DDJ011",pos:[-1.5,0,0]},
{name:"JSQ",pos:[-3,0,3]}, {name:"JSQ011",pos:[-3,0,3]},
{name:"ZDKBQ",pos:[0,0,3]}, {name:"ZDKBQ011",pos:[0,0,3]},
{name:"ZZ",pos:[3,0,3]}, {name:"ZZ011",pos:[3,0,3]},
{name:"ESWCJJ",pos:[0,0,6]}, {name:"ESWCJJ011",pos:[0,0,6]},
{name:"CTK",pos:[0,0,6]}, {name:"CTK011",pos:[0,0,6]},
{name:"YWJCQ",pos:[0,3,6]}, {name:"YWJCQ011",pos:[0,3,6]},
{name:"AQJD",pos:[0,-2,6]}, {name:"AQJD011",pos:[0,-2,6]},
{name:"QDP",pos:[0,-3,6]}, {name:"QDP011",pos:[0,-3,6]},
{name:"SDP",pos:[0,-4,6]}, {name:"SDP011",pos:[0,-4,6]},
{name:"BSG",pos:[1,-5,0]}, {name:"BSG011",pos:[1,-5,0]},
{name:"DZG",pos:[-1,-5,0]} {name:"DZG011",pos:[-1,-5,0]}

View File

@ -420,7 +420,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
} }
if(scope.raycasterswitch == "signal"){ if(scope.raycasterswitch == "signal"){
console.log(signallist);
let intersects = raycaster.intersectObjects( signallist.group.children,true); let intersects = raycaster.intersectObjects( signallist.group.children,true);
if(intersects[0]){ if(intersects[0]){
@ -449,10 +449,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
camerarail.progress = 0; camerarail.progress = 0;
let points = []; let points = [];
let stationp1 = stationstandlist.group.children[0].position; let stationp1 = stationstandlist.group.children[0].position;
let stationp2 = stationstandlist.group.children[20].position;
//全线漫游
// points.push(new THREE.Vector3(stationp1.x-20,10,stationp1.z));
// points.push(new THREE.Vector3(stationp2.x+20,10,stationp2.z));
//站内漫游(晕) //站内漫游(晕)
// points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+15)); // points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+15));
// points.push(new THREE.Vector3(stationp1.x,11,stationp1.z+15)); // points.push(new THREE.Vector3(stationp1.x,11,stationp1.z+15));
@ -462,10 +459,18 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
// points.push(new THREE.Vector3(stationp1.x+38,11,stationp1.z+2)); // points.push(new THREE.Vector3(stationp1.x+38,11,stationp1.z+2));
// points.push(new THREE.Vector3(stationp1.x+13,5,stationp1.z+2)); // points.push(new THREE.Vector3(stationp1.x+13,5,stationp1.z+2));
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+12)); if(stationstandlist.group.children[0].inside == false){
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z+12)); points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z-26));
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z+12)); points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z-26));
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z+12)); points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z-26));
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z-26));
}else{
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+12));
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z+12));
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z+12));
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z+12));
}
// points.push(new THREE.Vector3(stationp1.x+40,3,stationp1.z+15)); // points.push(new THREE.Vector3(stationp1.x+40,3,stationp1.z+15));
// controls.target = new THREE.Vector3(camera.position.x+1,camera.position.y,camera.position.z); // controls.target = new THREE.Vector3(camera.position.x+1,camera.position.y,camera.position.z);
// controls.update(); // controls.update();

View File

@ -46,6 +46,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
} }
function initnew3d(data,netdata){ function initnew3d(data,netdata){
// console.log(JSON.parse(netdata.assets)); // console.log(JSON.parse(netdata.assets));
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]); Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
let mapdata = data; let mapdata = data;
@ -68,7 +69,18 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
let switchdata = JSON.parse(netdata.switchs); let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals); let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands); let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList; let psddata = mapdata.psdList;
if(standsdata[0].inside == undefined){
for(let i=0;i<standsdata.length;i++){
for(let j=0;j<mapdata.stationStandList.length;j++){
if(standsdata[i].code == mapdata.stationStandList[j].stationCode){
standsdata[i].inside = mapdata.stationStandList[j].inside;
j = mapdata.stationStandList.length;
}
}
}
}
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList); assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList);
// assetloader.setmodellistnew(netdata.assets); // assetloader.setmodellistnew(netdata.assets);

View File

@ -101,7 +101,7 @@ export function StationStandListN() {
} }
} }
// console.log(newstationmesh);
if(mode){ if(mode){
if(mode == "02"){ if(mode == "02"){
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 ); let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
@ -153,6 +153,7 @@ export function StationStandListN() {
} }
} }
for(let i=0;i<standsdata.length;i++){ for(let i=0;i<standsdata.length;i++){
let newstationstand = new StationStandModel(standsdata[i]); let newstationstand = new StationStandModel(standsdata[i]);
if(standsdata[i].code != "Station96090"){ if(standsdata[i].code != "Station96090"){
@ -169,16 +170,18 @@ export function StationStandListN() {
newstationstand.direction2.name = standsdata[i].direction2.name; newstationstand.direction2.name = standsdata[i].direction2.name;
newstationstand.direction2.screenDoorOpenStatus = "01"; newstationstand.direction2.screenDoorOpenStatus = "01";
let newstationmesh = null; let newstationmesh = null;
if(standsdata[i].inside == true){ if(standsdata[i].inside == undefined){
newstationmesh = selectmesh1.clone(true);
}else if(standsdata[i].inside == true){
newstationmesh = selectmesh1.clone(true); newstationmesh = selectmesh1.clone(true);
}else{ }else{
newstationmesh = selectmesh2.clone(true); newstationmesh = selectmesh2.clone(true);
} }
// console.log(standsdata[i].name);
// console.log(standsdata[i].code);
// console.log("==================");
newstationmesh.code = standsdata[i].code; newstationmesh.code = standsdata[i].code;
newstationmesh.name = standsdata[i].code; newstationmesh.name = standsdata[i].code;
newstationmesh.inside = standsdata[i].inside;
newstationmesh.position.x = standsdata[i].position.x; newstationmesh.position.x = standsdata[i].position.x;
newstationmesh.position.y = standsdata[i].position.y; newstationmesh.position.y = standsdata[i].position.y;
newstationmesh.position.z = standsdata[i].position.z; newstationmesh.position.z = standsdata[i].position.z;

View File

@ -15,8 +15,6 @@ class EMouse extends Group {
// 名称的包围框 // 名称的包围框
if (this.device.name && this.device.style.Section.mouseOverStyle.nameShow) { if (this.device.name && this.device.style.Section.mouseOverStyle.nameShow) {
const rect = this.device.name.getBoundingRect(); const rect = this.device.name.getBoundingRect();
// console.log(this.device.isSwitchSection, this.device.switchSection);
// if (!this.device.isSwitchSection) {
this.sectionTextBorder = new Rect({ this.sectionTextBorder = new Rect({
zlevel: this.device.zlevel, zlevel: this.device.zlevel,
z: this.device.z + 4, z: this.device.z + 4,
@ -29,7 +27,6 @@ class EMouse extends Group {
}); });
this.add(this.sectionTextBorder); this.add(this.sectionTextBorder);
this.sectionTextBorder.hide(); this.sectionTextBorder.hide();
// }
const fontSize = this.device.model.type == '02' ? this.device.style.Section.text.fontSize + 2 : this.device.style.Section.text.fontSize; const fontSize = this.device.model.type == '02' ? this.device.style.Section.text.fontSize + 2 : this.device.style.Section.text.fontSize;
this.TextName = new Text({ this.TextName = new Text({
@ -50,25 +47,6 @@ class EMouse extends Group {
}); });
this.add(this.TextName); this.add(this.TextName);
this.TextName.hide(); this.TextName.hide();
this.sectionTextShadow = new Text({
zlevel: this.zlevel + 3,
z: 5,
position: [4, -2],
silent: true,
style: {
x: rect.x + (rect.width / 2),
y: rect.y + (rect.height / 2),
text: this.device.model.name,
fontFamily: this.device.style.fontFamily,
textFill: this.device.style.Section.mouseOverStyle.textShadowColor, // 黄色
textAlign: 'middle',
textVerticalAlign: 'top',
textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.fontFamily
}
});
this.add(this.sectionTextShadow);
this.sectionTextShadow.hide();
} }
// 区段包围框 // 区段包围框
if (this.device.section) { if (this.device.section) {
@ -155,47 +133,42 @@ class EMouse extends Group {
} }
mouseover(e) { mouseover(e) {
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (this.device.model.switchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
instance.mouseEvent.mouseover(e); instance.mouseEvent.mouseover(e);
} }
} else { }
this.TextName && this.TextName.show(); this.TextName && this.TextName.show();
this.sectionTextBorder && this.sectionTextBorder.show(); this.sectionTextBorder && this.sectionTextBorder.show();
this.lineBorder && this.lineBorder.show(); this.lineBorder && this.lineBorder.show();
const instance = this.getInstanceByCode(this.device.model.trainWindowCode); const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
instance.mouseEvent.mouseEnter(e); instance.mouseEvent.mouseEnter(e);
}
} }
} }
mouseout(e) { mouseout(e) {
if (!this.device.model.down) { if (this.device.model.switchSection && this.device.model.relSwitchCode) {
this.sectionTextShadow && this.sectionTextShadow.hide(); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); instance.mouseEvent.mouseout(e);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
instance.mouseEvent.mouseout(e);
}
} else {
this.TextName && this.TextName.hide();
this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide();
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseEvent.mouseLeave(e);
}
} }
} }
this.TextName && this.TextName.hide();
this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide();
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseEvent.mouseLeave(e);
}
} }
mouseEnter(e) { mouseEnter(e) {
this.TextName && this.TextName.show(); this.TextName && this.TextName.show();
this.sectionTextBorder && this.sectionTextBorder.show(); this.sectionTextBorder && this.sectionTextBorder.show();
this.lineBorder && this.lineBorder.show(); this.lineBorder && this.lineBorder.show();
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (this.device.model.switchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
instance.mouseEvent.mouseEnter(e); instance.mouseEvent.mouseEnter(e);
@ -207,7 +180,7 @@ class EMouse extends Group {
this.TextName && this.TextName.hide(); this.TextName && this.TextName.hide();
this.sectionTextBorder && this.sectionTextBorder.hide(); this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide(); this.lineBorder && this.lineBorder.hide();
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) { if (this.device.model.switchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode); const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseEvent.mouseLeave(e); instance.mouseEvent.mouseLeave(e);

View File

@ -793,15 +793,15 @@ export default class Section extends Group {
// } // }
// } // }
/** 计轴失效 13*/ // /** 计轴失效 13*/
alxeFailure() { // alxeFailure() {
if (this.section) { // if (this.section) {
this.section.setStyle({ // this.section.setStyle({
stroke: this.style.Section.axle.Failure, // stroke: this.style.Section.axle.Failure,
lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth // lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth
}); // });
} // }
} // }
showRemainTime(number) { // 区段延时保护倒计时显示 showRemainTime(number) { // 区段延时保护倒计时显示
this.releaseName && this.releaseName.show(); this.releaseName && this.releaseName.show();

View File

@ -14,7 +14,6 @@ class EMouse extends Group {
const rect = this.device.name.getNameText().getBoundingRect(); const rect = this.device.name.getNameText().getBoundingRect();
let textWidth = rect.width * 0.8; let textWidth = rect.width * 0.8;
if (this.device.triangle.drictx !== 1) { if (this.device.triangle.drictx !== 1) {
// rect.x += rect.width;
textWidth = -textWidth; textWidth = -textWidth;
} }
@ -91,8 +90,6 @@ class EMouse extends Group {
mouseover(e) { mouseover(e) {
this.switchBorder && this.switchBorder.show(); this.switchBorder && this.switchBorder.show();
// this.device.setLossAction(false);
// this.device.setSwitchCoreColor(this.device.style.Switch.mouseOverStyle.borderBackgroundColor);
this.device.setTextStyle({ this.device.setTextStyle({
textFill: '#000' textFill: '#000'
}); });
@ -106,21 +103,15 @@ class EMouse extends Group {
} }
} }
mouseEnter(e) { mouseEnter() {
this.switchBorder && this.switchBorder.show(); this.switchBorder && this.switchBorder.show();
// this.device.setLossAction(false); this.device.setTextStyle({ textFill: '#000' });
// this.device.setSwitchCoreColor(this.device.style.Switch.mouseOverStyle.borderBackgroundColor);
this.device.setTextStyle({
textFill: '#000'
});
this.textRect && this.textRect.show(); this.textRect && this.textRect.show();
} }
mouseLeave(e) { mouseLeave() {
this.switchBorder && this.switchBorder.hide(); this.switchBorder && this.switchBorder.hide();
this.device.setTextStyle({ this.device.setTextStyle({ textFill: this.device.style.backgroundColor });
textFill: this.device.style.backgroundColor
});
this.textRect && this.textRect.hide(); this.textRect && this.textRect.hide();
this.device.setState(this.device.model); this.device.setState(this.device.model);
} }

View File

@ -23,13 +23,13 @@ export default class EMouse {
} }
} }
mouseEnter(e) { mouseEnter() {
if (this.device.prdType) { if (this.device.prdType) {
this.device.setVisible(true); this.device.setVisible(true);
} }
} }
mouseLeave(e) { mouseLeave() {
if (this.device.prdType ) { if (this.device.prdType ) {
this.device.setVisible(false); this.device.setVisible(false);
} }

View File

@ -15,11 +15,11 @@ class TrainWindow extends Group {
this.z = 9; this.z = 9;
this.prdType = store.state.training.prdType; this.prdType = store.state.training.prdType;
this.isShowShape = true; this.isShowShape = true;
this.create(model); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
} }
create(model) { create() {
if (this.prdType !== '01') { if (this.prdType !== '01') {
this.createTrainWindow(); this.createTrainWindow();
} }

View File

@ -200,19 +200,17 @@ export default {
// if (elem.switchSection && elem.parentCode) { // if (elem.switchSection && elem.parentCode) {
// // // //
// nameShow = false; // nameShow = false;
if (elem.type != '03') { if (elem.type == '03') {
nameShow = false; nameShow = false;
} else { } else if (elem.type === '01') {
if (elem.type === '01') {
// //
nameShow = this.nameLevels.indexOf(11) !== -1; nameShow = this.nameLevels.indexOf(11) !== -1;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
nameShow = this.nameLevels.indexOf(5) !== -1; nameShow = this.nameLevels.indexOf(5) !== -1;
} else if (elem.type === '04') { } else if (elem.type === '04') {
// //
nameShow = this.nameLevels.indexOf(9) !== -1; nameShow = this.nameLevels.indexOf(9) !== -1;
}
} }
// //

View File

@ -218,7 +218,8 @@ export default {
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY, cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
param:{ param:{
standReentryStrategy: this.strategy standReentryStrategy: this.strategy
} },
val: this.strategy + ''
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {

View File

@ -200,19 +200,17 @@ export default {
// if (elem.switchSection && elem.parentCode) { // if (elem.switchSection && elem.parentCode) {
// // // //
// nameShow = false; // nameShow = false;
if (elem.type != '03') { if (elem.type == '03') {
nameShow = false; nameShow = false;
} else { } else if (elem.type === '01') {
if (elem.type === '01') {
// //
nameShow = this.nameLevels.indexOf(11) !== -1; nameShow = this.nameLevels.indexOf(11) !== -1;
} else if (elem.type === '02') { } else if (elem.type === '02') {
// //
nameShow = this.nameLevels.indexOf(5) !== -1; nameShow = this.nameLevels.indexOf(5) !== -1;
} else if (elem.type === '04') { } else if (elem.type === '04') {
// //
nameShow = this.nameLevels.indexOf(9) !== -1; nameShow = this.nameLevels.indexOf(9) !== -1;
}
} }
// //

View File

@ -50,37 +50,37 @@ export default {
menuNormal: { menuNormal: {
Local: [ Local: [
{ {
label: this.$t('menu.menuSwitch.switchLock'), label: '道岔单锁',
handler: this.lock, handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchUnlock'), label: '道岔单解',
handler: this.unlock, handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionBlockade'), label: '道岔封锁',
handler: this.block, handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK cmdType:CMD.Switch.CMD_SWITCH_BLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionUnblock'), label: '道岔解封',
handler: this.unblock, handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchTurnout'), label: '道岔转动',
handler: this.switchTurnout, handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), label: '道岔故障解锁',
handler: this.fault, handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'), label: '道岔计轴预复位',
handler: this.axlePreReset, handler: this.axlePreReset,
cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
}, },
@ -107,32 +107,32 @@ export default {
], ],
Center: [ Center: [
{ {
label: this.$t('menu.menuSwitch.switchLock'), label: '道岔单锁',
handler: this.lock, handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchUnlock'), label: '道岔单解',
handler: this.unlock, handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionBlockade'), label: '道岔封锁',
handler: this.block, handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK cmdType:CMD.Switch.CMD_SWITCH_BLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionUnblock'), label: '道岔解封',
handler: this.unblock, handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}, },
{ {
label: this.$t('menu.menuSwitch.switchTurnout'), label: '道岔转动',
handler: this.switchTurnout, handler: this.switchTurnout,
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
{ {
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), label: '道岔故障解锁',
handler: this.fault, handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },

View File

@ -481,31 +481,31 @@ export default {
{ deviceType: '02', orderNum: 5, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' } { deviceType: '02', orderNum: 5, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }
] ]
}, },
{ // 未生成实训 {
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: 'Switch_Section_Block', operateType: 'Switch_Block',
skinCode: '02', skinCode: '02',
trainingName: '道岔区段封闭({7})', trainingName: '道岔封闭({7})',
trainingRemark: '道岔区段封闭功能', trainingRemark: '道岔封闭功能',
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '105', tip: '鼠标右键菜单选择【道岔区段封闭】' }, { deviceType: '02', orderNum: 1, operateCode: '105', tip: '鼠标右键菜单选择【道岔封闭】' },
{ deviceType: '02', orderNum: 2, operateCode: '105', tip: '鼠标左键点击【确定】按钮' } { deviceType: '02', orderNum: 2, operateCode: '105', tip: '鼠标左键点击【确定】按钮' }
] ]
}, },
{ // 未生成实训 {
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: 'Switch_Section_Unblock', operateType: 'Switch_Unblock',
skinCode: '02', skinCode: '02',
trainingName: '道岔区段解封({7})', trainingName: '道岔解封({7})',
trainingRemark: '道岔区段解封功能', trainingRemark: '道岔解封功能',
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '106', tip: '鼠标右键菜单选择【道岔区段解封】' }, { deviceType: '02', orderNum: 1, operateCode: '106', tip: '鼠标右键菜单选择【道岔解封】' },
{ deviceType: '02', orderNum: 2, operateCode: '1061', tip: '鼠标左键点击【下达】按钮' }, { deviceType: '02', orderNum: 2, operateCode: '1061', tip: '鼠标左键点击【下达】按钮' },
{ deviceType: '02', orderNum: 3, operateCode: '1063', tip: '鼠标左键点击【确认1】按钮' }, { deviceType: '02', orderNum: 3, operateCode: '1063', tip: '鼠标左键点击【确认1】按钮' },
{ deviceType: '02', orderNum: 4, operateCode: '1064', tip: '鼠标左键点击【确认2】按钮' }, { deviceType: '02', orderNum: 4, operateCode: '1064', tip: '鼠标左键点击【确认2】按钮' },
@ -548,12 +548,12 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Switch_Axis_Pre_Reset', operateType: 'Switch_Axis_Pre_Reset',
skinCode: '02', skinCode: '02',
trainingName: '道岔区段计轴预复位({7})', trainingName: '道岔计轴预复位({7})',
trainingRemark: '道岔区段计轴预复位功能', trainingRemark: '道岔计轴预复位功能',
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '110', tip: '鼠标右键菜单选择【道岔区段计轴预复位】' }, { deviceType: '02', orderNum: 1, operateCode: '110', tip: '鼠标右键菜单选择【道岔计轴预复位】' },
{ deviceType: '02', orderNum: 2, operateCode: '1101', tip: '鼠标左键点击【下达】按钮' }, { deviceType: '02', orderNum: 2, operateCode: '1101', tip: '鼠标左键点击【下达】按钮' },
{ deviceType: '02', orderNum: 3, operateCode: '1103', tip: '鼠标左键点击【确认1】按钮' }, { deviceType: '02', orderNum: 3, operateCode: '1103', tip: '鼠标左键点击【确认1】按钮' },
{ deviceType: '02', orderNum: 4, operateCode: '1104', tip: '鼠标左键点击【确认2】按钮' }, { deviceType: '02', orderNum: 4, operateCode: '1104', tip: '鼠标左键点击【确认2】按钮' },
@ -593,8 +593,8 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Switch_Set_Limit_Speed', operateType: 'Switch_Set_Limit_Speed',
skinCode: '02', skinCode: '02',
trainingName: '道岔区段设置限速({7})', trainingName: '道岔设置限速({7})',
trainingRemark: '道岔区段设置限速功能限速值5', trainingRemark: '道岔设置限速功能限速值5',
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
@ -612,8 +612,8 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Switch_Cancel_Limit_Speed', operateType: 'Switch_Cancel_Limit_Speed',
skinCode: '02', skinCode: '02',
trainingName: '道岔区段取消限速({7})', trainingName: '道岔取消限速({7})',
trainingRemark: '道岔区段取消限速功能', trainingRemark: '道岔取消限速功能',
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [

View File

@ -249,6 +249,7 @@ export default {
}, },
handleSwicthMenu() { // handleSwicthMenu() { //
// //
this.clearAllMenuShow();
const section = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionParentCode); const section = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionParentCode);
const sectionA = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionACode); // const sectionA = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionACode); //
const sectionB = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionBCode); const sectionB = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionBCode);
@ -274,6 +275,7 @@ export default {
}; };
}, },
handleSingalMenu() { handleSingalMenu() {
this.clearAllMenuShow();
this.deviceHighLight(this.oldDevice, false); this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true); this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj; this.oldDevice = this.selectedObj;
@ -351,6 +353,7 @@ export default {
} }
}, },
handleSectionMenu() { handleSectionMenu() {
this.clearAllMenuShow();
this.deviceHighLight(this.oldDevice, false); this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true); this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj; this.oldDevice = this.selectedObj;
@ -386,6 +389,7 @@ export default {
}; };
}, },
handleStationMenu() { handleStationMenu() {
this.clearAllMenuShow();
this.centralizedStationList = new Array(15).fill({}); this.centralizedStationList = new Array(15).fill({});
this.stationParamList.forEach((station, index) => { this.stationParamList.forEach((station, index) => {
this.centralizedStationList[index] = station; this.centralizedStationList[index] = station;
@ -398,6 +402,7 @@ export default {
this.param = { stationCode: this.selectedObj.code }; this.param = { stationCode: this.selectedObj.code };
}, },
handleStandMenu() { handleStandMenu() {
this.clearAllMenuShow();
this.centralizedStationList = new Array(15).fill({}); this.centralizedStationList = new Array(15).fill({});
this.standParamList.forEach((stand, index) => { this.standParamList.forEach((stand, index) => {
this.centralizedStationList[index] = stand; this.centralizedStationList[index] = stand;

View File

@ -931,7 +931,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_Close_AllSignal', operateType: 'Station_Close_AllSignal',
skinCode: '07', skinCode: '07',
trainingName: '关站信号({10})', trainingName: '关站信号({26})',
trainingRemark: '关站信号', trainingRemark: '关站信号',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['01'], productTypes: ['01'],
@ -946,7 +946,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_Set_CI_Auto_Trigger', operateType: 'Station_Set_CI_Auto_Trigger',
skinCode: '07', skinCode: '07',
trainingName: '追踪全开({10})', trainingName: '追踪全开({26})',
trainingRemark: '追踪全开', trainingRemark: '追踪全开',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['02'], productTypes: ['02'],
@ -961,7 +961,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_Cancel_CI_Auto_Trigger', operateType: 'Station_Cancel_CI_Auto_Trigger',
skinCode: '07', skinCode: '07',
trainingName: '追踪全关({10})', trainingName: '追踪全关({26})',
trainingRemark: '追踪全关', trainingRemark: '追踪全关',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['02'], productTypes: ['02'],
@ -976,7 +976,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_Open_Auto_Setting', operateType: 'Station_Open_Auto_Setting',
skinCode: '07', skinCode: '07',
trainingName: '自排全开({10})', trainingName: '自排全开({26})',
trainingRemark: '自排全开', trainingRemark: '自排全开',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['02'], productTypes: ['02'],
@ -991,7 +991,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_Close_Auto_Setting', operateType: 'Station_Close_Auto_Setting',
skinCode: '07', skinCode: '07',
trainingName: '自排全关({10})', trainingName: '自排全关({26})',
trainingRemark: '自排全关', trainingRemark: '自排全关',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['02'], productTypes: ['02'],
@ -1006,7 +1006,7 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Station_CIArea_Close_AllSignal', operateType: 'Station_CIArea_Close_AllSignal',
skinCode: '07', skinCode: '07',
trainingName: '关区信号({10})', trainingName: '关区信号({26})',
trainingRemark: '关区信号', trainingRemark: '关区信号',
trainingType: 'Station', trainingType: 'Station',
productTypes: ['02'], productTypes: ['02'],

View File

@ -23,22 +23,25 @@
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="设置进路" name="first">用户管理</el-tab-pane> <el-tab-pane label="设置进路" name="first">设置进路</el-tab-pane>
<el-tab-pane label="取消进路" name="second">配置管理</el-tab-pane> <el-tab-pane label="取消进路" name="second">取消进路</el-tab-pane>
<el-tab-pane label="禁止进路" name="third">角色管理</el-tab-pane> <el-tab-pane label="禁止进路" name="third">禁止进路</el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="6" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button> <el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog> </el-dialog>

View File

@ -204,17 +204,15 @@ export default {
// nameShow = false; // nameShow = false;
if (elem.type == '03') { if (elem.type == '03') {
nameShow = false; nameShow = false;
} else { } else if (elem.type == '01') {
if (elem.type === '01') {
// //
nameShow = this.nameLevels.indexOf(11) !== -1; nameShow = this.nameLevels.indexOf(11) !== -1;
} else if (elem.type === '02') { } else if (elem.type == '02') {
// //
nameShow = this.nameLevels.indexOf(5) !== -1; nameShow = this.nameLevels.indexOf(5) !== -1;
} else if (elem.type === '04') { } else if (elem.type == '04') {
// //
nameShow = this.nameLevels.indexOf(9) !== -1; nameShow = this.nameLevels.indexOf(9) !== -1;
}
} }
// //

View File

@ -40,7 +40,6 @@ const training = {
memberList: [], // 综合仿真成员列表 memberList: [], // 综合仿真成员列表
memberData: {}, // 综合仿真成员列表 memberData: {}, // 综合仿真成员列表
simulationUserList: [], // 综合仿真用户列表 simulationUserList: [], // 综合仿真用户列表
addMemberInScript:{}, // 剧本录制新增角色
orignalUserRoleId:'' // 设置旧的角色的id orignalUserRoleId:'' // 设置旧的角色的id
}, },
@ -253,13 +252,6 @@ const training = {
state.memberData[newMemberId].disabled = true; state.memberData[newMemberId].disabled = true;
}, },
addMemberListInScript:(state, newMember) => {
if (!state.memberData[newMember.id]) {
// state.memberData[newMember.id] = newMember;
state.addMemberInScript = newMember;
}
},
updateMemberAndUser: (state, {simulationUserList, userId}) => { updateMemberAndUser: (state, {simulationUserList, userId}) => {
simulationUserList.forEach(item => { simulationUserList.forEach(item => {
let memberIndex = -1; let memberIndex = -1;
@ -720,10 +712,6 @@ const training = {
setRoleDeviceCode:({ commit }, roleDeviceCode) => { setRoleDeviceCode:({ commit }, roleDeviceCode) => {
commit('setRoleDeviceCode', roleDeviceCode); commit('setRoleDeviceCode', roleDeviceCode);
}, },
/** 添加新成员(剧本录制)*/
addMemberListInScript:({ commit }, data) => {
commit('addMemberListInScript', data);
},
/** 剧本仿真 设置旧的角色的id */ /** 剧本仿真 设置旧的角色的id */
setOrignalUserRoleId:({ commit }, data) => { setOrignalUserRoleId:({ commit }, data) => {
commit('setOrignalUserRoleId', data); commit('setOrignalUserRoleId', data);

View File

@ -128,6 +128,7 @@ export default {
'$store.state.runPlan.planLoadedCount': async function () { '$store.state.runPlan.planLoadedCount': async function () {
try { try {
await this.loadChartPage(); await this.loadChartPage();
this.selectSeries = []; this.runSeries = [];
if (this.dialogShow) { if (this.dialogShow) {
await this.loadInitData(); await this.loadInitData();
} }

View File

@ -72,7 +72,7 @@ export default {
getSimulationMemberList(this.group).then(resp => { getSimulationMemberList(this.group).then(resp => {
this.driverList = []; this.driverList = [];
this.treeData = []; this.treeData = [];
const result = covertMemberData(this.activeTrainList, resp); const result = covertMemberData(this.activeTrainList, resp.data);
this.driverList = result.driverList; this.driverList = result.driverList;
this.treeData = [{ this.treeData = [{
label: '行调', label: '行调',
@ -191,6 +191,9 @@ export default {
// () // ()
'$store.state.map.activeTrainListChange': function (val) { '$store.state.map.activeTrainListChange': function (val) {
const activeTrainList = this.$store.state.map.activeTrainList; const activeTrainList = this.$store.state.map.activeTrainList;
activeTrainList.sort((a, b) => {
return parseInt(a) - parseInt(b);
});
if (this.driverList.length > 0) { if (this.driverList.length > 0) {
const driverList = []; const driverList = [];
if (activeTrainList && activeTrainList.length) { if (activeTrainList && activeTrainList.length) {

View File

@ -117,8 +117,29 @@ export const operateEnum = {
type:'车站' type:'车站'
}, },
Driver:{ Driver:{
// code:'stationCode', code:'groupNumber',
type:'司机' type:'司机',
Driver_Door_On_Off:{
isList:true,
params:[
{
code:'open',
name:'',
result:[
{data:true, name:'开', judge:'='},
{data:false, name:'关', judge:'='}
]
},
{
code:'right',
name:'',
result:[
{data:true, name:'左门', judge:'='},
{data:false, name:'右门', judge:'='}
]
}
]
}
} }
}; };

View File

@ -36,6 +36,7 @@
<script> <script>
import DemonMenu from '@/views/newMap/displayNew/demonMenu'; import DemonMenu from '@/views/newMap/displayNew/demonMenu';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import {covertMemberData} from '@/views/newMap/displayNew/utils';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
@ -74,6 +75,7 @@ export default {
faultMode: false, faultMode: false,
viewDisabled: true, viewDisabled: true,
firstLoad:true, firstLoad:true,
activeTrainList:[],
isscriptRun:false // isscriptRun:false //
}; };
}, },
@ -191,98 +193,40 @@ export default {
if (resp.code == 200) { if (resp.code == 200) {
if (resp.data.memberList && resp.data.memberList.length > 0) { if (resp.data.memberList && resp.data.memberList.length > 0) {
this.$store.dispatch('training/setMemberList', {memberList:resp.data.memberList, userId:this.$store.state.user.id}); this.$store.dispatch('training/setMemberList', {memberList:resp.data.memberList, userId:this.$store.state.user.id});
// if (this.$store.state.training.started) {
const memberList = this.$store.state.training.memberData; this.activeTrainList = this.$store.state.map.activeTrainList;
// if (data.id) { }
// memberList[data.id].userId = this.$store.state.user.id; const memberList = resp.data.memberList;
// memberList[data.id].name = this.$store.state.user.nickname; // 仿
// memberList[data.id].disabled = true; const result = covertMemberData(this.activeTrainList, memberList);
// } this.driverList = result.driverList;
let lastData = JSON.stringify(memberList);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData = Object.values(lastData);
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (!member.userId) {
member.userId = '';
member.disabled = false;
} else {
member.disabled = true;
member.userName = this.$store.state.user.nickname;
}
if (member.type != '观众') {
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.deviceName = device.groupNumber;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member);
driverList.push(member);
} else {
member.deviceName = device.name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member);
}
} else {
member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
lastMemberList.push(member);
}
}
});
const treeData = [{ const treeData = [{
label: '行调', label: '行调',
id: 'dispatcher', id: 'dispatcher',
type: 'role', type: 'role',
children: dispatcherList children: result.deviceListData[0]
}, { }, {
label: '车站值班员', label: '车站值班员',
id: 'stationSupervisor', id: 'stationSupervisor',
type: 'role', type: 'role',
children: stationSupervisorList children: result.deviceListData[2]
}, { }, {
label: '司机', label: '司机',
id: 'driver', id: 'driver',
type: 'role', type: 'role',
children: driverList children: result.deviceListData[3]
}, { }, {
label: '通号', label: '通号',
id: 'maintainer', id: 'maintainer',
type: 'role', type: 'role',
children: maintainerList children: result.deviceListData[1]
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: result.deviceListData[4]
}]; }];
const lastMemberList = result.lastMemberList;
this.$emit('setTreeData', treeData); this.$emit('setTreeData', treeData);
this.$emit('setMemberData', lastMemberList); this.$emit('setMemberData', lastMemberList);
} }

View File

@ -27,9 +27,25 @@
:offset-bottom="offsetBottom" :offset-bottom="offsetBottom"
/> />
<script-chat ref="chatbox" :group="group" :user-role="userRole" /> <script-chat
ref="chatbox"
:group="group"
:user-role="userRole"
:tree-data="treeData"
:member-data="memberData"
/>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" :offset="offset" /> <tip-script-record-new
ref="tipTaskRecordNew"
:group="group"
:offset-bottom="offsetBottom"
:offset="offset"
:tree-data="treeData"
:member-list="memberData"
@changeTreeData="changeTreeData"
@addScriptMember="addScriptMember"
@resetChat="resetChat"
/>
</div> </div>
</template> </template>
@ -43,7 +59,8 @@ import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
import SetTime from '@/views/newMap/displayNew/demon/setTime'; import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import { ranAsPlan, exitRunPlan } from '@/api/simulation'; import { ranAsPlan, exitRunPlan } from '@/api/simulation';
import { mapGetters } from 'vuex'; import {covertMemberData} from '@/views/newMap/displayNew/utils';
import { getSimulationMemberList} from '@/api/simulation';
export default { export default {
name: 'MenuScript', name: 'MenuScript',
@ -85,7 +102,12 @@ export default {
data() { data() {
return { return {
isDisable: false, isDisable: false,
isScriptCommand:false isScriptCommand:false,
driverList:[],
treeData:[],
memberData:[],
activeTrainList:[],
userRole:''
}; };
}, },
@ -93,17 +115,14 @@ export default {
scriptId() { scriptId() {
return this.$route.query.scriptId; return this.$route.query.scriptId;
}, },
...mapGetters('map', [
'trainList'
]),
group() { group() {
return this.$route.query.group; return this.$route.query.group;
}, },
userRole() { // userRole() {
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER'; // return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
}, // },
isDriver() { isDriver() {
return this.$store.state.scriptRecord.userRole == 'DRIVER'; return this.userRole == 'DRIVER';
}, },
isShowScheduling() { isShowScheduling() {
return this.$store.state.training.prdType == '05'; return this.$store.state.training.prdType == '05';
@ -115,26 +134,108 @@ export default {
watch: { watch: {
'$store.state.scriptRecord.bgSet':function (val) { '$store.state.scriptRecord.bgSet':function (val) {
this.isScriptCommand = val; this.isScriptCommand = val;
},
// ()
'$store.state.map.activeTrainListChange': function (val) {
// driverList
const activeTrainList = this.$store.state.map.activeTrainList;
if (this.driverList.length > 0) {
const driverList = [];
if (activeTrainList && activeTrainList.length) {
activeTrainList.sort();
activeTrainList.forEach(groupNumber => {
const drivers = this.driverList.find(driver=>{
return driver.deviceCode == groupNumber;
});
if (drivers) {
driverList.push(drivers);
this.memberData.push(drivers);
}
});
}
this.treeData[2].children = driverList;
} else {
this.activeTrainList = activeTrainList;
}
},
'$store.state.map.mapViewLoadedCount': function (val) { //
getSimulationMemberList(this.group).then(resp => {
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
this.driverList = [];
this.treeData = [];
if (this.$store.state.training.started) {
this.activeTrainList = this.$store.state.map.activeTrainList;
}
// 仿
const result = covertMemberData(this.activeTrainList, resp.data);
this.driverList = result.driverList;
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: result.deviceListData[0]
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: result.deviceListData[2]
}, {
label: '司机',
id: 'driver',
type: 'role',
children: result.deviceListData[3]
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: result.deviceListData[1]
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: result.deviceListData[4]
}];
this.memberData = result.lastMemberList;
//
const member = resp.data.find(mem=>{
return mem.userId != '' && mem.userId != undefined;
});
if (member) {
const memberType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
const prdTypeList = ['01', '02', '04', '', ''];
const index = memberType.indexOf(member.type);
let prdType;
if (index >= 0) {
prdType = prdTypeList[index];
}
this.userRole = member.type;
this.$store.dispatch('training/setRoles', member.type);
this.$store.dispatch('scriptRecord/updateRole', member.type + ':' + member.id);
this.$store.dispatch('training/setPrdType', prdType);
}
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
} }
}, },
beforeDestroy() { beforeDestroy() {
// this.clearAutoSave();
this.$store.dispatch('training/setMemberList', {memberList:[], userId:this.$store.state.user.id});
this.$store.dispatch('map/resetActiveTrainList', true);
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$store.dispatch('scriptRecord/updateRole', null);
this.$store.dispatch('training/setRoles', null);
}, },
mounted() { mounted() {
// this.$store.state.training.prdType
this.isScriptCommand = this.$store.state.scriptRecord.bgSet; this.isScriptCommand = this.$store.state.scriptRecord.bgSet;
// if (!this.isScriptCommand) {
// this.$store.dispatch('training/setPrdType', '02');
// }
this.$store.dispatch('training/end', TrainingMode.NORMAL); this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/setPrdType', '01');
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.demonMenu.menuClick(); this.$refs.demonMenu.menuClick();
}); });
}, },
methods: { methods: {
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
selectBeginTime() { selectBeginTime() {
this.$refs.setTime.doShow(); this.$refs.setTime.doShow();
}, },
@ -196,6 +297,51 @@ export default {
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
}); });
},
resetChat() {
this.$refs.chatbox.resetCoversition();
},
changeTreeData({newRole, oldRole}) {
const deviceTypeList = ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
if (oldRole.id) {
const oldIndex = deviceTypeList.indexOf(oldRole.type);
if (oldIndex >= 0) {
const oldTreeDataIn = this.treeData[oldIndex];
oldTreeDataIn.children.map(device=>{
if (device.id == oldRole.id) {
device.userName = '';
delete device.userId;
device.disabled = false;
device.label = device.type + (device.deviceName ? '- ' + device.deviceName : '') + (device.name ? device.name : '');
}
});
this.treeData[oldIndex] = oldTreeDataIn;
}
}
const newIndex = deviceTypeList.indexOf(newRole.type);
if (newIndex >= 0) {
const newTreeDataIn = this.treeData[newIndex];
newTreeDataIn.children.map(device=>{
if (device.id == newRole.id) {
device.userName = this.$store.state.user.nickname;
device.userId = this.$store.state.user.id;
device.disabled = true;
device.label = device.type + (device.deviceName ? '- ' + device.deviceName : '') + (device.name ? device.name : '') + '-' + device.userName;
}
});
this.treeData[newIndex] = newTreeDataIn;
}
this.userRole = newRole.type;
},
addScriptMember(member) {
this.memberData.push(member);
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段调度'];
const index = deviceTypeList.indexOf(member.type);
if (index >= 0) {
const treeDataIn = this.treeData[index];
treeDataIn.children.push(member);
this.treeData[index] = treeDataIn;
}
} }
} }
}; };

View File

@ -15,9 +15,7 @@
</template> </template>
<script> <script>
import ChatBox from '@/views/newMap/chatView/chatBox.vue'; import ChatBox from '@/views/newMap/chatView/chatBox.vue';
import {covertMemberData} from '@/views/newMap/displayNew/utils';
import {getAllConversition} from '@/api/chat'; import {getAllConversition} from '@/api/chat';
import { getSimulationMemberList} from '@/api/simulation';
export default { export default {
name:'ScriptChat', name:'ScriptChat',
components:{ components:{
@ -31,6 +29,14 @@ export default {
userRole: { userRole: {
type: String, type: String,
required: true required: true
},
treeData:{
type:Array,
required:true
},
memberData:{
type:Array,
required:true
} }
}, },
data() { data() {
@ -38,15 +44,15 @@ export default {
isHasCoversition:false, isHasCoversition:false,
conversitionId:'', conversitionId:'',
currentMemberList:[], currentMemberList:[],
memberData:{}, // memberData:{},
chatContentList:[], chatContentList:[],
activeTrainList:[], activeTrainList:[],
isStartRecord:false, isStartRecord:false,
inviteUserName:'', inviteUserName:'',
inviteUser:{}, inviteUser:{},
isQuitShow:false, isQuitShow:false
treeData:[], // treeData:[],
driverList:[] // driverList:[]
}; };
}, },
computed:{ computed:{
@ -57,80 +63,6 @@ export default {
} }
}, },
watch:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { // 仿
getSimulationMemberList(this.group).then(resp => {
this.driverList = [];
this.treeData = [];
const result = covertMemberData(this.activeTrainList, resp);
this.driverList = result.driverList;
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: result.deviceListData[0]
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: result.deviceListData[2]
}, {
label: '司机',
id: 'driver',
type: 'role',
children: result.deviceListData[3]
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: result.deviceListData[1]
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: result.deviceListData[4]
}];
this.memberData = result.lastMemberList;
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
},
'$store.state.training.addMemberInScript':function(val, oldval) {
this.memberData.push(val);
const roleList = ['行调', '车站值班员', '司机', '通号', '车辆段'];
const roleIndex = roleList.indexOf(val.type);
if (roleIndex >= 0) {
this.treeData[roleIndex].children.push(val);
}
},
'userRole':function(val, oldval) {
//
this.changeRole(oldval, val);
},
'$store.state.scriptRecord.updateRoleStatus':function(val) {
//
this.changeRole(this.$store.state.scriptRecord.userRole, this.$store.state.scriptRecord.userRole);
},
// ()
'$store.state.map.activeTrainListChange': function (val) {
const activeTrainList = this.$store.state.map.activeTrainList;
if (this.driverList.length > 0) {
const driverList = [];
if (activeTrainList && activeTrainList.length) {
activeTrainList.sort();
activeTrainList.forEach(groupNumber => {
const drivers = this.driverList.find(driver=>{
return driver.deviceCode == groupNumber;
});
if (drivers) {
driverList.push(drivers);
}
});
}
this.treeData[2].children = driverList;
} else {
this.activeTrainList = activeTrainList;
}
},
// //
'$store.state.socket.createConversition':function(val) { '$store.state.socket.createConversition':function(val) {
if (this.memberData.length > 0) { if (this.memberData.length > 0) {
@ -214,31 +146,6 @@ export default {
this.inviteUser = {}; this.inviteUser = {};
this.isQuitShow = false; this.isQuitShow = false;
}, },
changeRole(oldval, val) {
const userList = ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
//
this.getAllConversition();
const oldIndex = userList.indexOf(oldval);
if (oldIndex >= 0) {
this.treeData[oldIndex].children.forEach(child=>{
if (child.userId) {
child.userId = '';
child.disabled = false;
child.label = child.type + (child.deviceName ? child.deviceName : '');
}
});
}
const index = userList.indexOf(val);
if (index >= 0) {
this.treeData[index].children.forEach(child=>{
if (child.id == this.$store.state.scriptRecord.updateRoleId) {
child.userId = this.$store.state.user.id;
child.disabled = true;
child.label = child.label + '-' + this.$store.state.user.nickname;
}
});
}
},
getAllConversition() { getAllConversition() {
// //
getAllConversition(this.$route.query.group).then(resp=>{ getAllConversition(this.$route.query.group).then(resp=>{

View File

@ -2,7 +2,7 @@ import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
export function covertMemberData (activeTrainList, resp) { export function covertMemberData (activeTrainList, resp) {
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(resp);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) { roleTypeList.forEach(function(element) {
const rolename = element.value; const rolename = element.value;
@ -18,25 +18,26 @@ export function covertMemberData (activeTrainList, resp) {
const deviceListData = [[], [], [], [], []]; const deviceListData = [[], [], [], [], []];
const driverList = []; const driverList = [];
lastData.forEach((member, index)=>{ lastData.forEach((member, index)=>{
if (!member.userId) { if (member.userId && member.userId == store.state.user.id) {
member.disabled = false;
} else {
member.disabled = true; member.disabled = true;
member.userName = store.state.user.nickname; member.userName = store.state.user.nickname;
store.dispatch('training/setOrignalUserRoleId', member.id); store.dispatch('training/setOrignalUserRoleId', member.id);
} else {
member.disabled = false;
} }
const userName = member.userName ? '-' + member.userName : ''; const userName = member.userName ? '-' + member.userName : '';
const name = member.name ? '-' + member.name : ''; const name = member.name ? '-' + member.name : '';
if (member.deviceCode) { if (member.deviceCode) {
const device = store.getters['map/getDeviceByCode'](member.deviceCode); const device = store.getters['map/getDeviceByCode'](member.deviceCode);
const deviceName = device.name || device.groupNumber; member.deviceName = device.name || device.groupNumber;
member.deviceName = deviceName; member.label = member.type + member.deviceName + name + userName;
member.label = member.type + deviceName + name + userName; member.normalName = member.type + member.deviceName + name;
} else { } else {
member.deviceName = ''; member.deviceName = '';
member.label = member.type + name + userName; member.label = member.type + name + userName;
member.normalName = member.type + name;
} }
lastMemberList.push(member);
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度']; const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度'];
const deviceTypeIndex = deviceType.indexOf(member.type); const deviceTypeIndex = deviceType.indexOf(member.type);
if (deviceTypeIndex >= 0) { if (deviceTypeIndex >= 0) {
@ -44,12 +45,13 @@ export function covertMemberData (activeTrainList, resp) {
if (activeTrainList.length > 0) { if (activeTrainList.length > 0) {
if (activeTrainList.includes(member.deviceCode)) { if (activeTrainList.includes(member.deviceCode)) {
deviceListData[deviceTypeIndex].push(member); deviceListData[deviceTypeIndex].push(member);
lastMemberList.push(member);
} }
} else {
driverList.push(member);
} }
driverList.push(member);
} else { } else {
deviceListData[deviceTypeIndex].push(member); deviceListData[deviceTypeIndex].push(member);
lastMemberList.push(member);
} }
} }
}); });

View File

@ -355,7 +355,7 @@ export default {
async simulationReset() { async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView'); await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false); await this.$store.dispatch('map/setTrainWindowShow', false);
// await this.$store.dispatch('training/over'); await this.$store.dispatch('map/resetActiveTrainList');
await this.$store.dispatch('socket/setSimulationReset'); // await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart'); await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState'); await this.$store.dispatch('training/setMapDefaultState');
@ -392,7 +392,6 @@ export default {
}, },
// //
mapViewLoaded(loading) { mapViewLoaded(loading) {
// console.log(loading, '**************');
this.loading = loading; this.loading = loading;
if (loading) { if (loading) {
this.$refs.progressBar && this.$refs.progressBar.start(); this.$refs.progressBar && this.$refs.progressBar.start();

View File

@ -9,7 +9,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType'; import deviceType from '@/jmapNew/constant/deviceType.js';
import JlmapVisual from '@/views/newMap/jlmapNew/index'; import JlmapVisual from '@/views/newMap/jlmapNew/index';
import TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip'; import TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
@ -120,7 +120,7 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
if (this.$store.state.map.selectDevice && this.$store.state.map.selectDevice.flag && device._type) { if (this.$store.state.map.selectDevice && this.$store.state.map.selectDevice.flag && device._type) {
if (device._type.toUpperCase() == this.$store.state.map.selectDevice.type.toUpperCase()) { if (device._type.toUpperCase() == this.$store.state.map.selectDevice.type.toUpperCase()) {
EventBus.$emit('selectDevice', this.selected); EventBus.$emit('selectDevice', device);
} else { } else {
const name = this.typeObj[this.$store.state.map.selectDevice.type]; const name = this.typeObj[this.$store.state.map.selectDevice.type];
const info = '选择的设备类型不正确' + (name ? `,请选择${name}类型` : ''); const info = '选择的设备类型不正确' + (name ? `,请选择${name}类型` : '');
@ -159,21 +159,17 @@ export default {
} }
if (device) { if (device) {
device = this.getSelectedByLineCode(device); device = this.getSelectedByLineCode(device);
// console.log((new Date()).valueOf(), '4', device);
this.selected = device; this.selected = device;
// console.log((new Date()).valueOf(), '5'); if (!this.buttonOperation) {
if (device) { this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
if (!this.buttonOperation) { if (!this.checkShouldPop(device)) {
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType}); this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: null });
if (!this.checkShouldPop(device)) { } else {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: null }); if (em.deviceType === 'StationStand' && lineCode === '01') {
} else { return;
if (em.deviceType === 'StationStand' && lineCode === '01') {
return;
}
menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
} }
menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
} }
} }
} else { } else {

View File

@ -59,11 +59,7 @@ export default {
} }
}, },
methods: { methods: {
initData(row) {
},
doShow(row) { doShow(row) {
this.initData(row);
this.dialogVisible = true; this.dialogVisible = true;
}, },
doSave() { doSave() {
@ -71,9 +67,9 @@ export default {
if (valid) { if (valid) {
this.lodaing = true; this.lodaing = true;
addSimulationMember(this.formModel, this.$route.query.group).then((res) => { addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
this.lodaing = false;
this.$message.success('添加仿真角色成员成功!'); this.$message.success('添加仿真角色成员成功!');
this.$emit('addScriptMember', res.data); this.$emit('addScriptMember', res.data);
this.lodaing = false;
this.handleClose(); this.handleClose();
}).catch(() => { }).catch(() => {
this.lodaing = false; this.lodaing = false;

View File

@ -8,7 +8,7 @@
</div> </div>
<el-tree <el-tree
ref="tree" ref="tree"
:data="covertMemberList" :data="treeData"
:props="defaultProps" :props="defaultProps"
node-key="id" node-key="id"
default-expand-all default-expand-all
@ -16,24 +16,28 @@
style="margin: 10px;overflow-y:auto;height:255px;margin-right: 0;" style="margin: 10px;overflow-y:auto;height:255px;margin-right: 0;"
> >
<span :id="data.id" slot-scope="{ node, data }" style="width:100%"> <span :id="data.id" slot-scope="{ node, data }" style="width:100%">
<span style="font-size: 14px">{{ data.label }}</span> <span v-if="data.children">
<span v-if="data.type!='role'" class="setGroup"> <span style="font-size: 14px">{{ data.label }}</span>
<span v-if="data.id!=memberId" class="settingBtn" @click="changeRole(data)">设置</span>
<span v-else class="hasSetted">已设置</span>
</span> </span>
<span v-else>
<span style="font-size: 14px">{{ data.normalName }}</span>
<span v-if="data.type!='role'" class="setGroup">
<span v-if="!data.disabled" class="settingBtn" @click="changeRole(data)">设置</span>
<span v-else class="hasSetted">已设置</span>
</span>
</span>
</span> </span>
</el-tree> </el-tree>
</div> </div>
</template> </template>
<script> <script>
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import ConstConfig from '@/scripts/ConstConfig';
import {changeScriptRole} from '@/api/script'; import {changeScriptRole} from '@/api/script';
export default { export default {
name:'AllScriptRole', name:'AllScriptRole',
props:{ props:{
memberList:{ treeData:{
type: Array, type: Array,
default() { default() {
return []; return [];
@ -54,8 +58,8 @@ export default {
return { return {
covertMemberList:[], covertMemberList:[],
driverList:[], driverList:[],
oldMember:{id:null, type:''},
queryMember:'', queryMember:'',
oldMemberId:'',
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
@ -63,117 +67,51 @@ export default {
}; };
}, },
watch:{ watch:{
'memberList':function(val) {
if (val && val.length > 0) {
this.covertMember();
}
},
queryMember(val) { queryMember(val) {
if (this.$refs.tree) { if (this.$refs.tree) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
},
'treeData':function(val) {
const roleName = this.$store.state.scriptRecord.userRole;
this.oldMember = {id:this.memberId, type:roleName};
} }
}, },
methods:{ methods:{
filterNode(value, data) { filterNode(value, data) {
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
covertMember() {
// if (this.covertMemberList.length > 0) {
// this.setMemmberList(this.driverList, this.memberList[0].children, this.memberList[1].children, this.memberList[3].children);
// } else {
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
this.memberList.forEach((member, index)=>{
if (member.type != '观众') {
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
driverList.push(member);
} else {
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
}
} else {
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
}
}
});
this.driverList = driverList;
this.setMemmberList(driverList, dispatcherList, stationSupervisorList, maintainerList);
// }
},
setMemmberList(driverList, dispatcherList, stationSupervisorList, maintainerList) {
this.oldMemberId = this.memberId;
// if (this.$store.state.training.started) {
// const activeList = this.$store.state.map.activeTrainList;
// driverList = driverList.filter(driver=>{
// return activeList.length > 0 && activeList.includes(driver.deviceCode);
// });
// } else {
// driverList = [];
// }
this.covertMemberList = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}];
},
changeRole(member) { changeRole(member) {
if (member) { if (member) {
// this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
this.switchMode(member); this.switchMode(member);
} }
}, },
addMember() { addMember() {
this.$emit('addMember'); this.$emit('addMember');
}, },
switchMode(role) { switchMode(member) {
changeScriptRole(this.group, role.id).then(res=>{ changeScriptRole(this.group, member.id).then(res=>{
let prdType = ''; let prdType = '';
if (this.openWindow) { if (this.openWindow) {
this.openWindow.close(); this.openWindow.close();
} }
const role = Object.assign({}, member);
if (role.type == '行值') { if (role.type == '行值') {
prdType = '01'; prdType = '01';
role.type = 'STATION_SUPERVISOR';
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode); this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
} else if (role.type == '行调') { } else if (role.type == '行调') {
prdType = '02'; prdType = '02';
role.type = 'DISPATCHER';
this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.$store.dispatch('training/setRoles', 'DISPATCHER');
} else if (role.type == '司机') { } else if (role.type == '司机') {
prdType = '04'; prdType = '04';
role.type = 'DRIVER';
this.$store.dispatch('training/setRoles', 'DRIVER'); this.$store.dispatch('training/setRoles', 'DRIVER');
} else if (role.type == '通号') { } else if (role.type == '通号') {
prdType = ''; prdType = '';
role.type = 'MAINTAINER';
this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.$store.dispatch('training/setRoles', 'MAINTAINER');
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer', path:'/jlmap3d/maintainer',
@ -186,25 +124,25 @@ export default {
} }
}); });
this.openWindow = window.open(routeData.href); this.openWindow = window.open(routeData.href);
} else if (role.type == '车辆段') {
prdType = '05';
role.type = 'DEPOT_DISPATCHER';
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
} else { } else {
prdType = ''; prdType = '';
} }
this.$store.dispatch('training/updateMemberListInScript', this.$store.dispatch('training/updateMemberListInScript',
{ {
oldMemberId:this.oldMemberId, oldMemberId:this.oldMember.id,
newMemberId:role.id, newMemberId:role.id,
userId:this.$store.state.user.id, userId:this.$store.state.user.id,
name:this.$store.state.user.nickname name:this.$store.state.user.nickname
} }
); );
this.oldMemberId = role.id;
this.$store.dispatch('training/setPrdType', prdType); this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{ this.$store.dispatch('scriptRecord/updateRole', role.type + ':' + role.id);
if (each.label == role.type) { this.$emit('setMemberId', {newRole:role, oldRole:this.oldMember});
this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role.id); this.oldMember = {id:role.id, type:role.type};
}
});
this.$emit('setMemberId', role);
this.$message('切换角色成功'); this.$message('切换角色成功');
// this.$refs.changeScriptRole.blur(); // this.$refs.changeScriptRole.blur();
}).catch(()=>{ }).catch(()=>{

View File

@ -86,12 +86,6 @@ export default {
memberName: '' memberName: ''
}; };
}, },
computed:{
// drawWay() {
// const drawWay = this.$route.query.drawWay;
// return drawWay && JSON.parse(drawWay);
// }
},
watch: { watch: {
actionInfoList: function(val) { actionInfoList: function(val) {
this.$nextTick(function() { this.$nextTick(function() {
@ -114,7 +108,7 @@ export default {
}, },
covertData(memberList, element) { covertData(memberList, element) {
const member = memberList.find(elem=>{ return elem.id == element.memberId; }); const member = memberList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name; const memberName = member.type + member.deviceName + (member.name ? member.name : '');
switch (element.type) { switch (element.type) {
case 'Start_Conversation': { case 'Start_Conversation': {
// isStartCoversition // isStartCoversition
@ -122,7 +116,7 @@ export default {
element.conversationMemberIds.forEach(id=>{ element.conversationMemberIds.forEach(id=>{
if (member.id != id) { if (member.id != id) {
const userName = memberList.find(elem=>{ return elem.id == id; }); const userName = memberList.find(elem=>{ return elem.id == id; });
targetNameList.push(userName.name); targetNameList.push(userName.type + userName.deviceName + (userName.name ? userName.name : ''));
} }
}); });
this.actionInfoList.push({id: element.id, isStartCoversition: true, memberName: memberName, targetName:targetNameList.toString() }); this.actionInfoList.push({id: element.id, isStartCoversition: true, memberName: memberName, targetName:targetNameList.toString() });

View File

@ -14,11 +14,11 @@
<div class="quickChange"> <div class="quickChange">
<!-- <div class="quickChange_head">快捷切换</div> --> <!-- <div class="quickChange_head">快捷切换</div> -->
<div class="quickChangeList" style="margin:10px 0px 10px 0px;overflow-y:auto;height:200px;"> <div class="quickChangeList" style="margin:10px 0px 10px 0px;overflow-y:auto;height:200px;">
<div v-for="member in quickChangeMember" :key="member.id" class="setGroupOut"> <div v-for="member in quickChangeMember.list" :key="member.id" class="setGroupOut">
<span style="font-size: 14px">{{ member.label }}</span> <span style="font-size: 14px">{{ member.normalName }}</span>
<span class="setGroup"> <span class="setGroup">
<span v-if="member.id!=memberId" class="settingBtn" @click="changeRole(member)">设置</span> <span v-if="member.userId" class="hasSetted">设置</span>
<span v-else class="hasSetted">设置</span> <span v-else class="settingBtn" @click="changeRole(member)">设置</span>
</span> </span>
</div> </div>
</div> </div>
@ -39,7 +39,14 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="所有成员"> <el-tab-pane label="所有成员">
<div class="eachScriptPanel"> <div class="eachScriptPanel">
<all-script-role ref="allScriptRole" :member-list="memberList" :member-id="memberId" :group="group" @setMemberId="setMemberId" @addMember="addMember" /> <all-script-role
ref="allScriptRole"
:member-id="memberId"
:tree-data="treeData"
:group="group"
@setMemberId="setMemberId"
@addMember="addMember"
/>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -54,7 +61,8 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import GetActionNew from './getAction'; import GetActionNew from './getAction';
import {getSimulationMemberList, executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation'; // getSimulationMemberList
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import {getDraftScriptByGroupNew, getAllSelectedScriptRole } from '@/api/script'; import {getDraftScriptByGroupNew, getAllSelectedScriptRole } from '@/api/script';
import AddScriptMember from './addScriptMember'; import AddScriptMember from './addScriptMember';
@ -80,11 +88,20 @@ export default {
offset:{ offset:{
type: Number, type: Number,
required: true required: true
},
treeData:{
type:Array,
required: true
},
memberList:{
type:Array,
required: true
} }
}, },
data() { data() {
return { return {
isShow:true, isShow:true,
isFirst:true,
language:'', language:'',
isPause:false, isPause:false,
executeDisabled: false, executeDisabled: false,
@ -92,11 +109,7 @@ export default {
autoSaveScript: null, autoSaveScript: null,
isSavingScript: false, isSavingScript: false,
mapLocation:null, mapLocation:null,
memberId:'', quickChangeMember:{list:[]},
oldMemberId:'',
allMemberList:[],
memberList:[],
quickChangeMember:[],
size: { size: {
width: 300, width: 300,
height: 300 height: 300
@ -104,6 +117,14 @@ export default {
openWindow:null openWindow:null
}; };
}, },
computed:{
memberId() {
return this.$store.state.scriptRecord.updateRoleId;
},
orignalUserRoleId() {
return this.$store.state.training.orignalUserRoleId;
}
},
watch:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation); Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
@ -112,10 +133,6 @@ export default {
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale}; const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation); Vue.prototype.$jlmap.setOptions(newMapLocation);
} }
// if (this.$store.state.scriptRecord.bgSet) {
// this.$store.dispatch('training/setPrdType', null);
// }
this.initData();
}, },
'$store.state.scriptRecord.bgSet': function (val) { '$store.state.scriptRecord.bgSet': function (val) {
this.backDisabled = val; this.backDisabled = val;
@ -123,17 +140,13 @@ export default {
'$store.state.scriptRecord.simulationPause': function(val) { '$store.state.scriptRecord.simulationPause': function(val) {
this.isPause = !(this.$store.state.scriptRecord.simulationPause); this.isPause = !(this.$store.state.scriptRecord.simulationPause);
}, },
'$store.state.map.activeTrainListChange':function (val) { 'memberList':function(val) {
this.changeRunPlanStatus(); if (this.isFirst) {
this.isFirst = false;
this.initData();
}
} }
}, },
beforeDestroy() {
// this.clearAutoSave();
this.$store.dispatch('training/setMemberList', {memberList:[], userId:this.$store.state.user.id});
this.$store.dispatch('map/resetActiveTrainList', true);
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$store.dispatch('scriptRecord/updateRole', null);
},
mounted() { mounted() {
this.language = this.$route.query.lang == 'en' ? this.$t('scriptRecord.english') : this.$t('scriptRecord.chinese'); this.language = this.$route.query.lang == 'en' ? this.$t('scriptRecord.english') : this.$t('scriptRecord.chinese');
getDraftScriptByGroupNew(this.group).then(response=>{ getDraftScriptByGroupNew(this.group).then(response=>{
@ -144,27 +157,13 @@ export default {
}, },
methods:{ methods:{
initData() { initData() {
getSimulationMemberList(this.group).then(resp => { getAllSelectedScriptRole(this.group).then(res=>{
const lastData = JSON.stringify(resp.data); res.data.forEach(each=>{
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id}); const eachMember = this.memberList.find(member=>{ return member.id == each.id; });
this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); if (eachMember) {
this.changeRunPlanStatus(); this.quickChangeMember.list.push(eachMember);
const member = this.memberList.find(mem=>{ }
return mem.type == '行调';
}); });
if (member) {
this.memberId = member.id;
this.oldMemberId = member.id;
}
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER' + ':' + this.memberId);
getAllSelectedScriptRole(this.group).then(res=>{
const lastData = JSON.stringify(res.data);
this.quickChangeMember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
});
}).catch(error => {
this.$message(error.message);
}); });
}, },
addScriptMember(member) { addScriptMember(member) {
@ -172,39 +171,28 @@ export default {
member.disabled = false; member.disabled = false;
const lastData = JSON.stringify([member]); const lastData = JSON.stringify([member]);
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
covertmember.forEach(each=>{ this.$emit('addScriptMember', covertmember[0]);
this.memberList.push(each);
this.$store.dispatch('training/addMemberListInScript', each);
});
}, },
setMemberId(member) { setMemberId({newRole, oldRole}) {
this.memberId = member.id; this.$emit('changeTreeData', {newRole:newRole, oldRole:oldRole});
const memberdata = this.quickChangeMember.find(mem=>{ return mem.id == member.id; }); const quickChangeMember = this.quickChangeMember.list;
if (!memberdata) { this.quickChangeMember.push(member); } quickChangeMember.forEach((mem, index)=>{
if (oldRole.id && mem.id == oldRole.id) {
delete mem.userId;
}
if (newRole.id == mem.id) {
mem.userId = this.$store.state.user.id;
}
});
this.quickChangeMember = {list:quickChangeMember};
const memberdata = this.quickChangeMember.list.find(mem=>{ return mem.id == newRole.id; });
if (!memberdata) {
newRole.userId = this.$store.state.user.id; this.quickChangeMember.list.push(newRole);
}
}, },
addMember() { addMember() {
this.$refs.addScriptMember.doShow(); this.$refs.addScriptMember.doShow();
}, },
changeRunPlanStatus() {
this.memberList = [];
if (this.$store.state.training.started) {
const activeList = this.$store.state.map.activeTrainList;
this.allMemberList.forEach(allmember=>{
if (allmember.type == '司机') {
if (activeList.length > 0 && activeList.includes(allmember.deviceCode)) {
this.memberList.push(allmember);
}
} else {
this.memberList.push(allmember);
}
});
} else {
this.memberList = this.allMemberList.filter(member=>{
return member.type != '司机';
});
}
},
changeRole(member) { changeRole(member) {
this.$refs.allScriptRole.changeRole(member); this.$refs.allScriptRole.changeRole(member);
}, },
@ -213,7 +201,7 @@ export default {
return member.id == memberId; return member.id == memberId;
}); });
if (currentMember) { if (currentMember) {
return currentMember.name; return currentMember.type + currentMember.deviceName + (currentMember.name ? currentMember.name : '');
} }
return ''; return '';
}, },
@ -236,7 +224,6 @@ export default {
}); });
lastData = JSON.parse(lastData); lastData = JSON.parse(lastData);
lastData.forEach(each=>{ lastData.forEach(each=>{
// const name = each.name == undefined ? '' : '-' + each.name;
let deviceName = ''; let deviceName = '';
if (each.deviceCode) { if (each.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](each.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](each.deviceCode);
@ -250,7 +237,8 @@ export default {
deviceName = each.deviceCode; deviceName = each.deviceCode;
} }
} }
each.name = each.type + deviceName + (each.name ? '' + each.name : ''); each.normalName = each.type + deviceName + (each.name ? '' + each.name : '');
each.name = each.normalName;
each.label = each.name; each.label = each.name;
}); });
return lastData; return lastData;
@ -338,21 +326,41 @@ export default {
dumpScriptDataNew(group).then(resp => { dumpScriptDataNew(group).then(resp => {
this.$parent.resetBeginTime(); this.$parent.resetBeginTime();
this.$refs['getAction'].loadInitData(); this.$refs['getAction'].loadInitData();
this.changeRunPlanStatus(); // this.changeRunPlanStatus();
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('training/updateMemberListInScript', this.$store.dispatch('training/updateMemberListInScript',
{ {
oldMemberId:this.memberId, oldMemberId:this.memberId,
newMemberId:this.oldMemberId, newMemberId:this.orignalUserRoleId,
userId:this.$store.state.user.id, userId:this.$store.state.user.id,
name:this.$store.state.user.nickname name:this.$store.state.user.nickname
} }
); );
const new_member = this.memberList.find(mem=>{ return mem.id == this.orignalUserRoleId; });
const old_member = this.memberList.find(mem=>{ return mem.id == this.memberId; });
if (new_member && old_member) {
new_member.userId = this.$store.state.user.id;
new_member.disabled = true;
this.quickChangeMember.list = [new_member];
const deviceList = ['行值', '行调', '司机', '通号', '车辆段'];
const deviceType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
const new_index = deviceList.indexOf(new_member.type);
const old_index = deviceList.indexOf(old_member.type);
let oldType, newType;
if (new_index >= 0) {
newType = deviceType[new_index];
}
if (old_index >= 0) {
oldType = deviceType[old_index];
}
this.$emit('changeTreeData', {oldRole:{id:this.memberId, type:oldType }, newRole:{id:this.orignalUserRoleId, type:newType}});
this.$emit('resetChat');
}
// this.initAutoSaveScript(); // this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER:' + this.oldMemberId); this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('scriptRecord/updateRole', new_member.type + ':' + this.orignalUserRoleId);
this.$store.dispatch('scriptRecord/updateBgSet', false); this.$store.dispatch('scriptRecord/updateBgSet', false);
this.memberId = this.oldMemberId; // this.memberId = this.orignalUserRoleId;
this.$message.success(this.$t('scriptRecord.resetDataSuccess')); this.$message.success(this.$t('scriptRecord.resetDataSuccess'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('scriptRecord.resetDataFail')); this.$messageBox(this.$t('scriptRecord.resetDataFail'));

View File

@ -687,7 +687,7 @@ function timedCount() {
function callback(Response) { function callback(Response) {
data = JSON.parse(Response.body); data = JSON.parse(Response.body);
// console.log(data);
if(data.type == "Train_Position"){ if(data.type == "Train_Position"){
postMessage(data); postMessage(data);

View File

@ -697,6 +697,7 @@ function timedCount(){
// postMessage(data.body[i]); // postMessage(data.body[i]);
// } // }
// } // }
if(data.type == "Device_Fault_Set_3D"){ if(data.type == "Device_Fault_Set_3D"){
postMessage(data); postMessage(data);
return; return;
@ -743,7 +744,10 @@ function timedCount(){
postMessage(data); postMessage(data);
return; return;
} }
if (data.type == 'Simulation_Over') {
postMessage(data);
return;
}
} }
} }

View File

@ -738,6 +738,7 @@ function timedCount(){
// postMessage(data.body[i]); // postMessage(data.body[i]);
// } // }
// } // }
if(data.type == "VR_Sync_3D"){ if(data.type == "VR_Sync_3D"){
} }