This commit is contained in:
fan 2020-04-13 17:13:52 +08:00
commit 20491dac81
22 changed files with 920 additions and 67 deletions

View File

@ -485,3 +485,47 @@ export function getAutoReentryGroupList(mapId, params) {
params
});
}
// 新建进路侧防
export function postFlankProtection(data) {
return request({
url: `/api/draftMap/flankProtection`,
method: 'post',
data
});
}
// 更新进路侧防数据
export function putFlankProtection(data) {
return request({
url: `/api/draftMap/flankProtection/${data.id}`,
method: 'put',
data
});
}
// 删除进路侧防
export function delFlankProtection(id) {
return request({
url: `/api/draftMap/flankProtection/${id}`,
method: 'delete'
});
}
// 查询进路侧防明细
export function getFlankProtectionDetail(id) {
return request({
url: `/api/draftMap/flankProtection/${id}`,
method: 'get'
});
}
// 查询进路侧防明细list
export function getFlankProtectionList(mapId, paramas) {
return request({
url: `/api/draftMap/flankProtection/${mapId}/paging`,
method: 'get',
paramas
});
}

View File

@ -222,6 +222,8 @@ class SkinCode extends defaultStyle {
distance: 4, // 站台和屏蔽门之间的距离
defaultColor: '#9f9f9c', // 屏蔽门默认颜色
splitDoorColor: '#009900', // 屏蔽门切除颜色
alarmColor:'red', // 收到警报颜色
emergencyColor:'yellow', // 紧急出发按钮激活颜色
special:true // 特殊屏蔽门(目前是西安二号线线路样式)
},
stand: { // 站台
@ -229,7 +231,8 @@ class SkinCode extends defaultStyle {
spareColor: '#808080', // 站台空闲颜色
stopColor: '#808080', // 站台列车停站颜色
jumpStopColor: 'yellow', // 站台跳停颜色
designatedJumpStopColor: 'yellow' // 站台指定列车跳停颜色
designatedJumpStopColor: 'yellow', // 站台指定列车跳停颜色
doorOpenColor:'#007f00' // 车门开启状态颜色(西安二号线线路样式)
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径

View File

@ -88,6 +88,8 @@ deviceState[deviceType.Psd] = {
close: 1, // 屏蔽门是否关闭
lock: 0, // 屏蔽门是否锁闭
interlockRelease: 0, // 是否互锁解除
alarmStatus:0, // 收到警报(西安二号线样式 暂时后端没加该字段)
emergencyDepart:0, // 紧急出发按钮激活(西安二号线样式 暂时后端没加该字段)
/** 屏蔽门状态*/
// screenDoorStatus: {
// Default: '01', /** 关门(缺省值)*/
@ -122,6 +124,7 @@ deviceState[deviceType.StationStand] = {
assignSkip: 0, // 是否指定跳停
runLevelTime: 0, // 区间运行时间 自动为 0
parkingTime: 0, // 站台停车时间 自动为0
doorOpen:0, // 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段)
// /** 折返策略*/
// reentryStrategy: {

View File

@ -24,7 +24,8 @@ class Status {
assignSkip: device.assignSkip, // 是否指定跳停
runLevelTime: device.runLevelTime, // 区间运行时间 自动为 0
parkingTime: device.parkingTime, // 站台停车时间 自动为0
fault: device.fault /** 非故障*/
fault: device.fault, /** 非故障*/
doorOpen:device.doorOpen /** 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段)*/
};
}
handleSection(device) {
@ -64,7 +65,9 @@ class Status {
screenDoorOpenStatus: device.close, // 屏蔽门是否开门
lock: device.lock, // 屏蔽门是否锁闭
interlockRelease: device.interlockRelease, // 是否互锁解除
fault: device.fault /** 非故障*/
fault: device.fault, /** 非故障*/
alarmStatus:device.alarmStatus, // 收到警报(西安二号线样式 暂时后端没加该字段)
emergencyDepart:device.emergencyDepart // 紧急出发按钮激活(西安二号线样式 暂时后端没加该字段)
};
}
handleStationDelayUnlock(device) {

View File

@ -71,6 +71,16 @@ export default class Line2 extends Group {
this.safeDoor && this.safeDoor.setColor(this.style.StationStand.safetyDoor.splitDoorColor);
}
/** 收到警报 */
alarm() {
this.safeDoor && this.safeDoor.setColor(this.style.StationStand.safetyDoor.alarmColor);
}
/** 紧急出发按钮激活 */
emergencyDepart() {
this.safeDoor && this.safeDoor.setColor(this.style.StationStand.safetyDoor.emergencyColor);
}
setState(model) {
if (!this.isShowShape) return;
/** 设置屏蔽门开关*/
@ -80,6 +90,9 @@ export default class Line2 extends Group {
model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/
model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/
model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */
model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */
// /** 设置屏蔽门状态*/
// switch (model.screenDoorStatus) {
// case '01':

View File

@ -369,6 +369,13 @@ class StationStand extends Group {
}
}
/** 车门开启 */
doorOpen() {
if (this.style.StationStand.common.standType && this.style.StationStand.common.standType == 'notFill') {
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.doorOpenColor);
}
}
/** 站台紧急关闭*/
emergentClose() {
if (!this.style.StationStand.common.special) {
@ -450,6 +457,8 @@ class StationStand extends Group {
model.trainParking && this.stop(); /** 列车停站*/
model.emergencyClosed && this.emergentClose(); /** 站台紧急关闭*/
model.doorOpen && this.doorOpen(); /** 车门开启 (西安二号线样式)*/
if (Number(model.parkingTime) > 0) {
this.setManuallyArmisticeTime(model.parkingTime); // 设置站台停车时间
}

View File

@ -135,7 +135,7 @@ export default {
}
.foshan-01__schedule .el-dialog {
background: rgba(0, 85, 231, 1);
background: linear-gradient(to bottom, #9BB6D3, #B8D0EA);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 2px solid #727375;
border-radius: 4px;

View File

@ -138,6 +138,11 @@ export default {
} else {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
}
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.stationCode = code;
}
}
},
mounted() {
@ -164,8 +169,13 @@ export default {
});
this.colsNum = 24 / this.centralizedStationList1.length;
if (centralizedStationList.length) {
this.stationCode = centralizedStationList[0].code;
if (this.$store.state.training.centerStationCode) {
this.stationCode = this.$store.state.training.centerStationCode;
} else {
this.stationCode = centralizedStationList[0].code;
}
}
if (this.$store.state.training.prdType == '01') {
this.$store.dispatch('map/setShowCentralizedStationCode', this.stationCode);
}

View File

@ -312,7 +312,7 @@ export default {
this.tempData.push(this.selected);
this.param = {
sectionCode: this.selected.code,
speedLimitValue: 5
speedLimitValue: '5'
};
},
handleStationMenu() {

View File

@ -109,6 +109,21 @@ export default {
{ deviceType: '03', orderNum: 7, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }
]
},
{
maxDuration: 15,
minDuration: 8,
operateType: 'Section_Set_Limit_Speed',
skinCode: '07',
trainingName: '轨区设限({8}{9})',
trainingRemark: '区段设置限速功能限速值5',
trainingType: 'Section',
productTypes: ['01'],
stepVOList: [
{ deviceType: '03', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该道岔' },
{ deviceType: '03', orderNum: 2, operateCode: '407', tip: '鼠标左键点击【轨区设限】按钮' },
{ deviceType: '03', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
},
{
maxDuration: 15,
minDuration: 8,
@ -127,6 +142,21 @@ export default {
{ deviceType: '03', orderNum: 6, operateCode: '001', tip: '鼠标左键点击【关闭】按钮' }
]
},
{
maxDuration: 15,
minDuration: 8,
operateType: 'Section_Cancel_Limit_Speed',
skinCode: '07',
trainingName: '轨区消限({8}{9})',
trainingRemark: '区段取消限速功能',
trainingType: 'Section',
productTypes: ['01'],
stepVOList: [
{ deviceType: '03', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该道岔' },
{ deviceType: '03', orderNum: 2, operateCode: '408', tip: '鼠标左键点击【轨区消限】按钮' },
{ deviceType: '03', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
},
{
maxDuration: 15,
minDuration: 8,
@ -343,7 +373,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '03', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该道岔' },
{ deviceType: '03', orderNum: 2, operateCode: '404', tip: '鼠标左键点击【区段解封】按钮' },
{ deviceType: '03', orderNum: 2, operateCode: '404', tip: '鼠标左键点击【解封区段】按钮' },
{ deviceType: '03', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
},
@ -634,6 +664,38 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
},
// {
// maxDuration: 15,
// minDuration: 8,
// operateType: 'Signal_Set_Route',
// skinCode: '07',
// trainingName: '联锁进路({3})',
// trainingRemark: '联锁进路',
// trainingType: 'Signal',
// productTypes: ['01'],
// stepVOList: [
// { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该信号机' },
// { deviceType: '04', orderNum: 2, operateCode: 'click', tip: '鼠标左键点击选择该信号机' },
// { deviceType: '04', orderNum: 3, operateCode: '301', tip: '鼠标左键点击【联锁进路】按钮' },
// { deviceType: '04', orderNum: 4, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
// ]
// },
// {
// maxDuration: 15,
// minDuration: 8,
// operateType: 'Signal_Cancel_Route',
// skinCode: '07',
// trainingName: '取消联锁({3})',
// trainingRemark: '取消联锁',
// trainingType: 'Signal',
// productTypes: ['01'],
// stepVOList: [
// { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该信号机' },
// { deviceType: '04', orderNum: 2, operateCode: 'click', tip: '鼠标左键点击选择该信号机' },
// { deviceType: '04', orderNum: 3, operateCode: '303', tip: '鼠标左键点击【取消联锁】按钮' },
// { deviceType: '04', orderNum: 4, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
// ]
// },
{
maxDuration: 15,
minDuration: 8,

View File

@ -124,7 +124,7 @@ export default {
productTypes: ['02'],
stepVOList: [
{ deviceType: '06', orderNum: 1, operateCode: '509', tip: '鼠标右键菜单选择【设置停站时间】' },
{ deviceType: '06', orderNum: 2, operateCode: '5092', tip: '鼠标左键点击,选择【人工】', val: '02' },
{ deviceType: '06', orderNum: 2, operateCode: '5092', tip: '鼠标左键点击,选择【人工】', val: '02' },
{ deviceType: '06', orderNum: 3, operateCode: '5094', tip: '输入或鼠标点击调整为【20】', val: '20' },
{ deviceType: '06', orderNum: 4, operateCode: '509', tip: '鼠标左键点击【确认】按钮' }
]
@ -140,7 +140,7 @@ export default {
productTypes: ['02'],
stepVOList: [
{ deviceType: '06', orderNum: 1, operateCode: '509', tip: '鼠标右键菜单选择【设置停站时间】' },
{ deviceType: '06', orderNum: 2, operateCode: '5092', tip: '鼠标左键点击,选择【人工】', val: '02' },
{ deviceType: '06', orderNum: 2, operateCode: '5092', tip: '鼠标左键点击,选择【人工】', val: '02' },
{ deviceType: '06', orderNum: 3, operateCode: '5094', tip: '输入或鼠标点击调整为【20】', val: '20' },
{ deviceType: '06', orderNum: 4, operateCode: '5093', tip: '鼠标左键点击,选择【一次有效】', val: 'false' },
{ deviceType: '06', orderNum: 5, operateCode: '509', tip: '鼠标左键点击【确认】按钮' }
@ -292,7 +292,7 @@ export default {
operateType: 'Section_Set_Limit_Speed',
skinCode: '06',
trainingName: '设置临时限速({8}{9})',
trainingRemark: '设置临时限速功能(限速值:不限速)',
trainingRemark: '设置临时限速功能-取消临时限速(限速值:不限速)',
trainingType: 'Section',
productTypes: ['02'],
stepVOList: [
@ -516,7 +516,7 @@ export default {
operateType: 'Switch_Set_Limit_Speed',
skinCode: '06',
trainingName: '设置临时限速({7})',
trainingRemark: '设置临时限速功能(限速值:不限)',
trainingRemark: '设置临时限速功能-取消临时限速(限速值:不限',
trainingType: 'Switch',
productTypes: ['01', '02'],
stepVOList: [

View File

@ -451,7 +451,7 @@ export const OperationEvent = {
setSpeed: {
menu: {
operation: '113',
domId: '_Tips-Switch-SetSpeed-Menu'
domId: '_Tips-Switch-SetSpeed-Menu{TOP}'
},
order: {
operation: '1131',
@ -482,7 +482,7 @@ export const OperationEvent = {
cancelSpeed: {
menu: {
operation: '114',
domId: '_Tips-Switch-CancelSpeed-Menu'
domId: '_Tips-Switch-CancelSpeed-Menu{TOP}'
},
order: {
operation: '1141',
@ -1092,7 +1092,7 @@ export const OperationEvent = {
setSpeed: {
menu: {
operation: '407',
domId: '_Tips-Section-SetSpeed-Menu'
domId: '_Tips-Section-SetSpeed-Menu{TOP}'
},
order: {
operation: '4071',
@ -1123,7 +1123,7 @@ export const OperationEvent = {
cancelSpeed: {
menu: {
operation: '408',
domId: '_Tips-Section-CancelSpeed-Menu'
domId: '_Tips-Section-CancelSpeed-Menu{TOP}'
},
order: {
operation: '4081',

View File

@ -34,7 +34,8 @@ const training = {
initTime: 0, // 当前系统时间
prdType: '', // 产品类型
roles: '', // 角色权限类型
group: '' // 设置全局 group
group: '', // 设置全局 group
centerStationCode:'' // 当前居中的集中站code
},
getters: {
@ -205,6 +206,9 @@ const training = {
},
notifyGetCommandDefinition: (state, lineCode) => {
Handler.notify(lineCode);
},
setCenterStationCode:(state, centerStationCode) => {
state.centerStationCode = centerStationCode;
}
},
@ -602,6 +606,11 @@ const training = {
*/
setGroup: ({ commit }, group) => {
commit('setGroup', group);
},
/** 设置当前居中的集中站code */
setCenterStationCode:({ commit }, centerStationCode) => {
commit('setCenterStationCode', centerStationCode);
}
}
};

View File

@ -159,3 +159,17 @@ export function deepAssign(obj, item) {
}
return Object.assign(obj, target);
}
// 对象2 复制到 对象1上 并保留对象1原有字段
export function copyClone(obj1, obj2 = {}) {
for (const keys in obj1) {
if (obj1.hasOwnProperty(keys)) {
if (obj1[keys] && typeof obj1[keys] === 'object') { // 如果值是对象,就递归一下
obj1[keys] = copyClone(obj1[keys], obj2[keys]);
} else {
obj1[keys] = obj2[keys];
}
}
}
return obj1;
}

View File

@ -18,7 +18,6 @@ import Cookies from 'js-cookie';
import { pageQueryTraining, pageQueryTrainingNew } from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map';
import localStore from 'storejs';
import { EventBus } from '@/scripts/event-bus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getCmdList } from '@/api/management/dictionary';
@ -164,8 +163,9 @@ export default {
} else {
res = await pageQueryTraining(params);
}
this.trainings.forEach(ele => {
res.data.list.forEach(item => {
res.data.list.forEach(item => {
item.isShow = false;
this.trainings.forEach(ele => {
if (item.id == ele.trainingId) {
item.isShow = true;
}
@ -335,12 +335,12 @@ export default {
},
addObj(index, row) {
const data = [];
this.$set(row, 'isShow', true);
row.isShow = true;
data.push(row);
this.$emit('routeSelected', data);
},
delObj(index, row) {
this.$set(row, 'isShow', false);
row.isShow = false;
this.trainings.forEach((el, i) => {
if (el.trainingId == row.id) {
this.trainings.splice(i, 1);

View File

@ -237,6 +237,11 @@ export default {
}
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
}
},
'$store.state.map.mousemove': function (val) {
this.mousemove();
},

View File

@ -158,9 +158,11 @@ export default {
if (deviceModel._type == 'Section' || deviceModel._type == 'Switch' || deviceModel._type == 'Signal' || deviceModel._type == 'Switch') {
const stationModel = this.$store.getters['map/getDeviceByCode'](deviceModel.stationCode);
this.setShowStation(stationModel.code, true);
this.$store.dispatch('training/setCenterStationCode', stationModel.code);
} else if (deviceModel._type === 'StationStand') {
const stationModel = this.$store.getters['map/getDeviceByCode'](deviceModel.deviceStationCode);
this.setShowStation(stationModel.code, true);
this.$store.dispatch('training/setCenterStationCode', stationModel.code);
} else if (deviceModel._type === 'Station') {
let stationModel = '';
if (deviceModel.centralized) {
@ -175,6 +177,7 @@ export default {
});
}
this.setShowStation(stationModel.code, true);
this.$store.dispatch('training/setCenterStationCode', stationModel.code);
}
this.setCenter(code);
}

View File

@ -0,0 +1,199 @@
<template>
<el-dialog v-dialogDrag class="autoSignal" :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getFlankProtectionList, delFlankProtection, getFlankProtectionDetail } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
stationCode: {
type: 'select',
label: '联锁车站',
config: {
data: []
}
},
number: {
type: 'text',
label: '侧防编号'
},
name: {
type: 'text',
label: '侧防名称'
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '侧防名称',
prop: 'name'
},
{
title: '侧防code',
prop: 'code'
},
{
title: '侧防编号',
prop: 'number'
},
{
title: '地图名称',
prop: 'mapId'
},
{
title: '连锁站',
prop: 'stationCode'
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'stationList'
])
},
watch: {
stationList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
if (val[i].ciStation) {
list.push({ label: val[i].name, value: val[i].code });
}
}
this.queryForm.queryObject.stationCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
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 getFlankProtectionList(this.mapInfo.id, params);
}
},
acquireMapList() { //
listMap({ drawWay:true}).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']);
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
});
}
}
return data;
},
editObj(index, row) {
getFlankProtectionDetail(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
delFlankProtection(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>
<style lang="scss">
.autoSignal .el-dialog__body {
padding: 0px 20px 10px 20px;
color: #606266;
font-size: 14px;
}
.autoSignal .el-dialog{
margin-top: 5vh !important;
}
</style>

View File

@ -0,0 +1,84 @@
<template>
<div style="height: 100%;">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
/>
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
</div>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'AutomaticOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
autoMaticoSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -0,0 +1,398 @@
<template>
<div style="height: 100%;">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="140px" size="mini">
<div class="definition">
<el-form-item label="编号:" prop="number">
<el-input v-model="addModel.number" style="width: 220px;" />
</el-form-item>
<el-form-item label="名称:" prop="name">
<el-input v-model="addModel.name" style="width: 220px;" />
</el-form-item>
<el-form-item label="所属联锁站:" prop="stationCode">
<el-select v-model="addModel.stationCode" clearable :filterable="true" style="width: 220px;">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankStationList' ? 'danger' : 'primary'"
@click="hover('flankStationList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<div style="height: 100%; position: relative; left: 8%; width: 88%; margin-bottom: 20px;">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">等级1</span>
</div>
<div style="margin-top: 8px;">
<el-form-item label="侧防道岔:">
<el-select v-model="addModel.level1.pSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSwitchLevel1' ? 'danger' : 'primary'"
@click="hover('flankSwitchLevel1')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level1.pSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防信号机:">
<el-select v-model="addModel.level1.pSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSingalLevel1' ? 'danger' : 'primary'"
@click="hover('flankSingalLevel1')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="侧防区域元件:">
<el-select v-model="addModel.level1.areaSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankAreaSwitchLevel1' ? 'danger' : 'primary'"
@click="hover('flankAreaSwitchLevel1')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level1.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</div>
</el-card>
</div>
<div style="height: 100%; position: relative; left: 8%; width: 88%">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">等级2</span>
</div>
<div style="margin-top: 8px;">
<el-form-item label="侧防道岔:">
<el-select v-model="addModel.level2.pSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSwitchLevel2' ? 'danger' : 'primary'"
@click="hover('flankSwitchLevel2')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level2.pSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防信号机:">
<el-select v-model="addModel.level2.pSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSingalLevel2' ? 'danger' : 'primary'"
@click="hover('flankSingalLevel2')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="侧防区域元件:">
<el-select v-model="addModel.level2.areaSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankAreaSwitchLevel2' ? 'danger' : 'primary'"
@click="hover('flankAreaSwitchLevel2')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level2.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</div>
</el-card>
</div>
</div>
</el-form>
<div class="draft">
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存侧防</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">更新侧防</el-button>
</el-button-group>
</div>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { postFlankProtection, putFlankProtection } from '@/api/jmap/mapdraft';
import { copyClone } from '@/utils/index';
export default {
name: 'RouteOperation',
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
field: '',
isSave: true,
loading: false,
SwitchLocateTypeList: [
{ name: '定位', code: true },
{ name: '反位', code: false }
],
addModel: {
code: '',
mapId: '',
id: '',
number: '',
stationCode: '',
name: '',
level1: {
pSwitch: {
switchCode: '',
normal: ''
},
pSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
},
level2: {
pSwitch: {
switchCode: '',
normal: ''
},
pSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
}
},
editShow: false,
rules: {
stationCode: [
{ required: true, message: '请选择所属连锁站', trigger: 'change' }
],
number: [
{ required: true, message: '请输入编号', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
]
}
};
},
computed: {
...mapGetters('map', [
'stationList',
'switchList',
'signalList'
]),
filterStationList() { //
return this.stationList.filter(station=>{
return station.ciStation;
});
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = copyClone(this.addModel, val);
this.editShow = true;
}
}
},
mounted() {
},
methods: {
hover(field) {
this.field = field === this.field ? '' : field;
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
if (this.field.toUpperCase() === 'flankSingalLevel1'.toUpperCase()) {
this.addModel.level1.pSignal = selected.code;
} else if (this.field.toUpperCase() === 'flankSingalLevel2'.toUpperCase()) {
this.addModel.level2.pSignal = selected.code;
}
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'flankStationList'.toUpperCase()) {
this.addModel.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
if (this.field.toUpperCase() === 'flankSwitchLevel1'.toUpperCase()) {
this.addModel.level1.pSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankSwitchLevel2'.toUpperCase()) {
this.addModel.level2.pSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel1'.toUpperCase()) {
this.addModel.level1.areaSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel2'.toUpperCase()) {
this.addModel.level2.areaSwitch.switchCode = selected.code;
}
}
this.field = '';
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
model['mapId'] = this.mapInfo.id;
model['id'] = this.addModel.id;
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postFlankProtection(this.buildModel(setUID('flank'))).then(resp => {
this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.failedCreateSignal'));
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putFlankProtection(this.buildModel()).then(resp => {
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
this.$refs.form.resetFields();
this.addModel.level1 = {
pSwitch: {
switchCode: '',
normal: ''
},
pSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
};
this.addModel.level2 = {
pSwitch: {
switchCode: '',
normal: ''
},
pSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
};
this.isSave = true;
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-radio {
margin-right: 10px;
}
/deep/ {
.el-select .el-tag {
height: auto;
display: flex;
align-items: center;
justify-content: center;
padding-right: 15px;
box-sizing: border-box;
white-space: normal;
}
.el-input__suffix{
right: 2px;
}
}
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -21,6 +21,14 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="侧防" class="tab_pane_box" name="flankProtect">
<flank-protect-operate
ref="flankProtectOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="自动折返" class="tab_pane_box" name="turned">
<turned-operate
ref="turnedOperate"
@ -75,6 +83,7 @@ import AutomaticOperate from './automaticoperate/index';
import RunLevelOperate from './runLeveloperate/index';
import SignalOperate from './signaloperate/index';
import TurnedOperate from './turnedoperate/index';
import FlankProtectOperate from './flankProtectOperate/index';
export default {
name: 'DataRelation',
@ -83,6 +92,7 @@ export default {
RoutingOperate,
AutomaticOperate,
RunLevelOperate,
FlankProtectOperate,
// PathOperate,
SignalOperate,
TurnedOperate
@ -109,7 +119,8 @@ export default {
automatic: 'automaticOperate',
signal: 'signalOperate',
runLevel: 'runLevelOperate',
turned: 'turnedOperate'
turned: 'turnedOperate',
flankProtect: 'flankProtectOperate'
}
};
},

View File

@ -116,50 +116,14 @@
</el-table>
</el-form-item>
<el-form-item :label="$t('map.accessSideTurnoutData') + ':'" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-select v-model="flankCode" clearable multiple filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
v-for="item in flankProtectList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:label="`${item.number}-${item.name}`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeFlankProtectionList' ? 'danger' : 'primary'"
@click="hover('routeFlankProtectionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeFlankProtectionList, {switchCode:flankCode, normal:flankType, switchType: flankType ? '定位' : '反位'})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="flankType" filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeFlankProtectionList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeFlankProtectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.associatedStationList')" prop="stationStandList">
<el-select v-model="addModel.stationStandList" multiple clearable filterable style="width: 220px;">
@ -192,7 +156,7 @@
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { postRouteNew, putRouteNew, getRouteNewList, getContinueProtectList } from '@/api/jmap/mapdraft';
import { postRouteNew, putRouteNew, getRouteNewList, getContinueProtectList, getFlankProtectionList } from '@/api/jmap/mapdraft';
import ProtectOperate from './protect';
import HostileData from './hostileData';
@ -236,6 +200,7 @@ export default {
{ name: '定位', code: true },
{ name: '反位', code: false }
],
flankProtectList: [], //
addModel: {
mapId: '',
code: '',
@ -320,9 +285,6 @@ export default {
this.$refs.protect.clear();
this.addModel = val;
val.overlapCode && this.initProtectData(val);
this.addModel.routeFlankProtectionList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
this.addModel.routeSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
@ -367,6 +329,9 @@ export default {
this.initLoad();
}
},
created() {
this.getFlankProtectList();
},
mounted() {
this.getRouteList();
},
@ -380,6 +345,24 @@ export default {
const response = await getRouteNewList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
this.routeList = response.data.list;
},
async getFlankProtectList() { //
const response = await getFlankProtectionList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
this.flankProtectList = response.data.list;
// this.flankProtectList.map(elem => {
// elem.stationName = this.filterStation(elem.stationCode);
// });
},
// filterStation(code) {
// let name = '';
// for (let i = 0; i < this.stationList.length; i++) {
// if (this.stationList[i].code == code) {
// name = this.stationList[i].name;
// return;
// }
// }
// return name;
// },
swictchName(code) {
let name = '';
if (code) {
@ -469,6 +452,8 @@ export default {
this.addModel.conflictingSignalList = [];
this.isSave = true;
this.$refs.protect.clear();
this.routeCode = '';
this.routeType = '';
this.addModel.stationCode = this.routeList[this.routeList.length - 1].stationCode;
this.addModel.delayReleaseTime = this.routeList[this.routeList.length - 1].delayReleaseTime;
}
@ -525,8 +510,6 @@ export default {
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) {
this.routeCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeFlankProtectionList'.toUpperCase()) {
this.flankCode = selected.code;
} else if (selected._type.toUpperCase() === 'StationStand'.toUpperCase() && this.field.toUpperCase() === 'routeStationStandList'.toUpperCase()) {
if (this.addModel.stationStandList.indexOf(selected.code) === -1) {
this.addModel.stationStandList.push(selected.code);