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 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) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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.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;
|
||||
window.addEventListener('resize', () =>
|
||||
onresize()
|
||||
, false)
|
||||
let onresize = function () {
|
||||
|
||||
scope.camera.aspect = changeelement.offsetWidth / changeelement.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);
|
||||
|
@ -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)'}"
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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') }}
|
||||
<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>
|
||||
</span>
|
||||
</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">
|
||||
|
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -161,6 +161,7 @@ export default {
|
||||
if (data.bigScreenSplitConfig) {
|
||||
data.bigScreenSplitConfig.forEach(item => {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
||||
if (section) {
|
||||
const param = {
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
name: `${section.name}(${section.code})`,
|
||||
@ -168,6 +169,7 @@ export default {
|
||||
sectionCode: section.code
|
||||
};
|
||||
this.tableData.push(param);
|
||||
}
|
||||
});
|
||||
|
||||
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
||||
|
@ -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 前缀命名
|
||||
|
@ -421,6 +421,7 @@ export default {
|
||||
const models = [this.editModel, ...list, ...centralizedList];
|
||||
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);
|
||||
},
|
||||
|
@ -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,11 +158,14 @@ export default {
|
||||
changeSectionAttr() {
|
||||
const changeSectionList = []; // 改变的区段列表
|
||||
this.sectionList.forEach(section => {
|
||||
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) {
|
||||
@ -178,11 +178,11 @@ export default {
|
||||
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);
|
||||
const sectionModelElem = deepAssign({}, elem);
|
||||
sectionModelElem.leftSectionCode = '';
|
||||
sectionModelElem.sepTypeLeft = '00';
|
||||
sectionModelElem.type = '03';
|
||||
changeSectionList.push(sectionModelElem);
|
||||
});
|
||||
changeSectionList.push(sectionModel);
|
||||
}
|
||||
@ -197,17 +197,19 @@ export default {
|
||||
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);
|
||||
const sectionModelElem = deepAssign({}, elem);
|
||||
sectionModelElem.rightSectionCode = '';
|
||||
sectionModelElem.sepTypeRight = '00'; // 分隔符
|
||||
sectionModelElem.type = '03';
|
||||
changeSectionList.push(sectionModelElem);
|
||||
});
|
||||
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" />
|
||||
|
@ -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()) {
|
||||
|
@ -218,6 +218,7 @@ export default {
|
||||
models = [...models, ...arr];
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user