Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
This commit is contained in:
commit
f6145d9ad8
@ -351,7 +351,6 @@ export default {
|
||||
if (model && model._type == 'GuideLock') {
|
||||
const operate = {
|
||||
start: true,
|
||||
over: true,
|
||||
operation: OperationEvent.Station.guideLock.button.operation,
|
||||
param:{
|
||||
stationCode:model.stationCode
|
||||
@ -367,7 +366,8 @@ export default {
|
||||
}
|
||||
this.$refs.password.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
|
||||
|
@ -79,14 +79,14 @@ export default {
|
||||
label: '设置临时限速',
|
||||
handler: this.setSpeed,
|
||||
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
|
||||
isDisabled: (section, work) => section.speedUpLimit === -1,
|
||||
isDisabled: (section, work) => section.speedUpLimit !== -1,
|
||||
isShow: (section, work) => work === 'dispatchWork' && section.type !== '04'
|
||||
},
|
||||
{
|
||||
label: '取消临时限速',
|
||||
handler: this.cancelSpeed,
|
||||
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
|
||||
isDisabled: (section, work) => section.speedUpLimit !== -1,
|
||||
isDisabled: (section, work) => section.speedUpLimit === -1,
|
||||
isShow: (section, work) => work === 'dispatchWork' && section.type !== '04'
|
||||
}
|
||||
],
|
||||
|
@ -162,6 +162,7 @@ export default {
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || (menuItem.isDisabled && menuItem.isDisabled(this.selected, this.work));
|
||||
menuItem.show = menuItem.isShow && menuItem.isShow(this.selected, this.work);
|
||||
@ -288,7 +289,7 @@ export default {
|
||||
},
|
||||
isTrainOccupy(selectType) {
|
||||
const data = this.$store.getters['map/getApproachSectionByCode'](selectType.code);
|
||||
if (data && data.routeSectionList.length > 0) {
|
||||
if (data && data.routeSectionList && data.routeSectionList.length > 0) {
|
||||
let isTrainOccupy = false;
|
||||
data.routeSectionList.forEach(sectionCode=>{
|
||||
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
|
||||
|
@ -186,7 +186,9 @@ export default {
|
||||
isDisabled: (signal, work) => {
|
||||
return false;
|
||||
},
|
||||
isShow: (signal, work) => work === 'dispatchWork'
|
||||
isShow: (signal, work, lineCode) => {
|
||||
return work === 'dispatchWork' || lineCode == '11';
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '进路交ATS自动控',
|
||||
@ -195,7 +197,9 @@ export default {
|
||||
isDisabled: (signal, work) => {
|
||||
return false;
|
||||
},
|
||||
isShow: (signal, work) => work === 'dispatchWork'
|
||||
isShow: (signal, work, lineCode) => {
|
||||
return work === 'dispatchWork' || lineCode == '11';
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '查询进路状态',
|
||||
@ -236,6 +240,9 @@ export default {
|
||||
]),
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
lineCode() {
|
||||
return this.$route.query.lineCode;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -269,7 +276,7 @@ export default {
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work, this.lineCode) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
// 故障模式菜单列表
|
||||
|
@ -10,27 +10,13 @@
|
||||
<tmt-dialog ref="tmtDialog" />
|
||||
<atr-dialog ref="atrDialog" />
|
||||
<train-trunk-detail ref="trainTrunkDetail" @openTra="openTra" />
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
<div class="display-draft">
|
||||
<el-button-group class="button-group-box">
|
||||
<template v-if="!dataError">
|
||||
<el-button type="success" :disabled="isRunPlan" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
|
||||
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
|
||||
</template>
|
||||
<el-button type="primary" size="small" @click="back">{{ $t('display.demon.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, getTopic } from '@/utils/stomp';
|
||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
|
||||
@ -44,13 +30,11 @@ import TtlDialog from './ttl';
|
||||
import TmtDialog from './tmt';
|
||||
import AtrDialog from './atr';
|
||||
import TrainTrunkDetail from './trainTrunkDetail';
|
||||
import parseStatus from '@/utils/parseStatus';
|
||||
|
||||
export default {
|
||||
name: 'DisplayDraft',
|
||||
components: {
|
||||
BaSiDi,
|
||||
SetTime,
|
||||
RpsDialog,
|
||||
CarPack,
|
||||
TroDialog,
|
||||
@ -109,24 +93,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.permissionOver': function () {
|
||||
this.$alert('用户权限已被收回', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
this.back();
|
||||
}
|
||||
});
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length) {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.deviceStateMessages': function (val) {
|
||||
if (val) {
|
||||
this.statusMessageNew(val);
|
||||
}
|
||||
},
|
||||
'$store.state.config.menuBarLoadedCount': function (val) { // menuBar加载完成
|
||||
this.setPosition();
|
||||
},
|
||||
@ -165,7 +131,6 @@ export default {
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
this.clearSubscribeNew();
|
||||
clearSimulation(this.group);
|
||||
this.$store.dispatch('training/reset');
|
||||
},
|
||||
async mounted() {
|
||||
@ -187,23 +152,6 @@ export default {
|
||||
EventBus.$emit('viewLoading', false);
|
||||
});
|
||||
},
|
||||
// 仿真错误时,被动退出时调用
|
||||
async back() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
async statusMessage(list) {
|
||||
if (this.$jlmap) {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
} else {
|
||||
this.$store.commit('map/updateMapDevice', list);
|
||||
}
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
async statusMessageNew(deviceStatus) {
|
||||
const list = parseStatus(deviceStatus);
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setDeviceStateMessages');
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||
@ -293,109 +241,11 @@ export default {
|
||||
const width = this.width;
|
||||
const height = this.height;
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
||||
},
|
||||
// 初始化
|
||||
initLoadData() {
|
||||
this.group = this.$route.query.group;
|
||||
this.$store.dispatch('training/reset');
|
||||
this.loadSimulationInfo();
|
||||
this.loadMapData();
|
||||
},
|
||||
// 新版地图根据仿真group获取仿真基础信息
|
||||
async loadSimulationInfo() {
|
||||
const resp = await getSimulationInfoNew(this.group);
|
||||
if (resp && resp.code == 200 && resp.data) {
|
||||
if (!resp.data.dataError) {
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断
|
||||
this.$store.dispatch('training/setInitTime', resp.data.systemTime);
|
||||
this.$store.dispatch('training/countTime');
|
||||
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
|
||||
this.planRunning = resp.data.planRunning;
|
||||
if (resp.data.planRunning) {
|
||||
this.$store.commit('training/start');
|
||||
}
|
||||
} else {
|
||||
this.$messageBox('此地图数据正在维护中,无法运行!');
|
||||
}
|
||||
this.dataError = resp.data.dataError;
|
||||
}
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
// 加载地图数据
|
||||
loadMapData() {
|
||||
if (parseInt(this.mapId)) {
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
loadMapDataById(this.mapId, 'simulation');
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
start(model) { // 开始仿真
|
||||
const data = {
|
||||
time: model.initTime
|
||||
};
|
||||
if (this.$route.query.prdType === '04') {
|
||||
data.loadNumber = model.loadNum;
|
||||
}
|
||||
ranAsPlan(data, this.group).then(res => {
|
||||
// this.$store.dispatch('training/setInitTime', model.initTime);
|
||||
this.$store.dispatch('training/setInitTime', model.timestamp);
|
||||
}).catch(error => {
|
||||
let message = '';
|
||||
switch (error.code) {
|
||||
case '5001':
|
||||
message = this.$t('error.mapDataError');
|
||||
break;
|
||||
case '5002':
|
||||
message = this.$t('error.runningChartDataError');
|
||||
break;
|
||||
case '5003':
|
||||
message = this.$t('error.runningChartIsNotLoaded');
|
||||
break;
|
||||
case '5004':
|
||||
message = this.$t('error.runningDataError');
|
||||
break;
|
||||
case '5000':
|
||||
message = this.$t('error.systemError');
|
||||
break;
|
||||
case '4000':
|
||||
message = this.$t('error.simulationDoesNotExist');
|
||||
break;
|
||||
case '4001':
|
||||
message = this.$t('error.simulationOperationIsNotDefined');
|
||||
break;
|
||||
case '4002':
|
||||
message = this.$t('error.simulationOperationProcessingMethodNotFound');
|
||||
break;
|
||||
case '4003':
|
||||
message = this.$t('error.simulationOperationFailed');
|
||||
break;
|
||||
case '4004':
|
||||
message = this.$t('error.operationConflict');
|
||||
break;
|
||||
default:
|
||||
message = '按计划行车异常,请退出重试!';
|
||||
// this.$messageBox('按计划行车异常,请退出重试!');
|
||||
break;
|
||||
}
|
||||
this.$messageBox(message + ',' + this.$t('error.startSimulationFailed'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
},
|
||||
troClick() {
|
||||
this.$refs.troDialog.doShow();
|
||||
@ -409,16 +259,6 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
.display-draft {
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
bottom: 15px;
|
||||
.button-group-box{
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.nanjing-02__systerm .el-dialog {
|
||||
background: #d8d8d8;
|
||||
|
Loading…
Reference in New Issue
Block a user