This commit is contained in:
sunzhenyu 2020-03-25 18:47:27 +08:00
commit 72f27c7a6f
195 changed files with 25109 additions and 3472 deletions

View File

@ -258,7 +258,7 @@ export function getRealDevices(group) {
}
// 获取房间真实设备连接关系
export function getRealDevicesNew(group) {
export function getRealDevicesInRoom(group) {
return request({
url: `/api/jointTraining/room/${group}/realDevice/connect`,
method: 'get'
@ -266,7 +266,7 @@ export function getRealDevicesNew(group) {
}
// 更新真实设备的连接关系
export function updateRealDevicesNew(group, data) {
export function updateRealDevices(group, data) {
return request({
url: `/api/jointTraining/room/${group}/realDevice`,
method: 'put',

248
src/api/jointTraining.js Normal file
View File

@ -0,0 +1,248 @@
import request from '@/utils/request';
// 文字聊天 发送文字
export function chatWithTextNew(data, group) {
return request({
url: `/api/v1/jointTraining/chatWithText?group=${group}`,
method: 'post',
data: {
message: data
}
});
}
// 生成分发二维码
export function getJoinTrainCodeNew(data, group) {
return request({
url: `/api/v1/jointTraining/qrCode?group=${group}`,
method: 'post',
data: data
});
}
// 创建房间
export function postCreateRoomNew(data) {
return request({
url: `/api/v1/jointTraining/room`,
method: 'post',
data: data
});
}
// 检查房间存在
export function checkRoomExistNew(params) {
return request({
url: `/api/simulationRoom`,
method: 'get',
params
});
}
// 获取房间详情
export function postRoomDetailNew(group) {
return request({
url: `/api/v1/jointTraining/room/${group}`,
method: 'get'
});
}
// 销毁房间
export function deljointTrainRoomNew(group) {
return request({
url: `/api/v1/jointTraining/room`,
method: 'delete',
params: {
group: group
}
});
}
// 查询有权限房间列表
export function getjointTrainListNew(params) {
return request({
url: `/api/v1/jointTraining/room/list`,
method: 'get',
params: params
});
}
// 加入房间
export function getjointTrainingNew(group) {
return request({
url: `/api/v1/jointTraining/room/join`,
method: 'put',
params: {
group: group
}
});
}
// 设置人员角色
export function putUserRolesNew(data, group) {
return request({
url: `/api/v1/jointTraining/room/user/role?group=${group}`,
method: 'put',
data: data
});
}
// 获取房间里的用户列表
export function getJointTrainRoomUserListNew(group) {
return request({
url: `/api/v1/jointTraining/room/${group}/user/list`,
method: 'get'
});
}
// 离开房间接口
export function putJointTrainingExitNew(group) {
return request({
url: `/api/v1/jointTraining/room/exit`,
method: 'put',
params: {
group: group
}
});
}
// 开始联合演练
export function startJointTrainingNew(group) {
return request({
url: `/api/v1/jointTraining/room/simulation`,
method: 'post',
params: {
group: group
}
});
}
// 获取个人信息
export function getUserRolesNew(group) {
return request({
url: `/api/v1/jointTraining/room/user/role`,
method: 'get',
params: {
group: group
}
});
}
// 返回房间
export function putJointTrainingStateNew() {
return request({
url: `/api/v1/jointTraining/room/back`,
method: 'put'
});
}
// 踢出用户
export function putJointTrainingUserkickedNew(userId, group) {
return request({
url: `/api/v1/jointTraining/room/user`,
method: 'put',
params: {
userId: userId,
group: group
}
});
}
// 管理员结束所有人的仿真
export function putJointTrainingSimulationNew(group) {
return request({
url: `/api/v1/jointTraining/room/simulation/all`,
method: 'put',
params: {
group: group
}
});
}
// 结束仿真返回房间
export function putJointTrainingSimulationUserNew(group) {
return request({
url: `/api/v1/jointTraining/room/simulation/user/exit`,
method: 'put',
params: {
group: group
}
});
}
// 进入仿真
export function putJointTrainingSimulationEntranceNew(group) {
return request({
url: `/api/v1/jointTraining/room/simulation/user/entrance`,
method: 'put',
params: {
group: group
}
});
}
/**
* 权限获取(房间权限)
*/
export function getPermissionJointNew(group) {
return request({
url: '/api/v1/jointTraining/qrCode',
method: 'get',
params: {
group: group
}
});
}
// 添加或更新真实设备和仿真对象连接
export function setRealDeviceNew(group, data) {
return request({
url: `/api/v1/jointTraining/room/realDevice?group=${group}`,
method: 'post',
data: data
});
}
// 删除真实设备和仿真对象连接
export function delRealDeviceNew(id, group) {
return request({
url: `/api/v1/jointTraining/room/realDevice/${id}`,
method: 'delete',
params: { group: group }
});
}
// 获取真实设备列表
export function getRealDevicesNew(group) {
return request({
url: `/api/v1/jointTraining/room/${group}/devices`,
method: 'get'
});
}
// 获取房间真实设备连接关系
export function getRealDevicesInRoomNew(group) {
return request({
url: `/api/v1/jointTraining/room/${group}/realDevice/connect`,
method: 'get'
});
}
// 更新真实设备的连接关系
export function updateRealDevicesNew(group, data) {
return request({
url: `/api/v1/jointTraining/room/${group}/realDevice`,
method: 'put',
data: data
});
}
// 真实设备是否被其他仿真使用
export function realDeviceIsUsedNew(group, projectCode) {
return request({
url: `/api/v1/jointTraining/room/${group}/realDeviceUsed`,
method: 'get',
params: {
projectCode: projectCode
}
});
}

View File

@ -277,7 +277,7 @@ export function modifyScriptAction(group, actionId, data) {
/** 分页查询存在的仿真 */
export function getExistingSimulation(params) {
return request({
url: `/api/simulation/manage/page`,
url: `/manage/simulation/exists`,
method: 'get',
params
});
@ -286,7 +286,7 @@ export function getExistingSimulation(params) {
/** 删除存在的仿真 */
export function deleteExistingSimulation(group) {
return request({
url: `/api/simulation/manage/${group}`,
url: `/manage/simulation/${group}`,
method: 'delete'
});
}

View File

@ -232,5 +232,6 @@ export default {
deviceCodeRepeatTip: 'The device code already exists, please modify the device code and created!',
stopPointOffsetTip: 'Set block stop offset in bulk successfully!',
mapSortSuccessfully: 'Map sort successfully',
mapSortFailed: 'Map sort failed'
mapSortFailed: 'Map sort failed',
enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!'
};

View File

@ -232,5 +232,6 @@ export default {
deviceCodeRepeatTip: '已存在该设备编号,请修改设备编号后创建!',
stopPointOffsetTip: '批量设置区段停车点偏移量成功!',
mapSortSuccessfully: '地图排序成功!',
mapSortFailed: '地图排序失败!'
mapSortFailed: '地图排序失败!',
enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!'
};

View File

@ -1,15 +1,24 @@
<template>
<el-dialog class="beijing-01__systerm stand-detain-train-all" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-detain-train-all"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px double lightgray; ">
<span class="base-label">范围</span>
<el-row>
<el-radio-group v-model="upDown" @change="choose">
<el-col :span="10">
<el-radio label="02" :id="upDown == '01' ? domIdChoose : ''">上行全线</el-radio>
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">上行全线</el-radio>
</el-col>
<el-col :span="6" :offset="8">
<el-radio label="01" :id="upDown == '02' ? domIdChoose : ''">下行全线</el-radio>
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">下行全线</el-radio>
</el-col>
</el-radio-group>
</el-row>
@ -18,10 +27,8 @@
<div class="table">
<span>扣车站台列表中心设置</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" empty-text="所有站台都无扣车状态" height="160" highlight-current-row>
<el-table-column prop="stationName" label="车站名称">
</el-table-column>
<el-table-column prop="standName" :width="140" label="扣车站台">
</el-table-column>
<el-table-column prop="stationName" label="车站名称" />
<el-table-column prop="standName" :width="140" label="扣车站台" />
</el-table>
</div>
<el-row justify="center" class="button-group">
@ -33,17 +40,17 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
export default {
name: 'StandDetainTrainAll',
components: {
NoticeInfo
@ -56,12 +63,12 @@
upDown: '01',
tempData: [],
disabled: true,
operation: '',
}
operation: ''
};
},
computed: {
...mapGetters('map', [
'stationStandList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -87,28 +94,28 @@
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
loadTableData() {
this.tempData = [];
this.stationStandList.forEach(elem => {
/** status 01: 未扣车*/
let stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
let station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) === Number(this.upDown)) {
this.tempData.push({ stationName: station.name, standName: elem.name });
}
});
//
//
if (this.tempData.length > 0) {
this.disabled = false;
}
},
doShow(operate, selected) {
this.selected = selected;
//
//
if (!this.dialogShow) {
this.loading = false;
this.upDown = selected.direction;
@ -127,27 +134,27 @@
mouseCancelState(this.selected);
},
choose(upDown) {
//
//
this.loadTableData();
let operate = {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
val: `${upDown}`,
}
val: `${upDown}`
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
});
},
commit() {
let operate = {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
val: this.upDown,
}
val: this.upDown
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -159,13 +166,13 @@
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
})
});
},
cancel() {
let operate = {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
@ -176,5 +183,5 @@
});
}
}
}
};
</script>

View File

@ -4,7 +4,8 @@ const mapDeviceStyle = {
'03': 'bejing_01',
'04': 'chengdu_03',
'06': 'ningbo_01',
'07': 'haerbin_01'
'07': 'haerbin_01',
'08': 'foshan_01'
};
export function selectLineCode(code) {

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台轨名称
show: true, // 站台轨名称显示
opposite: true, // 对称相反
@ -236,7 +225,8 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
@ -255,7 +245,8 @@ class SkinCode extends defaultStyle {
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
@ -312,7 +301,8 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
@ -465,6 +455,22 @@ class SkinCode extends defaultStyle {
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
@ -596,7 +585,8 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
@ -615,7 +605,8 @@ class SkinCode extends defaultStyle {
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};

View File

@ -0,0 +1,630 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinCode extends defaultStyle {
constructor() {
super();
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: {
show: true, // 物理区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
show: true, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 6, // 文字离区段距离
fontSize: 8, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
show: true, // 折返轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
show: true, // 转换轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 28, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
show: true, // 目的码名称显示
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 10, // 字体大小
fontWeight: 'bold', // 字体粗细
fontColor: 'yellow', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
line: {
width: 5, // 区段宽度
beyondWidth: 1, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
spareColor: '#3F3F3F', // 区段空闲颜色
communicationOccupiedColor: '#FF329A', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#FE0000', // 区段非通讯车占用颜色
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
faultLockColor: '#00FF00', // 区段故障锁闭颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
blockColor: '#800080', // 区段封锁颜色
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
},
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: '#FFFFFF', // 区段计轴颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽短
distance: 5, // 限速线距离区段距离
lineColor: '#FFFF00', // 限速线颜色
nameShow: false // 名称显示
},
separator: {
z: 6, // 分割符层级
width: 1.2, // 分隔符宽度
endWidth: 3.5, // 尽头分隔符宽度
endColor: '#3F3F3F', // 尽头分隔符颜色
color: '#3149C3' // 区段边界符颜色
},
block: {
special: false // 区段特殊显示
},
trainPosition:{
display: false // 列车实时位置显示
}
};
this[deviceType.Signal] = {
distance: 10, // 设备距离区段的距离
post: {
standardLength: 6, // 高柱长度
standardHeight: 6, // 灯柱高度
standardColor: '#3149C3', // 灯珠颜色
standardWidth: 2 // 灯珠宽度
},
text: {
show: true, // 信号机名称显示
distance: 0, // 文字和灯杆的距离
isAlignCenter: true, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色
checkColor: '#00FF00', // 信号字体
nameBorderShow: true // 信号机名字边框显示
},
lamp: {
bgShow: false, // 是否被选中
guidName: 'defult', // 默认引导类型
stopWidth: 2, // 禁止线宽度
borderWidth: 1, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 6, // 信号灯半径
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色
greenColor: '#00FF00', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: false, // 自动进路方向
offset: { x: -4, y: 0 }, // 自动进路偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
signalFrontTriangle: false, // 信号灯前三角展示
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
manualControl: '#FFFF00', // 人工控制
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: true, // 延时解锁方向
offset: { x: 15, y: -10}, // 延时解锁偏移量
fontSize: 11, // 延迟解锁字体大小
fontColor: '#FF0000', // 延迟解锁颜色
fontWeight: 'bold' // 字体粗细
},
button: {
distance: 5, // 信号灯按钮距离区段的距离
borderDashColor: '#FFFFFF', // 信号灯按钮边线
buttonColor: 'darkgreen', // 信号灯按钮颜色
buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色
},
lowButton:{
display: false // 现地 信号机按钮
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 11, // 站台默认字体大小
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
width: 60,
distance: 8, // 站台和屏蔽门之间的距离
defaultColor: '#00FF00', // 屏蔽门默认颜色
splitDoorColor: '#F61107' // 屏蔽门切除颜色
},
stand: { // 站台
headFontSize: 11, // 站台首端字体大小
spareColor: '#606060', // 站台空闲颜色
stopColor: '#FEFE00', // 站台列车停站颜色
jumpStopColor: '#9A99FF', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 20}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},
detainCar: { // 扣车
text: 'H', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -6}, // 扣车偏移量
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: 26}, // 运行时间偏移量
textColor: '#FFFFFF' // 停站时间字体颜色
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 6}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
},
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
lampColor: '#5A5D5A' // 功能按钮颜色
}
};
this[deviceType.StationCounter] = {
text: {
distance: 2, // 计数器名称和文字的距离
fontColor: '#FFFFFF', // 计数器字体颜色
borderColor: '#E4EF50' // 计数器边框颜色
}
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离
fontColor: '#FFFFFF', // 延时解锁字体颜色
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
subtitleText: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 17 // 等于副标题距离
},
lamp: {
lineDash: null, // 灯的包围框
borderShow: false, // 是否显示边框
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示
// },
kmPostShow: true, // 公里标显示
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
},
turnBack: { // 按图折返
lamp: 1, // 灯数量
lampSpace: 60 // 灯间距
},
StationControl:{
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 11, // 字体大小
fontFormat: 'consolas', // 字体格式
fontColor: '#ffffff', // 字体颜色
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top', // 字体垂直对齐
centerControlText: '中控', // 中控文字内容
substationControlText: '站控', // 站控文字内容
emergencyControlText:'紧急站控', // 紧急站控文字内容
interconnectedControlText:'连锁控' // 连锁控文字内容
// stationCenterControlText: '站中控', // 站中控文字内容
// generalAlarmControlText: '总报警' // 总报警文字内容
},
lamp: {
count: 2, // 控制模式灯个数
offset: {x: 0, y: 0}, // 控制模式灯偏移量
radiusR: 4, // 控制模式灯的半径
distance: 36, // 控制模式之间灯之间的距离
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: false, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false, // 联锁控显示
centerControlButtonShow: false // 中控显示
},
arrow: {
show: true // 控制模式箭头显隐
},
mouseOverStyle: { // 鼠标悬浮样式
fontSize: null,
fontFormat: 'consolas',
fontColor: '#000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top'
}
}
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 0, y: 8}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
fontWeight: 'bold', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#9C9D09', // 道岔反位颜色
monolockColor: '#870E10' // 道岔单锁颜色
},
sectionAction: {
flag: false, // 道岔 关联区段显示
spareColor: '#5b5b5b' // 区段显示颜色
},
core: {
length: 6 // 道岔单边长度
},
block: { // 道岔封锁配置
blockName: 'default', // 默认道岔封锁类型
nameBorderShow: true, // 道岔名称是否有包围框 显示
contentRectShow: false // 道岔封锁显示
},
monolock: { // 道岔单锁配置
locationColor: '#ea282c', // 道岔单锁定位颜色 (红色)
inversionColor: '#ea282c', // 道岔单锁反位颜色 (红色)
rectShow: false // 道岔单锁 矩形框是否显示
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.LcControl] = {
text: {
fontSize: 10, // 灯字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#FFFF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.ZcControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#00FF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.LimitControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#ECE9D8' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
textColor: '#000000',
arcColor: '#00FFFF'
}
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
}
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔
lineWidth: 1, // 车次窗线宽
trainWindowSmooth: 0 // 车次窗矩形圆滑程度
};
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 0, // 车身line宽
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [
{
type: '03',
serviceNumber: 'MM',
nameFormat: 'serviceNumber:groupNumber'
},
{
type: '02',
nameFormat: 'targetCode:groupNumber'
}
], // 特殊列车类型需设置显示格式
lrPadding: 1, // 两边间隔
upPadding: 1, // 上边距离
trainBodyFillColor: '#000000', // 列车车身填充颜色
trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式
},
hsda: {
trainHSDATextFontSize: 8// 列车HDSA字号
},
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'AAA', // 默认目的地码
trainTargetTextAlign: 'left', // 车次号文字显示位置
trainNumberOffset: { x: 1, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'BB', // 默认服务号(表号)
trainServerOffset: { x: 26, y: 1}// 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '0000', // 车次号前缀
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 42, y: 1}// 列车车次号偏移
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀
defaultGroupNumber: 'EEE', // 默认车组号
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量
},
trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
},
common: {
trainHeight: 17, // 列车高度
trainHeadDistance: 2, // 列车和车头之间的间距
trainWidth: 76, // 列车长度
trainTextFontSize: 15, // 列车字号
fontFamily: 'consolas', // 默认字体 族类
nameFontSize: 15, // 字体大小
haveTextHSDA: false, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 8 / 15, // 字体宽高比例用以拼接text是计算位置
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸
displayPosition: 'margin' // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗
},
trainStatusStyle: {
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#3265FF'},
{status: '04', showColor: '#9B4A09'},
{status: '05', showColor: '#EF0C08'},
{status: '06', showColor: '#FFFFFF'},
{status: '07', showColor: '#FFFF00'}
], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除
destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色
directionType: [
{
type: 1,
lineLShow: false,
lineRShow: false,
arrowLShow: false,
arrowRShow: true
},
{
type: 0,
lineLShow: false,
lineRShow: false,
arrowLShow: true,
arrowRShow: false
}
], // 运行方向状态类型对应车头显示状态 1从左往右 0从右往左
directionStopType: [
{type: '01', lineLShow: false, lineRShow: false},
{type: '02', lineLShow: false, lineRShow: true},
{type: '03', lineLShow: true, lineRShow: false}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
driveModeStatus: [
{
status: 'AM',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: 'CM',
trainLColor: '#FFFF00',
trainRColor: '#FFFF00'
},
{
status: 'RM',
trainLColor: '#EA700D',
trainRColor: '#EA700D'
},
{
status: 'NRM',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
}
], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM
runControlStatus: [], // 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}
doorStatus: [], // 设置车门状态类型
communicationStatus: [], // 设置通信状态 eg:{status: '01', trainColor:'#725A64'}
alarmStatus: [], // 设置报警状态 eg:{status: '01', aShow: false}
serverNoType: []// 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'}
}
};
}
}
export default new SkinCode();

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
@ -295,12 +284,29 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
@ -150,9 +139,11 @@ class SkinCode extends defaultStyle {
isAlignCenter: true, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色
defaultColor: '#00CE00', // 信号灯字体默认色
blockColor: '#ffffff', // 信号灯字体锁定颜色
checkColor: '#00FF00', // 信号字体
ArtificialRouteColor: '#FFFFFF', // ATS关自排 设定颜色
AutoRouteColor: '#D8D800', // 联锁自动进路颜色
nameBorderShow: false // 信号机名字边框显示
},
lamp: {
@ -166,10 +157,10 @@ class SkinCode extends defaultStyle {
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色
greenColor: '#000080', // 信号灯绿色
greenColor: '#00FF00', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
blueColor: '#000080' // 信号灯蓝色
},
route: {
direction: false, // 自动进路方向
@ -311,12 +302,29 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};
this[deviceType.Station] = {
// text: {
// show: true // 公里标名称显示

View File

@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
switchText: {
show: false, // 道岔区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
@ -230,13 +219,29 @@ class SkinCode extends defaultStyle {
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#ffff00' // 点亮灯颜色
},
OutFrame: {
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小

View File

@ -12,7 +12,6 @@ deviceState[deviceType.Section] = {
cutOff: 0, // 是否切除
invalid: 0, // 是否失效
speedUpLimit: 0, // 最高限速
/** 是否故障*/
fault: 0 /** 非故障*/
};
// 进路后端状态

View File

@ -85,7 +85,7 @@ class Jlmap {
return defaultStateDict;
}
setMap(map, mapDevice, routeData) {
setMap(map, mapDevice, logicData) {
// 保存皮肤类型
if (map.skinVO) {
this.lineCode = map.skinVO.code;
@ -100,7 +100,7 @@ class Jlmap {
// 解析后的数据
this.mapDevice = mapDevice;
// 进路数据
this.routeData = routeData;
this.logicData = logicData;
// 加载对应皮肤
this.style = this.loadStyle(this.lineCode);
@ -323,6 +323,13 @@ class Jlmap {
});
}
}
updatePrdType(val, list) {
this.showConfig.prdType = val;
(list || []).forEach(item => {
this.hookHandle(item, this.showConfig);
this.$painter.update(item);
});
}
update(list) {
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
(list || []).forEach(elem => {
@ -330,7 +337,7 @@ class Jlmap {
const type = elem._type;
if (elem.deviceType === 'ROUTE') { // 处理进路数据状态
store.dispatch('map/updateRouteState', elem);
const route = this.routeData[code];
const route = this.logicData.routeData[code];
if (route.automaticRouteCode) {
const automaticRoute = this.mapDevice[route.automaticRouteCode];
const automaticRouteStatus = {fleetMode: elem.fleetMode};
@ -343,6 +350,26 @@ class Jlmap {
if (this.hookHandle(signalDevice, signalStatus)) {
this.$painter.update(signalDevice);
}
} else if (elem.deviceType === 'CYCLE') {
store.dispatch('map/updateAutoReentryState', elem);
const autoReentryData = this.logicData.autoReentryData[code];
const cycleButton = this.mapDevice[autoReentryData.cycleButtonCode];
const cycleButtonStatus = {setUp: elem.setUp};
if (cycleButton && this.hookHandle(cycleButton, cycleButtonStatus)) {
this.$painter.update(cycleButton);
}
} else if (elem.deviceType === 'STATION') {
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
const guideLock = this.mapDevice[oDevice.guideLockCode];
const guideLockStatus = {totalGuideLock: elem.totalGuideLock};
if (guideLock && this.hookHandle(guideLock, guideLockStatus)) {
this.$painter.update(guideLock);
}
if (elem.dispose) {
this.$painter.delete(oDevice);
} else {
this.$painter.update(oDevice);
}
} else {
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
if (elem.dispose) {

View File

@ -108,12 +108,12 @@ export default class Automactic extends Group {
this.control && this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.controlColor });
}
handleSignal() {
this.control.setStyle({ fill: 'green' });
this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.lightUpColor });
}
// 设置状态
setState(model) {
this.recover();
model.green && this.handleSignal();
model.setUp && this.handleSignal();
}
createMouseEvent() {
@ -167,28 +167,28 @@ export default class Automactic extends Group {
const showMode = this.model.showMode;
const showConditions = this.style.AutoTurnBack.visibleConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.show();
this.showMode();
} else {
this.hide();
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.isShowShape = true;
this.show();
this.showMode();
} else {
this.isShowShape = false;
this.hide();
this.hideMode();
}
}
show() {
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.arcBorder && this.arcBorder.show();
this.setState(this.model);
}
hide() {
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -136,27 +136,27 @@ export default class AutomacticRoute extends Group {
const showMode = this.model.showMode;
const showConditions = this.style.AutomaticRoute.displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.show();
this.showMode();
} else {
this.hide();
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.isShowShape = true;
this.show();
this.showMode();
} else {
this.isShowShape = false;
this.hide();
this.hideMode();
}
}
show() {
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.setState(this.model);
}
hide() {
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -86,10 +86,17 @@ export default class GuideLock extends Group {
this.add(this.control);
this.add(this.text);
}
recover() {
this.control && this.control.setStyle({ fill: this.style.GuideLock.lamp.controlColor });
}
handleSignal() {
this.control.setStyle({ fill: this.style.GuideLock.lamp.lightUpColor });
}
// 设置状态
setState(model) {
if (!this.isShowShape) return;
this.recover();
model.totalGuideLock && this.handleSignal();
}
createMouseEvent() {
@ -129,27 +136,27 @@ export default class GuideLock extends Group {
const showMode = this.model.showMode;
const showConditions = this.style.GuideLock.displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.show();
this.showMode();
} else {
this.hide();
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.isShowShape = true;
this.show();
this.showMode();
} else {
this.isShowShape = false;
this.hide();
this.hideMode();
}
}
show() {
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.setState(this.model);
}
hide() {
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -6,7 +6,7 @@ import ELines from './ELines'; // 创建多线条 曲线 (私有)
import EblockLines from './EblockLines'; // 区段封锁特有
import ESeparator from './ESeparator'; // 分隔符 (私有)
import EMouse from './EMouse';
import { EAxle } from './EAxle'; // 创建计轴 (私有)
// import { EAxle } from './EAxle'; // 创建计轴 (暂时不使用)
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
import ELimitName from './ELimitName'; // 成都三号线 限速名称
import JTriangle from '../../utils/JTriangle';
@ -33,211 +33,12 @@ export default class Section extends Group {
}
create() {
const model = this.model;
// 01:计轴区段02逻辑区段03道岔区段 04道岔计轴区段
// 区段type 01计轴区段02逻辑区段03道岔区段 04道岔计轴区段
this.createSectionText(); // 创建区段文字
// if ((model.type === '01' || model.type === '03') && (
// model.logicSectionNum.length <= 0 ||
// model.logicSectionNum.length == 1 && model.logicSectionNum[0] == 0) ||
// model.type === '02') {
// if (model.type === '01' || model.type === '03') {
this.createSection(); // 创建区段
this.creatRelease(); // 创建延时释放
this.createSeparator(); // 创建分隔符
this.createTurnBack(); // 创建成都三号线 折返箭头
if (model.type === '01' && model.type === '03') {
this.createAxles(); // 创建计轴
}
// }
}
/** 创建区段*/
createSection() {
const model = this.model;
const style = this.style;
// 创建区段
this.section = new ELines({
zlevel: this.zlevel,
// z: model.type == '02' ? this.z + 1 : this.z, // 逻辑区段层级降低一层
z: this.z, // 逻辑区段层级降低一层
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
style: style
});
// 创建哈尔滨特殊区段(用作封锁显示)
this.sectionBlock = new EblockLines({
zlevel: this.zlevel,
z: this.z,
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.points,
style: style
});
this.add(this.section);
this.add(this.sectionBlock);
if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色
this.lineBorder = new ELines({
zlevel: this.zlevel,
z: this.z - 1, // 逻辑区段层级降低一层
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
style: style
});
this.add(this.lineBorder);
this.lineBorder.setStyle({ lineWidth: 0 });
}
}
// 折返箭头
createTurnBack() {
const model = this.model;
const style = this.style;
if (model.reentryTrack && style.Section.shuttleBack) {
const radius = 3;
model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边
const width = style.Section.line.width * 2;
const height = style.Section.line.width * 1;
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
const points = model.points;
let x = -model.drict * width * 1.2;
let y = -turnBackDistance;
if (model.drict < 0) {
x += points[0].x;
y += points[0].y;
} else {
x += points[points.length - 1].x;
y += points[points.length - 1].y;
}
this.turnBack = new EBackArrow({
zlevel: this.zlevel,
z: this.z + 10,
shape: {
drict: model.drict,
width: width,
height: height,
points: {
x: x,
y: y
}
},
style: {
lineWidth: style.Section.separator.width,
stroke: style.Section.separator.color,
fill: 'rgba(0, 0, 0, 0)'
}
});
this.turnBackriangle = new EBackArrowTriangle({
zlevel: this.zlevel,
z: this.z + 10,
shape: {
drict: model.drict,
width: width,
height: height,
points: {
x: x,
y: y
}
},
style: {
lineWidth: style.Section.separator.width,
stroke: style.Section.separator.color,
fill: style.Section.separator.color
}
});
this.add(this.turnBack);
this.add(this.turnBackriangle);
this.turnBack.hide();
this.turnBackriangle.hide();
}
}
// 创建延时释放 (需要在创建)
creatRelease() {
const model = this.model;
const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
this.release = new ERelease({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
},
lineWidth: style.Section.line.width,
stroke: style.Section.line.spareColor
});
this.add(this.release);
}
// 创建限速线 (需要在创建)
creatSpeedLimit() {
const model = this.model;
const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
if (x == Infinity) { x = 0; }
if (y == Infinity) { y = 0; }
if (!this.speedLimitLeft && !this.speedLimitRight) {
this.speedLimitLeft = new ELimitLines({
zlevel: this.zlevel,
z: this.z,
position: [x, -y],
style: style,
switch: model.switch,
code: model.code,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
points: model.points
});
this.speedLimitRight = new ELimitLines({
zlevel: this.zlevel,
z: this.z,
position: [-x, y],
style: style,
switch: model.switch,
code: model.code,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
points: model.points
});
if (style.Section.speedLimit.nameShow) {
// 开头 起点位置
this.speedLimitNameLeft = new ELimitName({
zlevel: this.zlevel,
z: this.z + 10,
drict: -1,
x: model.points[0].x,
y: model.points[0].y - 15,
style: style
});
// 终点位置
this.speedLimitNameRight = new ELimitName({
zlevel: this.zlevel,
z: this.z + 10,
drict: 1,
x: model.points[model.points.length - 1].x,
y: model.points[model.points.length - 1].y - 15,
style: style
});
this.add(this.speedLimitNameLeft);
this.add(this.speedLimitNameRight);
}
}
this.add(this.speedLimitLeft);
this.add(this.speedLimitRight);
}
// 创建区段名称
@ -251,14 +52,11 @@ export default class Section extends Group {
const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/
let tempx = x;
let tempy = y;
if (model.type == '01') { // 物理区段名称
if (style.Section.text.show) {
const opposite = style.Section.text.opposite ? -1 : 1;
tempx += traingle.getSin(style.Section.text.distance);
tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
const tempx = x + traingle.getSin(style.Section.text.distance);
const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
@ -280,8 +78,8 @@ export default class Section extends Group {
} else if (model.type == '02') { // 逻辑区段
if (style.Section.logicText.show) {
const opposite = style.Section.logicText.opposite ? -1 : 1;
tempx += traingle.getSin(style.Section.logicText.distance);
tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
const tempx = x + traingle.getSin(style.Section.logicText.distance);
const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
@ -300,34 +98,14 @@ export default class Section extends Group {
});
this.add(this.name);
}
} else if (model.type == '03') { // 道岔区段
if (style.Section.switchText.show) {
} else if (model.type == '04') { // 道岔计轴区段
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
} else if (model.type == '04') { // 道岔计轴区段名称
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
x: x + model.namePosition.x,
y: y + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
@ -434,98 +212,196 @@ export default class Section extends Group {
}
}
// 创建计轴 (需要在创建)
createAxles() {
/** 创建区段*/
createSection() {
const model = this.model;
const style = this.style;
/** 创建四个计轴*/
let traingle = null;
if (model && style && model.axleShow && model.points && model.points.length > 1) {
traingle = new JTriangle(model.points[0], model.points[1]);
this.lUpAxle = new EAxle({
// 创建区段
this.section = new ELines({
zlevel: this.zlevel,
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
z: this.z, // 逻辑区段会覆盖物理区段
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
style: style
});
this.add(this.section);
if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示)
this.sectionBlock = new EblockLines({
zlevel: this.zlevel,
z: this.z,
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.points,
style: style
});
this.add(this.sectionBlock);
}
if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色
this.lineBorder = new ELines({
zlevel: this.zlevel,
z: this.z - 1,
isSwitchSection: model.switchSection,
isCurve: model.curve,
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
style: style
});
this.add(this.lineBorder);
this.lineBorder.setStyle({ lineWidth: 0 });
}
}
// 折返箭头
createTurnBack() {
const model = this.model;
const style = this.style;
if (model.reentryTrack && style.Section.shuttleBack) {
const radius = 3;
model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边
const width = style.Section.line.width * 2;
const height = style.Section.line.width * 1;
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
const points = model.points;
let x = -model.drict * width * 1.2;
let y = -turnBackDistance;
if (model.drict < 0) {
x += points[0].x;
y += points[0].y;
} else {
x += points[points.length - 1].x;
y += points[points.length - 1].y;
}
this.turnBack = new EBackArrow({
zlevel: this.zlevel,
z: this.z + 10,
shape: {
point: {
drict: model.drict,
width: width,
height: height,
points: {
x: x,
y: y
}
},
style: {
lineWidth: style.Section.separator.width,
stroke: style.Section.separator.color,
fill: 'rgba(0, 0, 0, 0)'
}
});
this.turnBackriangle = new EBackArrowTriangle({
zlevel: this.zlevel,
z: this.z + 10,
shape: {
drict: model.drict,
width: width,
height: height,
points: {
x: x,
y: y
}
},
style: {
lineWidth: style.Section.separator.width,
stroke: style.Section.separator.color,
fill: style.Section.separator.color
}
});
this.add(this.turnBack);
this.add(this.turnBackriangle);
this.turnBack.hide();
this.turnBackriangle.hide();
}
}
// 创建延时释放
creatRelease() {
const model = this.model;
const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
this.release = new ERelease({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
},
lineWidth: style.Section.line.width,
stroke: style.Section.line.spareColor
});
this.add(this.release);
}
// 创建限速线
creatSpeedLimit() {
const model = this.model;
const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
if (x == Infinity) { x = 0; }
if (y == Infinity) { y = 0; }
if (!this.speedLimitLeft && !this.speedLimitRight) {
this.speedLimitLeft = new ELimitLines({
zlevel: this.zlevel,
z: this.z,
position: [x, -y],
style: style,
switch: model.switch,
code: model.code,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
points: model.points
});
this.speedLimitRight = new ELimitLines({
zlevel: this.zlevel,
z: this.z,
position: [-x, y],
style: style,
switch: model.switch,
code: model.code,
isSwitchSection: model.switchSection,
relSwitchCode: model.relSwitchCode,
isCurve: model.curve, // 是否曲线
points: model.points
});
if (style.Section.speedLimit.nameShow) {
// 开头 起点位置
this.speedLimitNameLeft = new ELimitName({
zlevel: this.zlevel,
z: this.z + 10,
drict: -1,
x: model.points[0].x,
y: model.points[0].y
},
drictx: 1,
dricty: -1,
traingle: traingle,
y: model.points[0].y - 15,
style: style
},
style: {
GBaseLineWidth: 1,
stroke: style.Section.axle.color
}
});
this.lBottomAxle = new EAxle({
// 终点位置
this.speedLimitNameRight = new ELimitName({
zlevel: this.zlevel,
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
shape: {
point: {
x: model.points[0].x,
y: model.points[0].y
},
drictx: 1,
dricty: 1,
traingle: traingle,
style: style
},
style: {
GBaseLineWidth: 1,
stroke: style.Section.axle.color
}
});
traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
this.rUpAxle = new EAxle({
zlevel: this.zlevel,
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
shape: {
point: {
z: this.z + 10,
drict: 1,
x: model.points[model.points.length - 1].x,
y: model.points[model.points.length - 1].y
},
drictx: -1,
dricty: -1,
traingle: traingle,
y: model.points[model.points.length - 1].y - 15,
style: style
},
style: {
GBaseLineWidth: 1,
stroke: style.Section.axle.color
}
});
this.rBottomAxle = new EAxle({
zlevel: this.zlevel,
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
shape: {
point: {
x: model.points[model.points.length - 1].x,
y: model.points[model.points.length - 1].y
},
drictx: -1,
dricty: 1,
traingle: traingle,
style: style
},
style: {
GBaseLineWidth: 1,
stroke: style.Section.axle.color
this.add(this.speedLimitNameLeft);
this.add(this.speedLimitNameRight);
}
});
this.add(this.lUpAxle);
this.add(this.rUpAxle);
this.add(this.lBottomAxle);
this.add(this.rBottomAxle);
}
this.add(this.speedLimitLeft);
this.add(this.speedLimitRight);
}
// 创建分隔符 (内层需要在创建)
// 创建分隔符
createSeparator() {
const model = this.model;
const style = this.style;
@ -566,14 +442,6 @@ export default class Section extends Group {
}
}
/** 设置区段集合显隐*/
setInvisible() {
const invisible = this.model.type === '02' && this.model.logicSectionShow;
this.eachChild((child) => {
child.attr('invisible', invisible);
});
}
/** 设置区段恢复默认状态*/
recover() {
if (this.section) {
@ -584,10 +452,7 @@ export default class Section extends Group {
stroke: this.style.Section.line.spareColor,
lineWidth: this.style.Section.line.width
});
if (this.release) {
this.release.hide();
}
this.release && this.release.hide();
if (this.speedLimitLeft && this.speedLimitRight) {
this.remove(this.speedLimitLeft);
this.remove(this.speedLimitRight);
@ -664,7 +529,7 @@ export default class Section extends Group {
}
}
/** 故障锁定状态 05*/
/** 故障锁 05*/
faultLock() {
if (this.section) {
this.section.setStyle({
@ -705,7 +570,7 @@ export default class Section extends Group {
}
}
/** 延时释放 10*/
/** 延时释放*/
async timeRelease() {
this.section.setStyle({
stroke: this.style.Section.line.routeLockColor,
@ -725,7 +590,7 @@ export default class Section extends Group {
}
}
/** 保护区段延时解锁 11*/
/** 保护区段延时解锁*/
protectiveTimeRelease() {
this.section.setStyle({
stroke: this.style.Section.line.protectiveLockColor,
@ -786,7 +651,7 @@ export default class Section extends Group {
setState(model, flag = false) {
if (!this.isShowShape) return;
this.recover();
// 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的
// 哈尔滨线路 道岔相关区段设置 默认颜色
if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) {
const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode];
if (switchModel.normalPosition != 0) { // 定位情况
@ -808,14 +673,17 @@ export default class Section extends Group {
model.routeLock && this.routeLock();
/** 轨道封锁 */
model.blockade && this.block();
/** 非CBTC车占用 */
/** 非通信车占用状态 */
model.nctOccupied && this.unCommunicationOccupied();
/** CBTC车占用 */
/** 通信车占用状态 */
model.ctOccupied && this.communicationOccupied();
/** 区段切除*/
model.cutOff && this.sectionCutOff();
/** 是否限速*/
model.speedUpLimit && this.setSpeedUpperLimit();
// 区段计轴预复位状态 (未处理)
// 区段故障锁闭
model.fault && this.faultLock();
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
const sectionSwitch = store.getters['map/getDeviceByCode'](model.switch.code);

View File

@ -1,113 +0,0 @@
import Polyline from 'zrender/src/graphic/shape/Polyline';
import Circle from 'zrender/src/graphic/shape/Circle';
import Arc from 'zrender/src/graphic/shape/Arc';
import Rect from 'zrender/src/graphic/shape/Rect';
import Group from 'zrender/src/container/Group';
class ESigButton extends Group {
constructor(model) {
super();
this.model = model;
this.isNew = false;
}
create() {
if (!this.isNew) {
const model = this.model;
const style = this.model.style;
const padding = 1;
const r = style.Signal.lamp.radiusR * 0.8;
this.isNew = true;
this.sigNormalButtom = new Rect({
zlevel: model.zlevel,
z: model.z,
_subType: 'SignalButton',
_val: '1',
shape: {
x: model.x - style.Signal.lamp.radiusR,
y: model.y - r + r * model.posit,
width: style.Signal.lamp.radiusR * 2,
height: style.Signal.lamp.radiusR * 2
},
style: {
lineWidth: 0.2,
stroke: style.Signal.button.borderDashColor,
fill: style.Signal.button.buttonColor
}
});
this.sigNormalButtomDown = new Polyline({
_subType: 'SignalButton',
_val: '1',
zlevel: model.zlevel,
z: model.z,
silent: true,
shape: { points: [
[model.x - padding + r, this.sigNormalButtom.shape.y + padding],
[model.x + padding - r, this.sigNormalButtom.shape.y + padding],
[model.x + padding - r, this.sigNormalButtom.shape.y + padding * 2 + r]
] },
style: {
lineWidth: 0.8,
stroke: style.backgroundColor
}
});
this.sigReentryButton = new Circle({
zlevel: model.zlevel,
z: model.z,
_subType: 'SignalButton',
_val: '2', // 折返按钮
shape: {
cx: model.x,
cy: model.y - 5 / 2 * r * model.posit,
r: style.Signal.lamp.radiusR
},
style: {
lineWidth: 0.2,
stroke: style.Signal.button.borderDashColor,
fill: style.Signal.button.buttonColor
}
});
this.sigReentryButtonDown = new Arc({
_subType: 'SignalButton',
_val: '2', // 折返按钮
zlevel: model.zlevel,
z: model.z,
silent: true,
shape: {
cx: this.sigReentryButton.shape.cx,
cy: this.sigReentryButton.shape.cy,
r: this.sigReentryButton.shape.r - padding,
startAngle: Math.PI * 8 / 5,
endAngle: Math.PI * 4 / 5,
clockwise: false
},
style: {
lineWidth: 0.8,
stroke: style.backgroundColor
}
});
this.add(this.sigNormalButtom);
this.add(this.sigReentryButton);
this.hide();
}
}
hide() {
this.create();
this.sigNormalButtom.hide();
this.sigReentryButton.hide();
}
show() {
this.create();
this.sigNormalButtom.show();
this.sigReentryButton.show();
}
}
export default ESigButton;

View File

@ -5,12 +5,10 @@ import ESigPost from './ESigPost';
import ESigLamp from './ESigLamp';
import ESigAuto from './ESigAuto';
import ESigRoute from './ESigRoute';
import ESigButton from './ESigButton';
import ESigDelay from './ESigDelay';
import ESigName from './ESigName';
import EMouse from './EMouse';
import Group from 'zrender/src/container/Group';
import BoundingRect from 'zrender/src/core/BoundingRect';
import EHighlight from '../element/EHighlight';
import EVirtualSignal from './EVirtualSignal';
import ELowButton from './ELowButton';
@ -73,18 +71,6 @@ class Signal extends Group {
this.lamps.push(lamp);
}
// 虚拟信号机显示
this.virtualSignal = new EVirtualSignal({
zlevel: this.zlevel,
z: this.z,
style: style,
drict: drict,
x: endPoint.x,
y: endPoint.y,
originX: model.position.x,
originY: model.position.y
});
// 信号机名称
const sigNameX = model.position.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x;
const sigNameY = model.position.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance);
@ -110,7 +96,7 @@ class Signal extends Group {
// 北京一号线,宁波一号线 自动进路状态
// const signalRouteH=;
// 自动进路
// 自动进路
const sigRouteH = style.Signal.route.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2;
const sigRouteX = endPoint.x + (style.Signal.route.offset.x + sigRouteH) * drict;
const sigRouteY = endPoint.y + (style.Signal.route.offset.y);
@ -123,7 +109,7 @@ class Signal extends Group {
drict: drict
});
// 自动通过
// 自动通过
const sigAutoH = style.Signal.auto.direction ? this.count * style.Signal.lamp.radiusR * 2 : -style.Signal.lamp.radiusR * 2;
const sigAutoX = endPoint.x + (style.Signal.auto.offset.x + sigAutoH) * drict;
const sigAutoY = endPoint.y + (style.Signal.auto.offset.y);
@ -160,17 +146,6 @@ class Signal extends Group {
textVerticalAlign: 'middle'
});
// 信号灯按钮
this.sigButton = new ESigButton({
zlevel: this.zlevel,
z: this.z,
style: style,
posit: posit,
show: model.buttonShow,
x: model.buttonPosition.x,
y: model.buttonPosition.y - posit * (style.Signal.button.distance + style.Signal.lamp.radiusR * 2)
});
if (isShowThePrdType(model.prdType, '03') && this.style.Signal.lowButton.display) {
// 北京一号线现地 信号机点击按钮
const lowButtonH = this.count * style.Signal.lamp.radiusR * 2;
@ -191,11 +166,21 @@ class Signal extends Group {
this.add(this.sigDelay);
if (this.model.virtual) {
// 虚拟信号机显示
this.virtualSignal = new EVirtualSignal({
zlevel: this.zlevel,
z: this.z,
style: style,
drict: drict,
x: endPoint.x,
y: endPoint.y,
originX: model.position.x,
originY: model.position.y
});
this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路)
} else {
this.lamps.forEach(lamp => { this.add(lamp); });
}
// this.add(this.sigButton);
}
createMouseEvent() {
@ -226,145 +211,50 @@ class Signal extends Group {
// 关闭
close() {
if (this.count == 2 && !this.model.lightType) { // 双灯 物理点灯
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 2 && this.model.lightType) { // 双灯 逻辑点灯
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 1 && !this.model.lightType) { // 单灯 物理点灯
if (this.lamps[0]) {
this.lamps[0].setStop(false);
if (this.model.useType == '05') {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
} else if (this.count == 1 && this.model.lightType) { // 单灯 逻辑点灯
if (this.lamps[0]) {
this.lamps[0].setStop(true);
if (this.model.useType == '05') {
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
} else if (this.count == 1) {
if (this.lamps[0]) {
if (this.model.useType == '05') {
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
}
}
/* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
openPositive() { // 正向开放
if (this.count == 2 && !this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 2 && this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 1 && !this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
}
/* 正向开放*/
openPositive() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
/* count 1单灯 2双灯 lightType 逻辑点灯 true物理点灯 false */
openLateral() { // 侧向开放
if (this.count == 2 && !this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 2 && this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 1 && !this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
// 出站信号机/阻隔信号机
if (['02', '06'].includes(this.model.useType)) {
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
}
}
} else if (this.count == 1 && this.model.lightType) {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
}
/* 侧向开放 */
openLateral() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
// 列车进路
trainRoute() {
if (this.count == 1) {
/** 单灯 列兼调信号*/
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
}
}
// 调车进路
shuntRoute() {
if (this.count == 1) {
/** 单灯 列兼调信号*/
/** 单灯 阻挡兼调车信号*/
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
}
}
// 引导
guid() {
@ -374,26 +264,17 @@ class Signal extends Group {
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
}
if (this.count == 2 && !this.model.lightType && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
}
} else if (this.count == 1 && !this.model.lightType && this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStop(false);
if (this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 允许引导信号
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} else if (this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 });
}
}
// 封锁
block() {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#000080');
}
@ -406,42 +287,31 @@ class Signal extends Group {
// 功能封锁
functionBlock() {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
// this.siglamp.setRectBlockByIndex(1, true);
}
}
// 信号保护区段监视状态显示
signalCheck() {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.sigName.setColor(this.style.Signal.text.checkColor);
}
}
// 故障
fault() {
if (this.count == 2 && !this.model.lightType) { // 双灯 物理点灯
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
if (this.lamps[1]) {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
}
// 逻辑点灯
logicalLight() {
if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X状态的逻辑点灯
this.lamps.forEach(lamp => { lamp.setStop(true); });
}
}
// 物理点灯
logicalLight() {
this.lamps.forEach(lamp => { lamp.setStop(false); });
}
// 逻辑点灯
physicsLight() {
this.lamps.forEach(lamp => { lamp.setStop(true); });
this.lamps.forEach(lamp => { lamp.setStop(false); });
}
// 设置人工进路显示状态 (人工控显示黄色三角)
@ -450,6 +320,9 @@ class Signal extends Group {
this.sigRoute.show();
this.sigRoute.setStyle({ fill: this.style.Signal.auto.manualControl });
}
if (this.style.Signal.lamp.guidName == 'haerbin_01') {
this.sigName.setColor(this.style.Signal.text.ArtificialRouteColor);
}
}
// 设置自动进路模式状态类型
@ -461,6 +334,10 @@ class Signal extends Group {
this.sigAuto.setColor(this.style.Signal.auto.autoRoute);
this.sigAuto.show();
}
if (this.style.Signal.lamp.guidName == 'haerbin_01') {
this.sigName.setColor(this.style.Signal.text.AutoRouteColor);
this.setAutoClose();
}
}
// 信号机进路自动触发模式状态类型
@ -497,7 +374,7 @@ class Signal extends Group {
if (this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth });
}
if (this.style.Signal.lamp.guidName == 'ningbo_01') {
if (this.style.Signal.lamp.guidName == 'ningbo_01' || this.style.Signal.lamp.guidName == 'haerbin_01') {
this.lamps[1].hide();
}
}
@ -516,25 +393,20 @@ class Signal extends Group {
model.isRouteSignal && this.setLowButtonShow();
/** 信号机封锁 */
model.blockade && this.block();
/** 设置灯的颜色 */
// model.redOpen = 0;
// model.redOpen = 1;
// model.yellowOpen = 0;
// model.greenOpen = 1;
// model.greenOpen = 0;
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openPositive(); // 信号侧向开放
}
/** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过
model.fleetMode && this.setAutoRouteOpen();
// 设置点灯类型 必须在最后设置不能放前面
if (model.lightType) {
// 设置点灯类型 必须在最后设置不能放前面 logicLight 0 物理点灯 1 逻辑点灯
if (model.logicLight) {
this.logicalLight(); // 设置逻辑点灯
} else {
this.physicsLight(); // 设置物理点灯
@ -549,15 +421,10 @@ class Signal extends Group {
return rect;
}
getShapeTipPoint(opts) {
var rect = new BoundingRect(0, 0, 0, 0);
getShapeTipPoint(opts) { // 判断第一步 或 第二部步骤 获取元素包围框
var drict = this.model.right ? 1 : -1; // 朝向 右:左
var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下
if (opts.val == '1' || opts.val == '2') {
rect = this.sigButton.getBoundingRect();
} else {
rect = this.sigPost.getBoundingRect();
}
const rect = this.sigPost.getBoundingRect();
return {
x: rect.x + drict * this.style.Signal.post.standardWidth,

View File

@ -161,7 +161,6 @@ export default class Station extends Group {
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.emergencyControlText,
// model.jjzkContent,
pop: false
});
this.add(this.emergencyControl);
@ -178,7 +177,6 @@ export default class Station extends Group {
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.centerControlText,
// model.zokContent,
pop: false
});
this.add(this.centerControl);
@ -195,7 +193,6 @@ export default class Station extends Group {
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.substationControlText,
// model.zakContent
pop: false
});
this.add(this.substationControl);
@ -268,31 +265,35 @@ export default class Station extends Group {
this.setState(model);
}
// 设置状态
setState(model) {
if (!this.isShowShape) return;
switch (model.controlMode) {
case '': // 无状态
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
break;
case 'Center': // 中控
handleCenter() { // 中控
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
break;
case 'Local': // 站控
}
handleLocal() { // 站控
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
break;
case 'Emergency': // 紧急站控
}
handleEmergency() { // 紧急站控
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
break;
}
recover() {
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
}
// 设置状态
setState(model) {
if (!this.isShowShape) return;
this.recover();
model.controlMode && this['handle' + model.controlMode]();
}
getShapeTipPoint() {

View File

@ -1,62 +0,0 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
this.text = new Text({
_subType: 'Text',
zlevel: this.device.zlevel,
z: this.device.z + 1,
position: [0, 0],
style: {
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance - 40,
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
text: '',
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
}
});
this.add(this.text);
this.text.hide();
}
setTextContext(text) {
if (text) {
this.text.setStyle('text', text);
}
}
mouseover(e) {
if (e.target) {
let name = '';
switch (e.target.parent._subType) {
case 'emergency':
name = '紧急站控';
break;
case 'center':
name = '中控';
break;
case 'substation':
name = '站控';
break;
}
// debugger;
this.setTextContext(name);
this.text.show();
}
}
mouseout(e) {
if (!this.device.model.down) {
this.text.hide();
}
}
}

View File

@ -1,198 +0,0 @@
/*
* 控制模式
*/
import Group from 'zrender/src/container/Group';
import ESingleControl from '../Station/ESingleControl'; // 单个信号灯 (私有)
import EArrow from '../Station/EArrow';
import { arrow } from '../utils/ShapePoints';
import EMouse from './EMouse';
/** 控制模式*/
export default class StationControl extends Group {
constructor(model, style) {
super();
this.selected = false;
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.z = 1;
this.model = model;
this.style = style;
this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
}
create() {
const model = this.model;
// 紧急站控
if (this.style.Station.StationControl.lamp.emergencyControlShow) {
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.emergencyControlText,
// model.jjzkContent,
pop: false
});
this.add(this.emergencyControl);
}
// 中控按钮
if (this.style.Station.StationControl.lamp.centerControlShow) {
this.centerControl = new ESingleControl({
_subType: 'center',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.centerControlText,
// model.zokContent,
pop: false
});
this.add(this.centerControl);
}
// 站控按钮
if (this.style.Station.StationControl.lamp.substationControlShow) {
this.substationControl = new ESingleControl({
_subType: 'substation',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.substationControlText,
// model.zakContent
pop: false
});
this.add(this.substationControl);
}
// 联锁控
if (this.style.Station.StationControl.lamp.interconnectedControlShow) {
this.interconnectedControl = new ESingleControl({
_subType: 'interconnected',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
},
context: this.style.Station.StationControl.text.interconnectedControlText || '联锁控',
pop: false
});
this.add(this.interconnectedControl);
}
// 箭头
if (this.style.Station.StationControl.arrow.show) {
const point = arrow(this.model.position.x, this.model.position.y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8);
this.arrowsControl = new EArrow({
zlevel: this.zlevel,
z: this.z,
style: this.style,
count: this.count,
drict: 1,
point: point,
x: model.position.x + this.style.Station.StationControl.lamp.offset.x,
y: model.position.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
fill: this.style.Station.StationControl.lamp.grayColor,
lineWidth: 1,
stroke: this.style.sidelineColor
});
this.add(this.arrowsControl);
}
}
// 设置状态
setState(model) {
if (!this.isShowShape) return;
// switch (model.status) {
// case '00': // 无状态
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// break;
// case '01': // 中控
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
// break;
// case '02': // 站控
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// break;
// case '03': // 紧急站控
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
// break;
// }
}
getArcBoundingRect(view) {
const rect = view.getBoundingRect().clone();
const scale = view.scale[0];
const offsetX = view.position[0];
const offsetY = view.position[1];
rect.x = rect.x * scale + offsetX - 2;
rect.y = rect.y * scale + offsetY - 2;
rect.width = rect.width * scale + 4;
rect.height = rect.height * scale + 4;
return rect;
}
/** 按钮是否按下*/
isPop(e) {
for (var i = 0; i < this.childCount(); i++) {
var rect = this.childAt(i).getBoundingRect();
if (rect.contain(e.offsetX, e.offsetY) && this.childAt(i).pop) {
return true;
}
}
}
createMouseEvent() {
if (this.style.ZcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
getShapeTipPoint() {
if (this.stationControl) {
var distance = 2;
var rect = this.stationControl.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || this.model.stationCode === stationCode) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
}
}

View File

@ -79,6 +79,7 @@ class StationStand extends Group {
r: style.StationStand.standEmergent.mergentR,
n: 4
});
this.add(this.emergent);
// 列车停站
const stopX = model.position.x;
@ -95,6 +96,7 @@ class StationStand extends Group {
r: style.StationStand.standEmergent.mergentR,
n: 4
});
this.add(this.trainStop);
// 列车出发
const departX = model.position.x;
@ -109,6 +111,7 @@ class StationStand extends Group {
x: departX,
y: departY
});
this.add(this.trainDepart);
/** 站台折返策略*/
const reentryH = style.StationStand.standEmergent.mergentR;
@ -124,8 +127,7 @@ class StationStand extends Group {
lineWidth: 0,
fill: style.StationStand.reentry.noHumanColor
});
// const distance = style.StationStand.safetyDoor.height * 2 - style.StationStand.stand.headFontSize / 2 - 2;
this.add(this.reentry);
/** 站台扣车*/
const detainD = model.right ? 1 : -1;
@ -147,6 +149,7 @@ class StationStand extends Group {
textAlign: 'middle',
textVerticalAlign: 'top'
});
this.add(this.detain);
/** 停站时间*/
const timeDrict = model.right ? 1 : -1;
@ -160,6 +163,7 @@ class StationStand extends Group {
y: timeY,
name: model.parkingTime || '30'
});
this.add(this.time);
/** 运行等级*/
const levelDrict = model.right ? 1 : -1;
@ -173,6 +177,7 @@ class StationStand extends Group {
y: levelY,
name: model.runLevelTime || '5'
});
this.add(this.level);
/** 列车停跳 */
if (style.StationStand.common.haveJumpShow) {
@ -203,14 +208,6 @@ class StationStand extends Group {
});
this.add(this.jump);
}
this.add(this.emergent);
this.add(this.detain);
this.add(this.reentry);
this.add(this.time);
this.add(this.level);
this.add(this.trainStop);
this.add(this.trainDepart);
}
createMouseEvent() {
@ -357,9 +354,7 @@ class StationStand extends Group {
recover() {
this.time && this.time.hide();
this.level && this.level.hide();
// if (!this.style.StationStand.common.special) {
this.detain && this.detain.hide();
// }
this.emergent && this.emergent.hide();
this.trainStop && this.trainStop.hide(); // 列车停站
this.trainDepart && this.trainDepart.hide();
@ -509,12 +504,10 @@ class StationStand extends Group {
}
/** 设置跳停*/
// model.allSkip = 1;
model.assignSkip && this.designatedJumpStop(); // 指定列车跳停
model.allSkip && this.jumpStop(); // 站台全部跳停
/** 设置扣车*/
// model.centerHoldTrain = 1;
if (model.stationHoldTrain && model.centerHoldTrain) {
this.standAndCenterDetainTrain(); // 中心+车站扣车
} else if (model.stationHoldTrain) {

View File

@ -269,8 +269,6 @@ export default class Switch extends Group {
this.setSwitchCoreColor(this.style.backgroundColor);
this.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false);
// this.relocShelter.hide();
// this.rhomboid.hide();
this.sheltertriangle.hide();
this.rhomboid.stopAnimation(false);
this.releaseBackground.hide();
@ -333,10 +331,6 @@ export default class Switch extends Group {
});
}
/** 空闲*/
spare() {
}
/** 单锁*/
setMonolock() {
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
@ -425,7 +419,6 @@ export default class Switch extends Group {
this.sectionCutOff(section);
}
}
}
setState(model) {
@ -443,7 +436,7 @@ export default class Switch extends Group {
model.blockade && this.block();
/** 区段切除*/
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) {
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];
if (switchModel.normalPosition != 0) { // 定位情况
const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode];

View File

@ -36,13 +36,13 @@
</template>
<script>
// import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',
@ -127,64 +127,35 @@ export default {
},
//
cancelTrainRoute() {
this.cancelTrainRouteFunc();
},
cancelTrainRouteFunc() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 2).then((data)=>{
this.doClose();
}
}).catch(error => {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
signalClose() {
const operate = {
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [`信号关灯: ${this.signalName}`]
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.signalClose, {}, 1).then((data)=>{
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.$refs.confirmControl.doShow(data.operate);
}).catch(() => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, error.message);
this.doClose();
});
},
//
reopenSignal() {
const operate = {
over: true,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.reopenSignal, {}, 2).then((data)=>{
this.doClose();
}
}).catch(error => {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//

View File

@ -1,26 +1,42 @@
<template>
<div>
<el-dialog class="beijing-01__systerm route-detail" :title="title" :visible.sync="show" width="340px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-dialog
v-dialogDrag
class="beijing-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled></el-input>
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled></el-input>
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
:height="140">
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{scope.row.name}}</span>
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
@ -38,16 +54,16 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
@ -61,8 +77,8 @@ export default {
selected: null,
tempData: [],
stationName: '',
signalName: '',
}
signalName: ''
};
},
computed: {
...mapGetters('map', [
@ -78,24 +94,24 @@ export default {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态'
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
@ -115,11 +131,10 @@ export default {
mouseCancelState(this.selected);
},
commit() {
let operate = {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.detail.menu.operation
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -134,10 +149,9 @@ export default {
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -148,5 +162,5 @@ export default {
});
}
}
}
};
</script>

View File

@ -80,7 +80,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteHandControl',
@ -278,47 +278,24 @@ export default {
},
//
humanControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param:{
routeCodeList:this.selection
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
atsAutoControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param:{
routeCodeList:this.selection
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {

View File

@ -61,11 +61,11 @@
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { deepAssign } from '@/utils/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'RouteSelection',
@ -210,7 +210,6 @@ export default {
//
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: row.code
};
@ -225,34 +224,20 @@ export default {
},
commit() {
if (this.row && this.row.canSetting) {
const operate = {
over: true,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: this.row.code
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
}
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();

View File

@ -45,10 +45,11 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'SectionControl',
@ -75,7 +76,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
@ -159,48 +160,24 @@ export default {
},
//
faultUnlock() {
const operate = {
over: true,
operation: OperationEvent.Section.fault.menu.operation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.fault);
},
//
axlePreReset() {
const operate = {
over: true,
operation: OperationEvent.Section.axlePreReset.menu.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.axlePreReset);
},
//
split() {
const operate = {
over: true,
operation: OperationEvent.Section.split.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.split);
},
//
active() {
const operate = {
over: true,
operation: OperationEvent.Section.active.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Section.active);
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
@ -209,18 +186,14 @@ export default {
this.doClose();
});
},
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(operate, {}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}

View File

@ -1,19 +1,37 @@
<template>
<el-dialog class="beijing-01__systerm stand-run-level" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-run-level"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="font-size: 16px; margin-bottom: 5px;">变通节点</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationName" size="mini" disabled></el-input>
<el-input v-model="stationName" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationStrategy" size="mini" disabled></el-input>
<el-input v-model="stationStrategy" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div>
<el-table ref="table" :data="strategyList" border :cell-style="tableStyle" style="width: 100%; margin-top:10px"
size="mini" @row-click="clickEvent" height="120" highlight-current-row :show-header="false">
<el-table-column prop="label" :id="domIdChoose" style="margin-left:30px">
</el-table-column>
<el-table
ref="table"
:data="strategyList"
border
:cell-style="tableStyle"
style="width: 100%; margin-top:10px"
size="mini"
height="120"
highlight-current-row
:show-header="false"
@row-click="clickEvent"
>
<el-table-column :id="domIdChoose" prop="label" style="margin-left:30px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
@ -24,18 +42,17 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
@ -65,7 +82,7 @@ export default {
{
value: '04',
label: '关闭'
},
}
],
stationName: '',
stationStrategy: '',
@ -73,13 +90,13 @@ export default {
isConfirm: false,
strategy: '',
tableStyle: {
'border-bottom': 'none',
}
'border-bottom': 'none'
}
};
},
computed: {
...mapGetters('map', [
'stationList',
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -100,17 +117,17 @@ export default {
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
loadInitData(selected, opts) {
this.tempData = [];
let stationList = [...this.stationList];
const station = this.stationList.find(n => n.code == selected.stationCode)
const stationList = [...this.stationList];
const station = this.stationList.find(n => n.code == selected.stationCode);
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
this.$nextTick(() => {
this.$refs.table.setCurrentRow(null);
})
});
},
doShow(operate, selected, opts) {
this.selected = selected;
@ -125,7 +142,7 @@ export default {
if (item.value == opts.reentryStrategy) {
this.stationStrategy = item.label;
}
})
});
}
}
this.loadInitData(selected, opts);
@ -138,7 +155,7 @@ export default {
},
clickEvent(row, column, event) {
const operate = {
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
operation: OperationEvent.StationStand.setBackStrategy.choose.operation
};
this.strategy = row.value;
this.isConfirm = true;
@ -146,7 +163,7 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
});
},
checkTableDataSelction(data) {
const selection = [];
@ -155,10 +172,10 @@ export default {
if (row.check && !row.disabled) {
selection.push(row);
}
})
});
}
this.disabledSend = selection.length ? false : true;
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
@ -171,25 +188,13 @@ export default {
},
commit() {
if (this.isConfirm) {
const operate = {
over:true,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
param:{
standReentryStrategy: this.strategy
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.StationStand.setBackStrategy, {standReentryStrategy: this.strategy}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
} else {
this.doClose();
@ -197,7 +202,7 @@ export default {
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -209,5 +214,5 @@ export default {
});
}
}
}
};
</script>

View File

@ -110,10 +110,11 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'StandDetainTrain',
@ -142,7 +143,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
upRadioId() {
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : '';
@ -252,65 +253,25 @@ export default {
},
//
setDetainTrain() {
const operate = {
over: true,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
this.sendCommand(menuOperate.StationStand.setDetainTrain);
},
//
cancelDetainTrain() {
const operate = {
over: true,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
this.sendCommand(menuOperate.StationStand.cancelDetainTrain);
},
//
earlyDeparture() {
const operate = {
over: true,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
};
this.sendCommand(menuOperate.StationStand.earlyDeparture);
},
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(operate, {}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {

View File

@ -103,9 +103,10 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
@ -163,7 +164,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '跳停';
@ -243,65 +244,29 @@ export default {
},
//
setJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2 + '::' + this.model.tripNumber;
// }
const operate = {
over: true,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param:{
trainGroupNumber:this.model.tripNumber
}
// val: this.selected.direction //, 01: /02:
// val: val
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
cancelJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2 + '::' + this.model.tripNumber;
// }
const operate = {
over: true,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param:{
trainGroupNumber:this.model.tripNumber
}
// val: val // , 01: /02:
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.model.tripNumber}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};

View File

@ -89,7 +89,7 @@
import { mapGetters } from 'vuex';
import { mouseCancelState } from '../utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
@ -311,27 +311,13 @@ export default {
},
commit() {
if (this.isConfirm) {
const operate = {
over: true,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
param: {
runLevelTime: this.time,
runLevelTimeForever: !!this.tempData[0].check
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.StationStand.setRunLevel, {runLevelTime: this.time, runLevelTimeForever: !!this.tempData[0].check}, 2).then((data)=>{
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
} else {
this.doClose();

View File

@ -69,7 +69,7 @@
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
name: 'StandStopTime',
@ -210,28 +210,13 @@ export default {
// });
// },
commit() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
param: {
parkingTime: this.control == '01' ? -1 : 1,
parkingAlwaysValid: this.effective == '1'
}
// messages: [`: ${this.stationName} - ${this.standName}, ${this.control == '01' ? '' : this.time + ''}, ${this.effective == false ? '' : ''}`]
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : 1, parkingAlwaysValid: this.effective == '1'}, 2).then((data)=>{
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {

View File

@ -55,9 +55,11 @@
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
// import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { mouseCancelState } from '../utils/menuItemStatus';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
@ -87,7 +89,7 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Switch.split.menu.operation) {
@ -158,34 +160,18 @@ export default {
},
//
unlock() {
const operate = {
over: true,
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Switch.unlock);
},
//
split() {
const operate = {
over: true,
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Switch.split);
},
//
active() {
const operate = {
over: true,
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.sendCommand(operate);
this.sendCommand(menuOperate.Switch.active);
},
cancel() {
const operate = {
type: MapDeviceType.Switch.type,
operation: OperationEvent.Command.cancel.menu.operation
};
@ -200,15 +186,12 @@ export default {
sendCommand(operate) { //
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
commitOperate(operate, {}, 2).then((data)=>{
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
this.$refs.noticeInfo.doShow({}, error.message);
});
}
}

View File

@ -381,7 +381,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (model.setting) {
if (model.totalGuideLock) {
operate.cmdType = CMD.Station.CMD_STATION_CANCEL_MASTER_GUIDE_LOCK;
} else {
operate.cmdType = CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK;
@ -396,7 +396,8 @@ export default {
break;
}
case OperationEvent.MixinCommand.functionButton.button.operation : {
if (model && model._type == 'AutoTurnBack' && !model.setting) {
if (model && model._type == 'AutoTurnBack' && !model.setUp) {
const operate = {
start: true,
over: true,
@ -417,7 +418,8 @@ export default {
break;
}
case OperationEvent.MixinCommand.totalCancel.button.operation: {
if (model && model._type == 'AutoTurnBack' && model.setting) {
debugger;
if (model && model._type == 'AutoTurnBack' && model.setUp) {
const operate = {
start: true,
over: true,

View File

@ -1,10 +1,20 @@
<template>
<el-dialog class="beijing-01__systerm two-confirmation" title="二次确认" :visible.sync="show" width="360px"
:before-close="doClose" :showClose="false" :zIndex="2000" :modal="false" :close-on-click-modal="false"
append-to-body v-dialogDrag>
<el-dialog
v-dialogDrag
class="beijing-01__systerm two-confirmation"
title="二次确认"
:visible.sync="show"
width="360px"
:before-close="doClose"
:show-close="false"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="message in messages">
<span> {{message}}</span><br>
<span> {{ message }}</span><br>
</template>
</div>
<el-row class="button-group">
@ -15,16 +25,20 @@
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
export default {
name: 'TwoConfirmation',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
@ -32,22 +46,21 @@
operation: '',
operate: '',
timer: null
}
},
components: {
NoticeInfo
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} else if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
} else {
return '';
}
},
domIdCancel() {
@ -57,17 +70,19 @@
if (this.operate) {
return this.operate.messages;
}
return []
return [];
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
doShow(operate) {
doShow(operate, message) {
this.operate = operate || {};
this.operate.messages = [];
this.operate.messages.push(message);
this.operation = this.operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
@ -79,42 +94,39 @@
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
let operate = {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
operation: OperationEvent.Command.close.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
})
});
},
commit() {
let operate = {
send: true,
type: this.operate.type,
val: this.operate.val,
const operate = {
over: true,
operation:this.operation
};
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
} else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
}
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation;
}
this.doClose();
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}, 1000).catch((error) => {
this.$refs.noticeInfo.doShow(operate);
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
}
};
</script>

View File

@ -1,37 +1,56 @@
<template>
<el-dialog class="beijing-01__systerm station-control" title="控制模式转换" :visible.sync="show" width="400px"
:before-close="doClose" :showClose="true" :zIndex="2000" :modal="false" :close-on-click-modal="false"
v-dialogDrag>
<el-dialog
v-dialogDrag
class="beijing-01__systerm station-control"
title="控制模式转换"
:visible.sync="show"
width="400px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> 集中站 </el-row>
<el-row style="margin-bottom: 20px">
<el-select v-model="stationCode" filterable placeholder="请选择" style="width: 100%;" :id="domIdChooseStation"
@change="handleChooseChangeStation">
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
<el-select
:id="domIdChooseStation"
v-model="station"
value-key="code"
filterable
placeholder="请选择"
style="width: 100%;"
@change="handleChooseChangeStation"
>
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item" />
</el-select>
</el-row>
<el-radio-group v-model="stationType" :id="domIdChooseControl">
<el-row style="padding-bottom: 10px" v-for="item in Object.keys(controlProps)" :key="item">
<el-radio-group :id="domIdChooseControl" v-model="stationType">
<el-row v-for="item in Object.keys(controlProps)" :key="item" style="padding-bottom: 10px">
<el-radio :label="item" @change="handleChooseChangeControl">
{{controlProps[item]}}</el-radio>
{{ controlProps[item] }}</el-radio>
</el-row>
</el-radio-group>
<el-row type="flex" justify="center" class="button-group">
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel" style="margin-left: 200px">退出
<el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出
</el-button>
</el-row>
<two-confirmation ref="twoConfirmation"></two-confirmation>
<two-confirmation ref="twoConfirmation" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import TwoConfirmation from './childDialog/twoConfirmation';
import { mapGetters } from 'vuex';
import TwoConfirmation from './childDialog/twoConfirmation';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
export default {
export default {
name: 'StationControl',
components: {
TwoConfirmation
},
data() {
return {
operate: null,
@ -39,16 +58,15 @@
disabledClose: false,
disabledCommit: false,
stationType: '01',
station:{},
stationCode: '',
stationName: '',
controlProps: {
'03': '紧急站控',
'02': '站控',
'01': '遥控',
},
'01': '遥控'
}
},
components: {
TwoConfirmation
};
},
computed: {
...mapGetters('map', [
@ -85,7 +103,7 @@
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
doShow(operate) {
@ -101,24 +119,23 @@
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
let operate = {
const operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation,
}
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
});
},
handleChooseChangeStation() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.Command.order.choose1.operation,
val: this.stationCode,
}
handleChooseChangeStation(data) {
this.stationCode = data.code;
this.stationName = data.name;
const operate = {
operation: OperationEvent.Command.order.choose1.operation
};
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation
// } else if (this.stationType == '02') {
@ -127,18 +144,16 @@
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation
// }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
});
},
handleChooseChangeControl() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.Command.order.choose.operation,
val: this.stationCode,
}
const operate = {
operation: OperationEvent.Command.order.choose.operation
};
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation
@ -148,11 +163,11 @@
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose.operation
// }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
});
},
//
handleCommit() {
@ -169,63 +184,27 @@
},
//
conterCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
})
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由站控转为中控:\n' + this.stationName);
});
},
//
requestCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch((error) => {
})
commitOperate(menuOperate.StationControl.requestStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName);
});
},
//
emergencyCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
val: `${this.stationCode}::`,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
})
}
commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCodes:[this.stationCode]}, 0).then((data)=>{
this.doClose();
this.$refs.twoConfirmation.doShow(data.operate, '确认将如下操作区域的控制模式由中控转为站控:\n' + this.stationName);
});
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -173,7 +173,7 @@ export default {
// },
//
faultUnlock(selectType) {
commitOperate(menuOperate.Section.fault, selectType, [selectType.code]).then((data)=>{
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 0).then((data)=>{
this.$refs.sectionControl.doShow(data.operate, data.selected);
});
},

View File

@ -27,6 +27,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mouseCancelState } from './utils/menuItemStatus';
import {menuOperate, commitOperate} from './utils/menuOperate';
export default {
name: 'StationStandMenu',
@ -242,75 +243,28 @@ export default {
},
//
setDetainTrainByLow(selectType) {
const operate = {
start: true,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
param:{
standCode:selectType.code
},
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:selectType.code}, 3).then((data)=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
/** 取消扣车 */
cancleDetainTrainByLow(selectType) {
const operate = {
start: true,
over: true,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
param:{
standCode:selectType.code
},
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:selectType.code}, 3).then((data)=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
setDetainTrain() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.StationStand.setDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
//
cancelDetainTrain() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.StationStand.cancelDetainTrain, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
//
@ -331,131 +285,44 @@ export default {
// },
//
setJumpStop() {
const operate = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStopControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.StationStand.setJumpStop, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standJumpStopControl.doShow(data.operate, this.selected);
});
},
//
cancelJumpStop() {
const operate = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStopControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.StationStand.cancelJumpStop, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standJumpStopControl.doShow(data.operate, this.selected);
});
},
//
setStopTime() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
const tempData = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standStopTime.doShow(operate, this.selected, tempData);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
commitOperate(menuOperate.StationStand.setStopTime, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standStopTime.doShow(data.operate, this.selected, []);
});
},
//
setRunLevel() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
const tempData = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standRunLevel.doShow(operate, this.selected, tempData);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
commitOperate(menuOperate.StationStand.setRunLevel, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standRunLevel.doShow(data.operate, this.selected, []);
});
},
//
earlyDeparture() {
const operate = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.StationStand.earlyDeparture, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standControl.doShow(data.operate, this.selected);
});
},
//
setBackStrategy() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
param:{
standCode:this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
const tempData = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standBackStrategy.doShow(operate, this.selected, tempData);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
commitOperate(menuOperate.StationStand.setBackStrategy, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standBackStrategy.doShow(data.operate, this.selected);
});
},
//
detail() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.StationStand.detail.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
const tempData = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standDetail.doShow(operate, this.selected, tempData);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
commitOperate(menuOperate.StationStand.detail, {standCode:this.selected.code}, 0).then((data)=>{
this.$refs.standDetail.doShow(data.operate, this.selected, []);
});
}
}

View File

@ -2,7 +2,7 @@ import store from '@/store';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// 控制禁用
// 操作
export const menuOperate = {
Section:{
active:{
@ -134,7 +134,68 @@ export const menuOperate = {
}
},
Stand:{
StationStand:{
setDetainTrain:{
// 设置扣车
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
},
cancelDetainTrain:{
// 取消扣车
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
},
setJumpStop:{
// 设置跳停
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
},
cancelJumpStop:{
// 取消跳停
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
},
setStopTime:{
// 停站时间控制
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
},
setRunLevel:{
// 运行时间控制
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
},
earlyDeparture:{
// 设置提前发车
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
},
setBackStrategy:{
// 设置折返策略
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
},
detail:{
// 查询站台状态
operation: OperationEvent.StationStand.detail.menu.operation
}
},
StationControl:{
requestCentralControl:{
// 请求中控(遥控)
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
},
requestStationControl:{
// 请求站控
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL
},
emergencyStationControl:{
// 紧急站控
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
}
}
};

View File

@ -25,7 +25,6 @@
<script>
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation';
import DataTable from '../menusPlan/components/dataTable';
import echarts from 'echarts';

View File

@ -1,9 +1,19 @@
<template>
<el-dialog class="chengdou-03__systerm notice-info" :title="title" :visible.sync="show" width="360px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm notice-info"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<template v-for="(message, index) in messages">
<div :key="index">{{message}}</div>
<div :key="index">{{ message }}</div>
</template>
</div>
<el-row justify="center" class="button-group">
@ -11,21 +21,20 @@
<el-button :id="domIdSure" type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</span>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
export default {
name: 'NoticeInfo',
data() {
return {
dialogShow: false,
messages: ['命令下达失败'],
operate: null
}
};
},
computed: {
show() {
@ -41,7 +50,7 @@
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
});
},
methods: {
doShow(operate, messages) {
@ -66,7 +75,7 @@
this.doClose();
}
}
}
};
</script>
<style>

View File

@ -169,6 +169,7 @@ export default {
type: this.operate.type,
operation: OperationEvent.Command.close.password.operation
};
this.$emit('checkCancel');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {

View File

@ -103,7 +103,7 @@
<center><b></b></center>
</span>
</button>
<password-box ref="password" @checkOver="passWordCommit" />
<password-box ref="password" @checkOver="passWordCommit" @checkCancel="checkCancel" />
<notice-info ref="noticeInfo" />
</div>
</template>
@ -148,7 +148,8 @@ export default {
'routeData',
'signalList',
'autoReentryList',
'autoReentryData'
'autoReentryData',
''
]),
Switch() {
return OperationEvent.Switch;
@ -226,14 +227,18 @@ export default {
};
this.trainingOperation(operate);
},
checkCancel() {
Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
//
trainingOperation(operate) {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
resetPosition() {
@ -273,7 +278,7 @@ export default {
type: 'mbm',
operation: operation
};
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation];
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation, this.Station.guideLock.button.operation];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.operation = operation;
@ -326,8 +331,8 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
operate.param = {signalCode: deviceList[0].code};
this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error);
});
}
} else if (deviceList.length === 2) {
@ -338,14 +343,14 @@ export default {
operate.param = {routeCode: item.code};
this.deviceList = [];
flag = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
});
if (!flag) {
this.deviceList = [];
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(operate, '未找到选择进路!');
}
}
},
@ -370,9 +375,9 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_CI_AUTO;
operate.param = {signalCode: route.startSignalCode};
}
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {
this.deviceList = [];
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
handelTotalCancel(model, subType) {
@ -384,10 +389,16 @@ export default {
};
if (model._type === 'Signal') {
const autoReentry = getAutoReentryBySignalCode(model.code, this.routeList, this.autoReentryList);
const autoReentryRel = this.autoReentryData[autoReentry.code];
if (autoReentryRel.open) {
let autoReentrySet = '';
autoReentry.forEach(item => {
const autoReentryRel = this.autoReentryData[item.code];
if (autoReentryRel.setUp) {
autoReentrySet = autoReentryRel;
}
});
if (autoReentrySet) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK;
operate.param = {cycleCode: model.cycleCode, cancelRoute: true};
operate.param = {cycleCode: autoReentrySet.code, cancelRoute: true};
} else {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE;
operate.param = {signalCode: model.code};
@ -400,9 +411,9 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO;
operate.param = {signalCode: route.startSignalCode};
}
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {
this.deviceList = [];
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
handleGuideRoute(deviceList) {
@ -424,8 +435,8 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.password.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
} else {
const operate = {
@ -441,8 +452,8 @@ export default {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
} else if (deviceList.length === 2) {
@ -458,14 +469,14 @@ export default {
operate.param = {routeCode: item.code};
this.deviceList = [];
flag = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
});
if (!flag) {
this.deviceList = [];
this.$refs.noticeInfo.doShow(operate);
this.$refs.noticeInfo.doShow(operate, '未找到选择进路!');
}
}
},
@ -483,8 +494,8 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
operate.param = {signalCode: model.code};
this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
},
@ -503,8 +514,8 @@ export default {
});
operate.param = {signalCode: model.code, routeCodeList: routeCodeList};
this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
handelSwitchOperate(model) {
@ -514,8 +525,8 @@ export default {
cmdType: this.cmdType,
param: { switchCode: model.code}
};
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
handelBlockOrUnblock(model) {
@ -539,8 +550,24 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
operate.param = {signalCode: model.code};
}
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
handelGuideLock(model) {
const operate = {
send: true,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: '',
param: {stationCode: model.stationCode}
};
if (model.totalGuideLock) {
operate.cmdType = CMD.Station.CMD_STATION_CANCEL_MASTER_GUIDE_LOCK;
} else {
operate.cmdType = CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK;
}
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
selectedChange() {
@ -567,6 +594,8 @@ export default {
this.handelSwitchOperate(model);
} else if (buttonOperation === this.MixinCommand.block.button.operation || buttonOperation === this.MixinCommand.unblock.button.operation) {
this.handelBlockOrUnblock(model);
} else if (buttonOperation === this.Station.guideLock.button.operation) {
this.handelGuideLock(model);
} else {
Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null);

View File

@ -20,7 +20,7 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { generateDayRunPlan } from '@/api/simulation';
import { getPublishMapInfo } from '@/api/jmap/map';
export default {
@ -73,7 +73,6 @@ export default {
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
// params['lineCode'] = this.$store.getters['map/lineCode'];
params['mapId'] = this.$route.query.mapId;
}
return runPlanTemplateList(params);
@ -111,12 +110,6 @@ export default {
getPublishMapInfo(this.$route.query.mapId).then(res=>{
this.PlanConvert = this.$theme.loadPlanConvert(res.data.lineCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
// getEveryDayRunPlanData(this.$route.query.group).then(resp => {
// this.$store.dispatch('runPlan/setPlanData', resp.data);
// }).catch(() => {
// this.$store.dispatch('runPlan/setPlanData', []);
// this.$messageBox(``);
// });
});
});
}).catch(() => {

View File

@ -8,7 +8,8 @@ class Theme {
'04': 'chengdu_03',
'05': 'fuzhou_01', // 国际版运行图皮肤 指向05 福州线路
'06': 'ningbo_01',
'07': 'haerbin_01' // 哈尔滨培训线路
'07': 'haerbin_01', // 哈尔滨培训线路
'08': 'foshan_01'
};
this._localShowMode = { // 现地显示模式
'01': 'all', // 成都一 全显
@ -17,7 +18,8 @@ class Theme {
'04': 'all', // 成都三 全显
'05': 'all', // 国际版运行图皮肤 指向05 福州线路 全显
'06': 'all', // 宁波一 全显
'07': 'ecStation' // 哈尔滨培训线路 集中站显示
'07': 'ecStation', // 哈尔滨培训线路 集中站显示
'08': 'all' // 佛山有轨线路 全显
};
}

View File

@ -0,0 +1,370 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-detain-train"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="head_content content">
<span class="base-label" style="left: 0px;">会话管理</span>
<el-col :span="8">
<el-button class="status">查询会话状态</el-button>
</el-col>
<el-col :span="15" :offset="1">
<el-input :value="messageText" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="12">
<el-button
:id="openMessageId"
class="status_btn"
:disabled="isOpenMessage"
@click="handleMessage('open')"
>打开会话</el-button>
</el-col>
<el-col :span="12">
<el-button
:id="closeMessageId"
class="status_btn"
:disabled="!isOpenMessage"
@click="handleMessage('close')"
>关闭会话
</el-button>
</el-col>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 0px;">操作</span>
<el-col :span="3">
<div class="text">操作</div>
</el-col>
<el-col :span="11" :offset="1">
<el-input :value="messageText1" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
</el-button>
</el-col>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 0px;">确认</span>
<el-col :span="3">
<div class="text">操作</div>
</el-col>
<el-col :span="11" :offset="1">
<el-input :value="messageText2" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
</el-button>
</el-col>
</div>
<div class="body_cont">
<el-col :span="7">
<div class="text">操作倒计时</div>
</el-col>
<el-col :span="17">
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
</el-col>
</div>
<div class="body_cont">
<div class="status_text">状态</div>
<div class="textarea_content" />
</div>
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
<confirm-tip ref="ConfirmTip" @close="closeMessage" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import ConfirmTip from './childDialog/confirmTip';
export default {
name: 'StandDetainTrain',
components: {
ConfirmTip
},
data() {
return {
dialogShow: false,
standName: '',
stationName: '',
selected: null,
operation: null,
radio: '1',
radio1: '1',
earlyDepar: false,
messageText: '',
messageText1: '',
messageText2: '',
isOpenMessage: false,
timeCountConfirm: -1,
disabledConfirm1: false,
disabledConfirm2: false
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
openMessageId() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
},
closeMessageId() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
},
confirmId1() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
},
confirmId2() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
},
title() {
return '取消全线临时限速';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) { //
this.timeCountConfirm = -1;
this.disabledConfirm2 = true;
}
}, 1000);
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
handleMessage(message) {
if (message == 'open') {
const operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText1 = '取消全线临时限速';
}
}).catch(() => {
this.doClose();
});
} else {
const operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = false;
this.messageText1 = '';
this.messageText2 = '';
this.disabledConfirm1 = false;
this.disabledConfirm2 = false;
this.timeCountConfirm = -1; //
}
}).catch(() => {
this.doClose();
});
}
},
confirm1() {
const operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText1 = '**************';
this.messageText2 = '取消全线临时限速';
this.disabledConfirm1 = true;
this.timeCountConfirm = 60; //
}
}).catch(() => {
this.doClose();
});
},
confirm2() {
const operate = {
send: true,
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText2 = '**************';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
}
}).catch(() => {
this.doClose();
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (!this.isOpenMessage) {
this.doClose();
} else {
const operate = {
message: `是否关闭会话,并关闭窗口`,
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId
};
this.$refs.ConfirmTip.doShow(operate);
}
}).catch(error => {
console.log(error);
});
},
closeMessage() {
const operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.ConfirmTip.doClose();
this.isOpenMessage = false;
this.messageText1 = '';
this.messageText2 = '';
this.disabledConfirm1 = false;
this.disabledConfirm2 = false;
this.timeCountConfirm = -1; //
this.doClose();
}).catch(error => {
console.log(error);
});
}
}
};
</script>
<style scoped lang="scss">
.stand-detain-train .context {
height: 80px !important;
}
.content {
width: 100%;
border: 1px solid lightgray;
padding: 18px 5px;
position: relative;
.base-label {
position: absolute;
top: -5px;
left: 20px;
background-color: #F0F0F0;
padding: 0 5px;
}
.el-button {
width: 100%;
line-height: 28px;
}
.status_btn {
width: 110px;
margin: 15px auto 0;
display: block;
}
}
.head_content {
height: 110px;
margin-bottom: 10px;
}
.cotnent_body {
height: 60px;
margin-bottom: 10px;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_btn {
width: 80px;
margin: 0 auto
}
}
.close_btn {
margin: 0 auto;
width: 80px;
display: block;
}
.body_cont {
margin-bottom: 10px;
padding: 0 3px;
overflow: hidden;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_text {
margin-bottom: 3px;
font-size: 14px;
padding-left: 8px;
}
.textarea_content {
height: 85px;
width: 100%;
border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset;
}
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<el-dialog class="ningbo-01__systerm notice-info" :title="title" :visible.sync="show" width="360px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div class="context">
<template v-for="(message, index) in messages">
<div :key="index">{{message}}</div>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="8">
<el-button :id="domIdSure" type="primary" @click="commit">确定</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'NoticeInfo',
data() {
return {
dialogShow: false,
messages: ['命令下达失败'],
operate: null
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '提示';
},
domIdSure() {
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, messages) {
this.operate = operate || {};
this.dialogShow = true;
this.messages = ['命令下达失败'];
if (messages && messages != 'null' && messages != 'undefined') {
this.messages.push(messages);
}
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.doClose();
},
cancel() {
this.doClose();
}
}
}
</script>
<style>
.notice-info .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,280 @@
<template>
<el-dialog class="ningbo-01__systerm confirm-control" :title="title" :visible.sync="show" width="360px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{message}}</span>
</template>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ConfirmControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operate: {},
messages: '',
operation: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
return '进路设置';
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
return '信号关灯';
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
return '信号重开';
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
return '取消进路';
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交ATS自动控';
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
return '设置运行等级';
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
return '停站时间';
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
return '设置折返策略';
}
return '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
/** 进路设置*/
return OperationEvent.Signal.arrangementRoute.confirm.domId;
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
/** 信号关灯*/
return OperationEvent.Signal.signalClose.confirm.domId;
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
/** 信号重开*/
return OperationEvent.Signal.reopenSignal.confirm.domId;
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
/** 取消进路*/
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
return OperationEvent.Signal.humanControl.confirm.domId;
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交ATS自动控*/
return OperationEvent.Signal.atsAutoControl.confirm.domId;
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
/** 设置运行等级*/
return OperationEvent.StationStand.setRunLevel.confirm.domId;
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
/** 设置停战时间*/
return OperationEvent.StationStand.setStopTime.confirm.domId;
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
/** 设置折返策略*/
return OperationEvent.StationStand.setBackStrategy.confirm.domId;
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.loading = false;
this.operate = operate || {};
this.messages = operate.messages;
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
/** 进路设置*/
this.routeSetting();
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
/** 信号关灯*/
this.signalClose();
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
/** 信号重开*/
this.reopenSignal();
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
/** 取消进路*/
this.cancelTrainRoute();
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交ATS自动控*/
this.atsAutoControl();
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
/** 设置运行等级*/
this.setRunLevel();
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
/** 停站时间*/
this.setStopTime();
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
/** 设置折返策略*/
this.setBackStrategy();
}
},
//
routeSetting() {
const operate = {
send: true,
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
};
this.sendCommand(operate);
},
//
signalClose() {
const operate = {
send: true,
operation: OperationEvent.Signal.signalClose.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.sendCommand(operate);
},
//
reopenSignal() {
const operate = {
send: true,
operation: OperationEvent.Signal.reopenSignal.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.sendCommand(operate);
},
//
cancelTrainRoute() {
const operate = {
send: true,
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.sendCommand(operate);
},
//
humanControl() {
const operate = {
send: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
};
this.sendCommand(operate);
},
// ATS
atsAutoControl() {
const operate = {
send: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
};
this.sendCommand(operate);
},
//
setRunLevel() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
};
this.sendCommand(operate);
},
//
setStopTime() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
};
this.sendCommand(operate);
},
//
setBackStrategy() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
};
this.sendCommand(operate);
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>
<style>
.confirm-control .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<el-dialog class="ningbo-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="540px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="height: 60px; padding-left: 20px">
<span style="font-size: 18px">{{message}}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="10" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'ConfirmControlSpeed',
data() {
return {
dialogShow: false,
loading: false,
type: '',
operation: '',
message: '',
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
if (this.dialogShow) {
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
return "区段设置限速";
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
return "区段取消限速";
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
return "道岔设置限速";
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
return "道岔取消限速";
}
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.confirm.domId;
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.confirm.domId;
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.type = operate.type;
this.operation = operate.operation;
this.message = operate.message;
}
this.loading = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
type: this.type
}
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation;
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation;
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 1, success: true });
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
})
},
cancel() {
let operate = {
type: this.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 0, success: false });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style>
.confirm-control-speed .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,118 @@
<template>
<el-dialog class="ningbo-01__systerm route-unlock-confirm" :title="title" :visible.sync="show" width="500px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="height: 60px; padding-left: 20px">
<span>{{stationName}}{{signalName}}信号机信号解锁确认下达吗</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="10" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'RouteUnlockConfirm',
data() {
return {
dialogShow: false,
loading: false,
signalName: '',
stationName: ''
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '信号解封'
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected) {
this.stationName = ''
this.signalName = '';
if (selected) {
this.signalName = selected.name;
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.loading = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.unlock.confirm.operation
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 1, success: true });
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
})
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$emit('setOperate', { step: 0, success: false });
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style>
.route-unlock-confirm .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,68 @@
<template>
<el-dialog class="ningbo-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="340px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
<div style="height: 60px; padding-left: 20px">
<span style="font-size: 18px">{{message}}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="11">
<el-button type="primary" :id="confirmId" @click="confirm">确定</el-button>
</el-col>
<el-col :span="11" :offset="2">
<el-button @click="doClose"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'ConfirmTip',
data() {
return {
dialogShow: false,
message: '',
confirmId: '',
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
if (this.dialogShow) {
return "提示";
}
}
},
mounted() {
},
methods: {
doShow(operate) {
this.message = operate.message;
this.dialogShow = true;
this.confirmId = operate.confirmId;
},
confirm() {
this.$emit('close');
},
doClose() {
this.dialogShow = false;
}
}
}
</script>
<style scoped>
.confirm-control-speed .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
.ningbo-01__systerm .el-dialog .el-button{
display: block;
margin: 0 auto;
}
</style>

View File

@ -0,0 +1,241 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm signal-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div v-if="passModel" style="margin: 12px 0;">
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'" @change="changeRadio">设置自动通过</el-radio>
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'" @change="changeRadio">取消自动通过</el-radio>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: null,
stationName: '',
signalName: '',
passRadio: '1',
passModel: false //
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
return '取消列车进路';
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
return '信号关灯';
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
return '重开信号';
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
return '信号机控制';
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
return '信号机控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.passModel = false;
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation;
if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
this.passRadio = '1';
this.passModel = true;
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
this.passRadio = '2';
this.passModel = true;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
changeRadio() {
},
commit() {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
/** 取消列车进路*/
this.cancelTrainRoute();
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
/** 信号关灯*/
this.signalClose();
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
/** 信号重开*/
this.reopenSignal();
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
this.singalPassModel(); //
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
this.singalCancelPassModel(); //
}
},
//
cancelTrainRoute() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.sendCommand(operate);
},
//
signalClose() {
const operate = {
operation: OperationEvent.Signal.signalClose.menu.operation,
messages: [`信号关灯: ${this.signalName}`],
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
reopenSignal() {
const operate = {
over: true,
operation: OperationEvent.Signal.reopenSignal.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
};
this.sendCommand(operate);
},
//
singalPassModel() {
const operate = {
over: true,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
};
this.sendCommand(operate);
},
//
singalCancelPassModel() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>

View File

@ -0,0 +1,168 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope">
<!-- <span v-if="scope.row.controlType == '01'">自动不进行冲突检测</span>
<span v-else>人工</span> -->
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
over: true,
operation: OperationEvent.Signal.detail.menu.operation,
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,341 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm route-hand-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column prop="name" label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="changeList[scope.$index]"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
@change="changeCheck(changeList[scope.$index],scope.row.code)"
/>
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button
:id="domIdConfirm"
type="primary"
:disabled="commitDisabled"
:loading="loading"
@click="commit"
>确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Vue from 'vue';
export default {
name: 'RouteHandControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false,
changeList:[],
commitDisabled: true,
disabledLength: 0
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
}
}
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
}
}
},
watch: {
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
this.allSelect = false;
this.changeList = [];
this.commitDisabled = true;
this.selection = [];
this.disabledLength = 0;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
this.changeList.push(false);
elem.disabled = false;
//
if (operate.operation == OperationEvent.Signal.humanControl.menu.operation && elem.atsControl == 0) {
elem.disabled = true;
this.disabledLength++;
} if (operate.operation == OperationEvent.Signal.atsAutoControl.menu.operation && elem.atsControl == 1) {
elem.disabled = true;
this.disabledLength++;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
changeCheck(check, code) {
if (check) {
this.selection.push(code);
} else {
this.selection.splice(this.selection.indexOf(code), 1);
}
if (this.selection.length >= (this.tempData.length - this.disabledLength) ) {
this.allSelect = true;
} else {
this.allSelect = false;
}
if (this.selection.length > 0) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
}
},
allSelectChange() {
this.changeList = [];
if (this.allSelect) {
this.tempData.forEach((item, index)=> {
if (!item.disabled) {
this.changeList.push(true);
this.selection.push(item.code);
} else {
this.changeList.push('');
}
});
this.allSelect = true;
if (this.selection.length > 0) {
this.commitDisabled = false;
}
} else {
this.tempData.forEach((item, index) => {
if (!item.disabled) {
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
} else {
this.changeList = [];
}
});
this.allSelect = false;
this.commitDisabled = true;
}
},
// serializeCodeListWithSeparator(sep) {
// const codeList = [];
// if (this.selection && this.selection.length) {
// this.selection.forEach(elem => {
// codeList.push(elem.code);
// });
// }
// return codeList.join(sep);
// },
// handleChooseChange(selection) {
// this.selection = selection;
// if (selection && selection.length) {
// const operate = {
// repeat: true,
// type: MapDeviceType.Signal.type,
// operation: '',
// val: this.serializeCodeListWithSeparator('::'),
// selection: selection
// };
// if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
// /** */
// operate.operation = OperationEvent.Signal.humanControl.choose.operation;
// } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
// /** */
// operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
// }
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// }
// });
// } else if (!selection) {
// this.$messageBox(``);
// }
// },
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);
},
//
atsAutoControl() {
const operate = {
over: true,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
param:{
routeCodeList: this.selection
}
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,171 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm route-lock"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>信号设备</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<!-- <div class="table">
<span>信号按钮列表</span>
<el-table
ref="table"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column prop="name" label="按钮名称" />
<el-table-column prop="status" label="按钮状态" />
</el-table>
</div> -->
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteLock',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
// tempData: [],
operate: null,
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : '';
},
title() {
return '封锁信号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
this.operate = operate.operation;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
/** status 04:封锁*/
// const signal = (selected || {}).state;
// this.tempData = [{ code: selected.code, name: selected.name, status: !selected.blockade ? '' : '' }];
// const timer = setInterval(() => {
// if (this.$refs.table) {
// this.$refs.table.setCurrentRow(this.tempData[0]);
// clearInterval(timer);
// }
// }, 300);
}
this.dialogShow = true;
this.$nextTick(() => {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
over: true,
operation: this.operate,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,219 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="350px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<el-row style="margin-top: 10px; line-height: 30px;">
<el-col :span="11"><span>进路列表</span></el-col>
<el-col :span="11" :offset="2">
<!-- <el-button class="expand" @click="expandPath">展开进路预览</el-button> -->
</el-col>
</el-row>
<el-table ref="table" :data="tempData" border :cell-style="tableStyle" style="width: 100%; margin-top:10px" size="mini" height="120" highlight-current-row :show-header="false" @row-click="clickEvent">
<el-table-column :id="domIdChoose" prop="name" style="margin-left:30px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="8" :offset="4">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { deepAssign } from '@/utils/index';
export default {
name: 'RouteSelection',
components: {
NoticeInfo
},
data() {
return {
tempData: [],
beforeSectionList: [],
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
display: true,
stationName: '',
signalName: '',
tableStyle: {
'border-bottom': 'none'
}
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '进路设置';
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
expandPath() {
console.log('展开进路预览');
},
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.row.canSetting = true;
this.restoreBeforeDevices();
const containSectionList = [];
if (!row.setting) {
//
if (row.routeSectionList && row.routeSectionList.length) {
//
row.routeSectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(item => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
sec.cutOff = true;
containSectionList.push(sec);
});
} else {
section.cutOff = true;
containSectionList.push(section);
}
});
}
this.$store.dispatch('training/updateMapState', [...containSectionList]);
this.beforeSectionList = containSectionList || [];
//
const operate = {
operation: OperationEvent.Signal.arrangementRoute.choose.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
}
},
commit() {
if (this.row && this.row.canSetting) {
const operate = {
over: true,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: this.row.code
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,287 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-detain-train"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">操作</span>
<div style="overflow: hidden;">
<div>操作设备</div>
<el-col :span="11">
<el-input :value="messageText1" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
</el-button>
</el-col>
</div>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">确认</span>
<div style="overflow: hidden;">
<div>操作设备</div>
<el-col :span="11">
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-option v-for="option in signalList" :key="option.code" :label="option.name" :value="option.name" />
</el-select>
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
</el-button>
</el-col>
</div>
</div>
<div class="body_cont">
<el-col :span="7">
<div class="text">操作倒计时</div>
</el-col>
<el-col :span="17">
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
</el-col>
</div>
<div class="body_cont">
<div class="status_text">状态</div>
<div class="textarea_content" />
</div>
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrain',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
selected: null,
operation: null,
messageText1: '',
messageText2: '',
timeCountConfirm: -1,
disabledConfirm1: false,
disabledConfirm2: true
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.unlock.choose.domId : '';
},
confirmId1() {
return this.dialogShow ? OperationEvent.Signal.unlock.confirm1.domId : '';
},
confirmId2() {
return this.dialogShow ? OperationEvent.Signal.unlock.confirm2.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : '';
},
title() {
return '解除封锁';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) { //
this.timeCountConfirm = -1;
this.disabledConfirm2 = true;
}
}, 1000);
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.messageText1 = selected.name;
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
SelectChange() {
const operate = {
operation: OperationEvent.Signal.unlock.choose.operation,
val: this.messageText2
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm1() {
const operate = {
operation: OperationEvent.Signal.unlock.confirm1.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText1 = '*****';
this.messageText2 = '';
this.disabledConfirm1 = true;
this.disabledConfirm2 = false;
this.timeCountConfirm = 60; //
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm2() {
const operate = {
operation: OperationEvent.Signal.unlock.confirm2.operation,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText2 = '*****';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
commit() {
const operate = {
over: true,
operation: OperationEvent.Signal.unlock.confirm.operation,
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>
<style scoped lang="scss">
.stand-detain-train {
.content {
width: 100%;
border: 1px solid lightgray;
padding: 18px 5px;
position: relative;
height: 80px !important;
.base-label {
position: absolute;
top: -8px;
left: 20px;
background-color: #F0F0F0;
padding: 0 5px;
}
.el-button {
width: 100%;
line-height: 28px;
}
.status_btn {
width: 110px;
margin: 15px auto 0;
display: block;
}
}
.head_content {
height: 110px;
margin-bottom: 10px;
}
.cotnent_body {
margin-bottom: 10px;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_btn {
width: 80px;
margin: 0 auto
}
}
.close_btn {
margin: 0 auto;
width: 80px;
display: block;
}
.body_cont {
margin-bottom: 10px;
padding: 0 3px;
overflow: hidden;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_text {
margin-bottom: 3px;
font-size: 14px;
padding-left: 8px;
}
.textarea_content {
height: 85px;
width: 100%;
border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset;
}
}
}
</style>

View File

@ -0,0 +1,148 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm route-lock"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header" style="line-height: 44px;">
{{ message }}
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteLock',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
message: '',
selected: null,
operate: null
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.cancelGuide.menu.domId : '';
},
title() {
if (this.operate == OperationEvent.Signal.cancelGuide.menu.operation) {
return '人解进路';
} else if (this.operate == OperationEvent.Signal.guide.menu.operation) {
return '办理引导进路';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, message) {
this.selected = selected;
this.operate = operate.operation;
this.message = message;
this.dialogShow = true;
this.$nextTick(() => {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operate == OperationEvent.Signal.cancelGuide.menu.operation) {
this.cancelGuide();
} else if (this.operate == OperationEvent.Signal.guide.menu.operation) {
this.guide();
}
},
// /
cancelGuide() {
const operate = {
over: true,
operation: this.operate,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
};
this.sendCommand(operate);
},
//
guide() {
const operate = {
over: true,
operation: this.operate,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,157 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm section-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="24">
<span style="margin-right: 10px;">区段:</span>
<el-select
:id="domIdChoose"
v-model="sectionCode"
filterable
size="mini"
@change="sectionSelectChange"
>
<el-option v-for="(option,index) in switchAndPhySicalSectionList" :key="index" :label="option.name" :value="option.name" />
</el-select>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
sectionCode: ''
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
switchAndPhySicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' || elem.type === '03'; });
}
return list;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.AxleReset.SetAxleReset.choose.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '计轴复位';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
if (!this.dialogShow) {
this.sectionCode = '';
this.operation = operate.operation || '';
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
sectionSelectChange() {
const operate = {
operation: OperationEvent.AxleReset.SetAxleReset.choose.operation,
val: this.sectionCode
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
});
},
commit() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET,
param: {
sectionCode: this.sectionCode
}
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,188 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm section-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>区段名</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="sectionName" size="small" disabled />
</el-col>
</el-row>
<el-row style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
激活</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
切除</el-radio>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
sectionName: '',
radio: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.sectionName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.sectionName += section.name;
}
}
this.sectionName += `${selected.name}`;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation || '';
if (this.operation == OperationEvent.Section.split.menu.operation) {
this.radio = '2';
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
this.radio = '1';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Section.split.menu.operation) {
/** 轨道区段切除*/
this.split();
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
/** 轨道区段激活*/
this.active();
}
},
//
split() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
};
this.sendCommand(operate);
},
//
active() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Section.CMD_SECTION_ACTIVE
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,316 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-detain-train"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">操作</span>
<div style="overflow: hidden;">
<div>操作设备</div>
<el-col :span="11">
<el-input :value="messageText1" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
</el-button>
</el-col>
</div>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">确认</span>
<div style="overflow: hidden;">
<div>操作设备</div>
<el-col :span="11">
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-option v-for="option in sectionList" :key="option.code" :label="option.name + '(' + option.code + ')'" :value="option.name" />
</el-select>
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
</el-button>
</el-col>
</div>
</div>
<div class="body_cont">
<el-col :span="7">
<div class="text">操作倒计时</div>
</el-col>
<el-col :span="17">
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
</el-col>
</div>
<div class="body_cont">
<div class="status_text">状态</div>
<div class="textarea_content" />
</div>
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrain',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
selected: null,
operation: null,
messageText1: '',
messageText2: '',
timeCountConfirm: -1,
disabledConfirm1: false,
disabledConfirm2: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Section.unlock.choose.domId : '';
},
confirmId1() {
return this.dialogShow ? OperationEvent.Section.unlock.confirm1.domId : '';
},
confirmId2() {
return this.dialogShow ? OperationEvent.Section.unlock.confirm2.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Section.unlock.confirm.domId : '';
},
title() {
if (this.operation == OperationEvent.Section.fault.menu.operation) {
return '区故解';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) { //
this.timeCountConfirm = -1;
this.disabledConfirm2 = true;
}
}, 1000);
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.messageText1 = `${selected.name}(${selected.code})`;
// if (selected.parentCode) {
// const parentSection = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
// this.messageText1 = `${parentSection.name}${selected.name}`;
// }
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.disabledConfirm1 = false;
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
this.messageText1 = '';
this.messageText2 = '';
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
SelectChange() {
const operate = {
operation: '',
val: this.messageText2
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm1() {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm1.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText1 = '*****';
this.messageText2 = '';
this.disabledConfirm1 = true;
this.disabledConfirm2 = false;
this.timeCountConfirm = 60; //
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm2() {
const operate = {
operation: '',
cmdType: ''
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText2 = '*****';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
commit() {
const operate = {
over: true,
operation: ''
};
if (this.operation == OperationEvent.Section.fault.menu.operation) {
operate.operation = OperationEvent.Section.fault.confirm.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>
<style scoped lang="scss">
.stand-detain-train {
.content {
width: 100%;
border: 1px solid lightgray;
padding: 18px 5px;
position: relative;
height: 80px !important;
.base-label {
position: absolute;
top: -8px;
left: 20px;
background-color: #F0F0F0;
padding: 0 5px;
}
.el-button {
width: 100%;
line-height: 28px;
}
.status_btn {
width: 110px;
margin: 15px auto 0;
display: block;
}
}
.head_content {
height: 110px;
margin-bottom: 10px;
}
.cotnent_body {
margin-bottom: 10px;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_btn {
width: 80px;
margin: 0 auto
}
}
.close_btn {
margin: 0 auto;
width: 80px;
display: block;
}
.body_cont {
margin-bottom: 10px;
padding: 0 3px;
overflow: hidden;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_text {
margin-bottom: 3px;
font-size: 14px;
padding-left: 8px;
}
.textarea_content {
height: 85px;
width: 100%;
border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset;
}
}
}
</style>

View File

@ -0,0 +1,551 @@
<template>
<div>
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm section-cmd-speed" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">命令信息</span>
<el-form label-position="center" size="mini">
<el-row>
<el-col :span="6">
<el-form-item label="类型" label-width="40px">
<el-select v-model="operation" size="small" disabled>
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
:value="option.code">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车站名称" label-width="80px">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="nameLabel" label-width="80px">
<el-input v-model="name" size="small" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="限速值" label-width="80px">
<el-select v-model="speed" :id="domIdChoose" size="small" :disabled="spdDisabled"
@change="speedSelectChange">
<el-option v-for="item in speedList" :key="item.value" :label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table class="table" ref="table" :data="tableData" border style="width: 100%" size="mini"
highlight-current-row height="200">
<el-table-column prop="order" :width="50" label="序号">
</el-table-column>
<el-table-column prop="date" :width="160" label="时间">
</el-table-column>
<el-table-column prop="context" :width="180" label="执行过程">
</el-table-column>
<el-table-column prop="result" label="执行结果">
</el-table-column>
</el-table>
<span class="notice">{{message}}</span>
<el-row class="button-group">
<el-col :span="2" :offset="2">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span v-show="timeCountCommand>0">({{ timeCountCommand }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span v-show="timeCountConfirm>0">({{ timeCountConfirm }})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdClose" @click="close">关闭</el-button>
</el-col>
</el-row>
</el-dialog>
<confirm-control-speed ref="confirmControlSpeed" @setOperate="getOperate"></confirm-control-speed>
</div>
</template>
<script>
import ConfirmControlSpeed from './childDialog/confirmControlSpeed';
import { now } from '@/utils/date';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SectionCmdSpeed',
components: {
ConfirmControlSpeed
},
data() {
return {
dialogShow: false,
backOperate: '',
selected: '',
order: 0,
row: null,
timer: null,
type: '',
operation: '',
cmdDisabled: [true, true, true],
spdDisabled: false,
stpDisabled: true,
tableData: [],
message: '',
timeCountCommand: -1,
timeCountConfirm: -1,
maxSpeed: 80,
speedSpace: 5,
stationName: '',
name: '',
speed: ''
};
},
computed: {
nameLabel() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation ||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
return '区段名称';
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation ||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
return '道岔名称';
}
return '';
},
speedList() {
const list = [{ name: '不限速', value: '-1' }];
for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) {
const speed = String(i * this.speedSpace);
list.push({ name: speed, value: speed });
}
return list;
},
typeList() {
return [
{ code: OperationEvent.Section.setSpeed.menu.operation, name: '区段设置限速' },
{ code: OperationEvent.Section.cancelSpeed.menu.operation, name: '区段取消限速' },
{ code: OperationEvent.Switch.setSpeed.menu.operation, name: '区段设置限速' },
{ code: OperationEvent.Switch.cancelSpeed.menu.operation, name: '区段取消限速' }
];
},
title() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
return '区段设置限速';
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
return '区段取消限速';
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
return '区段设置限速';
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
return '区段取消限速';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.choose.domId;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.choose.domId;
}
return '';
},
domIdCommand() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.order.domId;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.order.domId;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.order.domId;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.order.domId;
}
return '';
},
domIdConfirm1() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.confirm1.domId;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.confirm1.domId;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.confirm1.domId;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.confirm1.domId;
}
return '';
},
domIdConfirm2() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.confirm2.domId;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.confirm2.domId;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.confirm2.domId;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.cancelSpeed.confirm2.domId;
}
return '';
},
domIdStop() {
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
return OperationEvent.Section.setSpeed.stop.domId;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
return OperationEvent.Section.cancelSpeed.stop.domId;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
return OperationEvent.Switch.setSpeed.stop.domId;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
return OperationEvent.Switch.cancelSpeed.stop.domId;
}
return '';
},
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
isCancelSpeed() {
return this.operation == OperationEvent.Section.cancelSpeed.menu.operation || this.operation == OperationEvent.Switch.cancelSpeed.menu.operation;
}
},
watch: {
cmdDisabled: {
handler(val, oldVal) {
this.stpDisabled = true;
this.spdDisabled = false;
val.forEach((elem, index) => {
//
if (elem == false && index >= 1 || this.isCancelSpeed) {
this.spdDisabled = true;
}
// 1
if (elem == false && index >= 1) {
this.stpDisabled = false;
}
});
},
deep: true
},
'speed': function (val) {
if (val) this.cmdDisabled[0] = false;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (!this.$store.state.menuOperation.break) {
if (this.timeCountCommand > 0) {
this.timeCountCommand--;
} else if (this.timeCountCommand == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountCommand = -1;
}
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountConfirm = -1;
}
}
}, 1000);
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
methods: {
doShow(operate, selected, tempData) {
if (!this.dialogShow) {
this.name = '';
this.stationName = '';
if (selected) {
if (operate.operation == OperationEvent.Section.setSpeed.menu.operation ||
operate.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected.type === '02') {
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
if (section) {
this.name += section.name;
}
}
this.name += selected.name;
}
} else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation) {
if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.name = selected.name;
}
}
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
this.speed = '';
this.tableData = [];
this.selected = selected;
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.cmdDisabled = [true, true, true];
this.stpDisabled = true;
this.order = 0;
this.type = operate.type;
this.operation = operate.operation;
this.setMessage('请选择限速值后,点击“下达”按钮,下达命令!');
if (this.isCancelSpeed) {
this.speed = `${tempData}`;
this.spdDisabled = true;
this.cmdDisabled = [false, true, true];
}
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
speedSelectChange(val) {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.choose.operation;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.choose.operation;
}
this.setMessage('请点击“下达”按钮,下达命令!');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
}
});
},
command() {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.order.operation;
operate.message = `在【${this.name}】区段,区段设置限速${this.speed}km/h确认下达吗`;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.order.operation;
operate.message = `在【${this.name}】区段,区段取消限速${this.speed}km/h确认下达吗`;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.order.operation;
operate.message = `在【${this.name}】区段,道岔设置限速${this.speed}km/h确认下达吗`;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.order.operation;
operate.message = `在【${this.name}】区段,道岔取消限速${this.speed}km/h确认下达吗`;
}
this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
this.$refs.confirmControlSpeed.doShow(operate, this.selected);
} else {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
});
},
confirm1() {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm1.operation;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm1.operation;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm1.operation;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation;
}
this.setMessage('请点击“确认2”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1;
this.timeCountConfirm = 10;
this.setButtonEnable({ step: 2 });
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
});
},
confirm2() {
const operate = {
over: true,
operation: '',
cmdType: '',
param: {
speedLimitValue: this.speed
}
};
//
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
}
}).catch(() => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
});
},
stop() {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Section.setSpeed.menu.operation) {
/** 区段设置限速*/
operate.operation = OperationEvent.Section.setSpeed.stop.operation;
} else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) {
/** 区段取消限速*/
operate.operation = OperationEvent.Section.cancelSpeed.stop.operation;
} else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) {
/** 道岔设置限速*/
operate.operation = OperationEvent.Switch.setSpeed.stop.operation;
} else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
/** 道岔取消限速*/
operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation;
}
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
});
},
close() {
const operate = {
type: this.type,
operation: OperationEvent.Command.close.menu.operation
};
this.writeRecord({ order: ++this.order, date: now(), context: '点击关闭', result: '' });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
getOperate(operate) {
if (operate.step) {
this.setButtonEnable({ step: operate.step });
}
},
setButtonEnable(param) {
this.cmdDisabled = [true, true, true];
if (param && param.step >= 0) {
this.cmdDisabled[param.step] = false;
}
},
setMessage(message) {
this.message = message;
},
writeRecord(param) {
this.tableData.push(param);
},
editRecord(param) {
this.tableData.forEach(elem => {
if (elem.order == param.order) {
for (var prop in param) {
elem[prop] = param[prop];
}
}
});
}
}
};
</script>

View File

@ -0,0 +1,229 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-run-level"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="font-size: 16px; margin-bottom: 5px;">变通节点</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationName" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationStrategy" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div>
<el-table
ref="table"
:data="strategyList"
border
:cell-style="tableStyle"
style="width: 100%; margin-top:10px"
size="mini"
height="120"
highlight-current-row
:show-header="false"
@row-click="clickEvent"
>
<el-table-column :id="domIdChoose" prop="label" style="margin-left:30px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
export default {
name: 'StandBackStrategy',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
tempData: [],
strategyList: [
{
value: '01',
label: '无折返'
},
{
value: '02',
label: '无人折返'
},
{
value: '03',
label: '自动换端'
},
{
value: '04',
label: '关闭'
}
],
stationName: '',
stationStrategy: '',
selection: [],
isConfirm: false,
strategy: '',
tableStyle: {
'border-bottom': 'none'
}
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : '';
},
title() {
return '变通策略管理';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(selected, opts) {
this.tempData = [];
const stationList = [...this.stationList];
const station = this.stationList.find(n => n.code == selected.stationCode);
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
this.$nextTick(() => {
this.$refs.table.setCurrentRow(null);
});
},
doShow(operate, selected, opts) {
this.selected = selected;
if (!this.dialogShow) {
this.stationName = '';
this.stationStrategy = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
this.strategyList.forEach(item => {
if (item.value == opts.reentryStrategy) {
this.stationStrategy = item.label;
}
});
}
}
this.loadInitData(selected, opts);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
clickEvent(row, column, event) {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
val: `${row.value}`
};
this.strategy = row.value;
this.isConfirm = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.isConfirm) {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
val: `${this.strategy}`
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
this.doClose();
}
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,366 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm stand-detain-train" :title="title" :visible.sync="show" width="320px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div v-if="buckle">
<div style="padding: 15px; margin-bottom: 25px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">类型</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio
v-model="radio"
label="1"
:disabled="radio == 2"
style="display: block; text-align: left;"
>
本站台上行</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio
v-model="radio"
label="2"
:disabled="radio == 1"
style="display: block; text-align: left;"
>
本站台下行</el-radio>
</el-col>
</el-row>
</div>
<div style="padding: 15px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">功能</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio
v-model="radio1"
label="1"
:disabled="radio1 == '2'"
style="display: block; text-align: left;"
>
扣车</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio
v-model="radio1"
label="2"
:disabled="radio1 == '1'"
style="display: block; text-align: left;"
>
取消扣车</el-radio>
</el-col>
</el-row>
</div>
</div>
<div v-if="AutomaticBuckle">
<div style="padding: 15px; margin-bottom: 25px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">类型</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio v-model="autoRadio" label="1" style="display: block; text-align: left;">上行</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="autoRadio" label="2" style="display: block; text-align: left;">下行</el-radio>
</el-col>
</el-row>
</div>
<div style="padding: 15px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">功能</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio v-model="autoRadio1" label="1" :disabled="autoRadio1 == '2'" style="display: block; text-align: left;">设置</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="autoRadio1" label="2" :disabled="autoRadio1 == '1'" style="display: block; text-align: left;">取消</el-radio>
</el-col>
</el-row>
</div>
</div>
<div v-if="earlyDepar">
<div style="padding: 15px; margin-bottom: 25px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">类型</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio
:id="upRadioId"
v-model="radio2"
label="1"
style="display: block; text-align: left;"
:disabled="radio2 == 2"
@change="changeRadio"
>
本站台上行</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio
:id="downRadioId"
v-model="radio2"
label="2"
style="display: block; text-align: left;"
:disabled="radio2 == 1"
@change="changeRadio"
>
本站台下行</el-radio>
</el-col>
</el-row>
</div>
</div>
<el-row class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrain',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
standName: '',
stationName: '',
selected: null,
operation: null,
radio: '1',
radio1: '1',
radio2: '1',
earlyDepar: false, //
buckle: true, //
AutomaticBuckle: false, //
autoRadio: '1',
autoRadio1: '1'
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
upRadioId() {
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : '';
},
downRadioId() {
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.downSelect.domId : '';
},
title() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
return '扣车';
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
return '取消扣车';
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
return '提前发车';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected) {
this.standName = selected.name;
}
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.radio = '2';
if (this.selected.right) { //
this.radio = '1';
}
this.operation = operate.operation;
this.setDefaultItems();
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
setDefaultItems() { //
this.earlyDepar = false;
this.buckle = false;
this.AutomaticBuckle = false;
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
this.buckle = true;
this.radio1 = '1';
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
this.buckle = true;
this.radio1 = '2';
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
this.earlyDepar = true;
if (!this.selected.right) {
this.radio2 = '2';
} else {
this.radio2 = '1';
}
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.operation = '';
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
changeRadio(val) { //
const operate = {
operation: '',
val: val
};
if (val == 1) {
operate.operation = OperationEvent.StationStand.earlyDeparture.upSelect.operation;
} else if (val == 2) {
operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
console.log(error);
});
},
commit() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
/** 设置扣车*/
this.setDetainTrain();
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
/** 取消扣车*/
this.cancelDetainTrain();
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
/** 提前发车*/
this.earlyDeparture();
}
},
//
setDetainTrain() {
const operate = {
over: true,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
param: {
leftDirection: this.radio == '2', // 1 2
rightDirection: this.radio == '1'
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
//
cancelDetainTrain() {
const operate = {
over: true,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
param: {
leftDirection: this.radio == '2', // 1 2
rightDirection: this.radio == '1'
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
this.doClose();
if (!valid) {
this.$refs.noticeInfo.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
//
earlyDeparture() {
const operate = {
over: true,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = false;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style>
.stand-detain-train .context {
height: 80px !important;
}
</style>

View File

@ -0,0 +1,278 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-detail"
:title="title"
:visible.sync="show"
width="400px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-tree
:data="treeData"
:lazy="false"
class="tree-height-max"
:default-expand-all="true"
style="background: #f0f0f0;"
>
<div slot-scope="{ node, data }" style="height: 24px; width: 100%;">
<div v-if="data.level == 1" style="line-height: 26px;">{{ data.name }}</div>
<div v-if="data.level == 2" style="background: lightgray; overflow: hidden; height: 100%;">
<div
style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;"
>
{{ data.name }}</div>
<div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
{{ data.value }}</div>
</div>
</div>
</el-tree>
<!-- <el-row class="header">
<el-col :span="10"><span>车站名称</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="standName" size="small" disabled></el-input>
</el-col>
</el-row>
<div class="table">
<span>站台状态</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" highlight-current-row>
<el-table-column prop="item" :width="140" label="项目">
</el-table-column>
<el-table-column prop="status" label="状态">
</el-table-column>
</el-table>
</div> -->
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StandDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
tempData: [],
stationName: '',
standName: '',
strategyMap: {
'01': '无折返',
'02': '无人折返',
'03': '自动换端',
'04': '默认'
},
treeData: [
{
children: [
{
name: '车站',
value: '',
level: 2
},
{
name: '站台',
value: '',
level: 2
},
{
name: '停站时间',
value: '',
level: 2
},
{
name: '跳停',
value: '',
level: 2
}
],
name: '站台基本信息',
level: 1
},
{
children: [
{
name: '中心扣车',
value: '',
level: 2
},
{
name: '车站扣车',
value: '',
level: 2
}
],
name: '扣车',
level: 1
},
{
children: [
{
name: '上行站台',
value: '',
level: 2
},
{
name: '下行站台',
value: '',
level: 2
}
],
name: '运行等级',
level: 1
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
title() {
return '站台详细信息';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(selected, opts) {
this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
let stationStand, station;
if (selected.direction == '01') { //
//
if (index != 0) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
}
} else {
//
if (index != this.stationList.length - 1) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
}
}
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
// this.tempData.push({ item: '', status: opts.holdStatus == '02' || opts.holdStatus == '04' ? '' : '' });
// this.tempData.push({ item: '', status: opts.holdStatus == '03' || opts.holdStatus == '04' ? '' : '' });
//
this.treeData[1].children[0].value = selected.centerHoldTrain ? '已设置' : '未设置';
//
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
// this.tempData.push({ item: '', status: opts.parkingTime != -1 ? opts.parkingTime : '' });
//
this.treeData[0].children[2].value = selected.parkingTime != -1 ? selected.parkingTime : '自动';
//
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') {
//
// }
// if (!stationStand || !station) {
// this.tempData.push({ item: '', status: `` });
// } else {
// this.tempData.push({ item: '', status: selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:` : `${station.name}${stationStand.name}:` });
// }
// this.tempData.push({ item: '', status: opts.jumpStopStatus != '01' ? '' : '' });
//
// this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
},
doShow(operate, selected, opts) {
this.selected = selected;
if (!this.dialogShow) {
// this.standName = '';
// this.stationName = '';
this.treeData[0].children[0].value = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
// this.standName = selected.name;
this.treeData[0].children[1].value = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
// this.stationName = station.name;
this.treeData[0].children[0].value = station.name;
// this.treeData[0].children[1].value = station.runPlanName
}
}
this.loadInitData(selected, opts);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.close.confirm.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,187 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-detain-train-all"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px double lightgray; ">
<span class="base-label">范围</span>
<el-row>
<el-radio-group v-model="upDown" @change="choose">
<el-col :span="10">
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">上行全线</el-radio>
</el-col>
<el-col :span="6" :offset="8">
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">下行全线</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<div class="table">
<span>扣车站台列表中心设置</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" empty-text="所有站台都无扣车状态" height="160" highlight-current-row>
<el-table-column prop="stationName" label="车站名称" />
<el-table-column prop="standName" :width="140" label="扣车站台" />
</el-table>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">确定
</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StandDetainTrainAll',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
upDown: '01',
tempData: [],
disabled: true,
operation: ''
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
},
title() {
// if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) {
return '全线取消扣车';
} else {
return '全线取消跳停';
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadTableData() {
this.tempData = [];
this.stationStandList.forEach(elem => {
/** status 01: 未扣车*/
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) === Number(this.upDown)) {
this.tempData.push({ stationName: station.name, standName: elem.name });
}
});
//
if (this.tempData.length > 0) {
this.disabled = false;
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.loading = false;
this.upDown = selected.direction;
this.loadTableData();
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
choose(upDown) {
//
this.loadTableData();
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
val: `${upDown}`
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
val: this.upDown
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {
const operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,355 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm stand-detain-train" :title="title" :visible.sync="show" width="380px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<el-form label-width="70px" size="mini" style="">
<el-row style="margin-top: 20px;padding: 10px 5px; border: 1px solid lightgray;">
<span class="base-label" style="display:block; padding-left: 20px;">范围</span>
<el-radio-group :id="selfStationStandId" v-model="model.val1" @change="upAndDownStreamChangeVal1">
<div style="margin-bottom: 8px;">
<el-radio :label="upstream" :disabled="model.direction !== '02'">本站台上行跳停</el-radio>
</div>
<div style="margin-bottom: 8px;">
<el-radio :label="downstream" :disabled="model.direction !== '01'">本站台下行跳停</el-radio>
</div>
</el-radio-group>
<el-row>
<el-col :span="10">
<el-radio-group :id="otherStationStandId" v-model="model.val2" @change="upAndDownStreamChange">
<div style="margin-bottom: 8px;">
<el-radio :label="upstream" :disabled="model.direction !== '02'">指定列车上行跳停</el-radio>
</div>
<div style="margin-bottom: 8px;">
<el-radio :label="downstream" :disabled="model.direction !== '01'">指定列车下行跳停</el-radio>
</div>
</el-radio-group>
</el-col>
<el-col :span="11" align="top" :offset="2">
<span>车组号</span>
<el-select
:id="selectTrainId"
v-model="model.tripNumber"
style="width: 110px;"
size="mini"
:disabled="!model.val2"
@change="trainNoSelectChange"
>
<el-option
v-for="option in trainList"
:key="option.groupNumber"
:label="option.groupNumber"
:value="option.groupNumber"
/>
</el-select>
</el-col>
</el-row>
</el-row>
</el-form>
<div style="padding: 15px; margin-top: 20px; border: 1px solid lightgray;">
<span class="base-label" style="left: -5px; top: -22px; background: #f0f0f0; padding: 0 4px;">功能</span>
<el-row style="margin-top: -13px;">
<el-col :span="11">
<el-radio
v-model="radio1"
:label="JumpStopSet"
:disabled="radio1 == JumpStopCancel"
style="display: block; text-align: left;"
>
设置</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio
v-model="radio1"
:label="JumpStopCancel"
:disabled="radio1 == JumpStopSet"
style="display: block; text-align: left;"
>
取消</el-radio>
</el-col>
</el-row>
</div>
<el-row class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'StandDetainTrains',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
standName: '',
stationName: '',
selected: null,
operation: null,
trainList: [],
radio1: '',
model: {
val1: '',
val2: '',
tripNumber: '',
direction: ''
}
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selectTrainId() {
if (this.radio1 == this.JumpStopSet) {
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.select.domId : '';
} else {
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.select.domId : '';
}
},
selfStationStandId() {
if (this.radio1 == this.JumpStopSet) {
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.selfStationStand.domId : '';
} else {
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.selfStationStand.domId : '';
}
},
otherStationStandId() {
if (this.radio1 == this.JumpStopSet) {
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.otherStationStand.domId : '';
} else {
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.otherStationStand.domId : '';
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '跳停';
},
upstream() {
return '02'; //
},
downstream() {
return '01'; //
},
JumpStopSet() {
return OperationEvent.StationStand.setJumpStop.menu.operation;
},
JumpStopCancel() {
return OperationEvent.StationStand.cancelJumpStop.menu.operation;
}
},
watch: {
'model.val1'(val) {
if (val) this.model.val2 = '';
},
'model.val2'(val) {
if (val) this.model.val1 = '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.radio1 = '';
this.standName = '';
this.stationName = '';
if (selected) {
this.standName = selected.name;
}
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.model.direction = '01';
this.model.val1 = '01'; // , 01: /02:
if (this.selected.right) {
this.model.direction = '02';
this.model.val1 = '02';
}
this.radio1 = operate.operation;
this.model.val2 = '';
this.model.tripNumber = '';
/** 加载列车数据*/
this.trainList = this.map.trainList;
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
/** 设置跳停*/
this.setJumpStop();
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
/** 取消跳停*/
this.cancelJumpStop();
}
},
//
setJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2;
// }
const operate = {
over: true,
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
param: {
// Is_This_Platform: val,
trainGroupNumber: this.model.tripNumber
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
//
cancelJumpStop() {
// let val = this.model.val1;
// if (this.model.val2) {
// val = this.model.val2;
// }
const operate = {
over: true,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
param: {
// Is_This_Platform: val,
trainGroupNumber: this.model.tripNumber
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = false;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
upAndDownStreamChangeVal1(val) {
const operation = this.radio1 == this.JumpStopSet
? OperationEvent.StationStand.setJumpStop.selfStationStand.operation : OperationEvent.StationStand.cancelJumpStop.selfStationStand.operation;
this.model.val2 = '';
this.model.tripNumber = '';
const operate = {
operation: operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
upAndDownStreamChange(val) {
const operation = this.radio1 == this.JumpStopSet
? OperationEvent.StationStand.setJumpStop.otherStationStand.operation : OperationEvent.StationStand.cancelJumpStop.otherStationStand.operation;
this.model.val1 = '';
const operate = {
operation: operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainNoSelectChange(val) {
const operation = this.radio1 == this.JumpStopSet
? OperationEvent.StationStand.setJumpStop.select.operation : OperationEvent.StationStand.cancelJumpStop.select.operation;
this.model.val1 = '';
const operate = {
operation: operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
}
};
</script>
<style>
.stand-detain-train .context {
height: 80px !important;
}
</style>

View File

@ -0,0 +1,333 @@
<template>
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="10"><span>集中站</span></el-col>
<el-col :span="10" :offset="2"><span>站台</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>站台状态</span>
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
<el-table-column prop="name" :width="180" label="下一站台" />
<el-table-column prop="level" label="运行等级">
<template slot-scope="scope">
<el-select :id="chooseLevelId" v-model="scope.row.level" size="mini" @change="levelSelectChange(scope.row)">
<el-option
v-for="item in levelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="time" label="区间运行时间">
<template slot-scope="scope">
<el-select
:id="domIdChoose"
v-model="scope.row.time"
size="mini"
:disabled="scope.row.level == 0"
@change="timeSelectChange"
>
<el-option
v-for="item in timeList[scope.row.level]"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="check" label="一直有效">
<template slot-scope="scope">
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
</template>
</el-table-column>
</el-table>
</div>
<!-- <el-row class="button-group">
<span v-if="isSelect && tempData.length">提示: 未选中要设置运行等级的下一站台</span>
<span v-if="isConfirm && tempData.length">提示: 选中要设置运行等级的下一站台为{{tempData[0].name}}</span>
</el-row> -->
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import ConfirmControl from './childDialog/confirmControl';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandRunLevel',
components: {
ConfirmControl
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
maxRunLevel: 300,
stationName: '',
standName: '',
selection: [],
levelList: [
{
value: '0',
label: '自动'
},
{
value: '1',
label: '1'
},
{
value: '2',
label: '2'
},
{
value: '3',
label: '3'
},
{
value: '4',
label: '4'
}
],
isSelect: true,
isConfirm: false,
time: ''
};
},
computed: {
...mapGetters('map', [
'stationList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
chooseLevelId() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.chooseLevel.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
},
domIdCheck() {
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
},
title() {
return '设置运行等级';
},
timeList() {
const list = {
'0': [{ value: 0, label: '0' }],
'1': [], // 120 - 110
'2': [], // 100 - 90
'3': [], // 80 - 70
'4': [] // 60 - 50
};
for (let i = 110; i <= 120; i++) {
list['1'].push({ value: i, label: `${i}` });
}
for (let i = 90; i <= 100; i++) {
list['2'].push({ value: i, label: `${i}` });
}
for (let i = 70; i <= 80; i++) {
list['3'].push({ value: i, label: `${i}` });
}
for (let i = 50; i <= 60; i++) {
list['4'].push({ value: i, label: `${i}` });
}
return list;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getLevelByTime(time) {
return Object.keys(this.timeList).findIndex(key => {
return this.timeList[key].findIndex(obj => {
return obj.value === time;
}) >= 0;
}).toString();
},
loadInitData(selected, opts) {
this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { //
//
if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
}
} else {
//
if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
}
}
},
doShow(operate, selected, opts) {
this.selected = selected;
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.loadInitData(selected, opts);
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
checkTableDataSelction(data) { //
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
},
timeSelectChange(time) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.choose.operation
};
this.time = time.toString();
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
levelSelectChange(row) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation
};
this.time = row.time = this.timeList[row.level][0].value;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkChange(check) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.check.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.isConfirm) {
const operate = {
over: true,
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
param: {
runLevelTime: this.time,
runLevelTimeForever: !!this.tempData[0].check
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
} else {
this.doClose();
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,242 @@
<template>
<el-dialog v-dialogDrag :title="title" class="ningbo-01__systerm stand-stop-time" :visible.sync="show" width="340px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>站台名称</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="standName" size="small" disabled />
</el-col>
</el-row>
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 73px;">
<span class="base-label" style="left: -9px;">模式</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="control" style="width: 40%;float: left;" @change="chooseControl">
<div style="margin-bottom: 10px;">
<el-radio :id="control === '01'? '': domIdChoose1" label="01">自动</el-radio>
</div>
<el-radio :id="control === '02'? '': domIdChoose1" label="02">全人工</el-radio>
</el-radio-group>
<!-- <el-input-number
:id="domIdInput"
v-model="time"
:disabled="disabledInput"
controls-position="right"
:min="0"
size="mini"
style="width: 130px; padding-left:30px;display: block; float: left; margin-top: 15px;"
@change="inputTime"
/>
<div style="float: left;margin-top: 22px; margin-left: 5px;"></div> -->
</div>
</div>
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
<span class="base-label" style="left: -9px;">有效次数</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
<el-radio :id="effective === 0? '': domIdChoose2" label="0" name="effective">一次有效</el-radio>
<el-radio :id="effective === 1? '': domIdChoose2" label="1" name="effective">一直有效</el-radio>
</el-radio-group>
</div>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandStopTime',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
// time: 0,
control: '01',
direction: '01',
effective: '0',
selected: null,
standName: '',
stationName: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
},
domIdChoose1() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
},
domIdChoose2() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
},
domIdInput() {
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
},
disabledUp() {
if (this.selected) {
return this.selected.direction !== '02';
}
return true;
},
disabledDown() {
if (this.selected) {
return this.selected.direction !== '01';
}
return true;
},
disabledInput() {
return this.control === '01'; //
},
disabledTime() {
return this.control === '01'; //
},
title() {
return '停站时间';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempDate) {
this.selected = selected || {};
//
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.standName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
if (station) {
this.stationName = station.name;
}
}
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
// this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
// this.effective = tempDate.parkingValidStatus ? true : false;
this.effective = tempDate.parkingValidStatus ? '1' : '0';
this.direction = selected.direction;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
chooseControl(control) {
/** 自动时的默认时间*/
if (control == '01') {
this.inputTime = 15;
this.effective = 1;
}
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose1.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
chooseEffective() {
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose2.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
// inputTime() {
// const operate = {
// repeat: true,
// operation: OperationEvent.StationStand.setStopTime.input.operation
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// }
// });
// },
commit() {
const operate = {
send: true,
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
param: {
parkingTime: this.control == '01' ? -1 : 1,
// runLevelTime: this.time,
parkingAlwaysValid: this.effective == '1'
}
// messages: [`: ${this.stationName} - ${this.standName}, ${this.control == '01' ? '' : this.time + ''}, ${this.effective == false ? '' : ''}`]
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -0,0 +1,388 @@
<template>
<div>
<el-dialog class="ningbo-01__systerm station-cmd-control" :title="title" :visible.sync="show" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<span class="base-label">命令信息</span>
<el-form label-position="center" size="mini">
<el-row>
<el-col :span="8">
<el-form-item label="类型" label-width="40px">
<el-select v-model="operation" size="small" disabled>
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
:value="option.code">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="车站名称" label-width="100px">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
highlight-current-row height="200">
<el-table-column prop="order" :width="50" label="序号">
</el-table-column>
<el-table-column prop="date" :width="160" label="时间">
</el-table-column>
<el-table-column prop="context" :width="180" label="执行过程">
</el-table-column>
<el-table-column prop="result" label="执行结果">
</el-table-column>
</el-table>
<span class="notice">{{message}}</span>
<el-row class="button-group">
<el-col :span="2" :offset="2">
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
v-show="timeCountConfirm>0">({{timeCountConfirm}})</span></el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
</el-col>
<el-col :span="2" :offset="2">
<el-button :id="domIdClose" @click="close">关闭</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { now } from '@/utils/date';
export default {
name: 'StationCmdControl',
data() {
return {
dialogShow: false,
backOperate: '',
selected: null,
order: 0,
row: null,
timer: null,
operation: '',
cmdDisabled: [true, true, true],
stpDisabled: true,
tempData: [],
message: '',
timeCountCommand: -1,
timeCountConfirm: -1,
stationName: ''
}
},
computed: {
typeList() {
return [
{ code: OperationEvent.Station.powerUnLock.menu.operation, name: '上电解锁' },
{ code: OperationEvent.Station.execKeyOperationTest.menu.operation, name: '执行关键操作测试' }
]
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCommand() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
return OperationEvent.Station.powerUnLock.order.domId;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
return OperationEvent.Station.execKeyOperationTest.order.domId;
}
}
},
domIdConfirm1() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
return OperationEvent.Station.powerUnLock.confirm1.domId;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
return OperationEvent.Station.execKeyOperationTest.confirm1.domId;
}
}
},
domIdConfirm2() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
return OperationEvent.Station.powerUnLock.confirm2.domId;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
return OperationEvent.Station.execKeyOperationTest.confirm2.domId;
}
}
},
domIdStop() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
return OperationEvent.Station.powerUnLock.stop.domId;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
return OperationEvent.Station.execKeyOperationTest.stop.domId;
}
}
},
domIdClose() {
if (this.dialogShow) {
return OperationEvent.Command.close.menu.domId;
}
},
title() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
return '信号解封';
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
return '执行关键操作测试';
}
}
}
},
watch: {
cmdDisabled: {
handler(val, oldVal) {
this.stpDisabled = true;
val.forEach((elem, index) => {
// 1
if (elem == false && 1 <= index && index <= 2) {
this.stpDisabled = false;
}
});
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
this.timer = setInterval(() => {
if (!this.$store.state.menuOperation.break) {
if (this.timeCountCommand > 0) {
this.timeCountCommand--;
} else if (this.timeCountCommand == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountCommand = -1;
}
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) {
this.setButtonEnable({ step: 0 });
this.timeCountConfirm = -1;
}
}
}, 1000)
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.stationName = selected.name
}
this.order = 0;
this.operation = operate.operation;
this.tempData = [];
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.cmdDisabled = [false, true, true];
}
this.stpDisabled = true;
this.dialogShow = true;
this.setMessage('请点击“下达”按钮,下达命令!');
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
command() {
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation ||
this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 第一步不带弹框处理*/
this.commandNoPopUp();
} else {
/** 第一步带弹框处理*/
this.commandHasPopUp();
}
},
commandHasPopUp() {
},
commandNoPopUp() {
let operate = {
type: MapDeviceType.Station.type
}
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.order.operation
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.order.operation
}
this.setMessage('请点击“确认1”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 });
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
})
},
confirm1() {
let operate = {
type: MapDeviceType.Station.type,
}
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.confirm1.operation;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm1.operation;
}
this.setMessage('请点击“确认2”按钮确认命令');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1;
this.timeCountConfirm = 10;
this.setButtonEnable({ step: 2 });
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
}
}).catch(() => {
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
})
},
confirm2() {
let operate = {
send: true,
type: MapDeviceType.Station.type
}
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
}
this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
}
}).catch(() => {
this.timeCountCommand = -1;
this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 });
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
})
},
stop() {
let operate = {
type: MapDeviceType.Station.type,
}
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
/** 上电解锁*/
operate.operation = OperationEvent.Station.powerUnLock.stop.operation;
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
/** 执行关键操作测试*/
operate.operation = OperationEvent.Station.execKeyOperationTest.stop.operation;
}
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
} else {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
}
}).catch(error => {
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
})
},
close() {
let operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.close.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
},
getOperate(operate) {
/** 弹框返回值处理*/
},
setButtonEnable(param) {
this.cmdDisabled = [true, true, true];
if (param && param.step >= 0) {
this.cmdDisabled[param.step] = false;
}
},
setMessage(message) {
this.message = message;
},
writeRecord(param) {
this.tempData.push(param);
},
editRecord(param) {
this.tempData.forEach(elem => {
if (elem.order == param.order) {
for (var prop in param) {
elem[prop] = param[prop];
}
}
})
}
}
}
</script>

View File

@ -0,0 +1,253 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="540px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row style="margin-bottom: 10px;">
<el-col :span="17">
<el-table ref="table" :data="stationLists" border style="width: 100%;" size="mini" height="260" highlight-current-row @row-click="clickEvent">
<el-table-column label="选择" width="50">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked" :disabled="scope.row.disable" />
</template>
</el-table-column>
<el-table-column label="车站名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="当前状态">
<template slot-scope="scope">
<span v-if="scope.row.controlMode == 'Center'">遥控</span>
<span v-else-if="scope.row.controlMode == 'Local'">站控</span>
<span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span>
<span v-else>获取状态中...</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6" :offset="1">
<el-radio v-model="controlMode" label="center" :disabled="disabledAll" style="margin-bottom: 8px;">请求站控</el-radio>
<el-radio v-model="controlMode" label="local" :disabled="disabledAll">请求遥控</el-radio>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="17">
<el-col :span="11" style="text-align: center;"><el-checkbox v-model="checkedAll" size="medium" :disabled="disabledAll" @change="selectAll">全部选择</el-checkbox></el-col>
<el-col :span="11" :offset="2"><el-checkbox v-model="checked2" :disabled="disabledAll" size="medium">全部确认</el-checkbox></el-col>
</el-col>
<el-col :span="5" :offset="1" style="margin-top: -56px;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" style="margin-left: 0; margin-bottom: 10px; width: 100%;" @click="commit"> </el-button>
<el-button :id="domIdCancel" style="margin-left: 0; width: 100%;" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
export default {
name: 'StationControl',
components: {
NoticeInfo
},
data() {
return {
controlMode: 'center',
beforeSectionList: [],
checkedAll: false,
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
stationLists: [],
disabledAll: false
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '站遥控转换';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
getStationList(disable) {
this.stationLists = [];
if (this.stationList && this.stationList.length) {
this.stationList.forEach(item => {
if (item.centralized) {
const station = this.$store.getters['map/getDeviceByCode'](item.code);
let checked = false;
if (station.code == this.selected.code) {
checked = true;
}
const param = {
checked: checked,
disable: disable,
code: item.code,
name: item.name,
controlMode: station.controlMode
};
this.stationLists.push(param);
}
});
}
},
getProtectedSectionName(row) {
let name = '';
if (row &&
row.overlapSectionList &&
row.overlapSectionList &&
row.overlapSectionList.length > 0) {
const protect = row.overlapSectionList[0];
name = `${protect.name}`;
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
if (station) {
name = `${name}(${station.name})`;
}
}
return name;
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
if (selected) {
this.getStationList(true);
this.disabledAll = true;
} else {
this.getStationList(false);
this.disabledAll = false;
}
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
this.controlMode = 'local';
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
this.controlMode = 'center';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
selectAll() {
this.stationLists.forEach(row => {
if (this.checkedAll) {
row.checked = true;
} else {
row.checked = false;
}
});
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
const operate = {
operation: OperationEvent.Signal.arrangementRoute.choose.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
},
commit() {
const list = [];
this.stationLists.forEach(row => {
if (row.checked) {
list.push(row.code);
}
});
if (list && list.length) {
const operate = {
over: true,
operation: '',
cmdType: '',
param: {
stationCodes: list
}
};
if (this.controlMode == 'center') {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
operate.operation = OperationEvent.StationControl.requestStationControl.menu.operation;
} else if (this.controlMode == 'local') {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
operate.operation = OperationEvent.StationControl.requestCentralControl.menu.operation;
}
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -0,0 +1,127 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm station-human-control-all"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="context">
<span>{{ title }}</span>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StationHumanControlAll',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '全集中站进路交人工控';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Station.humanControlALL.menu.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.loading = false;
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.humanControlALL.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style>
.station-human-control-all .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm station-set-route-control-all"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div style="padding: 0px 10px">
<el-form ref="form" size="small" label-width="90px" label-position="left">
<el-form-item label="集中站名称:" prop="stationName">
<el-input v-model="stationName" size="small" disabled />
</el-form-item>
</el-form>
<el-radio-group v-model="mode">
<el-row>
<el-radio :label="true">检查冲突</el-radio>
</el-row>
<el-row style="margin-top: 20px">
<el-radio :label="false">不检查冲突</el-radio>
</el-row>
</el-radio-group>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'StationSetRouteControlAll',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: null,
stationName: '',
mode: true
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '全集中站设置进路控制模式';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Station.atsAutoControlALL.menu.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.loading = false;
this.operation = operate.operation;
this.stationName = '';
if (selected) {
this.stationName = selected.name;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Station.type,
label: MapDeviceType.Station.label,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
val: this.mode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Station.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style>
.station-set-route-control-all .context {
padding-bottom: 40px !important;
border: 1px solid lightgray;
}
</style>

View File

@ -0,0 +1,237 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm switch-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>车站名称</span></el-col>
<el-col :span="11" :offset="2"><span>道岔</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="switchName" size="small" disabled />
</el-col>
</el-row>
<el-row v-if="isLock" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
道岔单锁</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
道岔解单锁</el-radio>
</el-col>
</el-row>
<el-row v-if="isTurnBlock" style="margin-top: 10px;">
<el-col :span="11">
<el-radio v-model="turnRadio" label="1" :disabled="turnRadio == 2" style="display: block; text-align: center;">
道岔定位</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="turnRadio" label="2" :disabled="turnRadio == 1" style="display: block; text-align: center;">
道岔反位</el-radio>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: '',
stationName: '',
switchName: '',
isLock: false,
isTurnBlock: false,
turnRadio: '1',
lockRadio: '1',
activeRadio: '1'
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
return '道岔封锁';
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
return '道岔控制';
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
return '道岔强扳';
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
return '区段控制';
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
return '区段控制';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.switchName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.switchName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation;
this.isLock = false;
this.isTurnBlock = false;
if (this.operation == OperationEvent.Switch.locate.menu.operation) {
this.isTurnBlock = true;
this.turnRadio = '1';
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
this.isTurnBlock = true;
this.turnRadio = '2';
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
this.isLock = true;
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
/** 道岔单锁*/
this.lock();
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
/** 道岔封锁*/
this.block();
} else if (this.operation == OperationEvent.Switch.locate.menu.operation) {
/** 道岔定位*/
this.locate();
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
/** 道岔反位*/
this.reverse();
}
},
//
lock() {
const operate = {
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.sendCommand(operate);
},
//
block() {
const operate = {
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
};
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
};
this.sendCommand(operate);
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>

View File

@ -0,0 +1,322 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-detain-train"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">操作</span>
<div style="overflow: hidden;">
<div>道岔</div>
<el-col :span="11">
<el-input :value="messageText1" placeholder="" size="mini" disabled />
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
</el-button>
</el-col>
</div>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 2px;">确认</span>
<div style="overflow: hidden;">
<div>道岔</div>
<el-col :span="11">
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
<el-option v-for="option in switchList" :key="option.code" :label="option.name" :value="option.name" />
</el-select>
</el-col>
<el-col :span="8" :offset="1">
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
</el-button>
</el-col>
</div>
</div>
<div class="body_cont">
<el-col :span="7">
<div class="text">操作倒计时</div>
</el-col>
<el-col :span="17">
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
</el-col>
</div>
<div class="body_cont">
<div class="status_text">状态</div>
<div class="textarea_content" />
</div>
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetainTrain',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
selected: null,
operation: null,
messageText1: '',
messageText2: '',
timeCountConfirm: -1,
disabledConfirm1: false,
disabledConfirm2: true
};
},
computed: {
...mapGetters('map', [
'switchList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Switch.unlock.choose.domId : '';
},
confirmId1() {
return this.dialogShow ? OperationEvent.Switch.unlock.confirm1.domId : '';
},
confirmId2() {
return this.dialogShow ? OperationEvent.Switch.unlock.confirm2.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.unlock.confirm.domId : '';
},
title() {
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
return '道岔单解';
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
return '解除封锁';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
this.timer = setInterval(() => {
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) { //
this.timeCountConfirm = -1;
this.disabledConfirm2 = true;
}
}, 1000);
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.messageText1 = selected.name;
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.messageText1 = '';
this.messageText2 = '';
this.timeCountConfirm = -1;
this.disabledConfirm1 = false;
this.disabledConfirm2 = true;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
SelectChange() {
const operate = {
operation: '',
val: this.messageText2
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.choose.operation;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm1() {
const operate = {
operation: ''
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText1 = '*****';
this.messageText2 = '';
this.disabledConfirm1 = true;
this.disabledConfirm2 = false;
this.timeCountConfirm = 60; //
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
confirm2() {
const operate = {
operation: '',
cmdType: ''
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText2 = '*****';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
commit() {
const operate = {
over: true,
operation: ''
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.confirm.operation;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.confirm.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}).catch((error) => {
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
}
};
</script>
<style scoped lang="scss">
.stand-detain-train {
.content {
width: 100%;
border: 1px solid lightgray;
padding: 18px 5px;
position: relative;
height: 80px !important;
.base-label {
position: absolute;
top: -8px;
left: 20px;
background-color: #F0F0F0;
padding: 0 5px;
}
.el-button {
width: 100%;
line-height: 28px;
}
.status_btn {
width: 110px;
margin: 15px auto 0;
display: block;
}
}
.head_content {
height: 110px;
margin-bottom: 10px;
}
.cotnent_body {
margin-bottom: 10px;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_btn {
width: 80px;
margin: 0 auto
}
}
.close_btn {
margin: 0 auto;
width: 80px;
display: block;
}
.body_cont {
margin-bottom: 10px;
padding: 0 3px;
overflow: hidden;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_text {
margin-bottom: 3px;
font-size: 14px;
padding-left: 8px;
}
.textarea_content {
height: 85px;
width: 100%;
border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset;
}
}
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-select v-model="addModel.trainCode" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
:label="serviceNumber"
:value="serviceNumber"
/>
</el-select>
</el-form-item>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
// name: 'TrainMove',
name: 'TrainAddPlan',
components: {
},
data() {
return {
trainNoList: [],
selected: null,
tripNumberList: [],
serviceNumberList: [],
addModel: {
trainCode: '', //
serviceNumber: '', //
tripNumber: '' //
},
rules: {
trainCode: [
{ required: true, message: '请输入车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur' }
],
tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'trainList',
'stationStandList',
'trainWindowSectionCode'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
},
title() {
return '创建计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumberList = [];
if (typeof resp.data == 'string') {
this.serviceNumberList.push(resp.data);
} else {
resp.data.forEach(item => {
if (!this.serviceNumberList.includes(item)) {
this.serviceNumberList.push(item);
}
});
}
if (this.serviceNumberList.length === 1) {
this.addModel.serviceNumber = this.serviceNumberList[0];
}
});
},
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
}).catch(error => {
this.$messageBox(error.message);
});
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
// this.mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
over: true,
operation: OperationEvent.Train.createPlanTrain.menu.operation,
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: {
trainCode: this.addModel.trainCode, //
serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber //
}
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
});
} else {
return false;
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.doClose();
}
})
.catch(() => {
this.doClose();
});
}
}
};
</script>
<style scoped>
.ningbo-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-define"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">新车组号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.tripNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDefine',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
tripNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.addTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.addTrainId.menu.domId : '';
},
title() {
return '设置车体号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.input.operation,
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,168 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
title() {
return '删除车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
// getPublishMapTrainNos(map.skinCode).then(response => {
// this.trainNoList = response.data;
// }).catch(() => {
// this.$messageBox(``);
// });
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -0,0 +1,165 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog class="ningbo-01__systerm train-set-plan" :title="title" :visible.sync="show" width="380px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form">
<div style="overflow: hidden;">
<div style="width: 98%; float: left; padding: 10px 15px; margin: 20px 0px; height: 120px;">
<!-- <span class="base-label">目的</span> -->
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal" style="width:280px">
<el-input v-model="addModel.trainGoal"></el-input>
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
},
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '删除计划车'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.deletePlanTrainId.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-edit"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">新车组号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainEdit',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '修改计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,159 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-flag"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">车组号:</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.groupNumber" />
</el-col>
</el-row>
<el-row style="margin-top: 15px; margin-bottom: 30px">
<el-col :span="24">
<el-radio-group v-model="addModel.type" :disabled="true">
<el-radio label="01">备选项</el-radio>
<el-radio label="02">备选项</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainFlag',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
type: '01',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return 'ATP切除功能';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-move"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">车组号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainMove',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.addTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.addTrainId.menu.domId : '';
},
title() {
return '移动车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, 0.3);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog class="ningbo-01__systerm train-set-plan" :title="title" :visible.sync="show" width="640px" :before-close="doClose"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form">
<!-- <div style="width: 46%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainNo">
<el-input v-model="addModel.trainNo" disabled></el-input>
</el-form-item>
</div> -->
<div style="overflow: hidden;">
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;">
<span class="base-label"></span>
<div style="position: relative; top:-10px;">
<!-- <el-form-item prop="stationStandSource">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandSource" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="车 次 号:" prop="trainSource">
<el-input v-model="addModel.trainSource"></el-input>
</el-form-item>
</div>
</div>
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">目的</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal">
<el-input v-model="addModel.trainGoal"></el-input>
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
},
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '平移计划车'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected) {
//
if (!this.dialogShow) {
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.moveEventlyTrainId.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-head"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="11">车组号</el-col>
<el-col :span="11" :offset="2">服务号</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
<el-col :span="11" :offset="2">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">目的地号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.targetCode" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainSetHead',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: '',
targetCode: '',
tripNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '设置头码车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,173 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="11">车组号</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="addModel.groupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="11">服务号</el-col>
<el-col :span="11" :offset="2">序列号</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="addModel.serialNumber" />
</el-col>
<el-col :span="11" :offset="2">
<el-input :id="domIdInput" v-model="addModel.tripNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainSetPlan',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: '',
tripNumber: '',
serialNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '设置计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
// if (!this.dialogShow) {
// }
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,164 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-work"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="6" style="line-height: 44px;">车组号:</el-col>
<el-col :span="18">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainSetWork',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '设置人工车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,175 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-work"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="6">车组号:</el-col>
</el-row>
<el-row>
<el-col :span="18">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-radio v-model="radio" label="01">标记ATP切除</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio v-model="radio" label="02">标记APT恢复</el-radio>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainSetWork',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: ''
},
radio: '01',
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return 'ATP切除功能';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
this.mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.tripNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -0,0 +1,179 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm signal-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>折返</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<el-row style="margin: 12px 0;">
<el-col :span="11">
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'">设置</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'">取消</el-radio>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: null,
stationName: '',
signalName: '',
passRadio: '1'
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '自动折返';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'AutoTurnBack'.toUpperCase()) {
const autoReentryData = this.$store.getters['map/autoReentryData'];
this.signalName = autoReentryData[selected.cycleCode].name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation;
if (this.operation == OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation) {
this.passRadio = '1';
} else if (this.operation == OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation) {
this.passRadio = '2';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation) {
this.singalPassModel(); //
} else if (this.operation == OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation) {
this.singalCancelPassModel(); //
}
},
//
singalPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
};
this.sendCommand(operate);
},
//
singalCancelPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>

View File

@ -0,0 +1,391 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<!-- <menu-button ref="menuButton" /> -->
<menu-axle-reset ref="menuAxleReset" :selected="selected" />
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-control ref="menuStationControl" :selected="selected" />>
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-Timeout ref="passiveTimeout" />
</template>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import MenuCancel from './menuCancel';
import MenuSignal from './menuSignal';
// import MenuButton from './menuButton';
import MenuAxleReset from './menuAxleReset';
import MenuAutoTrunRoute from './menuAutoTrunRoute';
import MenuStationStand from './menuStationStand';
import MenuStationControl from './menuStationControl';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {
name: 'Menus',
components: {
MenuBar,
// MenuButton,
MenuAxleReset,
MenuAutoTrunRoute,
MenuCancel,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStationStand,
MenuStationControl,
MenuStation,
MenuTrain,
MenuLimit,
PassiveAlarm,
PassiveContorl,
PassiveTimeout
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
computed: {
...mapGetters('config', [
'width'
]),
isShowAll() {
return this.$route.params.mode !== 'dp' &&
this.$route.params.mode !== 'plan' &&
this.$store.state.training.roles != 'BigScreen';
},
isShowBar() {
return this.$store.state.training.prdType;
}
},
watch: {
isShowBar(val) {
val && this.$store.dispatch('config/updateMenuBar');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
});
}
};
</script>
<style>
.menus .pop-menu {
background: #F0F0F0;
}
.menus .pop-menu span {
color: #000;
}
.menus .pop-menu .is-disabled span {
color: #B4B3B8;
}
.ningbo-01__systerm {
overflow: hidden !important;
}
.ningbo-01__systerm .el-dialog {
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
}
.ningbo-01__systerm .el-dialog .el-dialog__header {
padding: 10px;
height: 26px;
}
.ningbo-01__systerm .el-dialog .el-dialog__footer {
background: #F0F0F0;
opacity: 1;
}
.ningbo-01__systerm .el-dialog .el-dialog__body {
padding: 10px;
margin: 5px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #F0F0F0;
opacity: 1;
}
.ningbo-01__systerm .el-dialog .el-dialog__title {
position: absolute;
top: 6px;
color: #000;
border-radius: 4px;
padding: 0px 2px;
height: 20px;
line-height: 20px
}
.ningbo-01__systerm .el-dialog .el-dialog__title::before {
content: '';
position: absolute;
top: 0;
left: 0;
filter: blur(7px);
height: 20px;
width: -webkit-fill-available;
background: rgba(190, 190, 190, 0.8);
z-index: -1;
}
.ningbo-01__systerm .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 5px;
right: 5px;
line-height: 18px;
}
.ningbo-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.ningbo-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.ningbo-01__systerm .el-dialog .el-button {
height: 32px;
line-height: 32px;
padding: 0px;
width: 80px;
border: 2px outset #E2E2E2;
border-radius: 0px !important;
color: #000;
background: #F0F0F0;
}
.ningbo-01__systerm .el-dialog .expand {
width: 120px;
}
.ningbo-01__systerm .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.ningbo-01__systerm .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.ningbo-01__systerm .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.ningbo-01__systerm .el-dialog .el-button:disabled span {
border: 0px;
}
.ningbo-01__systerm .el-dialog .el-input {
border: 2px inset #E9E9E9;
}
.ningbo-01__systerm .el-dialog .el-input .el-input__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.ningbo-01__systerm .el-dialog .el-input.is-disabled .el-input__inner {
background: #F0F0F0 !important;
}
.ningbo-01__systerm .el-dialog .el-textarea {
border: 2px inset #E9E9E9;
border-radius: 0px;
}
.ningbo-01__systerm .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.ningbo-01__systerm .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.ningbo-01__systerm .el-dialog .el-table--border th.gutter {
background: #EBEADB !important;
}
.ningbo-01__systerm .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.ningbo-01__systerm .el-dialog .el-table .cell {
line-height: unset !important;
}
.ningbo-01__systerm .el-dialog .el-table th.is-leaf {
background: #F0F0F0 !important;
border-right: 1px solid #BDBDBD !important;
border-bottom: 1px solid #BDBDBD !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.ningbo-01__systerm.stand-detain-train .el-dialog .el-table th.is-leaf {
background: #fff !important;
border-right: 1px solid #fff !important;
border-bottom: 1px solid #EBEEF5 !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.ningbo-01__systerm.stand-detain-train .el-dialog .el-table th.el-table-column--selection{
border-right: 1px solid #e2e2e2 !important;
}
.ningbo-01__systerm.stand-detain-train .el-dialog .el-table .el-table__body-wrapper .el-table__row .el-table-column--selection {
border-right: 1px solid #e2e2e2 !important;
}
.ningbo-01__systerm .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.ningbo-01__systerm .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
}
.ningbo-01__systerm .el-dialog .current-row>td {
background: #3399FF !important;
color: #fff !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox__label {
color: #000 !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.ningbo-01__systerm .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
position: absolute;
-webkit-box-sizing: content-box;
box-sizing: content-box;
content: "";
border: 1px solid #000;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
top: 1px;
}
.ningbo-01__systerm .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.ningbo-01__systerm .el-dialog .el-radio__label {
color: #000 !important;
}
.ningbo-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.ningbo-01__systerm .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
width: 4px;
height: 4px;
border-radius: 100%;
background-color: #000 !important;
position: absolute;
left: 50%;
top: 50%;
}
.ningbo-01__systerm .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.ningbo-01__systerm .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.ningbo-01__systerm .el-dialog .base-label {
background: #F0F0F0;
padding: 0 5px;
position: relative;
left: -15px;
top: -18px;
}
.ningbo-01__systerm .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.ningbo-01__systerm .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.ningbo-01__systerm .el-dialog .table {
margin-top: 10px;
}
.ningbo-01__systerm .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.ningbo-01__systerm .el-dialog .button-group {
margin-top: 10px;
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<turn-back-control ref="turnBackControl" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import TurnBackControl from './dialog/turnBackControl';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'MenuLimit',
components: {
PopMenu,
TurnBackControl
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '设置自动折返',
handler: this.handlerTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
},
{
label: '取消自动折返',
handler: this.cancelTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
}
],
Center: [
{
label: '设置自动折返',
handler: this.handlerTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
},
{
label: '取消自动折返',
handler: this.cancelTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
}
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.AutoTurnBack) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
handlerTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
});
},
//
cancelTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
});
}
}
};
</script>

View File

@ -0,0 +1,108 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<section-alxe-reset ref="sectionAlxeReset" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SectionAlxeReset from './dialog/sectionAlxeReset';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'MenuLimit',
components: {
PopMenu,
SectionAlxeReset
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '计轴复位',
handler: this.handleAxleReset,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
}
],
Center: [
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.AxleReset) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
handleAxleReset() {
const operate = {
start: true,
operation: OperationEvent.AxleReset.SetAxleReset.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionAlxeReset.doShow(operate);
}
});
}
}
};
</script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,389 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<button
:id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.arrangementRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.cancelTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)"
>
<span style="color: black">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.humanTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.humanTrainRoute.button.operation)"
>
<span style="color: red">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.reopenSignal.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.reopenSignal.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.guide.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.guide.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
id="mbm_06"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_06')"
>
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.locate.button.domId"
:style="{display: 'block', float: 'left', width: width+'px',backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.locate.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.reverse.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.reverse.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.lock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.lock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Switch.unlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Switch.unlock.button.operation)"
>
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Signal.setAutoInterlock.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Signal.setAutoInterlock.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Section.fault.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.fault.button.operation)"
>
<span style="color: black">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
:id="Section.axlePreReset.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown(Section.axlePreReset.button.operation)"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button
id="mbm_11"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_11')"
>
<span style="color: black">
<center>
<b style="color:deepskyblue"></b>
<b style="color:burlywood"></b>
</center>
<center>
<b style="color: red"></b>
<b style="color:forestgreen"></b>
</center>
</span>
</button>
<button
id="mbm_12"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_12')"
>
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
</div>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/OperateHandler';
export default {
name: 'MapButtonMenu',
data() {
return {
point: {
x: -1000,
y: -1000
},
operation: '0',
buttonName: '',
buttonDownColor: '#A8A8A8',
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {}
};
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Section() {
return OperationEvent.Section;
},
Signal() {
return OperationEvent.Signal;
},
isShowBtn() {
return this.$store.state.training.prdType == '01';
}
},
watch: {
'$store.state.config.canvasOffsetCount': function (val) {
this.resetPosition();
},
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
}
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},
updateButtonShow(val, old) {
if (old) {
//
const domId = getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
buttonDown(operation) {
const operate = {
type: 'mbm',
operation: operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
});
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
const model = this.$store.state.menuOperation.selected;
if (model) {
const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
} else {
OperateHandler.cleanOperates();
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;
$hoverBg: #f5f7fa;
.menu {
background-color: $bg;
position: fixed;
border: 1px solid gray;
z-index: 10;
display: block;
.dsp-block {
display: block;
text-align: center;
border-radius: unset;
width: 100%;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
</style>

View File

@ -0,0 +1,119 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
import { runDiagramQuit } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
};
</script>

View File

@ -0,0 +1,120 @@
<template>
<el-dialog class="ningbo-01__systerm two-confirmation" title="二次确认" :visible.sync="show" width="360px"
:before-close="doClose" :showClose="false" :zIndex="2000" :modal="false" :close-on-click-modal="false"
append-to-body v-dialogDrag>
<div class="context">
<template v-for="(message, index) in messages">
<span :key="index">{{message}}</span>
</template>
</div>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">确认</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'
export default {
name: 'TwoConfirmation',
data() {
return {
dialogShow: false,
loading: false,
operation: '',
operate: '',
timer: null
}
},
components: {
NoticeInfo
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdConfirm() {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
return OperationEvent.StationControl.emergencyStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
}
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
},
messages() {
if (this.operate) {
return this.operate.messages;
}
return []
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = this.operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
let operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
})
},
commit() {
let operate = {
send: true,
type: this.operate.type,
val: this.operate.val,
}
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation;
}
this.doClose();
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}, 1000).catch((error) => {
this.$refs.noticeInfo.doShow(operate);
});
}
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More