From 77b02b947e4dcd0af9f6180a0142368b38ecc059 Mon Sep 17 00:00:00 2001
From: zyy <1787816799@qq.com>
Date: Tue, 14 Jul 2020 16:07:43 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AE=BE=E5=A4=87=E8=BF=9E?=
=?UTF-8?q?=E6=8E=A5=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/baseUrl.js | 4 +-
.../newMap/displayNew/demon/equipment.vue | 71 ++++++++---------
src/views/newMap/displayNew/menuTrainList.vue | 77 ++++++++-----------
.../newMap/mapsystemNew/common/index.vue | 15 +++-
4 files changed, 82 insertions(+), 85 deletions(-)
diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js
index 778caeb7b..c59924e25 100644
--- a/src/utils/baseUrl.js
+++ b/src/utils/baseUrl.js
@@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
- BASE_API = 'https://test.joylink.club/jlcloud';
+ // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
- // BASE_API = 'http://192.168.3.6:9000'; // 旭强
+ BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
diff --git a/src/views/newMap/displayNew/demon/equipment.vue b/src/views/newMap/displayNew/demon/equipment.vue
index 70ee46638..3220345be 100644
--- a/src/views/newMap/displayNew/demon/equipment.vue
+++ b/src/views/newMap/displayNew/demon/equipment.vue
@@ -14,7 +14,7 @@
名称: {{ plcInfo.name }}
状态: {{ plcInfo.status ? '在线' : '不在线' }}
-
刷新
+
刷新
@@ -23,19 +23,12 @@
{{ scope.row.vrDeviceCode }}
(空)
-
- 激活
-
- 连接
- 断开
+ 连接
+ 断开
@@ -60,15 +53,24 @@ export default {
name: '',
status: ''
},
- index: 0
+ index: 0,
+ selected: {},
+ typeObj: {
+ Section: '区段',
+ Signal: '信号机',
+ Switch: '道岔',
+ Psd: '屏蔽门',
+ StationStand: '站台'
+ }
};
},
mounted() {
EventBus.$on('selectDevice', (data) => {
- this.tableData[this.index]['vrDeviceCode'] = data.code;
+ this.selected = data;
this.tableData[this.index]['buttonShowType'] = false;
this.tableData.splice(this.index, 1, this.tableData[this.index]);
this.$store.dispatch('map/selectDeviceCode', {flag: false, type: ''});
+ this.connect(this.tableData[this.index]);
});
},
async beforeDestroy() {
@@ -100,37 +102,32 @@ export default {
console.error(error);
}
},
- hover(row, index) {
+ doClose() {
+ this.show = false;
+ },
+ handleClick(row, index) {
row.buttonShowType = !row.buttonShowType;
this.index = index;
this.tableData.splice(index, 1, row);
this.$store.dispatch('map/selectDeviceCode', {flag: row.buttonShowType, type: row.type});
},
- freshen() {
- this.getList();
- },
- doClose() {
- this.show = false;
- },
- async handleClick(row) {
- if (row.vrDeviceCode) {
- this.$confirm('您确定将次设备连接, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- try {
- const res = await postSimulationConnectById(this.group, row.id, row.vrDeviceCode);
- if (res && res.code == 200) {
- this.$message.success('连接成功!');
- }
- } catch (error) {
- console.error(error);
+ async connect(row) {
+ this.$confirm(`您确定连接${this.typeObj[this.selected._type] || '设备'}: ${this.selected.name}, 是否继续?`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(async () => {
+ try {
+ const res = await postSimulationConnectById(this.group, row.id, this.selected.code);
+ if (res && res.code == 200) {
+ this.$message.success('连接成功!');
+ this.tableData[this.index]['vrDeviceCode'] = this.selected.code;
+ this.tableData.splice(this.index, 1, this.tableData[this.index]);
}
- });
- } else {
- this.$message.info('需要连接的设备编码为空,请选择');
- }
+ } catch (error) {
+ console.error(error);
+ }
+ });
},
async cancel(row, index) {
this.$confirm('您确定将次设备断开, 是否继续?', '提示', {
diff --git a/src/views/newMap/displayNew/menuTrainList.vue b/src/views/newMap/displayNew/menuTrainList.vue
index 2e6df6739..5670aef1d 100644
--- a/src/views/newMap/displayNew/menuTrainList.vue
+++ b/src/views/newMap/displayNew/menuTrainList.vue
@@ -1,17 +1,9 @@
-