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 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, z: this.z,
style: style, style: style,
x: model.position.x, x: model.position.x,
y: model.position.y, y: model.position.y - (model.height / 2),
width: model.width || style.StationStand.safetyDoor.width, width: model.width || style.StationStand.safetyDoor.width,
height: model.height || style.StationStand.safetyDoor.height, height: model.height || style.StationStand.safetyDoor.height,
show: model.hasDoor show: model.hasDoor

View File

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

View File

@ -33,9 +33,9 @@ class StationStand extends Group {
const drict = 1; 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 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({ this.safeStand = new ESafeStand({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
@ -47,124 +47,124 @@ class StationStand extends Group {
}); });
this.add(this.safeStand); this.add(this.safeStand);
if (model.direction != '03') { // if (model.direction != '03') {
// /** 屏蔽门*/ // /** 屏蔽门*/
// this.safeDoor = new ESafeDoor({ // this.safeDoor = new ESafeDoor({
// zlevel: this.zlevel, // zlevel: this.zlevel,
// z: this.z, // z: this.z,
// style: style, // style: style,
// x: model.position.x, // x: model.position.x,
// y: model.position.y, // y: model.position.y,
// width: model.width, // width: model.width,
// height: style.StationStand.safetyDoor.height, // height: style.StationStand.safetyDoor.height,
// show: model.hasDoor // show: model.hasDoor
// }); // });
/** 站台紧急关闭*/ /** 站台紧急关闭*/
const emergentH = drict > 0 ? style.StationStand.standEmergent.mergentR + style.StationStand.safetyDoor.height : style.StationStand.standEmergent.mergentR; 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 emergentX = model.position.x + drict * (style.StationStand.standEmergent.offset.x);
const emergentY = model.position.y + drict * (style.StationStand.standEmergent.offset.y + emergentH); const emergentY = model.position.y + drict * (style.StationStand.standEmergent.offset.y + emergentH);
this.emergent = new ESafeEmergent({ 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, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
style: style, style: style,
x: emergentX, x: jumpX,
y: emergentY, y: jumpY,
r: style.StationStand.standEmergent.mergentR, cx: jumpCX,
n: 4 cy: jumpCY,
});
/** 站台折返策略*/
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', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top',
jumpStopStatus: model.jumpStopStatus
}); });
this.add(this.jump);
/** 停站时间*/
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.safeDoor);
this.add(this.emergent);
this.add(this.detain);
this.add(this.reentry);
this.add(this.time);
this.add(this.level);
// }
} }
createMouseEvent() { createMouseEvent() {

View File

@ -8,7 +8,17 @@ export function getUID(type, list) {
// if (list && list.length) { // if (list && list.length) {
let name = ''; let name = '';
if (type == 'T') { 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 { } else {
name = Math.floor((Math.random() * 100000) + 1); name = Math.floor((Math.random() * 100000) + 1);
} }

View File

@ -3,11 +3,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // 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.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41: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 { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;
} }

View File

@ -4,7 +4,7 @@
<template v-if="basicInfo"> <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 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-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 <el-option
v-for="item in lineCodeList" v-for="item in lineCodeList"
:key="item.code" :key="item.code"

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@
<script> <script>
import { mapGetters } from 'vuex'; 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'; import PreViewField from './preview';
export default { export default {
@ -33,10 +33,13 @@ export default {
data() { data() {
return { return {
show: false, show: false,
showType: '',
codeType: '',
mapList: [], mapList: [],
RouteNatureTypeList: [], RouteNatureTypeList: [],
RouteAutoTypeList: [], RouteAutoTypeList: [],
SwitchLocateTypeList: [], SwitchLocateTypeList: [],
ContinueProtectList: [],
turnBackList: [ turnBackList: [
{ label: '是', value: true }, { label: '是', value: true },
{ label: '否', value: false } { label: '否', value: false }
@ -106,15 +109,19 @@ export default {
prop: 'endSignalCode' prop: 'endSignalCode'
}, },
{ {
type: 'button', title: '延续保护',
title: this.$t('map.continueProtectSwitchData'), prop: 'overlapCode'
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.overlapSwitchDetail
}
]
}, },
// {
// type: 'button',
// title: this.$t('map.continueProtectSwitchData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.overlapSwitchDetail
// }
// ]
// },
{ {
type: 'button', type: 'button',
title: this.$t('map.accessSideTurnoutData'), title: this.$t('map.accessSideTurnoutData'),
@ -125,16 +132,16 @@ export default {
} }
] ]
}, },
{ // {
type: 'button', // type: 'button',
title: this.$t('map.routeProtectsData'), // title: this.$t('map.routeProtectsData'),
buttons: [ // buttons: [
{ // {
name: this.$t('map.preview'), // name: this.$t('map.preview'),
handleClick: this.routeOverlap // handleClick: this.routeOverlap
} // }
] // ]
}, // },
{ {
type: 'button', type: 'button',
@ -173,12 +180,19 @@ export default {
buttons: [ buttons: [
{ {
name: this.$t('map.compile'), name: this.$t('map.compile'),
handleClick: this.edit handleClick: this.edit,
showControl: () => { return this.showType !== 'select'; }
}, },
{ {
name: this.$t('map.deleteObj'), name: this.$t('map.deleteObj'),
handleClick: this.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.$Dictionary.switchLocateType().then(list => {
this.SwitchLocateTypeList = list; this.SwitchLocateTypeList = list;
}); });
this.getProtectList();
this.acquireMapList(); this.acquireMapList();
}, },
methods: { methods: {
doShow() { doShow(showType, codeType) {
this.show = true; this.show = true;
this.reloadTable(); this.reloadTable();
if (showType && codeType) {
this.showType = showType;
this.codeType = codeType;
}
}, },
doClose() { doClose() {
this.show = false; this.show = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) { if (this.mapInfo && this.mapInfo.id) {
return listRouteRoute(this.mapInfo.id, params); return getRouteNewList(this.mapInfo.id, params);
} }
}, },
acquireMapList() { acquireMapList() {
@ -263,6 +281,7 @@ export default {
that.$convertSpecifiedField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']); that.$convertSpecifiedField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']);
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']); that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['nearSectionCode', 'autoTriggerSectionCode', 'turnBackSectionCode']); 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) { saveRelated(row) {
updateRouteRoute(row).then(response => { putRouteNew(row).then(response => {
this.$message.success('更新成功'); this.$message.success('更新成功');
}).catch(() => { }).catch(() => {
this.$messageBox('操作异常'); this.$messageBox('操作异常');
@ -410,7 +429,7 @@ export default {
mapId: elem.id, mapId: elem.id,
id: row.id id: row.id
}; };
queryRouteRouteDetail(model).then(response => { getRouteNewById(model.id).then(response => {
const data = response.data; const data = response.data;
this.$emit('routeSelected', data); this.$emit('routeSelected', data);
this.doClose(); this.doClose();
@ -425,7 +444,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRouteRoute(row.id).then(response => { delRouteNew(row.id).then(response => {
this.$message.success('删除成功'); this.$message.success('删除成功');
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
@ -440,6 +459,16 @@ export default {
if (this.queryList && this.queryList.reload) { if (this.queryList && this.queryList.reload) {
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-select>
</el-form-item> </el-form-item>
<el-form-item label="关联延续保护区段:" prop="overlapCode"> <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-button type="primary" @click="selectedOverlapCode">选择</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList"> <el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
@ -221,7 +221,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; 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'; import ProtectDetail from '../protectoperate/detail';
export default { export default {
@ -282,7 +282,8 @@ export default {
espList: [], // espList: [], //
overlapCode:'', overlapCode:'',
conflictingRouteList: [] // conflictingRouteList: [] //
} },
overlapName: ''
}; };
}, },
computed: { computed: {
@ -341,7 +342,7 @@ export default {
}, },
routeData(val, old) { routeData(val, old) {
if (val) { if (val) {
this.addModel = val; this.handelContinueProtectCode(val);
this.addModel.routeFlankProtectionList.forEach(item => { this.addModel.routeFlankProtectionList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位'; item.normal ? item.switchType = '定位' : item.switchType = '反位';
}); });
@ -375,8 +376,9 @@ export default {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
setOverlapCode(code) { setOverlapCode(data) {
this.addModel.overlapCode = code; this.addModel.overlapCode = data.code;
this.overlapName = data.name;
}, },
selectedOverlapCode() { selectedOverlapCode() {
this.$refs.routeDetail.doShow('select'); this.$refs.routeDetail.doShow('select');
@ -405,7 +407,7 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
createRouteRoute(this.buildModel(getUID('Route'))).then(response => { postRouteNew(this.buildModel(getUID('Route'))).then(response => {
this.$message.success('创建成功'); this.$message.success('创建成功');
this.loading = false; this.loading = false;
this.clear(); this.clear();
@ -420,7 +422,7 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
updateRouteRoute(this.buildModel()).then(response => { putRouteNew(this.buildModel()).then(response => {
this.$message.success(this.$t('map.updateSuccessfully')); this.$message.success(this.$t('map.updateSuccessfully'));
this.loading = false; this.loading = false;
this.clear(); this.clear();
@ -438,6 +440,8 @@ export default {
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSwitchList = []; this.addModel.routeSwitchList = [];
this.addModel.routeFlankProtectionList = []; this.addModel.routeFlankProtectionList = [];
this.overlapName = '';
this.addModel.overlapCode = '';
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) { if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = this.selected.code; this.addModel.stationCode = this.selected.code;
} }
@ -466,6 +470,13 @@ export default {
this.flankCode = selected.code; 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> <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> <div>
<QueryListPage <QueryListPage
ref="queryListPage" ref="queryListPage"
@ -13,8 +13,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft'; import { getAutoReentryList, delAutoReentry, getAutoReentryById, getRouteNewList } from '@/api/jmap/mapdraft';
import { getAutoSignalList, delAutoSignal, getAutoSignalDetail } from '@/api/jmap/mapdraft';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
@ -29,20 +28,17 @@ export default {
data() { data() {
return { return {
show: false, show: false,
mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
routeList: [],
queryForm: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
queryObject: { queryObject: {
signalCode: { name: {
type: 'select', type: 'text',
label: this.$t('map.signal'), label: '自动折返名称'
config: {
data: []
}
} }
} }
}, },
@ -53,29 +49,20 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: this.$t('map.signalCodeName'), title: '自动折返名称',
prop: 'signalCode' prop: 'name'
}, },
{ {
title: this.$t('map.interlockingBlocks'), title: '折返进路',
prop: 'sectionList', prop: 'turnBackRouteCode'
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.sectionList, this.sectionList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('map.psdList'), title: '基础进路',
prop: 'psdList', prop: 'basicRouteCode'
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.psdList, this.psdList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('map.espList'), title: '折返区段',
prop: 'espList', prop: 'reentryTrackCode'
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.espList, this.espList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
}, },
{ {
type: 'button', type: 'button',
@ -99,79 +86,52 @@ export default {
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'sectionList', 'sectionList'
'signalList',
'espList',
'psdList'
]) ])
}, },
watch: { 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() { mounted() {
this.acquireMapList();
}, },
methods: { methods: {
doShow() { doShow() {
this.show = true; this.show = true;
this.getRouteList();
this.reloadTable(); this.reloadTable();
}, },
doClose() { doClose() {
this.show = false; this.show = false;
}, },
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.uniqueName;
}
return name;
},
queryFunction(params) { queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) { 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) { afterQuery(data) {
if (data && data.list) { if (data && data.list) {
const that = this; const that = this;
const list = data.list; const list = data.list;
if (list) { if (list) {
list.map(elem => { list.map(elem => {
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']); that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['reentryTrackCode']);
elem.code = elem.signalCode; that.$convertSpecifiedField(elem, that.routeList, 'code', 'name', ['turnBackRouteCode', 'basicRouteCode']);
elem.signalCode = that.formatName(elem.signalCode);
}); });
} }
} }
return data; return data;
}, },
editObj(index, row) { editObj(index, row) {
getAutoSignalDetail(row.id).then(response => { getAutoReentryById(row.id).then(response => {
const data = response.data; const data = response.data;
this.$emit('autoMaticoSelected', data); this.$emit('autoReentrySelected', data);
this.doClose(); this.doClose();
}); });
}, },
deleteObj(index, row) { deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && 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.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
@ -183,6 +143,11 @@ export default {
if (this.queryList && this.queryList.reload) { if (this.queryList && this.queryList.reload) {
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" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @autoReentrySelected="autoReentrySelected" />
</div> </div>
</template> </template>
<script> <script>
@ -57,7 +57,7 @@ export default {
}); });
} }
}, },
autoMaticoSelected: function (data) { autoReentrySelected: function (data) {
this.routeData = data; this.routeData = data;
if (this.$refs && this.$refs.routeEdit) { if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false; this.$refs.routeEdit.isSave = false;

View File

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

View File

@ -17,21 +17,6 @@
<div style="height: calc(100% - 46px);"> <div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini"> <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-form-item label="关联站台轨:" prop="standTrackCode">
<el-select v-model="addModel.standTrackCode" filterable> <el-select v-model="addModel.standTrackCode" filterable>
<el-option <el-option
@ -47,6 +32,27 @@
@click="hover('sectionSelectCode')" @click="hover('sectionSelectCode')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </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-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
<el-radio-group v-model="addModel.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> <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: '', name: '',
standCode: '', // code standCode: '', // code
standTrackCode: '', // standTrackCode: '', //
width: 80, width: 60,
height: 5, height: 3,
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
doorLocationType: '01' // doorLocationType: '01' //
}, },
field: '', field: '',
addModel: { addModel: {
standCode: '', standCode: '',
width: 60,
height: 3,
standTrackCode: '', standTrackCode: '',
doorLocationType: '01' // doorLocationType: '01' //
} }
@ -250,9 +258,9 @@ export default {
}; };
this.stationStandList.forEach(elem => { this.stationStandList.forEach(elem => {
if (elem.code === this.addModel.standCode) { 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') { // 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: { map: {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList }, { 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: '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: '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: '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 }, { 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"> <el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
<div style="height: calc(100% - 46px);"> <div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper"> <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-form-item :label="$t('map.stationstandName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable @change="changeStation"> <el-select v-model="addModel.stationCode" filterable @change="changeStation">
<el-option <el-option
@ -32,20 +33,7 @@
@click="hover('standSelectStationCode')" @click="hover('standSelectStationCode')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType"> </el-form> -->
<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-scrollbar> </el-scrollbar>
</div> </div>
<div class="button_box"> <div class="button_box">
@ -100,10 +88,16 @@ export default {
}, },
field: '', field: '',
addModel: { addModel: {
stationCode: '', stationCode: '', //
// doorLocationType: '01', deviceStationCode: '', //
deviceStationCode: '' pointY: 0, // y
// hasDoor: true width: 60,
height: 20,
doorType: '01', //
standTrackCode: '', //
standTrackUpCode: '', //
standTrackDownCode: '', //
stationstandDirection: '02' //
} }
}; };
}, },
@ -111,7 +105,8 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'stationList', 'stationList',
'stationStandList', 'stationStandList',
'lineCode' 'sectionList',
'psdList'
]), ]),
form() { form() {
const form = { const form = {
@ -178,12 +173,84 @@ export default {
return rules; 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() { createRules() {
return { return {
stationCode: [ stationCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' } { 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: { watch: {
@ -193,7 +260,11 @@ export default {
}, },
mounted() { mounted() {
this.$Dictionary.doorLocationType().then(list => { 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.$Dictionary.runDirectionType().then(list => {
this.RunDirectionTypeList = list; this.RunDirectionTypeList = list;
@ -220,7 +291,6 @@ export default {
this.$emit('standStationCode', this.field); this.$emit('standStationCode', this.field);
}, },
deviceSelect(selected) { deviceSelect(selected) {
// this.$refs.make.resetFields();
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();
this.activeName = 'first'; this.activeName = 'first';
@ -231,32 +301,99 @@ export default {
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('standStationCode', ''); 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() { create() {
this.$refs.make.validate((valid) => { this.$refs.make.validate((valid) => {
if (valid) { if (valid) {
const uid = getUID('PF', this.stationStandList); const models = [];
const space = 8;
const Standuid = getUID('PF', this.stationStandList);
const model = { const model = {
_type: 'StationStand', _type: 'StationStand',
code: uid, code: Standuid,
name: `PF${this.stationStandList.length + 1}`, name: `PF${this.stationStandList.length + 1}`,
width: 40, width: this.addModel.width,
height: 20, height: this.addModel.height,
// doorLocationType: this.addModel.doorLocationType,
deviceStationCode: this.addModel.deviceStationCode, deviceStationCode: this.addModel.deviceStationCode,
visible: true visible: true,
// direction: '01', position: {
// hasDoor: this.addModel.hasDoor x: 0,
y: this.addModel.pointY
}
}; };
this.stationList.forEach(elem => { this.stationList.forEach(elem => {
if (elem.code === this.addModel.stationCode) { if (elem.code == this.addModel.stationCode) {
model.position = { x: elem.position.x, y: elem.position.y + 40 }; model.position.x = elem.position.x;
model.stationCode = elem.code; model.stationCode = elem.code;
} }
}); });
models.push(model);
this.$emit('updateMapModel', 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);
} }
}); });
}, },