Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2019-10-16 16:25:05 +08:00
commit f9a3461c63
23 changed files with 277 additions and 69 deletions

View File

@ -238,3 +238,12 @@ export function getPermissionJoint(group) {
} }
}); });
} }
//
export function setRealDevice(group, data) {
return request({
url: `/api/jointTraining/room/realDevice?group=${group}`,
method: 'post',
data: data
});
}

View File

@ -122,3 +122,11 @@ export function getPublishMapDetailList(params, code) {
params: params params: params
}); });
} }
/** 获取有屏蔽门的站台列表*/
export function hasDoorStationList(mapId) {
return request({
url: `/api/map/${mapId}/stand/hasDoor`,
method: 'get'
});
}

View File

@ -408,3 +408,20 @@ export function schedulingNotify(params) {
params params
}); });
} }
/** 获取PLC网关 */
export function getPlcGateway(group) {
return request({
url: `/api/simulation/${group}/plcGateway`,
method: 'get'
});
}
/** 处理ibp盘事件 */
export function handlerIbpEvent(group, data) {
return request({
url: `/api/simulation/${group}/ibp/event`,
method: 'post',
data: data
});
}

View File

@ -13,10 +13,10 @@ export default {
forcedStationControl: 'Forced Station Control', forcedStationControl: 'Forced Station Control',
toCentralControl: 'Switch Central Control', toCentralControl: 'Switch Central Control',
requestOperationArea: 'RequestOperationArea', requestOperationArea: 'RequestOperationArea',
historyQuery: 'HistoryQuery', historyQuery: 'History',
userManage: 'UserManage', userManage: 'Users',
help: 'Help', help: 'Help',
about: 'ControlMonitor(A)', about: 'About ControlMonitor(A)',
planCarOperation: 'PlanCarOperation', planCarOperation: 'PlanCarOperation',
addPlanCar: 'Add Plan Car', addPlanCar: 'Add Plan Car',
panPlanCar: 'Pan Plan Car', panPlanCar: 'Pan Plan Car',
@ -184,8 +184,8 @@ export default {
confirm: 'Confirm', confirm: 'Confirm',
close: 'Close', close: 'Close',
jobNumber: 'JobNumber:', jobNumber: 'Staff ID:',
userName: 'User Name:', userName: 'Name:',
password: 'Password:', password: 'Password:',
confirmPassword: 'Confirm Password:', confirmPassword: 'Confirm Password:',
inputJobNumber: 'Please enter job number', inputJobNumber: 'Please enter job number',
@ -220,14 +220,14 @@ export default {
about: 'About ControlMonitor', about: 'About ControlMonitor',
userList: 'User List', userList: 'User List',
jobNumber: 'JobNumber', jobNumber: 'Staff ID',
userName: 'UserName', userName: 'Name',
refresh: 'Refresh', refresh: 'Refresh',
add: 'Add', add: 'Add',
modify: 'Modify', modify: 'Modify',
delete: 'Delete', delete: 'Delete',
cancel: 'Cancel', cancel: 'Cancel',
userManage: 'User Manage', userManage: 'Users',
selectUser: 'Please select a user first', selectUser: 'Please select a user first',
deleteMessageOne: 'Are you sure to delete user', deleteMessageOne: 'Are you sure to delete user',
deleteMessageTwo: '?', deleteMessageTwo: '?',
@ -301,9 +301,9 @@ export default {
trainIDDisplaySetting: 'Train ID Display Setting', trainIDDisplaySetting: 'Train ID Display Setting',
plantrainDisplayMode: 'Plan train Display Mode', plantrainDisplayMode: 'Plan train Display Mode',
serviceNumber: 'Service Number', serviceNumber: 'Table No. ',
tripNumber: 'Train Number', tripNumber: 'Train Trip No.',
groupNumber: 'Group Number', groupNumber: 'Train No.',
targetNumber: 'Target Number', targetNumber: 'Target Number',
headCodeStationDisplayMode: 'Head Code Train Display Mode', headCodeStationDisplayMode: 'Head Code Train Display Mode',
fontSize: 'Font Size', fontSize: 'Font Size',
@ -317,8 +317,8 @@ export default {
stopTime: 'Stop time', stopTime: 'Stop time',
departureTime: 'Departure time', departureTime: 'Departure time',
runLevel: 'Run level', runLevel: 'Run level',
serviceNumber: 'Service number', serviceNumber: 'Table No.',
tripNumber: 'Trip number', tripNumber: 'Train Trip No.',
stationName: 'Station name:', stationName: 'Station name:',
stationKilometerMark: 'Station kilometer mark:', stationKilometerMark: 'Station kilometer mark:',
arrivalTime2: 'Arrival time:', arrivalTime2: 'Arrival time:',
@ -479,7 +479,7 @@ export default {
switch: 'Switch', switch: 'Switch',
activation: 'Activation', activation: 'Activation',
resection: 'Resection', resection: 'Resection',
groupNumber: 'Group number', groupNumber: 'Train No.',
planTrain: 'Plan train', planTrain: 'Plan train',
headCodeTrain: 'Head code train', headCodeTrain: 'Head code train',
artificialTrain: 'Artificial train', artificialTrain: 'Artificial train',

View File

@ -27,7 +27,7 @@ export default {
createTime: 'Creation Time', createTime: 'Creation Time',
detail: 'Detail', detail: 'Detail',
generateRunPlan: 'Generate Daily Plan', generateRunPlan: 'Generate Daily Plan',
generateRunjihua: 'Generate general shift schedule', generateRunjihua: 'Generate General Shift Schedule',
selectTemplateRunPlan: 'Select Template Run Plan', selectTemplateRunPlan: 'Select Template Run Plan',
pleaseSelectTemplate: 'Please Select Template Run Plan', pleaseSelectTemplate: 'Please Select Template Run Plan',
selectMap: 'Select Map', selectMap: 'Select Map',
@ -55,6 +55,7 @@ export default {
publishVersion: 'Version', publishVersion: 'Version',
lessonDeleteBtn: 'Delete', lessonDeleteBtn: 'Delete',
durationMinutes: ' minutes', durationMinutes: ' minutes',
copyRunPlan: 'Copy run plan',
testDefinitionMaking: 'Test Definition Making', testDefinitionMaking: 'Test Definition Making',
examRuleMaking: 'Exam Rule Making', examRuleMaking: 'Exam Rule Making',

View File

@ -14,7 +14,7 @@ export default {
createScriptSuccess: 'Create script success', createScriptSuccess: 'Create script success',
createScriptFail: 'Create script failure', createScriptFail: 'Create script failure',
scriptDetail: 'Script Detail', scriptDetail: 'Script Detail',
scriptRecord: 'Record', scriptRecord: 'Edit',
scriptModify: 'Modify', scriptModify: 'Modify',
scriptDelete: 'Delete', scriptDelete: 'Delete',
getScriptFail: 'Get script information failure', getScriptFail: 'Get script information failure',
@ -40,7 +40,7 @@ export default {
resetDataFail: 'Reset script failure', resetDataFail: 'Reset script failure',
allRoles: 'All Roles', allRoles: 'All Roles',
actors: 'Actors', actors: 'Actor Role',
roleSexMale: 'Male', roleSexMale: 'Male',
roleSexFemale: 'Female', roleSexFemale: 'Female',
selectScriptActorSuccess: 'Select script actor success', selectScriptActorSuccess: 'Select script actor success',
@ -50,9 +50,9 @@ export default {
modifyScriptActorSexSuccess: 'Modify script actor sex success', modifyScriptActorSexSuccess: 'Modify script actor sex success',
modifyScriptActorSexFail: 'Modify script actor sex failure', modifyScriptActorSexFail: 'Modify script actor sex failure',
addConversition: 'Add Conversition', addConversition: 'Add Dialogue',
narrator: 'Narrator', narrator: 'Sender',
narratorRules: 'Please select narrator', narratorRules: 'Please select Sender',
receiver: 'Receiver', receiver: 'Receiver',
receiverRules: 'Please select receiver', receiverRules: 'Please select receiver',
conversitionContent: 'Content', conversitionContent: 'Content',
@ -67,12 +67,12 @@ export default {
endStationRules: 'Please select end station', endStationRules: 'Please select end station',
addCommandButton: 'Add Command', addCommandButton: 'Add Command',
addConversitionButton: 'Add Conversition', addConversitionButton: 'Add Dialogue',
conversitionContentRules: 'Please input content', conversitionContentRules: 'Please input content',
addCommandSucess: 'Add command sucess', addCommandSucess: 'Add command sucess',
addCommandFail: 'Add command failure', addCommandFail: 'Add command failure',
addConversitionSuccess: 'Add conversition success', addConversitionSuccess: 'Add dialogue success',
addConversitionFail: 'Add conversition failure', addConversitionFail: 'Add dialogue failure',
modifyConversitionSuccess: 'Modify conversition success', modifyConversitionSuccess: 'Modify conversition success',
modifyConversitionFail: 'Modify conversition failure', modifyConversitionFail: 'Modify conversition failure',
modifyConversition: 'Modify Conversition', modifyConversition: 'Modify Conversition',

View File

@ -25,5 +25,7 @@ export default {
sending: 'sending...', sending: 'sending...',
holdAndTalk: 'Hold and talk', holdAndTalk: 'Hold and talk',
recording: 'recording...', recording: 'recording...',
sendText: 'Send text' sendText: 'Send text',
left: 'left',
right: 'right'
}; };

View File

@ -25,5 +25,7 @@ export default {
sending: '发送中...', sending: '发送中...',
holdAndTalk: '按住说话', holdAndTalk: '按住说话',
recording: '录音中...', recording: '录音中...',
sendText: '发送文字' sendText: '发送文字',
left: '左',
right: '右'
}; };

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ class IbpPan {
this.methods = opts.methods; this.methods = opts.methods;
// 鼠标事件 // 鼠标事件
this.events = { __Pan: 'pan', Contextmenu: 'contextmenu'}; this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu'};
// 设备数据 // 设备数据
this.ibpDevice = {}; this.ibpDevice = {};
@ -180,7 +180,22 @@ class IbpPan {
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); } if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
} }
setStatus(code, model) {
const oDevcie = this.ibpDevice[code].instance;
oDevcie.setStatus(model);
}
setDeviceStatus(list) {
const deviceList = Object.values(this.ibpDevice);
console.log(list, deviceList);
deviceList.forEach(elem =>{
(list || []).forEach(it =>{
if (elem.model.linkDevice === it.code) {
elem.instance.setStatus(it);
}
});
});
}
drawIbpInit() { drawIbpInit() {
this.$mouseController.setAllowDragging(true); this.$mouseController.setAllowDragging(true);
} }

View File

@ -13,6 +13,7 @@ class EventModel {
if (Object.values(deviceType).includes(view._type)) { if (Object.values(deviceType).includes(view._type)) {
this.deviceCode = view._code; this.deviceCode = view._code;
this.deviceType = view._type; this.deviceType = view._type;
this.deviceModel = view.model;
this.eventTarget = view; this.eventTarget = view;
break; break;
} }
@ -36,6 +37,7 @@ class MouseController extends Eventful {
if (zr) { if (zr) {
zr.on('contextmenu', this.contextmenu, this); zr.on('contextmenu', this.contextmenu, this);
zr.on('mousemove', this.moveEvent, this); zr.on('mousemove', this.moveEvent, this);
zr.on('click', this.click, this);
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
@ -62,6 +64,7 @@ class MouseController extends Eventful {
}; };
this.dispose = function () { this.dispose = function () {
zr.off('click', this.click);
zr.off('contextmenu', this.contextmenu); zr.off('contextmenu', this.contextmenu);
zr.off('mousemove', this.moveEvent); zr.off('mousemove', this.moveEvent);
this.disable(); this.disable();
@ -141,7 +144,10 @@ class MouseController extends Eventful {
var em = this.checkEvent(e); var em = this.checkEvent(e);
this.trigger(this.events.Contextmenu, em); this.trigger(this.events.Contextmenu, em);
} }
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
}
moveEvent(e) { moveEvent(e) {
const newEm = new EventModel(e); const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails; const trainDetails = store.state.map.trainDetails;

View File

@ -86,20 +86,20 @@ export default class button extends Group {
} }
onclick() { onclick() {
if (!this.model.draggable) { // if (!this.model.draggable) {
switch (this.model.status) { // switch (this.model.status) {
case 'off': { // case 'off': {
this.open(); // this.open();
this.model.status='on'; // this.model.status='on';
break; // break;
} // }
case 'on': { // case 'on': {
this.close(); // this.close();
this.model.status='off'; // this.model.status='off';
break; // break;
} // }
} // }
} // }
} }
// 关闭 // 关闭
close() { close() {

View File

@ -10,7 +10,7 @@ export default class CircularLamp extends Group {
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.z; this.z = device.model.z;
this.create(); this.create();
this.setStatus(this.model); // this.setStatus(this.model);
} }
create() { create() {
@ -39,9 +39,9 @@ export default class CircularLamp extends Group {
this.lamp.setStyle({fill: color}); this.lamp.setStyle({fill: color});
} }
setStatus(model) { setStatus(model) {
if (model.switch === 'on') { if ( model.holdStatus === '02'|| model.holdStatus === '03'|| model.holdStatus === '04') {
this.setCircularLampColor('#D8FCF2'); this.setCircularLampColor('#D8FCF2');
} else { } else if (model.holdStatus === '01') {
this.setCircularLampColor('#332C22'); this.setCircularLampColor('#332C22');
} }
} }

View File

@ -1,3 +1,4 @@
import LangStorage from '@/utils/lang';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
@ -54,6 +55,8 @@ class ESwName extends Group {
} }
}); });
const data=LangStorage.getLang() == 'en'?'Turnout section':'道岔区段名称';
this.arrowText = new Text({ this.arrowText = new Text({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z + 20, z: model.z + 20,
@ -63,9 +66,9 @@ class ESwName extends Group {
fontSize: style.arrowFontSize, fontSize: style.arrowFontSize,
fontWeight: style.Switch.text.fontWeight, fontWeight: style.Switch.text.fontWeight,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: `道岔区段名称: ${model.sectionName}`, text: `${data}: ${model.sectionName}`,
textFill: '#000', textFill: '#000',
textAlign: 'letf', textAlign: 'left',
textPadding: 3, textPadding: 3,
textBackgroundColor: style.tipBackgroundColor textBackgroundColor: style.tipBackgroundColor
} }

View File

@ -11,11 +11,11 @@ class EMouse extends Group {
create() { create() {
let destinationText = ''; let destinationText = '';
switch (this.device.model.destinationStatus) { switch (this.device.model.destinationStatus) {
case '01': destinationText = LangStorage.getLang() == 'en' ? 'fiducial point' : '准点'; break; case '01': destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点'; break;
case '02': destinationText = LangStorage.getLang() == 'en' ? 'soon' : '早点'; break; case '02': destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点'; break;
case '03': destinationText = LangStorage.getLang() == 'en' ? 'Severe early' : '严重早点'; break; case '03': destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点'; break;
case '04': destinationText = LangStorage.getLang() == 'en' ? 'behind schedule' : '晚点'; break; case '04': destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点'; break;
case '05': destinationText = LangStorage.getLang() == 'en' ? 'Serious delays' : '严重晚点'; break; case '05': destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点'; break;
default: destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知'; break; default: destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知'; break;
} }
let trainType = ''; let trainType = '';
@ -27,7 +27,7 @@ class EMouse extends Group {
} }
let text = ''; let text = '';
if (LangStorage.getLang() == 'en') { if (LangStorage.getLang() == 'en') {
text = ` The train type: ${trainType} \n table number: ${this.device.model.serviceNumber} \n Train no: ${this.device.model.tripNumber}\n Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n The number of: ${this.device.model.groupNumber}\n Point in the morning and evening: ${destinationText}\n moving direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew: \n The station name: \n The terminal name: \n Take up the orbit: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n In the station: \n train-ground communication: normal \n Run level: 4 \n Button vehicle state: ${this.device.model.runControlStatus == '01' ? 'normal' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n Stationary state: ${this.device.model.runStatus == '02' ? 'Has not stopped' : 'come to a standstill'}\n blocked state: no \n train speed: ${this.device.model.speed || 0} km/h \n Authorized distance of train movement: ${this.device.model.maLen || 0} m`; text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n train-ground communication: normal \n Operational Mode: 4 \n Detained: ${this.device.model.runControlStatus == '01' ? 'normal' : this.device.model.runControlStatus == '03' ? 'Jump' : 'Detain'}\n Stationary: ${this.device.model.runStatus == '02' ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else { } else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
} }

View File

@ -711,7 +711,7 @@ export default {
$height: 30px; $height: 30px;
$menuPadding: 10px; $menuPadding: 10px;
$menuItemHeight: 30px; $menuItemHeight: 30px;
$menuItemWidth: 180px; $menuItemWidth: 190px;
$menuItemPadding: 5px; $menuItemPadding: 5px;
#menuBar { #menuBar {

View File

@ -80,7 +80,7 @@ export default {
{label: '行值', value: 'Attendant', enLabel: 'Attendant '}, {label: '行值', value: 'Attendant', enLabel: 'Attendant '},
{label: '观众', value: 'Audience', enLabel: 'Audience '}, {label: '观众', value: 'Audience', enLabel: 'Audience '},
{label: '司机', value: 'Driver', enLabel: 'Driver '}, {label: '司机', value: 'Driver', enLabel: 'Driver '},
{label: '通号', value: 'Repair', enLabel: 'Repair '} {label: '通号', value: 'Repair', enLabel: 'Repairman '}
], ],
SimulationType: [ SimulationType: [

View File

@ -1,3 +1,12 @@
/**
* 真实设备类型
*/
export const RealDeviceType = {
Section: '区段',
Switch: '道岔',
Signal: '信号机',
ScreenDoor: '屏蔽门'
};
/** /**
* 权限类型 * 权限类型
*/ */
@ -2174,3 +2183,12 @@ export function checkOperationIsCurrentOperate(operation, operate) {
} }
} }
} }
/**
* ibp操作
*/
export const IbpOperation = {
Up_Hold_Train: {operate: '01', status: 'on'},
Up_Cancel_Hold_Train: {operate: '02', status: 'off'},
Down_Hold_Train: {operate: '03', status: 'on'},
Down_Cancel_Hold_Train: {operate: '04', status: 'off'}
};

View File

@ -88,6 +88,9 @@ function handle(state, data) {
case 'Simulation_Quest_Finish': // 任务结束标志 case 'Simulation_Quest_Finish': // 任务结束标志
state.tipOperateCount++; state.tipOperateCount++;
break; break;
case 'JointTraining_Device':
handleDeviceInfo(state, msg);
break;
case 'Simulation_Control_Pause': // 暂停中 case 'Simulation_Control_Pause': // 暂停中
store.dispatch('scriptRecord/updateSimulationPause', msg); store.dispatch('scriptRecord/updateSimulationPause', msg);
} }
@ -182,6 +185,11 @@ function handleUserinfo(state, data) {
state.roleInfo = data; state.roleInfo = data;
} }
} }
function handleDeviceInfo(state, data) {
if (data) {
state.deviceInfo = data;
}
}
function handleMessageInfo(state, type, data) { function handleMessageInfo(state, type, data) {
const message = { const message = {
join: true, join: true,
@ -275,7 +283,8 @@ const socket = {
permissionOver: {}, // 权限结束 permissionOver: {}, // 权限结束
tipOperateCount: 0 // 任务结束提示消息 tipOperateCount: 0, // 任务结束提示消息
deviceInfo: [] // 真实设备信息
}, },
getters: { getters: {

View File

@ -13,6 +13,8 @@ import ibpData from '@/ibp/constant/ibpData';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat'; import { putJointTrainingSimulationUser } from '@/api/chat';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic'
export default { export default {
name: 'Ibp', name: 'Ibp',
@ -43,7 +45,8 @@ export default {
showBackButton: true, showBackButton: true,
initTime: '', initTime: '',
started: false, started: false,
loading: false loading: false,
stationCode: '',
}; };
}, },
computed: { computed: {
@ -53,7 +56,7 @@ export default {
]), ]),
ibpId() { ibpId() {
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_'); return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
} },
}, },
watch: { watch: {
'$store.state.config.canvasSizeCount': function (val) { '$store.state.config.canvasSizeCount': function (val) {
@ -73,7 +76,12 @@ export default {
if (this.$ibp) { if (this.$ibp) {
this.setClockStart(started); this.setClockStart(started);
} }
} },
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
}, },
mounted() { mounted() {
this.setWindowSize(); this.setWindowSize();
@ -86,6 +94,7 @@ export default {
if (!deviceCode) { if (!deviceCode) {
return; return;
} }
this.stationCode = deviceCode;
document.getElementById(this.ibpId).oncontextmenu = function (e) { document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false; return false;
}; };
@ -116,6 +125,9 @@ export default {
}); });
Vue.prototype.$ibp = this.$ibp; Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this); this.$ibp.on('contextmenu', this.onContextMenu, this);
if (this.$route.query.group) {
this.$ibp.on('selected', this.onSelected, this);
}
this.setMap(data,ibpData[deviceCode]); this.setMap(data,ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]); this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime); this.initClockTime(this.initTime);
@ -128,6 +140,10 @@ export default {
}, },
// //
onSelected(em) { onSelected(em) {
if (em.deviceModel.mean) {
const params = { operate:IbpOperation[em.deviceModel.mean].operate,stationCode:this.stationCode };
handlerIbpEvent(this.$route.query.group,params);
}
}, },
// //
onContextMenu(em) { onContextMenu(em) {
@ -178,6 +194,9 @@ export default {
}, },
handleViewLoaded() { handleViewLoaded() {
this.loading = false; this.loading = false;
},
statusMessage(val) {
this.$ibp.setDeviceStatus(val);
} }
} }
}; };

View File

@ -158,3 +158,9 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
/deep/
.el-button+.el-button {
margin-top: 5px;
}
</style>

View File

@ -185,3 +185,9 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
/deep/
.el-button+.el-button {
margin-top:5px;
}
</style>

View File

@ -172,6 +172,35 @@
<el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" /> <el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" />
</div> </div>
</div> </div>
<!--<div class="Scheduling">-->
<!--<p class="title">真实设备-<span>{{hasPlc?'[PLC网关在线]':'[PLC网关离线]'}}</span></p>-->
<!--<ul>-->
<!--<li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">-->
<!--<span>{{ realDeviceType[nor.deviceType] }}</span>-->
<!--<div style="float: right; margin-right: 15px;">-->
<!--<el-select-->
<!--v-model="nor.deviceCode"-->
<!--:placeholder="$t('global.choose')"-->
<!--size="mini"-->
<!--:disabled="userId != roomInfo.creatorId"-->
<!--@change="handleChangeDevice(nor, doorList, stationStandList)"-->
<!--&gt;-->
<!--<el-option-->
<!--v-for="item in doorList"-->
<!--:key="item.code"-->
<!--:label="item.name"-->
<!--:value="item.code"-->
<!--:disabled="item.disabled"-->
<!--style="margin-left: 10px"-->
<!--/>-->
<!--</el-select>-->
<!--</div>-->
<!--</li>-->
<!--</ul>-->
<!--<div v-if="userId == roomInfo.creatorId" class="add-box">-->
<!--<el-button icon="el-icon-plus" circle plain @click="addingDevice" />-->
<!--</div>-->
<!--</div>-->
</div> </div>
</div> </div>
<div class="start-box"> <div class="start-box">
@ -254,12 +283,13 @@
</template> </template>
<script> <script>
import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance } from '@/api/chat'; import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance,setRealDevice } from '@/api/chat';
import { getStationList } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu,RealDeviceType } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo,hasDoorStationList } from '@/api/jmap/map';
import { getPlcGateway } from '@/api/simulation';
import trainChat from './trainChat'; import trainChat from './trainChat';
import AddPerson from './addPerson'; import AddPerson from './addPerson';
import QrCode from '@/components/QrCode'; import QrCode from '@/components/QrCode';
@ -300,6 +330,7 @@ export default {
signalList: [], signalList: [],
bigScreenList: [], bigScreenList: [],
stationList: [], stationList: [],
stationStandList: [],
ibpList: [], ibpList: [],
point: { point: {
x: 0, x: 0,
@ -309,7 +340,10 @@ export default {
timeDemon: null, timeDemon: null,
starting: false, starting: false,
mapId: '', mapId: '',
loading: false loading: false,
hasPlc: false,
doorList: [],
realDeviceType:RealDeviceType
}; };
}, },
computed: { computed: {
@ -329,7 +363,7 @@ export default {
}, },
stationListForIBP() { stationListForIBP() {
return this.stationList.map(item => { return this.stationList.map(item => {
const elem = { value: item.code, label: item.name, children:[{value: 'left', label: '左'}, {value: 'right', label: '右'}] }; const elem = { value: item.code, label: item.name, children:[{value: 'left', label: this.$t('trainRoom.left')}, {value: 'right', label: this.$t('trainRoom.right')}] };
return elem; return elem;
}); });
} }
@ -371,7 +405,12 @@ export default {
val.state = '02'; val.state = '02';
await this.addPeopleList(val); await this.addPeopleList(val);
} }
} },
'$store.state.socket.deviceInfo': async function (val) {
if (val) { //
await this.handlerDeviceList(val);
}
},
}, },
beforeDestroy() { beforeDestroy() {
if (this.timeDemon) { if (this.timeDemon) {
@ -382,6 +421,7 @@ export default {
this.userId = this.$store.state.user.id; this.userId = this.$store.state.user.id;
this.getRoomInfo(); // info this.getRoomInfo(); // info
this.getUserList(); // this.getUserList(); //
this.checkPlcGateway(); //PLC
this.timeDemon = setInterval(() => { this.timeDemon = setInterval(() => {
checkLoginLine(); checkLoginLine();
}, 5000 * 60); }, 5000 * 60);
@ -579,6 +619,8 @@ export default {
const resp = await getStationList(res.data.mapId); const resp = await getStationList(res.data.mapId);
this.stationList = resp.data; this.stationList = resp.data;
this.computePermissionRest(); this.computePermissionRest();
//
this.handleDoorList(res.data.mapId, resp.data);
}, },
// list Admin Instructor Dispatcher Attendant Audience Driver Repair IBP IBP // list Admin Instructor Dispatcher Attendant Audience Driver Repair IBP IBP
async getUserList() { async getUserList() {
@ -848,7 +890,52 @@ export default {
message: message, message: message,
type: type type: type
}); });
} },
checkPlcGateway() {
getPlcGateway(this.$route.query.group).then(resp=>{
if(resp.data){
this.hasPlc = true;
}else {
this.hasPlc = false;
}
}).catch(() => {
this.$messageBox('查询PLC设备失败');
});
},
handleDoorList(mapId,stationList) {
let doorList = [];
hasDoorStationList(mapId).then(res =>{
stationList.forEach(item => {
res.data.forEach(it =>{
if (item.code === it.stationCode) {
const direction = parseInt(it.doorLocationType)%2 ===0? '上行站台':'下行站台';
doorList.push({code:it.code,name:item.name+direction})
}
})
});
this.doorList = doorList;
}).catch((error) => {
this.$messageBox('获取屏蔽门列表失败!');
})
},
addingDevice() {
const roomDeviceVo = {id:'',deviceType:'ScreenDoor',deviceCode:''};
setRealDevice(this.$route.query.group,roomDeviceVo);
},
handleChangeDevice(nor,doorList, stationStandList){
setRealDevice(this.$route.query.group,nor);
doorList.forEach(item => {
item.disabled = false;
stationStandList.forEach(nor => {
if (item.code == nor.deviceCode) {
item.disabled = true;
}
});
});
},
handlerDeviceList(data) {
this.stationStandList = [data];
}
} }
}; };
</script> </script>
@ -858,7 +945,7 @@ export default {
.Scheduling { .Scheduling {
.el-input__inner { .el-input__inner {
height: 30px; height: 30px;
width: 140px; width: 180px;
} }
} }
} }