Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
529dce5d2c
@ -556,7 +556,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
|
||||
// let netDataAssets = JSON.parse(netdata.data.assets);
|
||||
// setpsdstationmap(JSON.parse(netdata.data.stands));
|
||||
scope.modelmanager.loadpromise(mixers).then(function (data) {
|
||||
switchModel = scope.modelmanager.otherDevice.mesh.getObjectByName("SWITCH");
|
||||
switchModel = scope.modelmanager.otherDevice.mesh.getObjectByName("SWITCH1");
|
||||
moveanima.initlistnew(switchModel);
|
||||
|
||||
scope.devicetext.initdevicetext(switchModel);
|
||||
@ -891,6 +891,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
|
||||
if(navMesh){
|
||||
scope.scene.remove( navMesh );
|
||||
}
|
||||
|
||||
if(navStatus){
|
||||
navStatus = false;
|
||||
}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);
|
||||
pathPoints.push(new THREE.Vector3(human.position.x,human.position.y,human.position.z));
|
||||
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(targetPosition);
|
||||
@ -1211,6 +1213,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
|
||||
};
|
||||
|
||||
this.updateaction = function (data) {
|
||||
console.log(data);
|
||||
if (data.type == "SWITCH") {
|
||||
if (data.normal == "0") {
|
||||
scope.modelmanager.otherDevice.normalPosition = "0";
|
||||
|
@ -212,6 +212,10 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
initall(event.data.body);
|
||||
return;
|
||||
}
|
||||
if (event.data.type == 'Simulation_Over') {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
|
||||
|
@ -20,7 +20,7 @@ export function MoveanimateVr(main){
|
||||
scope.animatelist[switchmodel.animacode+"chaijie"] = [];
|
||||
scope.animatelist[switchmodel.animacode+"fuwei"] = [];
|
||||
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 = [];
|
||||
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));
|
||||
@ -32,7 +32,7 @@ export function MoveanimateVr(main){
|
||||
|
||||
|
||||
}
|
||||
if(switchmodel.children[i].name == "DJZ"){
|
||||
if(switchmodel.children[i].name == "DJZ011"){
|
||||
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-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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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);
|
||||
}
|
||||
|
||||
if(switchmodel.children[i].name == "SZ"){
|
||||
if(switchmodel.children[i].name == "SZ011"){
|
||||
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-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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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);
|
||||
|
||||
}
|
||||
if(switchmodel.children[i].name == "QDP"){
|
||||
if(switchmodel.children[i].name == "QDP011"){
|
||||
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+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));
|
||||
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 = [];
|
||||
|
||||
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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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));
|
||||
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 = [];
|
||||
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));
|
||||
@ -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);
|
||||
}
|
||||
|
||||
if(switchmodel.children[i].name =="CTK"){
|
||||
if(switchmodel.children[i].name =="CTK011"){
|
||||
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+6,switchmodel.children[i].position.z));
|
||||
@ -188,21 +188,21 @@ export function MoveanimateVr(main){
|
||||
|
||||
|
||||
modelorderlist[switchmodel.animacode] = [
|
||||
{name:"SZ",pos:[-1.5,0,-1]},//锁子
|
||||
{name:"DINGK",pos:[0,0,9]},//顶盖
|
||||
{name:"DJZ",pos:[-3,0,0]},
|
||||
{name:"DDJ",pos:[-1.5,0,0]},
|
||||
{name:"JSQ",pos:[-3,0,3]},
|
||||
{name:"ZDKBQ",pos:[0,0,3]},
|
||||
{name:"ZZ",pos:[3,0,3]},
|
||||
{name:"ESWCJJ",pos:[0,0,6]},
|
||||
{name:"CTK",pos:[0,0,6]},
|
||||
{name:"YWJCQ",pos:[0,3,6]},
|
||||
{name:"AQJD",pos:[0,-2,6]},
|
||||
{name:"QDP",pos:[0,-3,6]},
|
||||
{name:"SDP",pos:[0,-4,6]},
|
||||
{name:"BSG",pos:[1,-5,0]},
|
||||
{name:"DZG",pos:[-1,-5,0]}
|
||||
{name:"SZ011",pos:[-1.5,0,-1]},//锁子
|
||||
{name:"DINGK011",pos:[0,0,9]},//顶盖
|
||||
{name:"DJZ011",pos:[-3,0,0]},
|
||||
{name:"DDJ011",pos:[-1.5,0,0]},
|
||||
{name:"JSQ011",pos:[-3,0,3]},
|
||||
{name:"ZDKBQ011",pos:[0,0,3]},
|
||||
{name:"ZZ011",pos:[3,0,3]},
|
||||
{name:"ESWCJJ011",pos:[0,0,6]},
|
||||
{name:"CTK011",pos:[0,0,6]},
|
||||
{name:"YWJCQ011",pos:[0,3,6]},
|
||||
{name:"AQJD011",pos:[0,-2,6]},
|
||||
{name:"QDP011",pos:[0,-3,6]},
|
||||
{name:"SDP011",pos:[0,-4,6]},
|
||||
{name:"BSG011",pos:[1,-5,0]},
|
||||
{name:"DZG011",pos:[-1,-5,0]}
|
||||
|
||||
|
||||
|
||||
|
@ -420,7 +420,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "signal"){
|
||||
console.log(signallist);
|
||||
|
||||
let intersects = raycaster.intersectObjects( signallist.group.children,true);
|
||||
|
||||
if(intersects[0]){
|
||||
@ -449,10 +449,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
camerarail.progress = 0;
|
||||
let points = [];
|
||||
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,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+13,5,stationp1.z+2));
|
||||
|
||||
if(stationstandlist.group.children[0].inside == false){
|
||||
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z-26));
|
||||
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));
|
||||
// controls.target = new THREE.Vector3(camera.position.x+1,camera.position.y,camera.position.z);
|
||||
// controls.update();
|
||||
|
@ -46,6 +46,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
}
|
||||
|
||||
function initnew3d(data,netdata){
|
||||
|
||||
// console.log(JSON.parse(netdata.assets));
|
||||
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
|
||||
let mapdata = data;
|
||||
@ -68,7 +69,18 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
let switchdata = JSON.parse(netdata.switchs);
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
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.setmodellistnew(netdata.assets);
|
||||
|
@ -101,7 +101,7 @@ export function StationStandListN() {
|
||||
}
|
||||
|
||||
}
|
||||
// console.log(newstationmesh);
|
||||
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
|
||||
@ -153,6 +153,7 @@ export function StationStandListN() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
if(standsdata[i].code != "Station96090"){
|
||||
@ -169,16 +170,18 @@ export function StationStandListN() {
|
||||
newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
newstationstand.direction2.screenDoorOpenStatus = "01";
|
||||
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);
|
||||
}else{
|
||||
newstationmesh = selectmesh2.clone(true);
|
||||
}
|
||||
// console.log(standsdata[i].name);
|
||||
// console.log(standsdata[i].code);
|
||||
// console.log("==================");
|
||||
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].code;
|
||||
|
||||
newstationmesh.inside = standsdata[i].inside;
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
|
@ -15,8 +15,6 @@ class EMouse extends Group {
|
||||
// 名称的包围框
|
||||
if (this.device.name && this.device.style.Section.mouseOverStyle.nameShow) {
|
||||
const rect = this.device.name.getBoundingRect();
|
||||
// console.log(this.device.isSwitchSection, this.device.switchSection);
|
||||
// if (!this.device.isSwitchSection) {
|
||||
this.sectionTextBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 4,
|
||||
@ -29,7 +27,6 @@ class EMouse extends Group {
|
||||
});
|
||||
this.add(this.sectionTextBorder);
|
||||
this.sectionTextBorder.hide();
|
||||
// }
|
||||
|
||||
const fontSize = this.device.model.type == '02' ? this.device.style.Section.text.fontSize + 2 : this.device.style.Section.text.fontSize;
|
||||
this.TextName = new Text({
|
||||
@ -50,25 +47,6 @@ class EMouse extends Group {
|
||||
});
|
||||
this.add(this.TextName);
|
||||
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) {
|
||||
@ -155,12 +133,12 @@ class EMouse extends Group {
|
||||
}
|
||||
|
||||
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);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseover(e);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
@ -169,17 +147,14 @@ class EMouse extends Group {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.sectionTextShadow && this.sectionTextShadow.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);
|
||||
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();
|
||||
@ -188,14 +163,12 @@ class EMouse extends Group {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.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);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
@ -207,7 +180,7 @@ class EMouse extends Group {
|
||||
this.TextName && this.TextName.hide();
|
||||
this.sectionTextBorder && this.sectionTextBorder.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);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
|
@ -793,15 +793,15 @@ export default class Section extends Group {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 计轴失效 13*/
|
||||
alxeFailure() {
|
||||
if (this.section) {
|
||||
this.section.setStyle({
|
||||
stroke: this.style.Section.axle.Failure,
|
||||
lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth
|
||||
});
|
||||
}
|
||||
}
|
||||
// /** 计轴失效 13*/
|
||||
// alxeFailure() {
|
||||
// if (this.section) {
|
||||
// this.section.setStyle({
|
||||
// stroke: this.style.Section.axle.Failure,
|
||||
// lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
showRemainTime(number) { // 区段延时保护倒计时显示
|
||||
this.releaseName && this.releaseName.show();
|
||||
|
@ -14,7 +14,6 @@ class EMouse extends Group {
|
||||
const rect = this.device.name.getNameText().getBoundingRect();
|
||||
let textWidth = rect.width * 0.8;
|
||||
if (this.device.triangle.drictx !== 1) {
|
||||
// rect.x += rect.width;
|
||||
textWidth = -textWidth;
|
||||
}
|
||||
|
||||
@ -91,8 +90,6 @@ class EMouse extends Group {
|
||||
|
||||
mouseover(e) {
|
||||
this.switchBorder && this.switchBorder.show();
|
||||
// this.device.setLossAction(false);
|
||||
// this.device.setSwitchCoreColor(this.device.style.Switch.mouseOverStyle.borderBackgroundColor);
|
||||
this.device.setTextStyle({
|
||||
textFill: '#000'
|
||||
});
|
||||
@ -106,21 +103,15 @@ class EMouse extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
mouseEnter() {
|
||||
this.switchBorder && this.switchBorder.show();
|
||||
// this.device.setLossAction(false);
|
||||
// this.device.setSwitchCoreColor(this.device.style.Switch.mouseOverStyle.borderBackgroundColor);
|
||||
this.device.setTextStyle({
|
||||
textFill: '#000'
|
||||
});
|
||||
this.device.setTextStyle({ textFill: '#000' });
|
||||
this.textRect && this.textRect.show();
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
mouseLeave() {
|
||||
this.switchBorder && this.switchBorder.hide();
|
||||
this.device.setTextStyle({
|
||||
textFill: this.device.style.backgroundColor
|
||||
});
|
||||
this.device.setTextStyle({ textFill: this.device.style.backgroundColor });
|
||||
this.textRect && this.textRect.hide();
|
||||
this.device.setState(this.device.model);
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ export default class EMouse {
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
mouseEnter() {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
mouseLeave() {
|
||||
if (this.device.prdType ) {
|
||||
this.device.setVisible(false);
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ class TrainWindow extends Group {
|
||||
this.z = 9;
|
||||
this.prdType = store.state.training.prdType;
|
||||
this.isShowShape = true;
|
||||
this.create(model);
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
create(model) {
|
||||
create() {
|
||||
if (this.prdType !== '01') {
|
||||
this.createTrainWindow();
|
||||
}
|
||||
|
@ -200,10 +200,9 @@ export default {
|
||||
// if (elem.switchSection && elem.parentCode) {
|
||||
// // 道岔轨的区段名称默认不显示
|
||||
// nameShow = false;
|
||||
if (elem.type != '03') {
|
||||
if (elem.type == '03') {
|
||||
nameShow = false;
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
} else if (elem.type === '01') {
|
||||
// 计轴区段名称
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
||||
} else if (elem.type === '02') {
|
||||
@ -213,7 +212,6 @@ export default {
|
||||
// 道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
// 站台轨名称
|
||||
if (elem.isStandTrack) {
|
||||
|
@ -218,7 +218,8 @@ export default {
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
||||
param:{
|
||||
standReentryStrategy: this.strategy
|
||||
}
|
||||
},
|
||||
val: this.strategy + ''
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
|
@ -200,10 +200,9 @@ export default {
|
||||
// if (elem.switchSection && elem.parentCode) {
|
||||
// // 道岔轨的区段名称默认不显示
|
||||
// nameShow = false;
|
||||
if (elem.type != '03') {
|
||||
if (elem.type == '03') {
|
||||
nameShow = false;
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
} else if (elem.type === '01') {
|
||||
// 计轴区段名称
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
||||
} else if (elem.type === '02') {
|
||||
@ -213,7 +212,6 @@ export default {
|
||||
// 道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
// 站台轨名称
|
||||
if (elem.isStandTrack) {
|
||||
|
@ -50,37 +50,37 @@ export default {
|
||||
menuNormal: {
|
||||
Local: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
label: '道岔单锁',
|
||||
handler: this.lock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
label: '道岔单解',
|
||||
handler: this.unlock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
label: '道岔封锁',
|
||||
handler: this.block,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
label: '道岔解封',
|
||||
handler: this.unblock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
label: '道岔转动',
|
||||
handler: this.switchTurnout,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_TURN
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
label: '道岔故障解锁',
|
||||
handler: this.fault,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'),
|
||||
label: '道岔计轴预复位',
|
||||
handler: this.axlePreReset,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
|
||||
},
|
||||
@ -107,32 +107,32 @@ export default {
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
label: '道岔单锁',
|
||||
handler: this.lock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
label: '道岔单解',
|
||||
handler: this.unlock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
label: '道岔封锁',
|
||||
handler: this.block,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
label: '道岔解封',
|
||||
handler: this.unblock,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
label: '道岔转动',
|
||||
handler: this.switchTurnout,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_TURN
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
label: '道岔故障解锁',
|
||||
handler: this.fault,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
},
|
||||
|
@ -481,31 +481,31 @@ export default {
|
||||
{ deviceType: '02', orderNum: 5, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }
|
||||
]
|
||||
},
|
||||
{ // 未生成实训
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Switch_Section_Block',
|
||||
operateType: 'Switch_Block',
|
||||
skinCode: '02',
|
||||
trainingName: '道岔区段封闭({7})',
|
||||
trainingRemark: '道岔区段封闭功能',
|
||||
trainingName: '道岔封闭({7})',
|
||||
trainingRemark: '道岔封闭功能',
|
||||
trainingType: 'Switch',
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '02', orderNum: 1, operateCode: '105', tip: '鼠标右键菜单选择【道岔区段封闭】' },
|
||||
{ deviceType: '02', orderNum: 1, operateCode: '105', tip: '鼠标右键菜单选择【道岔封闭】' },
|
||||
{ deviceType: '02', orderNum: 2, operateCode: '105', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
{ // 未生成实训
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Switch_Section_Unblock',
|
||||
operateType: 'Switch_Unblock',
|
||||
skinCode: '02',
|
||||
trainingName: '道岔区段解封({7})',
|
||||
trainingRemark: '道岔区段解封功能',
|
||||
trainingName: '道岔解封({7})',
|
||||
trainingRemark: '道岔解封功能',
|
||||
trainingType: 'Switch',
|
||||
productTypes: ['01', '02'],
|
||||
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: 3, operateCode: '1063', tip: '鼠标左键点击【确认1】按钮' },
|
||||
{ deviceType: '02', orderNum: 4, operateCode: '1064', tip: '鼠标左键点击【确认2】按钮' },
|
||||
@ -548,12 +548,12 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Switch_Axis_Pre_Reset',
|
||||
skinCode: '02',
|
||||
trainingName: '道岔区段计轴预复位({7})',
|
||||
trainingRemark: '道岔区段计轴预复位功能',
|
||||
trainingName: '道岔计轴预复位({7})',
|
||||
trainingRemark: '道岔计轴预复位功能',
|
||||
trainingType: 'Switch',
|
||||
productTypes: ['01'],
|
||||
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: 3, operateCode: '1103', tip: '鼠标左键点击【确认1】按钮' },
|
||||
{ deviceType: '02', orderNum: 4, operateCode: '1104', tip: '鼠标左键点击【确认2】按钮' },
|
||||
@ -593,8 +593,8 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Switch_Set_Limit_Speed',
|
||||
skinCode: '02',
|
||||
trainingName: '道岔区段设置限速({7})',
|
||||
trainingRemark: '道岔区段设置限速功能(限速值:5)',
|
||||
trainingName: '道岔设置限速({7})',
|
||||
trainingRemark: '道岔设置限速功能(限速值:5)',
|
||||
trainingType: 'Switch',
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
@ -612,8 +612,8 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Switch_Cancel_Limit_Speed',
|
||||
skinCode: '02',
|
||||
trainingName: '道岔区段取消限速({7})',
|
||||
trainingRemark: '道岔区段取消限速功能',
|
||||
trainingName: '道岔取消限速({7})',
|
||||
trainingRemark: '道岔取消限速功能',
|
||||
trainingType: 'Switch',
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
|
@ -249,6 +249,7 @@ export default {
|
||||
},
|
||||
handleSwicthMenu() { // 转换底部道岔菜单栏
|
||||
// 获取道岔相关区段显示高亮
|
||||
this.clearAllMenuShow();
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionParentCode);
|
||||
const sectionA = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionACode); // 获取道岔相关的道岔计轴区段
|
||||
const sectionB = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionBCode);
|
||||
@ -274,6 +275,7 @@ export default {
|
||||
};
|
||||
},
|
||||
handleSingalMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(this.selectedObj, true);
|
||||
this.oldDevice = this.selectedObj;
|
||||
@ -351,6 +353,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSectionMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(this.selectedObj, true);
|
||||
this.oldDevice = this.selectedObj;
|
||||
@ -386,6 +389,7 @@ export default {
|
||||
};
|
||||
},
|
||||
handleStationMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.centralizedStationList = new Array(15).fill({});
|
||||
this.stationParamList.forEach((station, index) => {
|
||||
this.centralizedStationList[index] = station;
|
||||
@ -398,6 +402,7 @@ export default {
|
||||
this.param = { stationCode: this.selectedObj.code };
|
||||
},
|
||||
handleStandMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.centralizedStationList = new Array(15).fill({});
|
||||
this.standParamList.forEach((stand, index) => {
|
||||
this.centralizedStationList[index] = stand;
|
||||
|
@ -931,7 +931,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Close_AllSignal',
|
||||
skinCode: '07',
|
||||
trainingName: '关站信号({10})',
|
||||
trainingName: '关站信号({26})',
|
||||
trainingRemark: '关站信号',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['01'],
|
||||
@ -946,7 +946,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Set_CI_Auto_Trigger',
|
||||
skinCode: '07',
|
||||
trainingName: '追踪全开({10})',
|
||||
trainingName: '追踪全开({26})',
|
||||
trainingRemark: '追踪全开',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
@ -961,7 +961,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Cancel_CI_Auto_Trigger',
|
||||
skinCode: '07',
|
||||
trainingName: '追踪全关({10})',
|
||||
trainingName: '追踪全关({26})',
|
||||
trainingRemark: '追踪全关',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
@ -976,7 +976,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Open_Auto_Setting',
|
||||
skinCode: '07',
|
||||
trainingName: '自排全开({10})',
|
||||
trainingName: '自排全开({26})',
|
||||
trainingRemark: '自排全开',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
@ -991,7 +991,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Close_Auto_Setting',
|
||||
skinCode: '07',
|
||||
trainingName: '自排全关({10})',
|
||||
trainingName: '自排全关({26})',
|
||||
trainingRemark: '自排全关',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
@ -1006,7 +1006,7 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Station_CIArea_Close_AllSignal',
|
||||
skinCode: '07',
|
||||
trainingName: '关区信号({10})',
|
||||
trainingName: '关区信号({26})',
|
||||
trainingRemark: '关区信号',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
|
@ -23,22 +23,25 @@
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="设置进路" name="first">用户管理</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="first">设置进路</el-tab-pane>
|
||||
<el-tab-pane label="取消进路" name="second">取消进路</el-tab-pane>
|
||||
<el-tab-pane label="禁止进路" name="third">禁止进路</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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-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-col>
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button>帮助(H)</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
</el-dialog>
|
||||
|
@ -204,18 +204,16 @@ export default {
|
||||
// nameShow = false;
|
||||
if (elem.type == '03') {
|
||||
nameShow = false;
|
||||
} else {
|
||||
if (elem.type === '01') {
|
||||
} else if (elem.type == '01') {
|
||||
// 计轴区段名称
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
||||
} else if (elem.type === '02') {
|
||||
} else if (elem.type == '02') {
|
||||
// 轨道轨名称
|
||||
nameShow = this.nameLevels.indexOf(5) !== -1;
|
||||
} else if (elem.type === '04') {
|
||||
} else if (elem.type == '04') {
|
||||
// 道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
// 站台轨名称
|
||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
|
||||
|
@ -40,7 +40,6 @@ const training = {
|
||||
memberList: [], // 综合仿真成员列表
|
||||
memberData: {}, // 综合仿真成员列表
|
||||
simulationUserList: [], // 综合仿真用户列表
|
||||
addMemberInScript:{}, // 剧本录制新增角色
|
||||
orignalUserRoleId:'' // 设置旧的角色的id
|
||||
},
|
||||
|
||||
@ -253,13 +252,6 @@ const training = {
|
||||
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}) => {
|
||||
simulationUserList.forEach(item => {
|
||||
let memberIndex = -1;
|
||||
@ -720,10 +712,6 @@ const training = {
|
||||
setRoleDeviceCode:({ commit }, roleDeviceCode) => {
|
||||
commit('setRoleDeviceCode', roleDeviceCode);
|
||||
},
|
||||
/** 添加新成员(剧本录制)*/
|
||||
addMemberListInScript:({ commit }, data) => {
|
||||
commit('addMemberListInScript', data);
|
||||
},
|
||||
/** 剧本仿真 设置旧的角色的id */
|
||||
setOrignalUserRoleId:({ commit }, data) => {
|
||||
commit('setOrignalUserRoleId', data);
|
||||
|
@ -128,6 +128,7 @@ export default {
|
||||
'$store.state.runPlan.planLoadedCount': async function () {
|
||||
try {
|
||||
await this.loadChartPage();
|
||||
this.selectSeries = []; this.runSeries = [];
|
||||
if (this.dialogShow) {
|
||||
await this.loadInitData();
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
this.driverList = [];
|
||||
this.treeData = [];
|
||||
const result = covertMemberData(this.activeTrainList, resp);
|
||||
const result = covertMemberData(this.activeTrainList, resp.data);
|
||||
this.driverList = result.driverList;
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
@ -191,6 +191,9 @@ export default {
|
||||
// 按计划行车的列车列表更新(更新司机列表)
|
||||
'$store.state.map.activeTrainListChange': function (val) {
|
||||
const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
activeTrainList.sort((a, b) => {
|
||||
return parseInt(a) - parseInt(b);
|
||||
});
|
||||
if (this.driverList.length > 0) {
|
||||
const driverList = [];
|
||||
if (activeTrainList && activeTrainList.length) {
|
||||
|
@ -117,8 +117,29 @@ export const operateEnum = {
|
||||
type:'车站'
|
||||
},
|
||||
Driver:{
|
||||
// code:'stationCode',
|
||||
type:'司机'
|
||||
code:'groupNumber',
|
||||
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:'='}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
<script>
|
||||
import DemonMenu from '@/views/newMap/displayNew/demonMenu';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
@ -74,6 +75,7 @@ export default {
|
||||
faultMode: false,
|
||||
viewDisabled: true,
|
||||
firstLoad:true,
|
||||
activeTrainList:[],
|
||||
isscriptRun:false // 剧本是否正在加载
|
||||
};
|
||||
},
|
||||
@ -191,98 +193,40 @@ export default {
|
||||
if (resp.code == 200) {
|
||||
if (resp.data.memberList && resp.data.memberList.length > 0) {
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data.memberList, userId:this.$store.state.user.id});
|
||||
// 以下待优化
|
||||
const memberList = this.$store.state.training.memberData;
|
||||
// if (data.id) {
|
||||
// memberList[data.id].userId = this.$store.state.user.id;
|
||||
// memberList[data.id].name = this.$store.state.user.nickname;
|
||||
// memberList[data.id].disabled = true;
|
||||
// }
|
||||
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);
|
||||
if (this.$store.state.training.started) {
|
||||
this.activeTrainList = this.$store.state.map.activeTrainList;
|
||||
}
|
||||
});
|
||||
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 memberList = resp.data.memberList;
|
||||
// 获取仿真成员列表
|
||||
const result = covertMemberData(this.activeTrainList, memberList);
|
||||
this.driverList = result.driverList;
|
||||
const treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: dispatcherList
|
||||
children: result.deviceListData[0]
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: stationSupervisorList
|
||||
children: result.deviceListData[2]
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: driverList
|
||||
children: result.deviceListData[3]
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
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('setMemberData', lastMemberList);
|
||||
}
|
||||
|
@ -27,9 +27,25 @@
|
||||
: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" />
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -43,7 +59,8 @@ import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
|
||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||
import { Notification } from 'element-ui';
|
||||
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { mapGetters } from 'vuex';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'MenuScript',
|
||||
@ -85,7 +102,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
isScriptCommand:false
|
||||
isScriptCommand:false,
|
||||
driverList:[],
|
||||
treeData:[],
|
||||
memberData:[],
|
||||
activeTrainList:[],
|
||||
userRole:''
|
||||
};
|
||||
},
|
||||
|
||||
@ -93,17 +115,14 @@ export default {
|
||||
scriptId() {
|
||||
return this.$route.query.scriptId;
|
||||
},
|
||||
...mapGetters('map', [
|
||||
'trainList'
|
||||
]),
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userRole() {
|
||||
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
|
||||
},
|
||||
// userRole() {
|
||||
// return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
|
||||
// },
|
||||
isDriver() {
|
||||
return this.$store.state.scriptRecord.userRole == 'DRIVER';
|
||||
return this.userRole == 'DRIVER';
|
||||
},
|
||||
isShowScheduling() {
|
||||
return this.$store.state.training.prdType == '05';
|
||||
@ -115,26 +134,108 @@ export default {
|
||||
watch: {
|
||||
'$store.state.scriptRecord.bgSet':function (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() {
|
||||
// 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() {
|
||||
// this.$store.state.training.prdType
|
||||
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/setPrdType', '01');
|
||||
this.$nextTick(() => {
|
||||
this.$refs.demonMenu.menuClick();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initPlannedDriving(isDisable) {
|
||||
this.isDisable = isDisable;
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
@ -196,6 +297,51 @@ export default {
|
||||
history.go(-1);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -15,9 +15,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import ChatBox from '@/views/newMap/chatView/chatBox.vue';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import {getAllConversition} from '@/api/chat';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
export default {
|
||||
name:'ScriptChat',
|
||||
components:{
|
||||
@ -31,6 +29,14 @@ export default {
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
treeData:{
|
||||
type:Array,
|
||||
required:true
|
||||
},
|
||||
memberData:{
|
||||
type:Array,
|
||||
required:true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -38,15 +44,15 @@ export default {
|
||||
isHasCoversition:false,
|
||||
conversitionId:'',
|
||||
currentMemberList:[],
|
||||
memberData:{},
|
||||
// memberData:{},
|
||||
chatContentList:[],
|
||||
activeTrainList:[],
|
||||
isStartRecord:false,
|
||||
inviteUserName:'',
|
||||
inviteUser:{},
|
||||
isQuitShow:false,
|
||||
treeData:[],
|
||||
driverList:[]
|
||||
isQuitShow:false
|
||||
// treeData:[],
|
||||
// driverList:[]
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -57,80 +63,6 @@ export default {
|
||||
}
|
||||
},
|
||||
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) {
|
||||
if (this.memberData.length > 0) {
|
||||
@ -214,31 +146,6 @@ export default {
|
||||
this.inviteUser = {};
|
||||
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(this.$route.query.group).then(resp=>{
|
||||
|
@ -2,7 +2,7 @@ import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
export function covertMemberData (activeTrainList, resp) {
|
||||
let lastData = JSON.stringify(resp.data);
|
||||
let lastData = JSON.stringify(resp);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
@ -18,25 +18,26 @@ export function covertMemberData (activeTrainList, resp) {
|
||||
const deviceListData = [[], [], [], [], []];
|
||||
const driverList = [];
|
||||
lastData.forEach((member, index)=>{
|
||||
if (!member.userId) {
|
||||
member.disabled = false;
|
||||
} else {
|
||||
if (member.userId && member.userId == store.state.user.id) {
|
||||
member.disabled = true;
|
||||
member.userName = store.state.user.nickname;
|
||||
store.dispatch('training/setOrignalUserRoleId', member.id);
|
||||
} else {
|
||||
member.disabled = false;
|
||||
}
|
||||
const userName = member.userName ? '-' + member.userName : '';
|
||||
const name = member.name ? '-' + member.name : '';
|
||||
if (member.deviceCode) {
|
||||
const device = store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
const deviceName = device.name || device.groupNumber;
|
||||
member.deviceName = deviceName;
|
||||
member.label = member.type + deviceName + name + userName;
|
||||
member.deviceName = device.name || device.groupNumber;
|
||||
member.label = member.type + member.deviceName + name + userName;
|
||||
member.normalName = member.type + member.deviceName + name;
|
||||
} else {
|
||||
member.deviceName = '';
|
||||
member.label = member.type + name + userName;
|
||||
member.normalName = member.type + name;
|
||||
}
|
||||
lastMemberList.push(member);
|
||||
|
||||
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度'];
|
||||
const deviceTypeIndex = deviceType.indexOf(member.type);
|
||||
if (deviceTypeIndex >= 0) {
|
||||
@ -44,12 +45,13 @@ export function covertMemberData (activeTrainList, resp) {
|
||||
if (activeTrainList.length > 0) {
|
||||
if (activeTrainList.includes(member.deviceCode)) {
|
||||
deviceListData[deviceTypeIndex].push(member);
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
driverList.push(member);
|
||||
}
|
||||
} else {
|
||||
deviceListData[deviceTypeIndex].push(member);
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -355,7 +355,7 @@ export default {
|
||||
async simulationReset() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
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/setSimulationStart');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
@ -392,7 +392,6 @@ export default {
|
||||
},
|
||||
// 设置地图加载状态
|
||||
mapViewLoaded(loading) {
|
||||
// console.log(loading, '**************');
|
||||
this.loading = loading;
|
||||
if (loading) {
|
||||
this.$refs.progressBar && this.$refs.progressBar.start();
|
||||
|
@ -9,7 +9,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
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 TrainingTips from '@/views/newMap/mapsystemNew/plugin/trainingtip';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
@ -120,7 +120,7 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
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()) {
|
||||
EventBus.$emit('selectDevice', this.selected);
|
||||
EventBus.$emit('selectDevice', device);
|
||||
} else {
|
||||
const name = this.typeObj[this.$store.state.map.selectDevice.type];
|
||||
const info = '选择的设备类型不正确' + (name ? `,请选择${name}类型` : '');
|
||||
@ -159,10 +159,7 @@ export default {
|
||||
}
|
||||
if (device) {
|
||||
device = this.getSelectedByLineCode(device);
|
||||
// console.log((new Date()).valueOf(), '4', device);
|
||||
this.selected = device;
|
||||
// console.log((new Date()).valueOf(), '5');
|
||||
if (device) {
|
||||
if (!this.buttonOperation) {
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||
if (!this.checkShouldPop(device)) {
|
||||
@ -175,7 +172,6 @@ export default {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
menu = getDeviceMenuByDeviceType('Cancel');
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
|
||||
|
@ -59,11 +59,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(row) {
|
||||
|
||||
},
|
||||
doShow(row) {
|
||||
this.initData(row);
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
@ -71,9 +67,9 @@ export default {
|
||||
if (valid) {
|
||||
this.lodaing = true;
|
||||
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
|
||||
this.lodaing = false;
|
||||
this.$message.success('添加仿真角色成员成功!');
|
||||
this.$emit('addScriptMember', res.data);
|
||||
this.lodaing = false;
|
||||
this.handleClose();
|
||||
}).catch(() => {
|
||||
this.lodaing = false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="covertMemberList"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
@ -16,24 +16,28 @@
|
||||
style="margin: 10px;overflow-y:auto;height:255px;margin-right: 0;"
|
||||
>
|
||||
<span :id="data.id" slot-scope="{ node, data }" style="width:100%">
|
||||
<span v-if="data.children">
|
||||
<span style="font-size: 14px">{{ data.label }}</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.id!=memberId" class="settingBtn" @click="changeRole(data)">设置</span>
|
||||
<span v-if="!data.disabled" class="settingBtn" @click="changeRole(data)">设置</span>
|
||||
<span v-else class="hasSetted">已设置</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
import {changeScriptRole} from '@/api/script';
|
||||
export default {
|
||||
name:'AllScriptRole',
|
||||
props:{
|
||||
memberList:{
|
||||
treeData:{
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
@ -54,8 +58,8 @@ export default {
|
||||
return {
|
||||
covertMemberList:[],
|
||||
driverList:[],
|
||||
oldMember:{id:null, type:''},
|
||||
queryMember:'',
|
||||
oldMemberId:'',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
@ -63,117 +67,51 @@ export default {
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'memberList':function(val) {
|
||||
if (val && val.length > 0) {
|
||||
this.covertMember();
|
||||
}
|
||||
},
|
||||
queryMember(val) {
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
'treeData':function(val) {
|
||||
const roleName = this.$store.state.scriptRecord.userRole;
|
||||
this.oldMember = {id:this.memberId, type:roleName};
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
filterNode(value, data) {
|
||||
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) {
|
||||
if (member) {
|
||||
// this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
|
||||
this.switchMode(member);
|
||||
}
|
||||
},
|
||||
addMember() {
|
||||
this.$emit('addMember');
|
||||
},
|
||||
switchMode(role) {
|
||||
changeScriptRole(this.group, role.id).then(res=>{
|
||||
switchMode(member) {
|
||||
changeScriptRole(this.group, member.id).then(res=>{
|
||||
let prdType = '';
|
||||
if (this.openWindow) {
|
||||
this.openWindow.close();
|
||||
}
|
||||
const role = Object.assign({}, member);
|
||||
if (role.type == '行值') {
|
||||
prdType = '01';
|
||||
role.type = 'STATION_SUPERVISOR';
|
||||
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
|
||||
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
|
||||
} else if (role.type == '行调') {
|
||||
prdType = '02';
|
||||
role.type = 'DISPATCHER';
|
||||
this.$store.dispatch('training/setRoles', 'DISPATCHER');
|
||||
} else if (role.type == '司机') {
|
||||
prdType = '04';
|
||||
role.type = 'DRIVER';
|
||||
this.$store.dispatch('training/setRoles', 'DRIVER');
|
||||
} else if (role.type == '通号') {
|
||||
prdType = '';
|
||||
role.type = 'MAINTAINER';
|
||||
this.$store.dispatch('training/setRoles', 'MAINTAINER');
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/maintainer',
|
||||
@ -186,25 +124,25 @@ export default {
|
||||
}
|
||||
});
|
||||
this.openWindow = window.open(routeData.href);
|
||||
} else if (role.type == '车辆段') {
|
||||
prdType = '05';
|
||||
role.type = 'DEPOT_DISPATCHER';
|
||||
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
|
||||
} else {
|
||||
prdType = '';
|
||||
}
|
||||
this.$store.dispatch('training/updateMemberListInScript',
|
||||
{
|
||||
oldMemberId:this.oldMemberId,
|
||||
oldMemberId:this.oldMember.id,
|
||||
newMemberId:role.id,
|
||||
userId:this.$store.state.user.id,
|
||||
name:this.$store.state.user.nickname
|
||||
}
|
||||
);
|
||||
this.oldMemberId = role.id;
|
||||
this.$store.dispatch('training/setPrdType', prdType);
|
||||
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
|
||||
if (each.label == role.type) {
|
||||
this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role.id);
|
||||
}
|
||||
});
|
||||
this.$emit('setMemberId', role);
|
||||
this.$store.dispatch('scriptRecord/updateRole', role.type + ':' + role.id);
|
||||
this.$emit('setMemberId', {newRole:role, oldRole:this.oldMember});
|
||||
this.oldMember = {id:role.id, type:role.type};
|
||||
this.$message('切换角色成功');
|
||||
// this.$refs.changeScriptRole.blur();
|
||||
}).catch(()=>{
|
||||
|
@ -86,12 +86,6 @@ export default {
|
||||
memberName: ''
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
// drawWay() {
|
||||
// const drawWay = this.$route.query.drawWay;
|
||||
// return drawWay && JSON.parse(drawWay);
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
actionInfoList: function(val) {
|
||||
this.$nextTick(function() {
|
||||
@ -114,7 +108,7 @@ export default {
|
||||
},
|
||||
covertData(memberList, element) {
|
||||
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) {
|
||||
case 'Start_Conversation': {
|
||||
// isStartCoversition
|
||||
@ -122,7 +116,7 @@ export default {
|
||||
element.conversationMemberIds.forEach(id=>{
|
||||
if (member.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() });
|
||||
|
@ -14,11 +14,11 @@
|
||||
<div class="quickChange">
|
||||
<!-- <div class="quickChange_head">快捷切换</div> -->
|
||||
<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">
|
||||
<span style="font-size: 14px">{{ member.label }}</span>
|
||||
<div v-for="member in quickChangeMember.list" :key="member.id" class="setGroupOut">
|
||||
<span style="font-size: 14px">{{ member.normalName }}</span>
|
||||
<span class="setGroup">
|
||||
<span v-if="member.id!=memberId" class="settingBtn" @click="changeRole(member)">设置</span>
|
||||
<span v-else class="hasSetted">已设置</span>
|
||||
<span v-if="member.userId" class="hasSetted">已设置</span>
|
||||
<span v-else class="settingBtn" @click="changeRole(member)">设置</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,7 +39,14 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="所有成员">
|
||||
<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>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -54,7 +61,8 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
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 {getDraftScriptByGroupNew, getAllSelectedScriptRole } from '@/api/script';
|
||||
import AddScriptMember from './addScriptMember';
|
||||
@ -80,11 +88,20 @@ export default {
|
||||
offset:{
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
treeData:{
|
||||
type:Array,
|
||||
required: true
|
||||
},
|
||||
memberList:{
|
||||
type:Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow:true,
|
||||
isFirst:true,
|
||||
language:'',
|
||||
isPause:false,
|
||||
executeDisabled: false,
|
||||
@ -92,11 +109,7 @@ export default {
|
||||
autoSaveScript: null,
|
||||
isSavingScript: false,
|
||||
mapLocation:null,
|
||||
memberId:'',
|
||||
oldMemberId:'',
|
||||
allMemberList:[],
|
||||
memberList:[],
|
||||
quickChangeMember:[],
|
||||
quickChangeMember:{list:[]},
|
||||
size: {
|
||||
width: 300,
|
||||
height: 300
|
||||
@ -104,6 +117,14 @@ export default {
|
||||
openWindow:null
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
memberId() {
|
||||
return this.$store.state.scriptRecord.updateRoleId;
|
||||
},
|
||||
orignalUserRoleId() {
|
||||
return this.$store.state.training.orignalUserRoleId;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
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};
|
||||
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) {
|
||||
this.backDisabled = val;
|
||||
@ -123,16 +140,12 @@ export default {
|
||||
'$store.state.scriptRecord.simulationPause': function(val) {
|
||||
this.isPause = !(this.$store.state.scriptRecord.simulationPause);
|
||||
},
|
||||
'$store.state.map.activeTrainListChange':function (val) {
|
||||
this.changeRunPlanStatus();
|
||||
'memberList':function(val) {
|
||||
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() {
|
||||
this.language = this.$route.query.lang == 'en' ? this.$t('scriptRecord.english') : this.$t('scriptRecord.chinese');
|
||||
@ -144,27 +157,13 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
initData() {
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
const lastData = JSON.stringify(resp.data);
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
|
||||
this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
this.changeRunPlanStatus();
|
||||
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);
|
||||
res.data.forEach(each=>{
|
||||
const eachMember = this.memberList.find(member=>{ return member.id == each.id; });
|
||||
if (eachMember) {
|
||||
this.quickChangeMember.list.push(eachMember);
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
});
|
||||
},
|
||||
addScriptMember(member) {
|
||||
@ -172,39 +171,28 @@ export default {
|
||||
member.disabled = false;
|
||||
const lastData = JSON.stringify([member]);
|
||||
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
covertmember.forEach(each=>{
|
||||
this.memberList.push(each);
|
||||
this.$store.dispatch('training/addMemberListInScript', each);
|
||||
});
|
||||
|
||||
this.$emit('addScriptMember', covertmember[0]);
|
||||
},
|
||||
setMemberId(member) {
|
||||
this.memberId = member.id;
|
||||
const memberdata = this.quickChangeMember.find(mem=>{ return mem.id == member.id; });
|
||||
if (!memberdata) { this.quickChangeMember.push(member); }
|
||||
setMemberId({newRole, oldRole}) {
|
||||
this.$emit('changeTreeData', {newRole:newRole, oldRole:oldRole});
|
||||
const quickChangeMember = this.quickChangeMember.list;
|
||||
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() {
|
||||
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) {
|
||||
this.$refs.allScriptRole.changeRole(member);
|
||||
},
|
||||
@ -213,7 +201,7 @@ export default {
|
||||
return member.id == memberId;
|
||||
});
|
||||
if (currentMember) {
|
||||
return currentMember.name;
|
||||
return currentMember.type + currentMember.deviceName + (currentMember.name ? currentMember.name : '');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
@ -236,7 +224,6 @@ export default {
|
||||
});
|
||||
lastData = JSON.parse(lastData);
|
||||
lastData.forEach(each=>{
|
||||
// const name = each.name == undefined ? '' : '-' + each.name;
|
||||
let deviceName = '';
|
||||
if (each.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](each.deviceCode);
|
||||
@ -250,7 +237,8 @@ export default {
|
||||
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;
|
||||
});
|
||||
return lastData;
|
||||
@ -338,21 +326,41 @@ export default {
|
||||
dumpScriptDataNew(group).then(resp => {
|
||||
this.$parent.resetBeginTime();
|
||||
this.$refs['getAction'].loadInitData();
|
||||
this.changeRunPlanStatus();
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
this.$store.dispatch('map/resetActiveTrainList');
|
||||
// this.changeRunPlanStatus();
|
||||
this.$store.dispatch('training/updateMemberListInScript',
|
||||
{
|
||||
oldMemberId:this.memberId,
|
||||
newMemberId:this.oldMemberId,
|
||||
newMemberId:this.orignalUserRoleId,
|
||||
userId:this.$store.state.user.id,
|
||||
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.$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.memberId = this.oldMemberId;
|
||||
// this.memberId = this.orignalUserRoleId;
|
||||
this.$message.success(this.$t('scriptRecord.resetDataSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('scriptRecord.resetDataFail'));
|
||||
|
@ -687,7 +687,7 @@ function timedCount() {
|
||||
function callback(Response) {
|
||||
|
||||
data = JSON.parse(Response.body);
|
||||
// console.log(data);
|
||||
|
||||
|
||||
if(data.type == "Train_Position"){
|
||||
postMessage(data);
|
||||
|
@ -697,6 +697,7 @@ function timedCount(){
|
||||
// postMessage(data.body[i]);
|
||||
// }
|
||||
// }
|
||||
|
||||
if(data.type == "Device_Fault_Set_3D"){
|
||||
postMessage(data);
|
||||
return;
|
||||
@ -743,7 +744,10 @@ function timedCount(){
|
||||
postMessage(data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.type == 'Simulation_Over') {
|
||||
postMessage(data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -738,6 +738,7 @@ function timedCount(){
|
||||
// postMessage(data.body[i]);
|
||||
// }
|
||||
// }
|
||||
|
||||
if(data.type == "VR_Sync_3D"){
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user