This commit is contained in:
joylink_cuiweidong 2021-01-06 18:15:34 +08:00
commit c266442842
9 changed files with 72 additions and 22 deletions

View File

@ -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
});
}

View File

@ -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'}
};

View File

@ -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) {

View File

@ -56,7 +56,8 @@
</div>
</div>
</div>
<div class="bottom-back" @click="back">返回</div>
<div v-if="!noPreLogout" class="bottom-back" @click="back">返回</div>
<div v-if="noPreLogout" class="bottom-back" @click="quit">退出</div>
<!-- :class="{'disable_box': alarmInfo}" -->
<div class="bottom-back" @click="handleAlarmInfo">
报警
@ -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();
}
}
};

View File

@ -14,7 +14,7 @@
<!-- notScript && -->
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
</el-button-group>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}</el-button>
<!-- <el-button v-if="!isLocalStation" size="small" :type="faultMode ? 'danger' : ''" @click="changeDirectiveMode()">指令模式</el-button> -->
</template>
</div>
@ -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(() => {

View File

@ -24,7 +24,7 @@
<el-button v-if="running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
</el-button-group>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}</el-button>
</template>
</div>
<!-- 菜单按钮列表 -->
@ -133,6 +133,11 @@ export default {
}
},
async mounted() {
EventBus.$on('CheckFaultModeEvent', () => {
if (!this.isScheduling) {
this.changeOperateMode();
}
});
await this.initLoadData();
},
async beforeDestroy() {

View File

@ -349,6 +349,8 @@ export default {
switch (hook) {
case 'Update': this.$store.dispatch('map/setKeyboardEnter');
break;
case 'Tab': EventBus.$emit('CheckFaultModeEvent');
break;
}
},
async simulationReset() {

View File

@ -6,7 +6,7 @@
<!--</el-select>-->
<el-button-group>
<el-button v-if="userRole=== 'STATION_SUPERVISOR' && !$route.query.projectDevice" size="small" @click="goIbp">IBP盘</el-button>
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goBigScreen">大屏</el-button>
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" :disabled="!hasBigScreen" @click="goBigScreen">大屏</el-button>
<el-button v-if="userRole==='DISPATCHER' && !$route.query.projectDevice" size="small" @click="goIscs">ISCS</el-button>
<el-button v-if="running && !dataError && $route.query.type !== 'ILW'" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
<template v-if="isAdmin">
@ -14,9 +14,9 @@
{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- -->
</template>
</el-button-group>
<el-button v-if="(isAdmin || $route.query.type === 'ILW') && !dataError && !isScreen" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式':'切换到故障模式' }}</el-button>
<el-button v-if="(isAdmin || $route.query.type === 'ILW') && !dataError && !isScreen" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式[Tab]':'切换到故障模式[Tab]' }}</el-button>
<!-- isCenter && !dataError && !isAdmin 此判断用于以后(目前 暂时不用) -->
<el-button v-if="isShowDirective" size="small" :type="directiveMode ? 'primary' : ''" @click="changeDirectiveMode()">{{ directiveMode? '切换到普通模式':'切换到指令模式' }}</el-button>
<el-button v-if="isShowDirective" size="small" :type="directiveMode ? 'primary' : ''" @click="changeDirectiveMode()">{{ directiveMode? '切换到普通模式[Tab]':'切换到指令模式[Tab]' }}</el-button>
</div>
<join-run-plan-view v-if="running && !dataError" ref="runPlanView" :group="group" />
<select-ibp ref="selectIbp" />
@ -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,6 +220,8 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
goIscs() {
queryHasIscs({mapId: this.$route.query.mapId}).then(resp => {
if (resp.data) {
const routeData = this.$router.resolve({
path:`/displayIscs/system`,
query:{
@ -214,6 +232,12 @@ export default {
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
} else {
this.$messageBox('该地图线路暂无ISCS数据');
}
}).catch(() => {
this.$message.error('查询ISCS数据异常');
});
},
// ibp
goIbp() {

View File

@ -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);