This commit is contained in:
fan 2021-02-22 18:48:31 +08:00
commit 33c76f6098
30 changed files with 182 additions and 98 deletions

View File

@ -199,13 +199,13 @@ class MouseController extends Eventful {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldDevice.instance['__down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newDevice.instance['__down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}

View File

@ -166,13 +166,13 @@ class MouseController extends Eventful {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldDevice.instance['__down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newDevice.instance['__down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}

View File

@ -176,13 +176,13 @@ class MouseController extends Eventful {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldDevice.instance['__down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newDevice.instance['__down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}

View File

@ -242,10 +242,14 @@ class SkinCode extends defaultStyle {
textBorderWidth:0, // 字体边框宽度
isSpecialType:true, // 特雷兹特殊类型
noneModeColor:'#ff0', // 无模式时字体颜色
currentModeColor:'#0f0' // 当前被控制时字体颜色
currentModeColor:'#0f0', // 当前被控制时字体颜色
dispatherColor:'#FFF', // 非当前控制 行调控制时字体颜色
centralizedColor:'#000', // 非当前控制 行值集中站控制时字体颜色
noCentralizedColor:'#1BFAEB' // 非当前控制 行值非集中站控制时字体颜色
},
kmPostShow: false, // 公里标显示
syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步
kilometerPosition: 'up', // 公里标朝向
text: {
fontSize: 11, // 字体大小

View File

@ -196,13 +196,13 @@ class MouseController extends Eventful {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldDevice.instance['__down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newDevice.instance['__down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -37,8 +39,9 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target) {
if (!this.device.__down) {
if (e &&
e.target) {
this.text.hide();
} else {
// this.device.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -39,8 +41,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -39,8 +41,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -37,8 +39,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -39,8 +41,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -29,7 +29,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LimitControl.mouseOverStyle.arcColor);
@ -40,8 +42,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.deviceStyle.mouseOverStyle.arcColor);
@ -39,8 +41,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.deviceStyle.lamp.controlColor);

View File

@ -161,7 +161,7 @@ class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (!this.device.__down) {
if (this.device.model.switchSection && this.device.model.relSwitchCode) {
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {

View File

@ -51,7 +51,7 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (!this.device.__down) {
this.nameRect.hide();
this.lampRect.hide();
this.device.lamps.forEach(elem => {

View File

@ -38,7 +38,7 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (!this.device.__down) {
if (e.target) {
this.text.hide();
}

View File

@ -511,14 +511,28 @@ export default class Station extends Group {
if (!this.isShowShape) return;
this.recover();
model.controlMode && this['handle' + model.controlMode]();
model.controller && this.handleComplexControl(model.controller);
if (this.style.Station.syncCentralizeStation && model.controlMode && model.centralized) {
// if (this.style.Station.syncCentralizeStation && model.controller && model.centralized) {
// debugger;
// model.chargeStationCodeList.forEach(item => {
// const device = store.getters['map/getDeviceByCode'](item);
// // device.controller = model.controller;
// device && device.instance && device.instance.recover();
// device && device.instance && device.instance.handleComplexControl(model.controller);
// });
// //
// }
model.controller && this.handleComplexControl(model.controller);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller) && model.centralized) {
model.chargeStationCodeList.forEach(item => {
const device = store.getters['map/getDeviceByCode'](item);
device.controlMode = model.controlMode;
device && device.instance && device.instance.recover();
device && device.instance && device.instance['handle' + model.controlMode]();
if (model.controller) {
device && device.instance && device.instance.handleComplexControl(model.controller);
} else {
device.controlMode = model.controlMode;
device && device.instance && device.instance['handle' + model.controlMode]();
}
});
}
if (model.tbStrategyId) {
@ -532,13 +546,26 @@ export default class Station extends Group {
}
handleComplexControl(controller) {
// debugger;
// store.state.user.id
// if (controller == ) {
// this.stationText.setColor(this.style.Station.stationText.currentModeColor);
// } else {
// debugger;
// }
const memberData = store.state.training.memberData;
if (memberData[controller].userId) {
if (memberData[controller].userId == store.state.user.id) {
this.stationText.setColor(this.style.Station.stationText.currentModeColor);
} else {
if (memberData[controller].type == 'DISPATCHER') {
this.stationText.setColor(this.style.Station.stationText.dispatherColor);
} else if (memberData[controller].type == 'STATION_SUPERVISOR') {
const deviceCode = memberData[controller].deviceCode;
if (deviceCode) {
const device = store.getters['map/getDeviceByCode'](deviceCode);
if (device.centralized) {
this.stationText.setColor(this.style.Station.stationText.centralizedColor);
} else {
this.stationText.setColor(this.style.Station.stationText.noCentralizedColor);
}
}
}
}
}
}
// setState(model) {

View File

@ -56,7 +56,7 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (!this.device.__down) {
if (this.style.StationStand.mouseOverStyle.standBackgroundColor) {
this.device.solidStand && this.device.solidStand.removeHover();
}

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -37,8 +39,9 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target) {
if (!this.device.__down) {
if (e &&
e.target) {
this.text.hide();
} else {
// this.device.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -103,7 +103,7 @@ class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (!this.device.__down) {
this.switchBorder && this.switchBorder.hide();
this.device.setTextStyle({
textFill: this.device.style.backgroundColor

View File

@ -114,23 +114,23 @@ class EMouse extends Group {
mouseover() {
if (this.device.model.style.Train.common.trainTip) {
this.device.deviceModel.down = true;
this.device.deviceModel.__down = true;
this.arrowText.show();
}
if (this.device.style.Train.mouseOverStyle) {
this.device.deviceModel.down = true;
this.device.deviceModel.__down = true;
this.trainBorder.show();
}
}
mouseout() {
if (this.device.model.style.Train.common.trainTip && this.device.deviceModel.down) {
if (this.device.model.style.Train.common.trainTip && this.device.deviceModel.__down) {
this.arrowText.hide();
this.device.deviceModel.down = false;
this.device.deviceModel.__down = false;
}
if (this.device.style.Train.mouseOverStyle && this.device.deviceModel.down) {
if (this.device.style.Train.mouseOverStyle && this.device.deviceModel.__down) {
this.trainBorder.hide();
this.device.deviceModel.down = false;
this.device.deviceModel.__down = false;
}
}

View File

@ -23,7 +23,7 @@ export default class TrainBody extends Group {
createMouse() {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
if (this.deviceModel.down) {
if (this.deviceModel.__down) {
store.dispatch('map/setTrainDetails', this.deviceModel);
this.mouseEvent.mouseover();
}
@ -303,7 +303,7 @@ export default class TrainBody extends Group {
removeTrainDetail() {
this.mouseEvent.mouseout();
store.dispatch('map/setTrainDetails', null);
this.deviceModel.down = false;
this.deviceModel.__down = false;
}
setTrainColor(color) {
this.trainBodyBox && this.trainBodyBox.setColor('fill', color);

View File

@ -29,7 +29,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.ZcControl.mouseOverStyle.arcColor);
@ -40,8 +42,10 @@ export default class EMouse extends Group {
}
mouseout(e) {
if (!this.device.model.down) {
if (e.target && e.target._subType == 'Text') {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);

View File

@ -78,7 +78,6 @@ export default {
this.selected &&
this.selected.instance &&
this.selected.instance.mouseEvent) {
this.selected.instance.__over = true;
this.selected.instance.mouseEvent.mouseover();
}
})
@ -88,7 +87,7 @@ export default {
this.selected &&
this.selected.instance &&
this.selected.instance.mouseEvent) {
this.selected.instance.__over = false;
this.selected.instance.__down = false;
this.selected.instance.mouseEvent.mouseout();
this.$jlmap.clearEvent();
}

View File

@ -7,7 +7,7 @@ export function mouseCancelState(selected) {
const device = Vue.prototype.$jlmap.getDeviceByCode(selected.code);
const instance = (device || {}).instance;
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
device['down'] = false;
device.instance['__down'] = false;
instance.mouseEvent.mouseout(Vue.prototype.$jlmap.$zr.curEvent);
}
}

View File

@ -103,6 +103,7 @@ export default {
this.selected.instance &&
this.selected.instance.mouseEvent) {
this.selected.instance.__over = false;
this.selected.instance.__down = false;
this.selected.instance.mouseEvent.mouseout();
this.$jlmap.clearEvent();
}

View File

@ -706,7 +706,7 @@ export default {
trainingType: 'Signal',
productTypes: ['01', '02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【人解列车进路】' },
{ deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【人工解锁进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '305', tip: '鼠标左键点击【确定】按钮' }
]
},

View File

@ -1344,9 +1344,6 @@ export default {
if (list && list.length) {
this.checkRoleChange(list);
}
},
'$store.state.training.simulationUserList':function(list) {
debugger;
}
},
@ -1356,8 +1353,15 @@ export default {
methods: {
checkRoleChange(list) {
list.forEach(item => {
if ((item.messageType === 'PLAY_CHANGE' || item.messageType == 'ONLINE') && item.userId == this.userId ) {
// || item.messageType == 'ONLINE'
if ((item.messageType === 'PLAY_CHANGE') && item.userId == this.userId ) {
if (item.memberId && item.type) {
// this.$store.dispatch('training/setCurrentRoleInfo', {memberId:item.memberId,type:item.type,deviceCode:});
}
// currentRole
// this.$store.state;
// this.switchShowStation(this.centralizedMap[item.deviceCode]);
// "memberId":"1","type":"DISPATCHER","deviceCode":"Station10002"
}
});
},

View File

@ -2,7 +2,7 @@
<el-dialog
v-dialogDrag
class="ningbo-01__systerm station-control"
title="下站控"
title="下站控"
:visible.sync="show"
width="500px"
:before-close="doClose"
@ -12,18 +12,18 @@
:close-on-click-modal="false"
>
<el-table :id="domIdChoose" ref="table" :data="centralizedStaionList" style="width: 100%;" height="320px" highlight-current-row @current-change="handleCurrentChange">
<el-table-column prop="name" label="控制区域" />
<el-table-column label="用户Id" />
<el-table-column label="授权范围" />
</el-table>
<el-table :id="domIdChoose" ref="table" :data="centralizedStaionList" style="width: 100%;" height="320px" highlight-current-row @current-change="handleCurrentChange">
<el-table-column prop="name" label="控制区域" />
<el-table-column label="用户Id" />
<el-table-column label="授权范围" />
</el-table>
<div class="message" style="color:#ff0000;font-size:14px;margin-left:10px">{{ message }}</div>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit(true)">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="status" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdApply" :disabled="status" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -45,7 +45,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StationControl',
components: {
NoticeInfo
NoticeInfo
},
data() {
return {
@ -104,11 +104,18 @@ export default {
watch: {
'selected': function(val) {
if (val) {
const sationEle = this.$store.getters['map/getDeviceByCode'](val.code);
if (this.prdType == '02') {
this.status = sationEle && sationEle.controlMode != 'Center';
} else {
this.status = sationEle && sationEle.controlMode == 'Center';
const stationEle = this.$store.getters['map/getDeviceByCode'](val.code);
if (stationEle) {
if (stationEle.controller) {
const memberData = this.$store.state.training.memberData;
if (memberData[stationEle.controller].userId == this.$store.state.user.id) {
this.status = false;
} else {
this.status = true;
}
} else {
this.status = true;
}
}
}
}
@ -116,15 +123,17 @@ export default {
methods: {
doShow() {
this.message = '';
this.dialogShow = true;
this.$nextTick(e => {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
})
this.dialogShow = true;
this.$nextTick(e => {
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$refs.table.setCurrentRow();
this.dialogShow = false;
this.status = true;
this.$store.dispatch('menuOperation/setSelected', {device: {}});
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('socket/shiftMsgQueue');
},
@ -165,7 +174,8 @@ export default {
param: {stationCode:val.code}
};
steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL;
// steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL;
steps.cmdType = CMD.Station.CMD_STATION_CONTROL_DEVOLVE;
this.$store.dispatch('training/nextNew', steps).then(({ valid }) => {
if (valid) {

View File

@ -106,12 +106,17 @@ export default {
watch: {
'selected': function(val) {
if (val) {
const sationEle = this.$store.getters['map/getDeviceByCode'](val.code);
if (sationEle) {
if (sationEle.controller != this.$store.state.user.id) {
this.status = false;
const stationEle = this.$store.getters['map/getDeviceByCode'](val.code);
if (stationEle) {
if (stationEle.controller) {
const memberData = this.$store.state.training.memberData;
if (memberData[stationEle.controller].userId == this.$store.state.user.id) {
this.status = true;
} else {
this.status = false;
}
} else {
this.status = true;
this.status = false;
}
}
}
@ -128,6 +133,8 @@ export default {
},
doClose() {
this.dialogShow = false;
this.status = true;
this.$store.dispatch('menuOperation/setSelected', {device: {}});
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('socket/shiftMsgQueue');
@ -169,7 +176,6 @@ export default {
param: {stationCodes:[val.code]}
};
// CMD_STATION_CONTROL_TRANSFER
// CMD_STATION_CONTROL_DEVOLVE
// CMD_STATION_CONTROL_REVOKE
// steps.cmdType = this.status ? CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL : CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL;
steps.cmdType = CMD.Station.CMD_STATION_CONTROL_APPLY;
@ -177,7 +183,6 @@ export default {
this.$store.dispatch('training/nextNew', steps).then(({ valid }) => {
if (valid) {
if (isClose) {
this.$store.dispatch('menuOperation/setSelected', {device: {}});
this.doClose();
}
this.$emit('commandSuccess', val.code);

View File

@ -5,7 +5,7 @@ export default {
const device = this.$jlmap.getDeviceByCode(selected.code);
const instance = (device || {}).instance;
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
device['down'] = false;
device.instance['__down'] = false;
instance.mouseEvent.mouseout(this.$jlmap.$zr.curEvent);
}
}