This commit is contained in:
joylink_cuiweidong 2019-12-12 10:41:32 +08:00
commit eec32fea2a
19 changed files with 641 additions and 345 deletions

View File

@ -401,3 +401,71 @@ export function getContinueProtectList(mapId, params) {
params
});
}
// 自动折返相关接口 创建修改删除根据id查询,
export function postAutoReentry(data) {
return request({
url: `/api/mapBuild/autoReentry`,
method: 'post',
data:data
});
}
export function putAutoReentry(data) {
return request({
url: `/api/mapBuild/autoReentry/${data.id}`,
method: 'put',
data:data
});
}
export function delAutoReentry(id) {
return request({
url: `/api/mapBuild/autoReentry/${id}`,
method: 'delete'
});
}
export function getAutoReentryById(id) {
return request({
url: `/api/mapBuild/autoReentry/${id}`,
method: 'get'
});
}
export function getAutoReentryList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoReentry/paging`,
method: 'get',
params
});
}
// 新版地图进路相关接口 创建修改删除根据id查询,
export function postRouteNew(data) {
return request({
url: `/api/mapBuild/routeNew`,
method: 'post',
data:data
});
}
export function putRouteNew(data) {
return request({
url: `/api/mapBuild/routeNew/${data.id}`,
method: 'put',
data:data
});
}
export function delRouteNew(id) {
return request({
url: `/api/mapBuild/routeNew/${id}`,
method: 'delete'
});
}
export function getRouteNewById(id) {
return request({
url: `/api/mapBuild/routeNew/${id}`,
method: 'get'
});
}
export function getRouteNewList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/routeNew`,
method: 'get',
params
});
}

View File

@ -23,7 +23,7 @@ export default class Line2 extends Group {
z: this.z,
style: style,
x: model.position.x,
y: model.position.y,
y: model.position.y - (model.height / 2),
width: model.width || style.StationStand.safetyDoor.width,
height: model.height || style.StationStand.safetyDoor.height,
show: model.hasDoor

View File

@ -2,38 +2,38 @@ import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
class ESafeStand extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
create() {
const model = this.model;
const style = this.model.style;
this.stand = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.x,
y: model.y,
width: model.width,
height: model.height
},
style: {
lineWidth: 0,
stroke: style.sidelineColor,
fill: style.StationStand.stand.spareColor
}
});
this.stand = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.x,
y: model.y,
width: model.width,
height: model.height
},
style: {
lineWidth: 0,
stroke: style.sidelineColor,
fill: style.StationStand.stand.spareColor
}
});
this.add(this.stand);
}
this.add(this.stand);
}
setColor(color) {
this.stand.setStyle('fill', color);
}
setColor(color) {
this.stand.setStyle('fill', color);
}
}
export default ESafeStand;

View File

@ -33,9 +33,9 @@ class StationStand extends Group {
const drict = 1;
/** 列车站台*/
const standH = drict > 0 ? style.StationStand.safetyDoor.height : model.height;
// const standH = drict > 0 ? style.StationStand.safetyDoor.height : model.height;
const standX = model.position.x - model.width / 2;
const standY = model.position.y + drict * (style.StationStand.safetyDoor.distance + standH);
const standY = model.position.y - model.height / 2;
this.safeStand = new ESafeStand({
zlevel: this.zlevel,
z: this.z,
@ -47,124 +47,124 @@ class StationStand extends Group {
});
this.add(this.safeStand);
if (model.direction != '03') {
// /** 屏蔽门*/
// this.safeDoor = new ESafeDoor({
// zlevel: this.zlevel,
// z: this.z,
// style: style,
// x: model.position.x,
// y: model.position.y,
// width: model.width,
// height: style.StationStand.safetyDoor.height,
// show: model.hasDoor
// });
// if (model.direction != '03') {
// /** 屏蔽门*/
// this.safeDoor = new ESafeDoor({
// zlevel: this.zlevel,
// z: this.z,
// style: style,
// x: model.position.x,
// y: model.position.y,
// width: model.width,
// height: style.StationStand.safetyDoor.height,
// show: model.hasDoor
// });
/** 站台紧急关闭*/
const emergentH = drict > 0 ? style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.height : style.StationStand.standEmergent.mergentR;
const emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x);
const emergentY = model.position.y + drict * (style.StationStand.standEmergent.offset.y + emergentH);
this.emergent = new ESafeEmergent({
/** 站台紧急关闭*/
const emergentH = drict > 0 ? style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.height : style.StationStand.standEmergent.mergentR;
const emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x);
const emergentY = model.position.y + drict * (style.StationStand.standEmergent.offset.y + emergentH);
this.emergent = new ESafeEmergent({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: emergentX,
y: emergentY,
r: style.StationStand.standEmergent.mergentR,
n: 4
});
/** 站台折返策略*/
const reentryD = style.StationStand.reentry.position ? model.height + 6 : -style.StationStand.safetyDoor.distance - style.StationStand.safetyDoor.height;
const reentryH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + reentryD;
const reentryX = model.position.x - (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.x - model.width / 2);
const reentryY = model.position.y + (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.y) + drict * reentryH;
this.reentry = new EReentry({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
drict: drict,
x: reentryX,
y: reentryY,
lineWidth: 0,
fill: style.StationStand.reentry.noHumanColor
});
const distance = style.StationStand.safetyDoor.height * 2 - style.StationStand.stand.headFontSize / 2 - 2;
/** 站台扣车*/
const detainD = style.StationStand.detainCar.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const detainH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + detainD;
const detainX = model.position.x - (style.StationStand.detainCar.position || drict) * (style.StationStand.detainCar.offset.x - model.width / 2);
const detainY = model.position.y + (style.StationStand.detainCar.position || drict) * (style.StationStand.detainCar.offset.y) + drict * detainH;
this.detain = new EDetain({
zlevel: this.zlevel,
z: this.z,
style: style,
x: detainX,
y: detainY,
textAlign: 'middle',
textVerticalAlign: 'top'
});
/** 停站时间*/
const timeD = style.StationStand.stopTime.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const timeH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + timeD;
const timeX = model.position.x - (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.x - model.width / 2);
const timeY = model.position.y + (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.y) + drict * timeH;
this.time = new ETime({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: timeX,
y: timeY,
name: model.parkingTime || '30'
});
/** 运行等级*/
const levelD = style.StationStand.level.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const levelH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + levelD;
const levelX = model.position.x - (style.StationStand.level.position || drict) * (style.StationStand.level.offset.x - model.width / 2);
const levelY = model.position.y + (style.StationStand.level.position || drict) * (style.StationStand.level.offset.y) + drict * levelH;
this.level = new ELevel({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: levelX,
y: levelY,
name: model.intervalRunTime || '5'
});
/** 列车停跳 */
if (style.StationStand.common.haveJumpShow) {
const jumpD = style.StationStand.jump.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const jumpH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + jumpD;
const jumpX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2);
const jumpY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y) + drict * jumpH;
const jumpCX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2);
const jumpCY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y - style.StationStand.common.textFontSize / 2) + drict * jumpH;
this.jump = new EJump({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: emergentX,
y: emergentY,
r: style.StationStand.standEmergent.mergentR,
n: 4
});
/** 站台折返策略*/
const reentryD = style.StationStand.reentry.position ? model.height + 6 : -style.StationStand.safetyDoor.distance - style.StationStand.safetyDoor.height;
const reentryH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + reentryD;
const reentryX = model.position.x - (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.x - model.width / 2);
const reentryY = model.position.y + (style.StationStand.reentry.position || drict) * (style.StationStand.reentry.offset.y) + drict * reentryH;
this.reentry = new EReentry({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
drict: drict,
x: reentryX,
y: reentryY,
lineWidth: 0,
fill: style.StationStand.reentry.noHumanColor
});
const distance = style.StationStand.safetyDoor.height * 2 - style.StationStand.stand.headFontSize / 2 - 2;
/** 站台扣车*/
const detainD = style.StationStand.detainCar.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const detainH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + detainD;
const detainX = model.position.x - (style.StationStand.detainCar.position || drict) * (style.StationStand.detainCar.offset.x - model.width / 2);
const detainY = model.position.y + (style.StationStand.detainCar.position || drict) * (style.StationStand.detainCar.offset.y) + drict * detainH;
this.detain = new EDetain({
zlevel: this.zlevel,
z: this.z,
style: style,
x: detainX,
y: detainY,
x: jumpX,
y: jumpY,
cx: jumpCX,
cy: jumpCY,
textAlign: 'middle',
textVerticalAlign: 'top'
textVerticalAlign: 'top',
jumpStopStatus: model.jumpStopStatus
});
/** 停站时间*/
const timeD = style.StationStand.stopTime.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const timeH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + timeD;
const timeX = model.position.x - (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.x - model.width / 2);
const timeY = model.position.y + (style.StationStand.stopTime.position || drict) * (style.StationStand.stopTime.offset.y) + drict * timeH;
this.time = new ETime({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: timeX,
y: timeY,
name: model.parkingTime || '30'
});
/** 运行等级*/
const levelD = style.StationStand.level.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const levelH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + levelD;
const levelX = model.position.x - (style.StationStand.level.position || drict) * (style.StationStand.level.offset.x - model.width / 2);
const levelY = model.position.y + (style.StationStand.level.position || drict) * (style.StationStand.level.offset.y) + drict * levelH;
this.level = new ELevel({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: levelX,
y: levelY,
name: model.intervalRunTime || '5'
});
/** 列车停跳 */
if (style.StationStand.common.haveJumpShow) {
const jumpD = style.StationStand.jump.position ? model.height - distance : -style.StationStand.safetyDoor.height;
const jumpH = drict > 0 ? style.StationStand.standEmergent.mergentR : style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.distance + jumpD;
const jumpX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2);
const jumpY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y) + drict * jumpH;
const jumpCX = model.position.x - (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.x - model.width / 2);
const jumpCY = model.position.y + (style.StationStand.jump.position || drict) * (style.StationStand.jump.offset.y - style.StationStand.common.textFontSize / 2) + drict * jumpH;
this.jump = new EJump({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: jumpX,
y: jumpY,
cx: jumpCX,
cy: jumpCY,
textAlign: 'middle',
textVerticalAlign: 'top',
jumpStopStatus: model.jumpStopStatus
});
this.add(this.jump);
}
this.add(this.safeDoor);
this.add(this.emergent);
this.add(this.detain);
this.add(this.reentry);
this.add(this.time);
this.add(this.level);
this.add(this.jump);
}
this.add(this.safeDoor);
this.add(this.emergent);
this.add(this.detain);
this.add(this.reentry);
this.add(this.time);
this.add(this.level);
// }
}
createMouseEvent() {

View File

@ -8,7 +8,17 @@ export function getUID(type, list) {
// if (list && list.length) {
let name = '';
if (type == 'T') {
name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
if (list.length) {
const str = list[list.length - 1].code.substr(0, 1);
if (str == 'T') {
name = Number(list[list.length - 1].code.replace('T', '')) + 1;
} else {
name = 1;
}
} else {
name = list.length + 1;
}
// name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
} else {
name = Math.floor((Math.random() * 100000) + 1);
}

View File

@ -3,11 +3,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'; // 杜康
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -4,7 +4,7 @@
<template v-if="basicInfo">
<el-form ref="edit" label-position="right" :model="editModel" :rules="editRules" label-width="120px" size="mini" @submit.native.prevent>
<el-form-item :label="$t('map.lineCode')" prop="lineCode">
<el-select v-model="editModel.lineCode" :placeholder="$t('map.pleaseSelect')" size="mini" disabled>
<el-select v-model="editModel.lineCode" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option
v-for="item in lineCodeList"
:key="item.code"

View File

@ -13,14 +13,6 @@
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
</div>
<el-tabs v-model="enabledTab" type="card" class="map_card" @tab-click="changePane">
<el-tab-pane :label="$t('map.continueProtect')" class="tab_pane_box" name="protect">
<protect-operate
ref="protectOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
<route-operate
ref="routeOperate"
@ -29,7 +21,15 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="折返" class="tab_pane_box" name="turned">
<el-tab-pane :label="$t('map.continueProtect')" class="tab_pane_box" name="protect">
<protect-operate
ref="protectOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="自动折返" class="tab_pane_box" name="turned">
<turned-operate
ref="trunedOperate"
:map-info="mapInfo"
@ -138,6 +138,9 @@ export default {
case 'path':
this.$refs.pathOperate.createRouteEvent();
break;
case 'turned':
this.$refs.trunedOperate.createRouteEvent();
break;
}
},
previewRouteEvent() {
@ -160,6 +163,9 @@ export default {
case 'path':
this.$refs.pathOperate.previewRouteEvent();
break;
case 'turned':
this.$refs.trunedOperate.previewRouteEvent();
break;
}
},
changePane(data) {
@ -185,6 +191,9 @@ export default {
case 'path':
this.$refs.pathOperate.setSelected(selected);
break;
case 'turned':
this.$refs.trunedOperate.setSelected(selected);
break;
}
},
setCenter(code) {

View File

@ -13,7 +13,6 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getContinueProtectList, delContinueProtect, getContinueProtectById } from '@/api/jmap/mapdraft';
export default {
@ -150,7 +149,7 @@ export default {
}
},
selectedObj(index, row) {
this.$emit('setOverlapCode', row.code);
this.$emit('setOverlapCode', row);
this.show = false;
}
}

View File

@ -289,7 +289,7 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postContinueProtect(this.buildModel(getUID('protect'))).then(resp => {
postContinueProtect(this.buildModel(getUID('Protect'))).then(resp => {
this.$message.success('创建延续保护成功!');
this.loading = false;
this.clear();

View File

@ -14,7 +14,7 @@
<script>
import { mapGetters } from 'vuex';
import { listMap, listRouteRoute, deleteRouteRoute, queryRouteRouteDetail, updateRouteRoute } from '@/api/jmap/mapdraft'; /** listRouteMapRoute*/
import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList } from '@/api/jmap/mapdraft'; /** listRouteMapRoute*/
import PreViewField from './preview';
export default {
@ -33,10 +33,13 @@ export default {
data() {
return {
show: false,
showType: '',
codeType: '',
mapList: [],
RouteNatureTypeList: [],
RouteAutoTypeList: [],
SwitchLocateTypeList: [],
ContinueProtectList: [],
turnBackList: [
{ label: '是', value: true },
{ label: '否', value: false }
@ -106,15 +109,19 @@ export default {
prop: 'endSignalCode'
},
{
type: 'button',
title: this.$t('map.continueProtectSwitchData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.overlapSwitchDetail
}
]
title: '延续保护',
prop: 'overlapCode'
},
// {
// type: 'button',
// title: this.$t('map.continueProtectSwitchData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.overlapSwitchDetail
// }
// ]
// },
{
type: 'button',
title: this.$t('map.accessSideTurnoutData'),
@ -125,16 +132,16 @@ export default {
}
]
},
{
type: 'button',
title: this.$t('map.routeProtectsData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.routeOverlap
}
]
},
// {
// type: 'button',
// title: this.$t('map.routeProtectsData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.routeOverlap
// }
// ]
// },
{
type: 'button',
@ -173,12 +180,19 @@ export default {
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.edit
handleClick: this.edit,
showControl: () => { return this.showType !== 'select'; }
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
type: 'danger',
showControl: () => { return this.showType !== 'select'; }
},
{
name: '选择',
handleClick: this.selectedObj,
showControl: () => { return this.showType === 'select'; }
}
]
}
@ -228,20 +242,24 @@ export default {
this.$Dictionary.switchLocateType().then(list => {
this.SwitchLocateTypeList = list;
});
this.getProtectList();
this.acquireMapList();
},
methods: {
doShow() {
doShow(showType, codeType) {
this.show = true;
this.reloadTable();
if (showType && codeType) {
this.showType = showType;
this.codeType = codeType;
}
},
doClose() {
this.show = false;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return listRouteRoute(this.mapInfo.id, params);
return getRouteNewList(this.mapInfo.id, params);
}
},
acquireMapList() {
@ -263,6 +281,7 @@ export default {
that.$convertSpecifiedField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']);
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['nearSectionCode', 'autoTriggerSectionCode', 'turnBackSectionCode']);
that.$convertSpecifiedField(elem, that.ContinueProtectList, 'code', 'name', ['overlapCode']);
});
}
}
@ -397,7 +416,7 @@ export default {
},
//
saveRelated(row) {
updateRouteRoute(row).then(response => {
putRouteNew(row).then(response => {
this.$message.success('更新成功');
}).catch(() => {
this.$messageBox('操作异常');
@ -410,7 +429,7 @@ export default {
mapId: elem.id,
id: row.id
};
queryRouteRouteDetail(model).then(response => {
getRouteNewById(model.id).then(response => {
const data = response.data;
this.$emit('routeSelected', data);
this.doClose();
@ -425,7 +444,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRouteRoute(row.id).then(response => {
delRouteNew(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(() => {
@ -440,6 +459,16 @@ export default {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
selectedObj(index, row) {
this.$emit('setRouteCode', row, this.codeType);
this.show = false;
},
// list
getProtectList() {
getContinueProtectList(this.$route.params.mapId, {pageSize:9999, pageNum:1}).then((resp) => {
this.ContinueProtectList = resp.data.list;
});
}
}
};

View File

@ -189,7 +189,7 @@
</el-select>
</el-form-item>
<el-form-item label="关联延续保护区段:" prop="overlapCode">
<el-input v-model="addModel.overlapCode" style="width: 178px" readonly="true" />
<el-input v-model="overlapName" style="width: 178px" readonly="true" />
<el-button type="primary" @click="selectedOverlapCode">选择</el-button>
</el-form-item>
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
@ -221,7 +221,7 @@
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
import { postRouteNew, putRouteNew, getContinueProtectList } from '@/api/jmap/mapdraft';
import ProtectDetail from '../protectoperate/detail';
export default {
@ -282,7 +282,8 @@ export default {
espList: [], //
overlapCode:'',
conflictingRouteList: [] //
}
},
overlapName: ''
};
},
computed: {
@ -341,7 +342,7 @@ export default {
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.handelContinueProtectCode(val);
this.addModel.routeFlankProtectionList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
@ -375,8 +376,9 @@ export default {
deviceChange(code) {
this.$emit('setCenter', code);
},
setOverlapCode(code) {
this.addModel.overlapCode = code;
setOverlapCode(data) {
this.addModel.overlapCode = data.code;
this.overlapName = data.name;
},
selectedOverlapCode() {
this.$refs.routeDetail.doShow('select');
@ -405,7 +407,7 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
createRouteRoute(this.buildModel(getUID('Route'))).then(response => {
postRouteNew(this.buildModel(getUID('Route'))).then(response => {
this.$message.success('创建成功');
this.loading = false;
this.clear();
@ -420,7 +422,7 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
updateRouteRoute(this.buildModel()).then(response => {
putRouteNew(this.buildModel()).then(response => {
this.$message.success(this.$t('map.updateSuccessfully'));
this.loading = false;
this.clear();
@ -438,6 +440,8 @@ export default {
this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSwitchList = [];
this.addModel.routeFlankProtectionList = [];
this.overlapName = '';
this.addModel.overlapCode = '';
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = this.selected.code;
}
@ -466,6 +470,13 @@ export default {
this.flankCode = selected.code;
}
}
},
async handelContinueProtectCode(val) {
if (val.overlapCode) {
const resp = await getContinueProtectList(this.$route.params.mapId, {pageSize:9999, pageNum:1, code:val.overlapCode});
this.overlapName = resp.data.list.length ? resp.data.list[0].name : '';
}
this.addModel = val;
}
}
};

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<el-dialog v-dialogDrag title="自动折返列表" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
@ -13,8 +13,7 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getAutoSignalList, delAutoSignal, getAutoSignalDetail } from '@/api/jmap/mapdraft';
import { getAutoReentryList, delAutoReentry, getAutoReentryById, getRouteNewList } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
@ -29,20 +28,17 @@ export default {
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
routeList: [],
queryForm: {
labelWidth: '120px',
queryObject: {
signalCode: {
type: 'select',
label: this.$t('map.signal'),
config: {
data: []
}
name: {
type: 'text',
label: '自动折返名称'
}
}
},
@ -53,29 +49,20 @@ export default {
indexShow: true,
columns: [
{
title: this.$t('map.signalCodeName'),
prop: 'signalCode'
title: '自动折返名称',
prop: 'name'
},
{
title: this.$t('map.interlockingBlocks'),
prop: 'sectionList',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.sectionList, this.sectionList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
title: '折返进路',
prop: 'turnBackRouteCode'
},
{
title: this.$t('map.psdList'),
prop: 'psdList',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.psdList, this.psdList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
title: '基础进路',
prop: 'basicRouteCode'
},
{
title: this.$t('map.espList'),
prop: 'espList',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.espList, this.espList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
title: '折返区段',
prop: 'reentryTrackCode'
},
{
type: 'button',
@ -99,79 +86,52 @@ export default {
},
computed: {
...mapGetters('map', [
'sectionList',
'signalList',
'espList',
'psdList'
'sectionList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.getRouteList();
this.reloadTable();
},
doClose() {
this.show = false;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.uniqueName;
}
return name;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getAutoSignalList(this.mapInfo.id, params);
return getAutoReentryList(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap({ drawWay:'1'}).then(response => {
this.mapList = response.data;
});
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
elem.code = elem.signalCode;
elem.signalCode = that.formatName(elem.signalCode);
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['reentryTrackCode']);
that.$convertSpecifiedField(elem, that.routeList, 'code', 'name', ['turnBackRouteCode', 'basicRouteCode']);
});
}
}
return data;
},
editObj(index, row) {
getAutoSignalDetail(row.id).then(response => {
getAutoReentryById(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.$emit('autoReentrySelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
delAutoSignal(row.id).then(response => {
delAutoReentry(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
@ -183,6 +143,11 @@ export default {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
getRouteList() {
getRouteNewList(this.$route.params.mapId, {pageSize:9999, pageNum:1}).then((resp) => {
this.routeList = resp.data.list;
});
}
}
};

View File

@ -6,7 +6,7 @@
:map-info="mapInfo"
:route-data="routeData"
/>
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
<route-detail ref="routeDetail" :map-info="mapInfo" @autoReentrySelected="autoReentrySelected" />
</div>
</template>
<script>
@ -57,7 +57,7 @@ export default {
});
}
},
autoMaticoSelected: function (data) {
autoReentrySelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;

View File

@ -4,15 +4,29 @@
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
<div class="definition">
<el-form-item label="折返名称:" prop="name">
<el-input v-model="addModel.name" />
<el-input v-model="addModel.name" style="width: 178px" />
</el-form-item>
<el-form-item label="折返进路" prop="turnBackRouteCode">
<el-input v-model="addModel.turnBackRouteName" />
<el-button type="primary">选择</el-button>
<el-form-item label="折返进路:" prop="turnBackRouteName">
<el-input v-model="addModel.turnBackRouteName" readonly="true" style="width: 178px" />
<el-button type="primary" @click="selectedRoute('turnBackRoute')">选择</el-button>
</el-form-item>
<el-form-item label="基础进路" prop="basicRouteCode">
<el-input v-model="addModel.basicRouteName" />
<el-button type="primary">选择</el-button>
<el-form-item label="基础进路:" prop="basicRouteName">
<el-input v-model="addModel.basicRouteName" readonly="true" style="width: 178px" />
<el-button type="primary" @click="selectedRoute('basicRoute')">选择</el-button>
</el-form-item>
<el-form-item label="折返区段:" prop="reentryTrackCode">
<el-select v-model="addModel.reentryTrackCode">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'reentryTrackCode' ? 'danger' : 'primary'"
@click="hover('reentryTrackCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
@ -25,17 +39,23 @@
</div>
</el-form>
</el-scrollbar>
<route-detail ref="routeDetail" :map-info="mapInfo" @setRouteCode="setRouteCode" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { postAutoSignal, putAutoSignal } from '@/api/jmap/mapdraft';
import { postAutoReentry, putAutoReentry, getRouteNewList } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
import RouteDetail from '../routeoperate/detail';
import { deepAssign } from '@/utils/index';
export default {
name: 'RouteOperation',
components: {
RouteDetail
},
props: {
selected: {
type: Object,
@ -70,25 +90,29 @@ export default {
turnBackRouteName: '',
basicRouteName:'',
turnBackRouteCode: '',
basicRouteCode:''
basicRouteCode:'',
priority: '',
reentryTrackCode: ''
},
editShow: false,
rules: {
name: [
{ required: true, message: '请输入折返名称', trigger: 'blur' }
],
turnBackRouteCode: [
turnBackRouteName: [
{ required: true, message: '请选择折返进路', trigger: 'blur' }
],
basicRouteCode: [
basicRouteName: [
{ required: true, message: '请选择基础进路', trigger: 'blur'}
],
reentryTrackCode: [
{ required: true, message: '请选择折返区段', trigger: 'change'}
]
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'sectionList'
])
},
@ -100,7 +124,7 @@ export default {
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.handelRouteName(val);
this.editShow = true;
}
}
@ -115,14 +139,13 @@ export default {
formatName(code) {
return formatName(code);
},
selectedRoute(codeType) {
this.$refs.routeDetail.doShow('select', codeType);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) {
this.addModel.signalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionList'.toUpperCase()) {
if (this.addModel.sectionList.indexOf(selected.code) === -1) {
this.addModel.sectionList.push(selected.code);
}
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'reentryTrackCode'.toUpperCase()) {
this.addModel.reentryTrackCode = selected.code;
}
}
},
@ -130,19 +153,18 @@ export default {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
model['mapId'] = this.mapInfo.id;
model['autoSignalId'] = this.addModel.id;
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
this.$message.success(this.$t('map.automaticSignalSuccessful'));
postAutoReentry(this.buildModel(getUID('TurnedAround'))).then(resp => {
this.$message.success('创建折返成功!');
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.failedCreateSignal'));
this.$messageBox('创建折返失败!');
this.loading = false;
});
}
@ -152,12 +174,12 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putAutoSignal(this.buildModel()).then(resp => {
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
putAutoReentry(this.buildModel()).then(resp => {
this.$message.success('更新折返成功!');
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
this.$messageBox('更新折返失败!');
this.loading = false;
});
}
@ -166,13 +188,34 @@ export default {
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.basicRouteName = '';
this.addModel.basicRouteCode = '';
this.addModel.turnBackRouteName = '';
this.addModel.turnBackRouteCode = '';
this.addModel.mapId = this.mapInfo.id;
this.addModel.sectionList = [];
this.addModel.signalCode = '';
this.addModel.code = '';
this.$refs.form.resetFields();
this.isSave = true;
}
},
setRouteCode(data, type) {
if (type === 'basicRoute') {
this.addModel.basicRouteName = data.name;
this.addModel.basicRouteCode = data.code;
} else if (type === 'turnBackRoute') {
this.addModel.turnBackRouteName = data.name;
this.addModel.turnBackRouteCode = data.code;
}
},
async handelRouteName(data) {
const model = {};
const resp1 = await getRouteNewList(this.$route.params.mapId, {pageSize:10, pageNum:1, code: data.basicRouteCode});
model.basicRouteName = resp1.data.list.length ? resp1.data.list[0].name : '';
const resp2 = await getRouteNewList(this.$route.params.mapId, {pageSize:10, pageNum:1, code: data.turnBackRouteCode});
model.turnBackRouteName = resp2.data.list.length ? resp2.data.list[0].name : '';
this.addModel = deepAssign(model, data);
}
}
};

View File

@ -261,7 +261,8 @@ export default {
mapEditShow: false,
mapPaintShow: true
},
oldDevice: null
oldDevice: null,
isSwitchSection: false
};
},
computed: {
@ -319,10 +320,26 @@ export default {
this.enabledTab = 'Section';
} else {
this.enabledTab = type;
if ( this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') {
if (this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') {
if (this.isSwitchSection) {
if (this.oldDevice._type == 'Section' && this.oldDevice.type == '04') {
this.oldDevice.relevanceSectionList.forEach(item => {
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
sectionModel.instance.drawSelected(false);
});
this.isSwitchSection = false;
}
}
this.oldDevice.instance.drawSelected(false);
}
if ( device && device.instance && typeof device.instance.drawSelected === 'function' ) {
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
if (device._type == 'Section' && device.type == '04') {
this.isSwitchSection = true;
device.relevanceSectionList.forEach(item => {
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
sectionModel.instance.drawSelected(true);
});
}
device.instance.drawSelected(true);
}
this.oldDevice = device;

View File

@ -17,21 +17,6 @@
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="关联站台" prop="standCode">
<el-select v-model="addModel.standCode" filterable>
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'standSelectStationCode' ? 'danger' : 'primary'"
size="small"
@click="hover('standSelectStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="关联站台轨:" prop="standTrackCode">
<el-select v-model="addModel.standTrackCode" filterable>
<el-option
@ -47,6 +32,27 @@
@click="hover('sectionSelectCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="关联站台:" prop="standCode">
<el-select v-model="addModel.standCode" filterable>
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'standSelectStationCode' ? 'danger' : 'primary'"
size="small"
@click="hover('standSelectStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="屏蔽门宽度:" prop="width">
<el-input-number v-model="addModel.width" style="width: 140px" />
</el-form-item>
<el-form-item label="屏蔽门高度:" prop="height">
<el-input-number v-model="addModel.height" style="width: 140px" />
</el-form-item>
<el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
<el-radio-group v-model="addModel.doorLocationType">
<el-radio v-for="item in DoorLocationTypeList" :key="item.code" :label="item.code" border>{{ item.name }}</el-radio>
@ -92,14 +98,16 @@ export default {
name: '',
standCode: '', // code
standTrackCode: '', //
width: 80,
height: 5,
width: 60,
height: 3,
position: { x: 0, y: 0 },
doorLocationType: '01' //
},
field: '',
addModel: {
standCode: '',
width: 60,
height: 3,
standTrackCode: '',
doorLocationType: '01' //
}
@ -250,9 +258,9 @@ export default {
};
this.stationStandList.forEach(elem => {
if (elem.code === this.addModel.standCode) {
model.position = { x: elem.position.x, y: elem.position.y };
model.position = { x: elem.position.x, y: elem.position.y - (elem.height / 2) - 8 };
if (this.addModel.doorLocationType == '01') { //
model.position = { x: elem.position.x, y: elem.position.y + ( 2 * elem.height) };
model.position = { x: elem.position.x, y: elem.position.y + (elem.height / 2) + 8 };
}
}
});

View File

@ -438,8 +438,8 @@ export default {
map: {
name: this.$t('map.mapData'),
item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
{ prop: 'lengthFact', label: this.$t('map.actualLength'), type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: !this.isPhysicalSection },
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },

View File

@ -16,7 +16,8 @@
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<config-list ref="make" :form="addForm" :form-model="addModel" :rules="createRules" />
<!-- <el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable @change="changeStation">
<el-option
@ -32,20 +33,7 @@
@click="hover('standSelectStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<!-- <el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
<el-select v-model="addModel.doorLocationType" filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in DoorLocationTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item> -->
<!-- <el-form-item :label="$t('map.stationstandHasDoor')" prop="hasDoor">
<el-checkbox v-model="addModel.hasDoor" />
</el-form-item> -->
</el-form>
</el-form> -->
</el-scrollbar>
</div>
<div class="button_box">
@ -100,10 +88,16 @@ export default {
},
field: '',
addModel: {
stationCode: '',
// doorLocationType: '01',
deviceStationCode: ''
// hasDoor: true
stationCode: '', //
deviceStationCode: '', //
pointY: 0, // y
width: 60,
height: 20,
doorType: '01', //
standTrackCode: '', //
standTrackUpCode: '', //
standTrackDownCode: '', //
stationstandDirection: '02' //
}
};
},
@ -111,7 +105,8 @@ export default {
...mapGetters('map', [
'stationList',
'stationStandList',
'lineCode'
'sectionList',
'psdList'
]),
form() {
const form = {
@ -178,12 +173,84 @@ export default {
return rules;
},
addForm() {
return {
labelWidth: '130px',
items: {
stand: {
name: '站台数据',
item: [
{ prop: 'stationCode', label: this.$t('map.stationstandName'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'standSelectStationCode', buttonShowType: this.isButtonType },
{ prop: 'pointY', label: 'Y 坐标:', type: 'number' },
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }
]
},
door: {
name: '屏蔽门数据',
item: [
{ prop: 'doorType', label: '屏蔽门类型:', type: 'radio', radioList: [
{value: '01', label: '单侧屏蔽门' },
{value: '02', label: '双侧屏蔽门' }
] },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne },
{ prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo },
{ prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo }
]
}
}
};
},
createRules() {
return {
stationCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
],
pointY: [
{ required: true, message: '请输入y坐标', trigger: 'blur' }
],
width: [
{ required: true, message: '请输入站台宽度', trigger: 'blur' }
],
height: [
{ required: true, message: '请输入站台高度', trigger: 'blur' }
],
standTrackCode: [
{ required: true, message: '请选择关联站台轨', trigger: 'change' }
],
standTrackUpCode: [
{ required: true, message: '请选择站台轨', trigger: 'change' }
],
standTrackDownCode: [
{ required: true, message: '请选择站台轨', trigger: 'change' }
]
};
},
isButtonType() {
return this.field == 'standSelectStationCode';
},
isButtonTypeS() {
return this.field == 'sectionSelectCode';
},
isButtonTypeU() {
return this.field == 'sectionSelectUpCode';
},
isButtonTypeD() {
return this.field == 'sectionSelectDownCode';
},
doorTypeOne() {
return this.addModel.doorType == '01';
},
doorTypeTwo() {
return this.addModel.doorType == '02';
},
PhysicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01'; });
}
return list;
}
},
watch: {
@ -193,7 +260,11 @@ export default {
},
mounted() {
this.$Dictionary.doorLocationType().then(list => {
this.DoorLocationTypeList = list;
this.DoorLocationTypeList = [];
list.forEach(item => {
const param = { value: item.code, label: item.name };
this.DoorLocationTypeList.push(param);
});
});
this.$Dictionary.runDirectionType().then(list => {
this.RunDirectionTypeList = list;
@ -220,7 +291,6 @@ export default {
this.$emit('standStationCode', this.field);
},
deviceSelect(selected) {
// this.$refs.make.resetFields();
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.activeName = 'first';
@ -231,32 +301,99 @@ export default {
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectCode'.toUpperCase()) {
this.addModel.standTrackCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectUpCode'.toUpperCase()) {
this.addModel.standTrackUpCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectDownCode'.toUpperCase()) {
this.addModel.standTrackDownCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('PF', this.stationStandList);
const models = [];
const space = 8;
const Standuid = getUID('PF', this.stationStandList);
const model = {
_type: 'StationStand',
code: uid,
code: Standuid,
name: `PF${this.stationStandList.length + 1}`,
width: 40,
height: 20,
// doorLocationType: this.addModel.doorLocationType,
width: this.addModel.width,
height: this.addModel.height,
deviceStationCode: this.addModel.deviceStationCode,
visible: true
// direction: '01',
// hasDoor: this.addModel.hasDoor
visible: true,
position: {
x: 0,
y: this.addModel.pointY
}
};
this.stationList.forEach(elem => {
if (elem.code === this.addModel.stationCode) {
model.position = { x: elem.position.x, y: elem.position.y + 40 };
if (elem.code == this.addModel.stationCode) {
model.position.x = elem.position.x;
model.stationCode = elem.code;
}
});
this.$emit('updateMapModel', model);
models.push(model);
if (this.addModel.doorType == '01') {
const uid = getUID('Psd', this.psdList);
const param = {
_type: 'Psd',
code: uid,
name: `Psd${this.psdList.length + 1}`,
width: this.addModel.width,
height: 3,
standCode: Standuid, // code
standTrackCode: this.addModel.standTrackCode, //
position: {
x: models[0].position.x,
y: this.addModel.pointY - (this.addModel.height / 2) - space
}
};
if (this.addModel.stationstandDirection == '01') { //
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
}
models.push(param);
} else if (this.addModel.doorType == '02') {
const arr = [];
for (let index = 0; index < 2; index++) {
const uid = getUID('Psd', [...this.psdList, ...arr]);
const param = {
_type: 'Psd',
code: uid,
name: `Psd${[...this.psdList, ...arr].length + 1}`,
width: this.addModel.width,
height: 3,
standCode: Standuid, // code
standTrackCode: '', //
position: {
x: models[0].position.x,
y: this.addModel.pointY
}
};
if (index == 0) {
param.standTrackCode = this.addModel.standTrackUpCode;
param.position.y = this.addModel.pointY - (this.addModel.height / 2) - space;
} else {
param.standTrackCode = this.addModel.standTrackDownCode;
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
}
arr.push(param);
}
arr.forEach(item => {
models.push(item);
});
}
this.$emit('updateMapModel', models);
}
});
},