Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
db1e4f36ef
@ -8,6 +8,7 @@ NODE_ENV = 'development'
|
||||
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
|
||||
|
||||
|
||||
|
1
.env.heb
1
.env.heb
@ -6,3 +6,4 @@ VUE_APP_PRO = 'local'
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
|
@ -6,3 +6,4 @@ VUE_APP_PRO = 'ntyl'
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
|
@ -5,3 +5,4 @@ NODE_ENV = 'production'
|
||||
VUE_APP_BASE_API = 'https://api.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
|
@ -5,3 +5,4 @@ NODE_ENV = 'test'
|
||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div id="app">
|
||||
<router-view />
|
||||
<deomon-topic ref="deomonTopic" />
|
||||
<img v-show="loading" :src="loadingImg" style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 2003">
|
||||
<img v-show="loading" :src="loadingImg" class="AppAll">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -108,3 +108,6 @@ export default {
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppAll{position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 2003}
|
||||
</style>
|
||||
|
@ -562,3 +562,35 @@ export function deleteStationDestination(mapId, code) {
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 大铁地图进路相关接口 创建,修改,删除,根据id查询,
|
||||
export function postBigRoute(data, mapId) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/route/railway `,
|
||||
method: 'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
export function getBigRouteList(mapId) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/route/all `,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 大铁地图进路删除接口
|
||||
export function deleteBigRoute(mapId, code) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/route/${code}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 草稿地图修改检查配置接口
|
||||
export function checkConfig(mapId, data) {
|
||||
return request({
|
||||
url: `/api/mapBuild/${mapId}/checkConfig `,
|
||||
method: 'PUT',
|
||||
data
|
||||
});
|
||||
}
|
||||
// { check: true/false } (body体)
|
||||
|
94
src/api/rtSimulation.js
Normal file
94
src/api/rtSimulation.js
Normal file
@ -0,0 +1,94 @@
|
||||
import request from '@/utils/request';
|
||||
/** 创建仿真 */
|
||||
export function createSimulation(data) {
|
||||
return request({
|
||||
url: `/rtSimulation?mapId=${data.mapId}&prdType=${data.prdType}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 根据仿真group获取仿真基础信息 */
|
||||
export function getSimulationInfoByGroup(groupId) {
|
||||
return request({
|
||||
url: `/rtSimulation/${groupId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 根据仿真group获取仿真地图数据 */
|
||||
export function getMapDataByGroup(groupId) {
|
||||
return request({
|
||||
url: `/rtSimulation/${groupId}/mapData`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 仿真发送指令 */
|
||||
export function sendSimulationCommand(group, memberId, type, data) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/member/${memberId}/operate/${type}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 获取仿真成员列表 */
|
||||
export function getMemberListCommon(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取仿真用户列表 */
|
||||
export function getUserListCommon(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/users`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 销毁仿真 */
|
||||
export function destroySimulation(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/destroy`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 初始化仿真 */
|
||||
export function initSimulation(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/init`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 设置故障 */
|
||||
export function setSimulationFault(group, data) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/fault`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 取消故障 */
|
||||
export function cancelSimulationFault(group, deviceId, faultType) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/device/${deviceId}/fault/${faultType}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 仿真运行倍速 */
|
||||
export function timesSpeedPlayback(group, speed) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/updateSpeed/${speed}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 仿真暂停 */
|
||||
export function simulationPause(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/pause`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 仿真开始 */
|
||||
export function simulationStart(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/start`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
@ -15,6 +15,13 @@ export function generateMapSystem(mapId) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 生成指定子系统 */
|
||||
export function generateAppointMapSystem(mapId, prdType) {
|
||||
return request({
|
||||
url: `/api/mapSystem/generate/${mapId}/${prdType}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 查询子系统信息 */
|
||||
export function getSubSystemInfo(id) {
|
||||
return request({
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="35%" :before-close="done => {}" :show-close="false" center>
|
||||
<div style="text-align:center; margin:auto;">
|
||||
<div class="qrcodeView">
|
||||
<qrcode-vue v-loading="loading" :value="url" :size="400" />
|
||||
</div>
|
||||
<div v-if="group" style="text-align: center;font-size: 18px;font-weight: bold; margin-top:40px;">
|
||||
<div v-if="group" class="qrcodeGroup">
|
||||
<span>{{ $t('global.roomId')+group }}</span>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@ -47,3 +47,7 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.qrcodeView{text-align:center; margin:auto;}
|
||||
.qrcodeGroup{text-align: center;font-size: 18px;font-weight: bold; margin-top:40px;}
|
||||
</style>
|
||||
|
@ -167,7 +167,7 @@
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<div v-if="!queryList.paginationHiden" class="page-container " style="text-align: center; margin: 10px 0; height: 40px;">
|
||||
<div v-if="!queryList.paginationHiden" class="page-container pageContainerView">
|
||||
<el-pagination
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100] "
|
||||
@ -601,4 +601,5 @@ export default {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.pageContainerView{text-align: center; margin: 10px 0; height: 40px;}
|
||||
</style>
|
||||
|
@ -20,9 +20,7 @@ export default {
|
||||
deletePlanCar: '删除计划车'
|
||||
},
|
||||
openRunPlan: {
|
||||
// selectRunplan: '选择运行图',
|
||||
delete: '删除',
|
||||
// modify: '修改',
|
||||
runPlanList: '运行图列表',
|
||||
getRunPlanListFail: '获取运行图列表失败',
|
||||
confirmDeleteRunPlan: '您确认是否删除此运行图?',
|
||||
@ -32,71 +30,24 @@ export default {
|
||||
modifying: {
|
||||
tripNumber: '车次号:',
|
||||
pleaseSelect: '请选择',
|
||||
manual: '手工',
|
||||
defaultStopTime: '缺省停站时间:',
|
||||
serviceNumber: '表号:',
|
||||
clearGuest: '清客',
|
||||
continuationPlan: '延续计划',
|
||||
firstTrain: '首班车',
|
||||
serialNumber: '序列号:',
|
||||
defaultRunLevel: '运行等级:',
|
||||
startTime: '开始时间',
|
||||
selectTime: '选择时间',
|
||||
inStock: '入库',
|
||||
outStock: '出库',
|
||||
lastTrain: '末班车',
|
||||
route: '交路:',
|
||||
// startingStation 起始站
|
||||
// startSection 起始区段
|
||||
// endStationTitle 终到站
|
||||
// endSection 终到区段
|
||||
// description 描述
|
||||
// detail: '详情:',
|
||||
// station: '车站',
|
||||
// section: '区段',
|
||||
// stopTime: '停站时间',
|
||||
// runLevel: '运行等级',
|
||||
// arrivalTime: '到点',
|
||||
// departureTime: '发点',
|
||||
showDefaultTime: '显示默认停站时间和运行等级',
|
||||
automatic: '自动',
|
||||
default: '默认',
|
||||
modifyTask: '修改任务',
|
||||
// setMessageTip1: '请先设置开始区段',
|
||||
// setMessageTip2: '终到区段',
|
||||
// setMessageTip3: '的站间运行时间',
|
||||
modifyTaskSuccess: '修改任务成功!',
|
||||
modifyTaskFailed: '修改任务失败',
|
||||
|
||||
startingStation: '起始站',
|
||||
startSection: '起始区段',
|
||||
endStation: '终点站',
|
||||
endSection: '终点区段',
|
||||
direction: '方向',
|
||||
distance: '距离',
|
||||
// operation: '操作',
|
||||
// edit: '编辑',
|
||||
// save: '保存',
|
||||
// cancelAndQuit: '取消&退出',
|
||||
modifySuccess: '修改成功!',
|
||||
modifyFailed: '修改失败',
|
||||
modifyRunLevel: '修改运行等级',
|
||||
modifyStopTime:'修改停站时间',
|
||||
|
||||
// startStationTips: '起始站发车时间不变',
|
||||
// endStationTips: '终到站到达时间不变',
|
||||
// startStationTitle: '起始站',
|
||||
// startedStation: '起始站台',
|
||||
endStationTitle: '终到站'
|
||||
// endedStation: '终到站台',
|
||||
// description: '描述',
|
||||
// modifyTaskRoute: '修改任务交路',
|
||||
// time: '时间',
|
||||
|
||||
// modifyStartTime: '修改开始时间:',
|
||||
// modifyStartTimeTitle: '修改起始时间',
|
||||
// search: '查找',
|
||||
// modifyTwoStationTime: '修改两站之间的时间'
|
||||
modifyStopTime:'修改停站时间'
|
||||
},
|
||||
editSmoothRun: {
|
||||
trainProportion: '分车比例',
|
||||
|
@ -509,26 +509,28 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
|
||||
}
|
||||
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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").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.getObjectByName("d3d001").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").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;
|
||||
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,7 +543,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
scope.modelmanager.standmodel.action.time = 0;
|
||||
scope.modelmanager.standmodel.action.timeScale = 1;
|
||||
scope.modelmanager.standmodel.action.play();
|
||||
console.log(data);
|
||||
|
||||
localVoicePlay("开往"+psdVoiceStationList[data.code].finlStationName+"方向的列车进站了!");
|
||||
}
|
||||
|
||||
@ -562,12 +564,12 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
this.deviceFaultSet = function (data) {
|
||||
|
||||
if (data.type == "SIGNAL") {//从上往下红绿黄
|
||||
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[2].material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.children[2].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.getObjectByName("d3d001").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
|
||||
}
|
||||
if (data.type == "PSD" || data.type == "STAND") {
|
||||
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
|
||||
@ -653,35 +655,37 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").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.getObjectByName("d3d001").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").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;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
|
||||
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
88
src/jlmap3d/lesson3d/lesson3dplayer.js
Normal file
88
src/jlmap3d/lesson3d/lesson3dplayer.js
Normal file
@ -0,0 +1,88 @@
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
//静态资源文件路径
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
//轨道视角控制
|
||||
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
|
||||
import { AssetModelManager } from '@/jlmap3d/lesson3d/manager/assetmodelmanager.js';
|
||||
|
||||
import { ControlManager } from '@/jlmap3d/lesson3d/manager/controlmanager.js';
|
||||
|
||||
// import { AnimationManager } from '@/jlmap3d/lesson3d/manager/assetmodelmanager.js';
|
||||
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene;
|
||||
|
||||
export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
this.dom = dom;
|
||||
|
||||
//定义相机
|
||||
|
||||
|
||||
//定义场景(渲染容器)
|
||||
scene = new THREE.Scene();
|
||||
scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
scene.add(ambientLight);
|
||||
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
let controlManager = new ControlManager( dom,scene,lessonData,lessonIndex);
|
||||
|
||||
let assetModelManager = new AssetModelManager(scene,controlManager);
|
||||
assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList).then((result) => {
|
||||
controlManager.initOctree(assetModelManager.loadAsset['default1'].mesh);
|
||||
|
||||
animate();
|
||||
console.log(lessonData.lessonProgress[lessonIndex]);
|
||||
if(lessonData.lessonProgress[lessonIndex].action.length>0){
|
||||
controlManager.initNewEvent(lessonData.lessonProgress[lessonIndex].action,assetModelManager.lessonTriggerList);
|
||||
}
|
||||
resolve("loadeend"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});;
|
||||
|
||||
|
||||
|
||||
this.actionRemove = function(actionModel){
|
||||
assetModelManager.otherModel.remove(actionModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
|
||||
if(controlManager.controlMode == "free"){
|
||||
controlManager.updateOrbitControl();
|
||||
}
|
||||
if(controlManager.controlMode == "fps"){
|
||||
controlManager.updateFpsControl();
|
||||
}
|
||||
// delta = clock.getDelta();
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
|
||||
this.attachModel = function(selectModel){
|
||||
}
|
||||
}
|
160
src/jlmap3d/lesson3d/manager/assetmodelmanager.js
Normal file
160
src/jlmap3d/lesson3d/manager/assetmodelmanager.js
Normal file
@ -0,0 +1,160 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function AssetModelManager(scene) {
|
||||
let scope = this;
|
||||
|
||||
|
||||
this.assetList = [];
|
||||
|
||||
this.otherModel = new THREE.Group();
|
||||
|
||||
scene.add(this.otherModel);
|
||||
|
||||
this.loadAsset = [];
|
||||
|
||||
this.loadAsset['default1'] = {
|
||||
modelId:'default1',
|
||||
packageName:"车站",
|
||||
url:"/MODEL/2021-04-06/1381-54584.FBX",
|
||||
mesh:"",
|
||||
assetType:'default',
|
||||
isUse:true,
|
||||
resourceType:"三维课程",
|
||||
};
|
||||
|
||||
//场景中可触发事件模型
|
||||
this.lessonTriggerList = [];
|
||||
|
||||
//加载课程资源
|
||||
this.lessonAssetsLoader = function(assetList,modelList){
|
||||
let initlist = [];
|
||||
if(assetList){
|
||||
for(let i = 0;i<assetList.length;i++){
|
||||
assetList[i].mesh = "";
|
||||
scope.loadAsset[assetList[i].modelId] = assetList[i];
|
||||
|
||||
}
|
||||
}
|
||||
for(let k in scope.loadAsset){
|
||||
initlist.push(fbxpromise(scope.loadAsset[k]));
|
||||
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
Promise.all(initlist).then((result) => {
|
||||
|
||||
initTriggerList();
|
||||
for(let i=0;i<modelList.length;i++){
|
||||
let newModelTrigger = scope.loadAsset[modelList[i].modelId].mesh.clone(true);
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.label = modelList[i].label;
|
||||
newModelTrigger.modelId = modelList[i].modelId;
|
||||
newModelTrigger.visible = modelList[i].visible;
|
||||
newModelTrigger.position.x = modelList[i].pos.x;
|
||||
newModelTrigger.position.y = modelList[i].pos.y;
|
||||
newModelTrigger.position.z = modelList[i].pos.z;
|
||||
newModelTrigger.rotation.x = modelList[i].rot.x;
|
||||
newModelTrigger.rotation.y = modelList[i].rot.y;
|
||||
newModelTrigger.rotation.z = modelList[i].rot.z;
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
}
|
||||
|
||||
updateTriggerList(scope.lessonTriggerList);
|
||||
resolve("loaderassets"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
resolve("loaderassets");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// <el-option label="车站" value="standstation"></el-option>
|
||||
// <el-option label="停车场" value="stopstation"></el-option>
|
||||
// <el-option label="单体设备" value="device"></el-option>
|
||||
// <el-option label="线路" value="xl"></el-option>
|
||||
// <el-option label="道岔" value="dc"></el-option>
|
||||
//FT 扶梯
|
||||
//FTAN 扶梯按钮(急停)
|
||||
//FTD 扶梯灯
|
||||
//FTKG 扶梯开关(钥匙孔)
|
||||
//FTTJ 扶梯台阶
|
||||
function initTriggerList(){
|
||||
|
||||
scope.loadAsset['default1'].mesh.getObjectByName("FTAN").showType = "default";
|
||||
scope.loadAsset['default1'].mesh.getObjectByName("FTAN").label = "扶梯急停按钮";
|
||||
scope.lessonTriggerList.push(scope.loadAsset['default1'].mesh.getObjectByName("FTAN"));
|
||||
|
||||
scope.loadAsset['default1'].mesh.getObjectByName("FTKG").showType = "default";
|
||||
scope.loadAsset['default1'].mesh.getObjectByName("FTKG").label = "扶梯钥匙孔";
|
||||
scope.lessonTriggerList.push(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
|
||||
|
||||
|
||||
// console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
|
||||
}
|
||||
|
||||
//动态加载资源
|
||||
this.lessonAssetsNewLoader = function(assetData,pos){
|
||||
let isLoaded = false;
|
||||
|
||||
if(scope.loadAsset[assetData.id]){
|
||||
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||
newModelTrigger.modelId = assetData.id;
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.label = assetData.packageName;
|
||||
newModelTrigger.position.copy(pos);
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
updateTriggerList(scope.lessonTriggerList);
|
||||
}else{
|
||||
scope.loadAsset[assetData.id] = {
|
||||
modelId:assetData.id,
|
||||
packageName:assetData.packageName,
|
||||
url:assetData.url,
|
||||
mesh:"",
|
||||
assetType:'loadModel',
|
||||
isUse:true,
|
||||
resourceType:"三维课程",
|
||||
};
|
||||
|
||||
fbxpromise(scope.loadAsset[assetData.id]).then(function(object){
|
||||
|
||||
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.modelId = assetData.id;
|
||||
newModelTrigger.label = assetData.packageName;
|
||||
newModelTrigger.position.copy(pos);
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
|
||||
updateTriggerList(scope.lessonTriggerList);
|
||||
// resolve("loadednew");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//fbx模型加载
|
||||
function fbxpromise(asset){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||
|
||||
if(asset.assetType == "default"){
|
||||
scene.add(object);
|
||||
}else if(asset.assetType == 'loadModel'){
|
||||
|
||||
}
|
||||
object.label = asset.packageName;
|
||||
asset.mesh = object;
|
||||
resolve();
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
403
src/jlmap3d/lesson3d/manager/controlmanager.js
Normal file
403
src/jlmap3d/lesson3d/manager/controlmanager.js
Normal file
@ -0,0 +1,403 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js';
|
||||
|
||||
import { Octree } from '@/jlmap3d/lesson3d/math/Octree.js';
|
||||
|
||||
export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
let scope = this;
|
||||
this.controlMode = "";
|
||||
this.controls = {};
|
||||
this.nowCamera = null;
|
||||
this.eventHitMode = false;
|
||||
|
||||
let eventBoxs = [];
|
||||
|
||||
|
||||
|
||||
let renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setClearColor(new THREE.Color(0x000000));
|
||||
renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight);
|
||||
renderer.setScissor( 0, 0, dom.offsetWidth, dom.offsetHeight);
|
||||
renderer.setScissorTest( false );
|
||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
renderer.sortObjects = true;
|
||||
dom.appendChild(renderer.domElement);
|
||||
|
||||
let orbitCamera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000);
|
||||
orbitCamera.position.set(0, 80, 40);
|
||||
orbitCamera.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
orbitCamera.updateProjectionMatrix();
|
||||
|
||||
let oribitControl = new THREE.OrbitControls(orbitCamera,dom);
|
||||
oribitControl.maxPolarAngle = Math.PI / 2;
|
||||
oribitControl.minPolarangle = Math.PI / 5;
|
||||
oribitControl.maxDistance = 800;
|
||||
oribitControl.screenSpacePanning = true;
|
||||
oribitControl.update();
|
||||
|
||||
|
||||
let fpsCamera = new THREE.PerspectiveCamera( 75,dom.offsetWidth / dom.offsetHeight, 0.1, 1000 );
|
||||
fpsCamera.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
fpsCamera.rotation.order = 'YXZ';
|
||||
|
||||
let attachBox = new THREE.Mesh(
|
||||
new THREE.BoxGeometry(1, 5, 1),
|
||||
new THREE.MeshBasicMaterial({color: 0xff00000})//RED box
|
||||
);
|
||||
let hitBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||
hitBox.setFromObject(attachBox);
|
||||
scene.add(attachBox);
|
||||
|
||||
//fps control
|
||||
const GRAVITY = 30;
|
||||
|
||||
const NUM_SPHERES = 20;
|
||||
const SPHERE_RADIUS = 0.2;
|
||||
|
||||
const sphereGeometry = new THREE.SphereGeometry( SPHERE_RADIUS, 32, 32 );
|
||||
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0x888855, roughness: 0.8, metalness: 0.5 } );
|
||||
|
||||
const spheres = [];
|
||||
let sphereIdx = 0;
|
||||
|
||||
for ( let i = 0; i < NUM_SPHERES; i ++ ) {
|
||||
|
||||
const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );
|
||||
|
||||
|
||||
scene.add( sphere );
|
||||
|
||||
spheres.push( { mesh: sphere, collider: new THREE.Sphere( new THREE.Vector3( 0, - 100, 0 ), SPHERE_RADIUS ), velocity: new THREE.Vector3() } );
|
||||
|
||||
}
|
||||
|
||||
scope.controlMode = lessonData.lessonProgress[lessonIndex].controlMode;
|
||||
// scope.controls = oribitControl;
|
||||
if(scope.controlMode == "free"){
|
||||
scope.nowCamera = orbitCamera;
|
||||
scope.controls.enabled = true;
|
||||
}else if(scope.controlMode == "fps"){
|
||||
scope.nowCamera = fpsCamera;
|
||||
scope.controls.enabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const worldOctree = new Octree();
|
||||
|
||||
const playerCollider = new Capsule( new THREE.Vector3( 0, 10, 0 ), new THREE.Vector3( 0, 11.9, 0 ), 1 );
|
||||
playerCollider.set(
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.y,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.z),
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.y+1.5,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.z ), 1);
|
||||
attachBox.position.x = lessonData.lessonProgress[lessonIndex].cameraPosition.x;
|
||||
attachBox.position.y = lessonData.lessonProgress[lessonIndex].cameraPosition.y ;
|
||||
attachBox.position.z = lessonData.lessonProgress[lessonIndex].cameraPosition.z;
|
||||
|
||||
|
||||
|
||||
|
||||
const playerVelocity = new THREE.Vector3();
|
||||
const playerDirection = new THREE.Vector3();
|
||||
|
||||
let playerOnFloor = false;
|
||||
|
||||
const keyStates = {};
|
||||
let clock = new THREE.Clock();
|
||||
|
||||
this.updateOrbitControl = function(){
|
||||
oribitControl.update();
|
||||
};
|
||||
|
||||
this.updateFpsControl = function(){
|
||||
const deltaTime = Math.min( 0.1, clock.getDelta() );
|
||||
|
||||
controls( deltaTime );
|
||||
|
||||
updatePlayer( deltaTime );
|
||||
|
||||
updateSpheres( deltaTime );
|
||||
|
||||
if(scope.eventHitMode == true){
|
||||
if(eventBoxs.length>0){
|
||||
|
||||
attachBox.position.copy(fpsCamera.position);
|
||||
for(let i=0;i<eventBoxs.length;i++){
|
||||
hitBox.setFromObject(attachBox);
|
||||
eventBoxs[i].setFromObject(eventBoxs[i].mesh);
|
||||
// console.log(eventBoxs[i]);
|
||||
if(hitBox.intersectsBox(eventBoxs[i])){
|
||||
console.log("相交");
|
||||
console.log(eventBoxs[i].action);
|
||||
if(eventBoxs[i].action.actionMode == "jump"){
|
||||
jumpEvent("action",eventBoxs[i].action);
|
||||
}
|
||||
if(eventBoxs[i].action.actionMode == "remove"){
|
||||
actionEvent("remove",eventBoxs[i].action,eventBoxs[i].mesh);
|
||||
}
|
||||
eventBoxs.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
scope.eventHitMod = false;
|
||||
}
|
||||
// attachBox.position.copy(fpsCamera.position);
|
||||
// hitBox.setFromObject(attachBox);
|
||||
// eventTestBox.setFromObject(eventBox);
|
||||
//
|
||||
// if(hitBox.intersectsBox(eventTestBox)){
|
||||
// //两个物体相交了
|
||||
// console.log("相交");
|
||||
// scope.eventHitMode = false;
|
||||
// }
|
||||
// else{
|
||||
// console.log("不相交");
|
||||
// }
|
||||
}
|
||||
|
||||
render();
|
||||
};
|
||||
|
||||
this.initOctree = function(object){
|
||||
worldOctree.fromGraphNode( object.getObjectByName("Object173") );
|
||||
// scope.controlMode = lessonData.lessonProgress[lessonIndex].controlMode;
|
||||
}
|
||||
|
||||
document.addEventListener( 'keydown', ( event ) => {
|
||||
|
||||
keyStates[ event.code ] = true;
|
||||
|
||||
} );
|
||||
|
||||
document.addEventListener( 'keyup', ( event ) => {
|
||||
|
||||
keyStates[ event.code ] = false;
|
||||
|
||||
} );
|
||||
let fpsMouseStatus = false;
|
||||
document.addEventListener( 'mousedown', () => {
|
||||
fpsMouseStatus = true;
|
||||
// document.body.requestPointerLock();
|
||||
} );
|
||||
|
||||
document.body.addEventListener( 'mousemove', ( event ) => {
|
||||
if(fpsMouseStatus == true){
|
||||
fpsCamera.rotation.y -= event.movementX / 500;
|
||||
fpsCamera.rotation.x -= event.movementY / 500;
|
||||
}
|
||||
// if ( document.pointerLockElement === document.body ) {
|
||||
// }
|
||||
} );
|
||||
|
||||
document.addEventListener( 'mouseup', () => {
|
||||
fpsMouseStatus = false;
|
||||
} );
|
||||
|
||||
|
||||
function playerCollitions() {
|
||||
|
||||
const result = worldOctree.capsuleIntersect( playerCollider );
|
||||
|
||||
playerOnFloor = false;
|
||||
|
||||
if ( result ) {
|
||||
|
||||
playerOnFloor = result.normal.y > 0;
|
||||
|
||||
if ( ! playerOnFloor ) {
|
||||
|
||||
playerVelocity.addScaledVector( result.normal, - result.normal.dot( playerVelocity ) );
|
||||
|
||||
}
|
||||
|
||||
playerCollider.translate( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updatePlayer( deltaTime ) {
|
||||
|
||||
if ( playerOnFloor ) {
|
||||
|
||||
const damping = Math.exp( - 3 * deltaTime ) - 1;
|
||||
playerVelocity.addScaledVector( playerVelocity, damping );
|
||||
|
||||
} else {
|
||||
|
||||
playerVelocity.y -= GRAVITY * deltaTime;
|
||||
|
||||
}
|
||||
|
||||
const deltaPosition = playerVelocity.clone().multiplyScalar( deltaTime );
|
||||
playerCollider.translate( deltaPosition );
|
||||
|
||||
playerCollitions();
|
||||
|
||||
fpsCamera.position.copy( playerCollider.end );
|
||||
|
||||
}
|
||||
|
||||
function spheresCollisions() {
|
||||
|
||||
for ( let i = 0; i < spheres.length; i ++ ) {
|
||||
|
||||
const s1 = spheres[ i ];
|
||||
|
||||
for ( let j = i + 1; j < spheres.length; j ++ ) {
|
||||
|
||||
const s2 = spheres[ j ];
|
||||
|
||||
const d2 = s1.collider.center.distanceToSquared( s2.collider.center );
|
||||
const r = s1.collider.radius + s2.collider.radius;
|
||||
const r2 = r * r;
|
||||
|
||||
if ( d2 < r2 ) {
|
||||
|
||||
const normal = s1.collider.clone().center.sub( s2.collider.center ).normalize();
|
||||
const v1 = normal.clone().multiplyScalar( normal.dot( s1.velocity ) );
|
||||
const v2 = normal.clone().multiplyScalar( normal.dot( s2.velocity ) );
|
||||
s1.velocity.add( v2 ).sub( v1 );
|
||||
s2.velocity.add( v1 ).sub( v2 );
|
||||
|
||||
const d = ( r - Math.sqrt( d2 ) ) / 2;
|
||||
|
||||
s1.collider.center.addScaledVector( normal, d );
|
||||
s2.collider.center.addScaledVector( normal, - d );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateSpheres( deltaTime ) {
|
||||
|
||||
spheres.forEach( sphere =>{
|
||||
|
||||
sphere.collider.center.addScaledVector( sphere.velocity, deltaTime );
|
||||
|
||||
const result = worldOctree.sphereIntersect( sphere.collider );
|
||||
|
||||
if ( result ) {
|
||||
|
||||
sphere.velocity.addScaledVector( result.normal, - result.normal.dot( sphere.velocity ) * 1.5 );
|
||||
sphere.collider.center.add( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
} else {
|
||||
|
||||
sphere.velocity.y -= GRAVITY * deltaTime;
|
||||
|
||||
}
|
||||
|
||||
const damping = Math.exp( - 1.5 * deltaTime ) - 1;
|
||||
sphere.velocity.addScaledVector( sphere.velocity, damping );
|
||||
|
||||
spheresCollisions();
|
||||
|
||||
sphere.mesh.position.copy( sphere.collider.center );
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
function getForwardVector() {
|
||||
|
||||
fpsCamera.getWorldDirection( playerDirection );
|
||||
playerDirection.y = 0;
|
||||
playerDirection.normalize();
|
||||
|
||||
return playerDirection;
|
||||
|
||||
}
|
||||
|
||||
function getSideVector() {
|
||||
|
||||
fpsCamera.getWorldDirection( playerDirection );
|
||||
playerDirection.y = 0;
|
||||
playerDirection.normalize();
|
||||
playerDirection.cross( fpsCamera.up );
|
||||
|
||||
return playerDirection;
|
||||
|
||||
}
|
||||
|
||||
function controls( deltaTime ) {
|
||||
|
||||
const speed = 25;
|
||||
|
||||
if ( playerOnFloor ) {
|
||||
|
||||
if ( keyStates[ 'KeyW' ] ) {
|
||||
|
||||
playerVelocity.add( getForwardVector().multiplyScalar( speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyS' ] ) {
|
||||
|
||||
playerVelocity.add( getForwardVector().multiplyScalar( - speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyA' ] ) {
|
||||
|
||||
playerVelocity.add( getSideVector().multiplyScalar( - speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyD' ] ) {
|
||||
|
||||
playerVelocity.add( getSideVector().multiplyScalar( speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render(){
|
||||
|
||||
if(scope.nowCamera){
|
||||
renderer.render( scene, scope.nowCamera );
|
||||
}
|
||||
}
|
||||
window.onresize = function () {
|
||||
renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
|
||||
this.initNewEvent = function(actions,lessonTriggerList){
|
||||
console.log(actions);
|
||||
console.log(lessonTriggerList);
|
||||
eventBoxs = [];
|
||||
for(let i=0;i<actions.length;i++){
|
||||
if(actions[i].actionType == "contact"){
|
||||
for(let j=0;j<lessonTriggerList.length;j++){
|
||||
|
||||
if(lessonTriggerList[j].label == actions[i].actionModel){
|
||||
let eventTestBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||
eventTestBox.setFromObject(lessonTriggerList[j]);
|
||||
eventTestBox.mesh = lessonTriggerList[j];
|
||||
eventTestBox.action = actions[i];
|
||||
eventBoxs.push(eventTestBox);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
scope.eventHitMode = true;
|
||||
|
||||
};
|
||||
console.log(lessonData);
|
||||
}
|
138
src/jlmap3d/lesson3d/math/Capsule.js
Normal file
138
src/jlmap3d/lesson3d/math/Capsule.js
Normal file
@ -0,0 +1,138 @@
|
||||
var Capsule = ( function () {
|
||||
|
||||
var _v1 = new THREE.Vector3();
|
||||
var _v2 = new THREE.Vector3();
|
||||
var _v3 = new THREE.Vector3();
|
||||
|
||||
var EPS = 1e-10;
|
||||
|
||||
function Capsule( start, end, radius ) {
|
||||
|
||||
this.start = start == undefined ? new THREE.Vector3( 0, 0, 0 ) : start;
|
||||
this.end = end == undefined ? new THREE.Vector3( 0, 1, 0 ) : end;
|
||||
this.radius = radius == undefined ? 1 : radius;
|
||||
|
||||
}
|
||||
|
||||
Object.assign( Capsule.prototype, {
|
||||
|
||||
clone: function () {
|
||||
|
||||
return new Capsule( this.start.clone(), this.end.clone(), this.radius );
|
||||
|
||||
},
|
||||
|
||||
set: function ( start, end, radius ) {
|
||||
|
||||
this.start.copy( start );
|
||||
this.end.copy( end );
|
||||
this.radius = radius;
|
||||
|
||||
},
|
||||
|
||||
copy: function ( capsule ) {
|
||||
|
||||
this.start.copy( capsule.start );
|
||||
this.end.copy( capsule.end );
|
||||
this.radius = capsule.radius;
|
||||
|
||||
},
|
||||
|
||||
getCenter: function ( target ) {
|
||||
|
||||
return target.copy( this.end ).add( this.start ).multiplyScalar( 0.5 );
|
||||
|
||||
},
|
||||
|
||||
translate: function ( v ) {
|
||||
|
||||
this.start.add( v );
|
||||
this.end.add( v );
|
||||
|
||||
},
|
||||
|
||||
checkAABBAxis: function ( p1x, p1y, p2x, p2y, minx, maxx, miny, maxy, radius ) {
|
||||
|
||||
return (
|
||||
( minx - p1x < radius || minx - p2x < radius ) &&
|
||||
( p1x - maxx < radius || p2x - maxx < radius ) &&
|
||||
( miny - p1y < radius || miny - p2y < radius ) &&
|
||||
( p1y - maxy < radius || p2y - maxy < radius )
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
intersectsBox: function ( box ) {
|
||||
|
||||
return (
|
||||
this.checkAABBAxis(
|
||||
this.start.x, this.start.y, this.end.x, this.end.y,
|
||||
box.min.x, box.max.x, box.min.y, box.max.y,
|
||||
this.radius ) &&
|
||||
this.checkAABBAxis(
|
||||
this.start.x, this.start.z, this.end.x, this.end.z,
|
||||
box.min.x, box.max.x, box.min.z, box.max.z,
|
||||
this.radius ) &&
|
||||
this.checkAABBAxis(
|
||||
this.start.y, this.start.z, this.end.y, this.end.z,
|
||||
box.min.y, box.max.y, box.min.z, box.max.z,
|
||||
this.radius )
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
lineLineMinimumPoints: function ( line1, line2 ) {
|
||||
|
||||
var r = _v1.copy( line1.end ).sub( line1.start );
|
||||
var s = _v2.copy( line2.end ).sub( line2.start );
|
||||
var w = _v3.copy( line2.start ).sub( line1.start );
|
||||
|
||||
var a = r.dot( s ),
|
||||
b = r.dot( r ),
|
||||
c = s.dot( s ),
|
||||
d = s.dot( w ),
|
||||
e = r.dot( w );
|
||||
|
||||
var t1, t2, divisor = b * c - a * a;
|
||||
|
||||
if ( Math.abs( divisor ) < EPS ) {
|
||||
|
||||
var d1 = - d / c;
|
||||
var d2 = ( a - d ) / c;
|
||||
|
||||
if ( Math.abs( d1 - 0.5 ) < Math.abs( d2 - 0.5 ) ) {
|
||||
|
||||
t1 = 0;
|
||||
t2 = d1;
|
||||
|
||||
} else {
|
||||
|
||||
t1 = 1;
|
||||
t2 = d2;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
t1 = ( d * a + e * c ) / divisor;
|
||||
t2 = ( t1 * a - d ) / c;
|
||||
|
||||
}
|
||||
|
||||
t2 = Math.max( 0, Math.min( 1, t2 ) );
|
||||
t1 = Math.max( 0, Math.min( 1, t1 ) );
|
||||
|
||||
var point1 = r.multiplyScalar( t1 ).add( line1.start );
|
||||
var point2 = s.multiplyScalar( t2 ).add( line2.start );
|
||||
|
||||
return [ point1, point2 ];
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
return Capsule;
|
||||
|
||||
} )();
|
||||
|
||||
export { Capsule };
|
460
src/jlmap3d/lesson3d/math/Octree.js
Normal file
460
src/jlmap3d/lesson3d/math/Octree.js
Normal file
@ -0,0 +1,460 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js';
|
||||
var Octree = ( function () {
|
||||
|
||||
var _v1 = new THREE.Vector3();
|
||||
var _v2 = new THREE.Vector3();
|
||||
var _plane = new THREE.Plane();
|
||||
var _line1 = new THREE.Line3();
|
||||
var _line2 = new THREE.Line3();
|
||||
var _sphere = new THREE.Sphere();
|
||||
var _capsule = new Capsule();
|
||||
|
||||
function Octree( box ) {
|
||||
|
||||
this.triangles = [];
|
||||
this.box = box;
|
||||
this.subTrees = [];
|
||||
|
||||
}
|
||||
|
||||
Object.assign( Octree.prototype, {
|
||||
|
||||
addTriangle: function ( triangle ) {
|
||||
|
||||
if ( ! this.bounds ) this.bounds = new THREE.Box3();
|
||||
|
||||
this.bounds.min.x = Math.min( this.bounds.min.x, triangle.a.x, triangle.b.x, triangle.c.x );
|
||||
this.bounds.min.y = Math.min( this.bounds.min.y, triangle.a.y, triangle.b.y, triangle.c.y );
|
||||
this.bounds.min.z = Math.min( this.bounds.min.z, triangle.a.z, triangle.b.z, triangle.c.z );
|
||||
this.bounds.max.x = Math.max( this.bounds.max.x, triangle.a.x, triangle.b.x, triangle.c.x );
|
||||
this.bounds.max.y = Math.max( this.bounds.max.y, triangle.a.y, triangle.b.y, triangle.c.y );
|
||||
this.bounds.max.z = Math.max( this.bounds.max.z, triangle.a.z, triangle.b.z, triangle.c.z );
|
||||
|
||||
this.triangles.push( triangle );
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
calcBox: function () {
|
||||
|
||||
this.box = this.bounds.clone();
|
||||
|
||||
// offset small ammount to account for regular grid
|
||||
this.box.min.x -= 0.01;
|
||||
this.box.min.y -= 0.01;
|
||||
this.box.min.z -= 0.01;
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
split: function ( level ) {
|
||||
|
||||
if ( ! this.box ) return;
|
||||
|
||||
var subTrees = [],
|
||||
halfsize = _v2.copy( this.box.max ).sub( this.box.min ).multiplyScalar( 0.5 ),
|
||||
box, v, triangle;
|
||||
|
||||
for ( var x = 0; x < 2; x ++ ) {
|
||||
|
||||
for ( var y = 0; y < 2; y ++ ) {
|
||||
|
||||
for ( var z = 0; z < 2; z ++ ) {
|
||||
|
||||
box = new THREE.Box3();
|
||||
v = _v1.set( x, y, z );
|
||||
|
||||
box.min.copy( this.box.min ).add( v.multiply( halfsize ) );
|
||||
box.max.copy( box.min ).add( halfsize );
|
||||
|
||||
subTrees.push( new Octree( box ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
while ( triangle = this.triangles.pop() ) {
|
||||
|
||||
for ( var i = 0; i < subTrees.length; i ++ ) {
|
||||
|
||||
if ( subTrees[ i ].box.intersectsTriangle( triangle ) ) {
|
||||
|
||||
subTrees[ i ].triangles.push( triangle );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ( var i = 0; i < subTrees.length; i ++ ) {
|
||||
|
||||
var len = subTrees[ i ].triangles.length;
|
||||
|
||||
if ( len > 8 && level < 16 ) {
|
||||
|
||||
subTrees[ i ].split( level + 1 );
|
||||
|
||||
}
|
||||
|
||||
if ( len != 0 ) {
|
||||
|
||||
this.subTrees.push( subTrees[ i ] );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
build: function () {
|
||||
|
||||
this.calcBox();
|
||||
this.split( 0 );
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
getRayTriangles: function ( ray, triangles ) {
|
||||
|
||||
for ( var i = 0; i < this.subTrees.length; i ++ ) {
|
||||
|
||||
var subTree = this.subTrees[ i ];
|
||||
if ( ! ray.intersectsBox( subTree.box ) ) continue;
|
||||
|
||||
if ( subTree.triangles.length > 0 ) {
|
||||
|
||||
for ( var j = 0; j < subTree.triangles.length; j ++ ) {
|
||||
|
||||
if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] );
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
subTree.getRayTriangles( ray, triangles );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return triangles;
|
||||
|
||||
},
|
||||
|
||||
triangleCapsuleIntersect: function ( capsule, triangle ) {
|
||||
|
||||
var point1, point2, line1, line2;
|
||||
|
||||
triangle.getPlane( _plane );
|
||||
|
||||
var d1 = _plane.distanceToPoint( capsule.start ) - capsule.radius;
|
||||
var d2 = _plane.distanceToPoint( capsule.end ) - capsule.radius;
|
||||
|
||||
if ( ( d1 > 0 && d2 > 0 ) || ( d1 < - capsule.radius && d2 < - capsule.radius ) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
var delta = Math.abs( d1 / ( Math.abs( d1 ) + Math.abs( d2 ) ) );
|
||||
var intersectPoint = _v1.copy( capsule.start ).lerp( capsule.end, delta );
|
||||
|
||||
if ( triangle.containsPoint( intersectPoint ) ) {
|
||||
|
||||
return { normal: _plane.normal.clone(), point: intersectPoint.clone(), depth: Math.abs( Math.min( d1, d2 ) ) };
|
||||
|
||||
}
|
||||
|
||||
var r2 = capsule.radius * capsule.radius;
|
||||
|
||||
line1 = _line1.set( capsule.start, capsule.end );
|
||||
|
||||
var lines = [
|
||||
[ triangle.a, triangle.b ],
|
||||
[ triangle.b, triangle.c ],
|
||||
[ triangle.c, triangle.a ]
|
||||
];
|
||||
|
||||
for ( var i = 0; i < lines.length; i ++ ) {
|
||||
|
||||
line2 = _line2.set( lines[ i ][ 0 ], lines[ i ][ 1 ] );
|
||||
|
||||
[ point1, point2 ] = capsule.lineLineMinimumPoints( line1, line2 );
|
||||
|
||||
if ( point1.distanceToSquared( point2 ) < r2 ) {
|
||||
|
||||
return { normal: point1.clone().sub( point2 ).normalize(), point: point2.clone(), depth: capsule.radius - point1.distanceTo( point2 ) };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
triangleSphereIntersect: function ( sphere, triangle ) {
|
||||
|
||||
triangle.getPlane( _plane );
|
||||
|
||||
if ( ! sphere.intersectsPlane( _plane ) ) return false;
|
||||
|
||||
var depth = Math.abs( _plane.distanceToSphere( sphere ) );
|
||||
var r2 = sphere.radius * sphere.radius - depth * depth;
|
||||
|
||||
var plainPoint = _plane.projectPoint( sphere.center, _v1 );
|
||||
|
||||
if ( triangle.containsPoint( sphere.center ) ) {
|
||||
|
||||
return { normal: _plane.normal.clone(), point: plainPoint.clone(), depth: Math.abs( _plane.distanceToSphere( sphere ) ) };
|
||||
|
||||
}
|
||||
|
||||
var lines = [
|
||||
[ triangle.a, triangle.b ],
|
||||
[ triangle.b, triangle.c ],
|
||||
[ triangle.c, triangle.a ]
|
||||
];
|
||||
|
||||
for ( var i = 0; i < lines.length; i ++ ) {
|
||||
|
||||
_line1.set( lines[ i ][ 0 ], lines[ i ][ 1 ] );
|
||||
_line1.closestPointToPoint( plainPoint, true, _v2 );
|
||||
|
||||
var d = _v2.distanceToSquared( sphere.center );
|
||||
|
||||
if ( d < r2 ) {
|
||||
|
||||
return { normal: sphere.center.clone().sub( _v2 ).normalize(), point: _v2.clone(), depth: sphere.radius - Math.sqrt( d ) };
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
getSphereTriangles: function ( sphere, triangles ) {
|
||||
|
||||
for ( var i = 0; i < this.subTrees.length; i ++ ) {
|
||||
|
||||
var subTree = this.subTrees[ i ];
|
||||
|
||||
if ( ! sphere.intersectsBox( subTree.box ) ) continue;
|
||||
|
||||
if ( subTree.triangles.length > 0 ) {
|
||||
|
||||
for ( var j = 0; j < subTree.triangles.length; j ++ ) {
|
||||
|
||||
if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] );
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
subTree.getSphereTriangles( sphere, triangles );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
getCapsuleTriangles: function ( capsule, triangles ) {
|
||||
|
||||
for ( var i = 0; i < this.subTrees.length; i ++ ) {
|
||||
|
||||
var subTree = this.subTrees[ i ];
|
||||
|
||||
if ( ! capsule.intersectsBox( subTree.box ) ) continue;
|
||||
|
||||
if ( subTree.triangles.length > 0 ) {
|
||||
|
||||
for ( var j = 0; j < subTree.triangles.length; j ++ ) {
|
||||
|
||||
if ( triangles.indexOf( subTree.triangles[ j ] ) === - 1 ) triangles.push( subTree.triangles[ j ] );
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
subTree.getCapsuleTriangles( capsule, triangles );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
sphereIntersect( sphere ) {
|
||||
|
||||
_sphere.copy( sphere );
|
||||
|
||||
var triangles = [], result, hit = false;
|
||||
|
||||
this.getSphereTriangles( sphere, triangles );
|
||||
|
||||
for ( var i = 0; i < triangles.length; i ++ ) {
|
||||
|
||||
if ( result = this.triangleSphereIntersect( _sphere, triangles[ i ] ) ) {
|
||||
|
||||
hit = true;
|
||||
|
||||
_sphere.center.add( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( hit ) {
|
||||
|
||||
var collisionVector = _sphere.center.clone().sub( sphere.center );
|
||||
var depth = collisionVector.length();
|
||||
|
||||
return { normal: collisionVector.normalize(), depth: depth };
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
capsuleIntersect: function ( capsule ) {
|
||||
|
||||
_capsule.copy( capsule );
|
||||
|
||||
var triangles = [], result, hit = false;
|
||||
|
||||
this.getCapsuleTriangles( _capsule, triangles );
|
||||
|
||||
for ( var i = 0; i < triangles.length; i ++ ) {
|
||||
|
||||
if ( result = this.triangleCapsuleIntersect( _capsule, triangles[ i ] ) ) {
|
||||
|
||||
hit = true;
|
||||
|
||||
_capsule.translate( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( hit ) {
|
||||
|
||||
var collisionVector = _capsule.getCenter( new THREE.Vector3() ).sub( capsule.getCenter( _v1 ) );
|
||||
var depth = collisionVector.length();
|
||||
|
||||
return { normal: collisionVector.normalize(), depth: depth };
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
rayIntersect: function ( ray ) {
|
||||
|
||||
if ( ray.direction.length() === 0 ) return;
|
||||
|
||||
var triangles = [], triangle, position,
|
||||
distance = 1e100,
|
||||
result;
|
||||
|
||||
this.getRayTriangles( ray, triangles );
|
||||
|
||||
for ( var i = 0; i < triangles.length; i ++ ) {
|
||||
|
||||
result = ray.intersectTriangle( triangles[ i ].a, triangles[ i ].b, triangles[ i ].c, true, _v1 );
|
||||
|
||||
if ( result ) {
|
||||
|
||||
var newdistance = result.sub( ray.origin ).length();
|
||||
|
||||
if ( distance > newdistance ) {
|
||||
|
||||
position = result.clone().add( ray.origin );
|
||||
distance = newdistance;
|
||||
triangle = triangles[ i ];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return distance < 1e100 ? { distance: distance, triangle: triangle, position: position } : false;
|
||||
|
||||
},
|
||||
|
||||
fromGraphNode: function ( group ) {
|
||||
|
||||
group.traverse( ( obj ) => {
|
||||
|
||||
if ( obj.type === 'Mesh' ) {
|
||||
|
||||
obj.updateMatrix();
|
||||
obj.updateWorldMatrix();
|
||||
|
||||
var geometry, isTemp = false;
|
||||
|
||||
if ( obj.geometry.index ) {
|
||||
|
||||
isTemp = true;
|
||||
geometry = obj.geometry.clone().toNonIndexed();
|
||||
|
||||
} else {
|
||||
|
||||
geometry = obj.geometry;
|
||||
|
||||
}
|
||||
|
||||
var positions = geometry.attributes.position.array;
|
||||
var transform = obj.matrixWorld;
|
||||
|
||||
for ( var i = 0; i < positions.length; i += 9 ) {
|
||||
|
||||
var v1 = new THREE.Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] );
|
||||
var v2 = new THREE.Vector3( positions[ i + 3 ], positions[ i + 4 ], positions[ i + 5 ] );
|
||||
var v3 = new THREE.Vector3( positions[ i + 6 ], positions[ i + 7 ], positions[ i + 8 ] );
|
||||
|
||||
v1.applyMatrix4( transform );
|
||||
v2.applyMatrix4( transform );
|
||||
v3.applyMatrix4( transform );
|
||||
|
||||
this.addTriangle( new THREE.Triangle( v1, v2, v3 ) );
|
||||
|
||||
}
|
||||
|
||||
if ( isTemp ) {
|
||||
|
||||
geometry.dispose();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
this.build();
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
return Octree;
|
||||
|
||||
} )();
|
||||
|
||||
export { Octree };
|
177
src/jlmap3d/lesson3d/model/lessondata.js
Normal file
177
src/jlmap3d/lesson3d/model/lessondata.js
Normal file
@ -0,0 +1,177 @@
|
||||
|
||||
export function LessonData() {
|
||||
let scope = this;
|
||||
|
||||
this.lessonId = "";
|
||||
this.lessonName = "";
|
||||
this.lessonType = "";
|
||||
this.lessonStatus = "";
|
||||
this.lessonData = {
|
||||
//资源列表
|
||||
assetList:[],
|
||||
//场景交互物体列表
|
||||
modelList:[],
|
||||
//课程组件启用状态
|
||||
lessonTools:[],
|
||||
dataType:"",
|
||||
toolJobPane:[],
|
||||
//课程内容
|
||||
lessonProgress:[
|
||||
|
||||
]
|
||||
};
|
||||
|
||||
this.initLessonProgress = function(){
|
||||
let newLessonProgress = {
|
||||
id:generateUUID(),
|
||||
progressName:"命名",
|
||||
roleName:"",
|
||||
roleUse:true,
|
||||
|
||||
progressScene:"",
|
||||
nextCode:"",
|
||||
nextNode:"",
|
||||
triggerType:"",
|
||||
triggerMode:"",
|
||||
triggerTime:"",
|
||||
triggerModel:"",
|
||||
controlMode:"",
|
||||
cameraMode:"",
|
||||
changeCamera:false,
|
||||
cameraPosition:{
|
||||
x:0,
|
||||
y:0,
|
||||
z:0
|
||||
},
|
||||
cameraTarget:{
|
||||
x:0,
|
||||
y:0,
|
||||
z:0
|
||||
},
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
assetPos:"",
|
||||
assetRot:"",
|
||||
assetType:"",
|
||||
index:"",
|
||||
stepTipsData:{
|
||||
tittle:"标题",
|
||||
text:"内容",
|
||||
},
|
||||
explainPane:{
|
||||
tittle:"标题",
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
action:[],
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
|
||||
}
|
||||
|
||||
this.loadLessonProgress = function(loadData){
|
||||
console.log(loadData);
|
||||
for(let i=0;i<loadData.length;i++){
|
||||
let newLessonProgress = {
|
||||
id:loadData[i].id,
|
||||
progressName:loadData[i].progressName,
|
||||
roleName:loadData[i].roleName,
|
||||
roleUse:loadData[i].roleUse,
|
||||
score:loadData[i].roleUse,
|
||||
progressScene:loadData[i].progressScene,
|
||||
nextCode:loadData[i].nextCode,
|
||||
nextNode:loadData[i].nextNode,
|
||||
triggerType:loadData[i].triggerType,
|
||||
triggerMode:loadData[i].triggerMode,
|
||||
triggerTime:loadData[i].triggerTime,
|
||||
triggerModel:loadData[i].triggerModel,
|
||||
controlMode:loadData[i].controlMode,
|
||||
cameraMode:loadData[i].cameraMode,
|
||||
changeCamera:loadData[i].changeCamera,
|
||||
cameraPosition:loadData[i].cameraPosition,
|
||||
cameraTarget:loadData[i].cameraTarget,
|
||||
assetId:loadData[i].assetId,
|
||||
assetPos:loadData[i].assetPos,
|
||||
assetRot:loadData[i].assetRot,
|
||||
assetType:loadData[i].assetType,
|
||||
index:loadData[i].index,
|
||||
stepTipsData:loadData[i].stepTipsData,
|
||||
explainPane:loadData[i].explainPane,
|
||||
action:loadData[i].action,
|
||||
jobPane:[],
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
}
|
||||
}
|
||||
|
||||
this.addLessonProgress = function(index){
|
||||
let inheirIndex = index - 1;
|
||||
let newLessonProgress = {
|
||||
id:generateUUID(),
|
||||
progressName:"命名",
|
||||
roleName:scope.lessonData.lessonProgress[inheirIndex].roleName,
|
||||
roleUse:scope.lessonData.lessonProgress[inheirIndex].roleUse,
|
||||
score:0,
|
||||
progressScene:scope.lessonData.lessonProgress[inheirIndex].progressScene,
|
||||
nextCode:"",
|
||||
nextNode:"",
|
||||
triggerType:"",
|
||||
triggerMode:"",
|
||||
triggerTime:"",
|
||||
triggerModel:"",
|
||||
controlMode:scope.lessonData.lessonProgress[inheirIndex].controlMode,
|
||||
cameraMode:scope.lessonData.lessonProgress[inheirIndex].cameraMode,
|
||||
changeCamera:scope.lessonData.lessonProgress[inheirIndex].changeCamera,
|
||||
cameraPosition:scope.lessonData.lessonProgress[inheirIndex].cameraPosition,
|
||||
cameraTarget:scope.lessonData.lessonProgress[inheirIndex].cameraTarget,
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
assetPos:"",
|
||||
assetRot:"",
|
||||
assetType:"",
|
||||
index:"",
|
||||
triger:[
|
||||
|
||||
],
|
||||
stepTipsData:{
|
||||
tittle:"标题",
|
||||
text:"内容",
|
||||
},
|
||||
explainPane:{
|
||||
tittle:"标题",
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
action:[
|
||||
|
||||
],
|
||||
jobPane:[],
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
|
||||
}
|
||||
|
||||
this.changeLessonProgress = function(){
|
||||
|
||||
}
|
||||
|
||||
this.removeLessonProgress = function(index){
|
||||
scope.lessonData.lessonProgress.splice(index,1);
|
||||
}
|
||||
|
||||
function generateUUID() {
|
||||
var d = new Date().getTime();
|
||||
if (window.performance && typeof window.performance.now === "function") {
|
||||
d += performance.now(); //use high-precision timer if available
|
||||
}
|
||||
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = (d + Math.random() * 16) % 16 | 0;
|
||||
d = Math.floor(d / 16);
|
||||
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
||||
});
|
||||
return uuid;
|
||||
}
|
||||
|
||||
|
||||
}
|
307
src/jlmap3d/lesson3d/toolsmodel/jobpanedata.js
Normal file
307
src/jlmap3d/lesson3d/toolsmodel/jobpanedata.js
Normal file
@ -0,0 +1,307 @@
|
||||
|
||||
export function JobPaneData() {
|
||||
let scope = this;
|
||||
|
||||
// let
|
||||
this.dataList = [
|
||||
{
|
||||
name:"值班站长",
|
||||
value:"zbzz",
|
||||
text:"执行分公司、部、中心、车站的有关规章制度,加强班组管理,掌握列车运行情况,安排车站行车组织工作",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"行车值班员",
|
||||
value:"xczby",
|
||||
text:"在本班组值班站长的指挥下开展工作,负责本班组车站综合控制室,负责车站行车工作,监视列车到、发情况及乘客上下车、候车动态,监控设备运作状况。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"客运值班员",
|
||||
value:"kyzby",
|
||||
text:"在值班站长的领导下,主管车站客运、票务管理,组织站务员从事客运服务工作",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"票厅员",
|
||||
value:"spy",
|
||||
text:"执行分公司、部、中心、车站的有关规章制度,在客运值班员领导下,负责车站售票工作。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"站台岗",
|
||||
value:"ztg",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"站长",
|
||||
value:"zz",
|
||||
text:"在站务中心(副)主任领导下,组织领导站内员工开展车站各项工作。负责车站员工的日常管理,定期进行员工教育,掌握员工思想状况。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"分部助理",
|
||||
value:"fbzl",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"行车调度",
|
||||
value:"xcdd",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"生产调度",
|
||||
value:"scdd",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"平台岗",
|
||||
value:"ptg",
|
||||
text:"负责站厅乘客服务,设备的巡视、紧急情况下事件的处理等。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"地铁公安",
|
||||
value:"110",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"120",
|
||||
value:"120",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"119",
|
||||
value:"119",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
32
src/jlmap3d/lesson3d/toolsmodel/lessontrigger.js
Normal file
32
src/jlmap3d/lesson3d/toolsmodel/lessontrigger.js
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
export function LessonTrigger() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.dataList = [
|
||||
|
||||
];
|
||||
// let
|
||||
this.triggerList = [
|
||||
{
|
||||
name:"移动触发器",
|
||||
type:"movetrigger",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"置物触发器",
|
||||
type:"placetrigger",
|
||||
picurl:"",
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
this.createTrigger = function(type){
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.deleteTrigger = function(selected){
|
||||
|
||||
}
|
||||
}
|
@ -54,9 +54,9 @@ export function AssetModelManager(scene) {
|
||||
z:scope.lessonTriggerList[i].position.z
|
||||
},
|
||||
rot:{
|
||||
x:scope.lessonTriggerList[i].position.x,
|
||||
y:scope.lessonTriggerList[i].position.y,
|
||||
z:scope.lessonTriggerList[i].position.z
|
||||
x:scope.lessonTriggerList[i].rotation.x,
|
||||
y:scope.lessonTriggerList[i].rotation.y,
|
||||
z:scope.lessonTriggerList[i].rotation.z
|
||||
},
|
||||
showType:scope.lessonTriggerList[i].showType,
|
||||
visible:scope.lessonTriggerList[i].visible,
|
||||
@ -86,7 +86,7 @@ export function AssetModelManager(scene) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
console.log(scope.loadAsset);
|
||||
return new Promise(function(resolve, reject){
|
||||
Promise.all(initlist).then((result) => {
|
||||
|
||||
@ -99,8 +99,12 @@ export function AssetModelManager(scene) {
|
||||
newModelTrigger.label = modelList[i].label;
|
||||
newModelTrigger.modelId = modelList[i].modelId;
|
||||
newModelTrigger.visible = modelList[i].visible;
|
||||
newModelTrigger.position.copy(modelList[i].pos);
|
||||
newModelTrigger.rotation.copy(modelList[i].rot);
|
||||
newModelTrigger.position.x = modelList[i].pos.x;
|
||||
newModelTrigger.position.y = modelList[i].pos.y;
|
||||
newModelTrigger.position.z = modelList[i].pos.z;
|
||||
newModelTrigger.rotation.x = modelList[i].rot.x;
|
||||
newModelTrigger.rotation.y = modelList[i].rot.y;
|
||||
newModelTrigger.rotation.z = modelList[i].rot.z;
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
|
||||
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js';
|
||||
|
||||
|
||||
import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/TransformControls';
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
@ -64,26 +64,48 @@ export function Lesson3dEditor(dom,lessonData) {
|
||||
|
||||
lesson3dUpdateControl(scope.controls);
|
||||
|
||||
let transcontrol = new THREE.TransformControls( scope.camerass, scope.renderer.domElement );
|
||||
//
|
||||
transcontrol.addEventListener( 'change', render );
|
||||
//
|
||||
transcontrol.addEventListener( 'dragging-changed', function ( event ) {
|
||||
scope.controls.enabled = ! event.value;
|
||||
} );
|
||||
//
|
||||
scene.add(transcontrol);
|
||||
|
||||
|
||||
|
||||
let assetModelManager = new AssetModelManager(scene);
|
||||
if(lessonData.assetList.length>0 || lessonData.modelList.length>0){
|
||||
assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList);
|
||||
console.log(lessonData);
|
||||
if(lessonData){
|
||||
if(lessonData.assetList.length>0 || lessonData.modelList.length>0){
|
||||
assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList);
|
||||
}else{
|
||||
assetModelManager.lessonAssetsLoader();
|
||||
}
|
||||
}else{
|
||||
assetModelManager.lessonAssetsLoader();
|
||||
}
|
||||
|
||||
|
||||
animate();
|
||||
|
||||
|
||||
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
scope.renderer.render( scene, scope.camerass );
|
||||
render();
|
||||
scope.controls.update();
|
||||
// delta = clock.getDelta();
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
|
||||
function render(){
|
||||
scope.renderer.render( scene, scope.camerass );
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
scope.renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
@ -111,4 +133,8 @@ export function Lesson3dEditor(dom,lessonData) {
|
||||
this.saveAssetModel = function(){
|
||||
return assetModelManager.saveModelList();
|
||||
}
|
||||
|
||||
this.attachModel = function(selectModel){
|
||||
transcontrol.attach(selectModel);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export function LessonData() {
|
||||
this.initLessonProgress = function(){
|
||||
let newLessonProgress = {
|
||||
id:generateUUID(),
|
||||
progressName:"",
|
||||
progressName:"命名",
|
||||
roleName:"",
|
||||
roleUse:true,
|
||||
|
||||
@ -37,8 +37,17 @@ export function LessonData() {
|
||||
triggerModel:"",
|
||||
controlMode:"",
|
||||
cameraMode:"",
|
||||
cameraPosition:"",
|
||||
cameraTarget:"",
|
||||
changeCamera:false,
|
||||
cameraPosition:{
|
||||
x:0,
|
||||
y:0,
|
||||
z:0
|
||||
},
|
||||
cameraTarget:{
|
||||
x:0,
|
||||
y:0,
|
||||
z:0
|
||||
},
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
assetPos:"",
|
||||
assetRot:"",
|
||||
@ -53,10 +62,7 @@ export function LessonData() {
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
action:{
|
||||
actionType:"事件操作类型",
|
||||
actionMode:"触发事件类型",
|
||||
},
|
||||
action:[],
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
@ -81,6 +87,7 @@ export function LessonData() {
|
||||
triggerModel:loadData[i].triggerModel,
|
||||
controlMode:loadData[i].controlMode,
|
||||
cameraMode:loadData[i].cameraMode,
|
||||
changeCamera:loadData[i].changeCamera,
|
||||
cameraPosition:loadData[i].cameraPosition,
|
||||
cameraTarget:loadData[i].cameraTarget,
|
||||
assetId:loadData[i].assetId,
|
||||
@ -102,7 +109,7 @@ export function LessonData() {
|
||||
let inheirIndex = index - 1;
|
||||
let newLessonProgress = {
|
||||
id:generateUUID(),
|
||||
progressName:"",
|
||||
progressName:"命名",
|
||||
roleName:scope.lessonData.lessonProgress[inheirIndex].roleName,
|
||||
roleUse:scope.lessonData.lessonProgress[inheirIndex].roleUse,
|
||||
score:0,
|
||||
@ -115,6 +122,7 @@ export function LessonData() {
|
||||
triggerModel:"",
|
||||
controlMode:scope.lessonData.lessonProgress[inheirIndex].controlMode,
|
||||
cameraMode:scope.lessonData.lessonProgress[inheirIndex].cameraMode,
|
||||
changeCamera:scope.lessonData.lessonProgress[inheirIndex].changeCamera,
|
||||
cameraPosition:scope.lessonData.lessonProgress[inheirIndex].cameraPosition,
|
||||
cameraTarget:scope.lessonData.lessonProgress[inheirIndex].cameraTarget,
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
@ -134,10 +142,9 @@ export function LessonData() {
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
action:{
|
||||
actionType:"事件操作类型",
|
||||
actionMode:"触发事件类型",
|
||||
},
|
||||
action:[
|
||||
|
||||
],
|
||||
jobPane:[],
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@ export function JobPaneData() {
|
||||
this.dataList = [
|
||||
{
|
||||
name:"值班站长",
|
||||
value:"zbzz",
|
||||
text:"执行分公司、部、中心、车站的有关规章制度,加强班组管理,掌握列车运行情况,安排车站行车组织工作",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -28,6 +29,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"行车值班员",
|
||||
value:"xczby",
|
||||
text:"在本班组值班站长的指挥下开展工作,负责本班组车站综合控制室,负责车站行车工作,监视列车到、发情况及乘客上下车、候车动态,监控设备运作状况。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -50,6 +52,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"客运值班员",
|
||||
value:"kyzby",
|
||||
text:"在值班站长的领导下,主管车站客运、票务管理,组织站务员从事客运服务工作",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -71,7 +74,8 @@ export function JobPaneData() {
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"票厅岗",
|
||||
name:"票厅员",
|
||||
value:"spy",
|
||||
text:"执行分公司、部、中心、车站的有关规章制度,在客运值班员领导下,负责车站售票工作。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -94,6 +98,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"站台岗",
|
||||
value:"ztg",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -116,6 +121,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"站长",
|
||||
value:"zz",
|
||||
text:"在站务中心(副)主任领导下,组织领导站内员工开展车站各项工作。负责车站员工的日常管理,定期进行员工教育,掌握员工思想状况。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -138,6 +144,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"分部助理",
|
||||
value:"fbzl",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -160,6 +167,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"行车调度",
|
||||
value:"xcdd",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -182,6 +190,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"生产调度",
|
||||
value:"scdd",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -203,7 +212,8 @@ export function JobPaneData() {
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"厅巡岗",
|
||||
name:"平台岗",
|
||||
value:"ptg",
|
||||
text:"负责站厅乘客服务,设备的巡视、紧急情况下事件的处理等。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -226,6 +236,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"地铁公安",
|
||||
value:"110",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -248,6 +259,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"120",
|
||||
value:"120",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
@ -270,6 +282,7 @@ export function JobPaneData() {
|
||||
},
|
||||
{
|
||||
name:"119",
|
||||
value:"119",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
|
@ -765,6 +765,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -699,6 +699,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -916,6 +916,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ class SkinCode extends defaultStyle {
|
||||
super();
|
||||
this.fontFamily = '宋体';
|
||||
this[deviceType.Section] = {
|
||||
elemnetType:['name', 'line', 'separator', 'badShunt'],
|
||||
elemnetType:['name', 'line', 'separator', 'badShunt', 'derailer'],
|
||||
// 'speedLimit', 'speedLimitName','standTrackText','reentryTrackText','transferTrackText',
|
||||
active: {
|
||||
routeColor: true // 进路触发颜色
|
||||
@ -143,11 +143,23 @@ class SkinCode extends defaultStyle {
|
||||
invadeSpecial:true, // 特殊侵限
|
||||
halfHeight: 3 // 区段分隔符高度的一半
|
||||
},
|
||||
shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
|
||||
shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
|
||||
z: 10,
|
||||
width: 1.5,
|
||||
color: '#FFFFFF',
|
||||
distance: 5 // 限速线距离区段距离
|
||||
distance: 5 // 限速线距离区段距离
|
||||
},
|
||||
derailer: {
|
||||
text: {
|
||||
color: 'green',
|
||||
offset: {
|
||||
x: -5,
|
||||
y: -15
|
||||
}
|
||||
},
|
||||
symbol: {
|
||||
color: 'red'
|
||||
}
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
@ -156,6 +168,7 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
colorSpecial: true, // 特殊处理灯位颜色
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
@ -170,16 +183,25 @@ class SkinCode extends defaultStyle {
|
||||
fontSize: 11, // 信号机名称字体大小
|
||||
fontWeight: 'bold', // 信号机名称字体粗细
|
||||
defaultColor: '#FFFFFF', // 信号灯字体默认色
|
||||
blockColor: '#EF0C08', // 信号灯字体锁定颜色
|
||||
blockColor: '#FFFFFF', // 信号灯字体锁定颜色
|
||||
checkColor: '#00FF00' // 信号保护区段检查颜色
|
||||
},
|
||||
remainTimeColor: '#F00',
|
||||
tText: {
|
||||
offsetX: 0,
|
||||
offsetY: -30,
|
||||
fontSize: 11, // 信号机名称字体大小
|
||||
fontWeight: 'bold', // 信号机名称字体粗细
|
||||
defaultColor: '#F00', // 信号灯字体默认色
|
||||
defaultText: 0
|
||||
},
|
||||
lamp: {
|
||||
bgShow: false, // 是否被选中
|
||||
guidName: 'singleRY', // 成都三号线引导类型
|
||||
borderVariable: true, // 信号灯边框可变
|
||||
borderVariable: false, // 信号灯边框可变
|
||||
stopWidth: 2, // 禁止线宽度
|
||||
borderWidth: 2, // 信号灯边框线宽度
|
||||
borderColor: '#3149C3', // 信号灯边框线颜色
|
||||
borderColor: '#677DBB', // 信号灯边框线颜色
|
||||
radiusR: 6, // 信号灯半径
|
||||
grayColor: '#7F7F7F', // 信号灯灰色
|
||||
redColor: '#FF0000', // 信号灯红色
|
||||
@ -187,7 +209,8 @@ class SkinCode extends defaultStyle {
|
||||
yellowColor: '#FFFF00', // 信号灯黄色
|
||||
whiteColor: '#FFFFFF', // 信号灯白色
|
||||
blueColor: '#0070C0', // 信号灯蓝色
|
||||
faultType: 'light' // 信号机故障类型 (light闪)
|
||||
faultType: 'light', // 信号机故障类型 (light闪)
|
||||
special:true // 大铁类型信号机
|
||||
},
|
||||
route: {
|
||||
direction: true, // 自动通过方向
|
||||
@ -258,71 +281,19 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.StationStand] = {
|
||||
// 成都三号线站台元素 站台 站台紧急关闭 扣车元素 停站时间 运行等级 跳停
|
||||
elemnetType:['solidStand', 'emergentRhombus', 'detainNormal', 'stopTime', 'level', 'jumpCircle'],
|
||||
// 站台元素 站台
|
||||
elemnetType:['lineStand'],
|
||||
// 站台
|
||||
solidStand:{
|
||||
lineStand:{
|
||||
// 层级
|
||||
z:0,
|
||||
spareColor: '#ffffff', // 站台空闲颜色
|
||||
jumpStopColor: '#808080', // 站台跳停颜色
|
||||
designatedJumpStopColor: '#808080', // 站台指定列车跳停颜色
|
||||
headFontSize: 10, // 站台首端字体大小
|
||||
stopColor: '#FFF000' // 站台列车停站颜色
|
||||
spareColor: '#00ff00', // 站台空闲颜色
|
||||
lineWidth:2 // 线宽
|
||||
// jumpStopColor: '#808080', // 站台跳停颜色
|
||||
// designatedJumpStopColor: '#808080', // 站台指定列车跳停颜色
|
||||
// headFontSize: 10, // 站台首端字体大小
|
||||
// stopColor: '#FFF000' // 站台列车停站颜色
|
||||
},
|
||||
// 站台紧急关闭
|
||||
emergentRhombus:{
|
||||
z:1,
|
||||
flicker: true, // 闪烁
|
||||
mergentR: 5, // 站台紧急关闭半径
|
||||
mergentN: 4, // 站台紧急关闭边数
|
||||
insideOffset: { x: 0, y: -30 }, // 内站台紧急关闭偏移量
|
||||
outsideOffset: { x: 0, y: 30}, // 外站台紧急关闭偏移量
|
||||
closeColor: '#F61107' // 站台紧急关闭颜色
|
||||
},
|
||||
// 扣车元素 普通扣车
|
||||
detainNormal:{
|
||||
z:0,
|
||||
position: -1, // 扣车标识在站台上显示方向
|
||||
text: '扣', // 扣车显示内容
|
||||
insideOffset: {x: -8, y: 20}, // 内站台扣车偏移量
|
||||
outsideOffset: {x: -8, y: 20}, // 外站台扣车偏移量
|
||||
centerTrainColor: '#C0C0C0', // 中心扣车颜色
|
||||
andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色
|
||||
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
|
||||
fontSize: 10, // 字体大小
|
||||
fontWeight: 'normal'
|
||||
},
|
||||
// 停站时间
|
||||
stopTime:{
|
||||
z:1,
|
||||
textFontSize: 10, // 停站时间字体大小
|
||||
textColor: '#FFFFFF', // 停站时间字体颜色
|
||||
position: -1, // 停站时间方向
|
||||
offset: {x: -8, y: 10} // 停站时间偏移量
|
||||
},
|
||||
// 运行等级
|
||||
level:{
|
||||
z:1,
|
||||
textFontSize: 10, // 运行等级字体大小
|
||||
position: 1, // 运行等级方向
|
||||
offset: {x: -8, y: 15}, // 运行等级偏移量
|
||||
textColor: '#FFF000' // 停站等级字体颜色
|
||||
},
|
||||
// 跳停
|
||||
jumpCircle: {
|
||||
z:1,
|
||||
position: 1, // 停跳方向
|
||||
text: '跳', // 停跳显示内容
|
||||
offset: {x: -8, y: 10},
|
||||
textColor: '#00ffcc', // 停跳文字颜色
|
||||
arcColor: '#00ffcc', // 停跳圆圈颜色
|
||||
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
|
||||
r: 8, // 圆半径大小
|
||||
fontWeight: 'normal', // 文字居中
|
||||
fontSize: 11 // 文字大小
|
||||
},
|
||||
|
||||
common: { // 通用属性
|
||||
textFontSize: 10, // 站台默认字体大小
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(prdType)
|
||||
@ -479,36 +450,36 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
core: {
|
||||
length: 6, // 道岔单边长度
|
||||
graphShow: true, // 图形显示
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
graphShow: true, // 图形显示
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
},
|
||||
jointImg: { // 道岔 A B C D四元素属性配置
|
||||
trapezoidLength: 8, // 直角梯形元素默认长度
|
||||
faultStatus: true, // 挤岔表示
|
||||
trapezoidLength: 8, // 直角梯形元素默认长度
|
||||
faultStatus: true, // 挤岔表示
|
||||
fork: true, // 挤岔专用(如有挤岔操作 变为true)
|
||||
forKColor: 'red' // 挤岔颜色 配合挤岔专用
|
||||
},
|
||||
arcBlcok: { // 圆形封锁图形
|
||||
show: false, // 显示
|
||||
arcBorderColor: 'green', // 默认边框颜色
|
||||
locationColor: 'green', // 定位封锁颜色
|
||||
inversionColor: '#FFFF00' // 反位封锁颜色
|
||||
},
|
||||
// arcBlcok: { // 圆形封锁图形
|
||||
// show: false, // 显示
|
||||
// arcBorderColor: 'green', // 默认边框颜色
|
||||
// locationColor: 'green', // 定位封锁颜色
|
||||
// inversionColor: '#FFFF00' // 反位封锁颜色
|
||||
// },
|
||||
rectLock: { // 矩形封锁框图形
|
||||
rectWidth: 18, // 矩形框 宽高
|
||||
rectBorderColor: '#fff', // 矩形边框颜色
|
||||
block: true, // 封锁显示
|
||||
blockColor: 'red', // 封锁颜色
|
||||
followName: true, // 位置跟随名称确定
|
||||
followName: true // 位置跟随名称确定
|
||||
},
|
||||
arcBlcok: { // 圆形封锁图形
|
||||
arcBlcok: { // 圆形封锁图形
|
||||
show: true, // 显示
|
||||
shapeR: 10,
|
||||
arcBorderColor: 'red', // 默认边框颜色
|
||||
locationColor: 'red', // 定位封锁颜色
|
||||
inversionColor: 'red' // 反位封锁颜色
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.LcControl] = {
|
||||
@ -942,6 +913,19 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {
|
||||
displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示)
|
||||
indicator:{
|
||||
radiusR:6,
|
||||
offset:{ x:0, y:20},
|
||||
color:'red'
|
||||
},
|
||||
text:{
|
||||
fontWeight:'normal',
|
||||
fontSize:12,
|
||||
fontFamily:'宋体'
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -726,6 +726,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -733,6 +733,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -829,6 +829,7 @@ class SkinCode extends defaultStyle {
|
||||
fontOffsetX: 45,
|
||||
fontOffsetY: 24
|
||||
};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -933,6 +933,7 @@ class SkinCode extends defaultStyle {
|
||||
// textFill: '#fff'
|
||||
// }
|
||||
// };
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -858,6 +858,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ class SkinCode extends defaultStyle {
|
||||
guidName: 'half', // 默认引导类型
|
||||
borderVariable: false, // 信号灯边框可变
|
||||
stopWidth: 2, // 禁止线宽度
|
||||
borderWidth: 2, // 信号灯边框线宽度
|
||||
borderWidth: 1, // 信号灯边框线宽度
|
||||
borderColor: '#000000', // 信号灯边框线颜色
|
||||
physicColor:'#ffffff', // 物理点灯信号灯边框线颜色
|
||||
radiusR: 5, // 信号灯半径
|
||||
@ -200,7 +200,9 @@ class SkinCode extends defaultStyle {
|
||||
yellowColor: 'yellow', // 信号灯黄色
|
||||
whiteColor: '#FFFFFF', // 信号灯白色
|
||||
blueColor: '#0070C0', // 信号灯蓝色
|
||||
faultType: 'cross' // 信号机故障类型 (cross叉形狀)
|
||||
faultType: 'cross', // 信号机故障类型 (cross叉形狀)
|
||||
guideSector: true, // 引导扇形
|
||||
guideSectorColor: '#FFFF00' // 引导扇形颜色
|
||||
},
|
||||
route: {
|
||||
direction: false, // 自动通过方向
|
||||
@ -879,6 +881,7 @@ class SkinCode extends defaultStyle {
|
||||
allowCLoseStrokeColor: '#FFFF00' // 允许关门描边颜色
|
||||
};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -529,8 +529,8 @@ class SkinCode extends defaultStyle {
|
||||
core: {
|
||||
length: 6, // 道岔单边长度
|
||||
graphShow: true, // 图形显示
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
},
|
||||
jointImg: { // 道岔 A B C D四元素属性配置
|
||||
trapezoidLength: 8, // 直角梯形元素默认长度
|
||||
@ -662,13 +662,14 @@ class SkinCode extends defaultStyle {
|
||||
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [
|
||||
{
|
||||
type: '03',
|
||||
type: 'MANUAL',
|
||||
serviceNumber: 'M0',
|
||||
nameFormat: 'serviceNumber:groupNumber'
|
||||
},
|
||||
{
|
||||
type: '02',
|
||||
nameFormat: 'targetCode:groupNumber'
|
||||
type: 'HEAD',
|
||||
serviceNumber: 'M0',
|
||||
nameFormat: 'serviceNumber:targetCode'
|
||||
}
|
||||
], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 4, // 两边间隔
|
||||
@ -697,8 +698,8 @@ class SkinCode extends defaultStyle {
|
||||
textAContent: 'A'// textA文本
|
||||
},
|
||||
trainNumber: {
|
||||
targetCodePrefix: '000', // 目的地码前缀
|
||||
trainNumberOffset: { x: 0, y: 1 }// 目的地码偏移量
|
||||
targetCodePrefix: '00', // 目的地码前缀
|
||||
trainNumberOffset: { x: 0, y: 4 }// 目的地码偏移量
|
||||
},
|
||||
trainServer: {
|
||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||
@ -803,6 +804,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -792,6 +792,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -849,6 +849,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -280,4 +280,9 @@ deviceRender[deviceType.SignalButton] = {
|
||||
_type: deviceType.SignalButton,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 指示灯 */
|
||||
deviceRender[deviceType.IndicatorLight] = {
|
||||
_type: deviceType.IndicatorLight,
|
||||
zlevel: 1
|
||||
}
|
||||
export default deviceRender;
|
||||
|
@ -260,4 +260,6 @@ deviceState[deviceType.Train] = {
|
||||
};
|
||||
deviceState[deviceType.Responder] = {
|
||||
};
|
||||
deviceState[deviceType.IndicatorLight] = {
|
||||
}
|
||||
export default deviceState;
|
||||
|
@ -42,6 +42,7 @@ const deviceType = {
|
||||
Axle: 'Axle',
|
||||
SplitStation:'SplitStation',
|
||||
SwitchFault: 'SwitchFault',
|
||||
IndicatorLight: 'IndicatorLight',
|
||||
Arrow: 'Arrow',
|
||||
Power: 'Power',
|
||||
StationTurnBack: 'StationTurnBack',
|
||||
|
83
src/jmapNew/shape/SaidLamp/EIndicatorLight.js
Normal file
83
src/jmapNew/shape/SaidLamp/EIndicatorLight.js
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 表示灯
|
||||
*/
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
export default class IndicatorLight extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this._subType = model._subType;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.createLight();
|
||||
this.createText();
|
||||
}
|
||||
|
||||
createLight() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const indicatorStyle = style.IndicatorLight.indicator || {};
|
||||
const radiusR = indicatorStyle.radiusR || 12;
|
||||
const offsetStyle = indicatorStyle.offset || {};
|
||||
const offsetX = offsetStyle.x || 0;
|
||||
const offsetY = offsetStyle.y || 0;
|
||||
const textColor = indicatorStyle.color || 'red';
|
||||
|
||||
this.indicator = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
cx: model.x + offsetX,
|
||||
cy: model.y + offsetY,
|
||||
r: radiusR
|
||||
},
|
||||
style: {
|
||||
lineWidth: 1,
|
||||
stroke: '#fff',
|
||||
fill: textColor
|
||||
}
|
||||
});
|
||||
this.add(this.indicator);
|
||||
}
|
||||
|
||||
createText() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const textStyle = style.IndicatorLight.text || {};
|
||||
// const offsetStyle = textStyle.offset || {};
|
||||
// const offsetX = offsetStyle.x || 0;
|
||||
// const offsetY = offsetStyle.y || 0;
|
||||
const fontWeight = textStyle.fontWeight || style.textStyle.fontWeight;
|
||||
const fontSize = textStyle.fontSize || style.textStyle.fontSize;
|
||||
const fontFamily = textStyle.fontFamily || style.textStyle.fontFamily;
|
||||
|
||||
this.text = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
// position: [0, 0],
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
fontWeight: fontWeight,
|
||||
fontSize: fontSize,
|
||||
fontFamily: fontFamily,
|
||||
text: model.text,
|
||||
textFill: '#fff',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}
|
||||
});
|
||||
this.add(this.text);
|
||||
}
|
||||
|
||||
setControlColor(color) {
|
||||
this.indicator.setStyle({fill: color});
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import EDeviceStatus from './EDeviceStatus';
|
||||
import EModeStatus from './EModeStatus';
|
||||
import EUnmanned from './EUnmanned';
|
||||
import EAxle from './EAxle';
|
||||
import EIndicatorLight from './EIndicatorLight';
|
||||
|
||||
export default class SaidLamp extends Group {
|
||||
constructor(model, {style}) {
|
||||
@ -165,6 +166,17 @@ export default class SaidLamp extends Group {
|
||||
});
|
||||
this.add(this.control);
|
||||
}
|
||||
} else if (this._type === 'IndicatorLight') {
|
||||
this.control = new EIndicatorLight({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
text: model.name,
|
||||
style: this.style,
|
||||
_subType: 'IndicatorLight'
|
||||
});
|
||||
this.add(this.control);
|
||||
}
|
||||
}
|
||||
|
||||
|
85
src/jmapNew/shape/Section/EDerailer.js
Normal file
85
src/jmapNew/shape/Section/EDerailer.js
Normal file
@ -0,0 +1,85 @@
|
||||
import Group from "zrender/src/container/Group";
|
||||
import Text from "zrender/src/graphic/Text";
|
||||
import Polygon from "zrender/src/graphic/shape/Polygon";
|
||||
|
||||
class EDerailer extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.style = model.style;
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.createText();
|
||||
this.createSymbol();
|
||||
}
|
||||
|
||||
createText() {
|
||||
const style = this.model.style;
|
||||
const model = this.model.modelData;
|
||||
const length = model.points.length;
|
||||
const offset = style.Section.derailer.text.offset||{};
|
||||
const offsetX = offset.x||0;
|
||||
const offsetY = offset.y||0;
|
||||
const positionX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
|
||||
const positionY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
|
||||
|
||||
this.text = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: positionX,
|
||||
y: positionY,
|
||||
text: 'T',
|
||||
fontWeight: style.fontWeight,
|
||||
fontSize: style.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
textFill: style.Section.derailer.text.color,
|
||||
textPosition: 'inside',
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'center'
|
||||
}
|
||||
})
|
||||
this.add(this.text);
|
||||
}
|
||||
|
||||
createSymbol() {
|
||||
const style = this.model.style;
|
||||
const model = this.model.modelData;
|
||||
const length = model.points.length;
|
||||
const offset = style.Section.derailer.symbol.offset||{};
|
||||
const offsetX = offset.x||0;
|
||||
const offsetY = offset.y||0;
|
||||
const pointX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX;
|
||||
const pointY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY;
|
||||
|
||||
this.symbol = new Polygon({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
points: [
|
||||
[pointX-3, pointY],
|
||||
[pointX, pointY-8],
|
||||
[pointX+3, pointY]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
fill: style.Section.derailer.symbol.color,
|
||||
}
|
||||
})
|
||||
this.add(this.symbol);
|
||||
}
|
||||
|
||||
setTextStyle(style) {
|
||||
this.text && this.text.setStyle(style);
|
||||
}
|
||||
|
||||
setSymbolStyle(style) {
|
||||
this.symbol && this.symbol.setStyle(style);
|
||||
}
|
||||
}
|
||||
|
||||
export default EDerailer;
|
@ -6,6 +6,7 @@ import EblockLines from './EblockLines'; // 区段封锁特有
|
||||
import ESeparator from './ESeparator'; // 分隔符 (私有)
|
||||
import EMouse from './EMouse';
|
||||
import EAxle from './EAxle'; // 创建计轴
|
||||
import EDerailer from './EDerailer'; //脱轨器
|
||||
// import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
|
||||
import EBackArrowGroup from './EBackArrow'; // 折返进路箭头
|
||||
import ELimitName from './ELimitName'; // 成都三号线 限速名称
|
||||
@ -15,6 +16,40 @@ import EStopRouteImg from './EStopRouteImg';
|
||||
import EBadShunt from './EBadShunt';
|
||||
import store from '@/store/index';
|
||||
|
||||
const exec = (f,...args) => { f && f(...args); };
|
||||
const DerailerMap = {
|
||||
0: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'green'});
|
||||
derailer.setSymbolStyle({fill: 'red'});
|
||||
},
|
||||
1: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'yellow'});
|
||||
derailer.setSymbolStyle({fill: 'red'});
|
||||
},
|
||||
2: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'green'});
|
||||
derailer.setSymbolStyle({fill: 'green'});
|
||||
},
|
||||
3: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'yellow'});
|
||||
derailer.setSymbolStyle({fill: 'green'});
|
||||
},
|
||||
4: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'red'});
|
||||
derailer.setSymbolStyle({fill: 'red'});
|
||||
},
|
||||
5: (derailer, style) => {
|
||||
derailer.show();
|
||||
derailer.setTextStyle({textFill: 'red'});
|
||||
derailer.setSymbolStyle({fill: 'gray'});
|
||||
}
|
||||
}
|
||||
|
||||
/** 区段*/
|
||||
export default class Section extends Group {
|
||||
constructor(model, {style, mapDevice}) {
|
||||
@ -63,7 +98,8 @@ export default class Section extends Group {
|
||||
'speedLimit': ELimitLines, // 限速线
|
||||
'speedLimitName': ELimitName, // 限速线名称
|
||||
'shuttleBack': EBackArrowGroup, // 折返箭头 (成都三号线显示)
|
||||
'badShunt':EBadShunt // 大铁项目 分路不良
|
||||
'badShunt':EBadShunt, // 大铁项目 分路不良
|
||||
'derailer': EDerailer
|
||||
};
|
||||
// 遍历当前线路下的绘图元素
|
||||
const model = this.model;
|
||||
@ -105,6 +141,7 @@ export default class Section extends Group {
|
||||
// this.line.setRunLineDefault();
|
||||
}
|
||||
this.name && this.name.recover();
|
||||
this.derailer && this.derailer.hide();
|
||||
this.speedLimit && this.speedLimit.hide();
|
||||
this.speedLimitName && this.speedLimitName.hide();
|
||||
this.badShunt && this.badShunt.hide();
|
||||
@ -428,6 +465,9 @@ export default class Section extends Group {
|
||||
model.faultLock && this.faultLock();
|
||||
// 设置灰显
|
||||
model.noStatus && this.setAshShow();
|
||||
// 设置脱轨器
|
||||
model.signalDerailer && exec(DerailerMap[model.signalDerailer], this.derailer, this.style);
|
||||
|
||||
/** 道岔区段更新岔心颜色 */
|
||||
if (model.type === '03' && model.switch) {
|
||||
const sectionSwitch = this.mapDevice[model.switch.code];
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import Arc from 'zrender/src/graphic/shape/Arc';
|
||||
import Sector from 'zrender/src/graphic/shape/Sector';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
// import Path from 'zrender/src/graphic/Path';
|
||||
import {ESigFault} from './ESigFault';
|
||||
@ -32,7 +33,27 @@ class ESigLamp extends Group {
|
||||
stroke: style.Signal.lamp.borderColor
|
||||
}
|
||||
});
|
||||
|
||||
if (style.Signal.lamp.guideSector) {
|
||||
this.lampSector = new Sector({
|
||||
_subType: 'SignalLamp',
|
||||
_val: '3',
|
||||
name: model.index,
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
shape: {
|
||||
cx: model.x,
|
||||
cy: model.y,
|
||||
r: style.Signal.lamp.radiusR,
|
||||
startAngle: Math.PI * 3 / 2,
|
||||
endAngle: Math.PI / 2
|
||||
},
|
||||
style: {
|
||||
fill: style.Signal.lamp.guideSectorColor
|
||||
}
|
||||
});
|
||||
this.add(this.lampSector);
|
||||
this.lampSector.hide();
|
||||
}
|
||||
if (style.Signal.lamp.faultType && style.Signal.lamp.faultType == 'flash') {
|
||||
this.lampFault = new ESigFault({
|
||||
zlevel: model.zlevel,
|
||||
@ -144,7 +165,13 @@ class ESigLamp extends Group {
|
||||
faultHide() {
|
||||
this.lampFault && this.lampFault.hide();
|
||||
}
|
||||
|
||||
setGuideSectorShowHide(flag) {
|
||||
if (flag) {
|
||||
this.lampSector && this.lampSector.show();
|
||||
} else {
|
||||
this.lampSector && this.lampSector.hide();
|
||||
}
|
||||
}
|
||||
setColor(color) {
|
||||
if (this.model.style.Signal.lamp.borderVariable) {
|
||||
this.lamp.setStyle({ fill: color, stroke: color });
|
||||
|
@ -44,13 +44,23 @@ class ESigName extends Group {
|
||||
getNameText() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.name.hide();
|
||||
}
|
||||
show() {
|
||||
this.name.show();
|
||||
}
|
||||
setAnimationStart(color) {
|
||||
this.name && this.name.animateStyle(true)
|
||||
.when(0, { textFill: this.model.style.backgroundColor })
|
||||
.when(1000, { textFill: color })
|
||||
.when(2000, { textFill: this.model.style.backgroundColor })
|
||||
.when(3000, { textFill: color })
|
||||
.start();
|
||||
}
|
||||
setAnimationEnd() {
|
||||
this.name && this.name.stopAnimation(false);
|
||||
}
|
||||
}
|
||||
|
||||
export default ESigName;
|
||||
|
@ -18,16 +18,179 @@ import Text from 'zrender/src/graphic/Text';
|
||||
import Isogon from 'zrender/src/graphic/shape/Isogon';
|
||||
import deviceType from '../../constant/deviceType';
|
||||
import { findDeviceByModelDepType } from '../utils/ShapeDepFind';
|
||||
import store from '@/store/index';
|
||||
// import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
// import background from './../../../ibp/shape/background';
|
||||
|
||||
const exec = (f, ...args) => { f && f(...args); };
|
||||
const SignalAspectMap = {
|
||||
// 1-红
|
||||
1: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
lamps[1].setColor(style.backgroundColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 2-绿
|
||||
2: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.greenColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.backgroundColor);
|
||||
lamps[1].setColor(style.Signal.lamp.greenColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 3-黄;
|
||||
3: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.yellowColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.yellowColor);
|
||||
lamps[1].setColor(style.backgroundColor);
|
||||
},
|
||||
3: (lamps, style) => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 4-黄红;
|
||||
4: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.yellowColor);
|
||||
lamps[1].setColor(style.Signal.lamp.redColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 5-绿绿;
|
||||
5: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.greenColor);
|
||||
lamps[1].setColor(style.Signal.lamp.greenColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 6-绿黄;
|
||||
6: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.greenColor);
|
||||
lamps[1].setColor(style.Signal.lamp.yellowColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 7-黄黄;
|
||||
7: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.yellowColor);
|
||||
lamps[1].setColor(style.Signal.lamp.yellowColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 8-黄闪黄;
|
||||
8: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.yellowColor);
|
||||
lamps[1].setAnimationStart(style.Signal.lamp.yellowColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 9-白红;
|
||||
9: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.whiteColor);
|
||||
lamps[1].setColor(style.Signal.lamp.redColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 10-蓝;
|
||||
10: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.blueColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.backgroundColor);
|
||||
lamps[1].setColor(style.Signal.lamp.blueColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 11-白;
|
||||
11: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.whiteColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.whiteColor);
|
||||
lamps[1].setColor(style.backgroundColor);
|
||||
},
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 12 红闪
|
||||
12: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
lamps[0].setAnimationStart(style.Signal.lamp.redColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
lamps[0].setAnimationStart(style.Signal.lamp.redColor);
|
||||
lamps[1].setColor(style.backgroundColor);
|
||||
},
|
||||
3: () =>{}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
}
|
||||
};
|
||||
|
||||
class Signal extends Group {
|
||||
constructor(model, {style, mapDevice}) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.model = model;
|
||||
this.mapDevice = mapDevice;
|
||||
this.mapDevice = mapDevice;
|
||||
this.style = style;
|
||||
this.count = parseInt(model.lampPositionType);
|
||||
this.lamps = new Array(this.count);
|
||||
@ -116,8 +279,8 @@ class Signal extends Group {
|
||||
z: this.z,
|
||||
_val: '3',
|
||||
style: {
|
||||
x: endPoint.x,
|
||||
y: endPoint.y,
|
||||
x: endPoint.x + (style.Signal.tText.offsetX || 0),
|
||||
y: endPoint.y + (style.Signal.tText.offsetY || 0),
|
||||
fontWeight: style.Signal.tText.fontWeight,
|
||||
fontSize: style.Signal.tText.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
@ -213,7 +376,7 @@ class Signal extends Group {
|
||||
fontWeight: style.Signal.text.fontWeight,
|
||||
fontSize: 12,
|
||||
fontFamily: style.fontFamily,
|
||||
textFill: '#FFF',
|
||||
textFill: style.Signal.remainTimeColor || '#FFF',
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'middle'
|
||||
});
|
||||
@ -322,12 +485,12 @@ class Signal extends Group {
|
||||
const drict = this.model.right ? 1 : -1; // 朝向 左:右
|
||||
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
|
||||
// 信号机名称
|
||||
const actual = this.mapDevice[model.linkSignalCode];
|
||||
const actual = this.mapDevice[model.linkSignalCode];
|
||||
const sigNameX = model.position.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x;
|
||||
const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
|
||||
const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.right ? 'left' : 'right';
|
||||
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
||||
const fillColor = actual.virtual? style.Signal.transmission.fillColorVirtual: style.Signal.transmission.fillColor;
|
||||
const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor;
|
||||
this.sigName = new ESigName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -508,15 +671,18 @@ class Signal extends Group {
|
||||
this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 });
|
||||
} else if (this.style.Signal.lamp.guidName === 'post') {
|
||||
this.sigPost.setHorColor(this.style.Signal.post.guideHorColor);
|
||||
} else if (this.style.Signal.lamp.guidName === 'half') {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
this.lamps[0] && this.lamps[0].setGuideSectorShowHide(true);
|
||||
}
|
||||
|
||||
if (this.style.Signal.lamp.guidName !== 'singleRY') {
|
||||
if (this.lamps.length == 1) {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
} else {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
|
||||
}
|
||||
if (this.lamps.length == 1) {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
} else {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -533,7 +699,7 @@ class Signal extends Group {
|
||||
if (this.style.Signal.text.nameBorderShow) {
|
||||
this.sigName.setStyle({ textBorderWidth: 1 });
|
||||
}
|
||||
if (this.sigBack) {
|
||||
if (this.sigBack && (!this.model.signalButtonList || !this.model.signalButtonList.length)) {
|
||||
this.sigBack.show();
|
||||
this.sigBack.setStyle('fill', this.style.Signal.sigBack.fillColor);
|
||||
}
|
||||
@ -541,6 +707,12 @@ class Signal extends Group {
|
||||
this.lamps[0].setBorderColor(this.style.Signal.lamp.borderColor);
|
||||
this.lamps[0].setAnimationStart(this.style.Signal.lamp.blockColor);
|
||||
}
|
||||
if (this.model.signalButtonList && this.model.signalButtonList.length) {
|
||||
this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
button && button.instance && button.instance.blockShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
reblock() {
|
||||
this.sigPost.setHorColor(this.style.Signal.post.reblockHorColor);
|
||||
@ -695,7 +867,8 @@ class Signal extends Group {
|
||||
}
|
||||
// 恢复状态
|
||||
recover() {
|
||||
this.lamps && this.lamps.forEach(item=> { item.show(); });
|
||||
this.sigName && this.sigName.setAnimationEnd();
|
||||
this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); });
|
||||
this.sigName.setStyle({ textBorderWidth: 0 });
|
||||
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
||||
this.remainTImeName && this.remainTImeName.hide();
|
||||
@ -734,9 +907,16 @@ class Signal extends Group {
|
||||
this.ciConfirm && this.ciConfirm.stopAnimation(false);
|
||||
this.ciConfirm && this.ciConfirm.hide();
|
||||
this.sigBack && this.sigBack.hide();
|
||||
this.tText && this.tText.hide();
|
||||
this.sigBack && this.sigBack.stopAnimation(false);
|
||||
this.lamps && this.lamps[0] && this.lamps[0].setAnimationEnd();
|
||||
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
|
||||
if (this.model.signalButtonList && this.model.signalButtonList.length) {
|
||||
this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
button && button.instance && button.instance.recover();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
@ -764,7 +944,6 @@ class Signal extends Group {
|
||||
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
|
||||
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
|
||||
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
|
||||
|
||||
/** 信号机封锁 */ // 缺一个功能封锁
|
||||
model.blockade && this.block();
|
||||
model.reblockade && this.reblock();
|
||||
@ -825,8 +1004,22 @@ class Signal extends Group {
|
||||
} else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
|
||||
this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor);
|
||||
}
|
||||
|
||||
if (this.style.Signal.lamp.special) {
|
||||
// 灯颜色状态显示
|
||||
exec(SignalAspectMap[model.signalAspect], this.lamps, this.style);
|
||||
// 灯是否点灯显示
|
||||
this.lamps.forEach(lamp => { lamp.setStop(model.signalLight); });
|
||||
}
|
||||
if (model.hasSelected) {
|
||||
this.sigName && this.sigName.setAnimationStart(this.style.Signal.text.defaultColor);
|
||||
}
|
||||
// 信号机故障
|
||||
model.fault && this.fault();
|
||||
if (model.guideTime) {
|
||||
this.tText && this.tText.setStyle('text', model.guideTime);
|
||||
this.tText && this.tText.show();
|
||||
}
|
||||
// 设置灰显
|
||||
if (model.noStatus || model.level === 0) {
|
||||
this.setAshShow();
|
||||
@ -859,8 +1052,8 @@ class Signal extends Group {
|
||||
default:
|
||||
var drict = this.model.right ? 1 : -1; // 朝向 右:左
|
||||
var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下
|
||||
var shape = this.model.type == 'TRANSMISSION'? this.transmission: this.sigPost;
|
||||
rect = shape.getBoundingRect().clone();
|
||||
var shape = this.model.type == 'TRANSMISSION' ? this.transmission : this.sigPost;
|
||||
rect = shape.getBoundingRect().clone();
|
||||
rect.x = rect.x + drict * this.style.Signal.post.standardVerticalWidth;
|
||||
rect.y = rect.y - offsetY;
|
||||
break;
|
||||
|
@ -20,16 +20,10 @@ export default class SignalButton extends Group {
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
let fillColor = '#008000';
|
||||
if (model.type === 'GUIDE') {
|
||||
fillColor = '#5050E1';
|
||||
} else if (model.type === 'FLEXIBLE' || model.type === 'SHUNT_TERMINAL') {
|
||||
fillColor = '#808080';
|
||||
}
|
||||
const fillColor = this.getTypeColor();
|
||||
this.rectButton = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
silent: true,
|
||||
shape: {
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
@ -38,18 +32,20 @@ export default class SignalButton extends Group {
|
||||
},
|
||||
style: {
|
||||
lineDash: null,
|
||||
stroke: '#808080',
|
||||
stroke: '#69666E',
|
||||
lineWidth:1,
|
||||
fill: fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.rectButton);
|
||||
this.leftLine = new Line({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
shape: {
|
||||
x1: model.position.x,
|
||||
y1: model.position.y,
|
||||
x2: model.position.x + 14,
|
||||
y2: model.position.y + 14
|
||||
x1: model.position.x + 1,
|
||||
y1: model.position.y + 1,
|
||||
x2: model.position.x + 13,
|
||||
y2: model.position.y + 13
|
||||
},
|
||||
style: {
|
||||
lineWidth: 2,
|
||||
@ -62,10 +58,10 @@ export default class SignalButton extends Group {
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
shape: {
|
||||
x1: model.position.x + 14,
|
||||
y1: model.position.y,
|
||||
x2: model.position.x,
|
||||
y2: model.position.y + 14
|
||||
x1: model.position.x + 13,
|
||||
y1: model.position.y + 1,
|
||||
x2: model.position.x + 1,
|
||||
y2: model.position.y + 13
|
||||
},
|
||||
style: {
|
||||
lineWidth: 2,
|
||||
@ -74,42 +70,62 @@ export default class SignalButton extends Group {
|
||||
});
|
||||
this.add(this.rightLine);
|
||||
this.rightLine.hide();
|
||||
this.buttonText = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: model.position.x + 7,
|
||||
y: model.position.y - 20,
|
||||
fontWeight: '400',
|
||||
fontSize: 12,
|
||||
fontFamily: '',
|
||||
text: model.name,
|
||||
textFill: '#C0C0C0',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}
|
||||
});
|
||||
this.add(this.rectButton);
|
||||
this.add(this.buttonText);
|
||||
if (model.type === 'PASS') {
|
||||
this.buttonText = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: model.position.x + model.nameOffset.x,
|
||||
y: model.position.y + model.nameOffset.y,
|
||||
fontWeight: '400',
|
||||
fontSize: 10,
|
||||
fontFamily: '',
|
||||
text: model.name,
|
||||
textFill: '#C0C0C0',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}
|
||||
});
|
||||
this.add(this.buttonText);
|
||||
}
|
||||
}
|
||||
startAnimate() {
|
||||
let color = '#008000';
|
||||
if (this.model.type === 'TRAIN_TERMINAL') {
|
||||
color = '#008000';
|
||||
} else if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') {
|
||||
color = '#808080';
|
||||
}
|
||||
this.rectButton && this.rectButton.animateStyle(true)
|
||||
.when(0, { fill: '#000' })
|
||||
.when(1000, { fill: color })
|
||||
.when(1000, { fill: this.getTypeColor() })
|
||||
.when(2000, { fill: '#000' })
|
||||
.start();
|
||||
}
|
||||
stopAnimation() {
|
||||
this.rectButton && this.rectButton.stopAnimation(true);
|
||||
}
|
||||
getTypeColor() {
|
||||
let color = '';
|
||||
if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') {
|
||||
color = '#808080';
|
||||
} else if (this.model.type === 'GUIDE') {
|
||||
color = '#5050E1';
|
||||
} else {
|
||||
color = '#008000';
|
||||
}
|
||||
return color;
|
||||
}
|
||||
recover() {
|
||||
this.stopAnimation();
|
||||
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
|
||||
this.rightLine && this.rightLine.hide();
|
||||
this.leftLine && this.leftLine.hide();
|
||||
}
|
||||
blockShow() {
|
||||
this.rightLine && this.rightLine.show();
|
||||
this.leftLine && this.leftLine.show();
|
||||
}
|
||||
setState(model) {
|
||||
this.recover();
|
||||
if (!this.isShowShape) return;
|
||||
if (model.hasSelected) {
|
||||
this.startAnimate();
|
||||
}
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
|
@ -3,6 +3,7 @@ import Group from 'zrender/src/container/Group';
|
||||
import ESolidStand from './safeStand/ESolidStand';
|
||||
import EHollowStand from './safeStand/EHollowStand';
|
||||
import EGapStand from './safeStand/EGapStand';
|
||||
import ELineStand from './safeStand/ELineStand';
|
||||
// 扣车元素
|
||||
import EDetain from './detain/EDetain';
|
||||
import EDetainHollow from './detain/EDetainHollow';
|
||||
@ -65,6 +66,7 @@ class StationStand extends Group {
|
||||
'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式)
|
||||
'hollowStand':EHollowStand, // 矩形空心站台 (西安二号线站台样式)
|
||||
'gapStand':EGapStand, // 分割站台(哈尔滨站台特有)
|
||||
'lineStand':ELineStand, // 大铁折线站台
|
||||
|
||||
'emergentCross':EEmergentCross, // 站台紧急关闭 西安二号线 正八边形
|
||||
'emergentArrow':EEmergentArrow, // 站台紧急关闭 哈尔滨 箭头型
|
||||
|
70
src/jmapNew/shape/StationStand/safeStand/ELineStand.js
Normal file
70
src/jmapNew/shape/StationStand/safeStand/ELineStand.js
Normal file
@ -0,0 +1,70 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polyline from 'zrender/src/graphic/shape/Polyline';
|
||||
// import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
// import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
class ESolidStand extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model.modelData;
|
||||
const style = this.model.style;
|
||||
const standX = model.position.x - model.width / 2;
|
||||
const standY = model.position.y - model.height / 2;
|
||||
const direction = model.right ? 1 : -1;
|
||||
|
||||
this.stand = new Polyline({
|
||||
zlevel: this.model.zlevel,
|
||||
z: this.model.z + 2,
|
||||
shape: {
|
||||
points:[
|
||||
[standX, standY + direction * model.height],
|
||||
[standX, standY],
|
||||
[standX + model.width, standY],
|
||||
[standX + model.width, standY + direction * model.height]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
stroke:style.StationStand.lineStand.spareColor,
|
||||
lineWidth: style.StationStand.lineStand.lineWidth
|
||||
}
|
||||
});
|
||||
this.add(this.stand);
|
||||
|
||||
// if (style.StationStand.solidStand.stationHoldTrainColor) {
|
||||
// const direction = model.right ? 1 : -1;
|
||||
// this.holdTrain = new Rect({
|
||||
// zlevel: this.model.zlevel,
|
||||
// z: this.model.z + 2,
|
||||
// shape: {
|
||||
// x: standX,
|
||||
// y: standY + (1 - direction) / 2 * model.height / 2,
|
||||
// width: model.width,
|
||||
// height: model.height / 2
|
||||
// },
|
||||
// style: {
|
||||
// fill:style.StationStand.solidStand.spareColor,
|
||||
// lineWidth: 0
|
||||
// }
|
||||
// });
|
||||
// this.add(this.holdTrain);
|
||||
// this.holdTrain.hide();
|
||||
// }
|
||||
}
|
||||
setStroke(color) {
|
||||
this.stand.setStyle('stroke', color);
|
||||
}
|
||||
recover() {
|
||||
// const style = this.model.style;
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ESolidStand;
|
@ -230,16 +230,16 @@ export default class Switch extends Group {
|
||||
offsetX = directx * this.style.Switch.rectLock.offset.x;
|
||||
offsetY = directy * this.style.Switch.rectLock.offset.y;
|
||||
}
|
||||
let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX;
|
||||
let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY;
|
||||
if (this.style.Switch.rectLock.followName) {
|
||||
const directx = this.triangle.drictx;
|
||||
const rect = this.name.getBoundingRect();
|
||||
const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0? rect.width: rect.width/2);
|
||||
const hLen = this.style.Switch.rectLock.rectWidth - rect.height
|
||||
x = rect.x - wLen/2;
|
||||
y = rect.y - hLen/2
|
||||
}
|
||||
let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX;
|
||||
let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY;
|
||||
if (this.style.Switch.rectLock.followName) {
|
||||
const directx = this.triangle.drictx;
|
||||
const rect = this.name.getBoundingRect();
|
||||
const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0 ? rect.width : rect.width / 2);
|
||||
const hLen = this.style.Switch.rectLock.rectWidth - rect.height;
|
||||
x = rect.x - wLen / 2;
|
||||
y = rect.y - hLen / 2;
|
||||
}
|
||||
|
||||
this.lockRect = new ELockRect({ // 单锁矩形框
|
||||
zlevel: this.zlevel,
|
||||
@ -326,7 +326,7 @@ export default class Switch extends Group {
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect && this.lockRect.hide(); // 矩形包围框
|
||||
this.lockCircle && this.lockCircle.hide(); // 圆形包围框
|
||||
this.lockCircle && this.lockCircle.hide(); // 圆形包围框
|
||||
this.lockArc && this.lockArc.hide(); // 圆形单锁框
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.shapeModelC.hide(); // 形状 C
|
||||
@ -703,6 +703,9 @@ export default class Switch extends Group {
|
||||
this.setInversionAction(model); /** 反位*/
|
||||
} else {
|
||||
this.setLossAction(model.fault); // 失去
|
||||
if (model.switchSplit) {
|
||||
this.setForkAction();
|
||||
}
|
||||
}
|
||||
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
||||
|
||||
|
@ -40,21 +40,11 @@ export default class TrainBody extends Group {
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.nameFormat = model.nameFormat;
|
||||
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
|
||||
? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
|
||||
: model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号
|
||||
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (style.Train.trainTargetNumber.lineNumber || '') + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber); // 车组号
|
||||
let serviceNumber = ''; // 服务号(表号)
|
||||
if (this.model.type == 'PLAN') { // 计划车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);
|
||||
} else if (this.model.type == 'HEAD') { // 头码车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode);
|
||||
this.nameFormat = 'serviceNumber:groupNumber';
|
||||
} else if (this.model.type == 'MANUAL') { // 人工车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceHeadNum);
|
||||
this.nameFormat = 'serviceNumber:groupNumber';
|
||||
}
|
||||
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);// 服务号(表号)
|
||||
let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码
|
||||
if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好
|
||||
targetCode = '01';
|
||||
|
@ -31,6 +31,7 @@ import FloodGate from './FloodGate/index';
|
||||
import DirectionRod from './DirectionRod/index';
|
||||
import Responder from './Responder/index';
|
||||
import SignalButton from './SignalButton/index';
|
||||
// import IndicatorLight from './SaidLamp/index';
|
||||
|
||||
/** 图库*/
|
||||
const mapShape = {};
|
||||
@ -74,6 +75,7 @@ mapShape[deviceType.FaultStatusGroup] = SaidLamp;
|
||||
mapShape[deviceType.ReturnModeGroup] = SaidLamp;
|
||||
mapShape[deviceType.Axle] = SaidLamp;
|
||||
mapShape[deviceType.SwitchFault] = SaidLamp;
|
||||
mapShape[deviceType.IndicatorLight] = SaidLamp;
|
||||
mapShape[deviceType.SplitStation] = SplitStation;
|
||||
mapShape[deviceType.Arrow] = Arrow;
|
||||
mapShape[deviceType.Power] = Power;
|
||||
|
@ -39,6 +39,9 @@ class Model {
|
||||
this['private'][deviceType.TrainWindow] = {
|
||||
trainWindowShow: true
|
||||
};
|
||||
this['private'][deviceType.SignalButton] = {
|
||||
hasSelected: 0
|
||||
};
|
||||
}
|
||||
|
||||
initPublicProps(model) {
|
||||
|
@ -110,7 +110,7 @@ export default {
|
||||
},
|
||||
groupNumber: '',
|
||||
field: '',
|
||||
selected: null,
|
||||
selected: null,
|
||||
rules: {
|
||||
faultType: [
|
||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
||||
@ -172,8 +172,8 @@ export default {
|
||||
this.field = field == this.field ? '' : field;
|
||||
},
|
||||
doShow(operate, selected, judge) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
@ -210,7 +210,7 @@ export default {
|
||||
this.dialogShow = false;
|
||||
this.form.faultType = '';
|
||||
this.$refs.form.resetFields();
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
|
400
src/jmapNew/theme/components/menus/dialog/setFaultNew.vue
Normal file
400
src/jmapNew/theme/components/menus/dialog/setFaultNew.vue
Normal file
@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<div v-dialogDrag>
|
||||
<!-- <el-dialog v-dialogDrag :class="popClass" :title="title" :visible.sync="show" width="350px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> -->
|
||||
<div
|
||||
v-show="show"
|
||||
class="iscs_fuzhou-01__systerm route-detail el-dialog"
|
||||
>
|
||||
<div class="el-dialog__header">
|
||||
<span class="el-dialog__title">{{ title }}</span>
|
||||
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
|
||||
<i class="el-dialog__close el-icon el-icon-close" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="el-dialog__body">
|
||||
<template v-if="judge">
|
||||
<el-row>
|
||||
<el-form ref="form" :model="formModel" :rules="rules">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="targetDeviceCode" label="目的地:">
|
||||
<el-select v-model="formModel.targetDeviceCode" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in selectedList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="field == 'selectedCode' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('selectedCode')"
|
||||
>激活</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>设备:</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>故障类型:</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="form" :rules="rules">
|
||||
<el-col :span="11">
|
||||
<el-form-item>
|
||||
<el-input v-model="deviceName" size="small" style="height: 32px;line-height: 32px;" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-form-item prop="faultType">
|
||||
<el-select v-model="form.faultType" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in faultList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
|
||||
import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import { setSimulationFault, cancelSimulationFault } from '@/api/rtSimulation';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
props: {
|
||||
popClass: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
activeShow: false,
|
||||
judge: false,
|
||||
deviceName: '',
|
||||
faultList: [],
|
||||
form: { faultType: ''},
|
||||
formModel: {
|
||||
targetDeviceCode: ''
|
||||
},
|
||||
groupNumber: '',
|
||||
field: '',
|
||||
selected: null,
|
||||
rules: {
|
||||
faultType: [
|
||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'trainList'
|
||||
]),
|
||||
selectedList() {
|
||||
let list = [];
|
||||
let sectionList = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
sectionList = this.sectionList.filter(elem => { return (elem.standTrack || elem.reentryTrack || elem.transferTrack); });
|
||||
}
|
||||
list = [...sectionList, ...this.trainList];
|
||||
return list;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.MixinCommand.stoppage.menu.operation) {
|
||||
return '设置故障';
|
||||
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
|
||||
return '取消故障';
|
||||
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
|
||||
return '设置托管';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.keyboardEnterCount': function (val) {
|
||||
if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && this.judge && this.field) {
|
||||
if (device._type == 'Section' || device._type == 'Train') {
|
||||
this.deviceSelect(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
},
|
||||
doShow(operate, selected, judge) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
this.operation = operate.operation;
|
||||
this.cmdType = operate.cmdType;
|
||||
let name = selected.name;
|
||||
if (selected._type == 'Train') {
|
||||
name = selected.serviceNumber;
|
||||
}
|
||||
if (name) {
|
||||
this.deviceName = deviceType[selected._type] + '-' + name;
|
||||
} else {
|
||||
this.deviceName = deviceType[selected._type];
|
||||
}
|
||||
if (selected._type === 'Switch') {
|
||||
this.faultList = [
|
||||
{label: '失表', value: 'SPLIT'},
|
||||
{label: '定位失表', value: 'NORMAL_SPLIT'},
|
||||
{label: '反位失表', value: 'REVERSE_SPLIT'},
|
||||
{label: '挤岔', value: 'SQUEEZE'},
|
||||
{label: '计轴故障', value: 'AXLE_FAULT'}
|
||||
];
|
||||
} else if (selected._type === 'Section') {
|
||||
this.faultList = [
|
||||
{label: '计轴故障', value: 'AXLE_FAULT'},
|
||||
{label: '通信车占用', value: 'CBTC_OCCUPIED_FAULT'}
|
||||
];
|
||||
} else if (selected._type === 'Signal') {
|
||||
this.faultList = [
|
||||
{label: '灯丝熔断', value: 'DS'}
|
||||
];
|
||||
} else {
|
||||
this.faultList = deviceFaultType[selected._type];
|
||||
}
|
||||
if (this.faultList && this.faultList.length) {
|
||||
this.form.faultType = this.faultList[0].value;
|
||||
}
|
||||
this.judge = false;
|
||||
if (judge) {
|
||||
this.judge = judge;
|
||||
this.groupNumber = selected.groupNumber;
|
||||
}
|
||||
}
|
||||
if (selected._type) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.form.faultType = '';
|
||||
this.$refs.form.resetFields();
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.operation == OperationEvent.MixinCommand.stoppage.menu.operation) {
|
||||
this.sendInstructions();
|
||||
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
|
||||
this.cancelCommand();
|
||||
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
|
||||
this.handleCollocation();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelCommand() {
|
||||
// const setp = {
|
||||
// over: true,
|
||||
// operation: menuOperate.Common.cancelFault.operation,
|
||||
// cmdType: menuOperate.Common.cancelFault.cmdType,
|
||||
// param: {
|
||||
// faultType: this.form.faultType
|
||||
// }
|
||||
// };
|
||||
// this.sendCommand(setp);
|
||||
this.loading = true;
|
||||
cancelSimulationFault(this.$route.query.group, this.selected.code, this.form.faultType).then(resp => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '取消故障操作失败!');
|
||||
});
|
||||
},
|
||||
sendInstructions() { // 发送指令
|
||||
// const setp = {
|
||||
// over: true,
|
||||
// operation: menuOperate.Common.setFault.operation,
|
||||
// cmdType: menuOperate.Common.setFault.cmdType,
|
||||
// param: {
|
||||
// faultType: this.form.faultType
|
||||
// }
|
||||
// };
|
||||
// this.sendCommand(setp);
|
||||
const data = {
|
||||
deviceId: this.selected.code,
|
||||
fault: this.form.faultType,
|
||||
deviceType: this.selected._type,
|
||||
params: {}
|
||||
};
|
||||
this.loading = true;
|
||||
setSimulationFault(this.$route.query.group, data).then(resp => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '设置故障操作失败!');
|
||||
});
|
||||
},
|
||||
handleCollocation() { // 设置托管
|
||||
const setp = {
|
||||
over: true,
|
||||
operation: menuOperate.Common.collocation.operation,
|
||||
cmdType: menuOperate.Common.collocation.cmdType,
|
||||
param: {
|
||||
groupNumber: this.groupNumber,
|
||||
targetDeviceCode: this.formModel.targetDeviceCode
|
||||
}
|
||||
};
|
||||
this.sendCommand(setp);
|
||||
|
||||
},
|
||||
sendCommand(setp) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', setp).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$messageBox('设置或取消故障操作失败!');
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '设置或取消故障操作失败!');
|
||||
});
|
||||
},
|
||||
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field == 'selectedCode' && em._type == 'Section') {
|
||||
this.formModel.targetDeviceCode = em.code;
|
||||
this.field = '';
|
||||
} else if (this.field == 'selectedCode' && em._type == 'Train') {
|
||||
this.formModel.targetDeviceCode = em.code;
|
||||
this.field = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-select-dropdown.el-popper{
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.route-detail{
|
||||
position: absolute;
|
||||
left:50%;
|
||||
transform: translateX(-175px);
|
||||
margin-top: 15vh;
|
||||
width: 350px;
|
||||
z-index: 2000;
|
||||
box-sizing: border-box;
|
||||
background: rgba(100, 100, 100, 0.3);
|
||||
border: 2px solid rgba(144, 144, 144, 0.8);
|
||||
border-radius: 6px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
.el-dialog__header{
|
||||
padding: 0px 8px;
|
||||
height: 26px;
|
||||
.el-dialog__title{
|
||||
color: #fff;
|
||||
}
|
||||
.el-dialog__headerbtn{
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
top: 4px;
|
||||
right: 12px;
|
||||
line-height: 16px;
|
||||
color: #fff;
|
||||
.el-icon{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-dialog__body{
|
||||
background: #fff;
|
||||
margin: 5px;
|
||||
margin-top: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -102,7 +102,7 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.password.domId : ''
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.password.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import SectionDetail from './dialog/sectionDetail';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -51,16 +51,16 @@ export default {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Section.CMD_SECTION_DETAILS
|
||||
}
|
||||
// {
|
||||
// label: '区故解',
|
||||
// handler: this.fault,
|
||||
// cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '属性',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Section.CMD_SECTION_DETAILS
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import RouteSelection from './dialog/routeSelection';
|
||||
import RouteDetail from './dialog/routeDetail';
|
||||
import RouteHandControl from './dialog/routeHandControl';
|
||||
@ -92,56 +92,56 @@ export default {
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '办理进路',
|
||||
handler: this.arrangementRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
},
|
||||
{
|
||||
label: '办理引导进路',
|
||||
handler: this.guide,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
},
|
||||
{
|
||||
label: '取消进路',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
},
|
||||
{
|
||||
label: '总人解',
|
||||
handler: this.humanTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
handler: this.reopenSignal,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
},
|
||||
{
|
||||
label: '信号封锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
|
||||
},
|
||||
{
|
||||
label: '信号解封',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: '进路收人工控',
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
},
|
||||
{
|
||||
label: '进路交自动控',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
},
|
||||
{
|
||||
label: '进路信息',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
}
|
||||
// {
|
||||
// label: '办理进路',
|
||||
// handler: this.arrangementRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '办理引导进路',
|
||||
// handler: this.guide,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
// },
|
||||
// {
|
||||
// label: '取消进路',
|
||||
// handler: this.cancelTrainRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '总人解',
|
||||
// handler: this.humanTrainRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '信号重开',
|
||||
// handler: this.reopenSignal,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
// },
|
||||
// {
|
||||
// label: '信号封锁',
|
||||
// handler: this.lock,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '信号解封',
|
||||
// handler: this.unlock,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '进路收人工控',
|
||||
// handler: this.humanControl,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
// },
|
||||
// {
|
||||
// label: '进路交自动控',
|
||||
// handler: this.atsAutoControl,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
// },
|
||||
// {
|
||||
// label: '进路信息',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -13,7 +13,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
|
@ -13,7 +13,7 @@ import PopMenu from '@/components/PopMenu';
|
||||
import StandControl from './dialog/standControl';
|
||||
import StandDetail from './dialog/standDetail';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
@ -44,41 +44,41 @@ export default {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
},
|
||||
{
|
||||
label: '设置站间运行等级',
|
||||
handler: this.setRunLevel,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
},
|
||||
{
|
||||
label: '显示站台信息',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
// {
|
||||
// label: '设置扣车',
|
||||
// handler: this.setDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '取消扣车',
|
||||
// handler: this.cancelDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '设置跳停',
|
||||
// handler: this.setJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '取消跳停',
|
||||
// handler: this.cancelJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '设置停站时间',
|
||||
// handler: this.setStopTime,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '设置站间运行等级',
|
||||
// handler: this.setRunLevel,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '显示站台信息',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -13,7 +13,7 @@
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock';
|
||||
@ -50,41 +50,41 @@ export default {
|
||||
menuNormal: {
|
||||
Local: [],
|
||||
Center: [
|
||||
{
|
||||
label: '单操到定位',
|
||||
handler: this.locate,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
},
|
||||
{
|
||||
label: '单操到反位',
|
||||
handler: this.reverse,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
},
|
||||
{
|
||||
label: '道岔单锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
},
|
||||
{
|
||||
label: '道岔解锁',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
},
|
||||
{
|
||||
label: '道岔封锁',
|
||||
handler: this.block,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
},
|
||||
{
|
||||
label: '道岔解封',
|
||||
handler: this.unblock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
}
|
||||
// {
|
||||
// label: '单操到定位',
|
||||
// handler: this.locate,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '单操到反位',
|
||||
// handler: this.reverse,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '道岔单锁',
|
||||
// handler: this.lock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔解锁',
|
||||
// handler: this.unlock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔封锁',
|
||||
// handler: this.block,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔解封',
|
||||
// handler: this.unblock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '区故解',
|
||||
// handler: this.fault,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
// }
|
||||
// {
|
||||
// label: '属性',
|
||||
// handler: this.undeveloped,
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
@ -184,7 +184,6 @@ export default {
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="menus __socpe" :style="{width: width + 'px'}">
|
||||
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
|
||||
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @onUpdateDone="onUpdateDone" @onChangeInitInfo="onChangeInitInfo" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @onUpdateDone="onUpdateDone" @onChangeInitInfo="onChangeInitInfo" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @onUpdateDone="onUpdateDone" @onChangeInitInfo="onChangeInitInfo" />
|
||||
<menu-section ref="menuSection" :selected="selected" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @onUpdateDone="onUpdateDone" @onChangeInitInfo="onChangeInitInfo" />
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @onUpdateDone="onUpdateDone" @onChangeInitInfo="onChangeInitInfo" />
|
||||
<menu-limit ref="menuLimit" :selected="selected" />
|
||||
<!--<passive-alarm ref="passiveAlarm" />-->
|
||||
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" :selected="selected" />
|
||||
@ -51,6 +51,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
initCacheMap: {},
|
||||
initInfo: {},
|
||||
updateDone: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('config', [
|
||||
'width'
|
||||
@ -68,6 +75,20 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$root.$on('iniCacheMap', (cmd, cacheMap) => {
|
||||
this.initCacheMap[cmd] = cacheMap;
|
||||
});
|
||||
this.$root.$on('appendCache', (cmd, code, cache) => {
|
||||
if (!this.initCacheMap[cmd]) {
|
||||
this.initCacheMap[cmd] = {};
|
||||
}
|
||||
this.initCacheMap[cmd][code] = cache;
|
||||
});
|
||||
this.$root.$on('removeCache', (cmd, code) => {
|
||||
if (this.initCacheMap[cmd]) {
|
||||
delete this.initCacheMap[cmd][code];
|
||||
}
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
const _that = this;
|
||||
@ -86,7 +107,22 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$root.$off('iniCacheMap');
|
||||
this.$root.$off('appendCache');
|
||||
this.$root.$off('removeCache');
|
||||
window.onclick = function (e) {};
|
||||
},
|
||||
methods: {
|
||||
onUpdateDone() {
|
||||
this.updateDone++;
|
||||
},
|
||||
onChangeInitInfo(initSelect, initParams) {
|
||||
this.initInfo = {
|
||||
initSelect,
|
||||
initParams
|
||||
};
|
||||
this.updateDone++;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -188,11 +188,28 @@ export default {
|
||||
RouteDetail,
|
||||
CancleSignalGuide
|
||||
},
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
initCacheMap: {},
|
||||
initInfo: {},
|
||||
updateDone: 0,
|
||||
beCentralizedStation:{},
|
||||
menuNormal: {
|
||||
Local: [
|
||||
@ -1380,7 +1397,7 @@ export default {
|
||||
{
|
||||
title: '初始化',
|
||||
operate: OperationEvent.Command.commandNingBo3.line_section_open_init,
|
||||
click: e => this.setOpenSection(e, false)
|
||||
click: e => this.setOpenSection(e, false)
|
||||
},
|
||||
{
|
||||
title: '确定/取消',
|
||||
@ -1802,36 +1819,32 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.$root.$on('iniCacheMap', (cmd, cacheMap) => {
|
||||
this.initCacheMap[cmd] = cacheMap;
|
||||
});
|
||||
this.$root.$on('appendCache', (cmd, code, cache) => {
|
||||
if (!this.initCacheMap[cmd]) {
|
||||
this.initCacheMap[cmd] = {};
|
||||
}
|
||||
this.initCacheMap[cmd][code] = cache;
|
||||
});
|
||||
this.$root.$on('removeCache', (cmd, code) => {
|
||||
if (this.initCacheMap[cmd]) {
|
||||
delete this.initCacheMap[cmd][code];
|
||||
}
|
||||
});
|
||||
// this.$root.$on('iniCacheMap', (cmd, cacheMap) => {
|
||||
// this.initCacheMap[cmd] = cacheMap;
|
||||
// });
|
||||
// this.$root.$on('appendCache', (cmd, code, cache) => {
|
||||
// if (!this.initCacheMap[cmd]) {
|
||||
// this.initCacheMap[cmd] = {};
|
||||
// }
|
||||
// this.initCacheMap[cmd][code] = cache;
|
||||
// });
|
||||
// this.$root.$on('removeCache', (cmd, code) => {
|
||||
// if (this.initCacheMap[cmd]) {
|
||||
// delete this.initCacheMap[cmd][code];
|
||||
// }
|
||||
// });
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$root.$off('iniCacheMap');
|
||||
this.$root.$off('appendCache');
|
||||
this.$root.$off('removeCache');
|
||||
// this.$root.$off('iniCacheMap');
|
||||
// this.$root.$off('appendCache');
|
||||
// this.$root.$off('removeCache');
|
||||
},
|
||||
methods: {
|
||||
onUpdateDone() {
|
||||
this.updateDone++;
|
||||
this.$emit('onUpdateDone');
|
||||
},
|
||||
onChangeInitInfo(initSelect, initParams) {
|
||||
this.initInfo = {
|
||||
initSelect,
|
||||
initParams
|
||||
};
|
||||
this.updateDone++;
|
||||
this.$emit('onChangeInitInfo', initSelect, initParams);
|
||||
},
|
||||
selectedChange() {
|
||||
const model = this.$store.state.menuOperation.selected;
|
||||
|
@ -133,7 +133,7 @@ export default {
|
||||
selected() {
|
||||
return this.$store.state.menuOperation.selected;
|
||||
},
|
||||
domIdChoose() {
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
@ -158,7 +158,7 @@ export default {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
'selected': function(val) {
|
||||
'selected': function(val) {
|
||||
if (val) {
|
||||
const stand = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
if (stand) {
|
||||
@ -176,6 +176,18 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const stand = this.stationStandList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(stand);
|
||||
setTimeout(() => {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -199,7 +211,7 @@ export default {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
|
@ -111,6 +111,19 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.selectSignalCode = selected.code;
|
||||
let index = 0;
|
||||
this.$refs.table.setCurrentRow(this.signalList.find((el, i) => { index = i; return el.code == selected.code; }));
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-row>
|
||||
<div class="signal-box-title">开始</div>
|
||||
<div style="border: 1px solid #ACABAA;padding: 8px;">
|
||||
<el-table :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeStar">
|
||||
<el-table ref="table" :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeStar">
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
</el-table>
|
||||
</div>
|
||||
@ -250,6 +250,20 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const signal = this.signalList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(signal);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.handleCurrentChangeStar(signal);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -258,6 +272,7 @@ export default {
|
||||
this.$refs.singleTable2.setCurrentRow();
|
||||
this.$refs.singleTable3.setCurrentRow();
|
||||
this.$refs.singleTable4.setCurrentRow();
|
||||
this.$refs.table.bodyWrapper.scrollTop = 0;
|
||||
},
|
||||
// 始端信号机点击
|
||||
handleCurrentChangeStar(val) {
|
||||
|
@ -202,6 +202,30 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, sure, selected) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (this.isSetSpeed) {
|
||||
this.title = `${sure ? '确认/取消设置临时限速区域' : '初始化设置临时限速区域'}`;
|
||||
} else {
|
||||
this.title = `${sure ? '清除临时限速区域' : '初始化清除临时限速区域'}`;
|
||||
this.command = true;
|
||||
}
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
let index = 0;
|
||||
const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.singleTable1.setCurrentRow(section);
|
||||
this.speedLimitValue = this.initParams.value || 0;
|
||||
setTimeout(()=> {
|
||||
this.$refs.singleTable1.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -166,6 +166,28 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, sure, selected) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消关闭轨道' : '确认/取消开放轨道'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化关闭轨道' : '初始化开放轨道'}`;
|
||||
this.command = true;
|
||||
}
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(section);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -250,7 +272,7 @@ export default {
|
||||
},
|
||||
getSectionStatus(code) {
|
||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||
return elem.blockade ? '关闭双向:所有列车' : '打开';
|
||||
return elem.closed ? '关闭双向:所有列车' : '打开';
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="tempList" highlight-current-row height="350px" @current-change="selectLine">
|
||||
<el-table ref="sectionTable" :data="tempList" highlight-current-row height="350px" @current-change="selectLine">
|
||||
<el-table-column prop="name" width="100" label="轨道" />
|
||||
<el-table-column prop="blockStatus" width="120" label="MAU">
|
||||
<template slot-scope="scope">
|
||||
@ -40,7 +40,7 @@
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="true">打印(P)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdClose" type="primary" @click="cancel">关闭(C)</el-button>
|
||||
<el-button :id="domIdClose" type="primary" @click="cancel">关闭(C)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :disabled="true">帮助(H)</el-button>
|
||||
@ -81,9 +81,9 @@ export default {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
tempList() {
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
|
||||
},
|
||||
tempList() {
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) );
|
||||
},
|
||||
domIdClose() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
@ -106,12 +106,22 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate;
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
const index = this.tempList.findIndex(el => el.code == selected.code);
|
||||
setTimeout(()=> {
|
||||
this.$refs.sectionTable.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -3,11 +3,11 @@
|
||||
<el-row>
|
||||
<el-col :span="sure? 18: 24">
|
||||
<el-table
|
||||
:id="domIdChoose"
|
||||
ref="table"
|
||||
:data="tempList"
|
||||
highlight-current-row
|
||||
height="350px"
|
||||
:id="domIdChoose"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
@ -28,7 +28,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="5" :offset="1" v-if="sure">
|
||||
<el-col v-if="sure" :span="5" :offset="1">
|
||||
<div class="set-status-title">命令</div>
|
||||
<div class="set-status-box">
|
||||
<el-radio v-model="command" :label="true">确认</el-radio>
|
||||
@ -62,40 +62,40 @@ import { mapGetters } from 'vuex';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
title: '',
|
||||
status: false,
|
||||
command: true,
|
||||
allChecked: false,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
sure: false,
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false
|
||||
sure: false,
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -108,18 +108,18 @@ export default {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
tempList() {
|
||||
return this.signalList;
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect||{};
|
||||
},
|
||||
cmdType() {
|
||||
return this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
|
||||
},
|
||||
tempList() {
|
||||
return this.signalList;
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect || {};
|
||||
},
|
||||
cmdType() {
|
||||
return this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK;
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || (this.isBlock ? this.currentSelect.blockade : !this.currentSelect.blockade) || this.noInit;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
},
|
||||
@ -139,81 +139,101 @@ export default {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
|
||||
}
|
||||
}
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value]||{};
|
||||
},
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value] || {};
|
||||
},
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化信号机封锁': '初始化信号机解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化信号机封锁' : '初始化信号机解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
|
||||
this.changeIgnore = sure;
|
||||
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, sure, selected) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化信号机封锁' : '初始化信号机解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
let index = 0;
|
||||
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$emit('updateDone');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.sure && (this.currentSelect = null);
|
||||
this.sure && this.$refs.table.setCurrentRow();
|
||||
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
|
||||
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
|
||||
)
|
||||
this.sure && (this.currentSelect = null);
|
||||
this.sure && this.$refs.table.setCurrentRow();
|
||||
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
|
||||
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
|
||||
);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit(isClose = false) {
|
||||
if (this.currentSelect &&
|
||||
if (this.currentSelect &&
|
||||
this.currentSelect.code == this.initSelect.code) {
|
||||
const cacheMap= this.getCacheMap();
|
||||
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
|
||||
const operate = {
|
||||
cmdType: this.sure&&isOK? this.cmdType: null,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
over: this.sure,
|
||||
param: {signalCode: this.currentSelect.code}
|
||||
};
|
||||
const cacheMap = this.getCacheMap();
|
||||
const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]);
|
||||
const operate = {
|
||||
cmdType: this.sure && isOK ? this.cmdType : null,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
over: this.sure,
|
||||
param: {signalCode: this.currentSelect.code}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (isOK) {
|
||||
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'});
|
||||
} else {
|
||||
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
|
||||
}
|
||||
this.$emit('updateDone')
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('两次选择不一致');
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (isOK) {
|
||||
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure ? 'two' : 'one'});
|
||||
} else {
|
||||
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
|
||||
}
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('两次选择不一致');
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone')
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone');
|
||||
if (this.changeIgnore) { return; }
|
||||
|
||||
const step = {
|
||||
@ -222,12 +242,12 @@ export default {
|
||||
val: val.code
|
||||
};
|
||||
|
||||
this.changeIgnore = false;
|
||||
this.$emit('updateDone')
|
||||
this.changeIgnore = false;
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.sure || this.$emit('initSelect', this.currentSelect);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.sure || this.$emit('initSelect', this.currentSelect);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
@ -235,22 +255,22 @@ export default {
|
||||
},
|
||||
getSignalStatus(code) {
|
||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||
return elem.blockade? '锁闭的': '未设锁闭';
|
||||
return elem.blockade ? '锁闭的' : '未设锁闭';
|
||||
},
|
||||
getProcess(code, type) {
|
||||
const blockType = this.isBlock ? 'lock': 'unlock';
|
||||
const cacheMap = this.getCacheMap();
|
||||
const cache = cacheMap[code];
|
||||
if (blockType==type) {
|
||||
if (cache) {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
const blockType = this.isBlock ? 'lock' : 'unlock';
|
||||
const cacheMap = this.getCacheMap();
|
||||
const cache = cacheMap[code];
|
||||
if (blockType == type) {
|
||||
if (cache) {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? this.isBlock ? '确认封锁完成' : '确认解除封锁完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
@ -3,11 +3,11 @@
|
||||
<el-row>
|
||||
<el-col :span="sure? 18: 24">
|
||||
<el-table
|
||||
:id="domIdChoose"
|
||||
ref="table"
|
||||
:data="tempList"
|
||||
highlight-current-row
|
||||
height="300px"
|
||||
:id="domIdChoose"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
@ -91,7 +91,7 @@ export default {
|
||||
sure: false,
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false
|
||||
changeIgnore: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -113,7 +113,7 @@ export default {
|
||||
disabled() {
|
||||
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
|
||||
},
|
||||
domIdChoose() {
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
@ -145,17 +145,34 @@ export default {
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (!sure) this.command = true;
|
||||
if (!sure) this.command = true;
|
||||
this.title = `${sure ? '确认/取消允许锁闭' : '初始化允许锁闭'}`;
|
||||
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
this.changeIgnore = sure;
|
||||
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, sure, selected) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (!sure) this.command = true;
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
let index = 0;
|
||||
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$emit('updateDone');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -173,7 +190,7 @@ export default {
|
||||
const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]);
|
||||
const operate = {
|
||||
cmdType: this.sure && isOK ? this.cmdType : null,
|
||||
operation: isClose? OperationEvent.Signal.lock.confirm.operation : OperationEvent.Signal.unlock.confirm.operation,
|
||||
operation: isClose ? OperationEvent.Signal.lock.confirm.operation : OperationEvent.Signal.unlock.confirm.operation,
|
||||
over: this.sure,
|
||||
param: {signalCode: this.currentSelect.code}
|
||||
};
|
||||
@ -199,9 +216,9 @@ export default {
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone')
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone');
|
||||
if (this.changeIgnore) { return; }
|
||||
|
||||
const step = {
|
||||
@ -210,7 +227,7 @@ export default {
|
||||
val: val.code
|
||||
};
|
||||
|
||||
this.changeIgnore = false;
|
||||
this.changeIgnore = false;
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-table :data="signalList" height="350px">
|
||||
<el-table ref="table" :data="signalList" height="350px">
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
<el-table-column prop="show" label="显示">
|
||||
<template slot-scope="scope">
|
||||
@ -98,6 +98,17 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
const index = this.signalList.findIndex(el => el.code == selected.code);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -166,11 +166,14 @@ export default {
|
||||
this.sure = sure;
|
||||
if (!sure) this.command = true;
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
console.log(this.currentSelect, '==========', this.currentSelect.callOn, this.noInit);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure;
|
||||
this.$refs.table.setCurrentRow(this.tempList.find(el => el.code == selected.code));
|
||||
let index = 0;
|
||||
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$emit('updateDone');
|
||||
});
|
||||
|
@ -3,11 +3,11 @@
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table
|
||||
ref="table"
|
||||
:id="domIdChoose"
|
||||
ref="table"
|
||||
:data="filterSignalList"
|
||||
height="350px"
|
||||
highlight-current-row
|
||||
:id="domIdChoose"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" label="ID" />
|
||||
@ -59,9 +59,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: false,
|
||||
operate: null,
|
||||
status: true,
|
||||
status: false,
|
||||
operate: null,
|
||||
allChecked: false,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
@ -73,28 +72,28 @@ export default {
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
selected() {
|
||||
return this.$store.state.menuOperation.selected;
|
||||
},
|
||||
disabled() {
|
||||
return !this.selected
|
||||
},
|
||||
},
|
||||
selected() {
|
||||
return this.$store.state.menuOperation.selected;
|
||||
},
|
||||
disabled() {
|
||||
return !this.selected;
|
||||
},
|
||||
filterSignalList() {
|
||||
return this.signalList.map(el => {
|
||||
return this.$store.getters['map/getDeviceByCode'](el.code);
|
||||
})
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''
|
||||
});
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
|
||||
},
|
||||
domIdApply() {
|
||||
},
|
||||
domIdApply() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
|
||||
},
|
||||
domIdClose() {
|
||||
},
|
||||
domIdClose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.close.domId : '';
|
||||
},
|
||||
title() {
|
||||
@ -106,69 +105,83 @@ export default {
|
||||
if (this.show) {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
'selected': function(val) {
|
||||
},
|
||||
'selected': function(val) {
|
||||
if (val) {
|
||||
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
if (signal && signal.redOpen) {
|
||||
this.status = true
|
||||
} else {
|
||||
this.status = false
|
||||
}
|
||||
}
|
||||
}
|
||||
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
if (signal && signal.redOpen) {
|
||||
this.status = true;
|
||||
} else {
|
||||
this.status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
if (!val) { return; }
|
||||
if (!val) { return; }
|
||||
const step = {
|
||||
code: val.code,
|
||||
code: val.code,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code
|
||||
};
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
this.$refs.table.setCurrentRow(this.selected);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
this.$refs.table.setCurrentRow(this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
console.log()
|
||||
console.log();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
});
|
||||
},
|
||||
doShow(operate) {
|
||||
this.operate = operate;
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const signal = this.filterSignalList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(signal);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.handleCurrentChange(signal);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.dialogShow = false;
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit(isClose = false) {
|
||||
const step = {
|
||||
cmdType: this.status ? CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL : CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation: OperationEvent.Command.common.apply.operation,
|
||||
over: true,
|
||||
param: { signalCode: this.selected.code }
|
||||
};
|
||||
const step = {
|
||||
cmdType: this.status ? CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL : CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
over: true,
|
||||
param: { signalCode: this.selected.code }
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
});
|
||||
},
|
||||
handleClick() {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-col :span="16">
|
||||
<div class="simulate_table">
|
||||
<div id="sim_table" class="simulate_table">
|
||||
<div style="display: flex;">
|
||||
<div class="simulate_table_header" style="width: 120px;">站台</div>
|
||||
<div class="simulate_table_header" style="width: 120px;">扣车</div>
|
||||
@ -116,6 +116,19 @@ export default {
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
this.judgeStatus();
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selectedStandList = [selected.code];
|
||||
this.allChecked = false;
|
||||
this.$nextTick(function () {
|
||||
const index = this.stationStandList.findIndex(el => el.code == selected.code);
|
||||
const ele = document.getElementById('sim_table');
|
||||
ele.scrollTop = index * 20;
|
||||
this.judgeStatus();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row style="width: 100%;overflow-x: auto;">
|
||||
<el-table :data="stationStandList" height="350px">
|
||||
<el-table ref="table" :data="stationStandList" height="350px">
|
||||
<el-table-column prop="name" width="80" label="站台" />
|
||||
<el-table-column prop="status" width="80" label="状态">打开</el-table-column>
|
||||
<el-table-column prop="minTime" width="110" label="最小停站时间" />
|
||||
@ -96,6 +96,16 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
const index = this.stationStandList.findIndex(el => el.code == selected.code);
|
||||
setTimeout(() => {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -103,7 +113,7 @@ export default {
|
||||
},
|
||||
commit() {
|
||||
},
|
||||
handleClick() {
|
||||
handleClick(mon, years) {
|
||||
},
|
||||
getDetainStatus(code) {
|
||||
const stand = this.$store.getters['map/getDeviceByCode'](code);
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-col :span="16">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="changeTabs">
|
||||
<el-tab-pane label="站台" name="first">
|
||||
<div class="simulate_table">
|
||||
<div id="sim_table" class="simulate_table">
|
||||
<div style="display: flex;">
|
||||
<div class="simulate_table_header" style="width: 120px;">站台</div>
|
||||
<div class="simulate_table_header" style="width: 120px;">扣车</div>
|
||||
@ -127,6 +127,18 @@ export default {
|
||||
});
|
||||
this.judgeStatus();
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selectedStandList = [selected.code];
|
||||
this.allChecked = false;
|
||||
this.$nextTick(function () {
|
||||
const index = this.stationStandList.findIndex(el => el.code == selected.code);
|
||||
const ele = document.getElementById('sim_table');
|
||||
ele.scrollTop = index * 20;
|
||||
this.judgeStatus();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
clickStand(val) {
|
||||
const index = this.selectedStandList.indexOf(val.code);
|
||||
if (index === -1) {
|
||||
|
@ -158,6 +158,14 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
const stand = this.centralizedStaionList.find(el => el.code == selected.code);
|
||||
this.$refs.table.setCurrentRow(stand);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
getControlApplUserId(controller, controlApplicant) {
|
||||
const memberData = this.$store.state.training.memberData;
|
||||
if (controller && memberData[controller] && memberData[controller].userId == this.$store.state.user.id ) {
|
||||
|
@ -3,11 +3,11 @@
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table
|
||||
:id="domIdChoose"
|
||||
ref="table"
|
||||
:data="switchList"
|
||||
highlight-current-row
|
||||
height="300px"
|
||||
:id="domIdChoose"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" width="80" label="道岔" />
|
||||
@ -61,8 +61,7 @@ export default {
|
||||
allChecked: false,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
status: false,
|
||||
isActive: false,
|
||||
isActive: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -96,15 +95,15 @@ export default {
|
||||
if (this.show) {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
'selected': function(val) {
|
||||
},
|
||||
'selected': function(val) {
|
||||
if (val) {
|
||||
const swchEle = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
const swchEle = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
if (swchEle && swchEle.cutOff) {
|
||||
this.status = true;
|
||||
this.status = true;
|
||||
} else {
|
||||
this.status = false;
|
||||
}
|
||||
this.status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -117,6 +116,18 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const switchEle = this.switchList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(switchEle);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -127,13 +138,13 @@ export default {
|
||||
const step = {
|
||||
over: true,
|
||||
cmdType: this.status ? CMD.Switch.CMD_SWITCH_ACTIVE : CMD.Switch.CMD_SWITCH_CUT_OFF,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation: OperationEvent.Command.common.apply.operation,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
param: { switchCode: this.selected.code}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -145,22 +156,22 @@ export default {
|
||||
if (!val) { return; }
|
||||
const step = {
|
||||
code: val.code,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code
|
||||
};
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: val});
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
getSwitchCutOff(code) {
|
||||
const swchEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (!!swchEle.cutOff) {
|
||||
const swchEle = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (swchEle.cutOff) {
|
||||
return '未激活';
|
||||
} else {
|
||||
return '激活';
|
||||
|
@ -28,7 +28,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="sure">
|
||||
<el-col v-if="sure" :span="6">
|
||||
<div class="radio-box-title">命令</div>
|
||||
<div class="radio-box">
|
||||
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
|
||||
@ -61,41 +61,41 @@ import { mapGetters } from 'vuex';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
title: '',
|
||||
status: false,
|
||||
standStatus: true,
|
||||
allChecked: false,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
command: true,
|
||||
sure: false,
|
||||
operate: {},
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false,
|
||||
sure: false,
|
||||
operate: {},
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -105,21 +105,21 @@ export default {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
tempList() {
|
||||
return this.switchList;
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect||{};
|
||||
},
|
||||
tempList() {
|
||||
return this.switchList;
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect || {};
|
||||
},
|
||||
isBlock() {
|
||||
return this.operate && this.operate.operation.includes(OperationEvent.Command.commandNingBo3.line_switch_block.operation);
|
||||
},
|
||||
cmdType() {
|
||||
return this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK;
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || (this.isBlock? this.currentSelect.blockade: !this.currentSelect.blockade) || this.noInit;
|
||||
},
|
||||
cmdType() {
|
||||
return this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK;
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || (this.isBlock ? this.currentSelect.blockade : !this.currentSelect.blockade) || this.noInit;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
},
|
||||
@ -139,82 +139,104 @@ export default {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
|
||||
}
|
||||
}
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value]||{};
|
||||
},
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value] || {};
|
||||
},
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
this.sure = sure;
|
||||
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化道岔封锁': '初始化解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化道岔封锁' : '初始化解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
|
||||
this.currentSelect = sure? this.$store.getters['map/getDeviceByCode'](this.initSelect.code): null
|
||||
this.dialogShow = true;
|
||||
this.currentSelect = sure ? this.$store.getters['map/getDeviceByCode'](this.initSelect.code) : null;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.changeIgnore = sure
|
||||
this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.changeIgnore = sure;
|
||||
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, sure, selected) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (sure) {
|
||||
this.title = `${this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁'}`;
|
||||
} else {
|
||||
this.title = `${this.isBlock ? '初始化道岔封锁' : '初始化解除封锁'}`;
|
||||
this.command = true;
|
||||
}
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const switchEle = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(switchEle);
|
||||
setTimeout(()=> {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.sure && (this.currentSelect = null);
|
||||
this.sure && (this.currentSelect = null);
|
||||
this.sure && this.$refs.table.setCurrentRow();
|
||||
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
|
||||
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
|
||||
)
|
||||
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
|
||||
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
|
||||
);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit(isClose = false) {
|
||||
if (this.currentSelect &&
|
||||
if (this.currentSelect &&
|
||||
this.currentSelect.code == this.initSelect.code) {
|
||||
const cacheMap= this.getCacheMap()
|
||||
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code])
|
||||
const operate = {
|
||||
cmdType: this.sure&&isOK ? this.cmdType : null,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
over: this.sure,
|
||||
param: { switchCode: this.currentSelect.code }
|
||||
};
|
||||
const cacheMap = this.getCacheMap();
|
||||
const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]);
|
||||
const operate = {
|
||||
cmdType: this.sure && isOK ? this.cmdType : null,
|
||||
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
|
||||
over: this.sure,
|
||||
param: { switchCode: this.currentSelect.code }
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (isOK) {
|
||||
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, {done: this.sure? 'two': 'one'});
|
||||
} else {
|
||||
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
|
||||
}
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (isOK) {
|
||||
this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, {done: this.sure ? 'two' : 'one'});
|
||||
} else {
|
||||
this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code);
|
||||
}
|
||||
|
||||
this.$emit('updateDone')
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(_ => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('两次选择不一致');
|
||||
}
|
||||
this.$emit('updateDone');
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
}).catch(_ => {
|
||||
isClose && this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('两次选择不一致');
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone')
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone');
|
||||
if (this.changeIgnore) { return; }
|
||||
|
||||
const step = {
|
||||
@ -223,34 +245,34 @@ export default {
|
||||
val: val.code
|
||||
};
|
||||
|
||||
this.changeIgnore = false;
|
||||
this.changeIgnore = false;
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.sure || this.$emit('initSelect', this.currentSelect);
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.sure || this.$emit('initSelect', this.currentSelect);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
getSwitchStatus(code) {
|
||||
getSwitchStatus(code) {
|
||||
const elem = this.$store.getters['map/getDeviceByCode'](code);
|
||||
return elem.blockade? '锁闭的': '未锁闭的';
|
||||
return elem.blockade ? '锁闭的' : '未锁闭的';
|
||||
},
|
||||
getProcess(code, type) {
|
||||
const blockType = this.isBlock ? 'block': 'unblock';
|
||||
const cacheMap = this.getCacheMap();
|
||||
const cache = cacheMap[code];
|
||||
if (blockType==type) {
|
||||
if (cache) {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
const blockType = this.isBlock ? 'block' : 'unblock';
|
||||
const cacheMap = this.getCacheMap();
|
||||
const cache = cacheMap[code];
|
||||
if (blockType == type) {
|
||||
if (cache) {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? this.isBlock ? '确认锁闭完成' : '确认解锁完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
@ -260,7 +282,7 @@ export default {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
@ -130,6 +130,21 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.mode = '';
|
||||
this.position = '';
|
||||
this.$nextTick(function () {
|
||||
let index = 0;
|
||||
const switchEle = this.switchList.find((el, i) => { index = i; return el.code == selected.code; });
|
||||
this.$refs.table.setCurrentRow(switchEle);
|
||||
setTimeout(() => {
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
this.handleCurrentChange(switchEle);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-table :data="switchList" height="350px">
|
||||
<el-table ref="table" :data="switchList" height="350px">
|
||||
<el-table-column prop="name" width="80" label="道岔" />
|
||||
<el-table-column prop="position" width="80" label="位置">
|
||||
<template slot-scope="scope">
|
||||
@ -94,6 +94,14 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
rightClickShow(operate, selected) {
|
||||
this.operate = operate;
|
||||
this.dialogShow = true;
|
||||
setTimeout(() => {
|
||||
const index = this.switchList.findIndex(el => el.code == selected.code);
|
||||
this.$refs.table.bodyWrapper.scrollTop = index * 20;
|
||||
}, 200);
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
@ -1,45 +1,42 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<section-control ref="sectionControl" pop-class="ningbo-01__systerm" />
|
||||
<section-un-lock ref="sectionUnLock" pop-class="ningbo-01__systerm" />
|
||||
<speed-limit-control ref="speedLimitControl" pop-class="ningbo-01__systerm" />
|
||||
<alxe-effective ref="alxeEffective" />
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<train-add-plan ref="trainAddPlan" pop-class="ningbo-01__systerm" />
|
||||
<load-spare-train ref="loadSpareTrain" pop-class="foshan-01__systerm" />
|
||||
<section-open ref="sectionOpen" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<section-limit-speed ref="sectionLimitSpeed" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<section-show ref="sectionShow" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SectionUnLock from '@/jmapNew/theme/components/menus/dialog/sectionUnLock';
|
||||
import SpeedLimitControl from '@/jmapNew/theme/components/menus/dialog/speedCmdControl';
|
||||
import AlxeEffective from './dialog/alxeEffective';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SectionOpen from './menuDialog/sectionOpen';
|
||||
import SectionLimitSpeed from './menuDialog/sectionLimitSpeed';
|
||||
import SectionShow from './menuDialog/sectionShow';
|
||||
import { mapGetters } from 'vuex';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'SectionMenu',
|
||||
components: {
|
||||
SectionLimitSpeed,
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionUnLock,
|
||||
SpeedLimitControl,
|
||||
AlxeEffective,
|
||||
NoticeInfo,
|
||||
TrainAddPlan,
|
||||
SetFault,
|
||||
LoadSpareTrain
|
||||
LoadSpareTrain,
|
||||
SectionOpen,
|
||||
SectionShow
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -47,6 +44,24 @@ export default {
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -71,26 +86,67 @@ export default {
|
||||
// },
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: '区段跟踪激活',
|
||||
// handler: this.active,
|
||||
// cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||
// },
|
||||
// {
|
||||
// label: '区段跟踪切除',
|
||||
// handler: this.split,
|
||||
// cmdType: CMD.Section.CMD_SECTION_CUT_OFF
|
||||
// },
|
||||
// {
|
||||
// label: '确认计轴有效',
|
||||
// handler: this.alxeEffective,
|
||||
// cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
|
||||
// },
|
||||
// {
|
||||
// label: '设置临时限速',
|
||||
// handler: this.setSpeed,
|
||||
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
|
||||
// }
|
||||
{
|
||||
label: '开放',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitOpen
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerOpen
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitClose
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerClose
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '临时限速',
|
||||
children: [
|
||||
{
|
||||
label: '设置',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitSetLimit
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerSetLimit
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '清除',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitCancelLimit
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerCancelLimit
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
handler: this.handlerDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -144,7 +200,8 @@ export default {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
if (this.selected.type != '04') {
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menu = this.menuNormal.Center;
|
||||
} else {
|
||||
this.menu = [];
|
||||
}
|
||||
@ -153,6 +210,12 @@ export default {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
},
|
||||
onUpdateDone() {
|
||||
this.$emit('onUpdateDone');
|
||||
},
|
||||
onChangeInitInfo(initSelect, initParams) {
|
||||
this.$emit('onChangeInitInfo', initSelect, initParams);
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
@ -251,6 +314,33 @@ export default {
|
||||
this.$refs.loadSpareTrain.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
handlerInitOpen() {
|
||||
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_open_init, false, this.selected);
|
||||
},
|
||||
handlerOpen() {
|
||||
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_open_sure, true, this.selected);
|
||||
},
|
||||
handlerInitClose() {
|
||||
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_close_init, false, this.selected);
|
||||
},
|
||||
handlerClose() {
|
||||
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_close_sure, true, this.selected);
|
||||
},
|
||||
handlerInitSetLimit() {
|
||||
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_setSpeed_init, false, this.selected);
|
||||
},
|
||||
handlerSetLimit() {
|
||||
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_setSpeed_sure, true, this.selected);
|
||||
},
|
||||
handlerInitCancelLimit() {
|
||||
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_clearSpeed_init, false, this.selected);
|
||||
},
|
||||
handlerCancelLimit() {
|
||||
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_clearSpeed_sure, true, this.selected);
|
||||
},
|
||||
handlerDetail() {
|
||||
this.$refs.sectionShow.rightClickShow('', this.selected);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,7 +3,13 @@
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<signal-guide-init ref="signalGuideInit" />
|
||||
<signal-guide ref="signalGuide" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<signal-can-block ref="signalCanBlock" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<cancel-signal-guide ref="cancelSignal" />
|
||||
<route-command ref="routeCommand" />
|
||||
<signal-model ref="signalModel" />
|
||||
<signal-block ref="signalBlock" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<signal-detail ref="signalDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -15,7 +21,13 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SignalGuideInit from './menuDialog/signalGuide';
|
||||
import SignalGuide from './menuDialog/signalGuide';
|
||||
import SignalCanBlock from './menuDialog/signalCanBlock';
|
||||
import CancelSignalGuide from './menuDialog/cancleSignalGuide';
|
||||
import RouteCommand from './menuDialog/routeCommand';
|
||||
import SignalModel from './menuDialog/signalModel';
|
||||
import SignalBlock from './menuDialog/signalBlock';
|
||||
import SignalDetail from './menuDialog/signalDetail';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
@ -24,8 +36,13 @@ export default {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
SetFault,
|
||||
SignalGuideInit
|
||||
|
||||
SignalGuide,
|
||||
SignalCanBlock,
|
||||
CancelSignalGuide,
|
||||
RouteCommand,
|
||||
SignalModel,
|
||||
SignalBlock,
|
||||
SignalDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -33,6 +50,24 @@ export default {
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -42,107 +77,93 @@ export default {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: '引导',
|
||||
// children: [
|
||||
// {
|
||||
// label: '初始化',
|
||||
// handler: this.initGuide
|
||||
// },
|
||||
// {
|
||||
// label: '确定/取消',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '清除',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '取消允许锁闭',
|
||||
// children: [
|
||||
// {
|
||||
// label: '初始化',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '确定/取消',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '进路',
|
||||
// children: [
|
||||
// {
|
||||
// label: '命令',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '显示',
|
||||
// children: [
|
||||
// {
|
||||
// label: 'CBTC进路信息',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '后备进路信息',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '信号指示模式',
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '封锁',
|
||||
// children: [
|
||||
// {
|
||||
// label: '初始化',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '确认/取消',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '解除封锁',
|
||||
// children: [
|
||||
// {
|
||||
// label: '初始化',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '确认/取消',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '解除封锁',
|
||||
// handler: this.undeveloped,
|
||||
// children: [
|
||||
// {
|
||||
// label: '初始化',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '确认/取消',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '显示',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
{
|
||||
label: '引导',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitGuide
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerGuide
|
||||
},
|
||||
{
|
||||
label: '清除',
|
||||
handler: this.handlerCancelGuide
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '取消允许锁闭',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitAllowLock
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerAllowLock
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '进路',
|
||||
children: [
|
||||
{
|
||||
label: '命令',
|
||||
handler: this.handlerRouteCommand
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
children: [
|
||||
{
|
||||
label: 'CBTC进路信息',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '后备进路信息',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '信号指示模式',
|
||||
handler: this.handlerSignalModel,
|
||||
cmdType: ''
|
||||
},
|
||||
{
|
||||
label: '封锁',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitBlock
|
||||
},
|
||||
{
|
||||
label: '确认/取消',
|
||||
handler: this.handlerBlock
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '解除封锁',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitUnblock
|
||||
},
|
||||
{
|
||||
label: '确认/取消',
|
||||
handler: this.handlerUnblock
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
handler: this.handlerDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -188,7 +209,12 @@ export default {
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
},
|
||||
onUpdateDone() {
|
||||
this.$emit('onUpdateDone');
|
||||
},
|
||||
onChangeInitInfo(initSelect, initParams) {
|
||||
this.$emit('onChangeInitInfo', initSelect, initParams);
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
@ -201,30 +227,6 @@ export default {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置通过模式
|
||||
singalPassModel() {
|
||||
commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.routeControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消通过模式
|
||||
singalCancelPassModel() {
|
||||
commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.routeControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 人工解锁进路(信号机取消引导)
|
||||
humanTrainRoute() {
|
||||
commitOperate(menuOperate.Signal.cancelGuide, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.routerCommand.doShow(operate, this.selected, '是否执行人解列车进路命令?');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
|
||||
@ -244,8 +246,41 @@ export default {
|
||||
undeveloped() {
|
||||
|
||||
},
|
||||
initGuide() {
|
||||
this.$refs.signalGuideInit.rightClickShow(OperationEvent.Signal.guide.initMenu, false, this.selected);
|
||||
handlerInitGuide() {
|
||||
this.$refs.signalGuide.rightClickShow(OperationEvent.Signal.guide.initMenu, false, this.selected);
|
||||
},
|
||||
handlerGuide() {
|
||||
this.$refs.signalGuide.rightClickShow(OperationEvent.Signal.guide.menu, true, this.selected);
|
||||
},
|
||||
handlerCancelGuide() {
|
||||
this.$refs.cancelSignal.rightClickShow(OperationEvent.Signal.cancelGuide.menu, this.selected);
|
||||
},
|
||||
handlerInitAllowLock() {
|
||||
this.$refs.signalCanBlock.rightClickShow(OperationEvent.Signal.lock.initMenu, false, this.selected);
|
||||
},
|
||||
handlerAllowLock() {
|
||||
this.$refs.signalCanBlock.rightClickShow(OperationEvent.Signal.lock.menu, true, this.selected);
|
||||
},
|
||||
handlerRouteCommand() {
|
||||
this.$refs.routeCommand.rightClickShow(OperationEvent.Signal.arrangementRoute.menu, this.selected);
|
||||
},
|
||||
handlerSignalModel() {
|
||||
this.$refs.signalModel.rightClickShow('', this.selected);
|
||||
},
|
||||
handlerInitBlock() {
|
||||
this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_block_init, false, this.selected);
|
||||
},
|
||||
handlerBlock() {
|
||||
this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_block_sure, true, this.selected);
|
||||
},
|
||||
handlerInitUnblock() {
|
||||
this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_unblock_init, false, this.selected);
|
||||
},
|
||||
handlerUnblock() {
|
||||
this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_unblock_sure, true, this.selected);
|
||||
},
|
||||
handlerDetail() {
|
||||
this.$refs.signalDetail.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_detail, this.selected);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -69,19 +69,28 @@ export default {
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: '所有进路自排关',
|
||||
// handler: this.humanControlALL,
|
||||
// cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
|
||||
// label: '开放/关闭',
|
||||
// handler: ''
|
||||
// },
|
||||
// {
|
||||
// label: '所有进路自排开',
|
||||
// handler: this.atsAutoControlALL,
|
||||
// cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
|
||||
// label: '设置/取消扣车',
|
||||
// handler: ''
|
||||
// },
|
||||
// {
|
||||
// label: '执行关键操作测试',
|
||||
// handler: this.execKeyOperationTest,
|
||||
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST
|
||||
// label: '设置站间列车数量',
|
||||
// handler: ''
|
||||
// },
|
||||
// {
|
||||
// label: '分配停站时间',
|
||||
// handler: ''
|
||||
// },
|
||||
// {
|
||||
// label: '授权转移',
|
||||
// handler: ''
|
||||
// },
|
||||
// {
|
||||
// label: '显示',
|
||||
// handler: ''
|
||||
// }
|
||||
]
|
||||
},
|
||||
|
@ -1,45 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<stand-control ref="standControl" system-name="ningbo-01__systerm" />
|
||||
<stand-jump-stop-control ref="standJumpStopControl" system-name="ningbo-01__systerm" />
|
||||
<stand-detail ref="standDetail" pop-class="ningbo-01__systerm" />
|
||||
<stand-run-level ref="standRunLevel" system-name="ningbo-01__systerm" />
|
||||
<stand-stop-time ref="standStopTime" system-name="ningbo-01__systerm" />
|
||||
<StandBulkBuckleTrain ref="standBulkBuckleTrain" />
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<stand-control ref="standControl" />
|
||||
<stand-detain ref="standDetain" />
|
||||
<allocate-time ref="allocateTime" />
|
||||
<station-transfer ref="stationTransfer" />
|
||||
<stand-detail ref="standDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StandControl from '@/jmapNew/theme/components/menus/dialog/standControl';
|
||||
import StandJumpStopControl from '@/jmapNew/theme/components/menus/dialog/standJumpStopControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import StandDetail from '@/jmapNew/theme/components/menus/dialog/standDetail';
|
||||
import StandRunLevel from '@/jmapNew/theme/components/menus/dialog/standRunLevel';
|
||||
import StandStopTime from '@/jmapNew/theme/components/menus/dialog/standStopTime';
|
||||
import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import StandControl from './menuDialog/standControl';
|
||||
import StandDetain from './menuDialog/standDetain';
|
||||
import StandDetail from './menuDialog/standDetail';
|
||||
import AllocateTime from './menuDialog/allocateTime';
|
||||
import StationTransfer from './menuDialog/stationTransfer';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandJumpStopControl,
|
||||
StandBulkBuckleTrain,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandStopTime,
|
||||
SetFault
|
||||
StandControl,
|
||||
SetFault,
|
||||
StandDetain,
|
||||
AllocateTime,
|
||||
StationTransfer,
|
||||
StandDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -76,66 +72,30 @@ export default {
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: '扣车',
|
||||
// handler: this.setDetainTrain,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '取消扣车',
|
||||
// handler: this.cancelDetainTrain,
|
||||
// cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '批量扣车',
|
||||
// handler: this.setBulkBuckleTrain,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL
|
||||
// },
|
||||
// {
|
||||
// label: '批量取消扣车',
|
||||
// handler: this.cancelBulkBuckleTrain,
|
||||
// cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL
|
||||
// },
|
||||
// {
|
||||
// label: '提前发车',
|
||||
// handler: this.earlyDeparture,
|
||||
// cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||
// },
|
||||
// {
|
||||
// label: '设置跳停',
|
||||
// handler: this.setJumpStop,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '取消跳停',
|
||||
// handler: this.cancelJumpStop,
|
||||
// cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '设置停站时间',
|
||||
// handler: this.setStopTime,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '设置运行等级',
|
||||
// handler: this.setRunLevel,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '区间列车数量限制',
|
||||
// handler: this.setDetainTrainAll,
|
||||
// cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO
|
||||
// },
|
||||
// {
|
||||
// label: '取消区间列车数量限制',
|
||||
// handler: this.cancelDetainTrainAll,
|
||||
// cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO
|
||||
// },
|
||||
// {
|
||||
// label: '查看站台信息',
|
||||
// handler: this.detail,
|
||||
// cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
// }
|
||||
{
|
||||
label: '开放/关闭',
|
||||
handler: this.handlerOpenOrClose
|
||||
},
|
||||
{
|
||||
label: '设置/取消扣车',
|
||||
handler: this.handlerDetain
|
||||
},
|
||||
{
|
||||
label: '设置站间列车数量',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '分配停站时间',
|
||||
handler: this.handlerAllocateTime
|
||||
},
|
||||
{
|
||||
label: '授权转移',
|
||||
handler: this.handlerStationTransfer
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
handler: this.handlerDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -173,7 +133,8 @@ export default {
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menu = this.menuNormal.Center;
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
@ -207,99 +168,25 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
handlerOpenOrClose() {
|
||||
this.$refs.standControl.rightClickShow('', this.selected);
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
handlerDetain() {
|
||||
this.$refs.standDetain.rightClickShow('', this.selected);
|
||||
},
|
||||
// 区间列车数量限制
|
||||
setDetainTrainAll() {
|
||||
commitOperate(menuOperate.StationStand.setDetainTrainAuto, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
handlerAllocateTime() {
|
||||
this.$refs.allocateTime.rightClickShow('', this.selected);
|
||||
},
|
||||
// 取消区间列车数量限制
|
||||
cancelDetainTrainAll() {
|
||||
commitOperate(menuOperate.StationStand.cancelDetainTrainAuto, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
handlerStationTransfer() {
|
||||
this.$refs.stationTransfer.rightClickShow('', this.selected);
|
||||
},
|
||||
// 批量扣车
|
||||
setBulkBuckleTrain() {
|
||||
commitOperate(menuOperate.StationStand.setBulkBuckleTrain, {}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standBulkBuckleTrain.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
handlerDetail() {
|
||||
this.$refs.standDetail.rightClickShow('', this.selected);
|
||||
},
|
||||
// 批量取消扣车
|
||||
cancelBulkBuckleTrain() {
|
||||
commitOperate(menuOperate.StationStand.cancelBulkBuckleTrain, {}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standBulkBuckleTrain.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置停站时间
|
||||
setStopTime() {
|
||||
commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standStopTime.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.standDetail.doShow(operate, this.selected);
|
||||
undeveloped() {
|
||||
this.$alert('实现中......', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,43 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<switch-control ref="switchControl" pop-class="ningbo-01__systerm" />
|
||||
<section-un-lock ref="sectionUnLock" pop-class="ningbo-01__systerm" />
|
||||
<speed-limit-control ref="speedLimitControl" pop-class="ningbo-01__systerm" />
|
||||
<alxe-effective ref="alxeEffective" />
|
||||
<switch-hook-lock ref="switchHookLock" pop-class="ningbo-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<switch-command ref="switchCommand" />
|
||||
<switch-block ref="switchBlock" :init-cache-map="initCacheMap" :init-info="initInfo" :update-done="updateDone" @updateDone="onUpdateDone" @initSelect="onChangeInitInfo" />
|
||||
<switch-active ref="switchActive" />
|
||||
<switch-detail ref="switchDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SectionUnLock from '@/jmapNew/theme/components/menus/dialog/sectionUnLock';
|
||||
import SpeedLimitControl from '@/jmapNew/theme/components/menus/dialog/speedCmdControl';
|
||||
import AlxeEffective from './dialog/alxeEffective';
|
||||
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
import SwitchCommand from './menuDialog/switchCommand';
|
||||
import SwitchBlock from './menuDialog/switchBlock';
|
||||
import SwitchActive from './menuDialog/switchActive';
|
||||
import SwitchDetail from './menuDialog/switchDetail';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'SwitchMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SwitchControl,
|
||||
SectionUnLock,
|
||||
SpeedLimitControl,
|
||||
AlxeEffective,
|
||||
NoticeInfo,
|
||||
SetFault,
|
||||
SwitchHookLock
|
||||
SwitchCommand,
|
||||
SwitchBlock,
|
||||
SwitchActive,
|
||||
SwitchDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -45,6 +38,24 @@ export default {
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -84,55 +95,54 @@ export default {
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: '定操',
|
||||
// handler: this.locate,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '反操',
|
||||
// handler: this.reverse,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '道岔单锁',
|
||||
// handler: this.lock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '区段激活',
|
||||
// handler: this.active,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
// },
|
||||
// {
|
||||
// label: '区段切除',
|
||||
// handler: this.split,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '确认计轴有效',
|
||||
// handler: this.alxeEffective,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
|
||||
// },
|
||||
// {
|
||||
// label: '设置临时限速',
|
||||
// handler: this.setSpeed,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '查看公里标',
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
|
||||
// }
|
||||
{
|
||||
label: '命令',
|
||||
handler: this.handlerCommand
|
||||
},
|
||||
{
|
||||
label: '封锁',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitBlock
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerBlock
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '解除封锁',
|
||||
children: [
|
||||
{
|
||||
label: '初始化',
|
||||
handler: this.handlerInitUnblock
|
||||
},
|
||||
{
|
||||
label: '确定/取消',
|
||||
handler: this.handlerUnblock
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '请求动岔',
|
||||
children: [
|
||||
{
|
||||
label: '请求或授权/取消',
|
||||
handler: this.handlerActive
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
disabled: true,
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '显示',
|
||||
handler: this.handlerDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -170,7 +180,8 @@ export default {
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menu = this.menuNormal.Center;
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
// if (!this.$store.state.scriptRecord.bgSet) {
|
||||
@ -184,6 +195,12 @@ export default {
|
||||
// }
|
||||
}
|
||||
},
|
||||
onUpdateDone() {
|
||||
this.$emit('onUpdateDone');
|
||||
},
|
||||
onChangeInitInfo(initSelect, initParams) {
|
||||
this.$emit('onChangeInitInfo', initSelect, initParams);
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
@ -195,86 +212,6 @@ export default {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 定操定位
|
||||
locate() {
|
||||
commitOperate(menuOperate.Switch.locate, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 定操反位
|
||||
reverse() {
|
||||
commitOperate(menuOperate.Switch.reverse, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
commitOperate(menuOperate.Switch.lock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔单解
|
||||
unlock() {
|
||||
commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
commitOperate(menuOperate.Switch.block, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔解封
|
||||
unblock() {
|
||||
commitOperate(menuOperate.Switch.unblock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
commitOperate(menuOperate.Switch.split, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
commitOperate(menuOperate.Switch.active, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置临时限速
|
||||
setSpeed() {
|
||||
commitOperate(menuOperate.Switch.setSpeed, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.speedLimitControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 确认计轴有效
|
||||
alxeEffective() {
|
||||
commitOperate(menuOperate.Switch.alxeEffective, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.alxeEffective.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert('实现中......', '提示', {
|
||||
@ -302,6 +239,27 @@ export default {
|
||||
// 道岔钩锁
|
||||
hookLock() {
|
||||
this.$refs.switchHookLock.doShow(this.selected);
|
||||
},
|
||||
handlerCommand() {
|
||||
this.$refs.switchCommand.rightClickShow('', this.selected);
|
||||
},
|
||||
handlerInitBlock() {
|
||||
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_block_init, false, this.selected);
|
||||
},
|
||||
handlerBlock() {
|
||||
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_block_sure, true, this.selected);
|
||||
},
|
||||
handlerInitUnblock() {
|
||||
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_unblock_init, false, this.selected);
|
||||
},
|
||||
handlerUnblock() {
|
||||
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_unblock_sure, true, this.selected);
|
||||
},
|
||||
handlerActive() {
|
||||
this.$refs.switchActive.rightClickShow('', this.selected);
|
||||
},
|
||||
handlerDetail() {
|
||||
this.$refs.switchDetail.rightClickShow('', this.selected);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -264,10 +264,6 @@ export function parser(data, skinCode, showConfig) {
|
||||
mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.signalButtonList || [], elem=> {
|
||||
mapDevice[elem.code] = createDevice(deviceType.SignalButton, elem, propConvert, showConfig);
|
||||
});
|
||||
|
||||
zrUtil.each(data.responderList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
@ -296,6 +292,16 @@ export function parser(data, skinCode, showConfig) {
|
||||
actual.aliasCodes.push(elem.code);
|
||||
}
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.signalButtonList || [], elem=> {
|
||||
mapDevice[elem.code] = createDevice(deviceType.SignalButton, elem, propConvert, showConfig);
|
||||
if (elem.signalCode) {
|
||||
const signal = mapDevice[elem.signalCode];
|
||||
if (signal.signalButtonList) {
|
||||
signal.signalButtonList.push(elem.code);
|
||||
} else { signal.signalButtonList = [elem.code]; }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mapDevice;
|
||||
@ -369,8 +375,9 @@ export function updateMapData(state, model) {
|
||||
case deviceType.ReturnModeGroup: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.ControlSwitch: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
|
||||
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.IndicatorLight: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
|
||||
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
|
||||
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
|
||||
case deviceType.StationTurnBack : updateForList(model, state, 'tbStrategyList'); break;
|
||||
|
@ -142,7 +142,7 @@ export default {
|
||||
// } else {
|
||||
// href = 'https://joylink.club/docs';
|
||||
// }
|
||||
href = 'https://test.joylink.club/cbtc/docs/';
|
||||
href = process.env.VUE_APP_BASE_SITE + '/docs/';
|
||||
window.open(href, '_blank');
|
||||
},
|
||||
goEmpty() {},
|
||||
|
@ -14,6 +14,8 @@ const AuthorList = () => import('@/views/authorization/list');
|
||||
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
||||
const Jlmap3dAssetManager = () => import('@/views/jlmap3d/jl3dassetmanager/assetmanager');
|
||||
const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3dedit');
|
||||
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
|
||||
|
||||
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
||||
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
|
||||
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
|
||||
@ -259,6 +261,11 @@ export const constantRoutes = [
|
||||
component: Jlmap3dLesson3dEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/design/jlmap3d/lesson3dplayer',
|
||||
component: Jlmap3dLesson3dPlayer,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/data2json',
|
||||
component: () => import('@/views/planMonitor/data2json/page.vue'),
|
||||
@ -372,11 +379,11 @@ export const publicAsyncRoute = [
|
||||
component: DisplayNew,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/displayCity/:mode',
|
||||
component: DisplayCity,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/displayCity/:mode',
|
||||
component: DisplayCity,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/design/displayNew/:mode',
|
||||
component: DesignDisplayNew,
|
||||
|
@ -41,7 +41,11 @@ export default {
|
||||
/** 挤岔恢复 */
|
||||
CMD_SWITCH_SQUEEZE_RECOVERY: {value: 'Switch_Squeeze_Recovery', label: '挤岔恢复'},
|
||||
/** 道岔命令 */
|
||||
CMD_SWITCH_COMMAND: {value: 'Switch_Command', label: '道岔命令'}
|
||||
CMD_SWITCH_COMMAND: {value: 'Switch_Command', label: '道岔命令'},
|
||||
/** 引导总锁 */
|
||||
CMD_SWITCH_MASTER_LOCK: {value:'Switch_Master_Lock', label: '设置引导总锁' },
|
||||
/** 取消引导总锁 */
|
||||
CMD_SWITCH_MASTER_UNBLOCK: {value: 'Switch_Master_Unblock', label: '取消引导总锁'}
|
||||
},
|
||||
|
||||
// 控制模式操作
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import { sendSimulationCommand } from '@/api/rtSimulation';
|
||||
import router from '@/router/index';
|
||||
import store from '@/store/index';
|
||||
import Command from './Command';
|
||||
import Handler from './Handler';
|
||||
|
||||
@ -96,11 +98,22 @@ class CommandHandle {
|
||||
execute(id, command) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const group = router.currentRoute.query.group;
|
||||
sendCommandNew(group, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
const newApi = router.currentRoute.query.newApi + '';
|
||||
if (newApi === 'true') {
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
sendSimulationCommand(group, userInfo.memberId, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
} else {
|
||||
sendCommandNew(group, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1106,6 +1106,14 @@ export const OperationEvent = {
|
||||
button: {
|
||||
operation: '1190',
|
||||
domId: '_Tips-Switch-GuideLock-Button{TOP}'
|
||||
},
|
||||
leftButton: {
|
||||
operation: '1191',
|
||||
domId: '_Tips-Switch-GuideLock-LeftButton{TOP}'
|
||||
},
|
||||
rightButton: {
|
||||
operation: '1192',
|
||||
domId: '_Tips-Switch-GuideLock-RightButton{TOP}'
|
||||
}
|
||||
},
|
||||
// 挤岔恢复
|
||||
@ -1406,6 +1414,10 @@ export const OperationEvent = {
|
||||
secondaryConfirm: {
|
||||
operation: '3065',
|
||||
domId: '_Tips-Signal-Lock-SecondaryConfirm'
|
||||
},
|
||||
initMenu: {
|
||||
operation: '3066',
|
||||
domId: '_Tips-Signal-Lock-InitMenu'
|
||||
}
|
||||
},
|
||||
// 解锁
|
||||
|
@ -244,7 +244,8 @@ const map = {
|
||||
keyboardEnterCount: 0, // 键盘enter键触发
|
||||
controlTransfer:[], // 控制权转移消息
|
||||
mapDataParseCount: 0,
|
||||
foldLineMap: {} // 现地折行线map数据
|
||||
foldLineMap: {}, // 现地折行线map数据
|
||||
clearButtonCount: 0 // 清除操作按钮计数器
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -937,6 +938,9 @@ const map = {
|
||||
},
|
||||
mapDataParseCountIncrease: (state) => {
|
||||
state.mapDataLoadedCount += 1;
|
||||
},
|
||||
initSimulationButton: (state) => {
|
||||
state.clearButtonCount += 1;
|
||||
}
|
||||
},
|
||||
|
||||
@ -1154,6 +1158,9 @@ const map = {
|
||||
},
|
||||
mapDataParseCountIncrease: ({ commit }) => {
|
||||
commit('mapDataParseCountIncrease');
|
||||
},
|
||||
initSimulationButton: ({ commit }) => {
|
||||
commit('initSimulationButton');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,31 @@
|
||||
import store from '@/store/index';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handleSockInfo(state, msg, type) {
|
||||
switch (type) {
|
||||
case 'ats':
|
||||
state.deviceStateMessages = msg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handleSimulationStateMsg(state, type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
state.simulationPause = true;
|
||||
store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
break;
|
||||
case 1:
|
||||
store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
state.simulationPause = false;
|
||||
break;
|
||||
case 4:
|
||||
state.simulationError++;
|
||||
break;
|
||||
case 7:
|
||||
state.simulationOver++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handle(state, data) {
|
||||
// console.log(data, 'socket订阅');
|
||||
const msg = data.body;
|
||||
@ -305,7 +330,10 @@ const socket = {
|
||||
LPFstrategy:[], // 北交大 大客流 推荐策略
|
||||
isFirst:false, // 第一次是否已经订阅
|
||||
competitionPracticeFinish:0, // 竞赛场景结束标识
|
||||
simulationAlarmInfo: [] // 仿真报警信息
|
||||
simulationAlarmInfo: [], // 仿真报警信息
|
||||
deviceStateMessages: null, // 新版订阅设备状态消息
|
||||
simulationSpeed: 1, // 仿真倍速
|
||||
simulationPause: false
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
@ -326,6 +354,10 @@ const socket = {
|
||||
state.equipmentStatus = equipmentStatus;
|
||||
},
|
||||
|
||||
setDeviceStateMessages: (state, deviceStateMessages) => {
|
||||
state.deviceStateMessages = deviceStateMessages;
|
||||
},
|
||||
|
||||
setTrainStationList: (state, trainStationList) => {
|
||||
state.trainStationList = trainStationList;
|
||||
},
|
||||
@ -372,6 +404,12 @@ const socket = {
|
||||
},
|
||||
clearSimulationRoleList: (state)=>{
|
||||
state.simulationRoleList = [];
|
||||
},
|
||||
setSimulationTimeSync: (state, time) => {
|
||||
state.simulationTimeSync = time;
|
||||
},
|
||||
setSimulationSpeed: (state, speed) => {
|
||||
state.simulationSpeed = speed;
|
||||
}
|
||||
},
|
||||
|
||||
@ -379,7 +417,15 @@ const socket = {
|
||||
setStomp: ({ state }, res) => {
|
||||
handle(state, res);
|
||||
},
|
||||
|
||||
handleSock: ({ state }, data) => {
|
||||
handleSockInfo(state, data.res, data.type);
|
||||
},
|
||||
handleSimulationState: ({ state }, data) => {
|
||||
handleSimulationStateMsg(state, data);
|
||||
},
|
||||
setSimulationSpeed: ({ commit }, speed) => {
|
||||
commit('setSimulationSpeed', speed);
|
||||
},
|
||||
setChatContent: ({ commit }, chatContent) => {
|
||||
commit('setChatContent', chatContent);
|
||||
},
|
||||
@ -396,6 +442,10 @@ const socket = {
|
||||
commit('setEquipmentStatus', []);
|
||||
},
|
||||
|
||||
setDeviceStateMessages: ({ commit }) => {
|
||||
commit('setDeviceStateMessages', null);
|
||||
},
|
||||
|
||||
setTrainStationList: ({ commit }) => {
|
||||
commit('setTrainStationList', []);
|
||||
},
|
||||
@ -442,6 +492,9 @@ const socket = {
|
||||
},
|
||||
clearSimulationRoleList:({ commit }) => {
|
||||
commit('clearSimulationRoleList');
|
||||
},
|
||||
setSimulationTimeSync:({ commit }, time) => {
|
||||
commit('setSimulationTimeSync', time);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -532,7 +532,6 @@ const training = {
|
||||
updateMapState: ({ commit }, deviceStatus) => {
|
||||
commit('updateMapState', deviceStatus);
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始教学模式
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user