调整地图绘图数据模型

This commit is contained in:
zyy 2020-07-01 18:08:42 +08:00
parent 07bca42db2
commit 64d415dbb3
16 changed files with 197 additions and 421 deletions

View File

@ -345,7 +345,7 @@ export default {
} else if (deviceList.length === 2) {
let flag = false;
this.routeListFilter.forEach(item => {
if (item.endSignalCode === deviceList[1].code) {
if (item.endButtonSignalCode === deviceList[1].code) { //
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
operate.code = deviceList[1].code;

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -5,9 +5,10 @@ class Model {
this[`${type}Model`]();
}
SectionModel() {
this._type = 'Section';
this.code = '';
this.name = '';
this.type = '';
this.type = '01';
this.relStandCode = ''; // 关联站台编码
this.leftStopPointOffset = 0; // 左向停车点偏移量
this.rightStopPointOffset = 0; // 右向停车点偏移量
@ -33,9 +34,8 @@ class Model {
this.relSwitchCode = '';
this.stationCode = '';
this.logicSectionNameSort = true;
this.sepTypeLeft = '';
this.sepTypeRight = '';
this.offsetRight = 0;
this.sepTypeLeft = '00';
this.sepTypeRight = '00';
this.parentCode = '';
this.points = [];
this.lengthFact = 0;
@ -54,6 +54,110 @@ class Model {
this.rightAxleOffset = { x: 0, y: 0 };
this.leftAxleOffset = { x: 0, y: 0 };
}
SignalModel() {
this._type = 'Signal';
this.code = '';
this.name = '';
this.type = 'PROTECTION';
this.uniqueName = '';
this.nameShow = false;
this.lampPostType = '01'; // 灯柱类型
this.lampPositionType = '01';
this.leftOrRight = 'L';
this.right = false;
this.virtual = false; // 是否虚拟信号机
this.positionType = '01';
this.namePosition = { x: 0, y: 0 };
this.stationCode = '';
this.sectionOffset = 0;
this.rotate = 0;
this.nameRotated = false;
this.sectionCode = '';
this.guideShow = false;
this.buttonShow = false;
this.position = { x: 0, y: 0 };
this.positionPoint = { x: 0, y: 0 };
this.buttonPosition = { x: 0, y: 0 };
this.guidePosition = { x: 0, y: 0 };
this.interlockStationCode = '';
this.callOn = true;
this.turnBack = false;
this.ctc = true; // 是否灭灯显示
this.noOverlap = false; // 是否无延续保护
}
SwitchModel() {
this._type = 'Switch';
this.code = '';
this.name = '';
this.turnTime = 0;
this.nameShow = false;
this.namePosition = { x: 0, y: 0 };
this.stationCode = '';
this.timeoutShow = false;
this.sectionACode = '';
this.sectionBCode = '';
this.sectionCCode = '';
this.tp = { x: 0, y: 0 };
}
StationModel() {
this._type = 'Station';
this.centralized = false;
this.ciStation = false; // 是否联锁站
this.depot = false; // 是否停车场或者车辆段
this.reentry = false; // 是否折返车站
this.smallRouting = false; // 是否小交路
this.number = ''; // 编号
this.code = '';
this.zcCode = '';
this.visible = true;
this.runPlanName = '';
this.name = '';
this.nameFont = '22';
this.nameFontColor = '#FFFFFF';
this.subheadDisplay = false;
this.subhead = ''; // 副标题
this.subheadFont = '';
this.subheadFontColor = '#FFFFFF';
this.subheadPosition = { x: 0, y: 0 };
this.kmPostShow = true;
this.kmRange = 0;
this.kmPost = '1000km~2000km';
this.kmPostFont = '8';
this.kmPostFontColor = '#FFFFFF';
this.isShowControlMode = '';
this.chargeStationCodeList = [];
this.relStationCodeList = []; // 联锁站关联车站列表
this.position = { x: 0, y: 0 };
this.kilometerPosition = { x: 0, y: 0 }; // 公里标偏移坐标
this.createControlMode = false;
this.createTurnBack = false;
this.turnBackPoint = {x: 0, y: 0}; // 按图折返坐标
this.controlModePoint = { x: 0, y: 0 }; // 控制模式坐标
}
StationStandModel() {
this._type = 'StationStand';
this.code = '';
this.name = '';
this.deviceStationCode = ''; // 设备集中站
this.width = 0;
this.height = 0;
this.stationCode = ''; // 所属车站
this.position = { x: 0, y: 0 };
this.visible = true; // 是否显示
this.inside = false; // 内外站台显示
this.right = true;
this.standTrackCode = ''; // 关联站台轨
this.small = false;
this.defaultReentryStrategy = ''; // 默认折返策略
this.stopJumpLamp = false; // 跳停功能按钮
this.stopJumpLampPoint = {x: 0, y: 0}; // 跳停功能按钮坐标
this.cancelStopJumpLamp = false; // 取消跳停功能按钮
this.cancelStopJumpLampPoint = {x: 0, y: 0}; // 取消跳停功能按钮坐标
this.upDetainLamp = false; // 上行扣车功能按钮
this.upDetainLampPoint = {x: 0, y: 0}; // 上行扣车功能按钮坐标
this.downDetainLamp = false; // 下行扣车功能按钮
this.downDetainLampPoint = {x: 0, y: 0}; // 下行扣车功能按钮坐标
}
}
export default function getModel(type) {

View File

@ -287,9 +287,9 @@ export default {
let startOffset = 0;
const sectionMap = {};
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
const sectionModel = deepAssign({}, section);
sectionModel.lengthFact = Number(sectionModel.logicSectionCodeList.reduce((pre, code) => pre + Number(this.$store.getters['map/getDeviceByCode'](code).lengthFact), 0).toFixed(3));
models.push(sectionModel);
const sectionModel = deepAssign({}, section);
sectionModel.lengthFact = Number(sectionModel.logicSectionCodeList.reduce((pre, code) => pre + Number(this.$store.getters['map/getDeviceByCode'](code).lengthFact), 0).toFixed(3));
models.push(sectionModel);
section.logicSectionCodeList.forEach(sectionCode => {
const logicSection = this.$store.getters['map/getDeviceByCode'](sectionCode);
sectionMap[logicSection.points[0].x + 's' + logicSection.points[0].y] = logicSection;

View File

@ -99,6 +99,8 @@
<script>
import { getUID } from '@/jmapNew/utils/Uid';
import { deepAssign } from '@/utils/index';
import getModel from '../models.js';
export default {
name: 'Create',
props: {
@ -183,54 +185,18 @@ export default {
}
},
createModelParam(uid, name) {
return {
_type: 'Section',
const model = getModel('Section');
const data = {
code: uid,
name: name,
type: '01',
standTrack: false,
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
switchSection: false, //
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
rightSectionCode: '',
leftSectionCode: '',
kmRangeRight: '',
kmRangeLeft: '',
region: '',
namePosition: { x: 0, y: 0 },
logicSectionCodeList: [],
logicSectionShow: true,
logicSectionNameSort: true,
sepTypeLeft: '01', //
sepTypeRight: '01',
lengthFact: 0,
parentCode: '',
relStandCode: '',
rightStopPointOffset: 0,
leftStopPointOffset: 0,
destinationCode: '',
trainWindowCode: '',
destinationCodePoint: { x: 0, y: 0 },
curve: false,
nameShow: true,
relevanceSectionList: [],
points: [],
leftAxlePosition: 0,
rightAxlePosition: 0,
roadType: null,
firstTurnBack: false,
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0}
nameShow: true
};
return Object.assign(model, data);
},
//
batchCreate() {

View File

@ -62,7 +62,7 @@ import TipInfo from './tipInfo';
import CreateSection from './create';
import SplitOrMerge from './splitOrMerge';
import BatchSettings from './batchSettings';
import getModel from '@/views/newMap/newMapdraft/mapoperate/models.js';
import getModel from '../models.js';
export default {
name: 'SectionDraft',
@ -455,7 +455,6 @@ export default {
this.clear();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
console.log(this.editModel, this.editModel.parentCode, '========', selected.parentCode, selected);
this.oldPoint = selected.points;
this.oldLeftSectionCode = selected.leftSectionCode;
this.oldRightSectionCode = selected.rightSectionCode;

View File

@ -71,6 +71,7 @@
import { getUID } from '@/jmapNew/utils/Uid';
import { deepAssign } from '@/utils/index';
import { EventBus } from '@/scripts/event-bus';
import getModel from '../models.js';
export default {
name: 'SplitOrMerge',
@ -163,56 +164,28 @@ export default {
const modelY = (selected.points[selected.points.length - 1].y - selected.points[0].y) / this.addModel.splitNumber; // y
for (let index = 1; index <= this.addModel.splitNumber; index++) {
const uid = getUID('T', [...this.sectionList, ...models]);
const model = {
_type: 'Section',
const sectionModel = getModel('Section');
const data = {
code: uid,
name: `${selected.name}_${index}`,
type: '01',
parentCode: '',
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
switchSection: false,
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
trainWindowCode: '',
logicSectionNameSort: selected.logicSectionNameSort,
logicSectionShow: selected.logicSectionShow,
sepTypeLeft: index == 0 ? selected.sepTypeLeft : '01', // ( 01)
sepTypeRight: index == this.addModel.splitNumber ? selected.sepTypeRight : '01', // ( 01)
offsetRight: selected.offsetRight,
curve: selected.curve,
nameShow: true,
lengthFact: 0,
points: [
{
x: selected.points[0].x + ((index - 1) * modelX),
y: selected.points[0].y + ((index - 1) * modelY)
},
{
x: selected.points[0].x + (index * modelX),
y: selected.points[0].y + (index * modelY)
}
],
namePosition: { x: 0, y: 0 },
relevanceSectionList: [],
roadType: selected.roadType,
firstTurnBack: false,
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0},
leftAxlePosition: 0,
rightAxlePosition: 0
points: [{
x: selected.points[0].x + ((index - 1) * modelX),
y: selected.points[0].y + ((index - 1) * modelY)
},
{
x: selected.points[0].x + (index * modelX),
y: selected.points[0].y + (index * modelY)
}],
roadType: selected.roadType
};
const model = Object.assign(sectionModel, data);
models.push(model);
}
const leftAssociatedSection = selected.leftSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](selected.leftSectionCode) || {}) : {};
@ -263,39 +236,13 @@ export default {
if (rsection && lsection) {
const uid = getUID('T', this.sectionList);
const model = {
_type: 'Section',
const sectionModel = getModel('Section');
const data = {
code: uid,
parentCode: '',
name: lsection.name,
type: '01',
standTrack: false,
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
segmentationPosition: { x: 0, y: 0 },
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
switchSection: false,
relSwitchCode: '',
curve: false,
nameShow: true,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
trainWindowCode: '',
relevanceSectionList: [],
roadType: null,
firstTurnBack: false,
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0},
leftAxlePosition: 0,
rightAxlePosition: 0
type: '01'
};
const model = Object.assign(sectionModel, data);
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true }));
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));

View File

@ -90,6 +90,8 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import JTriangle from '@/jmapNew/utils/JTriangle';
import getModel from '../models.js';
export default {
name: 'SignalCreate',
props: {
@ -179,32 +181,19 @@ export default {
uname = this.addModel.name || 'S' + this.signalList.length;
uid = getUID('S', this.signalList);
}
var model = {
_type: 'Signal',
const signalModel = getModel('Signal');
const data = {
code: uid,
name: uname,
type: 'PROTECTION',
uniqueName: uid,
sectionCode: this.addModel.sectionCode,
positionType: this.addModel.positionType,
right: this.addModel.right,
virtual: false,
// leftOrRight: this.addModel.leftOrRight,
nameRotated: false,
nameShow: true,
namePosition: { x: 0, y: 0 },
positionPoint: { x: 0, y: 0 },
buttonShow: true,
potLampType: '01',
lampPostType: '01',
lampPositionType: '01',
guideShow: false,
stationCode: this.addModel.stationCode,
callOn: true,
turnBack: false,
ctc: true,
noOverlap: false
stationCode: this.addModel.stationCode
};
const model = Object.assign(signalModel, data);
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.sectionCode) {

View File

@ -127,6 +127,7 @@ import { mapGetters } from 'vuex';
import ConfigList from '../config/list';
import { deepAssign } from '@/utils/index';
import createSignal from './create';
import getModel from '../models.js';
export default {
name: 'SignalDraft',
@ -171,36 +172,7 @@ export default {
],
questionList: [],
field:'',
editModel: {
code: '',
name: '',
type: 'PROTECTION',
uniqueName: '',
nameShow: false,
lampPostType: '',
lampPositionType: '',
leftOrRight: 'L',
right: false,
virtual: false, //
positionType: '',
namePosition: { x: 0, y: 0 },
stationCode: '',
sectionOffset: 0,
rotate: 0,
nameRotated: false,
sectionCode: '',
guideShow: false,
buttonShow: false,
position: { x: 0, y: 0 },
positionPoint: { x: 0, y: 0 },
buttonPosition: { x: 0, y: 0 },
guidePosition: { x: 0, y: 0 },
interlockStationCode: '',
callOn: true,
turnBack: false,
ctc: true, //
noOverlap: false //
},
editModel: getModel('Signal'),
addModel: {
number: 2
},
@ -386,6 +358,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() != 'selectSingalCode'.toUpperCase()) {
this.editModel = getModel('Signal');
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -92,47 +92,12 @@
</template>
<script>
function setModel() {
return {
centralized: false,
ciStation: false, //
depot:false, //
reentry:false, //
smallRouting: false, //
number:'', //
code: '',
zcCode: '',
visible: true,
runPlanName: '',
name: '',
nameFont: '',
nameFontColor: '#FFFFFF',
subheadDisplay:false,
subhead:'', //
subheadFont:'',
subheadFontColor:'#FFFFFF',
subheadPosition:{ x: 0, y: 0 },
kmPostShow: '',
kmRange: 0,
kmPost: '',
kmPostFont: '',
kmPostFontColor: '#FFFFFF',
isShowControlMode: '',
chargeStationCodeList:[],
relStationCodeList: [], //
position: { x: 0, y: 0 },
kilometerPosition: { x: 0, y: 0 }, //
createControlMode:false,
createTurnBack:false,
turnBackPoint: {x: 0, y: 0}, //
controlModePoint: { x: 0, y: 0 } //
};
}
import ElFont from '@/views/components/font/index';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import { deepAssign } from '@/utils/index';
import getModel from './models.js';
export default {
name: 'StationDraft',
@ -156,7 +121,7 @@ export default {
chargeStation:[],
relStationList: [], //
controlled:false,
editModel: deepAssign({}, setModel()),
editModel: getModel('Station'),
addModel: {
modelList: [],
positionY: 0
@ -300,7 +265,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.editModel = setModel();
this.editModel = getModel('Station');
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -404,42 +369,13 @@ export default {
const models = [];
this.addModel.modelList.forEach((item) => {
const uid = getUID('Station', [...this.stationList, ...models]);
const model = {
_type: 'Station',
const stationModel = getModel('Station');
const data = {
code: uid,
name: item.stationName,
number:'',
subheadDisplay:false,
zcCode: '',
runPlanName: '',
visible: true,
nameFont: '22',
nameFontColor: '#FFFFFF',
kmPost: '1000km~2000km',
kmPostShow: true,
kmPostFont: '8',
kmPostFontColor: '#FFFFFF',
kilometerPosition: { x: 0, y: 0 },
centralized: false,
depot:false,
reentry:false,
smallRouting: false,
chargeStationCodeList:[],
relStationCodeList: [], //
createControlMode: item.control,
createTurnBack: false,
turnBackPoint: {x: 0, y: 0}, //
textControlMode: false, //
textControlModePosition: { x: 0, y: 0},
showUnmanned: false, //
unmannedPosition: {x: 0, y: 0},
showLampFilament: false, //
lampFilamentPosition: {x: 0, y: 0},
showControlSwitch: false, // LCW/ATS
controlSwitchPosition: {x: 0, y: 0},
showFoldbackMode: false, //
foldbackModePosition: {x: 0, y: 0}
createControlMode: item.control
};
const model = Object.assign(stationModel, data);
this.sectionList.forEach(elem => {
if (elem.code === item.sectionCode) {
const l = 0;
@ -473,8 +409,7 @@ export default {
edit() {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: 'Station'}, this.editModel);
this.$emit('updateMapModel', data);
this.$emit('updateMapModel', this.editModel);
}
});
},

View File

@ -52,6 +52,7 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import ConfigList from './config/list';
import { deepAssign } from '@/utils/index';
import getModel from './models.js';
export default {
name: 'StationStandDraft',
@ -84,52 +85,17 @@ export default {
{ code: '02', name: '自动无人折返'},
{ code: '03', name: '自动换端'}
],
editModel: {
code: '',
name: '',
deviceStationCode: '', //
width: 0,
height: 0,
stationCode: '', //
position: { x: 0, y: 0 },
visible: true, //
inside: false, //
right: true,
standTrackCode: '',
small: false,
defaultReentryStrategy: '', //
stopJumpLamp: false, //
stopJumpLampPoint: {x: 0, y: 0}, //
cancelStopJumpLamp: false, //
cancelStopJumpLampPoint: {x: 0, y: 0}, //
upDetainLamp: false, //
upDetainLampPoint: {x: 0, y: 0}, //
downDetainLamp: false, //
downDetainLampPoint: {x: 0, y: 0} //
},
editModel: getModel('StationStand'),
field: '',
addModel: {
stationCode: '', //
deviceStationCode: '', //
pointY: 0, // y
width: 60,
height: 20,
standTrackCode: '', //
standTrackUpCode: '', //
standTrackDownCode: '', //
stationstandDirection: '02', //
right: true,
defaultReentryStrategy: '', //
inside: false, //
small: false,
stopJumpLamp: false, //
stopJumpLampPoint: {x: 0, y: 0}, //
cancelStopJumpLamp: false, //
cancelStopJumpLampPoint: {x: 0, y: 0}, //
upDetainLamp: false, //
upDetainLampPoint: {x: 0, y: 0}, //
downDetainLamp: false, //
downDetainLampPoint: {x: 0, y: 0} //
small: false
},
allModel: {
width: '',
@ -250,29 +216,7 @@ export default {
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS },
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'defaultReentryStrategy', label: '默认折返策略:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.reentryStrategyList, clearable: true },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' },
{ prop: 'inside', label: '是否内站台:', type: 'checkbox' },
{ prop: 'stopJumpLamp', label: '跳停按钮:', type: 'checkbox'},
{ prop: 'stopJumpLampPoint', label: '跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isStopJumpPointsShow, children: [
{ prop: 'stopJumpLampPoint.x', firstLevel: 'stopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'stopJumpLampPoint.y', firstLevel: 'stopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'cancelStopJumpLamp', label: '取消跳停按钮:', type: 'checkbox'},
{ prop: 'cancelStopJumpLampPoint', label: '取消跳停按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isCancelStopJumpPointsShow, children: [
{ prop: 'cancelStopJumpLampPoint.x', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'cancelStopJumpLampPoint.y', firstLevel: 'cancelStopJumpLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'upDetainLamp', label: '上行扣车按钮:', type: 'checkbox'},
{ prop: 'upDetainLampPoint', label: '上行扣车按钮坐标:', type: 'coordinate', width: '120px', isHidden: !this.isUpDetainPointsShow, children: [
{ prop: 'upDetainLampPoint.x', firstLevel: 'upDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'upDetainLampPoint.y', firstLevel: 'upDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'downDetainLamp', label: '下行扣车按钮:', type: 'checkbox'},
{ prop: 'downDetainLampPoint', label: '下行扣车坐标:', type: 'coordinate', width: '120px', isHidden: !this.isDownDetainPointsShow, children: [
{ prop: 'downDetainLampPoint.x', firstLevel: 'downDetainLampPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'downDetainLampPoint.y', firstLevel: 'downDetainLampPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
{ prop: 'small', label: '是否小型站台:', type: 'checkbox' }
]
},
door: {
@ -309,20 +253,17 @@ export default {
isButtonTypeS() {
return this.field == 'sectionSelectCode';
},
isButtonTypeES() {
return this.field === 'editSectionSelectCode';
},
isStopJumpPointsShow() {
return this.activeName === 'first' ? this.editModel.stopJumpLamp : this.addModel.stopJumpLamp;
return this.editModel.stopJumpLamp;
},
isCancelStopJumpPointsShow() {
return this.activeName === 'first' ? this.editModel.cancelStopJumpLamp : this.addModel.cancelStopJumpLamp;
return this.editModel.cancelStopJumpLamp;
},
isUpDetainPointsShow() {
return this.activeName === 'first' ? this.editModel.upDetainLamp : this.addModel.upDetainLamp;
return this.editModel.upDetainLamp;
},
isDownDetainPointsShow() {
return this.activeName === 'first' ? this.editModel.downDetainLamp : this.addModel.downDetainLamp;
return this.editModel.downDetainLamp;
},
PhysicalSectionList() {
let list = [];
@ -355,33 +296,34 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
hover(field) {
this.field = field === this.field ? '' : field;
this.field = field == this.field ? '' : field;
this.$emit('standStationCode', this.field);
},
changeStation(station) {
this.editModel.deviceStationCode = this.getDeviceStationCode(station);
},
deviceSelect(selected) {
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
if (this.field != 'standSelectStationCode' && selected && selected._type == 'StationStand') {
this.editModel = getModel('StationStand');
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) {
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field == 'standSelectStationCode') {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectCode'.toUpperCase()) {
this.hover(this.field);
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field == 'sectionSelectCode') {
this.addModel.standTrackCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'editSectionSelectCode'.toUpperCase()) {
this.hover(this.field);
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field == 'editSectionSelectCode') {
this.editModel.standTrackCode = selected.code;
this.activeName = 'first';
this.field = '';
this.$emit('standStationCode', '');
this.hover(this.field);
}
},
create() {
@ -390,31 +332,22 @@ export default {
const models = [];
const space = this.$store.state.map.map.skinVO.code == '07' ? 0 : 8;
const Standuid = getUID('PF', this.stationStandList);
const model = {
_type: 'StationStand',
const stationStandModel = getModel('StationStand');
const data = {
code: Standuid,
name: `PF${this.stationStandList.length + 1}`,
width: this.addModel.width,
height: this.addModel.height,
deviceStationCode: this.getDeviceStationCode(this.addModel.stationCode),
visible: true,
position: {
x: 0,
y: this.addModel.pointY
},
standTrackCode: this.addModel.standTrackCode,
right: this.addModel.right,
small: this.addModel.small,
inside: this.addModel.inside,
stopJumpLamp: this.addModel.stopJumpLamp, //
stopJumpLampPoint: this.addModel.stopJumpLampPoint, //
cancelStopJumpLamp: this.addModel.cancelStopJumpLamp, //
cancelStopJumpLampPoint: this.addModel.cancelStopJumpLampPoint, //
upDetainLamp: this.addModel.upDetainLamp, //
upDetainLampPoint: this.addModel.upDetainLampPoint, //
downDetainLamp: this.addModel.downDetainLamp, //
downDetainLampPoint: this.addModel.downDetainLampPoint //
small: this.addModel.small
};
const model = Object.assign(stationStandModel, data);
this.stationList.forEach(elem => {
if (elem.code == this.addModel.stationCode) {
model.stationCode = elem.code;

View File

@ -2,14 +2,6 @@
<div>
<div class="flex_box">
<el-button type="primary" @click="create">{{ $t('map.createSwitch') }}</el-button>
<!-- <el-button type="" @click="questionList = []">{{ $t('map.clearHint') }}</el-button> -->
</div>
<div style="height: calc(100% - 46px);">
<!-- <el-scrollbar wrap-class="scrollbar-wrapper">
<el-card v-if="questionList.length" class="box-card">
<div v-for="(item, index) in questionList" :key="index" class="text item">{{ item }}</div>
</el-card>
</el-scrollbar> -->
</div>
</div>
</template>
@ -17,6 +9,8 @@
import { getUID } from '@/jmapNew/utils/Uid';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
import getModel from '../models.js';
export default {
name: 'CreateSwitch',
computed: {
@ -27,7 +21,6 @@ export default {
},
methods:{
create() { //
// this.questionList = []; //
const createArr = []; // model
const changeSectionList = this.changeSectionAttr();
changeSectionList.forEach(section => {
@ -45,8 +38,8 @@ export default {
});
if (section.code && sectionB.code && sectionC.code) {
const uname = 'W' + section.name.replace('T', '');
const model = {
_type: 'Switch',
const switchModel = getModel('Switch');
const data = {
code: getUID('W', [...this.switchList, ...createArr]),
name: uname,
nameShow: true,
@ -54,9 +47,7 @@ export default {
sectionACode: section.code,
sectionBCode: sectionB.code,
sectionCCode: sectionC.code,
namePosition: { x: 0, y: 0 },
turnTime: 3,
tp: { x: 0, y: 0 },
intersection: {
x: section.points[section.points.length - 1].x,
y: section.points[section.points.length - 1].y
@ -67,6 +58,7 @@ export default {
},
normalPosition: 1 //
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
!swch && createArr.push(model); //
}
@ -86,8 +78,8 @@ export default {
});
if (section.code && sectionB.code && sectionC.code) {
const uname = 'W' + section.name.replace('T', '');
const model = {
_type: 'Switch',
const switchModel = getModel('Switch');
const data = {
code: getUID('W', [...this.switchList, ...createArr]),
name: uname,
nameShow: true,
@ -95,9 +87,7 @@ export default {
sectionACode: section.code,
sectionBCode: sectionB.code,
sectionCCode: sectionC.code,
namePosition: { x: 0, y: 0 },
turnTime: 3,
tp: { x: 0, y: 0 },
intersection: {
x: section.points[0].x,
y: section.points[0].y
@ -108,6 +98,7 @@ export default {
},
normalPosition: 1 //
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
!swch && createArr.push(model); //
}
@ -327,41 +318,22 @@ export default {
if (JSON.stringify(sectiona.points[0]) === JSON.stringify(sectionb.points[sectionb.points.length - 1])) {
point = { x: sectiona.points[0].x, y: sectiona.points[0].y };
}
models.push({
_type: 'Section',
const sectionModel = getModel('Section');
const data = {
code: elem.uid,
name: sectiona.name,
type: '04',
namePosition: point,
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
// segmentation: false,
segmentationPosition: { x: 0, y: 0 },
switchSection: true,
relSwitchCode: '',
relevanceSectionList: elem.relevanceSectionList,
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
logicSectionShow: false,
sepTypeLeft: '00',
offsetLeft: 0,
sepTypeRight: '00',
offsetRight: 0,
parentCode: '',
stationCode: sectiona.stationCode,
trainPosType: sectiona.trainPosType,
curve: false,
nameShow: true
});
};
models.push(Object.assign(sectionModel, data));
}
});
}

View File

@ -28,6 +28,7 @@ import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import { EventBus } from '@/scripts/event-bus';
import getModel from '../models.js';
export default {
name: 'CreateAxle',
@ -99,8 +100,8 @@ export default {
if (sectiona.length <= 0) {
return false;
}
models.push({
_type: 'Section',
const sectionModel = getModel('Section');
const data = {
code: uid,
name: uid,
type: '04',
@ -108,34 +109,18 @@ export default {
x: sectiona[sectiona.length - 1].x,
y: sectiona[sectiona.length - 1].y
},
standTrack: false,
kmRangeRight: '',
kmRangeLeft: '',
region: '',
standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 },
reentryTrack: false,
reentryTrackName: '',
reentryTrackNamePosition: { x: 0, y: 0 },
transferTrack: false,
transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 },
segmentationPosition: { x: 0, y: 0 },
switchSection: true,
relSwitchCode: this.fromData.relevanceSwitchList[0],
relevanceSectionList: this.fromData.relevanceSectionList,
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
logicSectionShow: false,
sepTypeLeft: '00',
offsetLeft: 0,
sepTypeRight: '00',
offsetRight: 0,
parentCode: '',
stationCode: sectiona.stationCode,
trainPosType: sectiona.trainPosType,
curve: false,
nameShow: true
});
};
models.push(Object.assign(sectionModel, data));
this.$emit('updateMapModel', models);
this.fromData.relevanceSectionList = [];
this.fromData.relevanceSwitchList = [];

View File

@ -37,7 +37,6 @@ export default {
return {
activeName: 'first',
lazy: true,
// questionList: [],
field: ''
};
},
@ -47,11 +46,6 @@ export default {
'switchList'
])
},
watch: {
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: {
setCenter(code) {
this.$emit('setCenter', code);

View File

@ -17,6 +17,8 @@
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
import ConfigList from '../config/list';
import getModel from '../models.js';
export default {
name: 'SwitchModle',
components: {
@ -24,19 +26,7 @@ export default {
},
data() {
return {
editModel: {
code: '',
name: '',
turnTime: 0,
nameShow: false,
namePosition: { x: 0, y: 0 },
stationCode: '',
timeoutShow: false,
sectionACode: '',
sectionBCode: '',
sectionCCode: '',
tp: { x: 0, y: 0 }
}
editModel: getModel('Switch')
};
},
computed: {

View File

@ -78,14 +78,6 @@ export default {
'lineCode'
])
},
watch: {
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
$route() {
// this.activeName = 'first';
}
},
methods: {
deviceChange(code) {
this.$emit('setCenter', code);
@ -96,9 +88,6 @@ export default {
this.editModel.code = selected.code;
this.editModel.modelCode = selected.modelCode;
this.editModel.groupNumber = selected.groupNumber;
// this.activeName = 'first';
} else {
// this.activeName = 'second';
}
},
create(list) {