Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
4edd31f699
@ -1,179 +0,0 @@
|
||||
//import request from '@/utils/request';
|
||||
|
||||
export function getmodels(data) {
|
||||
let postmap = {
|
||||
id:data.mapdata.id,
|
||||
mapId:data.mapdata.mapId,
|
||||
assets:"null",
|
||||
sections:"null",
|
||||
signals:"null",
|
||||
trains:"null",
|
||||
stands:"null",
|
||||
switchs:"null"
|
||||
};
|
||||
|
||||
if(data.mapdata.sectionlist.sections== undefined){
|
||||
return postmap;
|
||||
}
|
||||
|
||||
|
||||
if(data == undefined){
|
||||
|
||||
return postmap;
|
||||
}else{
|
||||
//资源
|
||||
let assets = [];
|
||||
for(let i=0;i<data.assetloader.modellist.length;i++){
|
||||
let asset = {
|
||||
id:data.assetloader.modellist[i].id,
|
||||
name:data.assetloader.modellist[i].name,
|
||||
deviceType:data.assetloader.modellist[i].deviceType,
|
||||
type:data.assetloader.modellist[i].type,
|
||||
assetUrl:data.assetloader.modellist[i].assetUrl
|
||||
}
|
||||
assets.push(asset);
|
||||
}
|
||||
|
||||
postmap.assets = JSON.stringify(assets);
|
||||
|
||||
//link轨道
|
||||
let links = [];
|
||||
for(let i=0;i<data.mapdata.linklist.linksgroup.children.length;i++){
|
||||
let link = {
|
||||
uuid:data.mapdata.linklist.linksgroup.children[i].uuid,
|
||||
code:data.mapdata.linklist.linksgroup.children[i].code,
|
||||
name:data.mapdata.linklist.linksgroup.children[i].name,
|
||||
lengthfact:data.mapdata.linklist.linksgroup.children[i].lengthfact,
|
||||
position:data.mapdata.linklist.linksgroup.children[i].position,
|
||||
rotation:data.mapdata.linklist.linksgroup.children[i].rotation,
|
||||
scale:data.mapdata.linklist.linksgroup.children[i].scale,
|
||||
rightlist:data.mapdata.linklist.linksgroup.children[i].rightlist,
|
||||
leftlist:data.mapdata.linklist.linksgroup.children[i].leftlist,
|
||||
lp:data.mapdata.linklist.linksgroup.children[i].lp,
|
||||
rp:data.mapdata.linklist.linksgroup.children[i].rp,
|
||||
rail:data.mapdata.linklist.linksgroup.children[i].rail,
|
||||
}
|
||||
links.push(link);
|
||||
}
|
||||
// postmap.sections.link = JSON.stringify(links);
|
||||
|
||||
//section隧道
|
||||
let sections = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.sectionlist.sections.datalist.length;i++){
|
||||
let section = {
|
||||
uuid:data.mapdata.sectionlist.sections.modellist[i].uuid,
|
||||
code:data.mapdata.sectionlist.sections.modellist[i].code,
|
||||
name:data.mapdata.sectionlist.sections.modellist[i].name,
|
||||
lengthfact:data.mapdata.sectionlist.sections.modellist[i].lengthfact,
|
||||
isStandTrack:data.mapdata.sectionlist.sections.modellist[i].isStandTrack,
|
||||
relStandCode:data.mapdata.sectionlist.sections.datalist[i].relStandCode,
|
||||
linkCode:data.mapdata.sectionlist.sections.datalist[i].linkCode,
|
||||
rightlist:data.mapdata.sectionlist.sections.modellist[i].rightlist,
|
||||
leftlist:data.mapdata.sectionlist.sections.modellist[i].leftlist,
|
||||
rightpoint:data.mapdata.sectionlist.sections.modellist[i].rightpoint,
|
||||
leftpoint:data.mapdata.sectionlist.sections.modellist[i].leftpoint,
|
||||
rail:data.mapdata.sectionlist.sections.modellist[i].rail,
|
||||
position:data.mapdata.sectionlist.sections.modellist[i].position,
|
||||
rotation:data.mapdata.sectionlist.sections.modellist[i].rotation,
|
||||
scale:data.mapdata.sectionlist.sections.modellist[i].scale
|
||||
}
|
||||
|
||||
// testmesh1.position.z = link.position.z;
|
||||
|
||||
sections.push(section);
|
||||
}
|
||||
console.log(links);
|
||||
let arrray = {
|
||||
link:links,
|
||||
section:sections,
|
||||
};
|
||||
postmap.sections = JSON.stringify(arrray);
|
||||
//道岔
|
||||
let switchs = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.sectionlist.switchs.modellist.length;i++){
|
||||
let switcha = {
|
||||
uuid:data.mapdata.sectionlist.switchs.modellist[i].uuid,
|
||||
code:data.mapdata.sectionlist.switchs.datalist[i].code,
|
||||
name:data.mapdata.sectionlist.switchs.datalist[i].name,
|
||||
alink:data.mapdata.sectionlist.switchs.datalist[i].alink,
|
||||
blink:data.mapdata.sectionlist.switchs.datalist[i].blink,
|
||||
clink:data.mapdata.sectionlist.switchs.datalist[i].clink,
|
||||
paname:data.mapdata.sectionlist.switchs.datalist[i].paname,
|
||||
pbname:data.mapdata.sectionlist.switchs.datalist[i].pbname,
|
||||
pcname:data.mapdata.sectionlist.switchs.datalist[i].pcname,
|
||||
pa:data.mapdata.sectionlist.switchs.datalist[i].pa,
|
||||
pb:data.mapdata.sectionlist.switchs.datalist[i].pb,
|
||||
pc:data.mapdata.sectionlist.switchs.datalist[i].pc,
|
||||
position:data.mapdata.sectionlist.switchs.modellist[i].position,
|
||||
rotation:data.mapdata.sectionlist.switchs.modellist[i].rotation,
|
||||
scale:data.mapdata.sectionlist.switchs.modellist[i].scale
|
||||
}
|
||||
switchs.push(switcha);
|
||||
}
|
||||
postmap.switchs = JSON.stringify(switchs);
|
||||
//信号
|
||||
let signals = [];
|
||||
for(let i=0;i<data.mapdata.signallist.list.length;i++){
|
||||
|
||||
|
||||
let signal = {
|
||||
uuid:data.mapdata.signallist.list[i].mesh.uuid,
|
||||
name:data.mapdata.signallist.list[i].mesh.name,
|
||||
modelid:data.mapdata.signallist.list[i].mesh.modelid,
|
||||
code:data.mapdata.signallist.list[i].mesh.code,
|
||||
position:data.mapdata.signallist.list[i].mesh.position,
|
||||
rotation:data.mapdata.signallist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.signallist.list[i].mesh.scale,
|
||||
virtual:data.mapdata.signallist.list[i].mesh.virtual
|
||||
}
|
||||
|
||||
signals.push(signal);
|
||||
}
|
||||
postmap.signals = JSON.stringify(signals);
|
||||
//车站
|
||||
let stands = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
|
||||
let station = {
|
||||
uuid:data.mapdata.stationstandlist.list[i].uuid,
|
||||
code:data.mapdata.stationstandlist.list[i].code,
|
||||
name:data.mapdata.stationstandlist.list[i].name,
|
||||
modelid:data.mapdata.stationstandlist.list[i].modelid,
|
||||
position:data.mapdata.stationstandlist.list[i].mesh.position,
|
||||
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
|
||||
direction1:{
|
||||
name:data.mapdata.stationstandlist.list[i].direction1.name,
|
||||
code:null
|
||||
},
|
||||
direction2:{
|
||||
name:data.mapdata.stationstandlist.list[i].direction2.name,
|
||||
code:null
|
||||
}
|
||||
}
|
||||
stands.push(station);
|
||||
}
|
||||
postmap.stands = JSON.stringify(stands);
|
||||
//列车
|
||||
let trains = [];
|
||||
for(let i=0;i<data.assetloader.modellist.length;i++){
|
||||
if(data.assetloader.modellist[i].deviceType == "train"){
|
||||
let train = {
|
||||
id:data.assetloader.modellist[i].id,
|
||||
name:data.assetloader.modellist[i].name,
|
||||
deviceType:data.assetloader.modellist[i].deviceType,
|
||||
type:data.assetloader.modellist[i].type,
|
||||
assetUrl:data.assetloader.modellist[i].assetUrl
|
||||
}
|
||||
|
||||
trains.push(train);
|
||||
}
|
||||
}
|
||||
postmap.trains = JSON.stringify(trains);
|
||||
|
||||
return postmap;
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取路径单元列表*/
|
||||
export function getmodels(data) {
|
||||
return request({
|
||||
url: 'http://192.168.3.23:1337/model_load',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
@ -10,7 +10,6 @@ import {SwitchList} from '@/jlmap3d/edit/testEditorModel/SwitchList.js';
|
||||
import {RailList} from '@/jlmap3d/edit/testEditorModel/RailList.js';
|
||||
|
||||
import axios from 'axios';
|
||||
import {getmodels} from '@/jlmap3d/edit/connect/getmodels';
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
|
@ -206,29 +206,15 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
});
|
||||
}
|
||||
}
|
||||
let changeelement = document.getElementById('jl3d');
|
||||
window.addEventListener('resize', () =>
|
||||
onresize()
|
||||
, false)
|
||||
let onresize = function () {
|
||||
|
||||
window.onresize = function () {
|
||||
|
||||
// if(scope.windowstatus){
|
||||
// changeelement.style.width = '50%';
|
||||
// changeelement.style.height = '50%';
|
||||
// changeelement.style.top = '25%';
|
||||
// scope.windowstatus = false;
|
||||
// scope.updatewindowstatus('0');
|
||||
// }else{
|
||||
scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight;
|
||||
scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight;
|
||||
scope.camera.updateProjectionMatrix();
|
||||
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
|
||||
|
||||
if(scope.windowstatus == "0"){
|
||||
let changeelement = document.getElementById('jl3d');
|
||||
changeelement.style.width = '100%';
|
||||
changeelement.style.height = '100%';
|
||||
changeelement.style.top = '0';
|
||||
scope.camera.aspect = window.innerWidth / scope.dom.offsetHeight;
|
||||
scope.camera.updateProjectionMatrix();
|
||||
scope.renderer.setSize(window.innerWidth, scope.dom.offsetHeight);
|
||||
}
|
||||
scope.renderer.setSize(changeelement.offsetWidth, changeelement.offsetHeight);
|
||||
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
// console.log(data);
|
||||
|
||||
if(data.type == "Train_Position"){
|
||||
|
||||
nowTrainRun(data.body);
|
||||
return;
|
||||
}
|
||||
|
@ -73,6 +73,10 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
|
||||
// jl3d.updateNowLeaveData("down",data.body.out);
|
||||
// }
|
||||
}
|
||||
|
||||
if(data.type == "TRAIN_PIS"){
|
||||
console.log(data);
|
||||
}
|
||||
if(data.type == "TRAIN_PFI_NUM"){
|
||||
|
||||
trafficTrain.trainList = [];
|
||||
|
@ -171,6 +171,8 @@ export function PasserHuman() {
|
||||
// console.log(inPasser);
|
||||
// console.log(outPasser);
|
||||
// let outPassers = inNum[scope.nowTrunk].num;
|
||||
console.log(inNum);
|
||||
console.log(leaveNum);
|
||||
let created = 0;
|
||||
for(let i=0;i<outPasser.length;i++){
|
||||
for(let j=0;j<outPasser[i];j++){
|
||||
@ -187,7 +189,7 @@ export function PasserHuman() {
|
||||
for(let j=0;j<inPasser[i];j++){
|
||||
setTimeout(function(){
|
||||
scope.createInPasser(humanlist,direct);
|
||||
}, Math.random()*1000*i);
|
||||
}, 2000+Math.random()*1000*j);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ class EStationText extends Group {
|
||||
create() {
|
||||
const model = this.model.modelData;
|
||||
const style = this.model.style;
|
||||
|
||||
// 车站名称
|
||||
this.stationName = new Text({
|
||||
zlevel: this.model.zlevel,
|
||||
@ -32,7 +31,7 @@ class EStationText extends Group {
|
||||
textBorderWidth:style.Station.stationText.textBorderWidth
|
||||
}
|
||||
});
|
||||
this.add(this.stationName);
|
||||
model.visible && this.add(this.stationName);
|
||||
if (model.subheadDisplay) { // 副标题
|
||||
this.subheadText = new Text({
|
||||
zlevel: this.model.zlevel,
|
||||
|
@ -13,7 +13,7 @@ import Text from 'zrender/src/graphic/Text';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
|
||||
import EStationText from './EStationText';
|
||||
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
|
||||
import { traverseLineElements } from '../utils/ShapeStatusCovert';
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
@ -39,9 +39,9 @@ export default class Station extends Group {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
// // 站台所有的绘图元素
|
||||
// 站台所有的绘图元素
|
||||
const elementTypeList = {
|
||||
'stationText':EStationText // 车站名称 (普通站台样式)
|
||||
'stationText': EStationText // 车站名称 (普通站台样式)
|
||||
};
|
||||
|
||||
// 遍历当前线路下的绘图元素 组合模式
|
||||
@ -74,7 +74,7 @@ export default class Station extends Group {
|
||||
textFill: model.kmPostFontColor
|
||||
});
|
||||
this.add(this.mileageText);
|
||||
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
model.visible && model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
}
|
||||
|
||||
// if (!model.visible) { // 隐藏车站
|
||||
@ -466,7 +466,7 @@ export default class Station extends Group {
|
||||
item.show();
|
||||
});
|
||||
if (this.mileageText) {
|
||||
this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
this.model.visible && this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
}
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
|
@ -70,7 +70,7 @@ export const loginInfo = {
|
||||
systemType: '011'
|
||||
},
|
||||
drts: {
|
||||
title: '行车调度员实训系统国赛备战版',
|
||||
title: '2020年“新誉杯”全国行车调度员大赛训练系统',
|
||||
loginPath: '/login?project=drts',
|
||||
loginParam: 'DRTS',
|
||||
loginTitle: '空串',
|
||||
|
@ -4,7 +4,7 @@
|
||||
</Jl3ddevice-Msg>
|
||||
<Jl3ddevice-List v-show="isswitch" :devicelist="devicelist" @sdevice="sdevice">
|
||||
</Jl3ddevice-List>
|
||||
<canvas id="canvastexture" />
|
||||
<canvas id="canvastexture" ></canvas>
|
||||
<div class="jl3dcontrolpane" v-show="isswitch">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="back">初始化</el-button>
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
<div id="jl3dwindow" v-show="isPsd" class="windowbutton"
|
||||
:style="{'background-image': 'url('+localStatic+'/texture/fk.png)'}"
|
||||
@click="windowchange"></div
|
||||
@click="windowchange"></div>
|
||||
|
||||
<div id="jl3dclose" v-show="isPsd" class="backbutton"
|
||||
:style="{'background-image': 'url('+localStatic+'/texture/xx.png)'}"
|
||||
|
@ -11,16 +11,6 @@
|
||||
<img class="logo" :src="logoImg" :style="{width: logoWidth}">
|
||||
<span>{{ loginTitle==='空串'?'':loginTitle }}</span>
|
||||
</div>
|
||||
<div v-if="project === 'drts' && !gameOver" class="drts_title">
|
||||
<div style="display: inline-block;">距离2020年“新誉杯”全国城市轨道交通行业职业技能竞赛还剩</div>
|
||||
<div class="countdown_box">{{ days[0] }}</div>
|
||||
<div class="countdown_box">{{ days[1] }}</div>
|
||||
<div class="countdown_box">{{ days[2] }}</div>
|
||||
<div style="display: inline-block;">天</div>
|
||||
</div>
|
||||
<div v-else-if="project === 'drts' && gameOver" style="position: absolute; top: 100px;font-size: 50px;color:#F00;">
|
||||
<div style="display: inline-block;">全国调度大赛已结束</div>
|
||||
</div>
|
||||
<div v-if="!syncLogin" class="language_box">
|
||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
@ -111,13 +101,6 @@
|
||||
</div>
|
||||
<float-part v-if="isProject && !versionBaseNoShow.includes(project)" />
|
||||
<div v-if="!mainBodyNoShow.includes(project)" style="position: absolute; bottom: 10px;right: 20px; font-size: 14px;"><span>主体:北京玖琏科技有限公司 备案号:京ICP备18028522号</span></div>
|
||||
<div v-if="project === 'drts'" class="drts_explain">
|
||||
<div>郑重承诺:满足用户的一切技术需求!新地图上线三周!新需求两周完成!新BUG两天修复!</div>
|
||||
<div style="width: 300px;justify-content:space-between;display: flex;margin:0 auto;margin-top: 30px;">
|
||||
<div style="display: inline-block;">备战国赛</div>
|
||||
<div style="display: inline-block;">免费使用</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="project === 'drts'" style="position: absolute; bottom: 50px; font-size: 20px;right: 20px;color:#3D3D3D;width: 370px;">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
@ -213,9 +196,7 @@ export default {
|
||||
versionBaseNoShow: VersionBaseNoShow,
|
||||
mainBodyNoShow: MainBodyNoShow,
|
||||
noQrcodeList: NoQrcodeList,
|
||||
expirationDate: 1606784400000,
|
||||
countdown: null,
|
||||
days: [0, 0, 0],
|
||||
gameOver: false,
|
||||
wchatImg: wchat,
|
||||
handRight: HandRight
|
||||
@ -319,12 +300,6 @@ export default {
|
||||
if (this.syncLogin || !this.project.endsWith('heb')) {
|
||||
this.loginRefresh();
|
||||
}
|
||||
if (this.project === 'drts') {
|
||||
this.getDaysTime();
|
||||
this.countdown = setInterval(()=>{
|
||||
this.getDaysTime();
|
||||
}, 24 * 60 * 60 * 1000);
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.countdown && clearInterval(this.countdown);
|
||||
@ -567,18 +542,6 @@ export default {
|
||||
this.$i18n.locale = this.lang;
|
||||
LangStorage.setLang(this.lang);
|
||||
},
|
||||
getDaysTime() {
|
||||
const nowTime = Date.parse(new Date());
|
||||
this.days = []; this.hours = []; this.minutes = []; this.seconds = [];
|
||||
const difference = this.expirationDate - nowTime;
|
||||
if (difference <= 0) {
|
||||
this.gameOver = true;
|
||||
}
|
||||
const day = Math.ceil(difference / (24 * 60 * 60 * 1000));
|
||||
this.days.push(Math.floor(day / 100));
|
||||
this.days.push(Math.floor((day % 100) / 10));
|
||||
this.days.push(day % 10);
|
||||
},
|
||||
goCompetitionRules(val) {
|
||||
if (val === '1') {
|
||||
window.open('https://mp.weixin.qq.com/s?__biz=MzI3NzMwODY3OQ==&mid=2247506304&idx=1&sn=77708ca228404cee2b28e131cdfb9735&chksm=eb6aade8dc1d24fe6eb9f1334aadda239f47dafc79de7d522e0f3f00e2d3ba1dd213dda6764c&xtrack=1&scene=90&subscene=93&sessionid=1598522875&clicktime=1598523062&enterid=1598523062&ascene=56&devicetype=android-29&version=3.0.27.2701&nettype=WIFI&abtest_cookie=AAACAA%3D%3D&lang=zh_CN&exportkey=AQZ2cTPSob%2B5kBDiWnKw0Js%3D&pass_ticket=12Xyhe%2BbZsC9Vuzfs0iYUUn0i%2Br5JlZiOGCxWoExuthBhnIrpkmUyjVRi6bjyA1I&wx_header=1&platform=win', '_blank');
|
||||
|
@ -28,7 +28,8 @@
|
||||
</el-button-group>
|
||||
</div>
|
||||
<Jl3d-Device
|
||||
v-if="deviceShow"
|
||||
v-if="deviceif"
|
||||
v-show="deviceShow"
|
||||
ref="Jl3dDevice"
|
||||
:panel-show="deviceShow"
|
||||
@closedevice3dview="jumpjlmap3dmodel"
|
||||
@ -113,7 +114,8 @@ export default {
|
||||
mapId:'',
|
||||
lineCode:'',
|
||||
practiceDisabled:false,
|
||||
deviceShow: false,
|
||||
deviceif:false,
|
||||
deviceShow: true,
|
||||
drivingShow: false,
|
||||
jl3dtrafficplan:this.$t('display.demon.trafficplantext'),
|
||||
jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
|
||||
@ -159,11 +161,16 @@ export default {
|
||||
}
|
||||
},
|
||||
jumpjlmap3dmodel() {
|
||||
if(this.deviceif == false){
|
||||
this.deviceif = true;
|
||||
}else{
|
||||
if (this.deviceShow == false) {
|
||||
this.deviceShow = true;
|
||||
} else {
|
||||
this.deviceShow = false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
showdriving() {
|
||||
this.drivingShow = false;
|
||||
|
@ -50,7 +50,8 @@
|
||||
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
|
||||
<add-member ref="addMember" />
|
||||
<Jl3d-Device
|
||||
v-if="deviceShow"
|
||||
v-if="deviceif"
|
||||
v-show="deviceShow"
|
||||
ref="Jl3dDevice"
|
||||
:panel-show="deviceShow"
|
||||
@closedevice3dview="devicemodel"
|
||||
@ -124,7 +125,8 @@ export default {
|
||||
mapViewLoadedOver: false,
|
||||
dataError: false,
|
||||
isAdmin: false,
|
||||
deviceShow: false,
|
||||
deviceif:false,
|
||||
deviceShow: true,
|
||||
centralizedStationMap: {}
|
||||
};
|
||||
},
|
||||
@ -175,7 +177,8 @@ export default {
|
||||
this.showSelectStation && this.setShowStation(this.showStation);
|
||||
// this.initMemberUserInfo();
|
||||
if (this.$route.query.type === 'VR_PSD') {
|
||||
this.deviceShow = true;
|
||||
this.deviceif = true;
|
||||
this.deviceShow = false;
|
||||
}
|
||||
if (this.$route.query.type === 'DRIVE') {
|
||||
this.$store.dispatch('training/setPrdType', '04');
|
||||
@ -292,11 +295,16 @@ export default {
|
||||
// });
|
||||
// },
|
||||
devicemodel() {
|
||||
if(this.deviceif == false){
|
||||
this.deviceif = true;
|
||||
}else{
|
||||
if (this.deviceShow == false) {
|
||||
this.deviceShow = true;
|
||||
} else {
|
||||
this.deviceShow = false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
/* 地图根据仿真group获取仿真基础信息 */
|
||||
async loadSimulationInfo() {
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Resource"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -162,6 +163,9 @@ export default {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.$refs.make && this.$refs.make.resetFields();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Arrow"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -139,6 +140,9 @@ export default {
|
||||
clear() {
|
||||
this.addModel = getModel('Arrow');
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
create() {
|
||||
const model = deepAssign(this.addModel, {code:getUID('Arrow', this.arrowList)});
|
||||
this.$emit('updateMapModel', model);
|
||||
|
@ -51,6 +51,7 @@ export default {
|
||||
data.content = `${this.editModel.prepend}::${this.editModel.content}`;
|
||||
}
|
||||
this.$emit('updateMapModel', data);
|
||||
this.$emit('clearDeviceSelect');
|
||||
} else {
|
||||
this.$message('还有属性未填写,修改未生效!');
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
:type="editModel.type"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -228,6 +229,9 @@ export default {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
handleIndicatorLightList(indicatorLightList) {
|
||||
this.atsControlList = [];
|
||||
this.centerCommunicationList = [];
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Counter"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -162,6 +163,9 @@ export default {
|
||||
this.addModel.stationCode = selected.code;
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
create() {
|
||||
const uid = getUID('Counter', this.counterList);
|
||||
const model = {
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="DelayUnlock"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -148,6 +149,9 @@ export default {
|
||||
deviceChange(code) {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Resource"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -200,6 +201,9 @@ export default {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
if (this.field) {
|
||||
@ -229,8 +233,8 @@ export default {
|
||||
},
|
||||
updateMapModel(data) {
|
||||
data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`;
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Esp"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -109,6 +110,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
// this.edit();
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
if (this.field) {
|
||||
@ -163,8 +167,8 @@ export default {
|
||||
}
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Resource"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -143,6 +144,9 @@ export default {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.$refs.make && this.$refs.make.resetFields();
|
||||
|
@ -3,10 +3,12 @@
|
||||
<div class="map-control">
|
||||
<div class="border-card">
|
||||
<div class="map-operate">
|
||||
<span>
|
||||
{{ $t('map.mapName') }}
|
||||
<b>{{ mapInfo.name }}</b>
|
||||
</span>
|
||||
<div style="float: left;width: 280px;overflow: hidden;height: 17px;text-overflow: ellipsis;white-space: nowrap;">
|
||||
<span>{{ $t('map.mapName') }}</span>
|
||||
<el-tooltip class="item" effect="dark" :content="mapInfo.name" placement="top">
|
||||
<b>{{ mapInfo.name }}</b>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<el-button v-if="isSave" type="text" style="float: right; padding: 3px 0" :disabled="$attrs.mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
|
||||
<el-dropdown class="operate-button" trigger="click">
|
||||
<span class="el-dropdown-link">数据操作</span>
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="LcControl"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -142,6 +143,9 @@ export default {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.$refs.make && this.$refs.make.resetFields();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Line"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -149,6 +150,9 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="OutFrame"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -156,6 +157,9 @@ export default {
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
addPoint(index) {
|
||||
const data = { x: 0, y: 0 };
|
||||
this.editModel.points.splice(index + 1, 0, data);
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Power"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="tabClick"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -324,8 +325,8 @@ export default {
|
||||
} else {
|
||||
delete data.sectionUnitList;
|
||||
}
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
deleteObj() {
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Psd"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -200,6 +201,9 @@ export default {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
@ -235,8 +239,8 @@ export default {
|
||||
this.$refs.createForm.resetForm();
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
},
|
||||
// 批量设置
|
||||
batchSettings() {
|
||||
|
@ -3,12 +3,6 @@
|
||||
<el-collapse v-model="activeName" accordion style="margin-left: 20px">
|
||||
<el-collapse-item title="左右停车点偏移" name="1">
|
||||
<el-form label-width="200px" size="mini">
|
||||
<!-- <el-form-item :label="$t('map.leftStopPointOffsetFromStart')" prop="leftDistance">
|
||||
<el-input-number v-model="form.leftDistance" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.rightStopPointOffsetFromTerminal')" prop="rightDistance">
|
||||
<el-input-number v-model="form.rightDistance" :min="0" />
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" size="small" @click="batchSettings">{{ $t('global.set') }}</el-button>
|
||||
@ -103,6 +97,34 @@
|
||||
<el-button style="margin-left: 150px" type="primary" size="small" @click="setSwitchSectionName">设置</el-button>
|
||||
</el-button-group>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="批量删除区段左右元素" name="7">
|
||||
<el-form ref="fromModel" :model="fromModel" label-width="150px" size="mini" :rules="roadRules">
|
||||
<el-form-item label="区段:" prop="sectionCode">
|
||||
<el-select v-model="fromModel.sectionCode" filterable>
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code + ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="field === 'sectiondeleteCode' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('sectiondeleteCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="线路类型">
|
||||
<el-radio v-model="fromModel.right" :label="true">右边删除</el-radio>
|
||||
<el-radio v-model="fromModel.right" :label="false">左边删除</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" size="small" @click="handleAllDelete">删除</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</template>
|
||||
@ -124,10 +146,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
activeName: '',
|
||||
// form: {
|
||||
// leftDistance: 0,
|
||||
// rightDistance: 0
|
||||
// },
|
||||
formModel: {
|
||||
modelList: [],
|
||||
trainPosType: ''
|
||||
@ -136,6 +154,10 @@ export default {
|
||||
roadType: null,
|
||||
sectionCode: ''
|
||||
},
|
||||
fromModel: {
|
||||
sectionCode: '',
|
||||
right: false
|
||||
},
|
||||
positionTypes: [
|
||||
{ name: '上方', type: '01' },
|
||||
{ name: '下方', type: '02' }
|
||||
@ -332,6 +354,162 @@ export default {
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.$message.success('道岔区段设置成功!');
|
||||
},
|
||||
handleAllDelete() {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.fromModel.sectionCode);
|
||||
const index = this.fromModel.right ? section.points.length - 1 : 0;
|
||||
const pointX = section.points[index].x;
|
||||
const map = this.$store.state.map.map;
|
||||
const models = [];
|
||||
map.sectionList.forEach(item => {
|
||||
if (item.type == '04') {
|
||||
const flag = this.fromModel.right ? item.namePosition.x >= pointX : item.namePosition.x < pointX;
|
||||
if (flag) {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
} else {
|
||||
const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX;
|
||||
if (flag) {
|
||||
if (item.type == '03') {
|
||||
const switchModel = this.$store.getters['map/getDeviceByCode'](item.relSwitchCode);
|
||||
switchModel && models.push(deepAssign(switchModel, { _dispose: true }));
|
||||
}
|
||||
if (item.type == '02') {
|
||||
const parentModel = this.$store.getters['map/getDeviceByCode'](item.parentCode);
|
||||
parentModel && models.push(deepAssign(parentModel, { _dispose: true }));
|
||||
}
|
||||
if (item.type == '01') {
|
||||
item.logicSectionCodeList && item.logicSectionCodeList.forEach(code => {
|
||||
const childModel = this.$store.getters['map/getDeviceByCode'](code);
|
||||
childModel && models.push(deepAssign(childModel, { _dispose: true }));
|
||||
});
|
||||
}
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
}
|
||||
});
|
||||
map.lineList && map.lineList.forEach(item => {
|
||||
const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX;
|
||||
if (flag) {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
map.trainWindowList && map.trainWindowList.forEach(item => {
|
||||
const flag = this.fromModel.right ? item.point.x > pointX : item.point.x < pointX;
|
||||
if (flag) {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
map.powerLineList && map.powerLineList.forEach(item => {
|
||||
const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX;
|
||||
if (flag) {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
const arrList = ['signalList', 'stationList', 'stationStandList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList', 'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList'];
|
||||
arrList.forEach(itemName => {
|
||||
map[itemName] && map[itemName].forEach(item => {
|
||||
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
if (flag) {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
});
|
||||
// map.signalList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// map.stationList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// map.stationStandList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// const esp = map.espList.find(ele => ele.standCode == item.code);
|
||||
// esp && models.push(deepAssign(esp, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// map.psdList && map.psdList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 计轴复位列表
|
||||
// map.axleCounterResetButtonList && map.axleCounterResetButtonList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // GQX折返:变通
|
||||
// map.tbStrategyList && map.tbStrategyList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// map.zcList && map.zcList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 折返按钮列表
|
||||
// map.cycleButtonList && map.cycleButtonList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 引导总锁列表
|
||||
// map.totalGuideLockButtonVOList && map.totalGuideLockButtonVOList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 自动进路
|
||||
// map.automaticRouteButtonList && map.automaticRouteButtonList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 矩形框
|
||||
// map.outerFrameList && map.outerFrameList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// // 方向杆列表
|
||||
// map.directionRodList && map.directionRodList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
// map.textList && map.textList.forEach(item => {
|
||||
// const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
|
||||
// if (flag) {
|
||||
// models.push(deepAssign(item, { _dispose: true }));
|
||||
// }
|
||||
// });
|
||||
if (this.fromModel.right && section.rightSectionCode) {
|
||||
section.rightSectionCode = '';
|
||||
}
|
||||
if (!this.fromModel.right && section.leftSectionCode) {
|
||||
section.leftSectionCode = '';
|
||||
}
|
||||
models.push(deepAssign(section, { _type: 'Section' }));
|
||||
this.$emit('updateMapModel', models);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -465,6 +465,9 @@ export default {
|
||||
} else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) {
|
||||
this.$refs.batchSettings.roadModel.sectionCode = selected.code;
|
||||
this.activeName = 'five';
|
||||
} else if (this.field.toUpperCase() === 'sectiondeleteCode'.toUpperCase()) {
|
||||
this.$refs.batchSettings.fromModel.sectionCode = selected.code;
|
||||
this.activeName = 'five';
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -677,6 +680,15 @@ export default {
|
||||
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](selected.trainWindowCode);
|
||||
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
|
||||
const deleteObjAssociatedSection = this.handleDeleteSectionAssociatedSection(selected);
|
||||
if (selected.type == '01') {
|
||||
selected.logicSectionCodeList && selected.logicSectionCodeList.forEach(code => {
|
||||
const selectedLocl = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (selectedLocl) {
|
||||
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](selectedLocl.trainWindowCode);
|
||||
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
}
|
||||
models = [...models, ...deleteObjAssociatedSection];
|
||||
this.$emit('updateMapModel', models);
|
||||
this.clear();
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Signal"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -424,6 +425,9 @@ export default {
|
||||
this.field = field == this.field ? '' : field;
|
||||
this.signalSectionCode(this.field);
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
@ -472,8 +476,8 @@ export default {
|
||||
}
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
},
|
||||
signalSectionCode(field) {
|
||||
this.field = field;
|
||||
|
@ -161,13 +161,15 @@ export default {
|
||||
if (data.bigScreenSplitConfig) {
|
||||
data.bigScreenSplitConfig.forEach(item => {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
||||
const param = {
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
name: `${section.name}(${section.code})`,
|
||||
offsetTop: 0,
|
||||
sectionCode: section.code
|
||||
};
|
||||
this.tableData.push(param);
|
||||
if (section) {
|
||||
const param = {
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
name: `${section.name}(${section.code})`,
|
||||
offsetTop: 0,
|
||||
sectionCode: section.code
|
||||
};
|
||||
this.tableData.push(param);
|
||||
}
|
||||
});
|
||||
|
||||
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
||||
@ -270,8 +272,8 @@ export default {
|
||||
clear() {
|
||||
this.$refs.hostileForm.resetFields();
|
||||
this.addModel.sectionCode = '';
|
||||
this.index = '';
|
||||
this.field = '';
|
||||
this.index = '';
|
||||
this.field = '';
|
||||
},
|
||||
generateOverlab() { // 生成
|
||||
if (!this.addModel.sectionCode) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="createRules"
|
||||
:type="editModel.type"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -142,6 +143,9 @@ export default {
|
||||
this.editModel.type = selected._type;
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
// 创建对象
|
||||
create() {
|
||||
const uid = getUID(this.addModel.type, this.splitStationList); // 根据类型写 uid 前缀命名
|
||||
@ -162,8 +166,8 @@ export default {
|
||||
this.$refs.createForm.resetForm();
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', data);
|
||||
this.field = '';
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
|
@ -419,8 +419,9 @@ export default {
|
||||
const list = this.changeChargeStation(this.editModel.chargeStationCodeList);
|
||||
const centralizedList = this.changeCentralized(this.editModel.centralized);
|
||||
const models = [this.editModel, ...list, ...centralizedList];
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="StationStand"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -289,6 +290,9 @@ export default {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
changeStation(station) {
|
||||
this.editModel.deviceStationCode = this.getDeviceStationCode(station);
|
||||
},
|
||||
@ -416,12 +420,12 @@ export default {
|
||||
models.push(deepAssign(item, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
} else {
|
||||
// 用于更新
|
||||
this.$emit('updateMapModel', selected);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', selected);
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
deleteObj() {
|
||||
|
@ -25,9 +25,6 @@ export default {
|
||||
const createArr = []; // 创建model列表
|
||||
const changeSectionList = this.changeSectionAttr();
|
||||
changeSectionList.forEach(section => {
|
||||
// if (section.code == 'T449' || section.code == 'T501' || section.code == 'T502') {
|
||||
// debugger;
|
||||
// }
|
||||
if (!section.rightSectionCode) { // 右侧关联关系为空 且 道岔区段
|
||||
const list = this.findSectionA(section.points[section.points.length - 1].x, section.points[section.points.length - 1].y);
|
||||
let sectionB = {};
|
||||
@ -161,53 +158,58 @@ export default {
|
||||
changeSectionAttr() {
|
||||
const changeSectionList = []; // 改变的区段列表
|
||||
this.sectionList.forEach(section => {
|
||||
const oneSection = section.points[section.points.length - 1];
|
||||
const oneSectionStar = section.points[0];
|
||||
let countA = 0;
|
||||
let countB = 0;
|
||||
this.sectionList.forEach(elem => {
|
||||
const twoSection = elem.points[0];
|
||||
const twoSectionEnd = elem.points[elem.points.length - 1];
|
||||
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
|
||||
countA++;
|
||||
if (countA >= 2) {
|
||||
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
||||
const sectionModel = deepAssign({}, section);
|
||||
sectionModel.rightSectionCode = '';
|
||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||
sectionModel.type = '03';
|
||||
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
||||
list.forEach(elem => {
|
||||
const sectionModel = deepAssign({}, elem);
|
||||
sectionModel.leftSectionCode = '';
|
||||
sectionModel.sepTypeLeft = '00';
|
||||
sectionModel.type = '03';
|
||||
changeSectionList.push(sectionModel);
|
||||
});
|
||||
changeSectionList.push(sectionModel);
|
||||
if (section.type == '01') {
|
||||
const oneSection = section.points[section.points.length - 1];
|
||||
const oneSectionStar = section.points[0];
|
||||
let countA = 0;
|
||||
let countB = 0;
|
||||
console.log(changeSectionList);
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type == '01') {
|
||||
const twoSection = elem.points[0];
|
||||
const twoSectionEnd = elem.points[elem.points.length - 1];
|
||||
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
|
||||
countA++;
|
||||
if (countA >= 2) {
|
||||
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
||||
const sectionModel = deepAssign({}, section);
|
||||
sectionModel.rightSectionCode = '';
|
||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||
sectionModel.type = '03';
|
||||
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
||||
list.forEach(elem => {
|
||||
const sectionModelElem = deepAssign({}, elem);
|
||||
sectionModelElem.leftSectionCode = '';
|
||||
sectionModelElem.sepTypeLeft = '00';
|
||||
sectionModelElem.type = '03';
|
||||
changeSectionList.push(sectionModelElem);
|
||||
});
|
||||
changeSectionList.push(sectionModel);
|
||||
}
|
||||
}
|
||||
} else if (oneSectionStar.x == twoSectionEnd.x && oneSectionStar.y == twoSectionEnd.y) {
|
||||
countB++;
|
||||
if (countB >= 2) {
|
||||
if (!this.checkAddListB(oneSectionStar, section.code)) { // 左侧关系清空
|
||||
const sectionModel = deepAssign({}, section);
|
||||
sectionModel.leftSectionCode = '';
|
||||
sectionModel.sepTypeLeft = '00';
|
||||
sectionModel.type = '03';
|
||||
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
|
||||
list.forEach(elem => {
|
||||
const sectionModelElem = deepAssign({}, elem);
|
||||
sectionModelElem.rightSectionCode = '';
|
||||
sectionModelElem.sepTypeRight = '00'; // 分隔符
|
||||
sectionModelElem.type = '03';
|
||||
changeSectionList.push(sectionModelElem);
|
||||
});
|
||||
changeSectionList.push(sectionModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (oneSectionStar.x == twoSectionEnd.x && oneSectionStar.y == twoSectionEnd.y) {
|
||||
countB++;
|
||||
if (countB >= 2) {
|
||||
if (!this.checkAddListB(oneSectionStar, section.code)) { // 左侧关系清空
|
||||
const sectionModel = deepAssign({}, section);
|
||||
sectionModel.leftSectionCode = '';
|
||||
sectionModel.sepTypeLeft = '00';
|
||||
sectionModel.type = '03';
|
||||
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
|
||||
list.forEach(elem => {
|
||||
const sectionModel = deepAssign({}, elem);
|
||||
sectionModel.rightSectionCode = '';
|
||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||
sectionModel.type = '03';
|
||||
changeSectionList.push(sectionModel);
|
||||
});
|
||||
changeSectionList.push(sectionModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
return changeSectionList;
|
||||
},
|
||||
@ -249,7 +251,6 @@ export default {
|
||||
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
||||
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
||||
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
||||
// const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
||||
// if (!parentSectionModel) { // 找不到父元素删除
|
||||
if (switchSectionList.indexOf(elem.code) == -1) {
|
||||
let uid;
|
||||
@ -268,7 +269,7 @@ export default {
|
||||
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
||||
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
||||
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
||||
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
||||
if (sectiona1 && sectionc1 && sectionb1 && sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
||||
ele['uid'] = uid;
|
||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
||||
sectiona1.parentCode = uid;
|
||||
@ -283,12 +284,6 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
// } else {
|
||||
// parentSectionModel.relevanceSectionList.push(elem.sectionACode);
|
||||
// parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
|
||||
// parentSectionModel.relevanceSectionList.push(elem.sectionCCode);
|
||||
// models.push(parentSectionModel);
|
||||
// }
|
||||
sectiona.relSwitchCode = elem.code;
|
||||
sectionb.relSwitchCode = elem.code;
|
||||
sectionc.relSwitchCode = elem.code;
|
||||
@ -298,8 +293,6 @@ export default {
|
||||
sectiona.switchSection = true;
|
||||
sectionb.switchSection = true;
|
||||
sectionc.switchSection = true;
|
||||
// sectionb.sepTypeLeft = '00';
|
||||
// sectionb.sepTypeRight = '00';
|
||||
models.push(sectiona);
|
||||
models.push(sectionb);
|
||||
models.push(sectionc);
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<switch-model ref="switchModel" v-on="$listeners" @setCenter="setCenter" @clrField="field=''"/>
|
||||
<switch-model ref="switchModel" v-on="$listeners" @setCenter="setCenter" @clrField="field=''" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<create-switch ref="createSwitch" v-on="$listeners" />
|
||||
|
@ -124,15 +124,15 @@ export default {
|
||||
this.editModel = deepAssign(this.editModel, data);
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
this.$emit('clrField');
|
||||
this.$emit('updateMapModel', data);
|
||||
this.$emit('clrField');
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
},
|
||||
// 修改对象
|
||||
edit() {
|
||||
this.$refs.dataform.edit();
|
||||
this.$refs.dataform.edit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -8,6 +8,7 @@
|
||||
:rules="rules"
|
||||
type="Text"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
@ -170,6 +171,9 @@ export default {
|
||||
[this.editModel.prepend, this.editModel.content] = selected.content.split('::');
|
||||
}
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
create() {
|
||||
const model = {
|
||||
_type: 'Text',
|
||||
|
@ -17,6 +17,7 @@
|
||||
:rules="rules"
|
||||
type="TrainWindow"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="second" :lazy="lazy">
|
||||
@ -202,6 +203,9 @@ export default {
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
|
||||
@ -354,12 +358,12 @@ export default {
|
||||
}
|
||||
});
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', models);
|
||||
this.field = '';
|
||||
} else {
|
||||
// 用于更新
|
||||
this.$emit('updateMapModel', selected);
|
||||
this.field = '';
|
||||
this.$emit('updateMapModel', selected);
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
editTrainWindow() {
|
||||
|
@ -218,6 +218,7 @@ export default {
|
||||
models = [...models, ...arr];
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user