Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2023-02-15 16:38:15 +08:00
commit 00a1137a9a
6 changed files with 292 additions and 3 deletions

View File

@ -894,6 +894,11 @@ export const menuOperate = {
modifyDispatcherLogerRpDirection:{
operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation,
cmdType: CMD.CTC.CTC_ZONE_SAVE_DIRECTION
},
// 状态切换操作
switchRouteSetModel:{
operation: OperationEvent.CTCCommand.switchRouteSetModel.confirm.operation,
cmdType: CMD.CTC.CTC_SWITCH_ROUTE_SET_MODEL
}
},
Rail: {

View File

@ -33,7 +33,7 @@
<div style="width: 200px;height: 25px;border: 2px #D1D1D1 inset;line-height: 21px;text-align: center;margin-left: 5px;">与中心通信正常</div>
</div>
</div>
<menu-button-ctc ref="menuButtonCtc" :selected="selected" />
<menu-button-ctc ref="menuButtonCtc" :selected="selected" :work="'ctcWork'" />
<menu-station-stand ref="menuStationStand" :selected="selected" :work="'ctcWork'" />
<menu-switch ref="menuSwitch" :selected="selected" :work="'ctcWork'" />
<menu-signal ref="menuSignal" :selected="selected" :work="'ctcWork'" />

View File

@ -0,0 +1,250 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm updateTrip"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="tableBox">
<el-table :data="tableData" height="300px">
<el-table-column prop="name" label="站名" width="150" />
<el-table-column>
<template slot="header" slot-scope="scope">
<el-checkbox v-model="planControlChecked" @change="changePlanControlChecked">全选</el-checkbox>
</template>
<template slot-scope="scope">
<el-checkbox v-model="scope.row.planControl">计划控制</el-checkbox>
</template>
</el-table-column>
<el-table-column>
<template slot="header" slot-scope="scope">
<el-radio v-model="allRouteSet" label="Plan_Set_Route" @input="changeAllRouteSet">全选</el-radio>
</template>
<template slot-scope="scope">
<el-radio v-model="scope.row.routeSetMode" label="Plan_Set_Route">
<span :class="isRouteSetMode(scope.row.code, 'Plan_Set_Route') ? 'redText' : ''">按图排路</span>
</el-radio>
</template>
</el-table-column>
<el-table-column>
<template slot="header" slot-scope="scope">
<el-radio v-model="allRouteSet" label="Manual_Set_Route" @input="changeAllRouteSet">全选</el-radio>
</template>
<template slot-scope="scope">
<el-radio v-model="scope.row.routeSetMode" label="Manual_Set_Route">
<span :class="isRouteSetMode(scope.row.code, 'Manual_Set_Route') ? 'redText' : ''">手工排路</span>
</el-radio>
</template>
</el-table-column>
</el-table>
</div>
<div class="button-group">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</div>
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { UserOperationType } from '@/scripts/ConstDic';
import { mapGetters } from 'vuex';
export default {
name: 'StatusSelect',
components: {
NoticeInfo
},
props: {
work: {
type: String,
default: () => {
return 'ctcWork';
}
}
},
data() {
return {
dialogShow: false,
tableData: [],
mapTableData: {},
planControlChecked: false,
allRouteSet: '',
loading: false
};
},
computed: {
...mapGetters('map', ['stationList']),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.CTCCommand.switchRouteSetModel.cancel.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.CTCCommand.switchRouteSetModel.confirm.domId : '';
},
title() {
return '状态选择';
},
roleDeviceCode() {
return this.$store.state.training.roleDeviceCode;
}
},
watch: {
tableData: {
handler: function() {
const hasTableData = !!this.tableData.length;
const planControlEvery = hasTableData && this.tableData.every(item => {
return item.planControl;
});
this.planControlChecked = planControlEvery;
const planSetRouteEvery = hasTableData && this.tableData.every(item => {
return item.routeSetMode == 'Plan_Set_Route';
});
const manualSetRouteEvery = hasTableData && this.tableData.every(item => {
return item.routeSetMode == 'Manual_Set_Route';
});
this.allRouteSet = planSetRouteEvery ? 'Plan_Set_Route' : (manualSetRouteEvery ? 'Manual_Set_Route' : '');
},
deep: true
}
},
methods: {
changePlanControlChecked() {
this.tableData.forEach(item => {
this.$set(item, 'planControl', this.planControlChecked);
});
},
changeAllRouteSet() {
this.tableData.forEach(item => {
this.$set(item, 'routeSetMode', this.allRouteSet);
});
},
isRouteSetMode(code, key) {
let s = false;
const obj = this.mapTableData[code];
if (obj && obj.routeSetMode == key) {
s = true;
}
return s;
},
doShow() {
this.getTableData();
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
getTableData() {
const mList = [];
this.mapTableData = {};
let list = this.stationList;
if (this.work == 'ctcWork') {
const roleDeviceInfo = this.$store.getters['map/getDeviceByCode'](this.roleDeviceCode);
if (roleDeviceInfo) {
list = [roleDeviceInfo];
}
}
const localArr = ['Station'];
list.forEach(item => {
const obj = this.$store.getters['map/getDeviceByCode'](item.code);
if (obj && localArr.includes(obj.operationMode)) {
const param = {
code: obj.code,
name: obj.name,
routeSetMode: obj.routeSetMode,
planControl: obj.planControl
};
mList.push(param);
this.mapTableData[obj.code] = {
...param
};
}
});
this.tableData = mList;
},
getChangeInfoList() {
const list = [];
this.tableData.forEach(item => {
const obj = this.mapTableData[item.code];
if (obj) {
const param = {};
const difArr = ['routeSetMode', 'planControl'];
difArr.forEach(key => {
if (item[key] != obj[key]) {
param[key] = item[key];
}
});
if (Object.keys(param).length) {
list.push({
...param,
stationCode: item.code
});
}
}
});
return list;
},
commit() {
const list = this.getChangeInfoList();
console.log('🚀 ~ file: statusSelect.vue:154 ~ commit ~ list', list);
if (list.length) {
const operate = {
over: true,
operation: menuOperate.CTC.switchRouteSetModel.operation,
userOperationType: UserOperationType.LEFTCLICK,
cmdType: menuOperate.CTC.switchRouteSetModel.cmdType,
param: {
routeSetModeParams: list
}
};
this.loading = true;
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.loading = false;
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
}
},
cancel() {
const operate = {
userOperationType: UserOperationType.LEFTCLICK,
operation: OperationEvent.CTCCommand.switchRouteSetModel.cancel.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.doClose();
}
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.tableBox {
padding-bottom: 10px;
}
.button-group {
text-align: center;
}
.redText {
color: red;
}
</style>

View File

@ -96,7 +96,7 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="444" class="button_box" @click="buttonDown()">
<button :id="CTCCommand.switchRouteSetModel.menu.domId" class="button_box" @click="statusSelectBtn">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
@ -114,6 +114,7 @@
<train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<fork-directive ref="forkDirective" />
<statusSelect ref="statusSelect" :work="work" />
</div>
</template>
@ -132,6 +133,7 @@ import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
import {UserOperationType} from '../../../../scripts/ConstDic';
import ForkDirective from './dialog/forkDirective';
import StatusSelect from './dialog/statusSelect';
export default {
name: 'MapButtonMenu',
components: {
@ -141,6 +143,7 @@ export default {
PopMenu,
TrainRoute,
ShuntRoute,
StatusSelect,
ForkDirective
},
props: {
@ -149,6 +152,12 @@ export default {
default: () => {
return null;
}
},
work: {
type: String,
default: () => {
return 'ctcWork';
}
}
},
data() {
@ -377,6 +386,16 @@ export default {
}
}
},
statusSelectBtn() {
const operate = {
operation: OperationEvent.CTCCommand.switchRouteSetModel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.$refs.statusSelect.doShow();
}
});
},
buttonDown(operation, commandTypeList) {
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
if (!station || station.controlMode === 'Interlock') { return; }

View File

@ -491,7 +491,8 @@ export default {
CTC_QUERY_DISPATCH_COMMAND:{value:'CTC_QUERY_DISPATCH_COMMAND', label: '调度台命令查询'},
CTC_SEND_DISPATCH_COMMAND:{value:'CTC_SEND_DISPATCH_COMMAND', label: '调度台命令下达'},
CTC_SIGN_DISPATCH_COMMAND:{value:'CTC_SIGN_DISPATCH_COMMAND', label: '调度台命令签收'},
CTC_READ_DISPATCH_COMMAND:{value:'CTC_READ_DISPATCH_COMMAND', label: '调度台命令已读'}
CTC_READ_DISPATCH_COMMAND:{value:'CTC_READ_DISPATCH_COMMAND', label: '调度台命令已读'},
CTC_SWITCH_ROUTE_SET_MODEL:{value:'Station_Switch_Route_Set_Model', label: '状态切换操作'}
},
RAIL: {

View File

@ -4226,6 +4226,20 @@ export const OperationEvent = {
operation: 'a062',
domId: '_Tips-CTC-loadUpdateStationTrainFixedPath-Menu{TOP}'
}
},
switchRouteSetModel: {
menu: {
operation: 'a063',
domId: '_Tips-CTC-switchRouteSetModel-menu{TOP}'
},
confirm: {
operation: 'a064',
domId: '_Tips-CTC-switchRouteSetModel-confirm'
},
cancel: {
operation: 'a065',
domId: '_Tips-CTC-switchRouteSetModel-cancel'
}
}
// CTC_ZONE_SAVE_TRIP_NUMBER
// CTC_ZONE_SAVE_STATION