This commit is contained in:
joylink_cuiweidong 2022-08-03 11:00:48 +08:00
commit ecb9287adf
15 changed files with 864 additions and 733 deletions

View File

@ -89,10 +89,12 @@ export default {
}
});
this.$nextTick(() => {
this.subscribe();
openIndexedDB();
});
},
beforeDestroy() {
this.$store.dispatch('subscribe_un', {});
},
methods: {
resizeHandler() {
this.$store.dispatch('app/resize', { width: this._clientWidth, height: this._clientHeight });
@ -110,14 +112,6 @@ export default {
this.$store.dispatch('socket/setSimulationInvite');
this.$store.dispatch('socket/setRoomInvite');
}
},
subscribe() {
const token = getToken();
const path = window.location.pathname;
if (token && this.$route.path != '/404' && !path.endsWith('login')) {
const header = { group: '', 'X-Token': token };
this.$store.dispatch('subscribe', {header, type: getSessionStorage('project')});
}
}
}
};

View File

@ -259,7 +259,7 @@ class SkinCode extends defaultStyle {
this[deviceType.SignalButton] = {
shape: 'roundWithDock',
fillColor: '#808080',
showName: true
showName: true,
}
this[deviceType.SwitchFault] = {

View File

@ -23,7 +23,7 @@ export default class Resource extends Group {
this.create();
}
create() {
create() { // 58
const model = this.model;
this.image = new Image({
zlevel: this.zlevel,

View File

@ -37,6 +37,7 @@ export default class SignalButton extends Group {
this.z = 0
this.model = model
this.style = style
this.pressed = false
// Line
this.create()
this.setState(model)
@ -291,7 +292,6 @@ export default class SignalButton extends Group {
}
}
}
// let
// { value: 'PICK', label: '接车按钮' },
// { value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
if (!store.getters['map/checkDeviceShow'](this._code)) {
@ -308,5 +308,26 @@ export default class SignalButton extends Group {
}
}
}
pressDown(flg, color) {
if (this.pressed === flg) return
if (this.arcShapeDock1) {
if (flg) {
this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy + 2 }, z: this.z + 2, zlevel: this.zlevel })
if (color) {
this.arcShape
.animateStyle(true)
.when(0, { fill: '#69666E' })
.when(1000, { fill: color })
.when(2000, { fill: '#69666E' })
.start()
}
} else {
this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy - 2 }, z: this.z + 2, zlevel: this.zlevel })
this.arcShape.stopAnimation(true)
this.recover()
}
this.pressed = flg
}
}
getAnchorPoint() {}
}

View File

@ -487,8 +487,6 @@ export default class Switch extends Group {
if (this.model.switchFaultCode) {
const switchFault = this.mapDevice[this.model.switchFaultCode];
if (this.style.SwitchFault.lamp.switchState) {
console.log(fault)
console.log(pos)
if (pos === 'N') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.controlColor)
else if (pos === 'R') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.reverseColor)
else if (pos === 'NO') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.switchingColor)
@ -816,7 +814,6 @@ export default class Switch extends Group {
}
} else {
this.setSwitchFault(model);
console.log(model)
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉

View File

@ -110,7 +110,6 @@ export default {
window.document.oncontextmenu = function () {
return false;
};
console.log(this.mapData, '---------------');
if (this.mapData && this.mapData.skinVO) {
const parser = parserFactory(ParserType.Graph.value);
this.mapDevice = parser.parser(this.mapData, this.mapData.skinVO.code, this.map.getShowConfig());

View File

@ -141,6 +141,7 @@ export default {
},
doShow(selected, type) {
// this.$root.$emit('dialogOpen', selected);
if (!this.mapData) { this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map)); }
this.selected = selected;
this.type = type;
this.dialogShow = true;
@ -152,17 +153,14 @@ export default {
loadData() {
this.beforeSwitchList = [];
this.beforeSectionList = [];
if (this.mapData) {
this.$refs.map.loadData(this.mapData);
setTimeout(() => {
if (this.type === 'rec') {
this.clickEvent(this.selected.receivingRouteCode);
} else if (this.type === 'dep') {
this.clickEvent(this.selected.departureRouteCode);
}
}, 100);
}
this.$refs.map.loadData(this.mapData);
setTimeout(() => {
if (this.type === 'rec') {
this.clickEvent(this.selected.receivingRouteCode);
} else if (this.type === 'dep') {
this.clickEvent(this.selected.departureRouteCode);
}
}, 100);
},
doClose() {
this.loading = false;

View File

@ -110,7 +110,6 @@ export default {
window.document.oncontextmenu = function () {
return false;
};
console.log(this.mapData, '---------------');
if (this.mapData && this.mapData.skinVO) {
const parser = parserFactory(ParserType.Graph.value);
this.mapDevice = parser.parser(this.mapData, this.mapData.skinVO.code, this.map.getShowConfig());

View File

@ -225,15 +225,15 @@ export default {
components: {
PasswordBox,
DefectiveShunting,
NoticeInfo
NoticeInfo,
},
props: {
selected: {
type: Object,
default: () => {
return null
}
}
},
},
},
data() {
return {
@ -264,8 +264,9 @@ export default {
buttonName: true,
signalName: true,
switchName: true,
sectionName: true
}
sectionName: true,
},
pressedSignalButton: null,
}
},
computed: {
@ -331,7 +332,7 @@ export default {
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
}
return ''
}
},
},
watch: {
'$store.state.menuOperation.buttonOperation': function(val, old) {
@ -370,7 +371,7 @@ export default {
const station = this.$store.getters['map/getDeviceByCode'](val)
this.$store.getters['map/checkStationGuideMaster'](station.code, station.sGuideMasterLock, station.xGuideMasterLock)
}
}
},
},
beforeDestroy() {
this.routeDataMap = null
@ -385,12 +386,12 @@ export default {
over: true,
operation: data.operation,
cmdType: data.nextCmdType,
param: data.param
param: data.param,
}
} else {
operate = {
operationPre: data.operation,
operation: data.operateNext
operation: data.operateNext,
}
}
this.trainingOperation(operate)
@ -477,7 +478,7 @@ export default {
operation: this.Station.powerUnLock.button.operation,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
code: this.$store.state.map.showCentralizedStationCode,
param: { stationCode: this.$store.state.map.showCentralizedStationCode }
param: { stationCode: this.$store.state.map.showCentralizedStationCode },
}
this.$store
.dispatch('training/nextNew', operate)
@ -503,7 +504,7 @@ export default {
// S
guideLockLeftButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.leftButton.operation
operation: this.Station.stationMasterLock.leftButton.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -519,7 +520,7 @@ export default {
// X
guideLockRightButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.rightButton.operation
operation: this.Station.stationMasterLock.rightButton.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -532,17 +533,18 @@ export default {
}
})
},
buttonDown(operation, commandTypeList) {
buttonDown(operation, commandTypeList, color) {
this.clearOperate()
this.pressedSignalButton && this.pressedSignalButton.instance.pressDown(true, color)
if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation
operation: operation,
}
//
const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Section.defectiveShunting.button.operation
this.Section.defectiveShunting.button.operation,
]
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -563,7 +565,7 @@ export default {
//
const operate = {
start: true,
operation: operation
operation: operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -595,7 +597,7 @@ export default {
// OR
arrangementRouteOperation(deviceList) {
const operate = {
operation: this.Signal.arrangementRoute.button.operation
operation: this.Signal.arrangementRoute.button.operation,
}
if (!this.routeDataMap) {
this.handleRouteDataMap()
@ -672,8 +674,8 @@ export default {
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
param: {
signalCode: model._type === 'Signal' ? model.code : model.signalCode
}
signalCode: model._type === 'Signal' ? model.code : model.signalCode,
},
}
this.$store
.dispatch('training/nextNew', operate)
@ -693,7 +695,7 @@ export default {
code: model.code,
operation: this.Signal.guide.button.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: { signalCode: model.signalCode }
param: { signalCode: model.signalCode },
}
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode)
// 15s
@ -711,7 +713,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
val: model.code,
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE,
}
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code)
if (model._type === 'SignalButton' && model.type === 'PICK') {
@ -733,7 +735,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: { switchCode: code }
param: { switchCode: code },
}
this.sendCommand(operate)
},
@ -770,7 +772,7 @@ export default {
code: model.code,
operation: buttonOperation,
cmdType: '',
param: {}
param: {},
}
if (model._type === 'Signal' && !this.checkHasTrainButton(model)) {
if (buttonOperation === this.Signal.lock.button.operation) {
@ -799,7 +801,7 @@ export default {
code: model.code,
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton,
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
param: { signalCode: model.signalCode }
param: { signalCode: model.signalCode },
}
// 15s
if (signal.guideTime) {
@ -817,7 +819,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
param: { sectionCode: model.code }
param: { sectionCode: model.code },
}
this.sendCommand(operate)
}
@ -826,6 +828,10 @@ export default {
selectedChange() {
//
const model = this.selected //
if (this.pressedSignalButton /* && this.pressedSignalButton.code === model.code */) {
this.pressedSignalButton.instance.pressDown(false)
this.pressedSignalButton = null
}
if (
(this.$store.state.training.prdType != '01' && this.$store.state.training.prdType != '10') ||
this.selected._event !== MouseEvent.Left ||
@ -840,7 +846,7 @@ export default {
this.Switch.locate.button.operation,
this.Switch.reverse.button.operation,
this.Switch.block.button.operation,
this.Switch.unblock.button.operation
this.Switch.unblock.button.operation,
]
const signalButtonOperation = [
'LOCATE', //
@ -849,7 +855,9 @@ export default {
'UNLOCK', //
'BLOCK', //
'UNBLOCK', //,
'SECTION_FAULT_UNLOCK' //
'SECTION_FAULT_UNLOCK', //
'CANCEL', //
'HUMAN_RELEASE_ROUTE', //
]
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model)
@ -884,21 +892,30 @@ export default {
this.guideLockRightButtonDown()
}
} else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
this.pressedSignalButton = model
const { lamp } = model.instance.style.SwitchFault
//
if (model.type === 'LOCATE') {
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'REVERSE') {
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'], lamp.reverseColor)
} else if (model.type === 'MONOLOCK') {
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'], lamp.lockColor)
} else if (model.type === 'UNLOCK') {
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'BLOCK') {
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'], lamp.blockColor)
} else if (model.type === 'UNBLOCK') {
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'SECTION_FAULT_UNLOCK') {
this.buttonDown(this.Section.fault.button.operation, ['Section'])
//
this.buttonDown(this.Section.fault.button.operation, ['Section'], lamp.faultColor)
} else if (model.type === 'CANCEL') {
//
this.buttonDown(this.MixinCommand.totalCancel.button.operation, ['Signal', 'SignalButton'])
} else if (model.type === 'HUMAN_RELEASE_ROUTE') {
//
this.buttonDown(this.Signal.humanTrainRoute.button.operation, ['Signal', 'SignalButton'])
}
} else if (
(model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) ||
@ -930,11 +947,13 @@ export default {
this.deviceList &&
this.deviceList.length &&
this.$store.dispatch('training/updateMapState', [
{ code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 }
{ code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 },
])
this.deviceList = []
Handler.clear() //
this.$store.dispatch('menuOperation/setButtonOperation', null)
// this.pressedSignalButton && this.pressedSignalButton.instance.pressDown(false)
// this.pressedSignalButton = null
},
assistOperateOrChange(model) {
// mode.type==
@ -946,8 +965,8 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
pressDown: model.pressDown ? 0 : 1 // 10
}
pressDown: model.pressDown ? 0 : 1, // 10
},
},
//
CHANGE_DIRECTION: {
@ -956,8 +975,8 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
pressDown: model.pressDown ? 0 : 1 // 10
}
pressDown: model.pressDown ? 0 : 1, // 10
},
},
//
PICK_ASSIST: {
@ -966,8 +985,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
DEPART_ASSIST: {
@ -975,8 +994,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
ACCIDENT: {
@ -984,9 +1003,9 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
}
stationCode: model.stationCode,
},
},
}
const noPasswordModelTypeMap = {
//
@ -995,8 +1014,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_BLOCK,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
RECOVERY: {
@ -1004,9 +1023,9 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RESTORE,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
}
stationCode: model.stationCode,
},
},
}
if (noPasswordModelTypeMap[model.type]) {
const operate = {
@ -1014,7 +1033,7 @@ export default {
operation: noPasswordModelTypeMap[model.type].operation,
code: model.code,
param: noPasswordModelTypeMap[model.type].param,
cmdType: noPasswordModelTypeMap[model.type].nextCmdType
cmdType: noPasswordModelTypeMap[model.type].nextCmdType,
}
this.$store
.dispatch('training/nextNew', operate)
@ -1033,7 +1052,7 @@ export default {
const operate = {
operation: modelTypeMap[model.type].operation,
code: model.code,
param: modelTypeMap[model.type].param
param: modelTypeMap[model.type].param,
}
this.$store
.dispatch('training/nextNew', operate)
@ -1066,8 +1085,8 @@ export default {
// console.error(error);
// this.$refs.noticeInfo.doShow();
// });
}
}
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -67,7 +67,14 @@ function handleRoute(to, next, loginPath) {
}
}
}
function subscribe() {
const token = getToken();
const path = window.location.pathname;
if (token && path != '/404' && !path.endsWith('login')) {
const header = { group: '', 'X-Token': token };
store.dispatch('subscribe', {header, type: getSessionStorage('project')});
}
}
router.beforeEach( async (to, from, next) => {
if (to.query.thirdJump) {
setToken(to.query.key);
@ -99,6 +106,7 @@ router.beforeEach( async (to, from, next) => {
store.dispatch('setResourcesUrl', urlData.VOICE_API);
store.dispatch('setUploadUrl', urlData.UPLOAD_API);
store.dispatch('setBaseSite', urlData.BASE_SITE);
subscribe();
} catch (e) {
const urlData = handlerUrl();
store.dispatch('setBaseUrl', urlData.BASE_API);

View File

@ -54,7 +54,7 @@ export function creatSubscribe(topic, header) {
}
Vue.prototype.$stomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
console.error('websocket订阅失败', error, topic, header);
}
}
// 回调函数

View File

@ -159,6 +159,7 @@
</el-form>
<div class="bigDraft">
<el-button-group class="bigDraftBtn">
<el-button v-if="isModify" type="primary" size="small" :loading="loading" @click="clear ">取消更新</el-button>
<el-button v-if="isModify" type="warning" size="small" :loading="loading" @click="save ">更新进路</el-button>
<el-button v-else type="primary" size="small" :loading="loading" @click="save">保存进路</el-button>
</el-button-group>

View File

@ -50,14 +50,6 @@ export default {
lazy: true,
mapData: null,
imageLists: [
// {
// value: `${process.env.VOICE_API}/oss/2d/bj1.png`,
// label: this.$t('map.upside')
// },
// {
// value: `${process.env.VOICE_API}/oss/2d/bj2.png`,
// label: this.$t('map.hypomere')
// }
{
value: `${this.$store.state.user.resourcesUrl}/PICTURE/2022-08-01/2292-98507.png`,
label: '电流表'

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<template>
<el-dialog
title="路票"
title="簿册"
:visible="registerBookShow"
fullscreen
:before-close="doClose"
@ -124,7 +124,7 @@ export default {
this.queryData();
},
queryData() {
const params = { stationCode: this.$store.state.map.showCentralizedStationCode};
const params = { stationCode: this.$store.state.training.roleDeviceCode};
commitOperate(menuOperate.Rail.railQueryRegister, params, 3).then(({valid, operate, response})=>{
this.tableData = response.data ? response.data.lines : [];
this.dataIndex = null;
@ -133,7 +133,7 @@ export default {
});
},
saveData(data) {
const params = { stationCode: this.$store.state.map.showCentralizedStationCode, line: data };
const params = { stationCode: this.$store.state.training.roleDeviceCode, line: data };
commitOperate(menuOperate.Rail.railFillInRegister, params, 3).then(({valid, operate})=>{
this.queryData();
}).catch(()=>{