From 01ef134ad376c0a895c3a04db0ec6ed8d191de92 Mon Sep 17 00:00:00 2001
From: dong <58670809@qq.com>
Date: Thu, 15 Sep 2022 11:30:06 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/trainingManage/editCondition.vue | 27 ++++++-----
src/views/trainingManage/expression.vue | 56 ++++++++++++++++++++--
2 files changed, 67 insertions(+), 16 deletions(-)
diff --git a/src/views/trainingManage/editCondition.vue b/src/views/trainingManage/editCondition.vue
index df5fa07fe..949342964 100644
--- a/src/views/trainingManage/editCondition.vue
+++ b/src/views/trainingManage/editCondition.vue
@@ -87,15 +87,15 @@ export default {
mapDevice() {
return this.$store.state.map.mapDevice;
},
+ mapStationDirectionData() {
+ return this.$store.state.map.mapStationDirectionData;
+ },
getDeviceList() {
const typeObj = {};
this.ConstSelect.operationDeviceList.forEach(ii => {
typeObj[ii.value] = ii.label;
});
const list = [];
- const autoList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST']; // 自动闭塞
- const SemiList = ['OCCLUSION', 'RECOVERY', 'ACCIDENT']; // 半自动闭塞
- const allList = [...autoList, ...SemiList];
Object.values(this.mapDevice).forEach(item => {
if (typeObj[item._type]) {
list.push({
@@ -104,22 +104,23 @@ export default {
_type: item._type
});
}
- if (item._type == 'SignalButton' && allList.includes(item.type)) {
- let isAuto = true;
- if (SemiList.includes(item.type)) {
- isAuto = false;
- }
- list.push({
- code: item.code,
- name: `${item.name}(${isAuto ? '自动闭塞' : '半自动闭塞'})`,
- _type: `${isAuto ? 'StationDirectionAuto' : 'StationDirectionSemi'}`
- });
+ });
+ Object.values(this.mapStationDirectionData).forEach(item => {
+ let isAuto = true;
+ if (item.runModel == 'S') {
+ isAuto = false;
}
+ list.push({
+ code: item.code,
+ name: `${item.name}_${item.labelEnum}(${isAuto ? '自动闭塞' : '半自动闭塞'})`,
+ _type: `${isAuto ? 'StationDirectionAuto' : 'StationDirectionSemi'}`
+ });
});
this.getRouteList.forEach(item => {
list.push({
code: item.code,
name: `${item.name}(进路)`,
+ startSignalCode: item.startSignalCode,
_type: 'Route'
});
});
diff --git a/src/views/trainingManage/expression.vue b/src/views/trainingManage/expression.vue
index 5603608c3..9f4d4cbd8 100644
--- a/src/views/trainingManage/expression.vue
+++ b/src/views/trainingManage/expression.vue
@@ -32,6 +32,17 @@
/>
+
+
+
+
+ 激活
+
- 激活
+ 激活
@@ -121,6 +132,7 @@ export default {
indexPath: '',
field: '',
deviceType: '',
+ startSignal: '',
formModel: {
t: 'E',
t1: 'S',
@@ -153,6 +165,18 @@ export default {
list = this.getDeviceList.filter(item => {
return item._type == this.deviceType;
});
+ if (this.deviceType == 'Route') {
+ list = list.filter(item => {
+ return item.startSignalCode == this.startSignal;
+ });
+ }
+ return list;
+ },
+ getSignalList() { // 信号机列表
+ let list = [];
+ list = this.getDeviceList.filter(item => {
+ return item._type == 'Signal';
+ });
return list;
},
getSectionList() { // 区段列表
@@ -229,6 +253,14 @@ export default {
};
return crules;
},
+ showElementCodeActive() {
+ let s = true;
+ const arr = ['Route', 'StationDirectionAuto', 'StationDirectionSemi'];
+ if (arr.includes(this.deviceType)) {
+ s = false;
+ }
+ return s;
+ },
showDevice() {
let s = false;
if (this.formModel.t1 == 'S') {
@@ -263,14 +295,20 @@ export default {
let list = this.getDeviceList;
if (this.field == 'v') {
list = this.getSectionList;
+ } else if (this.field == 'startSignal') {
+ list = this.getSignalList;
}
const findObj = list.find(item => {
return item.code == code;
});
if (findObj) {
- this.formModel[this.field] = findObj.code;
+ if (this.field == 'startSignal') {
+ this[this.field] = findObj.code;
+ } else {
+ this.formModel[this.field] = findObj.code;
+ }
}
- if (this.deviceType != this.getDeviceType()) {
+ if (this.field != 'startSignal' && this.deviceType != this.getDeviceType()) {
this.deviceType = this.getDeviceType();
this.formModel.filedName = '';
this.formModel.v = '';
@@ -372,6 +410,7 @@ export default {
}
}
this.deviceType = this.getDeviceType();
+ this.startSignal = this.getStartSignal();
},
getDeviceType() {
let type = '';
@@ -383,6 +422,16 @@ export default {
}
return type;
},
+ getStartSignal() {
+ let signal = '';
+ const findObj = this.getDeviceList.find(item => {
+ return item.code == this.formModel.elementCode;
+ });
+ if (findObj) {
+ signal = findObj.startSignalCode || '';
+ }
+ return signal;
+ },
clearFromData() {
this.$refs.formModel.resetFields();
}
@@ -392,6 +441,7 @@ export default {