Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-05-23 17:26:16 +08:00
commit cf6f018929
168 changed files with 6742 additions and 1609 deletions

View File

@ -1,5 +1,5 @@
# just a flag
NODE_ENV = 'Local'
NODE_ENV = 'production'
VUE_APP_PRO = 'local'
# base api

View File

@ -1,5 +1,5 @@
# just a flag
NODE_ENV = 'test'
NODE_ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'

View File

@ -82,7 +82,9 @@ export default {
},
subscribeMessage(res) {
if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) {
this.$refs.deomonTopic.doShow(res);
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') {
this.$refs.deomonTopic.doShow(res);
}
this.$store.dispatch('socket/setRoomInvite');
}
},

View File

@ -36,3 +36,73 @@ export function participantCompleteCompetition(id, group) {
method: 'post'
});
}
/** 分页获取地图下的实操列表 */
export function getQuestionListByMapId(params) {
return request({
url: `/api/v1/competitionPractical`,
method: 'get',
params
});
}
// 加载实操及内容
export function loadQuestionList(competitionId, data) {
return request({
url: `api/v1/competitionPractical/competition/${competitionId}/distribute`,
method: 'post',
data
});
}
/** 竞赛报名 */
export function postSignUp(id, data) {
return request({
url: `/api/race/${id}/signUp`,
method: 'post',
data
});
}
/** 查询用户是否已经报名该竞赛 */
export function getIsSignUp(raceId) {
return request({
url: `/api/race/${raceId}/isSignUp`,
method: 'get'
});
}
/** 分页查询竞赛报名人员 */
export function getRaceUserList(params) {
return request({
url: `/api/race/${params.raceId}/raceUser`,
method: 'get',
params
});
}
/** 分页查询理论题列表 */
export function getCompetitionTheory(params) {
return request({
url: `/api/v1/competitionTheory`,
method: 'get',
params
});
}
/** 提交试卷 */
export function postCompetitionTheory(theoryId, data) {
return request({
url: `/api/v1/competitionTheory/${theoryId}/submit`,
method: 'post',
data
});
}
/** 查询用户是否已经报名该竞赛 */
export function getCompetitionPractical(competitionId) {
return request({
url: `/api/v1/competitionPractical/competition/${competitionId}`,
method: 'get'
});
}

40
src/api/practical.js Normal file
View File

@ -0,0 +1,40 @@
import request from '@/utils/request';
/** 创建实操 */
export function createPractical(data) {
return request({
url: `/api/v1/competitionPractical`,
method: 'post',
data: data
});
}
/** 加载实操及内容 */
export function loadingPractical(data) {
return request({
url: `/api/v1/competitionPractical/distribute`,
method: 'post',
data: data
});
}
/** 查询地图下的实操列表 */
export function getPracticalListByMapId(mapId) {
return request({
url: `/api/v1/competitionPractical/map/${mapId}`,
method: 'get'
});
}
/** 删除实操 */
export function deletePractical(practicalId) {
return request({
url: `/api/v1/competitionPractical/${practicalId}`,
method: 'delete'
});
}
/** 更新实操 */
export function updatePractical(practicalId, data) {
return request({
url: `/api/v1/competitionPractical/{practicalId}`,
method: 'put',
data: data
});
}

26
src/api/race.js Normal file
View File

@ -0,0 +1,26 @@
import request from '@/utils/request';
/** 分页查询竞赛 */
export function getRaceList(params) {
return request({
url: `/api/race`,
method: 'get',
params: params
});
}
/** 创建竞赛 */
export function createRace(data) {
return request({
url: `/api/race`,
method: 'post',
data
});
}
/** 修改竞赛信息 */
export function updateRace(id, data) {
return request({
url: `/api/race/${id}`,
method: 'put',
data
});
}

BIN
src/assets/apply.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

BIN
src/assets/applyAlready.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -78,6 +78,25 @@
>{{ item.message }}</span>
</el-form-item>
</template>
<template v-else-if="checkFieldType(item, 'tel')">
<div :key="item.prop" class="form_box" :prop="item.prop">
<div class="title" :style="{width: form.labelWidth}">
<span v-if="item.required" class="required_box">*</span>{{ item.label }}
</div>
<div>
<el-form-item :prop="item.prop" :required="item.required">
<el-input v-model="formModel[item.prop]" :placeholder="item.placeholder" maxlength="11" class="input_box" />
</el-form-item>
<el-form-item :prop="item.propCode" :required="item.required">
<el-input v-model="formModel[item.propCode]" :placeholder="item.placeholderCode" class="code_box" style="width: 40%;" />
<el-button style="margin-left: 10px;" :disabled="item.mobileCodeTime != 0" @click="item.buttonClick">
获取验证码
<span v-if="item.mobileCodeTime">{{ item.mobileCodeTime }}</span>
</el-button>
</el-form-item>
</div>
</div>
</template>
<template v-else-if="checkFieldType(item, 'button')">
<el-form-item :key="item.prop" :label="item.label" :style="item.style">
<el-button
@ -99,9 +118,9 @@
<template v-else-if="checkFieldType(item, 'checkBox')">
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
<el-radio-group v-model="formModel[item.prop]">
<el-radio v-for="item in item.children" :key="item.value" :label="item.value">{{item.name}}</el-radio>
</el-radio-group>
<el-radio-group v-model="formModel[item.prop]">
<el-radio v-for="item in item.children" :key="item.value" :label="item.value">{{ item.name }}</el-radio>
</el-radio-group>
</el-form-item>
</template>
<template v-else-if="checkFieldType(item, 'radio')">
@ -331,6 +350,7 @@ export default {
},
data() {
return {
mobileCodeTime: 0
};
},
methods: {
@ -393,6 +413,14 @@ export default {
margin: 0;
}
}
.form_box{
overflow: hidden;
}
.required_box{
// content: '*';
color: #F56C6C;
margin-right: 4px;
}
.coordinate {
overflow: hidden;

View File

@ -76,5 +76,6 @@ export default {
iscsDraw: 'Iscs Draw',
iscsSystem: 'Iscs System',
studentManage: 'Student manage',
examDetail: 'Exam detail'
examDetail: 'Exam detail',
raceManage: 'Race manage'
};

View File

@ -80,5 +80,7 @@ export default {
competitionManage: '竞赛管理',
refereeJManage: '仿真管理',
homeJsxt: '首页',
examDetail: '考试详情'
examDetail: '考试详情',
raceManage: '竞赛管理',
recaList: '报名列表'
};

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,18 @@ var Staticmodel = {
deviceType: "stationstand",
type: "low",
picUrl: "",
assetUrl: "../../static/model/device/stationstand/stationstandhrb.FBX"
assetUrl: "../../static/model/device/stationstand/stationstand.FBX"
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
//../../static/model/device/stationstand.FBX
},
section: {
id: "4",
name: "区段",
deviceType: "section",
type: "low",
picUrl: "",
assetUrl: "../../static/model/device/section/section.FBX"
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
//../../static/model/device/stationstand.FBX

View File

@ -4,14 +4,18 @@ import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
import { Standtextureload } from '@/jlmap3d/jl3ddevice/standtextureload.js';
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import StompClient from '@/utils/sock';
var clock = new THREE.Clock();
export function Jl3ddeviceNew(dom,group,token) {
export function Jl3ddeviceNew(dom,group,token,skinCode) {
var scope = this;
this.dom = dom;
@ -24,6 +28,8 @@ export function Jl3ddeviceNew(dom,group,token) {
let helpbox,textplane;
let daochamodel;
let psdtexturemap = [];
//点击事件状态
this.raycasterstatus = false;
//动画状态
@ -33,6 +39,7 @@ export function Jl3ddeviceNew(dom,group,token) {
//当前动画播放模型
this.animationmodel = null;
this.stationtexture = [];
this.devicetext = new Textconfig();
this.windowstatus = '0';
@ -90,6 +97,7 @@ export function Jl3ddeviceNew(dom,group,token) {
this.controls.update();
document.addEventListener( "mousedown", onselect, false );
let teststomp = new StompClient();
@ -134,11 +142,29 @@ export function Jl3ddeviceNew(dom,group,token) {
this.anime = null;
this.modelmanager = new ModelManager();
this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
animate();
})
getPublish3dMapDetail(skinCode).then(netdata => {
setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets));
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map =scope.stationtexture["pingbimen"];
scope.modelmanager.standmodel.mesh.getObjectByName("pingbimen1").material.map.needsUpdate = true;
animate();
})
});
function setpsdstationmap(stationlist){
for(let i=0,leni=stationlist.length;i<leni;i++){
psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
}
}
//循环渲染函数
function animate() {
@ -199,10 +225,14 @@ export function Jl3ddeviceNew(dom,group,token) {
}
if (data._type == "Psd") {
console.log(data);
scope.modelmanager.standmodel.code = data.code;
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
if(scope.showmodel){
scope.resetmodel();
@ -245,6 +275,9 @@ export function Jl3ddeviceNew(dom,group,token) {
if (data._type == "Psd") {;
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
initstatus(data);
}

View File

@ -26,11 +26,19 @@ export function ModelManager(){
action:null
};
this.sectionmodel = {
code:"section",
sectionstatus:"01",
mesh:null,
action:null
};
this.loadpromise = function (data,mixers){
let initlist = [];
initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel));
initlist.push(fbxpromise(data.Signal,mixers,scope.signalmodel));
initlist.push(fbxpromise(data.stationstand,mixers,scope.standmodel));
initlist.push(fbxpromise(data.section,mixers,scope.sectionmodel));
return new Promise(function(resolve, reject){

View File

@ -0,0 +1,113 @@
export function Standtextureload(jlmap3dedit,assettype){
if(assettype.stationtexture == "xian3"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg');
}
}
if(assettype.stationtexture == "haerbin1"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg');
}
}
//console.log(jlmap3dedit.materiallist);
}
function settexture(materiallist,name,textureurl){
var loader = new THREE.TextureLoader();
// 加载一个资源
loader.load(
// 资源URL
textureurl,
// onLoad回调
function ( texture ) {
texture.name = name;
materiallist.push(texture);
},
// 目前暂不支持onProgress的回调
undefined,
// onError回调
function ( err ) {
console.error( 'An error happened.' );
}
);
}
function setstationtexture(stationtexture,name,textureurl){
var loader = new THREE.TextureLoader();
// 加载一个资源
loader.load(
// 资源URL
textureurl,
// onLoad回调
function ( texture ) {
texture.name = name;
stationtexture[name] = texture;
},
// 目前暂不支持onProgress的回调
undefined,
// onError回调
function ( err ) {
console.error( 'An error happened.' );
}
);
}

View File

@ -0,0 +1,681 @@
import { Staticmodel } from '@/jlmap3d/jl3ddevice/config.js';
//loader
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
import { Standtextureload } from '@/jlmap3d/jl3ddevice/standtextureload.js';
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import StompClient from '@/utils/sock';
var clock = new THREE.Clock();
export function Jl3dfaultdevice(dom,group,token,skinCode) {
var scope = this;
this.dom = dom;
this.nowcode = null;
this.animateswitch = false;
this.signallights = [];
Signallightload(this.signallights);
this.mixers = [];
this.showmodel = null;
let helpbox,textplane;
let daochamodel;
let psdtexturemap = [];
//点击事件状态
this.raycasterstatus = false;
//动画状态
this.animastats = false;
//当前选中模型
this.nowobject = null;
//当前动画播放模型
this.animationmodel = null;
this.stationtexture = [];
this.devicetext = new Textconfig();
this.windowstatus = '0';
//初始化webgl渲染
this.renderer = new THREE.WebGLRenderer({ antialias: true });
this.renderer.setClearColor(new THREE.Color(0x000000));
this.renderer.setSize(window.innerWidth, window.innerHeight);
this.renderer.shadowMap.enabled = true;
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
this.dom.appendChild(this.renderer.domElement);
//定义相机
this.camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 200);
this.camera.position.set(0, 20, 30);
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
//定义场景(渲染容器)
this.scene = new THREE.Scene();
this.scene.background = new THREE.Color(0xa0a0a0);
var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({ color: 0x999999, depthWrite: false }));
mesh.rotation.x = - Math.PI / 2;
mesh.receiveShadow = true;
this.scene.add(mesh);
var grid = new THREE.GridHelper(200, 20, 0x000000, 0x000000);
grid.material.opacity = 0.2;
grid.material.transparent = true;
this.scene.add(grid);
let moveanima = new Moveanimate(scope);
//定义全局光
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
this.scene.add(ambientLight);
var spotLight = new THREE.SpotLight(0xececff);
spotLight.position.set(-50, 80, 0);
spotLight.castShadow = true;
spotLight.shadow.mapSize.width = 2048;
spotLight.shadow.mapSize.height = 2048;
this.scene.add(spotLight);
this.controls = new THREE.OrbitControls(this.camera, dom);
this.controls.maxPolarAngle = Math.PI / 2;
this.controls.minPolarangle = Math.PI / 5;
this.controls.maxDistance = 80;
this.controls.screenSpacePanning = true;
this.controls.update();
document.addEventListener( "mousedown", onselect, false );
let teststomp = new StompClient();
// let topic = '/user/topic/simulation/assistant/'+group;
let topic = '/user/queue/simulation/jl3d/'+group;
let header = {'X-Token': token};
try {
// console.log("teststomp");
teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
function callback(Response) {
let data = JSON.parse(Response.body);
// if(scope.nowcode != data.body.code){
// scope.nowcode = data.body.code;
// scope.selectmodel(data);
// }else{
if(data.type == "DeviceCtrl_3D"){
// console.log(data.body);
if(data.body.code == scope.nowcode){
scope.updateaction(data.body);
}
}
// }
}
window.onresize = function () {
scope.camera.aspect = window.innerWidth / window.innerHeight;
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(window.innerWidth, window.innerHeight);
}
this.domresize = function(){
scope.camera.aspect = window.innerWidth/ window.innerHeight;
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(window.innerWidth, window.innerHeight);
}
this.anime = null;
this.modelmanager = new ModelManager();
getPublish3dMapDetail(skinCode).then(netdata => {
setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets));
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
// scope.stationtexture
animate();
})
});
function setpsdstationmap(stationlist){
for(let i=0,leni=stationlist.length;i<leni;i++){
psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
}
}
//循环渲染函数
function animate() {
scope.anime = requestAnimationFrame(animate);
scope.renderer.render(scope.scene, scope.camera);
scope.controls.update();
//scope.camera.lookAt(plane);
//
moveanima.animateupdate();
let delta = clock.getDelta();
if (scope.mixers) {
for (let i = 0; i < scope.mixers.length; i++) {
if (scope.mixers[i]) {
scope.mixers[i].update(delta);
}
}
}
}
this.hideswitch = function (nowswitchstatus){
if(nowswitchstatus){
scope.modelmanager.switchmodel.mesh.add(daochamodel);
}else{
scope.modelmanager.switchmodel.mesh.remove(daochamodel);
}
}
this.selectmodel = function (data) {
console.log(data);
if (scope.showmodel) {
if (scope.showmodel.code != data.code) {
scope.scene.remove(scope.showmodel);
scope.showmodel = null
scope.nowcode = data.code;
if (data.type == "SWITCH") {
// scope.modelmanager.switchmodel.locateType = data.body.locateType;
scope.modelmanager.switchmodel.code = data.code;
scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel);
// scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh);
scope.nowobject = scope.modelmanager.switchmodel.mesh;
// updatemenulist(scope.devicetext.devicelist);
scope.raycasterstatus = true;
}else{
scope.raycasterstatus = false;
scope.nowobject = "";
// updatemenulist();
}
if (data.type == "SIGNAL") {
scope.modelmanager.signalmodel.code = data.code;
scope.showmodel = scope.modelmanager.signalmodel.mesh;
scope.scene.add(scope.showmodel);
}
if (data.type == "PSD") {
// console.log(data);
scope.modelmanager.standmodel.code = data.code;
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
if (data.type == "AXLE_COUNTER") {
// console.log(data);
scope.modelmanager.sectionmodel.code = data.code;
scope.showmodel = scope.modelmanager.sectionmodel.mesh;
scope.scene.add(scope.showmodel);
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
if(scope.showmodel){
scope.resetmodel();
scope.showmodel.code = data.code;
// initstatus(data);
}
}
} else {
scope.nowcode = data.code;
if (data.type == "SWITCH") {
scope.modelmanager.switchmodel.normalPosition = "0";
scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel);
// if (data.normalPosition == "0") {
// scope.modelmanager.switchmodel.normalPosition = "0";
// if(scope.modelmanager.switchmodel.action){
// scope.modelmanager.switchmodel.action.reset();
// scope.modelmanager.switchmodel.action.time = 0;
// scope.modelmanager.switchmodel.action.timeScale = -1;
// scope.modelmanager.switchmodel.action.play();
// }
// } else if (data.normalPosition == "1") {
// scope.modelmanager.switchmodel.normalPosition = "1";
// if(scope.modelmanager.switchmodel.action){
// scope.modelmanager.switchmodel.action.reset();
// scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
// scope.modelmanager.switchmodel.action.timeScale = 1;
// scope.modelmanager.switchmodel.action.play();
// }
// }
}
if (data.type == "SIGNAL") {
scope.showmodel = scope.modelmanager.signalmodel.mesh;
scope.scene.add(scope.showmodel);
}
if (data.type == "PSD") {;
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
if (data.type == "AXLE_COUNTER") {
scope.showmodel = scope.modelmanager.sectionmodel.mesh;
scope.scene.add(scope.showmodel);
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
// scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
// initstatus(data);
}
}
//设备分解、归位动画按钮
this.disperdevice1 = function(){
if(scope.nowobject.animacode){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"on"],true)
} else if(scope.animastats == true){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"off"],true);
}
}
}
};
this.disperdevice2 = function(){
if(scope.nowobject.animacode){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"chaijie"],true);
} else if(scope.animastats == true){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true);
}
}
}
};
this.resetmodel = function(){
if(scope.nowobject.animacode){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true);
}
};
this.animationmsgshowon = function(nowobject){
scope.animationmodel = nowobject;
if(helpbox){
scope.animationmodel.helpbox = null;
scope.scene.remove( helpbox );
helpbox = undefined;
}
settext(scope.animationmodel,scope.animationmodel.position);
// console.log(scope.animationmodel);
helpbox = new THREE.BoxHelper( scope.animationmodel, 0xff0000 );
moveanima.updatehelpbox(helpbox,textplane);
// settext(intersects[0].object,intersects[0].point);
// getdevicemsg(intersects[0].object.name);
scope.scene.add( helpbox );
getdevicemsg(nowobject.name);
}
this.animationmsgshowoff = function(nowobject){
if(helpbox){
scope.animationmodel.helpbox = null;
scope.scene.remove( helpbox );
helpbox = undefined;
}
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
scope.animationmodel = null;
}
this.updateaction = function (data) {
if (data.type == "SWITCH") {
if (data.normal == "0") {
scope.modelmanager.switchmodel.normalPosition = "0";
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play();
} else if (data.normal == "1") {
scope.modelmanager.switchmodel.normalPosition = "1";
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = -1;
scope.modelmanager.switchmodel.action.play();
}
}
if (data.type == "SIGNAL") {//从上往下红绿黄
if(data.red == 1){
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}
if(data.yellow == 1){
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}
if(data.green == 1){
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
}
if (data.type == "PSD") {
if (data.code == scope.nowcode) {
if (data.open == "1" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
}
if (data.open == "0" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
}
}
// scope.showmodel.
}
this.repairpsd = function(){
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
this.updateselect = function(updata){
// console.log(updata);
if(helpbox){
scope.scene.remove( helpbox );
helpbox = null;
}
helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 );
// console.log(updata.mesh);
let point = {
x:updata.mesh.matrixWorld.elements[12],
y:updata.mesh.matrixWorld.elements[13],
z:updata.mesh.matrixWorld.elements[14]
};
settext(updata.mesh,point)
getdevicemsg(updata.mesh.name);
scope.scene.add( helpbox );
}
function getdevicemsg(selectname){
// console.log(selectname);
for(let i=0,leni=scope.devicetext.devicelist.length;i<leni;i++){
if(selectname == scope.devicetext.devicelist[i].name){
updatemsg(scope.devicetext.devicelist[i].text,scope.devicetext.devicelist[i].msg);
i=leni;
}
}
}
function initstatus(data) {
if (data._type == "Switch") {
if (data.normalPosition == "0") {
scope.modelmanager.switchmodel.normalPosition = "0";
if(scope.modelmanager.switchmodel.action){
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play();
}
} else if (data.normalPosition == "1") {
scope.modelmanager.switchmodel.normalPosition = "1";
if(scope.modelmanager.switchmodel.action){
scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = -1;
scope.modelmanager.switchmodel.action.play();
}
}
}
if (data._type == "Signal") {
if(data.logicLight == 0){
if(data.redOpen == 1){
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}
if(data.yellowOpen == 1){
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}
if(data.greenOpen == 1){
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
}else{
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}
}
if (data._type == "Psd") {
if (data.screenDoorOpenStatus == "0") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
}
if (data.screenDoorOpenStatus == "1") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
}
}
this.updatewindowstatus = function(nowwindowstatus){
scope.windowstatus == nowwindowstatus;
}
function onselect(event){
if(event.button == '0'){
if(scope.raycasterstatus){
//定义光线
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
let getBoundingClientRect = scope.dom.getBoundingClientRect()
if(scope.windowstatus == '0'){
mouse.x = ( (event.clientX - getBoundingClientRect .left) /scope.dom.offsetWidth) * 2-1;
mouse.y = -( (event.clientY - getBoundingClientRect .top) / scope.dom.offsetHeight) * 2 + 1;
}else{
mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
}
raycaster.setFromCamera( mouse, scope.camera );
let intersects = raycaster.intersectObjects( scope.modelmanager.switchmodel.mesh.children,true);
if(helpbox){
scope.scene.remove( helpbox );
helpbox = null;
}
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
if(intersects[0]){
if(intersects[0].object.raycastoff){
helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 );
settext(intersects[0].object.parent,intersects[0].point);
getdevicemsg(intersects[0].object.parent.name);
}else{
helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
settext(intersects[0].object,intersects[0].point);
getdevicemsg(intersects[0].object.name);
}
scope.scene.add( helpbox );
}
}
}
}
function settext(intersects,point){
if(intersects.text){
let textgeometry = new THREE.PlaneBufferGeometry( 18, 12, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,transparent: true,
alphaTest:0.1
} );
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.position.x = point.x;
textplane.position.y = point.y+6;
textplane.position.z = point.z;
// console.log(textplane.position);
// textplane.tcode = data[i].code;
textplane.rotation.y = -Math.PI/2;
textplane.lookAt(scope.camera.position);
// scope.textlist.push(textplane);
// newmesh.children[0].add(textplane);
scope.scene.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
var beauty = new Image();
beauty.src = "../../static/texture/guide.png";
//canvas文字贴图方法
//PS:待提炼 增强功能
function getTextCanvas(text){
var canvas = document.getElementById('canvastexture');
canvas.width = 256;
canvas.height = 128;
var ctx = canvas.getContext('2d');
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,256,128);
ctx.font = "20px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,256,128);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,256, 128);
ctx.fillText("设备部件:"+text, 90,30);
// ctx.fillText("车组人员:XXX", 40,20);
// ctx.fillText("速度:XXX.XXX", 40,30);
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
let data = ctx.getImageData(0, 0,256, 128);
return data;
}
}

View File

@ -19,12 +19,10 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
// import { DragControls } from '@/jlmap3d/main/control/DragControls';
//加载器
import { SimulationLoad } from '@/jlmap3d/main/loaders/SimulationLoad';
import { SimulationLoadNew } from '@/jlmap3d/main/loaders/SimulationLoadNew';
import { MaintainerLoad } from '@/jlmap3d/jl3dmaintainer/maintainerload';
//connect
import {Jlmap3dSubscribe } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe';
import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew';
import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect';
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
@ -97,11 +95,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
};
//地图模型数据
let mapdata = new Jl3ddata();
//订阅仿真socket
// console.log(routegroup);
// this.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
//连接到通信
//console.log(this.Subscribe.config);
this.webwork = new Worker("../../static/workertest/trainworker.js");
//初始化加载数据和模型getPublishMapDetail
@ -110,18 +103,13 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
getPublish3dMapDetail(skinCode).then(netdata => {
let assetsdata = JSON.parse(netdata.data.sections);
if(assetsdata.link){
scope.datatype = "old";
scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js");
scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
}else{
scope.datatype = "new";
scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js");
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
scope.jsonwebworknew = new Worker("../../static/workertest/maintainerworker.js");
scope.Subscribe = new Maintainerconnect(scope,routegroup,scope.jsonwebworknew);
scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
MaintainerLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
}
});
@ -304,7 +292,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
trainlisttest = loadtrainlisttest;
realsectionlist = loadrealsectionlist;
rails = loadrails;
console.log(stationstandlist);
scope.updatecamera(stationstandlist.group.children[0],"station");
}
@ -412,8 +399,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
}
if(scope.raycasterswitch == "section"){
console.log(sectionlist);
console.log(linklist);
//console.log(sectionlist.sections.modellist);
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
if(intersects[0]){
@ -424,7 +410,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
}
if(scope.raycasterswitch == "signal"){
console.log(signallist);
let intersects = raycaster.intersectObjects( signallist.group.children,true);
if(intersects[0]){
@ -435,7 +420,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
}
if(scope.raycasterswitch == "switch"){
console.log(sectionlist);
let intersects = raycaster.intersectObjects( sectionlist.switchs.modellist,true);
if(intersects[0]){

View File

@ -0,0 +1,828 @@
import StompClient from '@/utils/sock';
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
// 定于仿真socket接口
export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork) {
const scope = this;
this.map = null;
var trainlisttest = null;
var sectionlist = null;
var signallist = null;
var stationstandlist = null;
var sectionlist = null;
var materials = null;
var actions = null;
var rails = null;
var links = null;
var scenes = null;
var code = null;
var drivingcode = null;
var drivingspeed = null;
var drivingaptspeed = null;
let driverswitch = false;
let stoptimer = null;
let num = 30;
let pointstand = null;
let data = null;
// run as plane = 01;
// reset = 02;
var datatype = '00';
this.teststomp = new StompClient();
this.topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
let connectmsg = {
type:'init',
baseurl:getBaseUrl(),
topic:this.topic,
token:getToken(),
};
jsonwebwork.postMessage(connectmsg);
jsonwebwork.onmessage = function (event) {
// if(event.data.deviceType == "TRAIN"){
// // console.log(event.data);
//
// }
if(event.data.type == "Device_Fault_Set_3D"){
let newfault = {
code:event.data.body.code,
type:event.data.body.type,
text:event.data.body.fault,
fault:event.data.body.fault,
}
if(event.data.body.type == "SIGNAL"){
if(event.data.body.fault == "MAIN_FILAMENT_BROKEN"){
newfault.text = "主灯丝断丝故障";
}
}
if(event.data.body.type == "SWITCH"){
if(event.data.body.fault == "SPLIT"){
newfault.text = "道岔挤岔";
}
}
if(event.data.body.type == "AXLE_COUNTER"){
if(event.data.body.fault == "FAULT"){
newfault.text = "计轴故障";
}
}
if(event.data.body.type == "PSD"){
if(event.data.body.fault == "FAULT"){
newfault.text = "屏蔽门无法关闭故障";
}
}
warningmsg("新的故障设备:"+event.data.body.code);
updatefault(newfault);
return;
}
if(event.data.type == "Device_Fault_Over_3D"){
warningmsg("已修复故障设备:"+event.data.body.code);
deletefault(event.data.body.code);
return;
}
if(event.data.type == "Device_Load_Destroy_3D"){
DeviceDestroy(event.data);
resetfaultlist();
let fault = event.data.body.faultInfoList;
for(let i=0,leni= fault.length;i<leni;i++){
updatefault(fault[i]);
}
return;
}
if(event.data.type == 'TrainRun_3D'){
for(let i=0,leni=event.data.body.length;i<leni;i++){
// console.log(event.data.body[i]);
trainrunnew(event.data.body[i]);
}
return;
}
// if(event.data.type == 'TRAIN'){
// console.log(event.data);
// trainrun(event.data);
// }
if (event.data.type== 'SIGNAL' && signallist) {
signalupdate(event.data);
// console.log(event.data);
return;
}
if (event.data.type== "PSD" && actions) {
standupdate(event.data);
return;
}
if (event.data.type == "SWITCH") {
switchupdate(event.data);
return;
}
if (event.data.type == 'TRAIN_DOOR') {
traindoorupdate(event.data);
return;
}
if(event.data.type == 'Simulation_Reset'){
simulationreset(event.data);
return;
}
if(event.data.type == 'Simulation_DeviceStatus'){
initall(event.data.body);
return;
}
};
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
trainlisttest = newtrainlisttest;
sectionlist = newsectionlist;
signallist = newsignallist;
stationstandlist = newstationstandlist;
materials = materiallist;
scenes = scene;
actions = nowaction;
links = newlinklist;
rails = newrails;
};
this.socketon = function(topic) {
try {
// console.log("teststomp");
// scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
for (let i=0; i<trainlisttest.group.children.length; i++) {
if (trainlisttest.group.children[i].dispose == false) {
code = trainlisttest.group.children[i].name;
trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].open = '1';
trainlisttest.list[code].speed = 0;
trainlisttest.group.children[i].dispose = true;
trainlisttest.group.children[i].position.x = -50000;
trainlisttest.group.children[i].position.y = -50000;
trainlisttest.group.remove(trainlisttest.group.children[i]);
i--;
}
}
};
function trainrunnew(data){
let code = data.code;
if(trainlisttest.list[code].right != data.right){
if(data.right == "0"){
trainlisttest.list[code].right = "0";
trainlisttest.list[code].rotation.y = Math.PI;
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
trainlisttest.list[code].position.x = point.x;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = point.z;
}
}else{
trainlisttest.list[code].right = "1";
trainlisttest.list[code].rotation.y = 0;
let point = rails.sectionrail[data.section].lineleft.getPointAt(data.offset);
trainlisttest.list[code].position.x = point.x;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = point.z;
}
}
}
// console.log(data);
if(trainlisttest.list[code].dispose == "0"){
if (data.right == '1') { // 向右
trainlisttest.list[code].right = '1';
trainlisttest.list[code].progress = data.offset;
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
// if(rails.sectionrail[data.section].standTrack){
// trainlisttest.list[code].statsstop = 0;
// }
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0;
// for (let tl=0; tl<6; tl++) {
// trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
// }
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
// if(data.next){
// trainlisttest.list[code].nextcode = data.next;
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
// }
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
trainlisttest.list[code].status = '1';
if(trainlisttest.list[code].children[0].position.z != point.z){
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
trainlisttest.list[code].children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainlisttest.list[code].children[0].rotation.z
}
trainlisttest.list[code].children[1].rotalist.push(rotas);
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
trainlisttest.list[code].children[0].position.z += offsetz;
}
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainlisttest.list[code].children[rs].rotalist[0]){
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
trainlisttest.list[code].children[rs].position.z += offsetz;
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
// if(trainlisttest.list[code].groupNumber == "005"){
// console.log("rs:"+rs);
// console.log(trainlisttest.list[code].children[rs].matrixWorld.elements[12]);
// console.log(trainlisttest.list[code].children[rs].rotalist[0].posr.x);
// }
if(rs != 5){
let asd = trainlisttest.list[code].children[rs].rotalist[0];
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
}
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainlisttest.list[code].children[rs].rotalist.length;
}
}
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
}
}
}
} else if (data.right == '0') { // 向左
trainlisttest.list[code].right = '0';
trainlisttest.list[code].progress = 1-data.offset;
// trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
// if(rails.sectionrail[data.section].standTrack){
// trainlisttest.list[code].statsstop = 0;
// }
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
trainlisttest.list[code].rotation.y = Math.PI;
trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0;
// for (let tl=0; tl<6; tl++) {
// trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
// }
// trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
// if(data.next){
// trainlisttest.list[code].nextcode = data.next;
// trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
// trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
// }
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
trainlisttest.list[code].status = '0';
if(-trainlisttest.list[code].children[0].position.z != point.z){
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
let tangent = rails.sectionrail[data.section].lineright.getTangentAt(data.offset).normalize();
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
trainlisttest.list[code].children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainlisttest.list[code].children[0].rotation.z
}
trainlisttest.list[code].children[1].rotalist.push(rotas);
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
trainlisttest.list[code].children[0].position.z -= offsetz;
// trainlisttest.list[code].position.z = point.z;
}
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainlisttest.list[code].children[rs].rotalist[0]){
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
trainlisttest.list[code].children[rs].position.z -= offsetz;
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
if(rs != 5){
let asd = trainlisttest.list[code].children[rs].rotalist[0];
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
}
//let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainlisttest.list[code].children[rs].rotalist.length;
}
}
//console.log(trainlisttest.list[code].children[rs].rotalist.length);
}
}
// console.log(trainlisttest.list[code].rotalist);
}
}
}
}
function trainrun(data){
let code = data.code;
// console.log(data);
if(trainlisttest.list[code].dispose == "0"){
if(trainlisttest.list[code].curve == null){
if (data.right == '1') { // 向右
trainlisttest.list[code].right = '1';
trainlisttest.list[code].progress = data.offset;
trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
if(rails.sectionrail[data.section].standTrack){
trainlisttest.list[code].statsstop = 0;
}
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
}
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
if(data.next){
trainlisttest.list[code].nextcode = data.next;
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
}
trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
trainlisttest.list[code].status = '1';
} else if (data.right == '0') { // 向左
trainlisttest.list[code].right = '0';
trainlisttest.list[code].progress = 1-data.offset;
trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
if(rails.sectionrail[data.section].standTrack){
trainlisttest.list[code].statsstop = 0;
}
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
trainlisttest.list[code].rotation.y = Math.PI;
trainlisttest.list[code].position.x = point.x;
trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
}
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
if(data.next){
trainlisttest.list[code].nextcode = data.next;
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
}
trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
trainlisttest.list[code].status = '0';
}
}else{
//后端数据驱动车的位置更新与代码驱动车的移动相结合
if(data.code != trainlisttest.list[code].code){
if (data.right == '1') { // 向右
trainlisttest.list[code].right = '1';
trainlisttest.list[code].nowcode = data.code;
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
trainlisttest.list[code].progress = data.offset;
trainlisttest.list[code].nextcode = data.next;
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
trainlisttest.list[code].nextissection = rails.sectionrail[data.next].standTrack;
} else if (data.right == '0') { // 向左
trainlisttest.list[code].right = '0';
trainlisttest.list[code].nowcode = data.code;
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
trainlisttest.list[code].progress = 1-data.offset;
trainlisttest.list[code].nextcode = data.next;
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
trainlisttest.list[code].nextissection = rails.sectionrail[data.next].standTrack;
}
}
}
if(data.speed == 0){
trainlisttest.list[code].speeds = 0;
trainlisttest.list[code].statsstop = 0;
}else{
trainlisttest.list[code].speeds = parseFloat(data.speed*10/36/18/trainlisttest.list[code].len);
}
if(data.right != trainlisttest.list[code].status){
trainlisttest.list[code].status = data.right;
trainlisttest.list[code].curve = null;
trainlisttest.list[code].nextcurve = null;
trainlisttest.list[code].nextlen = null;
}
}
}
function initall(data){
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].deviceType == "SWITCH"){
initswitch(data[i]);
}
if(data[i].deviceType == "PSD"){
initstand(data[i]);
}
}
}
function DeviceDestroy(data){
for(let i=0,leni=data.body.length;i<leni;i++){
if(data.body[i].type == "TRAIN"){
code =data.body[i].code;
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == "0") {
if (rails.sectionrail[data.body[i].section]) {
trainlisttest.group.add(trainlisttest.list[code]);
trainlisttest.list[code].position.y = 0;
// trainlisttest.list[code].progress = 0;
trainlisttest.list[code].dispose = "0";
trainlisttest.list[code].nowcode = data.body[i].section;
trainlisttest.list[code].nextcode = null;
trainlisttest.list[code].curve = null;
trainlisttest.list[code].nextcurve = null;
trainlisttest.list[code].pc = 1;
if(trainlisttest.list[code].mixerpush == false){
for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi<lenmi;mi++){
jlmap3d.mixers.push(trainlisttest.list[code].mixer[mi]);
}
trainlisttest.list[code].mixerpush = true;
}
}
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == "1") {
trainlisttest.list[code].status = 1;
trainlisttest.group.remove(trainlisttest.list[code]);
trainlisttest.list[code].progress = null;
trainlisttest.list[code].dispose = "1";
code = trainlisttest.group.children[i].name;
trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].open = '1';
trainlisttest.list[code].curve = null;
trainlisttest.list[code].nextcurve = null;
trainlisttest.list[code].speed = 0;
trainlisttest.list[code].position.x = -50000;
trainlisttest.list[code].position.y = -50000;
trainlisttest.list[code].pc = 1;
}
}
if(data.body[i].type == "SIGNAL"){
signalupdate(data.body[i]);
}
if(data.body[i].type == "SWITCH"){
switchupdate(data.body[i]);
}
if(data.body[i].type == "PSD"){
standupdate(data.body[i]);
}
if(data.body[i].type == "TRAIN_DOOR"){
traindoorupdate(data.body[i]);
}
}
}
function traindoorupdate(data){
let code = data.code;
if(trainlisttest.list[code].right == "0"){
if(data.doorCode == "2"){
if(trainlisttest.list[code].open != data.open && data.open == "0"){
trainlisttest.list[code].open = "0";
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
}else if(trainlisttest.list[code].open != data.open && data.open == "1"){
trainlisttest.list[code].open = "1";
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = 0;
actions[code].top[an].timeScale = 1;
actions[code].top[an].play();
}
}
}else{
if (trainlisttest.list[code].open != data.open && data.open == '0') {
trainlisttest.list[code].open = '0';
for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1;
actions[code].down[an].play();
}
} else if (trainlisttest.list[code].open != data.open && data.open == '1') {
trainlisttest.list[code].open = "1";
for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset();
actions[code].down[an].time = 0;
actions[code].down[an].timeScale = 1;
actions[code].down[an].play();
}
}
}
}else{
if(data.doorCode == "1"){
if(trainlisttest.list[code].open != data.open && data.open == "0"){
trainlisttest.list[code].open = "0";
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
}else if(trainlisttest.list[code].open != data.open && data.open == "1"){
trainlisttest.list[code].open = "1";
for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset();
actions[code].top[an].time = 0;
actions[code].top[an].timeScale = 1;
actions[code].top[an].play();
}
}
}else{
if (trainlisttest.list[code].open != data.open && data.open == '0') {
trainlisttest.list[code].open = '0';
for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1;
actions[code].down[an].play();
}
} else if (trainlisttest.list[code].open != data.open && data.open == '1') {
trainlisttest.list[code].open = "1";
for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset();
actions[code].down[an].time = 0;
actions[code].down[an].timeScale = 1;
actions[code].down[an].play();
}
}
}
}
}
function trainstatus(data){
// 遍历列车对象组
if (trainlisttest) {
code = data.code;
// 剔除不显示的车
// 找到对应列车
if ( trainlisttest.list[code]) {
trainlisttest.list[code].driveMode = data.driveMode;
trainlisttest.list[code].status = data.right;
// 车门开关验证
// 遍历获取所在轨道
if (trainlisttest.list[code].dispose != data.dispose && data.dispose == "0") {
if (rails.sectionrail[data.sectionCode]) {
trainlisttest.group.add(trainlisttest.list[code]);
trainlisttest.list[code].position.y = 0;
// trainlisttest.list[code].progress = 0;
trainlisttest.list[code].dispose = "0";
trainlisttest.list[code].nowcode = data.sectionCode;
trainlisttest.list[code].nextcode = null;
trainlisttest.list[code].curve = null;
trainlisttest.list[code].nextcurve = null;
trainlisttest.list[code].pc = 1;
if(trainlisttest.list[code].mixerpush == false){
for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi<lenmi;mi++){
jlmap3d.mixers.push(trainlisttest.list[code].mixer[mi]);
}
trainlisttest.list[code].mixerpush = true;
}
}
} else if (trainlisttest.list[code].dispose != data.dispose && data.dispose == "1") {
trainlisttest.list[code].status = 1;
trainlisttest.group.remove(trainlisttest.list[code]);
trainlisttest.list[code].progress = null;
trainlisttest.list[code].dispose = "1";
code = trainlisttest.group.children[i].name;
trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].open = '1';
trainlisttest.list[code].curve = null;
trainlisttest.list[code].nextcurve = null;
trainlisttest.list[code].speed = 0;
trainlisttest.list[code].position.x = -50000;
trainlisttest.list[code].position.y = -50000;
trainlisttest.list[code].pc = 1;
}
}
}
}
function initstand(data) {
code = data.code;
if ( actions[code]) {
if (data.close == '1') {
actions[code].status = '1';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.close == '0') {
actions[code].status = '0';
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
}
}
}
function standupdate(data) {
code = data.code;
if ( actions[code]) {
if (data.open == '1') {
actions[code].status = '1';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.open == '0') {
actions[code].status = '0';
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
}
}
}
function signalupdate(data) {
code = data.code;
if(data.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
}
function initswitch(data) {
code = data.code;
if (data.routeLock == '0') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.routeLock == '1') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
}
}
function switchupdate(data) {
code = data.code;
if (actions[code].normal != data.normal) {
if (data.normal == '02') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.normal == '01') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
}
}
}
function simulationreset(data){
for(let i=0;i<trainlisttest.group.children.length;i++){
trainlisttest.group.children[i].dispose = true;
trainlisttest.group.children[i].stopstation = null;
trainlisttest.group.children[i].pc = null;
trainlisttest.group.children[i].targetpercent = null;
trainlisttest.group.children[i].progress = null;
trainlisttest.group.children[i].linkOffsetPercent = null;
trainlisttest.group.children[i].targetLink = null;
trainlisttest.group.remove(trainlisttest.group.children[i]);
i--;
}
}
}

View File

@ -0,0 +1,213 @@
//componnent
import {SectionList} from '@/jlmap3d/main/model/SectionList.js';
import {SignalList} from '@/jlmap3d/main/model/SignalList.js';
import {StationStandList} from '@/jlmap3d/main/model/StationStandList.js';
import {TrainList} from '@/jlmap3d/main/model/TrainList.js';
import {RealSectionList} from '@/jlmap3d/main/model/RealSectionList.js';
import {LinkList} from '@/jlmap3d/main/model/LinkList.js';
import {RailList} from '@/jlmap3d/main/model/RailList.js';
import {TrainListN} from '@/jlmap3d/main/newmodel/TrainListN.js';
import {SectionListN} from '@/jlmap3d/main/newmodel/SectionListN';
import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN';
import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN';
import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN';
import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
import { Loading } from 'element-ui';
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene){
//console.log(mapdata);
//console.log(data);
//console.log(scope);
let sceneload = scene;
let backdata = scope;
let jlmap3ddata = mapdata;
let assetloader = scope.assetloader;
let mixers = scope.mixers;
let actions = scope.actions;
let linklist,sectionlist,signallist,stationstandlist,trainlisttest,switchlist,realsectionlist,rails;
let loadingInstance = Loading.service({ fullscreen: true });
let isSection = false;
let isNewdata = false;
if(netdata.assets){
initnew3d(data,netdata);
}else{
loadingInstance.close();
alert("没有三维数据");
}
function initnew3d(data,netdata){
Materialload(scope,JSON.parse(netdata.assets));
let mapdata = data;
//初始化轨道和道岔
// lengthfact(data);
// linklist = new LinkList();
sectionlist = new SectionListN();
signallist = new SignalListN();
switchlist = new SwitchListN();
//初始化站台
stationstandlist = new StationStandListN();
//初始化测试列车
trainlisttest = new TrainListN();
// realsectionlist = new RealSectionList();
rails = new RailListN();
let sectiondata = JSON.parse(netdata.sections);
let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList;
assetloader.setmodellistnew(netdata.assets);
assetloader.assetpromise(sceneload)
// .then(function(data){
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
// })
.then(function(data){
//console.log(data);
//,netdata.stands,mixers,actions,"0"
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02");
})
.then(function(data){
//console.log(data);
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,rails,scene,assetloader);
})
.then(function(data){
//console.log(data);
return signallist.loadpromise(mapdata.signalList,signaldata,sceneload,assetloader);
})
.then(function(data){
return switchlist.loadpromise(mapdata.switchList,switchdata,sceneload,assetloader,mixers,actions);
})
.then(function(data){
//console.log(data);
//console.log(assetloader);
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
})
// .then(function(data){
// return new Promise(function(resolve, reject){
// rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
// resolve("loadrail");
//
// });
// })
.then(function(data){
return new Promise(function(resolve, reject){
//
let netasset = JSON.parse(netdata.assets);
if(netasset.istexture){
for(let mm=0;mm< stationstandlist.group.children.length;mm++){
let stationname = stationstandlist.group.children[mm].name;
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
newmaterial.map =scope.stationtexture[stationname];
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
}
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].deviceType == "suidaobg"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
// console.log(stationstandlist.group.children[0].name );
// if(stationstandlist.group.children[0].name == "Station75414"){
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "nbsuidao"){
// scope.assetloader.modellist[mn].mesh.name = "nbsuidao";
// scene.add(scope.assetloader.modellist[mn].mesh);
// }
// }
// }
resolve("mergemodel");
});
})
.then(function(data){
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
// // scope.assetloader.modellist[mn].mesh.rotation.x = Math.PI/2;
// // scope.assetloader.modellist[mn].mesh.position.y -=0.1;
// // console.log(scope.assetloader.modellist[mn].mesh);
// scene.add(scope.assetloader.modellist[mn].mesh);
// }
// }
//
// // mapdata = jlmap3ddata;
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
scope.webwork.postMessage("on");
scope.jsonwebworknew.postMessage("connect");
loadingInstance.close();
});
}
function onProgress( xhr ) {
if ( xhr.lengthComputable ) {
let percentComplete = xhr.loaded / xhr.total * 100;
//console.log( 'model ' + Math.round( percentComplete, 2 ) + '% downloaded' );
}
}
function onError() {}
}
function lengthfact(data){
let linklist = [];
//console.log(data);
for(let i=0;i<data.linkList.length;i++){
let dx = Math.abs(data.linkList[i].lp.x - data.linkList[i].rp.x);
    let dy = Math.abs(data.linkList[i].lp.y - data.linkList[i].rp.y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
let link = {
code:data.linkList[i].code,
lengthfact:data.linkList[i].lengthFact,
distance:distance
};
linklist.push(link);
}
let sectionlist = [];
for(let i=0;i<data.sectionList.length;i++){
for(let j=0;j<linklist.length;j++){
if(linklist[j].code == data.sectionList[i].linkCode){
let sectionoffset = data.sectionList[i].offsetRight - data.sectionList[i].offsetLeft;
let sectionlengthfact = sectionoffset/linklist[j].distance*linklist[j].lengthfact
let section = {
code:data.sectionList[i].code,
lengthfact:sectionoffset
};
sectionlist.push(section);
j = linklist.length;
}
}
}
//console.log(sectionlist);
}

View File

@ -409,8 +409,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
}
if(scope.raycasterswitch == "section"){
console.log(sectionlist);
console.log(linklist);
//console.log(sectionlist.sections.modellist);
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
if(intersects[0]){

View File

@ -114,8 +114,10 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
let stationname = stationstandlist.group.children[mm].name;
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
newmaterial.map =scope.stationtexture[stationname];
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;

View File

@ -559,6 +559,13 @@ class SkinCode extends defaultStyle {
trainBodyFillColor: '#725A64', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
},
soonerOrLater: {
level: 3,
serviceNumber: true,
earlyColor: '#00FF00',
lateColor: '#800000',
normalColor: '#FFF'
},
directionArrow: {
},
hsda: {

View File

@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
logicalTextColor: '#C0C0C0', // 逻辑区段名称颜色 (未用)
invalidColor: '#B18E38' // 区段ARB故障颜色
},
axle: {}, // 计轴
speedLimit: { // 限速元素
@ -678,6 +679,13 @@ class SkinCode extends defaultStyle {
},
directionArrow: {
},
soonerOrLater: {
level: 3,
trainBody: true,
earlyColor: '#00FF00',
lateColor: '#800000',
normalColor: '#FFF'
},
hsda: {
lrPaddingHSDA: 3, // HSDA两边间隔
upPaddingHSDA: 4, // HSDA上边距离

View File

@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
invalidColor: '#A25100' // 区段ARB故障颜色
},
axle: {}, // 计轴
speedLimit: { // 限速元素

View File

@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
invalidColor: '#A25100' // 区段ARB故障颜色
},
axle: {}, // 计轴
speedLimit: { // 限速元素

View File

@ -559,6 +559,14 @@ class SkinCode extends defaultStyle {
trainSidelineColor: '#FFFF00',
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
},
soonerOrLater: {
level: 5,
earlyColor: '#00FF00',
severeEarlyColor: '#0000FF',
lateColor: '#FF00FF',
severeLateColor: '#FF0000',
normalColor: '#DADA00'
},
directionArrow: {
},
hsda: {

View File

@ -101,7 +101,8 @@ class SkinCode extends defaultStyle {
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
invalidColor: '#9C5208' // 区段ARB故障颜色
},
axle: {}, // 计轴
speedLimit: { // 限速元素
@ -163,10 +164,11 @@ class SkinCode extends defaultStyle {
route: {
direction: false, // 自动进路方向
offset: { x: -4, y: 0 }, // 自动进路偏移量
routeColor: '#00FF00' // 自动进路
routeColor: '#00FF00', // 自动进路
radiusR: 6
},
auto: {
signalFrontTriangle: false, // 信号灯前三角展示
signalFrontTriangle: true, // 信号灯前三角展示
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
@ -232,7 +234,8 @@ class SkinCode extends defaultStyle {
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
circle: true // 空心圆环
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
@ -563,6 +566,13 @@ class SkinCode extends defaultStyle {
},
directionArrow: {
},
soonerOrLater: {
level: 3,
serviceNumber: true,
earlyColor: '#00FF00',
lateColor: '#800000',
normalColor: '#FFF'
},
hsda: {
trainHSDATextFontSize: 8// 列车HDSA字号
},
@ -581,7 +591,13 @@ class SkinCode extends defaultStyle {
tripNumberPrefix: '0000', // 车次号前缀
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 42, y: 1}// 列车车次号偏移
trainTargetOffset: { x: 42, y: 1}, // 列车车次号偏移
smallColor: '#70ECEE', // 小交路颜色
bigColor: '#FFFFFF', // 大交路颜色
inboundColor: '#00FF00', // 回库颜色
planTypeColor: '#FFFFFF', // 计划车颜色
manualTypeColor: '#FF0', // 人工车
headTypeColor: '#FF0' // 头码车
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀

View File

@ -418,6 +418,8 @@ class Jlmap {
if (elem.deviceType === 'TRAIN') {
store.dispatch('map/updateTrainState', elem);
store.dispatch('map/setTrainListUpdate', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);
}
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {

View File

@ -602,7 +602,13 @@ export default class Section extends Group {
});
}
}
/** ARB故障 */
invalid() {
this.section && this.section.setStyle({
stroke: this.style.Section.line.invalidColor,
lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth
});
}
/** 进路锁闭 04*/
routeLock() {
if (this.section) {
@ -774,6 +780,8 @@ export default class Section extends Group {
/** 空闲锁闭或者叫进路锁闭 */
model.routeLock && this.routeLock();
/** 轨道封锁 */
model.invalid && this.invalid();
/** 计轴故障 */
model.blockade && this.block();
/** 非通信车占用状态 */
model.nctOccupied && this.unCommunicationOccupied();

View File

@ -28,7 +28,7 @@ class EVirtualSignal extends Group {
]
},
style: {
lineWidth: style.Signal.lamp.borderWidth || 1,
lineWidth: style.Signal.lamp.borderWidth || 0,
fill: style.Signal.lamp.borderColor,
stroke: style.Signal.lamp.borderColor
}

View File

@ -370,7 +370,7 @@ class Signal extends Group {
this.cbtcStatus = '';
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.blueColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
@ -393,6 +393,7 @@ class Signal extends Group {
this.cbtcStatus = '';
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
@ -620,12 +621,12 @@ class Signal extends Group {
}
getBoundingRect() {
const rect = this.sigPost.getBoundingRect();
const rect = this.sigPost.getBoundingRect().clone();
this.lamps.forEach(elem => {
rect.union(elem.getBoundingRect());
rect.union(elem.getBoundingRect().clone());
});
if (this.insideTriangle) {
rect.union(this.insideTriangle.getBoundingRect());
rect.union(this.insideTriangle.getBoundingRect().clone());
}
return rect;
}

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle';
class EDetain extends Group {
constructor(model) {
@ -29,6 +30,24 @@ class EDetain extends Group {
textVerticalAlign: style.textStyle.textVerticalAlign
}
});
if (style.StationStand.detainCar.circle) {
const offsetX = model.right ? 8 : -8;
this.circleDetain = new Circle({
zlevel: model.zlevel,
z: model.z,
shape: {
cx: model.x + offsetX,
cy: model.y - 3,
r: 2
},
style: {
fill: '#000',
lineWidth: 1,
stroke: '#FFf'
}
});
this.add(this.circleDetain);
}
this.add(this.detain);
}
}
@ -40,11 +59,13 @@ class EDetain extends Group {
hideMode() {
this.detain && this.detain.hide();
this.circleDetain && this.circleDetain.hide();
}
showMode() {
this.create();
this.detain && this.detain.show();
this.circleDetain && this.circleDetain.show();
}
}

View File

@ -37,7 +37,7 @@ class EMouse extends Group {
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else {
if (Vue.prototype.$jlmap.lineCode == '11' || Vue.prototype.$jlmap.lineCode == '10') {
text = `列车类型: ${trainType}\n\0\0\0\0源:人工标记\n\0\0号: ${this.device.model.groupNumber}\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n戴扣车: 不执行\n跳停状态: 无跳停\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: CTC车\n最高信号系统控制: CTC\n驾驶模式: SM模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
text = `列车类型: ${trainType}\n\0\0\0\0源:人工标记\n\0\0号: ${this.device.model.groupNumber}\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n载扣车: 不执行\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'}\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: CTC车\n最高信号系统控制: CTC\n驾驶模式: SM模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
} else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
}

View File

@ -181,7 +181,7 @@ export default class TrainBody extends Group {
// this.add(this.atrStatus);
}
if (style.Train.common.hasTravelSigns) {
const travelSignsOffsetX = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.x : style.Train.travelSigns.trainTravelLeftSignsOffset.x;
const travelSignsOffsetX = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.x + 4 : style.Train.travelSigns.trainTravelLeftSignsOffset.x;
const travelSignsOffsetY = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.y : style.Train.travelSigns.trainTravelLeftSignsOffset.y;
this.travelSigns = new ETextName({
zlevel: model.zlevel,
@ -222,7 +222,7 @@ export default class TrainBody extends Group {
z: model.z + 1,
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
text: 'AA',
text: model.destinationCode,
textFill: '#00C300',
textStroke: style.trainTextColor,
textStrokeWidth: 0,
@ -239,7 +239,7 @@ export default class TrainBody extends Group {
z: model.z + 1,
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
text: '0',
text: model.dt > 0 ? '+' + model.dt : model.dt,
textFill: '#DADA00',
textStroke: style.trainTextColor,
textStrokeWidth: 0,
@ -300,12 +300,61 @@ export default class TrainBody extends Group {
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
}
getBoundingRect() {
const rect = new BoundingRect(0, 0, 0, 0);
if (this.trainBodyBox) {
const tempRect = this.trainBodyBox.getBoundingRect().clone();
rect.union(tempRect);
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});
} else if (planRoutingTypes === 'SMALL') {
this.style.Train.trainTarget.smallColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.smallColor});
} else if (planRoutingTypes === 'INBOUND') {
this.style.Train.trainTarget.inboundColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.inboundColor});
}
}
setTrainTypeColor(type) {
if (type === 'PLAN') {
this.style.Train.trainTarget.planTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.planTypeColor});
} else if (type === 'MANUAL') {
this.style.Train.trainTarget.manualTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.manualTypeColor});
} else if (type === 'HEAD') {
this.style.Train.trainTarget.headTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainTarget.headTypeColor});
}
}
setSoonerOrLater(dt) {
if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 5) {
if (dt > 120) {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.severeEarlyColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.severeEarlyColor});
} else if (dt >= 15 && dt <= 120) {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.earlyColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor});
} else if (dt <= -15 && dt >= -120) {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.lateColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.lateColor});
} else if (dt < -120) {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.severeLateColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.severeLateColor});
} else {
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.normalColor});
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.normalColor});
}
} else if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 3) {
if (dt > 120) {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.earlyColor});
} else if (dt < -120) {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.lateColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.lateColor});
} else {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.normalColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.normalColor});
}
}
return rect;
}
formatChangePosition(model, style) {
if (this.nameFormat) {

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import BoundingRect from 'zrender/src/core/BoundingRect';
export default class TrainBodyBox extends Group {
constructor(model) {
@ -30,4 +31,10 @@ export default class TrainBodyBox extends Group {
setColor(key, color) {
this.trainBodyBox.setStyle(key, color);
}
getBoundingRect() {
if (this.trainBodyBox) {
const tempRect = this.trainBodyBox.getBoundingRect().clone();
return tempRect;
}
}
}

View File

@ -85,6 +85,7 @@ export default class Train extends Group {
type: model.type,
speed: model.speed,
maLen: model.maLen,
dt: model.dt,
model: model
});
this.trainL = new TrainHead({
@ -323,7 +324,10 @@ export default class Train extends Group {
});
}
}
// 早晚点状态
setSoonerOrLater(dt) {
this.trainB && this.trainB.setSoonerOrLater(dt);
}
// 设置扣车状态
setHoldStatus(status) {
if (status) {
@ -403,7 +407,9 @@ export default class Train extends Group {
this.setAlarmStatus(model.alarmStatus);
this.setHoldStatus(model.hold);
this.setJumpStatus(model.jump);
this.setSoonerOrLater(model.dt);
this.setPlanRoutingTypeColor(model.planRoutingType);
this.setTrainTypeColor(model.type);
const style = this.style;
if (style.Section.trainPosition.display) {
this.updateSection(object);
@ -423,6 +429,12 @@ export default class Train extends Group {
// this.setTrainTypeStatus(model.type); // 根据列车类型设置列车识别号样式
// }
}
setTrainTypeColor(type) {
this.trainB && this.trainB.setTrainTypeColor(type);
}
setPlanRoutingTypeColor(planRoutingType) {
this.trainB && this.trainB.setPlanRoutingTypeColor(planRoutingType);
}
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
isChangeTrainWidth(model, style) {
if (!style.Train.trainBody.changeTrainWidth) { return; }

View File

@ -1,19 +1,17 @@
<template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<!-- <el-input v-model="addModel.trainCode" /> -->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<!-- <el-input v-model="addModel.tripNumber" /> -->
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
@ -29,10 +27,10 @@
<!-- <el-input v-model="addModel.serviceNumber" /> -->
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
@ -67,14 +65,10 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
@ -84,7 +78,7 @@ export default {
},
dialogShow: false,
loading: false
}
};
},
computed: {
...mapGetters('map', [
@ -130,12 +124,11 @@ export default {
},
doShow(operate, selected) {
this.selected = selected;
//
//
if (!this.dialogShow) {
}
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
@ -167,9 +160,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
@ -193,7 +185,7 @@ export default {
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -216,7 +208,7 @@ export default {
});
}
}
}
};
</script>
<style scoped>
.beijing-01__systerm .el-dialog .base-label {

View File

@ -6,6 +6,7 @@
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
<set-fault ref="setFault" />
<train-add-plan ref="trainAddPlan" />
</div>
</template>
@ -23,6 +24,7 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from './utils/menuOperate';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import TrainAddPlan from './dialog/trainAddPlan';
export default {
name: 'SectionMenu',
@ -32,7 +34,8 @@ export default {
SpeedLimitControl,
AlxeEffective,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -111,6 +114,16 @@ export default {
'buttonOperation'
])
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -157,6 +170,23 @@ export default {
}
}
},
//
addPlanTrain() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(operate, this.selected);
}
});
},
// //
// alxeFailure() {
// const operate = {

View File

@ -7,7 +7,6 @@
<train-move ref="trainMove" />
<train-edit ref="trainEdit" />
<train-set-plan ref="trainSetPlan" />
<train-add-plan ref="trainAddPlan" />
<train-move-evently ref="trainMoveEvently" />
<train-delete-plan ref="trainDeletePlan" />
<train-set-head ref="trainSetHead" />
@ -28,7 +27,6 @@ import TrainDefine from './dialog/trainDefine';
import TrainMove from './dialog/trainMove';
import TrainEdit from './dialog/trainEdit';
import TrainSetPlan from './dialog/trainSetPlan';
import TrainAddPlan from './dialog/trainAddPlan';
import TrainMoveEvently from './dialog/trainMoveEvently';
import TrainDeletePlan from './dialog/trainDeletePlan';
import TrainSetHead from './dialog/trainSetHead';
@ -49,7 +47,6 @@ export default {
TrainMove,
TrainEdit,
TrainSetPlan,
TrainAddPlan,
TrainMoveEvently,
TrainDeletePlan,
TrainSetHead,
@ -163,11 +160,6 @@ export default {
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// }
{
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
],
Center: [
// {
@ -264,11 +256,11 @@ export default {
// disabledCallback: MenuDisabledState.Train.moveTrainId,
// auth: { station: true, center: true }
// },
{
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
// {
// label: '',
// handler: this.addPlanTrain,
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
// }
]
},
menuForce: [
@ -482,23 +474,6 @@ export default {
}
});
},
//
addPlanTrain() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.$store.state.map.trainWindowSectionCode
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(operate, this.selected);
}
});
},
//
moveEventlyTrain() {
const operate = {

View File

@ -12,39 +12,28 @@
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
<el-form-item prop="trainCode" label="车组号:">
<!--<el-input v-model="addModel.trainCode"/>-->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<!-- <el-input v-model="serviceNumber" disabled="true"/> -->
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<!-- <el-input v-model="serviceNumber" disabled="true"/> -->
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
@ -78,14 +67,10 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode:'',
tripNumber:'',
serviceNumber: ''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serverNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'}
],
@ -145,7 +130,6 @@ export default {
this.selected = selected;
//
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
@ -177,10 +161,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}

View File

@ -5,6 +5,7 @@
<section-control ref="sectionControl" />
<section-cmd-control ref="sectionCmdControl" />
<speed-limit-control ref="speedLimitControl" />
<train-init-plan ref="trainInitPlan" />
<set-fault ref="setFault" />
</div>
</template>
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import {menuOperate, commitOperate} from './utils/menuOperate';
import TrainInitPlan from './dialog/trainInitPlan';
export default {
name: 'SectionMenu',
@ -31,7 +33,8 @@ export default {
SpeedLimitControl,
SectionControl,
SectionCmdControl,
SetFault
SetFault,
TrainInitPlan
},
props: {
selected: {
@ -97,6 +100,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push( {
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -113,6 +126,23 @@ export default {
this.menu = this.menuForce;
}
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
doShow(point) {
this.clickEvent();
this.initMenu();

View File

@ -1,14 +1,12 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<train-init-plan ref="trainInitPlan" />
<notice-info ref="noticeInfo" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import TrainInitPlan from './dialog/trainInitPlan';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { MenuDisabledState } from './utils/menuItemStatus';
import { mapGetters } from 'vuex';
@ -23,7 +21,6 @@ export default {
components: {
PopMenu,
NoticeInfo,
TrainInitPlan
},
mixins: [
CancelMouseState
@ -123,12 +120,6 @@ export default {
// handler: '',
// cmdType: ''
// }
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
]
},
menuForce: [
@ -390,23 +381,6 @@ export default {
}
});
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {

View File

@ -12,38 +12,27 @@
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
<el-form-item prop="trainCode" label="车组号:">
<!--<el-input v-model="addModel.trainCode"/>-->
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange" filterable>
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
@ -77,14 +66,10 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode:'',
tripNumber:'',
serviceNumber: ''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'change'}
],
@ -138,7 +123,6 @@ export default {
this.selected = selected;
//
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber: ''
};
@ -170,10 +154,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}

View File

@ -6,6 +6,7 @@
<section-detail ref="sectionDetail" />
<notice-info ref="noticeInfo" />
<set-fault ref="setFault" />
<train-init-plan ref="trainInitPlan" />
</div>
</template>
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import {menuOperate, commitOperate} from './utils/menuOperate';
import TrainInitPlan from './dialog/trainInitPlan';
export default {
name: 'SectionMenu',
@ -31,7 +33,8 @@ export default {
SectionDetail,
TrainCreate,
NoticeInfo,
SetFault
SetFault,
TrainInitPlan
},
props: {
selected: {
@ -66,6 +69,7 @@ export default {
auth: { station: false, center: true },
cmdType: CMD.Section.CMD_SECTION_DETAILS
}
]
},
menuForce: [
@ -100,6 +104,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push( {
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -206,6 +220,23 @@ export default {
callback: action => {
}
});
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
}
}
};

View File

@ -8,7 +8,6 @@
<train-move-number ref="trainMoveNumber" />
<train-delete-number ref="trainDeleteNumber" />
<train-detail-info ref="trainDetailInfo" />
<train-init-plan ref="trainInitPlan"/>
</div>
</template>
@ -23,7 +22,6 @@ import TrainEditNumber from './dialog/trainEditNumber';
import TrainMoveNumber from './dialog/trainMoveNumber';
import TrainCreateNumber from './dialog/trainCreateNumber';
import TrainDeleteNumber from './dialog/trainDeleteNumber';
import TrainInitPlan from './dialog/trainInitPlan';
import TrainDetailInfo from './dialog/trainDetailInfo';
import CancelMouseState from '@/mixin/CancelMouseState';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -41,7 +39,6 @@ export default {
TrainCreateNumber,
TrainDeleteNumber,
TrainDetailInfo,
TrainInitPlan
},
mixins: [
CancelMouseState
@ -125,11 +122,6 @@ export default {
handler: this.undeveloped,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true}
},
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
]
},
@ -389,23 +381,6 @@ export default {
}
});
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {

View File

@ -42,6 +42,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
@ -64,6 +65,9 @@ export default {
};
},
computed: {
...mapGetters('map', [
'overlapData'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -156,7 +160,25 @@ export default {
}
});
}
if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) {
this.overlapData[row.overlapCode].pathList.forEach(item => {
if (item.sectionList && item.sectionList.length) {
item.sectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(logicSectionCode => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
});
}
this.$store.dispatch('training/updateMapState', [...containSectionList]);
this.beforeSectionList = containSectionList || [];

View File

@ -12,16 +12,6 @@
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
@ -73,15 +63,11 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
@ -142,7 +128,6 @@ export default {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
@ -175,9 +160,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}

View File

@ -5,6 +5,7 @@
<section-un-lock ref="sectionUnLock" />
<speed-limit-control ref="speedLimitControl" />
<notice-info ref="noticeInfo" />
<train-add-plan ref="trainAddPlan" />
<set-fault ref="setFault" />
</div>
</template>
@ -21,6 +22,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import TrainAddPlan from './dialog/trainAddPlan';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'SectionMenu',
@ -30,7 +33,8 @@ export default {
SectionUnLock,
SpeedLimitControl,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -111,6 +115,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -138,6 +152,24 @@ export default {
this.$refs.popMenu.close();
}
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{

View File

@ -7,7 +7,6 @@
<train-move ref="trainMove" />
<!-- <train-edit ref="trainEdit" /> -->
<train-set-plan ref="trainSetPlan" />
<train-add-plan ref="trainAddPlan" />
<!-- <train-move-evently ref="trainMoveEvently" /> -->
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
<train-set-head ref="trainSetHead" />
@ -25,7 +24,6 @@ import TrainDefine from './dialog/trainDefine';
import TrainMove from './dialog/trainMove';
// import TrainEdit from './dialog/trainEdit';
import TrainSetPlan from './dialog/trainSetPlan';
import TrainAddPlan from './dialog/trainAddPlan';
// import TrainMoveEvently from './dialog/trainMoveEvently';
// import TrainDeletePlan from './dialog/trainDeletePlan';
import TrainSetHead from './dialog/trainSetHead';
@ -49,7 +47,6 @@ export default {
TrainMove,
// TrainEdit,
TrainSetPlan,
TrainAddPlan,
// TrainMoveEvently,
// TrainDeletePlan,
TrainSetHead,
@ -420,24 +417,6 @@ export default {
}
});
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.$store.state.map.trainWindowSectionCode
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
//
setHeadTrain() {
const operate = {

View File

@ -49,6 +49,8 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
@ -70,6 +72,9 @@ export default {
};
},
computed: {
...mapGetters('map', [
'overlapData'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -161,30 +166,56 @@ export default {
this.row = row;
if (row) {
//
this.row.canSetting = true;
this.restoreBeforeDevices();
const containSectionList = [];
if (row.canSetting) {
//
if (row.containSectionList && row.containSectionList.length) {
if (row.routeSectionList && row.routeSectionList.length) {
//
row.containSectionList.forEach(elem => {
elem.cutOff = true;
row.routeSectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(item => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
this.beforeSectionList = row.containSectionList || [];
if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) {
this.overlapData[row.overlapCode].pathList.forEach(item => {
if (item.sectionList && item.sectionList.length) {
item.sectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(logicSectionCode => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
});
}
this.$store.dispatch('training/updateMapState', [...containSectionList]);
this.beforeSectionList = containSectionList || [];
//
const operate = {
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code,
param: {
Route_Code: row.code
}
val: row.code
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}

View File

@ -0,0 +1,212 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
// name: 'TrainMove',
name: 'TrainAddPlan',
components: {
},
data() {
return {
trainNoList: [],
selected: null,
tripNumberList: [],
serviceNumberList: [],
addModel: {
serviceNumber: '', //
tripNumber: '' //
},
rules: {
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '创建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumberList = [];
if (typeof resp.data == 'string') {
this.serviceNumberList.push(resp.data);
} else {
resp.data.forEach(item => {
if (!this.serviceNumberList.includes(item)) {
this.serviceNumberList.push(item);
}
});
}
if (this.serviceNumberList.length === 1) {
this.addModel.serviceNumber = this.serviceNumberList[0];
}
});
},
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.addModel = {
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
}).catch(error => {
console.log(error);
// this.$messageBox(error.message);
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
// this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.doClose();
}
})
.catch(() => {
this.doClose();
});
}
}
};
</script>
<style scoped>
.foshan-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -6,6 +6,7 @@
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
<set-fault ref="setFault" />
<train-add-plan ref="trainAddPlan" />
</div>
</template>
@ -23,6 +24,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import {menuOperate, commitOperate} from './utils/menuOperate';
import TrainAddPlan from './dialog/trainAddPlan';
export default {
name: 'SectionMenu',
@ -32,7 +34,8 @@ export default {
SectionCmdControl,
SpeedCmdControl,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -159,6 +162,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -175,6 +188,24 @@ export default {
this.menu = this.menuForce;
}
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
doShow(point) {
this.clickEvent();
this.initMenu();

View File

@ -12,38 +12,27 @@
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
trainCode" label="车组号:">
inCode"/>-->
rainCode" filterable>
"车次号:" prop="tripNumber">
dModel.tripNumber"/>-->
del.tripNumber" filtefiltefiltefilt filtefilterable @change="tripNumberChange"
item>
tem label="服务号:" prop="serviceNumber">
addModel.serviceNumber" filterable>
t"
item>
<el-form-item label="车次号:" prop="tripNumber">
<!--<el-input v-model="addModel.tripNumber"/>-->
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服务号:" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
@ -77,14 +66,10 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode:'',
tripNumber:'',
serviceNumber: ''
},
rules: {
trainCode: [
{ required: true, message: '请输入列车编码', trigger: 'blur'}
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'change'}
],
@ -138,7 +123,6 @@ export default {
this.selected = selected;
//
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber: ''
};
@ -150,7 +134,7 @@ export default {
}
});
}).catch(error => {
console.log(error);;
console.log(error);
// this.$messageBox(error.message);
});
this.dialogShow = true;
@ -171,10 +155,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
sectionCode: this.trainWindowSectionCode,
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
@ -186,7 +168,7 @@ export default {
this.doClose();
}
}).catch(error => {
; ;onsole.log(error);
onsole.log(error);
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);

View File

@ -6,6 +6,7 @@
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
<set-fault ref="setFault" />
<train-init-plan ref="trainInitPlan" />
</div>
</template>
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import {menuOperate, commitOperate} from './utils/menuOperate';
import TrainInitPlan from './dialog/trainInitPlan';
export default {
name: 'SectionMenu',
@ -31,7 +33,8 @@ export default {
SectionCmdControl,
SpeedCmdControl,
NoticeInfo,
SetFault
SetFault,
TrainInitPlan
},
props: {
selected: {
@ -106,6 +109,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.createPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -134,6 +147,23 @@ export default {
this.$refs.popMenu.close();
}
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{

View File

@ -7,7 +7,6 @@
<train-move ref="trainMove" />
<train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber" />
<train-init-plan ref="trainInitPlan"/>
</div>
</template>
@ -23,7 +22,6 @@ import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber';
import TrainInitPlan from './dialog/trainInitPlan';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
@ -35,8 +33,7 @@ export default {
TrainDelete,
TrainMove,
TrainSwitch,
TrainEditNumber,
TrainInitPlan
TrainEditNumber
},
props: {
selected: {
@ -51,18 +48,18 @@ export default {
menu: [],
menuNormal: {
Local: [
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
// {
// label: '',
// handler: this.createPlanTrain,
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
// }
],
Center: [
{
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
}
// {
// label: '',
// handler: this.createPlanTrain,
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
// }
]
},
menuForce: [
@ -140,23 +137,6 @@ export default {
// this.$store.dispatch('map/setTrainWindowShow', false);
}
},
createPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
trainWindowCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainInitPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
const step = {

View File

@ -38,6 +38,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
@ -62,6 +63,9 @@ export default {
};
},
computed: {
...mapGetters('map', [
'overlapData'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -166,7 +170,25 @@ export default {
}
});
}
if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) {
this.overlapData[row.overlapCode].pathList.forEach(item => {
if (item.sectionList && item.sectionList.length) {
item.sectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(logicSectionCode => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
});
}
this.$store.dispatch('training/updateMapState', [...containSectionList]);
this.beforeSectionList = containSectionList || [];

View File

@ -12,33 +12,23 @@
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
@ -61,7 +51,6 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
// name: 'TrainMove',
name: 'TrainAddPlan',
@ -74,15 +63,11 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
@ -143,7 +128,6 @@ export default {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
@ -155,7 +139,7 @@ export default {
}
});
}).catch(error => {
console.log(error);
console.log(error);
// this.$messageBox(error.message);
});
this.dialogShow = true;
@ -176,9 +160,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}

View File

@ -6,7 +6,8 @@
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-control ref="menuStationControl" :selected="selected" />>
<menu-station-control ref="menuStationControl" />
<!-- :selected="selected" -->
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />

View File

@ -6,6 +6,7 @@
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
<train-add-plan ref="trainAddPlan" />
<set-fault ref="setFault" />
</div>
</template>
@ -23,6 +24,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import TrainAddPlan from './dialog/trainAddPlan';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'SectionMenu',
@ -33,7 +36,8 @@ export default {
SpeedLimitControl,
AlxeEffective,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -129,6 +133,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -156,6 +170,24 @@ export default {
this.$refs.popMenu.close();
}
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
// //
// alxeFailure() {
// this.mouseCancelState(this.selected);

View File

@ -20,14 +20,14 @@ export default {
PopMenu,
StationControl
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
// props: {
// selected: {
// type: Object,
// default() {
// return null;
// }
// }
// },
data() {
return {
menu: [],

View File

@ -7,7 +7,6 @@
<train-move ref="trainMove" />
<!-- <train-edit ref="trainEdit" /> -->
<train-set-plan ref="trainSetPlan" />
<train-add-plan ref="trainAddPlan" />
<!-- <train-move-evently ref="trainMoveEvently" /> -->
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
<train-set-head ref="trainSetHead" />
@ -24,7 +23,6 @@ import TrainDelete from './dialog/trainDelete';
import TrainDefine from './dialog/trainDefine';
import TrainMove from './dialog/trainMove';
import TrainSetPlan from './dialog/trainSetPlan';
import TrainAddPlan from './dialog/trainAddPlan';
import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork';
import trainSetWorkATP from './dialog/trainSetWorkATP';
@ -44,7 +42,6 @@ export default {
TrainDefine,
TrainMove,
TrainSetPlan,
TrainAddPlan,
TrainSetHead,
TrainSetWork,
trainSetWorkATP
@ -148,11 +145,6 @@ export default {
handler: this.moveTrainId,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
},
{
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
},
{
type: 'separator'
},
@ -407,24 +399,6 @@ export default {
}
});
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.$store.state.map.trainWindowSectionCode
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
//
setHeadTrain() {
const operate = {

View File

@ -32,8 +32,7 @@ export default {
data() {
return {
dialogShow: false,
messages: [this.$t('tip.commandFailed')],
operate: null
messages: [this.$t('tip.commandFailed')]
};
},
computed: {
@ -53,8 +52,7 @@ export default {
});
},
methods: {
doShow(operate, messages) {
this.operate = operate || {};
doShow(messages) {
this.dialogShow = true;
this.messages = [this.$t('tip.commandFailed')];
if (messages && messages != 'null') {

View File

@ -170,7 +170,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -187,10 +187,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow();
});
},
//
@ -207,10 +207,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow();
});
},
//
@ -230,7 +230,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -250,7 +250,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
// ATS
@ -270,7 +270,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -291,7 +291,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -312,7 +312,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -333,7 +333,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -152,7 +152,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -151,10 +151,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
//
@ -206,7 +206,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -226,7 +226,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -246,7 +246,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -267,7 +267,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -281,7 +281,7 @@ export default {
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
}
}

View File

@ -143,7 +143,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -297,10 +297,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
//
@ -311,10 +311,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -138,10 +138,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
cancel() {
@ -154,7 +154,7 @@ export default {
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
}
}

View File

@ -51,6 +51,7 @@ import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { deepAssign } from '@/utils/index';
import { menuOperate, commitOperate } from '../utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
@ -72,6 +73,9 @@ export default {
};
},
computed: {
...mapGetters('map', [
'overlapData'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -184,7 +188,25 @@ export default {
}
});
}
if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) {
this.overlapData[row.overlapCode].pathList.forEach(item => {
if (item.sectionList && item.sectionList.length) {
item.sectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(logicSectionCode => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
});
}
this.$store.dispatch('training/updateMapState', [...containSectionList]);
this.beforeSectionList = containSectionList || [];
@ -210,10 +232,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
}
},

View File

@ -129,10 +129,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -117,10 +117,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},

View File

@ -214,7 +214,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
} else {
this.doClose();

View File

@ -153,10 +153,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -170,7 +170,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -79,6 +79,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { now } from '@/utils/date';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StationCmdControl',
@ -311,11 +312,11 @@ export default {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
// operate.cmdType = CMD.Station.powerUnLock;
operate.cmdType = CMD.Station.CMD_STATION_POWER_ON_UNLOCK;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
// operate.cmdType = CMD.Station.execKeyOperationTest;
operate.cmdType = CMD.Station.CMD_STATION_KEY_OPERATION_TEST;
}
this.setMessage('');

View File

@ -95,7 +95,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -117,7 +117,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -144,10 +144,10 @@ export default {
if (valid) {
this.doClose();
}
}).catch((error) => {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
this.$refs.noticeInfo.doShow();
});
},

View File

@ -0,0 +1,227 @@
<template>
<el-dialog
v-dialogDrag
class="xian-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<!--<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">-->
<!--<el-select v-model="addModel.trainCode" filterable>-->
<!--<el-option-->
<!--v-for="train in trainList"-->
<!--:key="train.groupNumber"-->
<!--:label="train.groupNumber"-->
<!--:value="train.code"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
// name: 'TrainMove',
name: 'TrainAddPlan',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
tripNumberList: [],
serviceNumberList: [],
addModel: {
serviceNumber: '', //
tripNumber: '' //
},
rules: {
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '创建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumberList = [];
if (typeof resp.data == 'string') {
this.serviceNumberList.push(resp.data);
} else {
resp.data.forEach(item => {
if (!this.serviceNumberList.includes(item)) {
this.serviceNumberList.push(item);
}
});
}
if (this.serviceNumberList.length === 1) {
this.addModel.serviceNumber = this.serviceNumberList[0];
}
});
},
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.addModel = {
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
}).catch(error => {
console.log(error);
// this.$messageBox(error.message);
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
// this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.$refs.noticeInfo.doShow();
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.doClose();
}
})
.catch(() => {
this.doClose();
});
}
}
};
</script>
<style scoped>
.foshan-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -17,19 +17,19 @@
/>
</el-select>
</el-form-item>
<el-form-item prop="trainType" label-width="0px">
<el-form-item prop="type" label-width="0px">
<el-radio-group
:id="domIdTrainType"
v-model="formModel.trainType"
v-model="formModel.type"
style="margin-left: 15px;"
@change="trainTypeChange"
>
<el-radio :label="'01'">{{ $t('menu.planTrain') }}</el-radio>
<el-radio :label="'02'">{{ $t('menu.headCodeTrain') }}</el-radio>
<el-radio :label="'03'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
<el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
<el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="formModel.trainType == '01'" prop="serviceNumber">
<el-form-item v-if="formModel.type == 'PLAN'" prop="serviceNumber">
<span slot="label">{{ $t('menu.serviceNumber') }}</span>
<el-input
:id="domIdServerNo"
@ -37,40 +37,38 @@
:disabled="serverNoIsDisabled"
/>
</el-form-item>
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
<el-form-item v-if="formModel.type == 'PLAN'|| formModel.type == 'HEAD'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
<el-input
:id="domIdTrainNo"
v-model="formModel.tripNumber"
:disabled="trainNoIsDisabled"
maxlength="4"
/>
</el-form-item>
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="targetCode">
<el-form-item v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="destinationCode">
<el-input
:id="domIdTargetCode"
v-model="formModel.targetCode"
:disabled="targetCodeIsDisabled"
v-model="formModel.destinationCode"
/>
</el-form-item>
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
<el-select
:id="domIdTrainNumber"
v-model="formModel.category"
filterable
:disabled="true"
>
<el-option
v-for="item in categoryList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<!--<el-form-item v-if="formModel.type == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">-->
<!--<el-select-->
<!--:id="domIdTrainNumber"-->
<!--v-model="formModel.category"-->
<!--filterable-->
<!--:disabled="true"-->
<!--&gt;-->
<!--<el-option-->
<!--v-for="item in categoryList"-->
<!--:key="item.value"-->
<!--:label="item.name"-->
<!--:value="item.value"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="istargetCode" @click="commit">{{ $t('global.confirm') }}</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
@ -88,6 +86,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import Handler from '@/scripts/cmdPlugin/Handler';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'TrainControl',
@ -104,9 +103,9 @@ export default {
formModel: {
tripNumber: '',
groupNumber: '',
trainType: '01',
type: 'PLAN',
serviceNumber: '',
targetCode: '',
destinationCode: '',
category: 'MM'
},
@ -114,7 +113,7 @@ export default {
groupNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
],
trainType: [
type: [
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
],
serviceNumber: [
@ -123,7 +122,7 @@ export default {
tripNumber: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
targetCode: [
destinationCode: [
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
]
},
@ -252,20 +251,20 @@ export default {
}
},
watch: {
'formModel.tripNumber': function(val) {
if (val.length == 4) {
this.trainNoChange(val);
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: val,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
}
// 'formModel.tripNumber': function(val) {
// if (val.length == 4) {
// // this.trainNoChange(val);
// } else {
// this.formModel = {
// groupNumber: this.formModel.groupNumber,
// tripNumber: val,
// type: this.formModel.type,
// serviceNumber: '',
// destinationCode: '',
// category: 'MM'
// };
// }
// }
},
mounted() {
this.$nextTick(() => {
@ -282,13 +281,12 @@ export default {
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
trainType: model.type,
tripNumber: model.tripNumber,
type: model.type ? model.type : 'PLAN',
serviceNumber: model.serviceNumber,
targetCode: model.targetCode,
destinationCode: model.destinationCode,
category: 'MM'
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
@ -415,7 +413,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
} else {
return false;
@ -426,27 +424,52 @@ export default {
editTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
messages: [this.$t('tip.editTrainIdTip')],
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
// const operate = {
// send: true,
//
// operation: OperationEvent.Train.editTrainId.menu.operation,
// cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
// messages: [this.$t('tip.editTrainIdTip')],
// val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
// };
//
// this.loading = true;
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// this.loading = false;
// if (valid) {
// this.doClose();
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.confirmTrain.doShow(operate);
// }
// }).catch(() => {
// this.loading = false;
// this.doClose();
// this.$refs.noticeInfo.doShow();
// });
const params = {
groupNumber: this.formModel.groupNumber,
type: this.formModel.type,
serviceNumber: '',
tripNumber: '',
destinationCode: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (this.formModel.type === '01') {
params.serviceNumber = this.formModel.serviceNumber;
params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
} else if (this.formModel.type === '02') {
params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
}
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -133,7 +133,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
cancel() {

View File

@ -143,7 +143,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -0,0 +1,180 @@
<template>
<el-dialog v-dialogDrag class="xian-01__systerm train-control" :title="title" :visible.sync="show" width="370px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-select
v-model="groupNumber"
filterable
:disabled="true"
>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
<el-table :data="tableData" :show-header="false">
<el-table-column prop="key" label="key" />
<el-table-column prop="value" label="value" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Handler from '@/scripts/cmdPlugin/Handler';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default {
name: 'TrainControl',
components: {
},
data() {
return {
trainList: [],
tableData: [],
baseInfo: [],
marshallingInfo: [],
planInfo: [],
atcInfo: [],
operation: null,
dialogShow: false,
loading: false,
groupNumber: ''
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
return OperationEvent.Train.trainDetailInfo.confirm.operation;
},
domIdCancel() {
return OperationEvent.Command.cancel.menu.domId;
},
title() {
return '列车详细运行信息';
}
},
watch: {},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.groupNumber = model.groupNumber;
this.baseInfo = [
{key: '车组号', value: model.groupNumber},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '目的地号', value: ''},
{key: '类型', value: ''},
{key: '司机号', value: ''},
{key: '车站', value: ''},
{key: '所处设备', value: ''},
{key: '跟踪模式', value: ''},
{key: 'ATP切除', value: ''},
{key: '停站状态', value: ''}
];
this.marshallingInfo = [
{key: '车组号', value: ''},
{key: '设备ID', value: ''},
{key: '车头号1', value: ''},
{key: '车头号2', value: ''},
{key: '车厢号1', value: ''},
{key: '车厢号2', value: ''},
{key: '车厢号3', value: ''},
{key: '车厢号4', value: ''},
{key: '车厢号5', value: ''},
{key: '车厢号6', value: ''},
{key: '车厢号7', value: ''},
{key: '车厢号8', value: ''}
];
this.planInfo = [
{key: '车组号', value: ''},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '运行等级', value: ''},
{key: '状态', value: ''},
{key: '计划偏离', value: ''},
{key: '停站时间', value: ''},
{key: '计划到站', value: ''},
{key: '计划到点', value: ''},
{key: '计划发点', value: ''},
{key: '终端发车站台', value: ''},
{key: '终端发车时间', value: ''},
{key: '预计离开站台', value: ''},
{key: '预计离开时间', value: ''},
{key: '预计到达站台', value: ''},
{key: '预计到达时间', value: ''},
{key: '区间运行时分', value: ''}
];
this.atcInfo = [
{key: '车组号', value: ''},
{key: '车次号', value: ''},
{key: '表号', value: ''},
{key: '运行方向', value: ''},
{key: '扣车状态', value: ''},
{key: '车门状态', value: ''},
{key: '驾驶模式', value: ''},
{key: '目的地号', value: ''}
];
this.tableData = this.baseInfo;
/** 加载列车数据*/
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
const operate = {
operation: OperationEvent.Train.trainDetailInfo.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -167,7 +167,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -172,7 +172,7 @@ export default {
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -67,6 +67,10 @@
</template>
</template>
</div>
<!--<div class="deviceStatus">-->
<!--<div class="holdTrainStatus">H</div>-->
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<station-control-convert ref="stationControlConvert" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
@ -694,7 +698,7 @@ export default {
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
$width: 30px;
$height: 30px;
$height:30px;
$menuPadding: 10px;
$menuItemHeight: 30px;
$menuItemWidth: 190px;
@ -810,4 +814,21 @@ export default {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.deviceStatus{
display: inline-block;
font-size: 0;
height: 40px;
background: #f0f0f0;
width: 300px;
}
.holdTrainStatus,.jumpStopStatus{
color: #fff;
display: inline-block;
width: 30px;
height: 30px;
text-align: center;
background: #ccc;
font-size:14px;
}
</style>

View File

@ -63,12 +63,12 @@ export default {
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.chargeStationCodeList && station.chargeStationCodeList.length) {
if (station.relStationCodeList && station.relStationCodeList.length) {
const node = {
label: station.name,
children: []
};
station.chargeStationCodeList.forEach(item => {
station.relStationCodeList.forEach(item => {
const next = this.$store.getters['map/getDeviceByCode'](item);
node.children.push({
code: next.code,

View File

@ -121,8 +121,8 @@ export default {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
}

View File

@ -164,7 +164,7 @@ export default {
});
});
} else {
this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]);
this.$refs.noticeInfo.doShow(this.$t('menu.menuDialog.IncorrectPassword'));
}
},

View File

@ -136,12 +136,12 @@ export default {
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -118,12 +118,12 @@ export default {
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -135,12 +135,12 @@ export default {
if (valid) {
this.doClose();
} else {
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
// this.$refs.noticeInfo.doShow();
});
} else {
return false;

View File

@ -6,6 +6,7 @@
<speed-cmd-control ref="speedCmdControl" />
<notice-info ref="noticeInfo" />
<set-fault ref="setFault" />
<train-add-plan ref="trainAddPlan" />
</div>
</template>
@ -21,6 +22,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import TrainAddPlan from './dialog/trainAddPlan';
export default {
name: 'SectionMenu',
@ -30,7 +33,8 @@ export default {
SectionCmdControl,
SpeedCmdControl,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -142,6 +146,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -151,6 +165,7 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
@ -170,6 +185,24 @@ export default {
this.$refs.popMenu.close();
}
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{

View File

@ -56,46 +56,30 @@ export default {
// {
// label: '',
// handler: this.powerUnLock,
// cmdType: CMD.Station.active,
// cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
// },
// {
// label: '',
// handler: this.execKeyOperationTest,
// cmdType: CMD.Station.active,
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
// }
],
Center: [
{
label: '所有进路自排关',
label: '所有进路交人工控',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
},
{
label: '所有进路自排开',
label: '所有进路交ATS自动控',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
},
{
label: '上电解锁',
handler: this.powerUnLock,
cmdType: CMD.Station.active
label: '执行关键操作测试',
handler: this.execKeyOperationTest,
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST
}
// {
// label: '',
// handler: this.humanControlALL,
// cmdType: ''
// },
// {
// label: 'ATS',
// handler: this.atsAutoControlALL,
// cmdType: ''
// }
// {
// label: '',
// handler: this.execKeyOperationTest,
// cmdType: CMD.Station.active,
// auth: { station: false, center: true }
// }
]
},
menuForce: [
@ -140,9 +124,6 @@ export default {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
//
if (this.operatemode === OperateMode.FAULT) {
@ -150,10 +131,12 @@ export default {
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
if (this.selected.ciStation) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
}
},
doClose() {
@ -174,10 +157,10 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -193,10 +176,10 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -212,7 +195,7 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -228,7 +211,7 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
//
@ -259,12 +242,15 @@ export default {
}
});
},
//
//
humanControlALL() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.humanControlALL.menu.operation
operation: OperationEvent.Station.humanControlALL.menu.operation,
param:{
stationCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -273,12 +259,15 @@ export default {
}
});
},
//
// ATS
atsAutoControlALL() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
param:{
stationCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {

View File

@ -49,42 +49,51 @@ export default {
menuNormal: {
Local: [],
Center: [
// {
// label: this.$t('menu.menuTrain.addTrainId'),
// handler: this.addTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.deleteTrainId'),
// handler: this.delTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainId'),
// handler: this.editTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.editTrainNo'),
// handler: this.editTrainNo,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.moveTrainId'),
// handler: this.moveTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// },
// {
// label: this.$t('menu.menuTrain.switchTrainId'),
// handler: this.switchTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// }
{
label: this.$t('menu.menuTrain.addTrainId'),
handler: this.addTrainId,
cmdType:''
},
{
label: this.$t('menu.menuTrain.deleteTrainId'),
handler: this.delTrainId,
cmdType:''
},
{
label: this.$t('menu.menuTrain.editTrainId'),
handler: this.editTrainId,
cmdType:CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: this.$t('menu.menuTrain.editTrainNo'),
handler: this.editTrainNo,
cmdType:''
},
{
label: this.$t('menu.menuTrain.moveTrainId'),
handler: this.moveTrainId,
cmdType:''
},
{
label: this.$t('menu.menuTrain.switchTrainId'),
handler: this.switchTrainId,
cmdType:''
},
{
label: '标记ATP切除',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT
},
{
label: '标记ATP激活',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER
},
{
label: '查看列车详细运行信息',
handler: this.undeveloped(),
cmdType: CMD.TrainWindow.CMD_TRAIN_INFO
}
]
},
menuForce: [
@ -145,8 +154,6 @@ export default {
if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed];
}
// this.menu = MenuContextHandler.covert(this.menu);
},
doShow(point) {
this.clickEvent();
@ -177,10 +184,10 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
});
},
//
@ -198,10 +205,10 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
});
},
//
@ -219,10 +226,10 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow();
});
},
//
@ -310,6 +317,7 @@ export default {
}
});
},
undeveloped() {},
//
switchTrainId() {
const step = {

View File

@ -268,7 +268,7 @@ export default {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
},
refuse() {
@ -292,7 +292,7 @@ export default {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow();
});
}
}

View File

@ -264,6 +264,12 @@ export const menuOperate = {
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
}
},
TrainWindow: {
editTrainId: {
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
},
Common: {
setFault: {
operation: OperationEvent.Section.stoppage.menu.operation,

View File

@ -12,16 +12,6 @@
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
@ -73,15 +63,11 @@ export default {
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
@ -142,7 +128,6 @@ export default {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
@ -175,9 +160,8 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
cmdType: CMD.Section.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}

View File

@ -6,6 +6,7 @@
<speed-limit-control ref="speedLimitControl" />
<alxe-effective ref="alxeEffective" />
<notice-info ref="noticeInfo" />
<train-add-plan ref="trainAddPlan" />
<set-fault ref="setFault" />
</div>
</template>
@ -24,6 +25,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from './utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
import TrainAddPlan from './dialog/trainAddPlan';
export default {
name: 'SectionMenu',
@ -34,7 +36,8 @@ export default {
SpeedLimitControl,
AlxeEffective,
NoticeInfo,
SetFault
SetFault,
TrainAddPlan
},
props: {
selected: {
@ -149,6 +152,16 @@ export default {
}
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.Center.push({
label: '新建计划车',
handler: this.addPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
},
methods: {
clickEvent() {
const self = this;
@ -178,6 +191,24 @@ export default {
this.$refs.popMenu.close();
}
},
// ()
addPlanTrain() {
const step = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainAddPlan.doShow(step, this.selected);
}
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{

Some files were not shown because too many files have changed in this diff Show More