Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-06-01 14:03:32 +08:00
commit c7d9a290ad
79 changed files with 1909 additions and 1092 deletions

View File

@ -345,3 +345,19 @@ export function getSimulationChatMemberNew(group, conversationId) {
});
}
// 接受其他人的会话邀请 (新版地图)
export function acceptCoversitionInvite(group, conversationId) {
return request({
url: `/simulation/${group}/${conversationId}/accept`,
method: 'put'
});
}
// 退出该群聊 (新版地图)
export function quitCoversition(group, conversationId) {
return request({
url: `/simulation/${group}/${conversationId}/exist`,
method: 'delete'
});
}

View File

@ -510,6 +510,9 @@ export default {
if ( typeof row.selectChange === 'function') {
row.selectChange && row.selectChange(form);
}
},
getFormModel() {
return this.formModel;
}
}
};

View File

@ -486,6 +486,13 @@ export default {
}
this.queryList.data = [...this.queryList.data];
},
getFormModel() {
if (this.$refs.queryForm) {
return this.$refs.queryForm.getFormModel();
} else {
return '';
}
},
sortChange(data) {
const self = this;
if (data.order && data.column.sortable == 'custom') {

File diff suppressed because one or more lines are too long

View File

@ -154,6 +154,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
let assetsdata = JSON.parse(netdata.data.sections);
if(assetsdata.link){
scope.datatype = "old";
// datanew();
// scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js");
// scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
// scope.Subscribe.socketon(scope.Subscribe.topic);
@ -165,7 +166,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
if(trainlisttest){
if(trainlisttest.group){
if(trainlisttest.group.children[0]){
console.log(trainlisttest.group.children[0].name);
// console.log(trainlisttest.group.children[0].name);
updatemmi.updatedrivingcode(trainlisttest.group.children[0].name);
scope.Subscribe.initdrivercode(trainlisttest.group.children[0].name);
for(let k in rails.switchrail){

View File

@ -100,6 +100,7 @@ export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) {
//
// }
// console.log(data);
// console.log(data);
switch (data.type) {
case 'Simulation_Driver_Change':
@ -113,6 +114,7 @@ export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) {
updatemmi.updatedrivingcode( data.body.code);
break;
case 'Simulation_TrainSpeed':
trainspeed(data);
break;
case 'SJL3D_TrainStatus':

View File

@ -98,6 +98,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
// console.log(data);
if(data.type == "Train_Position"){
// stats.update();
trainrun(data.body);
return;
}

View File

@ -48,6 +48,22 @@ var Staticmodel = {
picUrl: "",
assetUrl: "../../static/model/passflow/monitor.FBX"
},
train: {
id: "7",
name: "列车",
deviceType: "train",
type: "hrb",
picUrl: "",
assetUrl: "../../static/model/train/train.FBX"
},
section: {
id: "8",
name: "区段",
deviceType: "section",
type: "hrb",
picUrl: "",
assetUrl: "../../static/model/passflow/section.FBX"
},
}

View File

@ -38,7 +38,6 @@ let originhuman1 = null;
let originhuman2 = null;
let originanima1 = null;
let originanima2 = null;
let moveanimatelist = [];
let zhajiin = [];
let zhajiout = [];
@ -218,10 +217,6 @@ export function Jl3dpassflow(dom) {
this.selectmodel = null;
const Color = {
GROUND: new THREE.Color( 0x606060 ).convertGammaToLinear( 2.2 ).getHex(),
NAVMESH: new THREE.Color( 0xFFFFFF ).convertGammaToLinear( 2.2 ).getHex(),
};
const ZONE = 'level';
const SPEED = 10;
@ -233,12 +228,12 @@ export function Jl3dpassflow(dom) {
let groupID, path;
const playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
const targetPosition = new THREE.Vector3();
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let targetPosition = new THREE.Vector3();
const pathfinder = new THREE.Pathfinding();
const mouse = new THREE.Vector2();
const raycaster = new THREE.Raycaster();
let pathfinder = new THREE.Pathfinding();
let mouse = new THREE.Vector2();
let raycaster = new THREE.Raycaster();
var loader = new THREE.OBJLoader();
@ -250,9 +245,9 @@ export function Jl3dpassflow(dom) {
function ( object ) {
console.time('createZone()');
// console.time('createZone()');
const zone = THREE.Pathfinding.createZone(object.children[0].geometry);
console.timeEnd('createZone()');
// console.timeEnd('createZone()');
pathfinder.setZoneData( ZONE, zone );
@ -301,7 +296,6 @@ export function Jl3dpassflow(dom) {
console.log(intersects[0].point);
targetPosition.copy( intersects[0].point );
originhuman1.position.copy( playerPosition );
// Teleport on ctrl/cmd click or RMB.
if (event.metaKey || event.ctrlKey || event.button === 2) {
@ -320,28 +314,14 @@ export function Jl3dpassflow(dom) {
points.push(path[i]);
}
originhuman1.curve = new THREE.CatmullRomCurve3(points);
originhuman1.curve.curvrtype = "chordal";
originhuman1.curve.curvrtype = "centripetal";
originhuman1.progress = 0;
console.log(path);
}
function tick ( dt ) {
// if ( !level || !(path||[]).length ) return
//
// let targetPosition = path[ 0 ];
// const velocity = targetPosition.clone().sub( playerPosition );
//
// if (velocity.lengthSq() > 0.05 * 0.05) {
// velocity.normalize();
// // Move player to target
// playerPosition.add( velocity.multiplyScalar( dt * SPEED ) );
// // originhuman1.lookAt();
// originhuman1.position.copy( playerPosition );
// } else {
// // Remove node from the path we calculated
// path.shift();
// }
if(originhuman1.curve){
if(originhuman1.progress<1){
let point = originhuman1.curve.getPointAt(originhuman1.progress);
@ -383,7 +363,8 @@ export function Jl3dpassflow(dom) {
initstationanimation(scope.modelmanager.station.mesh);
initzhajiinaimation(scope.modelmanager.zhajiin.mesh);
initzhajioutanimation(scope.modelmanager.zhajiout.mesh);
scene.add(scope.modelmanager.section.mesh);
scene.add(scope.modelmanager.train.mesh);
level = scope.modelmanager.station.mesh;
monitor = scope.modelmanager.monitor.mesh;
@ -415,45 +396,6 @@ export function Jl3dpassflow(dom) {
scene.add(humanlist);
scene.add(scope.modelmanager.man1.mesh);
for(let i=0;i<200;i++){
var mantype = Math.floor(Math.random()*(3-1+1))+1;
let newhuman;
if(mantype == 1){
newhuman = THREE.SkeletonUtils.clone( originhuman1 );
newhuman.animations = [];
newhuman.animations.push(originanima1.clone());
}else{
newhuman = THREE.SkeletonUtils.clone( originhuman2 );
newhuman.animations = [];
newhuman.animations.push(originanima2.clone());
}
// zhajiin[j].waiting = 1;
let mixer = new THREE.AnimationMixer( newhuman );
mixer.runplay = false;
let action = mixer.clipAction( newhuman.animations[ 0 ] );
newhuman.status = 1;
newhuman.stage = 0;
let newone = {
id:i,
mesh:newhuman,
direct:null,
doorstatus:null,
doors:null,
action:action,
mixer:mixer,
runrail:null
};
humans.push(newone);
mixers.push(mixer);
humanlist.add(newhuman);
}
}
@ -466,8 +408,8 @@ export function Jl3dpassflow(dom) {
clearInterval(checkobject);
//进站控制
startWorker();
// stationwebwork.postMessage("on");
// passerwebwork.postMessage("on");
stationwebwork.postMessage("on");
passerwebwork.postMessage("on");
};
},1000);
@ -488,123 +430,40 @@ export function Jl3dpassflow(dom) {
}
}
function initpasser(){
for(let i=0;i<3;i++){
newhumancreate(stationzon.getinitposition("enter1"),0);
}
for(let i=0;i<3;i++){
newhumancreate(stationzon.getinitposition("enter2"),0);
}
for(let i=0;i<3;i++){
newhumancreate(stationzon.getinitposition("security"),1);
}
for(let i=0;i<2;i++){
newhumancreate(stationzon.getinitposition("entergate"),2);
}
for(let i=0;i<6;i++){
newhumancreate(stationzon.getinitposition("standtop"),3);
}
for(let i=0;i<6;i++){
newhumancreate(stationzon.getinitposition("standdown"),3);
}
for(let i=0;i<5;i++){
newhumancreate(stationzon.getinitposition("exitgate"),4);
}
console.log(humanlist);
}
function startWorker(){
initpasser();
passerwebwork.onmessage = function (event) {
if(humans){
// console.log(humans.length);
// console.log(humans.length);
for(let i=0;i<humans.length;i++){
// console.log(humans[i]);
if(humans[i].status == 0){
if(humans[i].stage == 1){
let points = [];
points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z));
points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z-5));
zhajicontrol("in",humans[i].doors);
moveanimateinit(humans[i],i,points,i,0.02);
}
if(humans[i].stage == 2){
let points = [];
points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z));
points.push(new THREE.Vector3(12,10,12.9));
points.push(new THREE.Vector3(28,1.7,12.9));
points.push(new THREE.Vector3(34,1.7,12.9));
//1--left
//2-- right
if(humans[i].direct == 1){
points.push(new THREE.Vector3(34,1.7,16));
for(let j =0;j<22;j++){
if(stationleft[j].waiting == 0){
points.push(new THREE.Vector3(51-j*5,1.7,22));
points.push(new THREE.Vector3(51-j*5,1.7,23));
humans[i].doors = j;
stationright[j].waiting = 1;
moveanimateinit(humans[i],i,points,i,0.002);
j =22;
}
}
}else{
points.push(new THREE.Vector3(34,1.7,16));
points.push(new THREE.Vector3(14,1.7,17));
points.push(new THREE.Vector3(14,1.7,3));
for(let j =0;j<22;j++){
if(stationright[j].waiting == 0){
points.push(new THREE.Vector3(51-j*5,1.7,3));
points.push(new THREE.Vector3(51-j*5,1.7,2));
humans[i].doors = j;
stationright[j].waiting = 1;
moveanimateinit(humans[i],i,points,i,0.002);
j =22;
}
}
}
moveanimateinit(humans[i],i,points,i,0.002);
}
//出站
if(humans[i].stage == 3){
let points = [];
points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z));
if(humans[i].doors<11){
if(humans[i].direct == 1){
points.push(new THREE.Vector3(10,1.7,17));
}else{
points.push(new THREE.Vector3(8,1.7,5));
}
points.push(new THREE.Vector3(8,1.7,13));
points.push(new THREE.Vector3(5,1.7,13));
points.push(new THREE.Vector3(-4,6,13));
}else{
if(humans[i].direct == 1){
points.push(new THREE.Vector3(-19,1.7,17));
}else{
points.push(new THREE.Vector3(-18,1.7,6.4));
}
points.push(new THREE.Vector3(-18,1.7,13));
points.push(new THREE.Vector3(-12,1.7,13));
points.push(new THREE.Vector3(-7,6.8,12));
}
points.push(new THREE.Vector3(-5,10,4));
points.push(new THREE.Vector3(14,10,3));
var j = Math.floor(Math.random()*(4-1+1))+1;
points.push(new THREE.Vector3(19,10,-2+j*1.4));
humans[i].doors = j;
moveanimateinit(humans[i],i,points,i,0.002);
}
if(humans[i].stage == 4){
let points = [];
points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z));
points.push(new THREE.Vector3(humans[i].mesh.position.x+4,humans[i].mesh.position.y,humans[i].mesh.position.z));
if(humans[i].direct == 1){
points.push(new THREE.Vector3(33,10,25));
}else{
points.push(new THREE.Vector3(33.5,10,-5));
}
zhajicontrol("out",humans[i].doors);
moveanimateinit(humans[i],i,points,i,0.002);
}
}
}
}
moveanimateupdate();
// delta = clock.getDelta();
// tick(delta);
passerai();
if(mixers[i]._actions[0].isRunning()){
mixers[i].update( delta );
}
delta = clock.getDelta();
// tick(delta);
for(let i=mixers.length-1;i>=0;i--){
if(mixers[i]._actions[0].isRunning()){
@ -615,9 +474,17 @@ export function Jl3dpassflow(dom) {
};
stationwebwork.onmessage = function (event) {
// console.log("stationwebwork");
if(humans.length<200){
newhumancreate();
// if(humans.length<200){
var direct = Math.floor(Math.random()*(3-1+1))+1;
//1--top
//2-- down
if(direct == 1){
newhumancreate(stationzon.getzoneposition("enter1"),0);
}else{
newhumancreate(stationzon.getzoneposition("enter2"),0);
}
// }
};
}
@ -632,125 +499,257 @@ export function Jl3dpassflow(dom) {
monitorrender();
}
delta = clock.getDelta();
tick(delta);
// delta = clock.getDelta();
// tick(delta);
requestAnimationFrame(animate);
}
function moveanimateinit(model,name,points,index,speed){
function passerai(){
for(let i=0;i<humanlist.children.length;i++){
// console.log(humans[i]);
if(humanlist.children[i].status == 0){
if(humanlist.children[i].stage == 0){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("security");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
moveanimateinit(humanlist.children[i],i,points,i);
// console.log(path);
}
if(humanlist.children[i].stage == 1){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("entergate");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
moveanimateinit(humanlist.children[i],i,points,i);
}
if(humanlist.children[i].stage == 2){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z-5));
// zhajicontrol("in",humans[i].doors);
moveanimateinit(humanlist.children[i],i,points,i);
}
if(humanlist.children[i].stage == 3){
var direct = Math.floor(Math.random()*(3-1+1))+1;
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
//1--top
//2-- down
if(direct == 1){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("standtop");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
}else{
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("standdown");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
}
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
moveanimateinit(humanlist.children[i],i,points,i);
}
// //出站
// if(humanlist.children[i].stage == 3){
// // let points = [];
// // points.push(new THREE.Vector3(humans[i].mesh.position.x,humans[i].mesh.position.y,humans[i].mesh.position.z));
// // if(humans[i].doors<11){
// // if(humans[i].direct == 1){
// // points.push(new THREE.Vector3(10,1.7,17));
// // }else{
// // points.push(new THREE.Vector3(8,1.7,5));
// // }
// // points.push(new THREE.Vector3(8,1.7,13));
// // points.push(new THREE.Vector3(5,1.7,13));
// // points.push(new THREE.Vector3(-4,6,13));
// // }else{
// // if(humans[i].direct == 1){
// // points.push(new THREE.Vector3(-19,1.7,17));
// // }else{
// // points.push(new THREE.Vector3(-18,1.7,6.4));
// // }
// // points.push(new THREE.Vector3(-18,1.7,13));
// // points.push(new THREE.Vector3(-12,1.7,13));
// // points.push(new THREE.Vector3(-7,6.8,12));
// // }
// // points.push(new THREE.Vector3(-5,10,4));
// // points.push(new THREE.Vector3(14,10,3));
// // var j = Math.floor(Math.random()*(4-1+1))+1;
// // points.push(new THREE.Vector3(19,10,-2+j*1.4));
// //
// // humans[i].doors = j;
// // moveanimateinit(humans[i],i,points,i,0.002);
// }
if(humanlist.children[i].stage == 4){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("exitgate");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
moveanimateinit(humanlist.children[i],i,points,i);
}
if(humanlist.children[i].stage == 5){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
points.push(new THREE.Vector3(humanlist.children[i].position.x+5,humanlist.children[i].position.y,humanlist.children[i].position.z));
// zhajicontrol("in",humans[i].doors);
moveanimateinit(humanlist.children[i],i,points,i);
}
if(humanlist.children[i].stage == 6){
var direct = Math.floor(Math.random()*(3-1+1))+1;
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
//1--top
//2-- down
if(direct == 1){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("exit1");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
}else{
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("exit2");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
}
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
}
moveanimateinit(humanlist.children[i],i,points,i);
}
}
}
}
function moveanimateinit(model,name,points,index){
model.status = 1;
let curve = new THREE.CatmullRomCurve3(points);
curve.curvrtype = "chordal";
curve.curvrtype = "centripetal";
// curve.getLength();
// curve动画轨迹
// progress动画进度
// enable当前动画开关
// speed动画速度
// console.log(curve);
let animate = {
name:index,
index:index,
curve:curve,
progress:0,
directchange:false,
enable:true,
status:"start",
speed:speed,
};
humans[index].runrail = animate;
humans[index].status = 1;
humans[index].action.play();
humans[index].mixer.runplay = true;
moveanimatelist.push(animate);
model.action.play();
model.progress = 0;
model.runrail = curve;
model.speed = 0.1/curve.getLength();
}
function moveanimateupdate(){
if(humans.length>0){
for(let i=0;i<humans.length;i++){
if(humans[i].runrail.enable){
// 动画播放结束
if(humans[i].runrail.progress>=1){
for(let i=0;i<humanlist.children.length;i++){
if(humanlist.children[i].status == 1){
if(humanlist.children[i].progress>=1){
// let point = humans[i].runrail.curve.getPointAt(1);
//更新模型坐标
// console.log(moveanimatelist);
if(humans[i].status == 1){
humans[i].runrail.enable = false;
humans[i].runrail.progress = 1;
humans[i].mixer.runplay = false;
humans[i].action.stop();
humans[i].status = 0;
if(humanlist.children[i].status == 1){
// humanlist.children[i].runrail.enable = false;
humanlist.children[i].progress = 1;
// humanlist.children[i].mixer.runplay = false;
humanlist.children[i].action.stop();
humanlist.children[i].status = 0;
if(humans[i].stage == 4){
humanlist.remove(humans[i].mesh);
// humans.splice(i,1);
}
if(humans[i].stage == 3){
if(humans[i].direct == 1){
stationleft[humans[i].doors].waiting = 0;
}else{
stationright[humans[i].doors].waiting = 0;
}
humans[i].stage = 4;
// if(humanlist.children[i].stage == 4){
//
// humanlist.remove(humanlist.children[i].mesh);
// // humans.splice(i,1);
// }
//
if(humanlist.children[i].stage == 6){
humanlist.remove(humanlist.children[i]);
// humanlist.children[i].stage = 7;
}
if(humans[i].stage == 2){
humans[i].stage = 3;
if(humanlist.children[i].stage == 5){
humanlist.children[i].stage = 6;
}
if(humanlist.children[i].stage == 4){
humanlist.children[i].stage = 5;
}
if(humanlist.children[i].stage == 3){
humanlist.children[i].stage = 4;
}
//
if(humanlist.children[i].stage == 2){
humanlist.children[i].stage = 3;
}
if(humans[i].stage == 1){
if(humanlist.children[i].stage == 1){
humans[i].stage = 2;
humanlist.children[i].stage = 2;
}
if(humans[i].stage == 0){
// console.log(humans[i].doors);
zhajiin[humans[i].doors].waiting = 0;
humans[i].stage = 1;
if(humanlist.children[i].stage == 0){
// // console.log(humans[i].doors);
// zhajiin[humanlist.children[i].doors].waiting = 0;
humanlist.children[i].stage = 1;
}
moveanimatelist.splice(i,1);
}
}else{
//根据动画进度获取动画轨迹上点
let point = humans[i].runrail.curve.getPointAt(humans[i].runrail.progress);
// console.log(i);
// console.log(humanlist.children[i].runrail);
// console.log(humanlist.children[i].progress);
let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress);
//更新模型坐标
humans[i].mesh.position.x = point.x;
humans[i].mesh.position.y = point.y;
humans[i].mesh.position.z = point.z;
if((humans[i].runrail.progress+0.001)<1){
let tangent = humans[i].runrail.curve.getPointAt(humans[i].runrail.progress+0.001);
humans[i].mesh.lookAt(new THREE.Vector3(tangent.x,humans[i].mesh.position.y,tangent.z));
humanlist.children[i].position.x = point.x;
humanlist.children[i].position.y = point.y;
humanlist.children[i].position.z = point.z;
if((humanlist.children[i].progress+0.001)<1){
let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001);
humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z));
}
humans[i].runrail.progress += humans[i].runrail.speed;
humanlist.children[i].progress += humanlist.children[i].speed;
point = null;
}
}
}
}
}
function newhumancreate(){
var direct = Math.floor(Math.random()*(3-1+1))+1;
function newhumancreate(position,stage,){
var mantype = Math.floor(Math.random()*(3-1+1))+1;
// console.log(direct);
let points = [];
let newhuman;
if(mantype == 1){
newhuman = THREE.SkeletonUtils.clone( originhuman1 );
@ -762,51 +761,21 @@ export function Jl3dpassflow(dom) {
newhuman.animations.push(originanima2.clone());
}
if(direct == 1|| direct == 2){
let testposition = stationzon.getzoneposition("enter1");
newhuman.position.set(32,10,25);
points.push(testposition);
points.push(new THREE.Vector3(26,10,21));
points.push(new THREE.Vector3(18,10,18));
}else{
let testposition = stationzon.getzoneposition("enter2");
newhuman.position.set(32,10,-5);
points.push(testposition);
points.push(new THREE.Vector3(26,10,12));
points.push(new THREE.Vector3(24,10,17));
points.push(new THREE.Vector3(18,10,18));
}
let j = Math.floor(Math.random()*(4-1+1))+1;
points.push(new THREE.Vector3(-0.5+j*1.4,10,18.5));
// zhajiin[j].waiting = 1;
let mixer = new THREE.AnimationMixer( newhuman );
mixer.runplay = false;
let action = mixer.clipAction( newhuman.animations[ 0 ] );
newhuman.position.copy(position);
newhuman.status = 0;
var stationdirection = Math.floor(Math.random()*(2-1+1))+1;
let newone = {
id:humans.length,
mesh:newhuman,
status:1,
stage:0,
direct:stationdirection,
doorstatus:null,
doors:j,
action:action,
mixer:mixer,
runrail:null
};
humans.push(newone);
newhuman.stage = stage;
newhuman.direct = null;
newhuman.doorstatus = null;
newhuman.doors = null;
newhuman.action = mixer.clipAction( newhuman.animations[ 0 ] );
newhuman.mixer = mixer;
newhuman.runrail = null;
newhuman.speed = 0;
mixers.push(mixer);
humanlist.add(newhuman);
moveanimateinit(newone,humans.length,points,newone.id,0.002);
// return newone;
}
function initstationanimation(object){

View File

@ -44,6 +44,22 @@ export function ModelManager(){
action:null
};
this.train = {
code:null,
screenDoorOpenStatus:"01",
mesh:null,
action:null
};
this.section = {
code:null,
screenDoorOpenStatus:"01",
mesh:null,
action:null
};
this.loadpromise = function (data,mixers){
let initlist = [];
initlist.push(fbxpromise(data.man1,mixers,scope.man1));
@ -52,6 +68,8 @@ export function ModelManager(){
initlist.push(fbxpromise(data.zhajiin,mixers,scope.zhajiin));
initlist.push(fbxpromise(data.zhajiout,mixers,scope.zhajiout));
initlist.push(fbxpromise(data.monitor,mixers,scope.monitor));
initlist.push(fbxpromise(data.train,mixers,scope.train));
initlist.push(fbxpromise(data.section,mixers,scope.section));
return new Promise(function(resolve, reject){

View File

@ -5,6 +5,7 @@ let enter1 = {
name : "enter1",
type : "normal",
stage : "0",
randompoint : new THREE.Vector3(26.6,9.8,-2.7),
railpoints : [
new THREE.Vector3(34,9.8,-6),
new THREE.Vector3(32,9.8,-6)
@ -16,6 +17,7 @@ let enter2 = {
name : "enter2",
type : "normal",
stage : "0",
randompoint : new THREE.Vector3(27,9.8,16),
railpoints : [
new THREE.Vector3(35,9.8,31.5),
new THREE.Vector3(31,9.8,31.5)
@ -27,6 +29,7 @@ let security = {
name : "security",
type : "device",
stage : "1",
randompoint : new THREE.Vector3(8.8,9.8,18),
railpoints : [
new THREE.Vector3(20.5,9.8,18),
new THREE.Vector3(21,9.8,21)
@ -38,6 +41,7 @@ let entergate = {
name : "entergate",
type : "device",
stage : "2",
randompoint : new THREE.Vector3(2.3,9.8,13),
railpoints : [
new THREE.Vector3(6.3,9.8,17.4),
new THREE.Vector3(4.8,9.8,17.4),
@ -52,6 +56,7 @@ let standtop = {
name : "standtop",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,0.38),
railpoints : [
new THREE.Vector3(52.1,1.77,-1.8),
new THREE.Vector3(-63.5,1.77,-1.8)
@ -63,6 +68,7 @@ let standdown = {
name : "standdown",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,21),
railpoints : [
new THREE.Vector3(52.1,1.77,24),
new THREE.Vector3(-64,1.77,24)
@ -74,6 +80,7 @@ let exitgate = {
name : "exitgate",
type : "device",
stage : "5",
randompoint : new THREE.Vector3(-16,9.8,-0.4),
railpoints : [
new THREE.Vector3(18.8,9.8,-0.27),
new THREE.Vector3(18.8,9.8,1.18),
@ -88,6 +95,7 @@ let exit1 = {
name : "exit1",
type : "normal",
stage : "6",
randompoint : new THREE.Vector3(),
railpoints : [
new THREE.Vector3(28.2,9.8,-7),
new THREE.Vector3(30.5,9.8,-7.4)
@ -99,6 +107,7 @@ let exit2 = {
name : "exit2",
type : "normal",
stage : "6",
randompoint : new THREE.Vector3(),
railpoints : [
new THREE.Vector3(28.3,9.8,28.8),
new THREE.Vector3(31.2,9.8,28.8)
@ -127,6 +136,44 @@ export function ZoneManager() {
scope.list[exit2.name] = new ZoneModel(exit2);
}
this.getinitposition = function(name){
// console.log(scope.list[name]);
let randompoint = new THREE.Vector3(0,scope.list[name].randompoint.y,0);
// console.log(randompoint);
if(name == "enter1"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*8;
randompoint.z = scope.list[name].randompoint.z + Math.random()*8;
}
if(name == "enter2"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*8;
randompoint.z = scope.list[name].randompoint.z + Math.random()*8;
}
if(name == "security"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*10;
randompoint.z = scope.list[name].randompoint.z + Math.random()*2;
}
if(name == "entergate"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*5;
randompoint.z = scope.list[name].randompoint.z - Math.random()*2;
}
if(name == "standtop"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*100;
randompoint.z = scope.list[name].randompoint.z + Math.random();
}
if(name == "standdown"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*100;
randompoint.z = scope.list[name].randompoint.z ;
}
if(name == "exitgate"){
randompoint.x = scope.list[name].randompoint.x + Math.random()*30;
randompoint.z = scope.list[name].randompoint.z + Math.random()*5;
}
// let random = Math.random();
return randompoint;
}
this.getzoneposition = function(name){
// let random = Math.random();
let position = scope.list[name].railline.getPointAt(Math.random());

View File

@ -7,6 +7,7 @@ export function ZoneModel(data) {
this.type = data.type;
this.stage = data.stage;
this.status = 0;
this.randompoint = data.randompoint;
//轨迹点
this.railpoints = data.railpoints;

View File

@ -66,12 +66,12 @@ export function Jlmap3dSubscribe(jlmap3d,routegroup,jsonwebwork) {
// if(event.data.type == 'Simulation_DeviceStatus'){
// devicestatus(event.data);
// }
// console.log(data);
if(event.data._type == 'Simulation_Driver_Change'){
drivingcode = event.data.body.code;
jlmap3d.updatedrivingcode( event.data.body.code);
}
if(event.data._type == 'Train'){
// console.log(event.data);
trainstatus(event.data);
}
if (event.data._type== 'Signal' && signallist) {

View File

@ -191,12 +191,12 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
scope.webwork.onmessage = function (event) {
//更新列车位置
// if(scope.datatype == "new"){
//
if(scope.datatype == "new"){
// UpdateTrainNew(camera,trainlisttest);
// }else{
// UpdateTrain(camera,trainlisttest);
// }
}else{
UpdateTrain(camera,trainlisttest);
}
if(camerarail.moveswitch == true){
// console.log(camerarail.progress);

View File

@ -8,6 +8,7 @@ export function Materialload(jlmap3dedit,assettype){
settexture( jlmap3dedit.materiallist,"black",'../../static/material/signal/5.jpg');
if(assettype){
if(assettype.stationtexture == "xian3"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/xian3list.jpg');
@ -69,6 +70,8 @@ export function Materialload(jlmap3dedit,assettype){
}
}
}
//console.log(jlmap3dedit.materiallist);
}

View File

@ -303,7 +303,7 @@ export default class Switch extends Group {
this.releaseBackground.hide();
break;
case '02':
this.relocShelter.getSection().animateStyle(true)
this.relocShelter && this.relocShelter.getSection().animateStyle(true)
.when(1000, { fill: this.style.backgroundColor })
.start();
break;

View File

@ -416,7 +416,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#870E10', // 道岔单锁'定位'颜色
monolockInversionColor: '#870E10', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -383,7 +383,8 @@ class SkinCode extends defaultStyle {
locateColor: 'lightgreen', // 道岔定位颜色
inversionColor: 'lightgreen', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -366,7 +366,8 @@ class SkinCode extends defaultStyle {
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -404,7 +404,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: '#c00000', // 道岔单锁'定位'颜色 (红色)
monolockInversionColor: '#c00000', // 道岔单锁'反位'颜色 (红色)
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -386,7 +386,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -413,7 +413,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#fff', // 道岔反位颜色
monolock: true, // 名称单锁显示包围框
monolockLocationColor: '#fff', // 道岔单锁'定位'颜色
monolockInversionColor: '#fff' // 道岔单锁'反位'颜色
monolockInversionColor: '#fff', // 道岔单锁'反位'颜色
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: true, // 道岔 关联区段显示

View File

@ -269,7 +269,8 @@ class SkinCode extends defaultStyle {
inversionColor: '#FFFF00', // 道岔反位颜色
monolockLocationColor: 'lightgreen', // 道岔单锁'定位'颜色 (浅绿色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -408,7 +408,9 @@ class SkinCode extends defaultStyle {
inversionColor: '#9C9D09', // 道岔反位颜色
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
block: true // 封锁名称
block: true, // 封锁名称
faultFlashing: false, // 故障闪烁
lossRect: true // 道岔失表矩形
},
sectionAction: {
flag: false, // 道岔 关联区段显示
@ -466,7 +468,7 @@ class SkinCode extends defaultStyle {
this[deviceType.SwitchFault] = {
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
text: {
fontSize: 11, // 字体大小
fontSize: 14, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
@ -603,7 +605,7 @@ class SkinCode extends defaultStyle {
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 42, y: 1}, // 列车车次号偏移
smallColor: '#70ECEE', // 小交路颜色
smallColor: '#00FFFF', // 小交路颜色
bigColor: '#FFFFFF', // 大交路颜色
inboundColor: '#00FF00', // 回库颜色
planTypeColor: '#FFFFFF' // 计划车颜色

View File

@ -436,7 +436,8 @@ class SkinCode extends defaultStyle {
locateColor: '#FFFFFF', // 道岔定位颜色
inversionColor: '#FFFFFF', // 道岔反位颜色
monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
monolockInversionColor: '#FFFF00' // 道岔单锁'反位'颜色 (黄色)
monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
faultFlashing: true // 故障闪烁
},
sectionAction: {
flag: false, // 道岔 关联区段显示

View File

@ -224,4 +224,7 @@ export default class SaidLamp extends Group {
this.isShowShape = false;
}
}
setControlColor(color) {
this.control && this.control.setControlColor(color);
}
}

View File

@ -47,6 +47,10 @@ class ESwLnversion extends Group {
this.relocShelter.stopAnimation(flag);
}
getSection() {
return this.relocShelter;
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);

View File

@ -50,6 +50,9 @@ class ESwLocal extends Group {
cb(child);
});
}
getLocal() {
return this.locShelter;
}
}
export default ESwLocal;

View File

@ -4,6 +4,7 @@
import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import JTriangle from '../../utils/JTriangle';
import ESwName from './ESwName.js';
import ESwLocal from './ESwLocal.js';
@ -105,7 +106,27 @@ export default class Switch extends Group {
onmouseover: () => { this.name.getArrowText().show(); },
onmouseout: () => { this.name.getArrowText().hide(); }
});
if (this.style.Switch.text.lossRect) {
const lossRect = this.locShelter.getLocal().getBoundingRect();
this.lossShow = new Rect({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x: lossRect.x - 5,
y: lossRect.y - 5,
width: lossRect.width + 10,
height: lossRect.height + 10
},
style: {
fill: 'rgba(0, 0, 0, 1)',
lineDash: [3, 3],
stroke: '#F00',
lineWidth: 2
}
});
this.add(this.lossShow);
this.lossShow.hide();
}
const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength;
const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1];
const Tspoint2 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]];
@ -268,6 +289,8 @@ export default class Switch extends Group {
this.locShelter.hide(); // 定位覆盖图形
this.relocShelter.hide(); // 反位覆盖图形
this.enabledName.hide(); // 使能隐藏
this.lossShow && this.lossShow.hide();
this.lossShow && this.lossShow.stopAnimation(false);
}
/** 定位*/
@ -298,7 +321,7 @@ export default class Switch extends Group {
}
/** 失去*/
setLossAction(nameFlicker) {
setLossAction() {
// this.recover();
this.locShelter.show();
this.relocShelter.show();
@ -306,9 +329,24 @@ export default class Switch extends Group {
this.sheltertriangle.show();
this.sheltertriangle.setColor(this.style.backgroundColor);
this.setTextColor(this.style.Switch.text.lossColor);
nameFlicker && this.nameTextAnimation();
}
this.style.Switch.text.faultFlashing && this.nameTextAnimation();
this.lossShow && this.lossShow.show();
this.lossShow && this.lossShow.animateStyle(true)
.when(0, { stroke: this.style.backgroundColor })
.when(500, { stroke: '#F00' })
.when(1000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(split) {
if (this.model.switchFaultCode && split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor('#F00');
} else if (this.model.switchFaultCode && !split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor(this.style.backgroundColor);
}
}
/** 挤叉*/
setForkAction() {
this.rhomboid.hide(); // 平行四边形
@ -424,10 +462,10 @@ export default class Switch extends Group {
if (this.model.normalPosition) {
this.releaseBackground.hide(); /** 定位*/
} else if (this.model.reversePosition) {
this.relocShelter.getSection().animateStyle(true)
this.relocShelter && this.relocShelter.getSection().animateStyle(true)
.when(1000, { fill: this.style.backgroundColor })
.start();
this.rhomboid.getSection().animateStyle(true)
this.rhomboid && this.rhomboid.getSection().animateStyle(true)
.when(1000, { fill: this.style.backgroundColor })
.start(); /** 反位*/
}
@ -479,8 +517,9 @@ export default class Switch extends Group {
} else if (model.reversePosition) {
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction(true);
this.setLossAction();
}
/** 道岔单锁 */
model.singleLock && this.setMonolock();
/** 道岔封锁 */
@ -490,6 +529,7 @@ export default class Switch extends Group {
// this.setForkAction(); // 道岔挤岔完成
// 道岔使能显示
model.isCiConfirm && this.setCiConfirm();
this.setSwitchFault(model.split);
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];

View File

@ -194,8 +194,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
textAlign: 'center',
textVerticalAlign: 'middle'
});
this.add(this.travelSigns);
}
@ -211,8 +211,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
textAlign: 'center',
textVerticalAlign: 'middle'
});
this.add(this.crewNum);
}
@ -228,8 +228,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
textAlign: 'center',
textVerticalAlign: 'middle'
});
this.add(this.travelNum);
}
@ -245,8 +245,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
textAlign: 'left',
textVerticalAlign: 'top'
textAlign: 'center',
textVerticalAlign: 'middle'
});
this.add(this.delayTime);
}
@ -307,6 +307,23 @@ export default class TrainBody extends Group {
return new BoundingRect(0, 0, 0, 0);
}
}
getBoundingRectOfFont() { // 获取文字宽度
if (this.textTrainServer) {
const tempRect = this.textTrainServer.getBoundingRect().clone();
return tempRect;
} else if (this.textTrainTarget) {
const tempRect = this.textTrainTarget.getBoundingRect().clone();
return tempRect;
} else if (this.textTrainNumber) {
const tempRect = this.textTrainNumber.getBoundingRect().clone();
return tempRect;
} else if (this.textTrainTargetNumber) {
const tempRect = this.textTrainTargetNumber.getBoundingRect().clone();
return tempRect;
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
setPlanRoutingTypeColor(planRoutingTypes) {
if (planRoutingTypes === 'BIG') {
this.style.Train.trainTarget.bigColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.bigColor});

View File

@ -18,10 +18,10 @@ export default class TrainHead extends Group {
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.point.x - baseMargin * (style.Train.trainHead.trainConntWidth),
x: model.point.x - baseMargin * (style.Train.trainHead.trainConntWidth * model.scale),
y: model.point.y,
width: style.Train.trainHead.trainConntWidth * model.scale,
height: style.Train.trainHead.trainHeadRectHeight
height: model.height || style.Train.trainHead.trainHeadRectHeight * model.scale
},
style: {
lineWidth: 0.1,
@ -31,15 +31,18 @@ export default class TrainHead extends Group {
});
this.add(this.line);
}
const height = model.height / 2;
const startX = model.point.x + model.drect * (style.Train.trainHead.trainConntWidth * model.scale);
const points = [
[startX + model.drect * 2 * model.scale, (model.point.y + height)],
[startX + model.drect * -2 * model.scale, (model.point.y + height) + height],
[startX + model.drect * -2 * model.scale, (model.point.y + height) - height]
];
this.arrow = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points: [
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleFirst.x), model.point.y + style.Train.trainHead.trainHeadTriangleFirst.y],
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleSecond.x), model.point.y + style.Train.trainHead.trainHeadTriangleSecond.y],
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleThird.x), model.point.y + style.Train.trainHead.trainHeadTriangleThird.y]
]
points: points
},
style: {
lineWidth: 0.1,

View File

@ -87,6 +87,8 @@ export default class Train extends Group {
dt: model.dt,
model: model
});
const rect = this.trainB.getBoundingRectOfFont().clone();
const height = rect.height;
this.trainL = new TrainHead({
style: style,
zlevel: this.zlevel,
@ -96,6 +98,8 @@ export default class Train extends Group {
y: this.point.y
},
drect: -1,
height: height,
fontSize: this.fontSize,
scale: this.newScale
});
@ -108,6 +112,8 @@ export default class Train extends Group {
y: this.point.y
},
drect: 1,
height: height,
fontSize: this.fontSize,
scale: this.newScale
});

View File

@ -63,7 +63,7 @@ export default {
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.relStationCodeList && station.relStationCodeList.length) {
if (station.relStationCodeList && station.ciStation && station.relStationCodeList.length) {
const node = {
label: station.name,
children: []

View File

@ -93,7 +93,7 @@ export default {
operation: '',
planMode: 5,
headMode: 5,
fontSize: 16
fontSize: 30
};
},
computed: {

View File

@ -36,7 +36,7 @@ class Model {
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
nameFontSize: 30 // 字体大小
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true

View File

@ -150,6 +150,48 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.powerLineList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];
if (cnodeSection && lnodeSection && rnodeSection) {
cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code];
const sectionParent = mapDevice[cnodeSection.parentCode];
if (sectionParent) {
sectionParent['switch'] = mapDevice[elem.code];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[0].x,
y: cnodeSection.points[0].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[rnodeSection.points.length - 2].x,
y: rnodeSection.points[rnodeSection.points.length - 2].y
};
} else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[cnodeSection.points.length - 1].x,
y: cnodeSection.points[cnodeSection.points.length - 1].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[1].x,
y: rnodeSection.points[1].y
};
}
const section = mapDevice[cnodeSection.parentCode];
if (section) {
mapDevice[elem.code].sectionName = section.name;
mapDevice[elem.code].sectionParentCode = section.code;
section['relSwitchCode'] = elem.code;
}
rnodeSection['layer'] = -1;
}
}, this);
zrUtil.each(data.indicatorLightList || [], elem => {
switch (elem.type) {
case 'AtsControl':
@ -205,6 +247,7 @@ export function parser(data, skinCode, showConfig) {
break;
case 'SwitchFault':
mapDevice[elem.code] = createDevice(deviceType.SwitchFault, elem, propConvert, showConfig);
mapDevice[elem.switchCode].switchFaultCode = elem.code; // 道岔数据上关联道岔故障表示灯需保证该数据在switchList之后处理
break;
}
}, this);
@ -218,49 +261,6 @@ export function parser(data, skinCode, showConfig) {
}
}
}, this);
zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];
if (cnodeSection && lnodeSection && rnodeSection) {
cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code];
const sectionParent = mapDevice[cnodeSection.parentCode];
if (sectionParent) {
sectionParent['switch'] = mapDevice[elem.code];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[0].x,
y: cnodeSection.points[0].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[rnodeSection.points.length - 2].x,
y: rnodeSection.points[rnodeSection.points.length - 2].y
};
} else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[cnodeSection.points.length - 1].x,
y: cnodeSection.points[cnodeSection.points.length - 1].y
};
mapDevice[elem.code].skew = {
x: rnodeSection.points[1].x,
y: rnodeSection.points[1].y
};
}
const section = mapDevice[cnodeSection.parentCode];
if (section) {
mapDevice[elem.code].sectionName = section.name;
mapDevice[elem.code].sectionParentCode = section.code;
section['relSwitchCode'] = elem.code;
}
rnodeSection['layer'] = -1;
}
}, this);
}
return mapDevice;

View File

@ -134,6 +134,7 @@ const CompetitionDetail = () => import('@/views/jsxt/competition/examDetail');
const CompetitionManage = () => import('@/views/jsxt/competition/index');
const CompetitionHome = () => import('@/views/jsxt/competition/home');
const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index');
const RefereeResult = () => import('@/views/jsxt/competition/theory/result');
const JsxtExamResult = () => import('@/views/jsxt/competition/result');
const JsxtApply = () => import('@/views/jsxt/apply/index');
// const theoryManage = () => import('@/views/jsxt/competition/theory/index');
@ -1042,10 +1043,15 @@ export const JSXT = [
]
},
{
path: '/jsxt/theory/detail/:id',
path: '/jsxt/theory/detail',
component: Refereedetail,
hidden: true
},
{
path: '/jsxt/theory/result', // 考试结果页面
component: RefereeResult,
hidden: true
},
// 裁判系统
{
path: '/refereeJsxt',

View File

@ -32,7 +32,7 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
loginPath: '/designgzb/login'
},
hyd: {
title: '城市轨道交通实训平台',
title: '城市轨道交通综合行车模拟仿真系统',
loginPath: '/login'
},
designhyd: {

View File

@ -29,6 +29,15 @@ function handle(state, data) {
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
break;
case 'Simulation_Start_Conversation': // 综合演练仿真-聊天界面用户邀请其他人加入群聊
state.inviteOtherIntoChat = msg;
break;
case 'Simulation_Accept_Conversation': // 综合演练仿真-聊天界面用户接受被邀请
state.acceptInviteChat = msg;
break;
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
state.quitCoversition = msg;
break;
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
break;
@ -160,9 +169,7 @@ function handleSimulationInfo(state, data) {
member:data.member,
memberOnline:data.member.online,
chatTime: data.chatTime,
targetOnline:data.targetMember ? data.targetMember.online : null,
targetName:data.targetMember ? data.targetMember : 'All',
targetRole:data.targetMember ? data.targetMember.role : null,
targetUser:data.targetMember ? data.targetMember : 'All',
all: data.all,
date: +new Date(`${myDate1} ${chatTime}`)
};
@ -213,7 +220,10 @@ const socket = {
simulationStart: '', // 仿真-开始消息
simulationOver:0, // 退出仿真推送消息
simulationReset: '', // 仿真-异常消息
simulationText: {}, // 仿真-用户交互消息(聊天/命令)
simulationText: {}, // 仿真-用户交互消息(聊天/命令),
inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息
acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请,
quitCoversition:{}, // 综合演练仿真-聊天界面用户退出群聊推送消息,
// coversitionList:{}, // 历史仿真-用户消息列表
message: {}, // 仿真聊天

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -2,15 +2,72 @@
<div class="emergency_release">
<div class="emergency_release_header">
<div class="emergency_header_text">中心PIS紧急信息一览</div>
<el-table :data="tableData" :header-cell-style="headerCellStyle" :cell-style="cellStyle" :height="'60%'" style="width: 94%; position: relative;left: 3%;">
<el-table-column prop="time" label="时间" width="150" />
<el-table-column prop="description" label="信息描述" />
<el-table-column prop="level" label="等级" />
</el-table>
<div style="margin-top: 10px;width: 100%;">
<div style="width: 75%;background: #FFF;padding: 2px;display: inline-block;vertical-align:top;margin-left: 3%">
<div style="width: 100%;text-align: center;font-size: 13px;padding-top:5px;">显示内容</div>
<div style="width:100%; height: 100px; border: 1px solid #000;" />
</div>
<div style="width: 15%;background: #939FAC; display: inline-block;margin-left: 2%;">
<div class="emergency_select_button">区域详细</div>
<div style="width: 100%;text-align: center;color: #FFF;font-size: 13px;background: #121A86;height: 30px;line-height: 30px;">紧急信息清除</div>
<div class="emergency_select_button">清除</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name:'EmergencyRelease',
data() {
return {
tableData: [],
headerCellStyle: {background: '#121A86', height: '25px', color: '#FFF'},
cellStyle: {height:'25px'}
};
}
};
</script>
<style lang="scss" scoped>
.emergency_release{padding:20px;}
.emergency_release{padding:20px;height: 100%;}
.emergency_release_header{height: 100%;}
.emergency_header_text{margin-top:10px;text-align: center;color: #9af1ec;font-size: 18px;padding-bottom: 10px;}
.emergency_select_button {
text-align: center;
width: 90px;
height: 30px;
background: #A9A9A9;
border-top: 2px solid #FFF;
border-left: 2px solid #FFF;
border-right: 2px solid #898888;
border-bottom: 2px solid #898888;
margin: 10px auto 5px;
font-size: 14px;
line-height: 30px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.emergency_select_button:active {
border-top: 2px solid #898888;
border-left: 2px solid #898888;
border-right: 2px solid #FFF;
border-bottom: 2px solid #FFF;
}
/deep/
.el-table th{
padding: 0;
}
/deep/
.el-table td{
padding: 0;
}
</style>

View File

@ -3,7 +3,7 @@
<div class="lcdControl_title">LCD控制屏</div>
<div class="area_select" style="margin-top: 110px;">
<div class="area_select_title">特定区域</div>
<div class="area_select_button">全线</div>
<div class="area_select_button" @click="selectedAllArea">全线</div>
</div>
<div class="area_select" style="margin-top: 200px;">
<div>
@ -15,21 +15,28 @@
</div>
<div class="lcd_content_box">
<div style="display: inline-block;">
<div style="display: inline-block;position:absolute;width: 50px;z-index: 2;background: #45607B;">
<div class="lcd_content_box_left_title">车站</div>
<div class="lcd_content_box_left_title">选择</div>
</div>
<div style="width: 100%; overflow-x: auto;white-space: nowrap;height: 100%;">
<div style="position: relative; left: 50px;">
<div v-for="(station, index) in stationList" :key="index" style="display: inline-block;text-align: center;">
<div class="each_station_info">{{ station }}</div>
<div class="each_station_info" @click="selectedArea(station)">{{ station }}</div>
<div class="button_default_content">
<div class="button_default" :style="{background:selectedAreaList.includes(station.stationName + '-' + index)?'#2EFF74':'#CDCDCD'}" />
<div class="button_default" :style="{background:selectedAreaList.includes(station)?'#2EFF74':'#CDCDCD'}" @click="selectedArea(station)" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getByGroupStationList } from '@/api/jmap/map';
export default {
name:'LcdControl',
data() {
return {
columns: ['车站', '选择'],
@ -37,6 +44,35 @@ export default {
lcdSwitch: true,
selectedAreaList:[]
};
},
async created () {
// 线
try {
const res = await getByGroupStationList(this.$route.query.group);
if (res.code == 200) {
this.stationList = [];
res.data.forEach(station => {
if (!station.depot) {
this.stationList.push(station.name);
}
});
}
} catch (e) {
this.$message.error('获取车站列表失败!');
}
},
methods: {
selectedArea(station) {
const index = this.selectedAreaList.indexOf(station);
if (index < 0) {
this.selectedAreaList.push(station);
} else {
this.selectedAreaList.splice(index, 1);
}
},
selectedAllArea() {
this.selectedAreaList = [...this.stationList];
}
}
};
</script>
@ -79,9 +115,19 @@ export default {
margin: 5px 12px 10px;
font-size: 14px;
line-height: 30px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.area_select_button:active {
border-top: 2px solid #898888;
border-left: 2px solid #898888;
border-right: 2px solid #FFF;
border-bottom: 2px solid #FFF;
}
.each_station_info{
/*display: inline-block;*/
vertical-align:top;
font-size: 13px;
padding: 2px 2px;
@ -91,6 +137,11 @@ export default {
border-right: 2px solid #898888;
border-bottom: 2px solid #898888;
margin-right: 5px;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.lcd_content_box{
margin-top: 110px;
@ -103,14 +154,12 @@ export default {
border-right: 3px solid #fff;
border-bottom: 3px solid #fff;
padding-top: 10px;
padding-left: 10px;
overflow-x: auto;
}
.lcd_content_box_left_title{
vertical-align:top;
font-size: 13px;
color: #CBFFFF;
padding: 10px 10px 5px;
padding: 5px 10px 10px;
}
.button_default_content{
margin-top: 5px;

View File

@ -103,6 +103,7 @@ export default {
},
async created () {
// 线
try {
const res = await getByGroupStationList(this.$route.query.group);
if (res.code == 200) {
this.stationList = [];
@ -121,6 +122,10 @@ export default {
}
});
}
} catch (e) {
this.$message.error('获取车站列表失败!');
}
},
methods:{
showInfoBrroadcast() {

View File

@ -138,6 +138,7 @@ import axios from 'axios';
}
},
updatetrainlist(){
console.log(this.group);
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;

View File

@ -3,11 +3,11 @@
<div id="jl3d" class="jl3ddraw">
</div>
<!-- <div class="menutop">
<div class="menutop">
<el-button-group>
<el-button type="primary" @click="switchrender">{{rendermode}}</el-button>
</el-button-group>
</div> -->
</div>
<div class="menudown">
<el-button-group>
<el-button type="primary" @click="back">退出</el-button>
@ -18,7 +18,7 @@
</template>
<script>
import Vue from 'vue';
import { Jl3dpassflow } from '@/jlmap3d/jl3dpassflow/jl3dpassflow.js';
import { Jl3dpassflow } from '@/jlmap3d/jl3dpassflow/jl3dpassflownew.js';
import { ProjectIcon } from '@/scripts/ProjectConfig';
export default {

View File

@ -160,7 +160,8 @@ export default {
this.resultFlag = false;
const res = await getRaceUserById(this.$route.query.raceId);
if (this.$route.query.type == 'theory' && (res.data.status == 4 || res.data.status == 5)) {
this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
// this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
} else if (this.$route.query.type == 'operation' && (res.data.status == 4 || res.data.status == 6)) {
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
} else {
@ -171,7 +172,7 @@ export default {
if (this.$route.query.type == 'theory') {
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
if (resp.data) {
this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}?raceId=${this.$route.query.raceId}`);
this.$router.push(`/jsxt/theory/detail?raceId=${this.$route.query.raceId}`);
} else {
this.$messageBox('试卷还没被加载');
}

View File

@ -1,29 +0,0 @@
<template>
<div class="">
理论首页
<el-button @click="startExam">开始考试</el-button>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
mapId: ''
};
},
created() {
this.mapId = this.$route.params.id;
},
methods: {
startExam() {
this.$router.push(`/jsxt/theory/detail/${this.mapId}`);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -0,0 +1,116 @@
<template>
<div class="question">
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
<template v-if="checkType(option, 'judge')">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
<span>{{ el.content }}</span>
</el-radio>
</el-radio-group>
</template>
<template v-else-if="checkType(option, 'select')">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
<span>{{ $asc2chart(i+65) }}. </span>
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
</el-radio>
</el-radio-group>
</template>
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: ''
},
option: {
type: Object,
required: true
}
},
data() {
return {
answer: 0
};
},
watch: {
value(val) {
this.changeValue();
}
},
mounted() {
this.changeValue();
},
methods: {
changeValue() {
this.answer = parseInt(this.value);
},
checkType(option, type) {
return option.type == type;
},
appendIndex(str, index, option) {
let result = '';
const i = option.optionList.findIndex(ele => ele.correct);
if (option.type === 'select') {
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${this.$asc2chart(i + 65)})</span>`;
}
} else if (option.type === 'judge') {
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${option.optionList[i].content})</span>`;
}
}
this.$set(option, 'rightAnswer', option.optionList[i].id);
//
return `${index + 1}. ${str} ${result}`;
},
onChnage(e) {
const answer = `${e}`;
this.$emit('input', answer);
this.$emit('save', {userExamQuestionId: this.option.id, answer: answer});
}
}
};
</script>
<style lang="scss" scoped>
.rich-text {
padding: 0;
display: inline;
}
.question {
/deep/ {
.ql-editor {
line-height: 26px;
padding: 0;
}
.el-radio {
color: #000;
}
.el-radio__label {
font-size: 16px;
line-height: 26px;
}
.el-radio-group .is-disabled .el-radio__label{
color: #333;
}
.select-box.el-radio-group .is-checked.is-disabled .el-radio__label{
color: red;
}
}
}
</style>

View File

@ -14,7 +14,7 @@
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;float: left;color:#F00;font-size: 12px;">温馨提示考试过程中请不要刷新或关闭本页面</div>
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;float: left;color:#F00;font-size: 12px;">温馨提示考试过程中请退出或关闭本页面不会终止计时</div>
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;margin-right: 10px;font-weight:bold;">{{ '剩余时间:'+countdownTime }}</div>
<el-button-group class="buttons">
<el-button v-loading="loading" type="primary" @click="commit"> </el-button>
@ -28,6 +28,7 @@
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import Question from './question';
import localStore from 'storejs';
import { postCompetitionTheory, getTheoryQuestion, quitCurrentRace } from '@/api/competition';
export default {
@ -51,7 +52,7 @@ export default {
passScore: 10
},
examQuestions: [],
theoryAnswers: [],
theoryAnswersMap: {},
countdownTime: '00:00:00',
theoryExamTime: 0,
countdown: null
@ -100,15 +101,32 @@ export default {
},
methods: {
loadInitData() {
this.theoryAnswers = [];
// this.theoryAnswers = [];
this.theoryAnswersMap = {};
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
const storeAnswersKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
const storeAnswers = localStore.get(storeAnswersKey);
if (storeAnswers) {
this.theoryAnswersMap = storeAnswers;
}
if (resp.data) {
this.examQuestions = resp.data.questions.map((el, i) => {
el.index = i;
el.answer = this.theoryAnswersMap[el.id];
return el;
});
this.theoryExamTime = resp.data.theoryExamTime * 60;
this.countdownTime = this.computationTime(this.theoryExamTime);
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
const startTime = localStore.get(storeKey);
if (startTime) {
const dt = new Date().getTime() - startTime;
this.theoryExamTime = resp.data.theoryExamTime * 60 - Math.floor(dt / 1000);
} else {
const storeValue = new Date().getTime();
localStore.set(storeKey, storeValue);
}
this.countdown = setInterval(() => {
if (this.theoryExamTime <= 0) {
if (this.countdown) {
@ -157,20 +175,28 @@ export default {
}
},
doEnd() {
const theoryAnswers = [];
for (const key in this.theoryAnswersMap) {
theoryAnswers.push({questionId: key, answerOptionId: this.theoryAnswersMap[key]});
}
const params = {
competitionId: this.$route.query.raceId,
theoryAnswers: this.theoryAnswers
theoryAnswers: theoryAnswers
};
postCompetitionTheory(params).then(()=>{
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
this.$router.push({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
});
},
onSave(data) {
// console.log(data, '');
this.theoryAnswers.push({
answerOptionId: data.answer,
questionId: data.userExamQuestionId
});
// this.theoryAnswers.push({
// answerOptionId: data.answer,
// questionId: data.userExamQuestionId
// });
this.theoryAnswersMap[data.userExamQuestionId] = data.answer;
// console.log(data, '', this.theoryAnswers, this.theoryAnswersMap);
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
localStore.set(storeKey, this.theoryAnswersMap);
},
computationTime(time) {
let hours = Math.floor(time / 3600);

View File

@ -0,0 +1,200 @@
<template>
<el-container class="quiz">
<el-container class="quiz__container">
<el-header class="quiz__container-header layer-center">
<div class="titles">考试结果</div>
</el-header>
<el-main class="quiz__container-main layer-center">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length">
<div class="caption">{{ index2UnicodeList[i] }}{{ el.title }}</div>
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
</template>
</div>
<div style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span>
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<el-button-group class="buttons">
<el-button v-loading="loading" type="primary" @click="commit">返回首页</el-button>
</el-button-group>
</el-footer>
</el-container>
</el-container>
</template>
<script>
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import Question from './question';
// import { getTheoryQuestion } from '@/api/competition';
import { getCompetitionDetail } from '@/api/competition';
export default {
components: {
Question
},
mixins: [
// WindowResizeHandler
],
data() {
return {
index: 0,
height: 0,
loading: false,
formModel: {
description: '',
duration: 10,
name: '',
status: '',
totalScore: 0,
passScore: 10
},
totalScore: 0,
examQuestions: []
};
},
computed: {
examId() {
return this.$route.params.examId;
},
userExamId() {
return this.$route.params.userExamId;
},
question() {
return this.examQuestions[this.index] || {};
},
index2UnicodeList() {
return ['一', '二', '三', '四'];
},
sortedList() {
return [
{
title: '判断题',
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
},
{
title: '选择题',
children: this.examQuestions.filter(el => { return el.type === 'select'; })
}
];
}
},
watch: {
'$router': function() {
this.loadInitData();
}
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
getCompetitionDetail(this.$route.query.raceId).then((resp)=>{
if (resp.data) {
resp.data.forEach((item, i) => {
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
});
this.totalScore = resp.data.reduce((pre, ver) => pre + ver.score, 0);
}
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
},
returnTop() {
document.querySelector('.el-header').scrollIntoView(true);
},
commit() {
if (this.$route.query.result) {
const query = { raceId:this.$route.query.raceId };
this.$router.push({path: `/refereeJsxt/home`, query: query });
} else {
const query = { raceId:this.$route.query.raceId };
this.$router.push({path: `/jsxt/home`, query: query });
}
}
}
};
</script>
<style lang="scss" scoped>
.layer-center {
width: 900px;
height: 100%;
margin: auto;
background: #fff;
padding-top: 0;
}
.quiz {
background: #eee;
height: 100%;
&::-webkit-scrollbar {
display:none
}
&__card {
height: 100%;
.dir-item {
padding-left: 25px;
}
.dir-caption {
padding-left: 10px;
line-height: 26px;
background: #f1f1f1;
}
}
&__container {
height: 100%;
&-header {
height: auto !important;
.titles {
font-size: 24px;
line-height: 60px;
font-weight: bold;
text-align: center;
margin: 0 auto;
}
.notes {
color:#606266;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 20px;
}
}
&-main {
.section {
padding: 5px 20px;
.caption {
line-height: 26px;
}
.context {
}
}
}
&-footer {
text-align: right;
position: sticky;
bottom: 0px;
padding: 40px ;
.buttons {
position: relative;
bottom: 20px;
}
}
}
}
</style>

View File

@ -58,11 +58,12 @@ export default {
getTestPaperDatail(data.raceId).then(res => {
this.theoryScore = res.data.theoryScore;
this.practicalScore = res.data.practicalScore;
console.log(data);
this.info = {
raceId: data.raceId,
userId: data.userId,
theoryScore: data.theoryScore,
practiceScore: data.practiceScore
theoryScore: data.artificialTheoryScore || data.theoryScore,
practiceScore: data.artificialPracticeScore || data.practiceScore
};
});
},
@ -75,8 +76,8 @@ export default {
const data = {
raceId: this.info.raceId,
userId: this.info.userId,
theoryScore: this.info.theoryScore,
practiceScore: this.info.practiceScore
artificialTheoryScore: Number(this.info.theoryScore),
artificialPracticeScore: Number(this.info.practiceScore)
};
putRefereeScoring(data).then(res => {
this.doClose();

View File

@ -39,7 +39,6 @@ export default {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
afterQuery:this.afterQuery,
columns: [
{
title: '名字',
@ -70,11 +69,17 @@ export default {
},
{
title: '理论分数',
prop: 'theoryScore'
prop: 'theoryScore',
type: 'tag',
columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || '0'; },
tagType: (row) => { return 'success'; }
},
{
title: '实操分数',
prop: 'practiceScore'
prop: 'practiceScore',
type: 'tag',
columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || '0'; },
tagType: (row) => { return 'success'; }
},
{
title: '总分',
@ -98,7 +103,13 @@ export default {
showControl: (row) => { return row.status == '3'; }
},
{
name: '回放',
name: '理论结果',
handleClick: this.handleTheoryResult,
type: '',
showControl: (row) => { return row.status == '5'; }
},
{
name: '实操回放',
handleClick: this.playBack,
type: '',
showControl: (row) => { return row.status == '4'; }
@ -136,7 +147,8 @@ export default {
return statusDict[status];
},
getData() {
const params = {raceId:this.$route.query.raceId, pageSize:999, pageNum:1};
const formModel = this.$refs.queryListPage.getFormModel();
const params = {raceId:this.$route.query.raceId, pageSize:999, pageNum:1, name: formModel ? formModel.name : '', organization: formModel ? formModel.organization : ''};
getRaceUserList(params).then(response=>{
this.queryList.data = response.data.list;
this.refresh();
@ -148,6 +160,9 @@ export default {
}, 2000);
});
},
handleTheoryResult() {
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
},
handleAdd() {
const loading = this.$loading({
lock: true,
@ -164,7 +179,7 @@ export default {
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
console.log(JSON.parse(data));
// console.log(JSON.parse(data));
loadingPaper(that.$route.query.raceId, JSON.parse(data)).then(res => {
that.$message.success('试题加载成功');
loading.close();
@ -196,14 +211,6 @@ export default {
gradeScore(index, row) { //
this.$refs.editScore.doShow(row);
},
// afterQuery(data) {
// clearTimeout(this.inter);
// this.inter = setTimeout(() => {
// if (!this.isLeaving) {
// this.refresh();
// }
// }, 3000);
// },
refresh() {
this.$refs.queryListPage.refresh(false);
}

View File

@ -69,7 +69,7 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import { UrlConfig } from '@/scripts/ConstDic';
import { ProjectIcon } from '@/scripts/ProjectConfig';
import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig';
import { removeToken } from '@/utils/auth';
import LangStorage from '@/utils/lang';
import logoImgHyd from '@/assets/project_icon/logo_hyd.png';
@ -121,7 +121,7 @@ export default {
lang: 'zh',
language: '中文',
logoImg: logoImgHyd,
title: '城市轨道交通实训平台'
title: ''
};
},
computed: {
@ -151,7 +151,9 @@ export default {
},
mounted() {
if (this.project.startsWith('design')) {
this.title = '城市轨道交通设计平台';
this.title = loginInfo['designhyd'].title;
} else {
this.title = loginInfo['hyd'].title;
}
document.title = this.title;
},

View File

@ -10,7 +10,7 @@
<div class="userBubble" @click="playAudio('audio'+index)">
<div class="userMessage">
<!-- &&!(chatContent.self) -->
<span v-if="chatContent.all">@{{ covertName(chatContent.targetName) }}</span>
<span v-if="chatContent.all">@{{ covertName(chatContent.targetUser) }}</span>
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.message }}</span>
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
@ -78,7 +78,7 @@ export default {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
coversition.targetName = coversition.targetMember ? coversition.targetMember : 'All';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
@ -103,6 +103,20 @@ export default {
},
covertName(data) {
if (data != 'All') {
if (data instanceof Array) {
let result = '';
data.forEach(each=>{
result += this.covertEachName(each);
});
return result;
} else {
return this.covertEachName(data);
}
} else {
return '@All';
}
},
covertEachName(data) {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
@ -118,10 +132,7 @@ export default {
});
const deviceName = data.deviceName ? '-' + data.deviceName : '';
const memberName = data.name ? '-' + data.name : '';
return data.role + deviceName + memberName;
} else {
return 'All';
}
return '@' + data.role + deviceName + memberName;
},
playAudio(id) {
document.querySelector('#' + id).play();

View File

@ -102,7 +102,7 @@ export default {
this.checkList = [];
}
}).catch(error=>{
this.$messageBox('创建会话失败: ' + error.messagfe);
this.$messageBox('创建会话失败: ' + error.message);
this.loading = false;
this.dialogVisible = false;
this.checkList = [];

View File

@ -12,6 +12,7 @@
:offset-bottom="offsetBottom"
:group="group"
:quest-id="questId"
:user-role="userRole"
@tryTime="tryTime"
@hidepanel="hidepanel"
@quitQuest="quitQuest"
@ -151,6 +152,17 @@ export default {
// return this.$route.query.prdType;
return this.$store.state.training.prdType;
},
userRole() {
if (this.prdType == '02') {
return 'DISPATCHER';
} else if (this.prdType == '01') {
return 'STATION_SUPERVISOR';
} else if (this.prdType == '04') {
return 'DRIVER';
} else {
return 'AUDIENCE';
}
},
isDemon() {
return this.mode === 'demon';
},

View File

@ -188,7 +188,8 @@ export default {
'04': '02', // =>
'05': '' // => null
},
dataError: false
dataError: false,
planRunning:false
};
},
computed: {
@ -278,10 +279,14 @@ export default {
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = '';
// this.mapBox = document.getElementsByTagName('canvas');
if (this.planRunning) {
this.$store.dispatch('training/simulationStart');
}
if (this.trainingId) {
getTrainingStepsDetailNew(this.trainingId, { group: this.group }).then(resp => {
this.trainingObj = resp.data;
this.$store.dispatch('training/setTrainingData', this.trainingObj);
}).catch(error => {
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
});
@ -434,7 +439,7 @@ export default {
this.questId = Number(resp.data.questId) || 0;
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
if (resp.data.planRunning) {
this.$store.dispatch('training/simulationStart');
this.planRunning = resp.data.planRunning;
} else {
this.$store.dispatch('training/over');
}

View File

@ -13,8 +13,8 @@
style="height: 100%;"
>
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
<div class="topTrainListInfo">下行列车详细信息</div>
<el-table :data="topTrainList" height="45%" :highlight-current-row="true" @row-click="selectTrain">
<div class="bottomTrainListInfo">下行列车详细信息</div>
<el-table :data="bottomTrainList" height="45%" :highlight-current-row="true" @row-click="selectTrain">
<el-table-column property="groupNumber" label="车组号" width="70" />
<el-table-column property="tripNumber" label="车次号" width="70" />
<el-table-column property="destinationCode" label="目的地号" width="100" />
@ -163,7 +163,7 @@ export default {
// padding: 5px;
background: #fff;
}
.topTrainListInfo{
.topTrainListInfo,.bottomTrainListInfo{
padding: 10px 10px;
background: #cde2ef;
font-size: 13px;

View File

@ -152,7 +152,9 @@ export default {
}
},
'$store.state.map.showCentralizedStationNum': function (val) {
if (this.$store.state.map.showCentralizedStationCode) {
this.setShowStation(this.$store.state.map.showCentralizedStationCode);
}
},
'$store.state.training.offsetStationCode': function(code) {
if (code && this.localStationShow && this.$store.state.training.prdType === '01') {
@ -433,8 +435,14 @@ export default {
let list = [];
nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
if (item === 'trainList') {
this.$store.state.map.map[item].forEach(elem => {
elem && list.push(elem);
});
} else {
list = [...list, ...this.$store.state.map.map[item]];
}
}
});
this.$jlmap.updateShowStation(list, stationCode);
!isTraining && this.setCenter(stationCode);

View File

@ -1,201 +0,0 @@
<template>
<div class="chat-coversition">
<div id="coversition-list-name" />
<div class="coversition-list">
<div
v-for="coversition in coversitionList"
:key="coversition.id"
:class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'"
@click="changeCoversition(coversition)"
>{{ coversition.coverName }}</div>
</div>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {getSimulationConversationListNew} from '@/api/chat';
export default {
name:'ChatCoversitionList',
data() {
return {
coversitionList:[],
currentCoversition:{}
};
},
mounted() {
this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
data.map(coversition=>{
if (coversition.name) {
coversition.coverName = coversition.name;
coversition.isOnline = true;
} else {
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
}
return coversition;
});
this.coversitionList = data;
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
}
}
});
},
addCoversition(data) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
const objectCover = this.handleMemberName(data);
if (data.name) {
data.coverName = data.name;
data.isOnline = true;
} else {
data.coverName = objectCover.coversitionName;
data.isOnline = objectCover.isOnline;
}
this.coversitionList.push(data);
this.currentCoversition = data;
}
},
changeCoversition(coversition) {
this.$emit('setHeadTitle', coversition.coverName);
this.currentCoversition = {id:coversition.id, all:coversition.all};
this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition);
},
changeCoversitionOther(coversition) {
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
if (index < 0) {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
handleMemberName(conversition) {
if (conversition.all) {
return {coversitionName:conversition.name, isOnline:true};
} else {
let coversitionName = '';
let isOnline = true;
if (conversition.memberList) {
conversition.memberList.forEach(member=>{
if (member.userId != this.$store.state.user.id) {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
let data = member.role;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
isOnline = member.online;
coversitionName = data + deviceName + memberName;
}
});
} else if (conversition.member) {
const member = conversition.member;
let data = member.role;
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
isOnline = member.online;
coversitionName = data + deviceName + memberName;
} else {
coversitionName = conversition.name;
}
return {coversitionName:coversitionName, isOnline:isOnline};
}
}
}
};
</script>
<style lang="scss" scoped>
.chat-coversition{
width: 100px;
display: inline-block;
border-right: 1px #dedede solid;
height: 100%;
vertical-align: top;
background: #f9f9f9;
border-radius: 5px 0px 0px 5px;
}
.coversition-list{
padding: 3px 0px 10px 0px;
height: 355px;
overflow: auto;
margin-top:40px;
}
.each-coversition{
font-size: 14px;
padding: 10px 7px 10px 10px;
border-bottom: 1px #dedede solid;
cursor: pointer;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.coversition-active{
background: #e0e0e0;
}
// safariqq360
//
.coversition-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.coversition-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -2,9 +2,9 @@
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<chat-coversition-list ref="chatCoversitionList" :group="group" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
@ -43,6 +43,7 @@
</div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
<chat-create-group ref="createGroup" :group="group" @addCoversition="addCoversition" />
<chat-tooltip :group="group" @getCoversitionList="getCoversitionList" />
</div>
</template>
<script>
@ -51,6 +52,7 @@ import ChatContent from './chatContent';
import ChatMemberList from './chatMemberList';
import ChatCoversitionList from './chatCoversitionList';
import ChatCreateGroup from './chatCreateGroup';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
import {uploadAudioFileNew} from '@/api/chat';
export default {
@ -60,7 +62,8 @@ export default {
ChatContent,
ChatMemberList,
ChatCoversitionList,
ChatCreateGroup
ChatCreateGroup,
ChatTooltip
},
props: {
group: {
@ -81,6 +84,7 @@ export default {
inter:null,
recorders: null,
microphone:null,
isHasCoversition:false,
form:{
language:'zh',
sex:'1'
@ -90,7 +94,7 @@ export default {
},
computed:{
isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE';
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
}
},
mounted() {
@ -110,11 +114,12 @@ export default {
setSetting(data) {
this.form = data;
},
getCoversitionList() {
this.$refs.chatCoversitionList.initPage(false);
},
setCurrentCoversition(coversition) {
this.currentCoversition = coversition;
if (coversition.all) {
this.headerTitle = coversition.name;
}
if (this.recordSending) {
this.cancleRecording();
}
@ -123,8 +128,15 @@ export default {
setHeadTitle(headerTitle) {
this.headerTitle = headerTitle;
},
hideAddCoversition() {
this.isHasCoversition = true;
},
showAddCoverition() {
this.isHasCoversition = false;
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data);
this.isHasCoversition = true;
this.currentCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},

View File

@ -5,13 +5,13 @@
<div :class="chatContent.self?'rightUser':'leftUser'">
<div class="userHeader">
<!-- chatContent.all&& -->
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.member,false) }}</div>
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
</div>
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
<div class="userMessage">
<!-- chatContent.all&& -->
<span v-if="!chatContent.member.robot">@{{ covertName(chatContent.targetName) }}</span>
<span v-if="!chatContent.member.robot&&chatContent.all">{{ covertName(chatContent.targetUser,true) }}</span>
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.message }}</span>
</div>
@ -102,7 +102,7 @@ export default {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
coversition.targetName = coversition.targetMember ? coversition.targetMember : 'All';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
@ -141,8 +141,22 @@ export default {
};
});
},
covertName(data) {
covertName(data, status) {
if (data != 'All') {
if (data instanceof Array) {
let result = '';
data.forEach(each=>{
result += this.covertEachName(each, status);
});
return result;
} else {
return this.covertEachName(data, status);
}
} else {
return '@All';
}
},
covertEachName(data, status) {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
@ -158,9 +172,10 @@ export default {
});
const deviceName = data.deviceName ? '-' + data.deviceName : '';
const memberName = data.name ? '-' + data.name : '';
return data.role + deviceName + memberName;
if (status) {
return '@' + data.role + deviceName + memberName;
} else {
return 'All';
return data.role + deviceName + memberName;
}
},
playAudio(audioUrl) {

View File

@ -0,0 +1,161 @@
<template>
<div class="chat-coversition">
<div id="coversition-list-name" />
<div class="coversition-list">
<div
v-for="coversition in coversitionList"
:key="coversition.id"
:class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'"
@click="changeCoversition(coversition)"
>
<div class="coversitionName">{{ coversition.name }}</div>
<div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" />
</div>
</div>
</div>
</template>
<script>
import {getSimulationConversationListNew, quitCoversition} from '@/api/chat';
export default {
name:'ChatCoversitionList',
props: {
group: {
type: String,
required: true
}
},
data() {
return {
coversitionList:[],
currentCoversition:{}
};
},
mounted() {
this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
this.coversitionList = data;
if (resp.data.length >= 2) {
this.$emit('hideAddCoversition');
}
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
const coversition = data.filter(coversition=>{ return coversition.all == false; });
this.currentCoversition = coversition[0];
this.$emit('setCurrentCoversition', coversition[0]);
}
}
});
},
addCoversition(data) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
this.coversitionList.push(data);
this.currentCoversition = data;
}
},
changeCoversition(coversition) {
this.$emit('setHeadTitle', coversition.name);
this.currentCoversition = {id:coversition.id, all:coversition.all};
this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition);
},
changeCoversitionOther(coversition) {
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
if (index < 0) {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
closeCoversition(coversitionId) {
quitCoversition(this.group, coversitionId).then(res=>{
this.initPage(true);
this.$emit('showAddCoverition');
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.chat-coversition{
width: 100px;
display: inline-block;
border-right: 1px #dedede solid;
height: 100%;
vertical-align: top;
background: #f9f9f9;
border-radius: 5px 0px 0px 5px;
}
.coversition-list{
padding: 3px 0px 10px 0px;
height: 355px;
overflow: auto;
margin-top:40px;
}
.each-coversition{
font-size: 14px;
padding: 10px 7px 10px 10px;
border-bottom: 1px #dedede solid;
cursor: pointer;
}
.coversition-active{
background: #e0e0e0;
}
.coversitionName{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: inline-block;
width: 60px;
font-size: 14px;
}
.closeConversition{
vertical-align: top;
margin-top: 2px;
}
// safariqq360
//
.coversition-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.coversition-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -1,5 +1,6 @@
<template>
<div v-show="dialogVisible" class="chat-create-group">
<div v-show="dialogVisible" class="chat-create-group-all">
<div class="chat-create-group">
<div class="create-group-header">
<div class="create-group-title">添加会话对象</div>
<div class="create-group-close">
@ -35,6 +36,7 @@
<el-button size="small" @click="doClose">取消</el-button>
</div>
</div>
</div>
</template>
<script>
import {getSimulationMembersNew, getSimulationConversationIdNew} from '@/api/chat';
@ -102,7 +104,7 @@ export default {
this.checkList = [];
}
}).catch(error=>{
this.$messageBox('创建会话失败: ' + error.messagfe);
this.$messageBox('创建会话失败: ' + error.message);
this.loading = false;
this.dialogVisible = false;
this.checkList = [];
@ -118,6 +120,14 @@ export default {
};
</script>
<style lang="scss" scoped>
.chat-create-group-all{
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
z-index:10;
}
.chat-create-group{
position: absolute;
width: 70%;

View File

@ -46,6 +46,12 @@ export default {
if (val) {
this.getSimulationMembers();
}
},
'$store.state.socket.acceptInviteChat':function(val) {
this.getSimulationMembers();
},
'$store.state.socket.quitCoversition':function(val) {
this.getSimulationMembers();
}
},
mounted() {

View File

@ -0,0 +1,110 @@
<template>
<div v-show="dialogVisible" class="chatTooltipAll">
<div class="chatTooltip">
<div class="chatTooltipHeader">
{{ userName }} 邀请您加入会话
</div>
<div class="chatTooltipBootom">
<div class="create-group-bottom">
<el-button :loading="loading" size="small" type="primary" @click="doCreate">接受</el-button>
<el-button size="small" @click="doClose">拒绝</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {acceptCoversitionInvite} from '@/api/chat';
export default {
name:'ChatTooltip',
props: {
group: {
type: String,
required: true
}
},
data() {
return {
userName:'',
dialogVisible:false,
loading:false,
conversationId:''
};
},
watch:{
'$store.state.socket.inviteOtherIntoChat':function(val) {
this.userName = this.coverName(val);
this.dialogVisible = true;
this.conversationId = val.conversationId;
}
},
// {"conversationId":"22e10b17-7a6c-4b1b-8724-f87fb2053b76","from":{"id":"17","userId":"75","name":"",
// "role":"STATION_SUPERVISOR","deviceType":"STATION","deviceCode":"Station32955","deviceName":"","online":true,"robot":false}
methods:{
coverName(inviteUser) {
const member = inviteUser.from;
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
let data = member.role;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
return data + deviceName + memberName;
},
doCreate() {
this.loading = true;
acceptCoversitionInvite(this.group, this.conversationId).then(res=>{
this.loading = false;
this.dialogVisible = false;
this.$emit('getCoversitionList');
}).catch(error=>{
this.$messageBox('接受邀请失败: ' + error.message);
});
},
doClose() {
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
.chatTooltip{
position: absolute;
width: 290px;
left: 32%;
top: 42%;
z-index: 5;
background: #fff;
padding: 15px;
box-shadow: #969090 0px 0px 10px;
border-radius: 4px;
line-height: 20px;
transform: translateY(-50%);
}
.chatTooltipHeader{
margin-top:10px;
font-size:14px;
}
.chatTooltipBootom{
margin-top:10px;
text-align: center;
margin-bottom:10px;
}
.chatTooltipAll{
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
z-index: 10;
}
</style>

View File

@ -26,7 +26,7 @@
<script>
import QrCode from '@/components/QrCode';
import ChatBox from './chatBox';
import ChatBox from './chatView/chatBox';
import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
import { exitFullscreen } from '@/utils/screen';

View File

@ -13,8 +13,8 @@
style="height: 100%;"
>
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
<div class="topTrainListInfo">下行列车详细信息</div>
<el-table :data="topTrainList" height="45%" :highlight-current-row="true" @row-click="selectTrain">
<div class="bottomTrainListInfo">下行列车详细信息</div>
<el-table :data="bottomTrainList" height="45%" :highlight-current-row="true" @row-click="selectTrain">
<el-table-column property="groupNumber" label="车组号" width="70" />
<el-table-column property="tripNumber" label="车次号" width="70" />
<el-table-column property="destinationCode" label="目的地号" width="100" />
@ -163,7 +163,7 @@ export default {
// padding: 5px;
background: #fff;
}
.topTrainListInfo{
.topTrainListInfo,.bottomTrainListInfo{
padding: 10px 10px;
background: #cde2ef;
font-size: 13px;

View File

@ -111,19 +111,20 @@ export default {
'stationStandList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
}
},
// watch: {
// signalList: function (val, old) {
// const list = [];
// if (val && val.length) {
// for (let i = 0; i < val.length; i++) {
// list.push({ label: val[i].uniqueName, value: val[i].code });
// }
// this.queryForm.queryObject.signalCode.config.data = list;
// }
// }
// },
mounted() {
this.acquireMapList();
this.initQueryObject();
},
methods: {
doShow() {
@ -133,6 +134,16 @@ export default {
doClose() {
this.show = false;
},
initQueryObject() {
const list = [];
const val = this.signalList;
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -155,36 +155,35 @@ export default {
'stationList'
])
},
watch: {
stationList: function (val, old) {
const list = [];
if (val && val.length) {
val.forEach(elem => {
list.push({ label: this.formatName(elem.code), value: elem.code });
});
this.queryForm.queryObject.startStationCode.config.data = list;
this.queryForm.queryObject.endStationCode.config.data = list;
}
},
sectionList: function (val, old) {
const list = [];
if (val && val.length) {
val.forEach(elem => {
list.push({ label: this.formatName(elem.code), value: elem.code });
});
this.queryForm.queryObject.startSectionCode.config.data = list;
this.queryForm.queryObject.endSectionCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
this.initQueryObject();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
initQueryObject() {
const stationList = [];
if (this.stationList && this.stationList.length) {
this.stationList.forEach(elem => {
stationList.push({ label: this.formatName(elem.code), value: elem.code });
});
this.queryForm.queryObject.startStationCode.config.data = stationList;
this.queryForm.queryObject.endStationCode.config.data = stationList;
}
const sectionList = [];
if (this.sectionList && this.sectionList.length) {
this.sectionList.forEach(elem => {
if (elem.standTrack || elem.reentryTrack || elem.transferTrack) {
sectionList.push({ label: this.formatName(elem.code), value: elem.code });
}
});
this.queryForm.queryObject.startSectionCode.config.data = sectionList;
this.queryForm.queryObject.endSectionCode.config.data = sectionList;
}
},
doClose() {
this.show = false;
},

View File

@ -158,26 +158,27 @@ export default {
'stationList'
])
},
watch: {
sectionList: function (val, old) {
const list = [];
if (val && val.length) {
val.forEach(elem => {
list.push({ label: `${elem.name}(${elem.code})`, value: elem.code });
});
this.queryForm.queryObject.startSectionCode.config.data = list;
this.queryForm.queryObject.endSectionCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
this.initQueryObject();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
initQueryObject() {
const sectionList = [];
if (this.sectionList && this.sectionList.length) {
this.sectionList.forEach(elem => {
if (elem.standTrack || elem.reentryTrack || elem.transferTrack) {
sectionList.push({ label: this.formatName(elem.code), value: elem.code });
}
});
this.queryForm.queryObject.startSectionCode.config.data = sectionList;
this.queryForm.queryObject.endSectionCode.config.data = sectionList;
}
},
doClose() {
this.show = false;
},

View File

@ -105,19 +105,9 @@ export default {
'signalList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].name + '(' + val[i].code + ')', value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
this.initQueryObject();
},
methods: {
doShow() {
@ -127,6 +117,16 @@ export default {
doClose() {
this.show = false;
},
initQueryObject() {
const list = [];
const val = this.signalList;
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].name + '(' + val[i].code + ')', value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -219,9 +219,9 @@ export default {
for (const index in wb.Sheets) {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
}
// console.log(jsonData, '');
console.log(jsonData, '解析后数据');
if (that.$route.query.lineCode == '02') {
if (that.$route.query.lineCode == '02' && !jsonData[0].downTrack && !jsonData[0].upTrack) {
that.loadingDig.close();
that.$message.warning(`运行图暂无默认上行折返轨或默认下行折返轨,请输入`);
} else {

View File

@ -45,7 +45,7 @@ export default {
},
maxWidth: {
type: Number,
require: true
default: 0
},
maxHeight: {
type: Number,
@ -205,6 +205,11 @@ export default {
indexKmRangeMap: {}
};
},
computed: {
...mapGetters('runPlan', [
'stations'
])
},
watch: {
maxWidth() {
this.setPosition();
@ -232,11 +237,6 @@ export default {
this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]);
}
},
computed: {
...mapGetters('runPlan', [
'stations'
])
},
mounted() {
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
},
@ -247,6 +247,7 @@ export default {
serviceNumberChange(row) {
if (row) {
this.$store.dispatch('runPlan/setSelected', { serviceNumber: row.serviceNumber, tripNumber: null });
this.renderTripNumber({ serviceNumber: row.serviceNumber, tripNumber: null });
const serviceObj = this.$store.state.runPlan.editData[row.serviceNumber];
if (serviceObj) {
this.analyticalTripNumber(serviceObj.trainMap);
@ -256,6 +257,7 @@ export default {
tripNumberChange(row) {
if (row) {
this.$store.dispatch('runPlan/setSelected', { serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
this.renderTripNumber({ serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
}
},
async analyticalServiceNumber(data) {
@ -426,6 +428,39 @@ export default {
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
},
renderTripNumber(params) {
const tripNumber = params.tripNumber; //
const serviceNumber = params.serviceNumber; //
let data;
const op = this.myChart.getOption();
op.series.forEach((item, index) => {
if (item.name == serviceNumber && item.data) {
const temp = item.data.filter(elem => elem[3] == tripNumber);
if (temp.length) {
data = temp;
}
}
if (item.name == 'trainLabel') {
op.series.pop();
this.myChart && this.myChart.setOption(op, true);
}
});
op.series.push({
name: 'trainLabel',
lineStyle: {
color: '#000',
width: 2,
type: 'solid'
},
z: 10,
type: 'line',
data: data
});
setTimeout(() => {
this.myChart && this.myChart.setOption(op, true);
}, 50);
},
mouseClick(params) {
const model = {
serviceNumber: params.seriesName

Binary file not shown.

View File

@ -675,7 +675,7 @@ function timedCount(){
// postMessage(data);
// }
//
console.log(e.data);
// console.log(e.data);
if(e.data.type == "init"){
topic = e.data.topic;
@ -695,7 +695,7 @@ function timedCount(){
function callback(Response) {
// console.log(Response);
data = JSON.parse(Response.body);
console.log(data);
// console.log(data);
if(data.type == 'SJL3D_TrainStatus'){
for (let i=0,leni = data.body.length; i<leni; i++) {
postMessage(data.body[i]);