From e94ffd235ab35152ae0c1cb1e5e92152885a4742 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Wed, 6 Jan 2021 18:17:40 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=A8=A1=E5=BC=8F=E5=BF=AB?=
=?UTF-8?q?=E6=8D=B7=E9=94=AE&ISCS=E8=BF=94=E5=9B=9E=EF=BC=88=E9=80=80?=
=?UTF-8?q?=E5=87=BA=EF=BC=89=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iscs.js | 8 ++++
src/jmapNew/config/keyboardEvents.js | 3 +-
src/permission.js | 6 ---
src/views/iscs/iscsSystem/stationNav.vue | 11 ++++-
src/views/newMap/displayNew/menuSchema.vue | 10 +++-
.../scriptPreview/scriptButtonGroup.vue | 7 ++-
src/views/newMap/jlmapNew/index.vue | 2 +
.../newMap/jointTrainingNew/menuSchema.vue | 46 ++++++++++++++-----
src/views/trainingPlatform/demonList.vue | 1 -
9 files changed, 72 insertions(+), 22 deletions(-)
diff --git a/src/api/iscs.js b/src/api/iscs.js
index 0f15a31b9..2b81ddacb 100644
--- a/src/api/iscs.js
+++ b/src/api/iscs.js
@@ -41,3 +41,11 @@ export function deleteIscs(id) {
method: 'delete'
});
}
+// 查询地图下是否有ISCS数据
+export function queryHasIscs(params) {
+ return request({
+ url: `/api/v1/iscs/hasData`,
+ method: 'get',
+ params
+ });
+}
diff --git a/src/jmapNew/config/keyboardEvents.js b/src/jmapNew/config/keyboardEvents.js
index 4938ba94a..caf5f6021 100644
--- a/src/jmapNew/config/keyboardEvents.js
+++ b/src/jmapNew/config/keyboardEvents.js
@@ -12,6 +12,7 @@ export const keyboardEvents = {
ALT_O: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_O'},
ALT_E: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_E'},
ALT_S: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_S'},
- ALT_D: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_D'}
+ ALT_D: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_D'},
+ TAB: {altKey: false, ctrlKey: false, shiftKey: false, event: 'Tab'}
};
diff --git a/src/permission.js b/src/permission.js
index 118472c2e..b69fa3d35 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -7,12 +7,6 @@ import 'nprogress/nprogress.css';
import { getToken, removeToken, getSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
-// function hasPermission(roles, permissionRoles) {
-// if (roles.indexOf(admin) >= 0) return true;
-// if (!permissionRoles) return true;
-// return roles.some(role => permissionRoles.indexOf(role) >= 0);
-// }
-
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool']; // 不重定向白名单
for (const val in loginInfo) {
diff --git a/src/views/iscs/iscsSystem/stationNav.vue b/src/views/iscs/iscsSystem/stationNav.vue
index eb77d9498..8369846d0 100644
--- a/src/views/iscs/iscsSystem/stationNav.vue
+++ b/src/views/iscs/iscsSystem/stationNav.vue
@@ -56,7 +56,8 @@
-
返回
+ 返回
+ 退出
报警
@@ -308,6 +309,11 @@ export default {
manage:{name:'管理', type:'totalSystem', id: 'manage', active:false, icon:iscs_icon9 }
};
},
+ computed: {
+ noPreLogout() {
+ return this.$route.query.noPreLogout;
+ }
+ },
watch:{
$route() {
const data = Object.values(this.buttonList);
@@ -453,6 +459,9 @@ export default {
this.$message.error('清除仿真失败!');
});
}
+ },
+ quit() {
+ window.close();
}
}
};
diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue
index 790f7f07e..aa3b1d634 100644
--- a/src/views/newMap/displayNew/menuSchema.vue
+++ b/src/views/newMap/displayNew/menuSchema.vue
@@ -14,7 +14,7 @@
{{ $t('display.schema.loadRunDiagram') }}
- {{ faultMode?'切换到普通模式':'切换到故障模式' }}
+ {{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}
@@ -38,6 +38,7 @@ import { getSessionStorage } from '@/utils/auth';
import { getToken } from '@/utils/auth';
import { getIbpInfoByStation } from '@/api/ibp';
import { loadRunPlanData } from '@/utils/loaddata';
+import { EventBus } from '@/scripts/event-bus';
// 右上角操作
export default {
@@ -128,6 +129,13 @@ export default {
this.viewDisabled = false;
}
},
+ mounted() {
+ EventBus.$on('CheckFaultModeEvent', () => {
+ if (!this.isScheduling) {
+ this.changeOperateMode();
+ }
+ });
+ },
methods: {
loadRunData() {
this.$store.dispatch('runPlan/clear').then(() => {
diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue
index 37f700069..5a62a6a08 100644
--- a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue
+++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue
@@ -24,7 +24,7 @@
{{ $t('display.schema.previewRunDiagram') }}
{{ $t('display.schema.loadRunDiagram') }}
- {{ faultMode?'切换到普通模式':'切换到故障模式' }}
+ {{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}
@@ -133,6 +133,11 @@ export default {
}
},
async mounted() {
+ EventBus.$on('CheckFaultModeEvent', () => {
+ if (!this.isScheduling) {
+ this.changeOperateMode();
+ }
+ });
await this.initLoadData();
},
async beforeDestroy() {
diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue
index e6faa0dc1..b2b4825c5 100644
--- a/src/views/newMap/jlmapNew/index.vue
+++ b/src/views/newMap/jlmapNew/index.vue
@@ -349,6 +349,8 @@ export default {
switch (hook) {
case 'Update': this.$store.dispatch('map/setKeyboardEnter');
break;
+ case 'Tab': EventBus.$emit('CheckFaultModeEvent');
+ break;
}
},
async simulationReset() {
diff --git a/src/views/newMap/jointTrainingNew/menuSchema.vue b/src/views/newMap/jointTrainingNew/menuSchema.vue
index 939e8b49f..a6d4a2607 100644
--- a/src/views/newMap/jointTrainingNew/menuSchema.vue
+++ b/src/views/newMap/jointTrainingNew/menuSchema.vue
@@ -6,7 +6,7 @@
IBP盘
- 大屏
+ 大屏
ISCS
{{ $t('joinTraining.runGraphPreview') }}
@@ -14,9 +14,9 @@
{{ $t('joinTraining.runGraphLoading') }}
- {{ faultMode?' 切换到普通模式':'切换到故障模式' }}
+ {{ faultMode?' 切换到普通模式[Tab]':'切换到故障模式[Tab]' }}
- {{ directiveMode? '切换到普通模式':'切换到指令模式' }}
+ {{ directiveMode? '切换到普通模式[Tab]':'切换到指令模式[Tab]' }}
@@ -32,6 +32,8 @@ import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
import SelectIbp from '@/views/newMap/displayNew/demon/selectIbp';
import { getIbpInfoByStation } from '@/api/ibp';
import { loadRunPlanData } from '@/utils/loaddata';
+import { EventBus } from '@/scripts/event-bus';
+import { queryHasIscs } from '@/api/iscs';
export default {
name: 'MenuDemonSchema',
components:{
@@ -102,6 +104,9 @@ export default {
...mapGetters('runPlan', [
'stations'
]),
+ ...mapGetters('map', [
+ 'bigScreenConfig'
+ ]),
running() {
return this.$store.state.training.started;
},
@@ -113,6 +118,9 @@ export default {
},
isShowDirective() { // 哈尔滨项目 行调设备显示
return this.$route.query.type == 'CW' && this.project == 'heb';
+ },
+ hasBigScreen() {
+ return this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length;
}
},
watch: {
@@ -139,6 +147,14 @@ export default {
},
async mounted() {
this.userId = this.$store.state.user.id;
+ EventBus.$on('CheckFaultModeEvent', () => {
+ if ((this.isAdmin || this.$route.query.type === 'ILW') && !this.dataError && !this.isScreen) {
+ this.changeOperateMode();
+ }
+ if (this.isShowDirective) {
+ this.changeDirectiveMode();
+ }
+ });
},
methods: {
loadRunData(opt) {
@@ -204,16 +220,24 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
goIscs() {
- const routeData = this.$router.resolve({
- path:`/displayIscs/system`,
- query:{
- lineCode: this.$route.query.lineCode,
- mapId: this.$route.query.mapId,
- group: this.$route.query.group,
- noPreLogout: true
+ queryHasIscs({mapId: this.$route.query.mapId}).then(resp => {
+ if (resp.data) {
+ const routeData = this.$router.resolve({
+ path:`/displayIscs/system`,
+ query:{
+ lineCode: this.$route.query.lineCode,
+ mapId: this.$route.query.mapId,
+ group: this.$route.query.group,
+ noPreLogout: true
+ }
+ });
+ window.open(routeData.href, '_blank', 'noopener noreferrer');
+ } else {
+ this.$messageBox('该地图线路暂无ISCS数据!');
}
+ }).catch(() => {
+ this.$message.error('查询ISCS数据异常');
});
- window.open(routeData.href, '_blank', 'noopener noreferrer');
},
// 点击ibp预览
goIbp() {
diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue
index 8d1b919cc..679f7a17f 100644
--- a/src/views/trainingPlatform/demonList.vue
+++ b/src/views/trainingPlatform/demonList.vue
@@ -137,7 +137,6 @@ export default {
},
forTree(item) {
item.children && item.children.forEach(childrenItem => {
- // childrenItem.key = item.id + childrenItem.id + childrenItem.type;
childrenItem.key = item.key + '-' + childrenItem.id;
if (childrenItem.children && childrenItem.children.length) {
this.forTree(childrenItem);