Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
cf6f018929
@ -1,5 +1,5 @@
|
|||||||
# just a flag
|
# just a flag
|
||||||
NODE_ENV = 'Local'
|
NODE_ENV = 'production'
|
||||||
VUE_APP_PRO = 'local'
|
VUE_APP_PRO = 'local'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# just a flag
|
# just a flag
|
||||||
NODE_ENV = 'test'
|
NODE_ENV = 'production'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||||
|
@ -82,7 +82,9 @@ export default {
|
|||||||
},
|
},
|
||||||
subscribeMessage(res) {
|
subscribeMessage(res) {
|
||||||
if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) {
|
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');
|
this.$store.dispatch('socket/setRoomInvite');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -36,3 +36,73 @@ export function participantCompleteCompetition(id, group) {
|
|||||||
method: 'post'
|
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
40
src/api/practical.js
Normal 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
26
src/api/race.js
Normal 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
BIN
src/assets/apply.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 157 KiB |
BIN
src/assets/applyAlready.png
Normal file
BIN
src/assets/applyAlready.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@ -78,6 +78,25 @@
|
|||||||
>{{ item.message }}</span>
|
>{{ item.message }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</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')">
|
<template v-else-if="checkFieldType(item, 'button')">
|
||||||
<el-form-item :key="item.prop" :label="item.label" :style="item.style">
|
<el-form-item :key="item.prop" :label="item.label" :style="item.style">
|
||||||
<el-button
|
<el-button
|
||||||
@ -99,9 +118,9 @@
|
|||||||
|
|
||||||
<template v-else-if="checkFieldType(item, 'checkBox')">
|
<template v-else-if="checkFieldType(item, 'checkBox')">
|
||||||
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
|
<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-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 v-for="item in item.children" :key="item.value" :label="item.value">{{ item.name }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="checkFieldType(item, 'radio')">
|
<template v-else-if="checkFieldType(item, 'radio')">
|
||||||
@ -331,6 +350,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
mobileCodeTime: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -393,6 +413,14 @@ export default {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.form_box{
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.required_box{
|
||||||
|
// content: '*';
|
||||||
|
color: #F56C6C;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -76,5 +76,6 @@ export default {
|
|||||||
iscsDraw: 'Iscs Draw',
|
iscsDraw: 'Iscs Draw',
|
||||||
iscsSystem: 'Iscs System',
|
iscsSystem: 'Iscs System',
|
||||||
studentManage: 'Student manage',
|
studentManage: 'Student manage',
|
||||||
examDetail: 'Exam detail'
|
examDetail: 'Exam detail',
|
||||||
|
raceManage: 'Race manage'
|
||||||
};
|
};
|
||||||
|
@ -80,5 +80,7 @@ export default {
|
|||||||
competitionManage: '竞赛管理',
|
competitionManage: '竞赛管理',
|
||||||
refereeJManage: '仿真管理',
|
refereeJManage: '仿真管理',
|
||||||
homeJsxt: '首页',
|
homeJsxt: '首页',
|
||||||
examDetail: '考试详情'
|
examDetail: '考试详情',
|
||||||
|
raceManage: '竞赛管理',
|
||||||
|
recaList: '报名列表'
|
||||||
};
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
@ -22,7 +22,18 @@ var Staticmodel = {
|
|||||||
deviceType: "stationstand",
|
deviceType: "stationstand",
|
||||||
type: "low",
|
type: "low",
|
||||||
picUrl: "",
|
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
|
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
|
||||||
//../../static/model/device/stationstand.FBX
|
//../../static/model/device/stationstand.FBX
|
||||||
|
|
||||||
|
@ -4,14 +4,18 @@ import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
|||||||
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||||
|
|
||||||
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
|
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
|
||||||
|
import { Standtextureload } from '@/jlmap3d/jl3ddevice/standtextureload.js';
|
||||||
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
|
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
|
||||||
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
|
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
|
||||||
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
|
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
|
||||||
|
|
||||||
|
import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||||
|
|
||||||
|
|
||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
|
|
||||||
var clock = new THREE.Clock();
|
var clock = new THREE.Clock();
|
||||||
export function Jl3ddeviceNew(dom,group,token) {
|
export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||||
var scope = this;
|
var scope = this;
|
||||||
|
|
||||||
this.dom = dom;
|
this.dom = dom;
|
||||||
@ -24,6 +28,8 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
|
|
||||||
let helpbox,textplane;
|
let helpbox,textplane;
|
||||||
let daochamodel;
|
let daochamodel;
|
||||||
|
|
||||||
|
let psdtexturemap = [];
|
||||||
//点击事件状态
|
//点击事件状态
|
||||||
this.raycasterstatus = false;
|
this.raycasterstatus = false;
|
||||||
//动画状态
|
//动画状态
|
||||||
@ -33,6 +39,7 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
//当前动画播放模型
|
//当前动画播放模型
|
||||||
this.animationmodel = null;
|
this.animationmodel = null;
|
||||||
|
|
||||||
|
this.stationtexture = [];
|
||||||
this.devicetext = new Textconfig();
|
this.devicetext = new Textconfig();
|
||||||
|
|
||||||
this.windowstatus = '0';
|
this.windowstatus = '0';
|
||||||
@ -90,6 +97,7 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
this.controls.update();
|
this.controls.update();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener( "mousedown", onselect, false );
|
document.addEventListener( "mousedown", onselect, false );
|
||||||
|
|
||||||
let teststomp = new StompClient();
|
let teststomp = new StompClient();
|
||||||
@ -134,11 +142,29 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
this.anime = null;
|
this.anime = null;
|
||||||
|
|
||||||
this.modelmanager = new ModelManager();
|
this.modelmanager = new ModelManager();
|
||||||
this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
|
getPublish3dMapDetail(skinCode).then(netdata => {
|
||||||
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
|
setpsdstationmap(JSON.parse(netdata.data.stands));
|
||||||
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
|
Standtextureload(scope,JSON.parse(netdata.data.assets));
|
||||||
animate();
|
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() {
|
function animate() {
|
||||||
@ -199,10 +225,14 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data._type == "Psd") {
|
if (data._type == "Psd") {
|
||||||
|
console.log(data);
|
||||||
scope.modelmanager.standmodel.code = data.code;
|
scope.modelmanager.standmodel.code = data.code;
|
||||||
scope.showmodel = scope.modelmanager.standmodel.mesh;
|
scope.showmodel = scope.modelmanager.standmodel.mesh;
|
||||||
scope.scene.add(scope.showmodel);
|
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){
|
if(scope.showmodel){
|
||||||
scope.resetmodel();
|
scope.resetmodel();
|
||||||
@ -245,6 +275,9 @@ export function Jl3ddeviceNew(dom,group,token) {
|
|||||||
if (data._type == "Psd") {;
|
if (data._type == "Psd") {;
|
||||||
scope.showmodel = scope.modelmanager.standmodel.mesh;
|
scope.showmodel = scope.modelmanager.standmodel.mesh;
|
||||||
scope.scene.add(scope.showmodel);
|
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);
|
initstatus(data);
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,19 @@ export function ModelManager(){
|
|||||||
action:null
|
action:null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.sectionmodel = {
|
||||||
|
code:"section",
|
||||||
|
sectionstatus:"01",
|
||||||
|
mesh:null,
|
||||||
|
action:null
|
||||||
|
};
|
||||||
|
|
||||||
this.loadpromise = function (data,mixers){
|
this.loadpromise = function (data,mixers){
|
||||||
let initlist = [];
|
let initlist = [];
|
||||||
initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel));
|
initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel));
|
||||||
initlist.push(fbxpromise(data.Signal,mixers,scope.signalmodel));
|
initlist.push(fbxpromise(data.Signal,mixers,scope.signalmodel));
|
||||||
initlist.push(fbxpromise(data.stationstand,mixers,scope.standmodel));
|
initlist.push(fbxpromise(data.stationstand,mixers,scope.standmodel));
|
||||||
|
initlist.push(fbxpromise(data.section,mixers,scope.sectionmodel));
|
||||||
|
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject){
|
||||||
|
|
||||||
|
113
src/jlmap3d/jl3ddevice/standtextureload.js
Normal file
113
src/jlmap3d/jl3ddevice/standtextureload.js
Normal 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.' );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
681
src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js
Normal file
681
src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -19,12 +19,10 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
|||||||
// import { DragControls } from '@/jlmap3d/main/control/DragControls';
|
// import { DragControls } from '@/jlmap3d/main/control/DragControls';
|
||||||
|
|
||||||
//加载器
|
//加载器
|
||||||
import { SimulationLoad } from '@/jlmap3d/main/loaders/SimulationLoad';
|
import { MaintainerLoad } from '@/jlmap3d/jl3dmaintainer/maintainerload';
|
||||||
import { SimulationLoadNew } from '@/jlmap3d/main/loaders/SimulationLoadNew';
|
|
||||||
|
|
||||||
//connect
|
//connect
|
||||||
import {Jlmap3dSubscribe } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe';
|
import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect';
|
||||||
import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew';
|
|
||||||
|
|
||||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
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();
|
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");
|
this.webwork = new Worker("../../static/workertest/trainworker.js");
|
||||||
//初始化加载数据和模型getPublishMapDetail
|
//初始化加载数据和模型getPublishMapDetail
|
||||||
@ -110,18 +103,13 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
|
|||||||
getPublish3dMapDetail(skinCode).then(netdata => {
|
getPublish3dMapDetail(skinCode).then(netdata => {
|
||||||
let assetsdata = JSON.parse(netdata.data.sections);
|
let assetsdata = JSON.parse(netdata.data.sections);
|
||||||
if(assetsdata.link){
|
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{
|
}else{
|
||||||
scope.datatype = "new";
|
scope.datatype = "new";
|
||||||
scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js");
|
scope.jsonwebworknew = new Worker("../../static/workertest/maintainerworker.js");
|
||||||
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
|
scope.Subscribe = new Maintainerconnect(scope,routegroup,scope.jsonwebworknew);
|
||||||
scope.Subscribe.socketon(scope.Subscribe.topic);
|
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;
|
trainlisttest = loadtrainlisttest;
|
||||||
realsectionlist = loadrealsectionlist;
|
realsectionlist = loadrealsectionlist;
|
||||||
rails = loadrails;
|
rails = loadrails;
|
||||||
console.log(stationstandlist);
|
|
||||||
scope.updatecamera(stationstandlist.group.children[0],"station");
|
scope.updatecamera(stationstandlist.group.children[0],"station");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -412,8 +399,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scope.raycasterswitch == "section"){
|
if(scope.raycasterswitch == "section"){
|
||||||
console.log(sectionlist);
|
|
||||||
console.log(linklist);
|
|
||||||
//console.log(sectionlist.sections.modellist);
|
//console.log(sectionlist.sections.modellist);
|
||||||
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
|
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
|
||||||
if(intersects[0]){
|
if(intersects[0]){
|
||||||
@ -424,7 +410,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scope.raycasterswitch == "signal"){
|
if(scope.raycasterswitch == "signal"){
|
||||||
console.log(signallist);
|
|
||||||
let intersects = raycaster.intersectObjects( signallist.group.children,true);
|
let intersects = raycaster.intersectObjects( signallist.group.children,true);
|
||||||
|
|
||||||
if(intersects[0]){
|
if(intersects[0]){
|
||||||
@ -435,7 +420,6 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scope.raycasterswitch == "switch"){
|
if(scope.raycasterswitch == "switch"){
|
||||||
console.log(sectionlist);
|
|
||||||
let intersects = raycaster.intersectObjects( sectionlist.switchs.modellist,true);
|
let intersects = raycaster.intersectObjects( sectionlist.switchs.modellist,true);
|
||||||
|
|
||||||
if(intersects[0]){
|
if(intersects[0]){
|
||||||
|
828
src/jlmap3d/jl3dmaintainer/maintainerconnect.js
Normal file
828
src/jlmap3d/jl3dmaintainer/maintainerconnect.js
Normal 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--;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
213
src/jlmap3d/jl3dmaintainer/maintainerload.js
Normal file
213
src/jlmap3d/jl3dmaintainer/maintainerload.js
Normal 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);
|
||||||
|
}
|
@ -409,8 +409,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scope.raycasterswitch == "section"){
|
if(scope.raycasterswitch == "section"){
|
||||||
console.log(sectionlist);
|
|
||||||
console.log(linklist);
|
|
||||||
//console.log(sectionlist.sections.modellist);
|
//console.log(sectionlist.sections.modellist);
|
||||||
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
|
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
|
||||||
if(intersects[0]){
|
if(intersects[0]){
|
||||||
|
@ -114,8 +114,10 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
|||||||
let stationname = stationstandlist.group.children[mm].name;
|
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 =scope.stationtexture["stationlist"];
|
||||||
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
|
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
|
||||||
|
|
||||||
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
|
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
|
||||||
newmaterial.map =scope.stationtexture[stationname];
|
newmaterial.map =scope.stationtexture[stationname];
|
||||||
|
|
||||||
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
|
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
|
||||||
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
|
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
|
||||||
|
|
||||||
|
@ -559,6 +559,13 @@ class SkinCode extends defaultStyle {
|
|||||||
trainBodyFillColor: '#725A64', // 列车车身填充颜色
|
trainBodyFillColor: '#725A64', // 列车车身填充颜色
|
||||||
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
|
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
|
||||||
},
|
},
|
||||||
|
soonerOrLater: {
|
||||||
|
level: 3,
|
||||||
|
serviceNumber: true,
|
||||||
|
earlyColor: '#00FF00',
|
||||||
|
lateColor: '#800000',
|
||||||
|
normalColor: '#FFF'
|
||||||
|
},
|
||||||
directionArrow: {
|
directionArrow: {
|
||||||
},
|
},
|
||||||
hsda: {
|
hsda: {
|
||||||
|
@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
|
|||||||
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||||
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||||
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||||
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
|
logicalTextColor: '#C0C0C0', // 逻辑区段名称颜色 (未用)
|
||||||
|
invalidColor: '#B18E38' // 区段ARB故障颜色
|
||||||
},
|
},
|
||||||
axle: {}, // 计轴
|
axle: {}, // 计轴
|
||||||
speedLimit: { // 限速元素
|
speedLimit: { // 限速元素
|
||||||
@ -678,6 +679,13 @@ class SkinCode extends defaultStyle {
|
|||||||
},
|
},
|
||||||
directionArrow: {
|
directionArrow: {
|
||||||
},
|
},
|
||||||
|
soonerOrLater: {
|
||||||
|
level: 3,
|
||||||
|
trainBody: true,
|
||||||
|
earlyColor: '#00FF00',
|
||||||
|
lateColor: '#800000',
|
||||||
|
normalColor: '#FFF'
|
||||||
|
},
|
||||||
hsda: {
|
hsda: {
|
||||||
lrPaddingHSDA: 3, // HSDA两边间隔
|
lrPaddingHSDA: 3, // HSDA两边间隔
|
||||||
upPaddingHSDA: 4, // HSDA上边距离
|
upPaddingHSDA: 4, // HSDA上边距离
|
||||||
|
@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
|
|||||||
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||||
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||||
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||||
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
|
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
|
||||||
|
invalidColor: '#A25100' // 区段ARB故障颜色
|
||||||
},
|
},
|
||||||
axle: {}, // 计轴
|
axle: {}, // 计轴
|
||||||
speedLimit: { // 限速元素
|
speedLimit: { // 限速元素
|
||||||
|
@ -93,7 +93,8 @@ class SkinCode extends defaultStyle {
|
|||||||
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||||
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||||
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||||
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
|
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
|
||||||
|
invalidColor: '#A25100' // 区段ARB故障颜色
|
||||||
},
|
},
|
||||||
axle: {}, // 计轴
|
axle: {}, // 计轴
|
||||||
speedLimit: { // 限速元素
|
speedLimit: { // 限速元素
|
||||||
|
@ -559,6 +559,14 @@ class SkinCode extends defaultStyle {
|
|||||||
trainSidelineColor: '#FFFF00',
|
trainSidelineColor: '#FFFF00',
|
||||||
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
|
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
|
||||||
},
|
},
|
||||||
|
soonerOrLater: {
|
||||||
|
level: 5,
|
||||||
|
earlyColor: '#00FF00',
|
||||||
|
severeEarlyColor: '#0000FF',
|
||||||
|
lateColor: '#FF00FF',
|
||||||
|
severeLateColor: '#FF0000',
|
||||||
|
normalColor: '#DADA00'
|
||||||
|
},
|
||||||
directionArrow: {
|
directionArrow: {
|
||||||
},
|
},
|
||||||
hsda: {
|
hsda: {
|
||||||
|
@ -101,7 +101,8 @@ class SkinCode extends defaultStyle {
|
|||||||
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||||
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||||
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||||
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
|
logicalTextColor: '#FFFFFF', // 逻辑区段名称颜色 (未用)
|
||||||
|
invalidColor: '#9C5208' // 区段ARB故障颜色
|
||||||
},
|
},
|
||||||
axle: {}, // 计轴
|
axle: {}, // 计轴
|
||||||
speedLimit: { // 限速元素
|
speedLimit: { // 限速元素
|
||||||
@ -163,10 +164,11 @@ class SkinCode extends defaultStyle {
|
|||||||
route: {
|
route: {
|
||||||
direction: false, // 自动进路方向
|
direction: false, // 自动进路方向
|
||||||
offset: { x: -4, y: 0 }, // 自动进路偏移量
|
offset: { x: -4, y: 0 }, // 自动进路偏移量
|
||||||
routeColor: '#00FF00' // 自动进路
|
routeColor: '#00FF00', // 自动进路
|
||||||
|
radiusR: 6
|
||||||
},
|
},
|
||||||
auto: {
|
auto: {
|
||||||
signalFrontTriangle: false, // 信号灯前三角展示
|
signalFrontTriangle: true, // 信号灯前三角展示
|
||||||
direction: false, // 自动通过方向
|
direction: false, // 自动通过方向
|
||||||
offset: { x: -4, y: 0}, // 自动通过偏移量
|
offset: { x: -4, y: 0}, // 自动通过偏移量
|
||||||
width: 5, // 自动宽度
|
width: 5, // 自动宽度
|
||||||
@ -232,7 +234,8 @@ class SkinCode extends defaultStyle {
|
|||||||
trainColor: '#E4EF50', // 车站扣车颜色
|
trainColor: '#E4EF50', // 车站扣车颜色
|
||||||
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
||||||
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||||
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
|
||||||
|
circle: true // 空心圆环
|
||||||
},
|
},
|
||||||
stopTime: { // 停站时间
|
stopTime: { // 停站时间
|
||||||
position: 1, // 运行时间方向
|
position: 1, // 运行时间方向
|
||||||
@ -563,6 +566,13 @@ class SkinCode extends defaultStyle {
|
|||||||
},
|
},
|
||||||
directionArrow: {
|
directionArrow: {
|
||||||
},
|
},
|
||||||
|
soonerOrLater: {
|
||||||
|
level: 3,
|
||||||
|
serviceNumber: true,
|
||||||
|
earlyColor: '#00FF00',
|
||||||
|
lateColor: '#800000',
|
||||||
|
normalColor: '#FFF'
|
||||||
|
},
|
||||||
hsda: {
|
hsda: {
|
||||||
trainHSDATextFontSize: 8// 列车HDSA字号
|
trainHSDATextFontSize: 8// 列车HDSA字号
|
||||||
},
|
},
|
||||||
@ -581,7 +591,13 @@ class SkinCode extends defaultStyle {
|
|||||||
tripNumberPrefix: '0000', // 车次号前缀
|
tripNumberPrefix: '0000', // 车次号前缀
|
||||||
defaultDirectionCode: 'D', // 默认车次号1
|
defaultDirectionCode: 'D', // 默认车次号1
|
||||||
defaultTripNumber: 'CCC', // 默认车次号2
|
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: {
|
trainTargetNumber: {
|
||||||
groupNumberPrefix: '000', // 车组号前缀
|
groupNumberPrefix: '000', // 车组号前缀
|
||||||
|
@ -418,6 +418,8 @@ class Jlmap {
|
|||||||
if (elem.deviceType === 'TRAIN') {
|
if (elem.deviceType === 'TRAIN') {
|
||||||
store.dispatch('map/updateTrainState', elem);
|
store.dispatch('map/updateTrainState', elem);
|
||||||
store.dispatch('map/setTrainListUpdate', 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);
|
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||||
if (elem.dispose) {
|
if (elem.dispose) {
|
||||||
|
@ -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*/
|
/** 进路锁闭 04*/
|
||||||
routeLock() {
|
routeLock() {
|
||||||
if (this.section) {
|
if (this.section) {
|
||||||
@ -774,6 +780,8 @@ export default class Section extends Group {
|
|||||||
/** 空闲锁闭或者叫进路锁闭 */
|
/** 空闲锁闭或者叫进路锁闭 */
|
||||||
model.routeLock && this.routeLock();
|
model.routeLock && this.routeLock();
|
||||||
/** 轨道封锁 */
|
/** 轨道封锁 */
|
||||||
|
model.invalid && this.invalid();
|
||||||
|
/** 计轴故障 */
|
||||||
model.blockade && this.block();
|
model.blockade && this.block();
|
||||||
/** 非通信车占用状态 */
|
/** 非通信车占用状态 */
|
||||||
model.nctOccupied && this.unCommunicationOccupied();
|
model.nctOccupied && this.unCommunicationOccupied();
|
||||||
|
@ -28,7 +28,7 @@ class EVirtualSignal extends Group {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.Signal.lamp.borderWidth || 1,
|
lineWidth: style.Signal.lamp.borderWidth || 0,
|
||||||
fill: style.Signal.lamp.borderColor,
|
fill: style.Signal.lamp.borderColor,
|
||||||
stroke: style.Signal.lamp.borderColor
|
stroke: style.Signal.lamp.borderColor
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ class Signal extends Group {
|
|||||||
this.cbtcStatus = '';
|
this.cbtcStatus = '';
|
||||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
|
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
|
||||||
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
|
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') { // 设置底座颜色
|
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
|
||||||
this.sigPost.setColor('#00FF00');
|
this.sigPost.setColor('#00FF00');
|
||||||
if (this.model.logicLight) {
|
if (this.model.logicLight) {
|
||||||
@ -393,6 +393,7 @@ class Signal extends Group {
|
|||||||
this.cbtcStatus = '';
|
this.cbtcStatus = '';
|
||||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||||
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
|
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') { // 设置底座颜色
|
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
|
||||||
this.sigPost.setColor('#00FF00');
|
this.sigPost.setColor('#00FF00');
|
||||||
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
|
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
|
||||||
@ -620,12 +621,12 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
const rect = this.sigPost.getBoundingRect();
|
const rect = this.sigPost.getBoundingRect().clone();
|
||||||
this.lamps.forEach(elem => {
|
this.lamps.forEach(elem => {
|
||||||
rect.union(elem.getBoundingRect());
|
rect.union(elem.getBoundingRect().clone());
|
||||||
});
|
});
|
||||||
if (this.insideTriangle) {
|
if (this.insideTriangle) {
|
||||||
rect.union(this.insideTriangle.getBoundingRect());
|
rect.union(this.insideTriangle.getBoundingRect().clone());
|
||||||
}
|
}
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Text from 'zrender/src/graphic/Text';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
|
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||||
|
|
||||||
class EDetain extends Group {
|
class EDetain extends Group {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
@ -29,6 +30,24 @@ class EDetain extends Group {
|
|||||||
textVerticalAlign: style.textStyle.textVerticalAlign
|
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);
|
this.add(this.detain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,11 +59,13 @@ class EDetain extends Group {
|
|||||||
|
|
||||||
hideMode() {
|
hideMode() {
|
||||||
this.detain && this.detain.hide();
|
this.detain && this.detain.hide();
|
||||||
|
this.circleDetain && this.circleDetain.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
showMode() {
|
showMode() {
|
||||||
this.create();
|
this.create();
|
||||||
this.detain && this.detain.show();
|
this.detain && this.detain.show();
|
||||||
|
this.circleDetain && this.circleDetain.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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`;
|
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 {
|
} else {
|
||||||
if (Vue.prototype.$jlmap.lineCode == '11' || Vue.prototype.$jlmap.lineCode == '10') {
|
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 {
|
} 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`;
|
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`;
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ export default class TrainBody extends Group {
|
|||||||
// this.add(this.atrStatus);
|
// this.add(this.atrStatus);
|
||||||
}
|
}
|
||||||
if (style.Train.common.hasTravelSigns) {
|
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;
|
const travelSignsOffsetY = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.y : style.Train.travelSigns.trainTravelLeftSignsOffset.y;
|
||||||
this.travelSigns = new ETextName({
|
this.travelSigns = new ETextName({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
@ -222,7 +222,7 @@ export default class TrainBody extends Group {
|
|||||||
z: model.z + 1,
|
z: model.z + 1,
|
||||||
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
|
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
|
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
|
||||||
text: 'AA',
|
text: model.destinationCode,
|
||||||
textFill: '#00C300',
|
textFill: '#00C300',
|
||||||
textStroke: style.trainTextColor,
|
textStroke: style.trainTextColor,
|
||||||
textStrokeWidth: 0,
|
textStrokeWidth: 0,
|
||||||
@ -239,7 +239,7 @@ export default class TrainBody extends Group {
|
|||||||
z: model.z + 1,
|
z: model.z + 1,
|
||||||
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
|
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
|
||||||
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
|
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
|
||||||
text: '0',
|
text: model.dt > 0 ? '+' + model.dt : model.dt,
|
||||||
textFill: '#DADA00',
|
textFill: '#DADA00',
|
||||||
textStroke: style.trainTextColor,
|
textStroke: style.trainTextColor,
|
||||||
textStrokeWidth: 0,
|
textStrokeWidth: 0,
|
||||||
@ -300,12 +300,61 @@ export default class TrainBody extends Group {
|
|||||||
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
|
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
|
||||||
}
|
}
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
const rect = new BoundingRect(0, 0, 0, 0);
|
|
||||||
if (this.trainBodyBox) {
|
if (this.trainBodyBox) {
|
||||||
const tempRect = this.trainBodyBox.getBoundingRect().clone();
|
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) {
|
formatChangePosition(model, style) {
|
||||||
if (this.nameFormat) {
|
if (this.nameFormat) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||||
|
|
||||||
export default class TrainBodyBox extends Group {
|
export default class TrainBodyBox extends Group {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
@ -30,4 +31,10 @@ export default class TrainBodyBox extends Group {
|
|||||||
setColor(key, color) {
|
setColor(key, color) {
|
||||||
this.trainBodyBox.setStyle(key, color);
|
this.trainBodyBox.setStyle(key, color);
|
||||||
}
|
}
|
||||||
|
getBoundingRect() {
|
||||||
|
if (this.trainBodyBox) {
|
||||||
|
const tempRect = this.trainBodyBox.getBoundingRect().clone();
|
||||||
|
return tempRect;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ export default class Train extends Group {
|
|||||||
type: model.type,
|
type: model.type,
|
||||||
speed: model.speed,
|
speed: model.speed,
|
||||||
maLen: model.maLen,
|
maLen: model.maLen,
|
||||||
|
dt: model.dt,
|
||||||
model: model
|
model: model
|
||||||
});
|
});
|
||||||
this.trainL = new TrainHead({
|
this.trainL = new TrainHead({
|
||||||
@ -323,7 +324,10 @@ export default class Train extends Group {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 早晚点状态
|
||||||
|
setSoonerOrLater(dt) {
|
||||||
|
this.trainB && this.trainB.setSoonerOrLater(dt);
|
||||||
|
}
|
||||||
// 设置扣车状态
|
// 设置扣车状态
|
||||||
setHoldStatus(status) {
|
setHoldStatus(status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
@ -403,7 +407,9 @@ export default class Train extends Group {
|
|||||||
this.setAlarmStatus(model.alarmStatus);
|
this.setAlarmStatus(model.alarmStatus);
|
||||||
this.setHoldStatus(model.hold);
|
this.setHoldStatus(model.hold);
|
||||||
this.setJumpStatus(model.jump);
|
this.setJumpStatus(model.jump);
|
||||||
|
this.setSoonerOrLater(model.dt);
|
||||||
|
this.setPlanRoutingTypeColor(model.planRoutingType);
|
||||||
|
this.setTrainTypeColor(model.type);
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (style.Section.trainPosition.display) {
|
if (style.Section.trainPosition.display) {
|
||||||
this.updateSection(object);
|
this.updateSection(object);
|
||||||
@ -423,6 +429,12 @@ export default class Train extends Group {
|
|||||||
// this.setTrainTypeStatus(model.type); // 根据列车类型设置列车识别号样式
|
// this.setTrainTypeStatus(model.type); // 根据列车类型设置列车识别号样式
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
setTrainTypeColor(type) {
|
||||||
|
this.trainB && this.trainB.setTrainTypeColor(type);
|
||||||
|
}
|
||||||
|
setPlanRoutingTypeColor(planRoutingType) {
|
||||||
|
this.trainB && this.trainB.setPlanRoutingTypeColor(planRoutingType);
|
||||||
|
}
|
||||||
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
isChangeTrainWidth(model, style) {
|
isChangeTrainWidth(model, style) {
|
||||||
if (!style.Train.trainBody.changeTrainWidth) { return; }
|
if (!style.Train.trainBody.changeTrainWidth) { return; }
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
|
<el-dialog
|
||||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
v-dialogDrag
|
||||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
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%;">
|
<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-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
|
||||||
<!-- <el-input v-model="addModel.tripNumber" /> -->
|
<!-- <el-input v-model="addModel.tripNumber" /> -->
|
||||||
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
@ -29,10 +27,10 @@
|
|||||||
<!-- <el-input v-model="addModel.serviceNumber" /> -->
|
<!-- <el-input v-model="addModel.serviceNumber" /> -->
|
||||||
<el-select v-model="addModel.serviceNumber" filterable>
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="serviceNumber in serviceNumberList"
|
v-for="serviceNumber in serviceNumberList"
|
||||||
:key="serviceNumber"
|
:key="serviceNumber"
|
||||||
:label="serviceNumber"
|
:label="serviceNumber"
|
||||||
:value="serviceNumber"
|
:value="serviceNumber"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -67,14 +65,10 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode: '', // 车组号
|
|
||||||
serviceNumber: '', // 服务号
|
serviceNumber: '', // 服务号
|
||||||
tripNumber: '' // 车次号
|
tripNumber: '' // 车次号
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入车组号', trigger: 'change' }
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -84,7 +78,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false
|
loading: false
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('map', [
|
...mapGetters('map', [
|
||||||
@ -130,12 +124,11 @@ export default {
|
|||||||
},
|
},
|
||||||
doShow(operate, selected) {
|
doShow(operate, selected) {
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
//如果不是断点激活,则需要对初始值进行初始化
|
// 如果不是断点激活,则需要对初始值进行初始化
|
||||||
if (!this.dialogShow) {
|
if (!this.dialogShow) {
|
||||||
|
|
||||||
}
|
}
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber:''
|
serviceNumber:''
|
||||||
};
|
};
|
||||||
@ -167,9 +160,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
@ -193,7 +185,7 @@ export default {
|
|||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
const operate = {
|
const operate = {
|
||||||
operation: OperationEvent.Command.cancel.menu.operation,
|
operation: OperationEvent.Command.cancel.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
@ -216,7 +208,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.beijing-01__systerm .el-dialog .base-label {
|
.beijing-01__systerm .el-dialog .base-label {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<alxe-effective ref="alxeEffective" />
|
<alxe-effective ref="alxeEffective" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
|||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -32,7 +34,8 @@ export default {
|
|||||||
SpeedLimitControl,
|
SpeedLimitControl,
|
||||||
AlxeEffective,
|
AlxeEffective,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -111,6 +114,16 @@ export default {
|
|||||||
'buttonOperation'
|
'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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
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() {
|
// alxeFailure() {
|
||||||
// const operate = {
|
// const operate = {
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<train-move ref="trainMove" />
|
<train-move ref="trainMove" />
|
||||||
<train-edit ref="trainEdit" />
|
<train-edit ref="trainEdit" />
|
||||||
<train-set-plan ref="trainSetPlan" />
|
<train-set-plan ref="trainSetPlan" />
|
||||||
<train-add-plan ref="trainAddPlan" />
|
|
||||||
<train-move-evently ref="trainMoveEvently" />
|
<train-move-evently ref="trainMoveEvently" />
|
||||||
<train-delete-plan ref="trainDeletePlan" />
|
<train-delete-plan ref="trainDeletePlan" />
|
||||||
<train-set-head ref="trainSetHead" />
|
<train-set-head ref="trainSetHead" />
|
||||||
@ -28,7 +27,6 @@ import TrainDefine from './dialog/trainDefine';
|
|||||||
import TrainMove from './dialog/trainMove';
|
import TrainMove from './dialog/trainMove';
|
||||||
import TrainEdit from './dialog/trainEdit';
|
import TrainEdit from './dialog/trainEdit';
|
||||||
import TrainSetPlan from './dialog/trainSetPlan';
|
import TrainSetPlan from './dialog/trainSetPlan';
|
||||||
import TrainAddPlan from './dialog/trainAddPlan';
|
|
||||||
import TrainMoveEvently from './dialog/trainMoveEvently';
|
import TrainMoveEvently from './dialog/trainMoveEvently';
|
||||||
import TrainDeletePlan from './dialog/trainDeletePlan';
|
import TrainDeletePlan from './dialog/trainDeletePlan';
|
||||||
import TrainSetHead from './dialog/trainSetHead';
|
import TrainSetHead from './dialog/trainSetHead';
|
||||||
@ -49,7 +47,6 @@ export default {
|
|||||||
TrainMove,
|
TrainMove,
|
||||||
TrainEdit,
|
TrainEdit,
|
||||||
TrainSetPlan,
|
TrainSetPlan,
|
||||||
TrainAddPlan,
|
|
||||||
TrainMoveEvently,
|
TrainMoveEvently,
|
||||||
TrainDeletePlan,
|
TrainDeletePlan,
|
||||||
TrainSetHead,
|
TrainSetHead,
|
||||||
@ -163,11 +160,6 @@ export default {
|
|||||||
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||||
// auth: { station: true, center: true }
|
// auth: { station: true, center: true }
|
||||||
// }
|
// }
|
||||||
{
|
|
||||||
label: '新建计划车',
|
|
||||||
handler: this.addPlanTrain,
|
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
// {
|
||||||
@ -264,11 +256,11 @@ export default {
|
|||||||
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||||
// auth: { station: true, center: true }
|
// auth: { station: true, center: true }
|
||||||
// },
|
// },
|
||||||
{
|
// {
|
||||||
label: '新建计划车',
|
// label: '新建计划车',
|
||||||
handler: this.addPlanTrain,
|
// handler: this.addPlanTrain,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
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() {
|
moveEventlyTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -12,39 +12,28 @@
|
|||||||
>
|
>
|
||||||
<div class="el-dialog-div">
|
<div class="el-dialog-div">
|
||||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
||||||
<el-form-item prop="trainCode" label="车组号:">
|
<el-form-item label="车次号:" prop="tripNumber">
|
||||||
<!--<el-input v-model="addModel.trainCode"/>-->
|
<!--<el-input v-model="addModel.tripNumber"/>-->
|
||||||
<el-select v-model="addModel.trainCode" filterable>
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="train in trainList"
|
v-for="tripNum in tripNumberList"
|
||||||
:key="train.groupNumber"
|
:key="tripNum"
|
||||||
:label="train.groupNumber"
|
:label="tripNum"
|
||||||
:value="train.code"
|
:value="tripNum"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="车次号:" prop="tripNumber">
|
<el-form-item label="服务号:" prop="serviceNumber">
|
||||||
<!--<el-input v-model="addModel.tripNumber"/>-->
|
<!-- <el-input v-model="serviceNumber" disabled="true"/> -->
|
||||||
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="tripNum in tripNumberList"
|
v-for="serviceNumber in serviceNumberList"
|
||||||
:key="tripNum"
|
:key="serviceNumber"
|
||||||
:label="tripNum"
|
:label="serviceNumber"
|
||||||
:value="tripNum"
|
:value="serviceNumber"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<el-row justify="center" class="button-group">
|
<el-row justify="center" class="button-group">
|
||||||
@ -78,14 +67,10 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber: ''
|
serviceNumber: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入列车编码', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
serverNumber: [
|
serverNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'blur'}
|
{ required: true, message: '请输入服务号', trigger: 'blur'}
|
||||||
],
|
],
|
||||||
@ -145,7 +130,6 @@ export default {
|
|||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
// 如果不是断点激活,则需要对初始值进行初始化
|
// 如果不是断点激活,则需要对初始值进行初始化
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber:''
|
serviceNumber:''
|
||||||
};
|
};
|
||||||
@ -177,10 +161,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
sectionCode: this.trainWindowSectionCode,
|
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<section-control ref="sectionControl" />
|
<section-control ref="sectionControl" />
|
||||||
<section-cmd-control ref="sectionCmdControl" />
|
<section-cmd-control ref="sectionCmdControl" />
|
||||||
<speed-limit-control ref="speedLimitControl" />
|
<speed-limit-control ref="speedLimitControl" />
|
||||||
|
<train-init-plan ref="trainInitPlan" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
|
import TrainInitPlan from './dialog/trainInitPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -31,7 +33,8 @@ export default {
|
|||||||
SpeedLimitControl,
|
SpeedLimitControl,
|
||||||
SectionControl,
|
SectionControl,
|
||||||
SectionCmdControl,
|
SectionCmdControl,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainInitPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -113,6 +126,23 @@ export default {
|
|||||||
this.menu = this.menuForce;
|
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) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<pop-menu ref="popMenu" :menu="menu" />
|
<pop-menu ref="popMenu" :menu="menu" />
|
||||||
<train-init-plan ref="trainInitPlan" />
|
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PopMenu from '@/components/PopMenu';
|
import PopMenu from '@/components/PopMenu';
|
||||||
import TrainInitPlan from './dialog/trainInitPlan';
|
|
||||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||||
import { MenuDisabledState } from './utils/menuItemStatus';
|
import { MenuDisabledState } from './utils/menuItemStatus';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
@ -23,7 +21,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
PopMenu,
|
PopMenu,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
TrainInitPlan
|
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
CancelMouseState
|
CancelMouseState
|
||||||
@ -123,12 +120,6 @@ export default {
|
|||||||
// handler: '',
|
// handler: '',
|
||||||
// cmdType: ''
|
// cmdType: ''
|
||||||
// }
|
// }
|
||||||
{
|
|
||||||
label: '新建计划列车',
|
|
||||||
handler: this.createPlanTrain,
|
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
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() {
|
undeveloped() {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$alert('实现中......', '提示', {
|
this.$alert('实现中......', '提示', {
|
||||||
|
@ -12,38 +12,27 @@
|
|||||||
>
|
>
|
||||||
<div class="el-dialog-div">
|
<div class="el-dialog-div">
|
||||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
||||||
<el-form-item prop="trainCode" label="车组号:">
|
<el-form-item label="车次号:" prop="tripNumber">
|
||||||
<!--<el-input v-model="addModel.trainCode"/>-->
|
<!--<el-input v-model="addModel.tripNumber"/>-->
|
||||||
<el-select v-model="addModel.trainCode" filterable>
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="train in trainList"
|
v-for="tripNum in tripNumberList"
|
||||||
:key="train.groupNumber"
|
:key="tripNum"
|
||||||
:label="train.groupNumber"
|
:label="tripNum"
|
||||||
:value="train.code"
|
:value="tripNum"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="车次号:" prop="tripNumber">
|
<el-form-item label="服务号:" prop="serviceNumber">
|
||||||
<!--<el-input v-model="addModel.tripNumber"/>-->
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
<el-select v-model="addModel.tripNumber" @change="tripNumberChange" filterable>
|
<el-option
|
||||||
<el-option
|
v-for="serviceNumber in serviceNumberList"
|
||||||
v-for="tripNum in tripNumberList"
|
:key="serviceNumber"
|
||||||
:key="tripNum"
|
:label="serviceNumber"
|
||||||
:label="tripNum"
|
:value="serviceNumber"
|
||||||
:value="tripNum"
|
/>
|
||||||
/>
|
</el-select>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</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>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<el-row justify="center" class="button-group">
|
<el-row justify="center" class="button-group">
|
||||||
@ -77,14 +66,10 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber: ''
|
serviceNumber: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入列车编码', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'change'}
|
{ required: true, message: '请输入服务号', trigger: 'change'}
|
||||||
],
|
],
|
||||||
@ -138,7 +123,6 @@ export default {
|
|||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
// 如果不是断点激活,则需要对初始值进行初始化
|
// 如果不是断点激活,则需要对初始值进行初始化
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber: ''
|
serviceNumber: ''
|
||||||
};
|
};
|
||||||
@ -170,10 +154,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
sectionCode: this.trainWindowSectionCode,
|
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<section-detail ref="sectionDetail" />
|
<section-detail ref="sectionDetail" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
|
<train-init-plan ref="trainInitPlan" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
|
import TrainInitPlan from './dialog/trainInitPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -31,7 +33,8 @@ export default {
|
|||||||
SectionDetail,
|
SectionDetail,
|
||||||
TrainCreate,
|
TrainCreate,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainInitPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -66,6 +69,7 @@ export default {
|
|||||||
auth: { station: false, center: true },
|
auth: { station: false, center: true },
|
||||||
cmdType: CMD.Section.CMD_SECTION_DETAILS
|
cmdType: CMD.Section.CMD_SECTION_DETAILS
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -206,6 +220,23 @@ export default {
|
|||||||
callback: action => {
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
<train-move-number ref="trainMoveNumber" />
|
<train-move-number ref="trainMoveNumber" />
|
||||||
<train-delete-number ref="trainDeleteNumber" />
|
<train-delete-number ref="trainDeleteNumber" />
|
||||||
<train-detail-info ref="trainDetailInfo" />
|
<train-detail-info ref="trainDetailInfo" />
|
||||||
<train-init-plan ref="trainInitPlan"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,7 +22,6 @@ import TrainEditNumber from './dialog/trainEditNumber';
|
|||||||
import TrainMoveNumber from './dialog/trainMoveNumber';
|
import TrainMoveNumber from './dialog/trainMoveNumber';
|
||||||
import TrainCreateNumber from './dialog/trainCreateNumber';
|
import TrainCreateNumber from './dialog/trainCreateNumber';
|
||||||
import TrainDeleteNumber from './dialog/trainDeleteNumber';
|
import TrainDeleteNumber from './dialog/trainDeleteNumber';
|
||||||
import TrainInitPlan from './dialog/trainInitPlan';
|
|
||||||
import TrainDetailInfo from './dialog/trainDetailInfo';
|
import TrainDetailInfo from './dialog/trainDetailInfo';
|
||||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
@ -41,7 +39,6 @@ export default {
|
|||||||
TrainCreateNumber,
|
TrainCreateNumber,
|
||||||
TrainDeleteNumber,
|
TrainDeleteNumber,
|
||||||
TrainDetailInfo,
|
TrainDetailInfo,
|
||||||
TrainInitPlan
|
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
CancelMouseState
|
CancelMouseState
|
||||||
@ -125,11 +122,6 @@ export default {
|
|||||||
handler: this.undeveloped,
|
handler: this.undeveloped,
|
||||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||||
auth: { station: true, center: true}
|
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() {
|
undeveloped() {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$alert('实现中......', '提示', {
|
this.$alert('实现中......', '提示', {
|
||||||
|
@ -42,6 +42,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
|||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
import { deepAssign } from '@/utils/index';
|
import { deepAssign } from '@/utils/index';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RouteSelection',
|
name: 'RouteSelection',
|
||||||
@ -64,6 +65,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'overlapData'
|
||||||
|
]),
|
||||||
show() {
|
show() {
|
||||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
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.$store.dispatch('training/updateMapState', [...containSectionList]);
|
||||||
this.beforeSectionList = containSectionList || [];
|
this.beforeSectionList = containSectionList || [];
|
||||||
|
|
||||||
|
@ -12,16 +12,6 @@
|
|||||||
>
|
>
|
||||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||||
<div style="width: 96%;">
|
<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-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
|
||||||
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
<el-option
|
<el-option
|
||||||
@ -73,15 +63,11 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode: '', // 车组号
|
|
||||||
serviceNumber: '', // 服务号
|
serviceNumber: '', // 服务号
|
||||||
tripNumber: '' // 车次号
|
tripNumber: '' // 车次号
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入车组号', trigger: 'change' }
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -142,7 +128,6 @@ export default {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber:''
|
serviceNumber:''
|
||||||
};
|
};
|
||||||
@ -175,9 +160,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<section-un-lock ref="sectionUnLock" />
|
<section-un-lock ref="sectionUnLock" />
|
||||||
<speed-limit-control ref="speedLimitControl" />
|
<speed-limit-control ref="speedLimitControl" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -21,6 +22,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -30,7 +33,8 @@ export default {
|
|||||||
SectionUnLock,
|
SectionUnLock,
|
||||||
SpeedLimitControl,
|
SpeedLimitControl,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -138,6 +152,24 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
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() {
|
setStoppage() {
|
||||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<train-move ref="trainMove" />
|
<train-move ref="trainMove" />
|
||||||
<!-- <train-edit ref="trainEdit" /> -->
|
<!-- <train-edit ref="trainEdit" /> -->
|
||||||
<train-set-plan ref="trainSetPlan" />
|
<train-set-plan ref="trainSetPlan" />
|
||||||
<train-add-plan ref="trainAddPlan" />
|
|
||||||
<!-- <train-move-evently ref="trainMoveEvently" /> -->
|
<!-- <train-move-evently ref="trainMoveEvently" /> -->
|
||||||
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
|
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
|
||||||
<train-set-head ref="trainSetHead" />
|
<train-set-head ref="trainSetHead" />
|
||||||
@ -25,7 +24,6 @@ import TrainDefine from './dialog/trainDefine';
|
|||||||
import TrainMove from './dialog/trainMove';
|
import TrainMove from './dialog/trainMove';
|
||||||
// import TrainEdit from './dialog/trainEdit';
|
// import TrainEdit from './dialog/trainEdit';
|
||||||
import TrainSetPlan from './dialog/trainSetPlan';
|
import TrainSetPlan from './dialog/trainSetPlan';
|
||||||
import TrainAddPlan from './dialog/trainAddPlan';
|
|
||||||
// import TrainMoveEvently from './dialog/trainMoveEvently';
|
// import TrainMoveEvently from './dialog/trainMoveEvently';
|
||||||
// import TrainDeletePlan from './dialog/trainDeletePlan';
|
// import TrainDeletePlan from './dialog/trainDeletePlan';
|
||||||
import TrainSetHead from './dialog/trainSetHead';
|
import TrainSetHead from './dialog/trainSetHead';
|
||||||
@ -49,7 +47,6 @@ export default {
|
|||||||
TrainMove,
|
TrainMove,
|
||||||
// TrainEdit,
|
// TrainEdit,
|
||||||
TrainSetPlan,
|
TrainSetPlan,
|
||||||
TrainAddPlan,
|
|
||||||
// TrainMoveEvently,
|
// TrainMoveEvently,
|
||||||
// TrainDeletePlan,
|
// TrainDeletePlan,
|
||||||
TrainSetHead,
|
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() {
|
setHeadTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import ConfirmControl from './childDialog/confirmControl';
|
import ConfirmControl from './childDialog/confirmControl';
|
||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||||
|
import { deepAssign } from '@/utils/index';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RouteSelection',
|
name: 'RouteSelection',
|
||||||
@ -70,6 +72,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'overlapData'
|
||||||
|
]),
|
||||||
show() {
|
show() {
|
||||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
},
|
},
|
||||||
@ -161,30 +166,56 @@ export default {
|
|||||||
this.row = row;
|
this.row = row;
|
||||||
if (row) {
|
if (row) {
|
||||||
// 恢复进路区段的切除状态
|
// 恢复进路区段的切除状态
|
||||||
|
this.row.canSetting = true;
|
||||||
this.restoreBeforeDevices();
|
this.restoreBeforeDevices();
|
||||||
|
const containSectionList = [];
|
||||||
if (row.canSetting) {
|
if (row.canSetting) {
|
||||||
// 设置选中区段为切除状态
|
// 设置选中区段为切除状态
|
||||||
if (row.containSectionList && row.containSectionList.length) {
|
if (row.routeSectionList && row.routeSectionList.length) {
|
||||||
// 设置新选的进路区段为切除状态
|
// 设置新选的进路区段为切除状态
|
||||||
row.containSectionList.forEach(elem => {
|
row.routeSectionList.forEach(elem => {
|
||||||
elem.cutOff = true;
|
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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) {
|
||||||
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
|
this.overlapData[row.overlapCode].pathList.forEach(item => {
|
||||||
this.beforeSectionList = row.containSectionList || [];
|
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 = {
|
const operate = {
|
||||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
||||||
val: row.code,
|
val: row.code
|
||||||
param: {
|
|
||||||
Route_Code: row.code
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
}
|
}
|
||||||
|
212
src/jmapNew/theme/fuzhou_01/menus/dialog/trainAddPlan.vue
Normal file
212
src/jmapNew/theme/fuzhou_01/menus/dialog/trainAddPlan.vue
Normal 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>
|
@ -6,6 +6,7 @@
|
|||||||
<speed-cmd-control ref="speedCmdControl" />
|
<speed-cmd-control ref="speedCmdControl" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -32,7 +34,8 @@ export default {
|
|||||||
SectionCmdControl,
|
SectionCmdControl,
|
||||||
SpeedCmdControl,
|
SpeedCmdControl,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -175,6 +188,24 @@ export default {
|
|||||||
this.menu = this.menuForce;
|
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) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
|
@ -12,38 +12,27 @@
|
|||||||
>
|
>
|
||||||
<div class="el-dialog-div">
|
<div class="el-dialog-div">
|
||||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
||||||
trainCode" label="车组号:">
|
<el-form-item label="车次号:" prop="tripNumber">
|
||||||
inCode"/>-->
|
<!--<el-input v-model="addModel.tripNumber"/>-->
|
||||||
rainCode" filterable>
|
<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>
|
||||||
"车次号:" prop="tripNumber">
|
<el-form-item label="服务号:" prop="serviceNumber">
|
||||||
dModel.tripNumber"/>-->
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
del.tripNumber" filtefiltefiltefilt filtefilterable @change="tripNumberChange"
|
<el-option
|
||||||
|
v-for="serviceNumber in serviceNumberList"
|
||||||
|
:key="serviceNumber"
|
||||||
|
:label="serviceNumber"
|
||||||
|
:value="serviceNumber"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
item>
|
|
||||||
tem label="服务号:" prop="serviceNumber">
|
|
||||||
addModel.serviceNumber" filterable>
|
|
||||||
|
|
||||||
t"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<el-row justify="center" class="button-group">
|
<el-row justify="center" class="button-group">
|
||||||
@ -77,14 +66,10 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber: ''
|
serviceNumber: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入列车编码', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'change'}
|
{ required: true, message: '请输入服务号', trigger: 'change'}
|
||||||
],
|
],
|
||||||
@ -138,7 +123,6 @@ export default {
|
|||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
// 如果不是断点激活,则需要对初始值进行初始化
|
// 如果不是断点激活,则需要对初始值进行初始化
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber: ''
|
serviceNumber: ''
|
||||||
};
|
};
|
||||||
@ -150,7 +134,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);;
|
console.log(error);
|
||||||
// this.$messageBox(error.message);
|
// this.$messageBox(error.message);
|
||||||
});
|
});
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
@ -171,10 +155,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
sectionCode: this.trainWindowSectionCode,
|
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
@ -186,7 +168,7 @@ export default {
|
|||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
; ;onsole.log(error);
|
onsole.log(error);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow(operate);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<speed-cmd-control ref="speedCmdControl" />
|
<speed-cmd-control ref="speedCmdControl" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
|
<train-init-plan ref="trainInitPlan" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
|
import TrainInitPlan from './dialog/trainInitPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -31,7 +33,8 @@ export default {
|
|||||||
SectionCmdControl,
|
SectionCmdControl,
|
||||||
SpeedCmdControl,
|
SpeedCmdControl,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainInitPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -134,6 +147,23 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
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() {
|
setStoppage() {
|
||||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<train-move ref="trainMove" />
|
<train-move ref="trainMove" />
|
||||||
<train-switch ref="trainSwitch" />
|
<train-switch ref="trainSwitch" />
|
||||||
<train-edit-number ref="trainEditNumber" />
|
<train-edit-number ref="trainEditNumber" />
|
||||||
<train-init-plan ref="trainInitPlan"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,7 +22,6 @@ import TrainDelete from './dialog/trainDelete';
|
|||||||
import TrainMove from './dialog/trainMove';
|
import TrainMove from './dialog/trainMove';
|
||||||
import TrainSwitch from './dialog/trainSwitch';
|
import TrainSwitch from './dialog/trainSwitch';
|
||||||
import TrainEditNumber from './dialog/trainEditNumber';
|
import TrainEditNumber from './dialog/trainEditNumber';
|
||||||
import TrainInitPlan from './dialog/trainInitPlan';
|
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -35,8 +33,7 @@ export default {
|
|||||||
TrainDelete,
|
TrainDelete,
|
||||||
TrainMove,
|
TrainMove,
|
||||||
TrainSwitch,
|
TrainSwitch,
|
||||||
TrainEditNumber,
|
TrainEditNumber
|
||||||
TrainInitPlan
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -51,18 +48,18 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
{
|
// {
|
||||||
label: '新建计划列车',
|
// label: '新建计划列车',
|
||||||
handler: this.createPlanTrain,
|
// handler: this.createPlanTrain,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
}
|
// }
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
{
|
// {
|
||||||
label: '新建计划列车',
|
// label: '新建计划列车',
|
||||||
handler: this.createPlanTrain,
|
// handler: this.createPlanTrain,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
// cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
menuForce: [
|
||||||
@ -140,23 +137,6 @@ export default {
|
|||||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
// 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() {
|
setStoppage() {
|
||||||
const step = {
|
const step = {
|
||||||
|
@ -38,6 +38,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
|||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||||
import {menuOperate, commitOperate} from '../utils/menuOperate';
|
import {menuOperate, commitOperate} from '../utils/menuOperate';
|
||||||
import { deepAssign } from '@/utils/index';
|
import { deepAssign } from '@/utils/index';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RouteSelection',
|
name: 'RouteSelection',
|
||||||
@ -62,6 +63,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'overlapData'
|
||||||
|
]),
|
||||||
show() {
|
show() {
|
||||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
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.$store.dispatch('training/updateMapState', [...containSectionList]);
|
||||||
this.beforeSectionList = containSectionList || [];
|
this.beforeSectionList = containSectionList || [];
|
||||||
|
|
||||||
|
@ -12,33 +12,23 @@
|
|||||||
>
|
>
|
||||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||||
<div style="width: 96%;">
|
<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-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
|
||||||
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="tripNum in tripNumberList"
|
v-for="tripNum in tripNumberList"
|
||||||
:key="tripNum"
|
:key="tripNum"
|
||||||
:label="tripNum"
|
:label="tripNum"
|
||||||
:value="tripNum"
|
:value="tripNum"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
|
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
|
||||||
<el-select v-model="addModel.serviceNumber" filterable>
|
<el-select v-model="addModel.serviceNumber" filterable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="serviceNumber in serviceNumberList"
|
v-for="serviceNumber in serviceNumberList"
|
||||||
:key="serviceNumber"
|
:key="serviceNumber"
|
||||||
:label="serviceNumber"
|
:label="serviceNumber"
|
||||||
:value="serviceNumber"
|
:value="serviceNumber"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -61,7 +51,6 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
|||||||
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
|
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
|
||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// name: 'TrainMove',
|
// name: 'TrainMove',
|
||||||
name: 'TrainAddPlan',
|
name: 'TrainAddPlan',
|
||||||
@ -74,15 +63,11 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode: '', // 车组号
|
|
||||||
serviceNumber: '', // 服务号
|
serviceNumber: '', // 服务号
|
||||||
tripNumber: '' // 车次号
|
tripNumber: '' // 车次号
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入车组号', trigger: 'change' }
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -143,7 +128,6 @@ export default {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber:''
|
serviceNumber:''
|
||||||
};
|
};
|
||||||
@ -155,7 +139,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
// this.$messageBox(error.message);
|
// this.$messageBox(error.message);
|
||||||
});
|
});
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
@ -176,9 +160,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
|
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
|
||||||
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
|
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
|
||||||
<menu-station-stand ref="menuStationStand" :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-switch ref="menuSwitch" :selected="selected" />
|
||||||
<menu-signal ref="menuSignal" :selected="selected" />
|
<menu-signal ref="menuSignal" :selected="selected" />
|
||||||
<menu-section ref="menuSection" :selected="selected" />
|
<menu-section ref="menuSection" :selected="selected" />
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<speed-limit-control ref="speedLimitControl" />
|
<speed-limit-control ref="speedLimitControl" />
|
||||||
<alxe-effective ref="alxeEffective" />
|
<alxe-effective ref="alxeEffective" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -23,6 +24,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -33,7 +36,8 @@ export default {
|
|||||||
SpeedLimitControl,
|
SpeedLimitControl,
|
||||||
AlxeEffective,
|
AlxeEffective,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -156,6 +170,24 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
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() {
|
// alxeFailure() {
|
||||||
// this.mouseCancelState(this.selected);
|
// this.mouseCancelState(this.selected);
|
||||||
|
@ -20,14 +20,14 @@ export default {
|
|||||||
PopMenu,
|
PopMenu,
|
||||||
StationControl
|
StationControl
|
||||||
},
|
},
|
||||||
props: {
|
// props: {
|
||||||
selected: {
|
// selected: {
|
||||||
type: Object,
|
// type: Object,
|
||||||
default() {
|
// default() {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<train-move ref="trainMove" />
|
<train-move ref="trainMove" />
|
||||||
<!-- <train-edit ref="trainEdit" /> -->
|
<!-- <train-edit ref="trainEdit" /> -->
|
||||||
<train-set-plan ref="trainSetPlan" />
|
<train-set-plan ref="trainSetPlan" />
|
||||||
<train-add-plan ref="trainAddPlan" />
|
|
||||||
<!-- <train-move-evently ref="trainMoveEvently" /> -->
|
<!-- <train-move-evently ref="trainMoveEvently" /> -->
|
||||||
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
|
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
|
||||||
<train-set-head ref="trainSetHead" />
|
<train-set-head ref="trainSetHead" />
|
||||||
@ -24,7 +23,6 @@ import TrainDelete from './dialog/trainDelete';
|
|||||||
import TrainDefine from './dialog/trainDefine';
|
import TrainDefine from './dialog/trainDefine';
|
||||||
import TrainMove from './dialog/trainMove';
|
import TrainMove from './dialog/trainMove';
|
||||||
import TrainSetPlan from './dialog/trainSetPlan';
|
import TrainSetPlan from './dialog/trainSetPlan';
|
||||||
import TrainAddPlan from './dialog/trainAddPlan';
|
|
||||||
import TrainSetHead from './dialog/trainSetHead';
|
import TrainSetHead from './dialog/trainSetHead';
|
||||||
import TrainSetWork from './dialog/trainSetWork';
|
import TrainSetWork from './dialog/trainSetWork';
|
||||||
import trainSetWorkATP from './dialog/trainSetWorkATP';
|
import trainSetWorkATP from './dialog/trainSetWorkATP';
|
||||||
@ -44,7 +42,6 @@ export default {
|
|||||||
TrainDefine,
|
TrainDefine,
|
||||||
TrainMove,
|
TrainMove,
|
||||||
TrainSetPlan,
|
TrainSetPlan,
|
||||||
TrainAddPlan,
|
|
||||||
TrainSetHead,
|
TrainSetHead,
|
||||||
TrainSetWork,
|
TrainSetWork,
|
||||||
trainSetWorkATP
|
trainSetWorkATP
|
||||||
@ -148,11 +145,6 @@ export default {
|
|||||||
handler: this.moveTrainId,
|
handler: this.moveTrainId,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '新建计划车',
|
|
||||||
handler: this.addPlanTrain,
|
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'separator'
|
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() {
|
setHeadTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
|
@ -32,8 +32,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
messages: [this.$t('tip.commandFailed')],
|
messages: [this.$t('tip.commandFailed')]
|
||||||
operate: null
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -53,8 +52,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doShow(operate, messages) {
|
doShow(messages) {
|
||||||
this.operate = operate || {};
|
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.messages = [this.$t('tip.commandFailed')];
|
this.messages = [this.$t('tip.commandFailed')];
|
||||||
if (messages && messages != 'null') {
|
if (messages && messages != 'null') {
|
||||||
|
@ -170,7 +170,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 信号关灯
|
// 信号关灯
|
||||||
@ -187,10 +187,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 信号重开
|
// 信号重开
|
||||||
@ -207,10 +207,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消进路
|
// 取消进路
|
||||||
@ -230,7 +230,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 进路交人工控
|
// 进路交人工控
|
||||||
@ -250,7 +250,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 进路交ATS自动控
|
// 进路交ATS自动控
|
||||||
@ -270,7 +270,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置运行等级
|
// 设置运行等级
|
||||||
@ -291,7 +291,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 停站时间
|
// 停站时间
|
||||||
@ -312,7 +312,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置折返策略
|
// 设置折返策略
|
||||||
@ -333,7 +333,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -152,7 +152,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -151,10 +151,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 信号关灯
|
// 信号关灯
|
||||||
@ -206,7 +206,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消联锁自动进路
|
// 取消联锁自动进路
|
||||||
@ -226,7 +226,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置联锁自动触发
|
// 设置联锁自动触发
|
||||||
@ -246,7 +246,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消联锁自动触发
|
// 取消联锁自动触发
|
||||||
@ -267,7 +267,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消
|
// 取消
|
||||||
@ -281,7 +281,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -297,10 +297,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 进路交自动控
|
// 进路交自动控
|
||||||
@ -311,10 +311,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -138,10 +138,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -154,7 +154,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ import ConfirmControl from './childDialog/confirmControl';
|
|||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||||
import { deepAssign } from '@/utils/index';
|
import { deepAssign } from '@/utils/index';
|
||||||
import { menuOperate, commitOperate } from '../utils/menuOperate';
|
import { menuOperate, commitOperate } from '../utils/menuOperate';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RouteSelection',
|
name: 'RouteSelection',
|
||||||
@ -72,6 +73,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'overlapData'
|
||||||
|
]),
|
||||||
show() {
|
show() {
|
||||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
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.$store.dispatch('training/updateMapState', [...containSectionList]);
|
||||||
this.beforeSectionList = containSectionList || [];
|
this.beforeSectionList = containSectionList || [];
|
||||||
|
|
||||||
@ -210,10 +232,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -129,10 +129,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -117,10 +117,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
|
@ -153,10 +153,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -170,7 +170,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -79,6 +79,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import { now } from '@/utils/date';
|
import { now } from '@/utils/date';
|
||||||
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StationCmdControl',
|
name: 'StationCmdControl',
|
||||||
@ -311,11 +312,11 @@ export default {
|
|||||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||||
/** 上电解锁*/
|
/** 上电解锁*/
|
||||||
operate.operation = OperationEvent.Station.powerUnLock.confirm2.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) {
|
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||||
/** 执行关键操作测试*/
|
/** 执行关键操作测试*/
|
||||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
|
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
|
||||||
// operate.cmdType = CMD.Station.execKeyOperationTest;
|
operate.cmdType = CMD.Station.CMD_STATION_KEY_OPERATION_TEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setMessage('');
|
this.setMessage('');
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -144,10 +144,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
227
src/jmapNew/theme/xian_01/menus/dialog/trainAddPlan.vue
Normal file
227
src/jmapNew/theme/xian_01/menus/dialog/trainAddPlan.vue
Normal 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>
|
@ -17,19 +17,19 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="trainType" label-width="0px">
|
<el-form-item prop="type" label-width="0px">
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
:id="domIdTrainType"
|
:id="domIdTrainType"
|
||||||
v-model="formModel.trainType"
|
v-model="formModel.type"
|
||||||
style="margin-left: 15px;"
|
style="margin-left: 15px;"
|
||||||
@change="trainTypeChange"
|
@change="trainTypeChange"
|
||||||
>
|
>
|
||||||
<el-radio :label="'01'">{{ $t('menu.planTrain') }}</el-radio>
|
<el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
|
||||||
<el-radio :label="'02'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
<el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||||
<el-radio :label="'03'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</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>
|
<span slot="label">{{ $t('menu.serviceNumber') }}</span>
|
||||||
<el-input
|
<el-input
|
||||||
:id="domIdServerNo"
|
:id="domIdServerNo"
|
||||||
@ -37,40 +37,38 @@
|
|||||||
:disabled="serverNoIsDisabled"
|
:disabled="serverNoIsDisabled"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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
|
<el-input
|
||||||
:id="domIdTrainNo"
|
:id="domIdTrainNo"
|
||||||
v-model="formModel.tripNumber"
|
v-model="formModel.tripNumber"
|
||||||
:disabled="trainNoIsDisabled"
|
|
||||||
maxlength="4"
|
maxlength="4"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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
|
<el-input
|
||||||
:id="domIdTargetCode"
|
:id="domIdTargetCode"
|
||||||
v-model="formModel.targetCode"
|
v-model="formModel.destinationCode"
|
||||||
:disabled="targetCodeIsDisabled"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
|
<!--<el-form-item v-if="formModel.type == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">-->
|
||||||
<el-select
|
<!--<el-select-->
|
||||||
:id="domIdTrainNumber"
|
<!--:id="domIdTrainNumber"-->
|
||||||
v-model="formModel.category"
|
<!--v-model="formModel.category"-->
|
||||||
filterable
|
<!--filterable-->
|
||||||
:disabled="true"
|
<!--:disabled="true"-->
|
||||||
>
|
<!-->-->
|
||||||
<el-option
|
<!--<el-option-->
|
||||||
v-for="item in categoryList"
|
<!--v-for="item in categoryList"-->
|
||||||
:key="item.value"
|
<!--:key="item.value"-->
|
||||||
:label="item.name"
|
<!--:label="item.name"-->
|
||||||
:value="item.value"
|
<!--:value="item.value"-->
|
||||||
/>
|
<!--/>-->
|
||||||
</el-select>
|
<!--</el-select>-->
|
||||||
</el-form-item>
|
<!--</el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row justify="center" class="button-group">
|
<el-row justify="center" class="button-group">
|
||||||
<el-col :span="10" :offset="2">
|
<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>
|
||||||
<el-col :span="8" :offset="4">
|
<el-col :span="8" :offset="4">
|
||||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
<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 ConfirmTrain from './childDialog/confirmTrain';
|
||||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||||
|
import { menuOperate, commitOperate } from '../utils/menuOperate';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainControl',
|
name: 'TrainControl',
|
||||||
@ -104,9 +103,9 @@ export default {
|
|||||||
formModel: {
|
formModel: {
|
||||||
tripNumber: '',
|
tripNumber: '',
|
||||||
groupNumber: '',
|
groupNumber: '',
|
||||||
trainType: '01',
|
type: 'PLAN',
|
||||||
serviceNumber: '',
|
serviceNumber: '',
|
||||||
targetCode: '',
|
destinationCode: '',
|
||||||
category: 'MM'
|
category: 'MM'
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ export default {
|
|||||||
groupNumber: [
|
groupNumber: [
|
||||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
trainType: [
|
type: [
|
||||||
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
@ -123,7 +122,7 @@ export default {
|
|||||||
tripNumber: [
|
tripNumber: [
|
||||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
targetCode: [
|
destinationCode: [
|
||||||
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -252,20 +251,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'formModel.tripNumber': function(val) {
|
// 'formModel.tripNumber': function(val) {
|
||||||
if (val.length == 4) {
|
// if (val.length == 4) {
|
||||||
this.trainNoChange(val);
|
// // this.trainNoChange(val);
|
||||||
} else {
|
// } else {
|
||||||
this.formModel = {
|
// this.formModel = {
|
||||||
groupNumber: this.formModel.groupNumber,
|
// groupNumber: this.formModel.groupNumber,
|
||||||
tripNumber: val,
|
// tripNumber: val,
|
||||||
trainType: this.formModel.trainType,
|
// type: this.formModel.type,
|
||||||
serviceNumber: '',
|
// serviceNumber: '',
|
||||||
targetCode: '',
|
// destinationCode: '',
|
||||||
category: 'MM'
|
// category: 'MM'
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@ -282,13 +281,12 @@ export default {
|
|||||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
groupNumber: model.groupNumber,
|
groupNumber: model.groupNumber,
|
||||||
tripNumber: `${model.directionCode}${model.tripNumber}`,
|
tripNumber: model.tripNumber,
|
||||||
trainType: model.type,
|
type: model.type ? model.type : 'PLAN',
|
||||||
serviceNumber: model.serviceNumber,
|
serviceNumber: model.serviceNumber,
|
||||||
targetCode: model.targetCode,
|
destinationCode: model.destinationCode,
|
||||||
category: 'MM'
|
category: 'MM'
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 加载列车数据*/
|
/** 加载列车数据*/
|
||||||
this.loadInitData(this.map);
|
this.loadInitData(this.map);
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
@ -415,7 +413,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -426,27 +424,52 @@ export default {
|
|||||||
editTrainId() {
|
editTrainId() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const operate = {
|
// const operate = {
|
||||||
send: true,
|
// send: true,
|
||||||
|
//
|
||||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
// operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||||
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
|
// cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
|
||||||
messages: [this.$t('tip.editTrainIdTip')],
|
// messages: [this.$t('tip.editTrainIdTip')],
|
||||||
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
|
// 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: ''
|
||||||
};
|
};
|
||||||
|
if (this.formModel.type === '01') {
|
||||||
this.loading = true;
|
params.serviceNumber = this.formModel.serviceNumber;
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
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;
|
this.loading = false;
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
this.$refs.confirmTrain.doShow(operate);
|
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -133,7 +133,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
180
src/jmapNew/theme/xian_01/menus/dialog/trainDetail.vue
Normal file
180
src/jmapNew/theme/xian_01/menus/dialog/trainDetail.vue
Normal 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>
|
@ -167,7 +167,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -172,7 +172,7 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -67,6 +67,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<!--<div class="deviceStatus">-->
|
||||||
|
<!--<div class="holdTrainStatus">H</div>-->
|
||||||
|
<!--<div class="jumpStopStatus">S</div>-->
|
||||||
|
<!--</div>-->
|
||||||
<station-control-convert ref="stationControlConvert" />
|
<station-control-convert ref="stationControlConvert" />
|
||||||
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
|
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
|
||||||
<view-train-id ref="viewTrainId" />
|
<view-train-id ref="viewTrainId" />
|
||||||
@ -694,7 +698,7 @@ export default {
|
|||||||
<style scoped rel="stylesheet/scss" lang="scss">
|
<style scoped rel="stylesheet/scss" lang="scss">
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
$width: 30px;
|
$width: 30px;
|
||||||
$height: 30px;
|
$height:30px;
|
||||||
$menuPadding: 10px;
|
$menuPadding: 10px;
|
||||||
$menuItemHeight: 30px;
|
$menuItemHeight: 30px;
|
||||||
$menuItemWidth: 190px;
|
$menuItemWidth: 190px;
|
||||||
@ -810,4 +814,21 @@ export default {
|
|||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
-webkit-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>
|
</style>
|
||||||
|
@ -63,12 +63,12 @@ export default {
|
|||||||
initMenu() {
|
initMenu() {
|
||||||
this.menuNormal = [];
|
this.menuNormal = [];
|
||||||
this.stationList.forEach(station => {
|
this.stationList.forEach(station => {
|
||||||
if (station.chargeStationCodeList && station.chargeStationCodeList.length) {
|
if (station.relStationCodeList && station.relStationCodeList.length) {
|
||||||
const node = {
|
const node = {
|
||||||
label: station.name,
|
label: station.name,
|
||||||
children: []
|
children: []
|
||||||
};
|
};
|
||||||
station.chargeStationCodeList.forEach(item => {
|
station.relStationCodeList.forEach(item => {
|
||||||
const next = this.$store.getters['map/getDeviceByCode'](item);
|
const next = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
node.children.push({
|
node.children.push({
|
||||||
code: next.code,
|
code: next.code,
|
||||||
|
@ -121,8 +121,8 @@ export default {
|
|||||||
this.doClose();
|
this.doClose();
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]);
|
this.$refs.noticeInfo.doShow(this.$t('menu.menuDialog.IncorrectPassword'));
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -136,12 +136,12 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
} else {
|
} else {
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -118,12 +118,12 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
} else {
|
} else {
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -135,12 +135,12 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
} else {
|
} else {
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
// this.$refs.noticeInfo.doShow(operate);
|
// this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<speed-cmd-control ref="speedCmdControl" />
|
<speed-cmd-control ref="speedCmdControl" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,6 +22,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import { menuOperate, commitOperate } from './utils/menuOperate';
|
import { menuOperate, commitOperate } from './utils/menuOperate';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -30,7 +33,8 @@ export default {
|
|||||||
SectionCmdControl,
|
SectionCmdControl,
|
||||||
SpeedCmdControl,
|
SpeedCmdControl,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -151,6 +165,7 @@ export default {
|
|||||||
},
|
},
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
|
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
@ -170,6 +185,24 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
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() {
|
setStoppage() {
|
||||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||||
|
@ -56,46 +56,30 @@ export default {
|
|||||||
// {
|
// {
|
||||||
// label: '上电解锁',
|
// label: '上电解锁',
|
||||||
// handler: this.powerUnLock,
|
// handler: this.powerUnLock,
|
||||||
// cmdType: CMD.Station.active,
|
// cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// label: '执行关键操作测试',
|
// label: '执行关键操作测试',
|
||||||
// handler: this.execKeyOperationTest,
|
// handler: this.execKeyOperationTest,
|
||||||
// cmdType: CMD.Station.active,
|
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
|
||||||
// }
|
// }
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
{
|
{
|
||||||
label: '所有进路自排关',
|
label: '所有进路交人工控',
|
||||||
handler: this.humanControlALL,
|
handler: this.humanControlALL,
|
||||||
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
|
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '所有进路自排开',
|
label: '所有进路交ATS自动控',
|
||||||
handler: this.atsAutoControlALL,
|
handler: this.atsAutoControlALL,
|
||||||
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
|
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '上电解锁',
|
label: '执行关键操作测试',
|
||||||
handler: this.powerUnLock,
|
handler: this.execKeyOperationTest,
|
||||||
cmdType: CMD.Station.active
|
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: [
|
menuForce: [
|
||||||
@ -140,9 +124,6 @@ export default {
|
|||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
if (this.operatemode === OperateMode.ADMIN) {
|
|
||||||
this.menu = [...this.menu, ...this.menuForce];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
@ -150,10 +131,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
if (this.selected.ciStation) {
|
||||||
this.initMenu();
|
this.clickEvent();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
this.initMenu();
|
||||||
this.$refs.popMenu.resetShowPosition(point);
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
this.$refs.popMenu.resetShowPosition(point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
@ -174,10 +157,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消故障
|
// 取消故障
|
||||||
@ -193,10 +176,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 全站设置联锁自动触发
|
// 全站设置联锁自动触发
|
||||||
@ -212,7 +195,7 @@ export default {
|
|||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 全站取消联锁自动触发
|
// 全站取消联锁自动触发
|
||||||
@ -228,7 +211,7 @@ export default {
|
|||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 上电解锁
|
// 上电解锁
|
||||||
@ -259,12 +242,15 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 所有进路自排关
|
// 所有进路交人工控
|
||||||
humanControlALL() {
|
humanControlALL() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
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 }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@ -273,12 +259,15 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 所有进路自排开
|
// 所有进路交ATS自动控
|
||||||
atsAutoControlALL() {
|
atsAutoControlALL() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
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 }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -49,42 +49,51 @@ export default {
|
|||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [],
|
Local: [],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
{
|
||||||
// label: this.$t('menu.menuTrain.addTrainId'),
|
label: this.$t('menu.menuTrain.addTrainId'),
|
||||||
// handler: this.addTrainId,
|
handler: this.addTrainId,
|
||||||
// auth: { station: true, center: true },
|
cmdType:''
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
},
|
||||||
// },
|
{
|
||||||
// {
|
label: this.$t('menu.menuTrain.deleteTrainId'),
|
||||||
// label: this.$t('menu.menuTrain.deleteTrainId'),
|
handler: this.delTrainId,
|
||||||
// handler: this.delTrainId,
|
cmdType:''
|
||||||
// auth: { station: true, center: true },
|
},
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
{
|
||||||
// },
|
label: this.$t('menu.menuTrain.editTrainId'),
|
||||||
// {
|
handler: this.editTrainId,
|
||||||
// label: this.$t('menu.menuTrain.editTrainId'),
|
cmdType:CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||||
// handler: this.editTrainId,
|
},
|
||||||
// auth: { station: true, center: true },
|
{
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
label: this.$t('menu.menuTrain.editTrainNo'),
|
||||||
// },
|
handler: this.editTrainNo,
|
||||||
// {
|
cmdType:''
|
||||||
// label: this.$t('menu.menuTrain.editTrainNo'),
|
},
|
||||||
// handler: this.editTrainNo,
|
{
|
||||||
// auth: { station: true, center: true },
|
label: this.$t('menu.menuTrain.moveTrainId'),
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
handler: this.moveTrainId,
|
||||||
// },
|
cmdType:''
|
||||||
// {
|
},
|
||||||
// label: this.$t('menu.menuTrain.moveTrainId'),
|
{
|
||||||
// handler: this.moveTrainId,
|
label: this.$t('menu.menuTrain.switchTrainId'),
|
||||||
// auth: { station: true, center: true },
|
handler: this.switchTrainId,
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
cmdType:''
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// label: this.$t('menu.menuTrain.switchTrainId'),
|
label: '标记ATP切除',
|
||||||
// handler: this.switchTrainId,
|
handler: this.undeveloped(),
|
||||||
// auth: { station: true, center: true },
|
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT
|
||||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
},
|
||||||
// }
|
{
|
||||||
|
label: '标记ATP激活',
|
||||||
|
handler: this.undeveloped(),
|
||||||
|
cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '查看列车详细运行信息',
|
||||||
|
handler: this.undeveloped(),
|
||||||
|
cmdType: CMD.TrainWindow.CMD_TRAIN_INFO
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
menuForce: [
|
||||||
@ -145,8 +154,6 @@ export default {
|
|||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.menu = MenuContextHandler.covert(this.menu);
|
|
||||||
},
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
@ -177,10 +184,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消故障
|
// 取消故障
|
||||||
@ -198,10 +205,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 限速行驶
|
// 限速行驶
|
||||||
@ -219,10 +226,10 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(step);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 添加列车识别号
|
// 添加列车识别号
|
||||||
@ -310,6 +317,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
undeveloped() {},
|
||||||
// 交换列车识别号
|
// 交换列车识别号
|
||||||
switchTrainId() {
|
switchTrainId() {
|
||||||
const step = {
|
const step = {
|
||||||
|
@ -268,7 +268,7 @@ export default {
|
|||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refuse() {
|
refuse() {
|
||||||
@ -292,7 +292,7 @@ export default {
|
|||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,6 +264,12 @@ export const menuOperate = {
|
|||||||
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
|
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
TrainWindow: {
|
||||||
|
editTrainId: {
|
||||||
|
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||||
|
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||||
|
}
|
||||||
|
},
|
||||||
Common: {
|
Common: {
|
||||||
setFault: {
|
setFault: {
|
||||||
operation: OperationEvent.Section.stoppage.menu.operation,
|
operation: OperationEvent.Section.stoppage.menu.operation,
|
||||||
|
@ -12,16 +12,6 @@
|
|||||||
>
|
>
|
||||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||||
<div style="width: 96%;">
|
<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-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
|
||||||
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
|
||||||
<el-option
|
<el-option
|
||||||
@ -73,15 +63,11 @@ export default {
|
|||||||
tripNumberList: [],
|
tripNumberList: [],
|
||||||
serviceNumberList: [],
|
serviceNumberList: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
trainCode: '', // 车组号
|
|
||||||
serviceNumber: '', // 服务号
|
serviceNumber: '', // 服务号
|
||||||
tripNumber: '' // 车次号
|
tripNumber: '' // 车次号
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
trainCode: [
|
|
||||||
{ required: true, message: '请输入车组号', trigger: 'change' }
|
|
||||||
],
|
|
||||||
serviceNumber: [
|
serviceNumber: [
|
||||||
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
{ required: true, message: '请输入服务号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -142,7 +128,6 @@ export default {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
this.addModel = {
|
this.addModel = {
|
||||||
trainCode:'',
|
|
||||||
tripNumber:'',
|
tripNumber:'',
|
||||||
serviceNumber:''
|
serviceNumber:''
|
||||||
};
|
};
|
||||||
@ -175,9 +160,8 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||||
param: {
|
param: {
|
||||||
trainCode: this.addModel.trainCode, // 车组号
|
|
||||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||||
tripNumber: this.addModel.tripNumber // 车次号
|
tripNumber: this.addModel.tripNumber // 车次号
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<speed-limit-control ref="speedLimitControl" />
|
<speed-limit-control ref="speedLimitControl" />
|
||||||
<alxe-effective ref="alxeEffective" />
|
<alxe-effective ref="alxeEffective" />
|
||||||
<notice-info ref="noticeInfo" />
|
<notice-info ref="noticeInfo" />
|
||||||
|
<train-add-plan ref="trainAddPlan" />
|
||||||
<set-fault ref="setFault" />
|
<set-fault ref="setFault" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -24,6 +25,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
|||||||
import {menuOperate, commitOperate} from './utils/menuOperate';
|
import {menuOperate, commitOperate} from './utils/menuOperate';
|
||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault';
|
||||||
|
import TrainAddPlan from './dialog/trainAddPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -34,7 +36,8 @@ export default {
|
|||||||
SpeedLimitControl,
|
SpeedLimitControl,
|
||||||
AlxeEffective,
|
AlxeEffective,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault
|
SetFault,
|
||||||
|
TrainAddPlan
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
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: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@ -178,6 +191,24 @@ export default {
|
|||||||
this.$refs.popMenu.close();
|
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() {
|
setStoppage() {
|
||||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
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
Loading…
Reference in New Issue
Block a user