Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
49968e00ec
@ -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 {RailList} from '@/jlmap3d/edit/testEditorModel/RailList.js';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import {getmodels} from '@/jlmap3d/edit/connect/getmodels';
|
|
||||||
import { Loading } from 'element-ui';
|
import { Loading } from 'element-ui';
|
||||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
// 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 () {
|
scope.camera.aspect = changeelement.offsetWidth / changeelement.offsetHeight;
|
||||||
|
|
||||||
// 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.updateProjectionMatrix();
|
scope.camera.updateProjectionMatrix();
|
||||||
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
|
scope.renderer.setSize(changeelement.offsetWidth, changeelement.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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
|||||||
// console.log(data);
|
// console.log(data);
|
||||||
|
|
||||||
if(data.type == "Train_Position"){
|
if(data.type == "Train_Position"){
|
||||||
|
|
||||||
nowTrainRun(data.body);
|
nowTrainRun(data.body);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,10 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
|
|||||||
// jl3d.updateNowLeaveData("down",data.body.out);
|
// jl3d.updateNowLeaveData("down",data.body.out);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data.type == "TRAIN_PIS"){
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
if(data.type == "TRAIN_PFI_NUM"){
|
if(data.type == "TRAIN_PFI_NUM"){
|
||||||
|
|
||||||
trafficTrain.trainList = [];
|
trafficTrain.trainList = [];
|
||||||
|
@ -171,6 +171,8 @@ export function PasserHuman() {
|
|||||||
// console.log(inPasser);
|
// console.log(inPasser);
|
||||||
// console.log(outPasser);
|
// console.log(outPasser);
|
||||||
// let outPassers = inNum[scope.nowTrunk].num;
|
// let outPassers = inNum[scope.nowTrunk].num;
|
||||||
|
console.log(inNum);
|
||||||
|
console.log(leaveNum);
|
||||||
let created = 0;
|
let created = 0;
|
||||||
for(let i=0;i<outPasser.length;i++){
|
for(let i=0;i<outPasser.length;i++){
|
||||||
for(let j=0;j<outPasser[i];j++){
|
for(let j=0;j<outPasser[i];j++){
|
||||||
@ -187,7 +189,7 @@ export function PasserHuman() {
|
|||||||
for(let j=0;j<inPasser[i];j++){
|
for(let j=0;j<inPasser[i];j++){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
scope.createInPasser(humanlist,direct);
|
scope.createInPasser(humanlist,direct);
|
||||||
}, Math.random()*1000*i);
|
}, 2000+Math.random()*1000*j);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ class EStationText extends Group {
|
|||||||
create() {
|
create() {
|
||||||
const model = this.model.modelData;
|
const model = this.model.modelData;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
// 车站名称
|
// 车站名称
|
||||||
this.stationName = new Text({
|
this.stationName = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
@ -32,7 +31,7 @@ class EStationText extends Group {
|
|||||||
textBorderWidth:style.Station.stationText.textBorderWidth
|
textBorderWidth:style.Station.stationText.textBorderWidth
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.stationName);
|
model.visible && this.add(this.stationName);
|
||||||
if (model.subheadDisplay) { // 副标题
|
if (model.subheadDisplay) { // 副标题
|
||||||
this.subheadText = new Text({
|
this.subheadText = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
|
@ -13,7 +13,7 @@ import Text from 'zrender/src/graphic/Text';
|
|||||||
import store from '@/store/index_APP_TARGET';
|
import store from '@/store/index_APP_TARGET';
|
||||||
|
|
||||||
import EStationText from './EStationText';
|
import EStationText from './EStationText';
|
||||||
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
|
import { traverseLineElements } from '../utils/ShapeStatusCovert';
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
@ -39,9 +39,9 @@ export default class Station extends Group {
|
|||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
|
||||||
// // 站台所有的绘图元素
|
// 站台所有的绘图元素
|
||||||
const elementTypeList = {
|
const elementTypeList = {
|
||||||
'stationText':EStationText // 车站名称 (普通站台样式)
|
'stationText': EStationText // 车站名称 (普通站台样式)
|
||||||
};
|
};
|
||||||
|
|
||||||
// 遍历当前线路下的绘图元素 组合模式
|
// 遍历当前线路下的绘图元素 组合模式
|
||||||
@ -74,7 +74,7 @@ export default class Station extends Group {
|
|||||||
textFill: model.kmPostFontColor
|
textFill: model.kmPostFontColor
|
||||||
});
|
});
|
||||||
this.add(this.mileageText);
|
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) { // 隐藏车站
|
// if (!model.visible) { // 隐藏车站
|
||||||
@ -466,7 +466,7 @@ export default class Station extends Group {
|
|||||||
item.show();
|
item.show();
|
||||||
});
|
});
|
||||||
if (this.mileageText) {
|
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.isShowShape = true;
|
||||||
this.setState(this.model);
|
this.setState(this.model);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
</Jl3ddevice-Msg>
|
</Jl3ddevice-Msg>
|
||||||
<Jl3ddevice-List v-show="isswitch" :devicelist="devicelist" @sdevice="sdevice">
|
<Jl3ddevice-List v-show="isswitch" :devicelist="devicelist" @sdevice="sdevice">
|
||||||
</Jl3ddevice-List>
|
</Jl3ddevice-List>
|
||||||
<canvas id="canvastexture" />
|
<canvas id="canvastexture" ></canvas>
|
||||||
<div class="jl3dcontrolpane" v-show="isswitch">
|
<div class="jl3dcontrolpane" v-show="isswitch">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" @click="back">初始化</el-button>
|
<el-button type="primary" @click="back">初始化</el-button>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<div id="jl3dwindow" v-show="isPsd" class="windowbutton"
|
<div id="jl3dwindow" v-show="isPsd" class="windowbutton"
|
||||||
:style="{'background-image': 'url('+localStatic+'/texture/fk.png)'}"
|
:style="{'background-image': 'url('+localStatic+'/texture/fk.png)'}"
|
||||||
@click="windowchange"></div
|
@click="windowchange"></div>
|
||||||
|
|
||||||
<div id="jl3dclose" v-show="isPsd" class="backbutton"
|
<div id="jl3dclose" v-show="isPsd" class="backbutton"
|
||||||
:style="{'background-image': 'url('+localStatic+'/texture/xx.png)'}"
|
:style="{'background-image': 'url('+localStatic+'/texture/xx.png)'}"
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
<Jl3d-Device
|
<Jl3d-Device
|
||||||
v-if="deviceShow"
|
v-if="deviceif"
|
||||||
|
v-show="deviceShow"
|
||||||
ref="Jl3dDevice"
|
ref="Jl3dDevice"
|
||||||
:panel-show="deviceShow"
|
:panel-show="deviceShow"
|
||||||
@closedevice3dview="jumpjlmap3dmodel"
|
@closedevice3dview="jumpjlmap3dmodel"
|
||||||
@ -113,7 +114,8 @@ export default {
|
|||||||
mapId:'',
|
mapId:'',
|
||||||
lineCode:'',
|
lineCode:'',
|
||||||
practiceDisabled:false,
|
practiceDisabled:false,
|
||||||
deviceShow: false,
|
deviceif:false,
|
||||||
|
deviceShow: true,
|
||||||
drivingShow: false,
|
drivingShow: false,
|
||||||
jl3dtrafficplan:this.$t('display.demon.trafficplantext'),
|
jl3dtrafficplan:this.$t('display.demon.trafficplantext'),
|
||||||
jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
|
jl3dtraffictrain:this.$t('display.demon.traffictraintext'),
|
||||||
@ -159,11 +161,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
jumpjlmap3dmodel() {
|
jumpjlmap3dmodel() {
|
||||||
|
if(this.deviceif == false){
|
||||||
|
this.deviceif = true;
|
||||||
|
}else{
|
||||||
if (this.deviceShow == false) {
|
if (this.deviceShow == false) {
|
||||||
this.deviceShow = true;
|
this.deviceShow = true;
|
||||||
} else {
|
} else {
|
||||||
this.deviceShow = false;
|
this.deviceShow = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
showdriving() {
|
showdriving() {
|
||||||
this.drivingShow = false;
|
this.drivingShow = false;
|
||||||
|
@ -50,7 +50,8 @@
|
|||||||
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
|
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
|
||||||
<add-member ref="addMember" />
|
<add-member ref="addMember" />
|
||||||
<Jl3d-Device
|
<Jl3d-Device
|
||||||
v-if="deviceShow"
|
v-if="deviceif"
|
||||||
|
v-show="deviceShow"
|
||||||
ref="Jl3dDevice"
|
ref="Jl3dDevice"
|
||||||
:panel-show="deviceShow"
|
:panel-show="deviceShow"
|
||||||
@closedevice3dview="devicemodel"
|
@closedevice3dview="devicemodel"
|
||||||
@ -124,7 +125,8 @@ export default {
|
|||||||
mapViewLoadedOver: false,
|
mapViewLoadedOver: false,
|
||||||
dataError: false,
|
dataError: false,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
deviceShow: false,
|
deviceif:false,
|
||||||
|
deviceShow: true,
|
||||||
centralizedStationMap: {}
|
centralizedStationMap: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -175,7 +177,8 @@ export default {
|
|||||||
this.showSelectStation && this.setShowStation(this.showStation);
|
this.showSelectStation && this.setShowStation(this.showStation);
|
||||||
// this.initMemberUserInfo();
|
// this.initMemberUserInfo();
|
||||||
if (this.$route.query.type === 'VR_PSD') {
|
if (this.$route.query.type === 'VR_PSD') {
|
||||||
this.deviceShow = true;
|
this.deviceif = true;
|
||||||
|
this.deviceShow = false;
|
||||||
}
|
}
|
||||||
if (this.$route.query.type === 'DRIVE') {
|
if (this.$route.query.type === 'DRIVE') {
|
||||||
this.$store.dispatch('training/setPrdType', '04');
|
this.$store.dispatch('training/setPrdType', '04');
|
||||||
@ -292,11 +295,16 @@ export default {
|
|||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
devicemodel() {
|
devicemodel() {
|
||||||
|
if(this.deviceif == false){
|
||||||
|
this.deviceif = true;
|
||||||
|
}else{
|
||||||
if (this.deviceShow == false) {
|
if (this.deviceShow == false) {
|
||||||
this.deviceShow = true;
|
this.deviceShow = true;
|
||||||
} else {
|
} else {
|
||||||
this.deviceShow = false;
|
this.deviceShow = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/* 地图根据仿真group获取仿真基础信息 */
|
/* 地图根据仿真group获取仿真基础信息 */
|
||||||
async loadSimulationInfo() {
|
async loadSimulationInfo() {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Resource"
|
type="Resource"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
this.$refs.form && this.$refs.form.resetFields();
|
||||||
this.$refs.make && this.$refs.make.resetFields();
|
this.$refs.make && this.$refs.make.resetFields();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Arrow"
|
type="Arrow"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -139,6 +140,9 @@ export default {
|
|||||||
clear() {
|
clear() {
|
||||||
this.addModel = getModel('Arrow');
|
this.addModel = getModel('Arrow');
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
create() {
|
create() {
|
||||||
const model = deepAssign(this.addModel, {code:getUID('Arrow', this.arrowList)});
|
const model = deepAssign(this.addModel, {code:getUID('Arrow', this.arrowList)});
|
||||||
this.$emit('updateMapModel', model);
|
this.$emit('updateMapModel', model);
|
||||||
|
@ -51,6 +51,7 @@ export default {
|
|||||||
data.content = `${this.editModel.prepend}::${this.editModel.content}`;
|
data.content = `${this.editModel.prepend}::${this.editModel.content}`;
|
||||||
}
|
}
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
|
this.$emit('clearDeviceSelect');
|
||||||
} else {
|
} else {
|
||||||
this.$message('还有属性未填写,修改未生效!');
|
this.$message('还有属性未填写,修改未生效!');
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
:type="editModel.type"
|
:type="editModel.type"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -228,6 +229,9 @@ export default {
|
|||||||
this.$emit('deviceSelect', '');
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
handleIndicatorLightList(indicatorLightList) {
|
handleIndicatorLightList(indicatorLightList) {
|
||||||
this.atsControlList = [];
|
this.atsControlList = [];
|
||||||
this.centerCommunicationList = [];
|
this.centerCommunicationList = [];
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Counter"
|
type="Counter"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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;
|
this.addModel.stationCode = selected.code;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
create() {
|
create() {
|
||||||
const uid = getUID('Counter', this.counterList);
|
const uid = getUID('Counter', this.counterList);
|
||||||
const model = {
|
const model = {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="DelayUnlock"
|
type="DelayUnlock"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -148,6 +149,9 @@ export default {
|
|||||||
deviceChange(code) {
|
deviceChange(code) {
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
this.$refs.form && this.$refs.form.resetFields();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Resource"
|
type="Resource"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -200,6 +201,9 @@ export default {
|
|||||||
this.$emit('deviceSelect', '');
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
hover(field) {
|
hover(field) {
|
||||||
this.field = field === this.field ? '' : field;
|
this.field = field === this.field ? '' : field;
|
||||||
if (this.field) {
|
if (this.field) {
|
||||||
@ -229,8 +233,8 @@ export default {
|
|||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`;
|
data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`;
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
this.$refs.dataform.deleteObj();
|
this.$refs.dataform.deleteObj();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Esp"
|
type="Esp"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
// this.edit();
|
// this.edit();
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
hover(field) {
|
hover(field) {
|
||||||
this.field = field === this.field ? '' : field;
|
this.field = field === this.field ? '' : field;
|
||||||
if (this.field) {
|
if (this.field) {
|
||||||
@ -163,8 +167,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
this.$refs.dataform.deleteObj();
|
this.$refs.dataform.deleteObj();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Resource"
|
type="Resource"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
this.$refs.form && this.$refs.form.resetFields();
|
||||||
this.$refs.make && this.$refs.make.resetFields();
|
this.$refs.make && this.$refs.make.resetFields();
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
<div class="map-control">
|
<div class="map-control">
|
||||||
<div class="border-card">
|
<div class="border-card">
|
||||||
<div class="map-operate">
|
<div class="map-operate">
|
||||||
<span>
|
<div style="float: left;width: 280px;overflow: hidden;height: 17px;text-overflow: ellipsis;white-space: nowrap;">
|
||||||
{{ $t('map.mapName') }}
|
<span>{{ $t('map.mapName') }}</span>
|
||||||
<b>{{ mapInfo.name }}</b>
|
<el-tooltip class="item" effect="dark" :content="mapInfo.name" placement="top">
|
||||||
</span>
|
<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-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">
|
<el-dropdown class="operate-button" trigger="click">
|
||||||
<span class="el-dropdown-link">数据操作</span>
|
<span class="el-dropdown-link">数据操作</span>
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="LcControl"
|
type="LcControl"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
this.$refs.form && this.$refs.form.resetFields();
|
||||||
this.$refs.make && this.$refs.make.resetFields();
|
this.$refs.make && this.$refs.make.resetFields();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Line"
|
type="Line"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -149,6 +150,9 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceChange(code) {
|
deviceChange(code) {
|
||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="OutFrame"
|
type="OutFrame"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
addPoint(index) {
|
addPoint(index) {
|
||||||
const data = { x: 0, y: 0 };
|
const data = { x: 0, y: 0 };
|
||||||
this.editModel.points.splice(index + 1, 0, data);
|
this.editModel.points.splice(index + 1, 0, data);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Power"
|
type="Power"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="tabClick"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -324,8 +325,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
delete data.sectionUnitList;
|
delete data.sectionUnitList;
|
||||||
}
|
}
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Psd"
|
type="Psd"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -200,6 +201,9 @@ export default {
|
|||||||
this.$emit('deviceSelect', '');
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
|
||||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||||
@ -235,8 +239,8 @@ export default {
|
|||||||
this.$refs.createForm.resetForm();
|
this.$refs.createForm.resetForm();
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
// 批量设置
|
// 批量设置
|
||||||
batchSettings() {
|
batchSettings() {
|
||||||
|
@ -3,12 +3,6 @@
|
|||||||
<el-collapse v-model="activeName" accordion style="margin-left: 20px">
|
<el-collapse v-model="activeName" accordion style="margin-left: 20px">
|
||||||
<el-collapse-item title="左右停车点偏移" name="1">
|
<el-collapse-item title="左右停车点偏移" name="1">
|
||||||
<el-form label-width="200px" size="mini">
|
<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-form-item>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" size="small" @click="batchSettings">{{ $t('global.set') }}</el-button>
|
<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 style="margin-left: 150px" type="primary" size="small" @click="setSwitchSectionName">设置</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-collapse-item>
|
</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>
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -124,10 +146,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: '',
|
activeName: '',
|
||||||
// form: {
|
|
||||||
// leftDistance: 0,
|
|
||||||
// rightDistance: 0
|
|
||||||
// },
|
|
||||||
formModel: {
|
formModel: {
|
||||||
modelList: [],
|
modelList: [],
|
||||||
trainPosType: ''
|
trainPosType: ''
|
||||||
@ -136,6 +154,10 @@ export default {
|
|||||||
roadType: null,
|
roadType: null,
|
||||||
sectionCode: ''
|
sectionCode: ''
|
||||||
},
|
},
|
||||||
|
fromModel: {
|
||||||
|
sectionCode: '',
|
||||||
|
right: false
|
||||||
|
},
|
||||||
positionTypes: [
|
positionTypes: [
|
||||||
{ name: '上方', type: '01' },
|
{ name: '上方', type: '01' },
|
||||||
{ name: '下方', type: '02' }
|
{ name: '下方', type: '02' }
|
||||||
@ -332,6 +354,162 @@ export default {
|
|||||||
});
|
});
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.$message.success('道岔区段设置成功!');
|
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()) {
|
} else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) {
|
||||||
this.$refs.batchSettings.roadModel.sectionCode = selected.code;
|
this.$refs.batchSettings.roadModel.sectionCode = selected.code;
|
||||||
this.activeName = 'five';
|
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);
|
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](selected.trainWindowCode);
|
||||||
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
|
trainWindowModel && models.push(deepAssign(trainWindowModel, { _dispose: true }));
|
||||||
const deleteObjAssociatedSection = this.handleDeleteSectionAssociatedSection(selected);
|
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];
|
models = [...models, ...deleteObjAssociatedSection];
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.clear();
|
this.clear();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Signal"
|
type="Signal"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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.field = field == this.field ? '' : field;
|
||||||
this.signalSectionCode(this.field);
|
this.signalSectionCode(this.field);
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceChange(code) {
|
deviceChange(code) {
|
||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
@ -472,8 +476,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
signalSectionCode(field) {
|
signalSectionCode(field) {
|
||||||
this.field = field;
|
this.field = field;
|
||||||
|
@ -161,13 +161,15 @@ export default {
|
|||||||
if (data.bigScreenSplitConfig) {
|
if (data.bigScreenSplitConfig) {
|
||||||
data.bigScreenSplitConfig.forEach(item => {
|
data.bigScreenSplitConfig.forEach(item => {
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
||||||
const param = {
|
if (section) {
|
||||||
position: String(section.points[section.points.length - 1].x),
|
const param = {
|
||||||
name: `${section.name}(${section.code})`,
|
position: String(section.points[section.points.length - 1].x),
|
||||||
offsetTop: 0,
|
name: `${section.name}(${section.code})`,
|
||||||
sectionCode: section.code
|
offsetTop: 0,
|
||||||
};
|
sectionCode: section.code
|
||||||
this.tableData.push(param);
|
};
|
||||||
|
this.tableData.push(param);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
||||||
@ -270,8 +272,8 @@ export default {
|
|||||||
clear() {
|
clear() {
|
||||||
this.$refs.hostileForm.resetFields();
|
this.$refs.hostileForm.resetFields();
|
||||||
this.addModel.sectionCode = '';
|
this.addModel.sectionCode = '';
|
||||||
this.index = '';
|
this.index = '';
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
generateOverlab() { // 生成
|
generateOverlab() { // 生成
|
||||||
if (!this.addModel.sectionCode) {
|
if (!this.addModel.sectionCode) {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="createRules"
|
:rules="createRules"
|
||||||
:type="editModel.type"
|
:type="editModel.type"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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;
|
this.editModel.type = selected._type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
// 创建对象
|
// 创建对象
|
||||||
create() {
|
create() {
|
||||||
const uid = getUID(this.addModel.type, this.splitStationList); // 根据类型写 uid 前缀命名
|
const uid = getUID(this.addModel.type, this.splitStationList); // 根据类型写 uid 前缀命名
|
||||||
@ -162,8 +166,8 @@ export default {
|
|||||||
this.$refs.createForm.resetForm();
|
this.$refs.createForm.resetForm();
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
this.$refs.dataform.deleteObj();
|
this.$refs.dataform.deleteObj();
|
||||||
|
@ -419,8 +419,9 @@ export default {
|
|||||||
const list = this.changeChargeStation(this.editModel.chargeStationCodeList);
|
const list = this.changeChargeStation(this.editModel.chargeStationCodeList);
|
||||||
const centralizedList = this.changeCentralized(this.editModel.centralized);
|
const centralizedList = this.changeCentralized(this.editModel.centralized);
|
||||||
const models = [this.editModel, ...list, ...centralizedList];
|
const models = [this.editModel, ...list, ...centralizedList];
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="StationStand"
|
type="StationStand"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
@ -289,6 +290,9 @@ export default {
|
|||||||
this.$emit('deviceSelect', '');
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
changeStation(station) {
|
changeStation(station) {
|
||||||
this.editModel.deviceStationCode = this.getDeviceStationCode(station);
|
this.editModel.deviceStationCode = this.getDeviceStationCode(station);
|
||||||
},
|
},
|
||||||
@ -416,12 +420,12 @@ export default {
|
|||||||
models.push(deepAssign(item, { _dispose: true }));
|
models.push(deepAssign(item, { _dispose: true }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
} else {
|
} else {
|
||||||
// 用于更新
|
// 用于更新
|
||||||
this.$emit('updateMapModel', selected);
|
this.$emit('updateMapModel', selected);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
|
@ -25,9 +25,6 @@ export default {
|
|||||||
const createArr = []; // 创建model列表
|
const createArr = []; // 创建model列表
|
||||||
const changeSectionList = this.changeSectionAttr();
|
const changeSectionList = this.changeSectionAttr();
|
||||||
changeSectionList.forEach(section => {
|
changeSectionList.forEach(section => {
|
||||||
// if (section.code == 'T449' || section.code == 'T501' || section.code == 'T502') {
|
|
||||||
// debugger;
|
|
||||||
// }
|
|
||||||
if (!section.rightSectionCode) { // 右侧关联关系为空 且 道岔区段
|
if (!section.rightSectionCode) { // 右侧关联关系为空 且 道岔区段
|
||||||
const list = this.findSectionA(section.points[section.points.length - 1].x, section.points[section.points.length - 1].y);
|
const list = this.findSectionA(section.points[section.points.length - 1].x, section.points[section.points.length - 1].y);
|
||||||
let sectionB = {};
|
let sectionB = {};
|
||||||
@ -161,53 +158,58 @@ export default {
|
|||||||
changeSectionAttr() {
|
changeSectionAttr() {
|
||||||
const changeSectionList = []; // 改变的区段列表
|
const changeSectionList = []; // 改变的区段列表
|
||||||
this.sectionList.forEach(section => {
|
this.sectionList.forEach(section => {
|
||||||
const oneSection = section.points[section.points.length - 1];
|
if (section.type == '01') {
|
||||||
const oneSectionStar = section.points[0];
|
const oneSection = section.points[section.points.length - 1];
|
||||||
let countA = 0;
|
const oneSectionStar = section.points[0];
|
||||||
let countB = 0;
|
let countA = 0;
|
||||||
this.sectionList.forEach(elem => {
|
let countB = 0;
|
||||||
const twoSection = elem.points[0];
|
console.log(changeSectionList);
|
||||||
const twoSectionEnd = elem.points[elem.points.length - 1];
|
this.sectionList.forEach(elem => {
|
||||||
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
|
if (elem.type == '01') {
|
||||||
countA++;
|
const twoSection = elem.points[0];
|
||||||
if (countA >= 2) {
|
const twoSectionEnd = elem.points[elem.points.length - 1];
|
||||||
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
if (oneSection.x == twoSection.x && oneSection.y == twoSection.y) {
|
||||||
const sectionModel = deepAssign({}, section);
|
countA++;
|
||||||
sectionModel.rightSectionCode = '';
|
if (countA >= 2) {
|
||||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
||||||
sectionModel.type = '03';
|
const sectionModel = deepAssign({}, section);
|
||||||
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
sectionModel.rightSectionCode = '';
|
||||||
list.forEach(elem => {
|
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||||
const sectionModel = deepAssign({}, elem);
|
sectionModel.type = '03';
|
||||||
sectionModel.leftSectionCode = '';
|
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
||||||
sectionModel.sepTypeLeft = '00';
|
list.forEach(elem => {
|
||||||
sectionModel.type = '03';
|
const sectionModelElem = deepAssign({}, elem);
|
||||||
changeSectionList.push(sectionModel);
|
sectionModelElem.leftSectionCode = '';
|
||||||
});
|
sectionModelElem.sepTypeLeft = '00';
|
||||||
changeSectionList.push(sectionModel);
|
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;
|
return changeSectionList;
|
||||||
},
|
},
|
||||||
@ -249,7 +251,6 @@ export default {
|
|||||||
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
||||||
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
||||||
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
||||||
// const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
|
||||||
// if (!parentSectionModel) { // 找不到父元素删除
|
// if (!parentSectionModel) { // 找不到父元素删除
|
||||||
if (switchSectionList.indexOf(elem.code) == -1) {
|
if (switchSectionList.indexOf(elem.code) == -1) {
|
||||||
let uid;
|
let uid;
|
||||||
@ -268,7 +269,7 @@ export default {
|
|||||||
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
||||||
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
||||||
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
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;
|
ele['uid'] = uid;
|
||||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
||||||
sectiona1.parentCode = uid;
|
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;
|
sectiona.relSwitchCode = elem.code;
|
||||||
sectionb.relSwitchCode = elem.code;
|
sectionb.relSwitchCode = elem.code;
|
||||||
sectionc.relSwitchCode = elem.code;
|
sectionc.relSwitchCode = elem.code;
|
||||||
@ -298,8 +293,6 @@ export default {
|
|||||||
sectiona.switchSection = true;
|
sectiona.switchSection = true;
|
||||||
sectionb.switchSection = true;
|
sectionb.switchSection = true;
|
||||||
sectionc.switchSection = true;
|
sectionc.switchSection = true;
|
||||||
// sectionb.sepTypeLeft = '00';
|
|
||||||
// sectionb.sepTypeRight = '00';
|
|
||||||
models.push(sectiona);
|
models.push(sectiona);
|
||||||
models.push(sectionb);
|
models.push(sectionb);
|
||||||
models.push(sectionc);
|
models.push(sectionc);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tabs v-model="activeName" class="card">
|
<el-tabs v-model="activeName" class="card">
|
||||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
<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>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||||
<create-switch ref="createSwitch" v-on="$listeners" />
|
<create-switch ref="createSwitch" v-on="$listeners" />
|
||||||
|
@ -124,15 +124,15 @@ export default {
|
|||||||
this.editModel = deepAssign(this.editModel, data);
|
this.editModel = deepAssign(this.editModel, data);
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
this.$emit('clrField');
|
this.$emit('clrField');
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
this.$refs.dataform.deleteObj();
|
this.$refs.dataform.deleteObj();
|
||||||
},
|
},
|
||||||
// 修改对象
|
// 修改对象
|
||||||
edit() {
|
edit() {
|
||||||
this.$refs.dataform.edit();
|
this.$refs.dataform.edit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="Text"
|
type="Text"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
<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('::');
|
[this.editModel.prepend, this.editModel.content] = selected.content.split('::');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
create() {
|
create() {
|
||||||
const model = {
|
const model = {
|
||||||
_type: 'Text',
|
_type: 'Text',
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
:rules="rules"
|
:rules="rules"
|
||||||
type="TrainWindow"
|
type="TrainWindow"
|
||||||
@updateMapModel="updateMapModel"
|
@updateMapModel="updateMapModel"
|
||||||
|
@clearDeviceSelect="clearDeviceSelect"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="second" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="second" :lazy="lazy">
|
||||||
@ -202,6 +203,9 @@ export default {
|
|||||||
hover(field) {
|
hover(field) {
|
||||||
this.field = field == this.field ? '' : field;
|
this.field = field == this.field ? '' : field;
|
||||||
},
|
},
|
||||||
|
clearDeviceSelect() {
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
|
},
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
this.$refs.form && this.$refs.form.resetFields();
|
||||||
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
|
||||||
@ -354,12 +358,12 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
models.push(deepAssign(selected, { _dispose: true }));
|
models.push(deepAssign(selected, { _dispose: true }));
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
} else {
|
} else {
|
||||||
// 用于更新
|
// 用于更新
|
||||||
this.$emit('updateMapModel', selected);
|
this.$emit('updateMapModel', selected);
|
||||||
this.field = '';
|
this.field = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editTrainWindow() {
|
editTrainWindow() {
|
||||||
|
@ -218,6 +218,7 @@ export default {
|
|||||||
models = [...models, ...arr];
|
models = [...models, ...arr];
|
||||||
});
|
});
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user