Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1
Conflicts: src/store/modules/trainingNew.js src/views/newMap/display/terminals/localWork.vue
This commit is contained in:
commit
c1f0bd6fa7
@ -234,10 +234,11 @@ export function startTraining(group, params) {
|
||||
});
|
||||
}
|
||||
/** 结束实训 */
|
||||
export function endTraining(group) {
|
||||
export function endTraining(group, data) {
|
||||
return request({
|
||||
url: `/api/training2Simulation/${group}/finish`,
|
||||
method: 'put'
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 实训完成步骤 */
|
||||
|
@ -437,17 +437,12 @@ class Jlmap {
|
||||
this.$painter.$transformHandle.revisibleAll();
|
||||
}
|
||||
updatePicture(list = []) {
|
||||
console.log('---------------');
|
||||
// debugger;
|
||||
list.forEach(item => {
|
||||
const device = this.mapDevice[item];
|
||||
if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) {
|
||||
const pictureDevice = store.getters['map/getPictureDeviceByCode'](item);
|
||||
device._pictureHide = pictureDevice ? pictureDevice.pictureHide : false;
|
||||
this.$painter.updatePicture(device);
|
||||
if (device.code === 'X97979') {
|
||||
console.log(pictureDevice, 'pictureDevice', this.mapDevice[device.code]);
|
||||
}
|
||||
try {
|
||||
if (device._type === deviceType.Section && device.type === '03') {
|
||||
this.mapDevice[device.switch.code]._pictureHide = pictureDevice ? pictureDevice.pictureHide : false;
|
||||
|
@ -84,7 +84,7 @@ class EHorizontal2Door extends Group {
|
||||
this.stand2.setStyle('fill', style.Psd.horizontal2Door.defaultColor);
|
||||
}
|
||||
}
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.stand1.setStyle('fill', '#7F7F7F');
|
||||
this.stand2.setStyle('fill', '#7F7F7F');
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class ERect2Door extends Group {
|
||||
this.psd.setStyle('fill', style.Psd.rectDoor.defaultColor);
|
||||
}
|
||||
}
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.psd.setStyle('fill', '#7F7F7F');
|
||||
}
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ export default class Section extends Group {
|
||||
// 区段延时解锁
|
||||
model.remain > 0 && this.delayUnlock();
|
||||
// 设置灰显
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.setAshShow();
|
||||
}
|
||||
// 设置脱轨器
|
||||
|
@ -1210,7 +1210,7 @@ class Signal extends Group {
|
||||
}
|
||||
this.model.virtual && this.sigBack && this.sigBack.show();
|
||||
// 设置灰显
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.setAshShow();
|
||||
}
|
||||
|
||||
@ -1218,7 +1218,7 @@ class Signal extends Group {
|
||||
if (this.style.Signal.text.conflictColor && model.checkConflict) {
|
||||
this.sigName.setColor(this.style.Signal.text.conflictColor);
|
||||
}
|
||||
if (store.state.training.prdType === '01') {
|
||||
if (store.state.map.picture === 'localWork') {
|
||||
this.lowButton && this.lowButton.show();
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ class EStationText extends Group {
|
||||
z: this.model.z,
|
||||
silent: !model.visible || false,
|
||||
style: {
|
||||
x: model.subheadPosition.x,
|
||||
y: model.subheadPosition.y,
|
||||
x: model.computedSubheadTextPosition.x,
|
||||
y: model.computedSubheadTextPosition.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.subheadFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
|
@ -34,10 +34,12 @@ export default class Station extends Group {
|
||||
this.computedPosition = pictureDevice.position;
|
||||
this.computedTurnBackPoint = { x: model.turnBackPoint ? model.turnBackPoint.x + offsetX : 0, y: model.turnBackPoint ? model.turnBackPoint.y + offsetY : 0 };
|
||||
this.computedControlModePoint = { x: model.controlModePoint.x + offsetX, y: model.controlModePoint.y + offsetY };
|
||||
this.computedSubheadTextPosition = { x: model.subheadPosition ? model.subheadPosition.x + offsetX : 0, y: model.subheadPosition ? model.subheadPosition.y + offsetY : 0 };
|
||||
} else {
|
||||
this.computedPosition = model.position;
|
||||
this.computedTurnBackPoint = model.turnBackPoint;
|
||||
this.computedControlModePoint = model.controlModePoint;
|
||||
this.computedSubheadTextPosition = model.subheadPosition;
|
||||
}
|
||||
this.z = 40;
|
||||
this.model = model;
|
||||
@ -59,6 +61,7 @@ export default class Station extends Group {
|
||||
'stationText': EStationText // 车站名称 (普通站台样式)
|
||||
};
|
||||
model.computedPosition = this.computedPosition;
|
||||
model.computedSubheadTextPosition = this.computedSubheadTextPosition;
|
||||
// 遍历当前线路下的绘图元素 组合模式
|
||||
traverseLineElements(style.Station, elementTypeList, model, style, this);
|
||||
|
||||
|
@ -55,7 +55,7 @@ class ETrainSetButton extends Group {
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.setColor('#7F7F7F');
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class StationStand extends Group {
|
||||
this.downDetainLamp && this.downDetainLamp.hide();
|
||||
}
|
||||
setScreenDoorOpenStatus(model) {
|
||||
if (!this.model.noStatus && !(this.model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (!this.model.noStatus && !(this.model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.gapStand && this.gapStand.setState(model);
|
||||
}
|
||||
}
|
||||
@ -183,7 +183,7 @@ class StationStand extends Group {
|
||||
currentTypeList.forEach(element => {
|
||||
this[element].setState(model);
|
||||
});
|
||||
if (store.state.training.prdType === '01') {
|
||||
if (store.state.map.picture === 'localWork') {
|
||||
this.stopJumpLamp && this.stopJumpLamp.show();
|
||||
this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
|
||||
this.upDetainLamp && this.upDetainLamp.show();
|
||||
|
@ -110,7 +110,7 @@ class EGapStand extends Group {
|
||||
this.setClose();
|
||||
}
|
||||
}
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === '02')) {
|
||||
this.setColor('#7F7F7F');
|
||||
}
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ export default class Switch extends Group {
|
||||
const sectionC = this.mapDevice[switchModel.sectionCCode];
|
||||
sectionC && sectionC.instance && sectionC.instance.handleSwitchSection(sectionC);
|
||||
}
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) {
|
||||
this.setAshShow();
|
||||
}
|
||||
!model.auto && this.artificialArc && this.artificialArc.show();
|
||||
|
@ -40,7 +40,7 @@ export default class Train extends Group {
|
||||
_computed() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (model.trainWindowModel) {
|
||||
if (model.trainWindowModel && model.trainWindowModel.instance) {
|
||||
const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code);
|
||||
if (amendData) {
|
||||
model.trainWindowModel.instance.computedPoint = amendData.position;
|
||||
|
@ -4,34 +4,25 @@ export default class EMouse {
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
this.device.setVisible(true);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(false);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
this.device.setVisible(false);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter() {
|
||||
// if (this.device.prdType) {
|
||||
// this.device.setVisible(true);
|
||||
// }
|
||||
}
|
||||
|
||||
mouseLeave() {
|
||||
if (this.device.prdType ) {
|
||||
this.device.setVisible(false);
|
||||
}
|
||||
this.device.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,12 @@ class TrainWindow extends Group {
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 9;
|
||||
this.prdType = store.state.training.prdType;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
create() {
|
||||
if (this.prdType !== '01') {
|
||||
if (store.state.map.picture !== 'localWork') {
|
||||
this.createTrainWindow();
|
||||
}
|
||||
}
|
||||
|
@ -91,8 +91,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd(false)">拒签</el-button>
|
||||
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd(true)">签收</el-button>
|
||||
<el-button :id="getDomObj('signCmdFalse').domId" :disabled="!commandId || currentHasSigned" @click="signCmd(false)">拒签</el-button>
|
||||
<el-button :id="getDomObj('signCmdTrue').domId" :disabled="!commandId || currentHasSigned" @click="signCmd(true)">签收</el-button>
|
||||
<el-button @click="doClose">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -101,6 +101,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import shouxinxiang from '@/assets/dispatcherStation/shouxinxiang.png';
|
||||
import { mapState } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
export default {
|
||||
name:'CmdManage',
|
||||
data() {
|
||||
@ -223,6 +224,9 @@ export default {
|
||||
// this.searchCmd();
|
||||
},
|
||||
methods:{
|
||||
getDomObj(key) {
|
||||
return OperationEvent.DispatchCmd.menuButton[key];
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
const status = this.getStateInfo(row.rcvCompanies).state;
|
||||
if (status === 'Signed') {
|
||||
@ -307,15 +311,25 @@ export default {
|
||||
command = 'CTC_SIGN_REJECT_DIS_COMMAND';
|
||||
delete data.proxySign;
|
||||
}
|
||||
sendCommandNew(this.group, command, data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
if (res.code == 200) {
|
||||
// this.searchCmd();
|
||||
} else {
|
||||
this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${res.message}`);
|
||||
const key = status ? 'signCmdTrue' : 'signCmdFalse';
|
||||
const operate = {
|
||||
operation: this.getDomObj(key).operation,
|
||||
param: data,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
sendCommandNew(this.group, command, data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
if (res.code == 200) {
|
||||
// this.searchCmd();
|
||||
} else {
|
||||
this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${res.message}`);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${error.message}`);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${error.message}`);
|
||||
});
|
||||
},
|
||||
filterTableData() {
|
||||
|
@ -81,8 +81,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd(false)">拒签</el-button>
|
||||
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd(true)">签收</el-button>
|
||||
<el-button :id="getDomObj('signCmdFalse').domId" :disabled="!commandId || currentHasSigned" @click="signCmd(false)">拒签</el-button>
|
||||
<el-button :id="getDomObj('signCmdTrue').domId" :disabled="!commandId || currentHasSigned" @click="signCmd(true)">签收</el-button>
|
||||
<el-button @click="doClose">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -91,6 +91,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import { mapState } from 'vuex';
|
||||
import { parseTime } from '@/utils/index';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
export default {
|
||||
name:'CmdManage',
|
||||
data() {
|
||||
@ -181,6 +182,9 @@ export default {
|
||||
beforeDestroy() {},
|
||||
mounted() {},
|
||||
methods:{
|
||||
getDomObj(key) {
|
||||
return OperationEvent.DispatchCmd.menuButton[key];
|
||||
},
|
||||
getDeviceName(receiverId) {
|
||||
let name = '';
|
||||
if (receiverId) {
|
||||
@ -239,12 +243,22 @@ export default {
|
||||
command = 'CTC_SIGN_REJECT_DIS_COMMAND';
|
||||
delete data.proxySign;
|
||||
}
|
||||
sendCommandNew(this.group, command, data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
// this.$emit('changeSignedStatus', signInfo);
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.$messageBox('查询调度命令失败:' + error.message);
|
||||
const key = status ? 'signCmdTrue' : 'signCmdFalse';
|
||||
const operate = {
|
||||
operation: this.getDomObj(key).operation,
|
||||
param: data,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
sendCommandNew(this.group, command, data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
// this.$emit('changeSignedStatus', signInfo);
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.$messageBox('查询调度命令失败:' + error.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
searchCmd() {
|
||||
|
@ -63,7 +63,6 @@ function handleRoute(to, next, loginPath) {
|
||||
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
||||
if (to.path === '/404' && to.redirectedFrom === '/') {
|
||||
const project = getSessionStorage('project');
|
||||
console.log(localStore.get('trainingPlatformRoute' + store.getters.id + project, '-------------'));
|
||||
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
|
||||
} else {
|
||||
next();
|
||||
|
@ -4216,6 +4216,68 @@ export const OperationEvent = {
|
||||
domId: '_Tips-TrainingDesign-menuButton-faultMode'
|
||||
}
|
||||
}
|
||||
},
|
||||
// 调度台
|
||||
DispatcherManage: {
|
||||
menu: {
|
||||
schedulingPlan: {
|
||||
operation: '1601',
|
||||
domId: '_Tips-DispatcherManage-menu-schedulingPlan'
|
||||
},
|
||||
dispatchingCommand: {
|
||||
operation: '1602',
|
||||
domId: '_Tips-DispatcherManage-menu-dispatchingCommand'
|
||||
},
|
||||
dispatchWork: {
|
||||
operation: '1603',
|
||||
domId: '_Tips-DispatcherManage-menu-dispatchWork'
|
||||
},
|
||||
dataUpdate: {
|
||||
operation: '1604',
|
||||
domId: '_Tips-DispatcherManage-menu-dataUpdate'
|
||||
},
|
||||
timeLock: {
|
||||
operation: '1605',
|
||||
domId: '_Tips-DispatcherManage-menu-timeLock'
|
||||
}
|
||||
}
|
||||
},
|
||||
// 调度命令
|
||||
DispatchCmd: {
|
||||
menuButton: {
|
||||
refreshSearch: {
|
||||
operation: '1701',
|
||||
domId: '_Tips-DispatchCmd-menuButton-refreshSearch'
|
||||
},
|
||||
createCmd: {
|
||||
operation: '1702',
|
||||
domId: '_Tips-DispatchCmd-menuButton-createCmd'
|
||||
},
|
||||
search: {
|
||||
operation: '1703',
|
||||
domId: '_Tips-DispatchCmd-menuButton-search'
|
||||
},
|
||||
allographCmd: {
|
||||
operation: '1704',
|
||||
domId: '_Tips-DispatchCmd-menuButton-allographCmd{BOTTOM}'
|
||||
},
|
||||
sendCmd: {
|
||||
operation: '1705',
|
||||
domId: '_Tips-DispatchCmd-menuButton-sendCmd{BOTTOM}'
|
||||
},
|
||||
saveCacheData: {
|
||||
operation: '1706',
|
||||
domId: '_Tips-DispatchCmd-menuButton-saveCacheData{BOTTOM}'
|
||||
},
|
||||
signCmdTrue: {
|
||||
operation: '1707',
|
||||
domId: '_Tips-DispatchCmd-menuButton-signCmdTrue{BOTTOM}'
|
||||
},
|
||||
signCmdFalse: {
|
||||
operation: '1708',
|
||||
domId: '_Tips-DispatchCmd-menuButton-signCmdFalse{BOTTOM}'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import store from '@/store/index';
|
||||
import { copyAssign } from '@/utils/index';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handleSockInfo(state, msg, type) {
|
||||
switch (type) {
|
||||
@ -27,311 +26,6 @@ function handleSimulationStateMsg(state, type) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// function handle(state, data) {
|
||||
// // console.log(data, 'socket订阅');
|
||||
// const msg = data.body;
|
||||
// const path = window.location.href;
|
||||
// const search = window.location.search;
|
||||
// if (((path.includes('/display/demon') && search.includes('project=bjd')) || path.includes('/planSchedule/window')) && !state.isFirst) { state.isFirst = true; }
|
||||
// switch (data.type) {
|
||||
// case 'Order_Pay_Result': // 订单支付结果消息
|
||||
// state.payOrder = msg;
|
||||
// break;
|
||||
// case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
||||
// state.equipmentStatus = msg;
|
||||
// break;
|
||||
// case 'Simulation_User': // 仿真-进出仿真消息
|
||||
// handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
||||
// break;
|
||||
// case 'Simulation_Script_Action_Tip': // 剧本提示消息
|
||||
// handleSimulationScriptTipInfo(state, msg); // 剧本提示消息
|
||||
// break;
|
||||
// case 'Simulation_Script_Action_Finish':
|
||||
// state.simulationScriptTipFinish++; // 剧本某一部操作完成提示
|
||||
// break;
|
||||
// case 'Simulation_Script_Action_Error':
|
||||
// state.simulationScriptTipError++; // 剧本某一部操作执行错误
|
||||
// break;
|
||||
// case 'Simulation_Over': // 用户退出仿真推送消息
|
||||
// state.simulationOver++; // 用户退出仿真推送消息
|
||||
// break;
|
||||
// case 'Simulation_Script_Action':// 剧本编制添加指令的推送消息
|
||||
// state.scriptAction = msg;
|
||||
// break;
|
||||
// case 'Simulation_AutoFault_Trigger': // 自动故障触发操作推送消息
|
||||
// state.autoFaultTrigger++;
|
||||
// break;
|
||||
// case 'Simulation_RunFact': // 仿真-列车实际到 发车站消息
|
||||
// if (!Array.isArray(msg)) {
|
||||
// state.trainStationList = [msg];
|
||||
// } else {
|
||||
// state.trainStationList = msg;
|
||||
// }
|
||||
// break;
|
||||
// case 'Simulation_Error': // 仿真-异常消息
|
||||
// state.simulationError += 1;
|
||||
// break;
|
||||
// case 'Simulation_RunAsPlan_Start': // 仿真-仿真开始按计划行车消息
|
||||
// state.simulationStart = msg;
|
||||
// break;
|
||||
// case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车
|
||||
// state.simulationReset += 1;
|
||||
// break;
|
||||
// case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令)
|
||||
// handleSimulationInfo(state, msg);
|
||||
// break;
|
||||
// case 'Simulation_Conversation_Operation': // 仿真-用户交互消息(聊天/命令)-新
|
||||
// handleSimulationInfo(state, {id: msg.id, message: msg, messageType: 'MESSAGE'});
|
||||
// break;
|
||||
// case 'Simulation_ApplyHandle': // 请求处理消息(旧版可能在用,新版地图不用这个)
|
||||
// handlePushMsgQueue(state, msg);
|
||||
// break;
|
||||
// case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
||||
// state.simulationInvite = msg;
|
||||
// break;
|
||||
// case 'Be_Logged_Out': // 重复登录被登出
|
||||
// state.beLogoutCount++;
|
||||
// state.loggedOutMsg = msg;
|
||||
// break;
|
||||
// case 'Simulation_Run_Plan_Reload': // 运行图变更
|
||||
// state.runPlanReloadCount++;
|
||||
// break;
|
||||
// case 'Simulation_Control_Pause': // 暂停中
|
||||
// store.dispatch('scriptRecord/updateSimulationPause', msg);
|
||||
// break;
|
||||
// case 'BROADCAST': // 升级通知消息
|
||||
// Notification.warning({
|
||||
// title: msg.title,
|
||||
// center: true,
|
||||
// message: msg.message,
|
||||
// position: 'bottom-right',
|
||||
// showClose: msg.showClose,
|
||||
// duration: 0
|
||||
// });
|
||||
// break;
|
||||
// case 'Simulation_Member':
|
||||
// state.memberChangeCount++;
|
||||
// break;
|
||||
// case 'Simulation_Time_Sync':
|
||||
// state.simulationTimeSync = msg;
|
||||
// break;
|
||||
// case 'Simulation_IbpStatus':
|
||||
// state.simulationIbpStatus = msg;
|
||||
// break;
|
||||
// case 'Simulation_Competition_Practice_Finish':
|
||||
// state.competitionPracticeFinish++;
|
||||
// break;
|
||||
// case 'Simulation_Alarm':
|
||||
// state.simulationAlarmInfo = msg;
|
||||
// break;
|
||||
// case 'STATION_PFI_NUM':
|
||||
// state.stationPfiNum = msg;
|
||||
// break;
|
||||
// case 'STAND_PFI':
|
||||
// state.standPfiNum = msg;
|
||||
// break;
|
||||
// case 'TRAIN_PFI_NUM':
|
||||
// state.trainPfiNum = msg;
|
||||
// break;
|
||||
// case 'TRAIN_PFI_BL':
|
||||
// state.trainPfiBL = msg;
|
||||
// break;
|
||||
// case 'LPF_STRATEGY_RECOMMEND':
|
||||
// state.LPFstrategy = msg;
|
||||
// break;
|
||||
// case 'Simulation_Scenes_Reload':
|
||||
// if (msg) {
|
||||
// store.dispatch('training/start');
|
||||
// } else {
|
||||
// store.dispatch('training/over');
|
||||
// }
|
||||
// state.trainingReloadCount++;
|
||||
// break;
|
||||
// case 'Simulation_PslStatus':
|
||||
// state.simulationPslStatus = msg;
|
||||
// break;
|
||||
// // 运行图加线/抽线/变化推送消息
|
||||
// case 'Simulation_Trip_Plan_Change':
|
||||
// state.simulationPlanChange = msg;
|
||||
// break;
|
||||
// // 占线板信息
|
||||
// case 'Simulation_RailCtcStatus':
|
||||
// state.railCtcStatusMsg = msg;
|
||||
// break;
|
||||
// // 大铁项目 ctc 运行图初始化信息
|
||||
// // case 'SIMULATION_CTC_RUN_PLAN_INIT':
|
||||
// // msg.forEach(element => {
|
||||
// // const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber;
|
||||
// // const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber;
|
||||
// // if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; }
|
||||
// // if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; }
|
||||
// // const code = element.stationCode + '' + element.code;
|
||||
// // state.railCtcRunplanInitMsg[code] = element;
|
||||
// // });
|
||||
// // break;
|
||||
// // 大铁项目 ctc 运行图改变信息
|
||||
// case 'SIMULATION_CTC_RUN_PLAN_CHANGE':
|
||||
// state.voiceBroadcastMsgs = [];
|
||||
// msg.forEach(element => {
|
||||
// const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber;
|
||||
// const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber;
|
||||
// if (tripNumberDe) {
|
||||
// element.departRunPlan.up = '';
|
||||
// element.departRunPlan.down = '';
|
||||
// parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe;
|
||||
// }
|
||||
// if (tripNumberAr) {
|
||||
// element.arriveRunPlan.up = '';
|
||||
// element.arriveRunPlan.down = '';
|
||||
// parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr;
|
||||
// }
|
||||
// const code = element.stationCode + '' + element.code;
|
||||
// if (store.state.training.roleDeviceCode === element.stationCode && element.arriveRunPlan && element.arriveRunPlan.adjacentMessage === '1') {
|
||||
// state.voiceBroadcastMsgs.push(element.stationCode + '' + element.code);
|
||||
// }
|
||||
// state.railCtcRunplanInitMsg[code] = copyAssign(state.railCtcRunplanInitMsg[code] || {}, element);
|
||||
// });
|
||||
// if (state.voiceBroadcastMsgs.length) {
|
||||
// state.voiceBroadcastChange++;
|
||||
// }
|
||||
// state.railCtcRunplanChange++;
|
||||
// break;
|
||||
// // 大铁项目 ctc 调度发布行车计划 给车站下发消息
|
||||
// case 'SIMULATION_RAILWAY_RUN_PLAN_SEND':
|
||||
// msg.forEach(each=>{
|
||||
// state.railwaySimulationRunplanSendMap[each.stationCode] = each;
|
||||
// });
|
||||
// state.railwaySimulationRunplanSendChange++;
|
||||
// break;
|
||||
// // 大铁项目 ctc 车务管理端 初始化消息
|
||||
// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_INIT':
|
||||
// state.railCtcStationManageRpMsg = {};
|
||||
// msg.forEach(element => {
|
||||
// const code = element.stationCode + '' + element.tripNumber;
|
||||
// state.railCtcStationManageRpMsg[code] = element;
|
||||
// });
|
||||
// // state.railCtcStationManageRpChange++;
|
||||
// break;
|
||||
// // 大铁项目 ctc 车务管理端 修改/增加消息
|
||||
// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_CHANGE':
|
||||
// msg.forEach(element => {
|
||||
// const code = element.stationCode + '' + element.tripNumber;
|
||||
// state.railCtcStationManageRpMsg[code] = copyAssign(state.railCtcStationManageRpMsg[code] || {}, element);
|
||||
// });
|
||||
// state.railCtcStationManageRpChange++;
|
||||
// break;
|
||||
// // 大铁项目 ctc 车务管理端 移除消息
|
||||
// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_REMOVE':
|
||||
// msg.forEach(element => {
|
||||
// const code = element.stationCode + '' + element.tripNumber;
|
||||
// delete state.railCtcStationManageRpMsg[code];
|
||||
// });
|
||||
// state.railCtcStationManageRpChange++;
|
||||
// break;
|
||||
// // 调度命令信息
|
||||
// case 'SIMULATION_RAIL_CTC_DIS_COMMAND_ADD':
|
||||
// state.dispatchCommandMsg = msg;
|
||||
// break;
|
||||
// // 调度命令状态
|
||||
// case 'SIMULATION_RAIL_CTC_DIS_COMMAND_SYNC':
|
||||
// state.dispatchCommandState = msg;
|
||||
// console.log('调度命令状态', msg);
|
||||
// break;
|
||||
// // 车站发送计划信息
|
||||
// case 'SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND':
|
||||
// state.changedCtcRunplanMap = msg;
|
||||
// break;
|
||||
// case 'SIMULATION_RAIL_TICKET':
|
||||
// state.ticketInfo = msg;
|
||||
// break;
|
||||
// // // 实训提示消息
|
||||
// // case 'Simulation_Training_Step_Tip':
|
||||
// // state.trainingStepTip = msg;
|
||||
// // break;
|
||||
// case 'Simulation_Training_Finish':
|
||||
// state.trainingOverCount++;
|
||||
// break;
|
||||
// case 'YJDDZH_TRAIN_POSITION':
|
||||
// state.whTrainInfo = msg;
|
||||
// break;
|
||||
// case 'Simulation_Training_Step_Finish':
|
||||
// state.trainingStepFinishCount++;
|
||||
// break;
|
||||
// case 'SIMULATION_WORK_PARAM':
|
||||
// state.simulationWorkParam = msg;
|
||||
// break;
|
||||
// //
|
||||
// // // 大铁项目 调度台 运行图信息 初始化消息
|
||||
// // case 'SIMULATION_RAILWAY_RUN_PLAN_INIT':
|
||||
// // state.railwaySimulationRpMsg = {};
|
||||
// // msg.forEach(element => {
|
||||
// // const code = element.stationCode + '' + element.runPlanCode;
|
||||
// // state.railwaySimulationRpMsg[code] = element;
|
||||
// // });
|
||||
// // break;
|
||||
// // // 大铁项目 调度台 运行图信息 修改/增加消息
|
||||
// // case 'SIMULATION_RAILWAY_RUN_PLAN_CHANGE':
|
||||
// // msg.forEach(element => {
|
||||
// // const code = element.stationCode + '' + element.runPlanCode;
|
||||
// // state.railwaySimulationRpMsg[code] = copyAssign(state.railwaySimulationRpMsg[code] || {}, element);
|
||||
// // });
|
||||
// // state.railwaySimulationRpChange++;
|
||||
// // break;
|
||||
// // // 大铁项目 调度台 运行图信息 移除消息
|
||||
// // case 'SIMULATION_RAILWAY_RUN_PLAN_REMOVE':
|
||||
// // msg.forEach(element => {
|
||||
// // const code = element.stationCode + '' + element.runPlanCode;
|
||||
// // delete state.railwaySimulationRpMsg[code];
|
||||
// // });
|
||||
// // state.railwaySimulationRpChange++;
|
||||
// // break;
|
||||
// }
|
||||
// }
|
||||
// 仿真内部聊天
|
||||
function handleSimulationInfo(state, data) {
|
||||
switch (data.messageType) {
|
||||
case 'INVITE':
|
||||
state.inviteSimulationConversation = data;
|
||||
break;
|
||||
case 'CONNECT':
|
||||
state.acceptConversionInvite = data;
|
||||
break;
|
||||
case 'OVER':
|
||||
state.overConversation = data;
|
||||
break;
|
||||
case 'MESSAGE':
|
||||
state.conversationInfo = data;
|
||||
break;
|
||||
case 'CREATE':
|
||||
state.createConversation = data;
|
||||
break;
|
||||
case 'EXIT':
|
||||
state.exitConversation = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 剧本提示
|
||||
function handleSimulationScriptTipInfo(state, data) {
|
||||
state.simulationScriptTip = data;
|
||||
}
|
||||
|
||||
function handleSimulationUserinfo(state, data) {
|
||||
state.simulationRoleList = (data instanceof Array) ? data : [data];
|
||||
}
|
||||
|
||||
// (旧版可能在用,新版地图不用这个)
|
||||
function handlePushMsgQueue(state, msg) {
|
||||
if (msg instanceof Array) {
|
||||
state.msgQueue.concat(msg);
|
||||
} else {
|
||||
state.msgQueue.push(msg);
|
||||
}
|
||||
|
||||
if (!state.msgHead) {
|
||||
state.msgHead = state.msgQueue[0];
|
||||
}
|
||||
}
|
||||
|
||||
const socket = {
|
||||
namespaced: true,
|
||||
@ -407,7 +101,6 @@ const socket = {
|
||||
railwaySimulationRunplanSendChange:0, // 大铁项目 调度台 发布 行车计划变化
|
||||
voiceBroadcastMsgs: [], // 语音播报信息
|
||||
voiceBroadcastChange: 0, // 语音播报信息变化
|
||||
trainingStepTip: '', // 新实训推送消息
|
||||
trainingOverCount: 0, // 新实训结束计数器
|
||||
trainingReloadCount: 0,
|
||||
whTrainInfo: null,
|
||||
@ -535,9 +228,6 @@ const socket = {
|
||||
state.railCtcRunplanInitMsg[code] = element;
|
||||
});
|
||||
},
|
||||
clearTrainingStepTip: (state) => {
|
||||
state.trainingStepTip = '';
|
||||
},
|
||||
clearTrainingOverCount: (state) => {
|
||||
state.trainingOverCount = 0;
|
||||
},
|
||||
@ -691,9 +381,6 @@ const socket = {
|
||||
setTicketInfo: (state, data) => {
|
||||
state.ticketInfo = data;
|
||||
},
|
||||
setTrainingStepTip: (state, data) => {
|
||||
state.trainingStepTip = data;
|
||||
},
|
||||
trainingOverCountIncrease: (state) => {
|
||||
state.trainingOverCount++;
|
||||
},
|
||||
@ -801,9 +488,6 @@ const socket = {
|
||||
initRailCtcRunplanInitMsg:({ commit }, list) => {
|
||||
commit('initRailCtcRunplanInitMsg', list);
|
||||
},
|
||||
clearTrainingStepTip: ({ commit }) => {
|
||||
commit('clearTrainingStepTip');
|
||||
},
|
||||
clearTrainingOverCount: ({ commit }) => {
|
||||
commit('clearTrainingOverCount');
|
||||
},
|
||||
@ -924,9 +608,6 @@ const socket = {
|
||||
setTicketInfo: ({ commit }, data) => {
|
||||
commit('setTicketInfo', data);
|
||||
},
|
||||
setTrainingStepTip: ({ commit }, data) => {
|
||||
commit('setTrainingStepTip', data);
|
||||
},
|
||||
trainingOverCountIncrease: ({ commit }) => {
|
||||
commit('trainingOverCountIncrease');
|
||||
},
|
||||
|
@ -14,9 +14,8 @@ const training = {
|
||||
sceneOperate: null,
|
||||
stepOrder: 0,
|
||||
operateOrder: 0,
|
||||
// stepOverCount: 0,
|
||||
trainingScore: '',
|
||||
operateErrMsg: ''
|
||||
operateErrMsg: '',
|
||||
trainingStepTip: ''
|
||||
},
|
||||
getters: {
|
||||
teachMode: (state) => {
|
||||
@ -34,9 +33,6 @@ const training = {
|
||||
stepOrder: (state) => {
|
||||
return state.stepOrder;
|
||||
},
|
||||
trainingScore: (state) => {
|
||||
return state.trainingScore;
|
||||
},
|
||||
sceneOperate: (state) => {
|
||||
return state.sceneOperate;
|
||||
}
|
||||
@ -80,14 +76,17 @@ const training = {
|
||||
clearStepOverCount: (state) => {
|
||||
state.clearStepOverCount = 0;
|
||||
},
|
||||
setTrainingScore: (state, score) => {
|
||||
state.trainingScore = score;
|
||||
},
|
||||
setSceneOperate: (state, sceneOperate) => {
|
||||
state.sceneOperate = sceneOperate;
|
||||
},
|
||||
setOperateErrMsg: (state, msg) => {
|
||||
state.operateErrMsg = msg;
|
||||
},
|
||||
clearTrainingStepTip: (state) => {
|
||||
state.trainingStepTip = '';
|
||||
},
|
||||
setTrainingStepTip: (state, data) => {
|
||||
state.trainingStepTip = data;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@ -126,9 +125,6 @@ const training = {
|
||||
clearStepOverCount: ({commit}) => {
|
||||
commit('clearStepOverCount');
|
||||
},
|
||||
setTrainingScore: ({commit}, score) => {
|
||||
commit('setTrainingScore', score);
|
||||
},
|
||||
setSceneOperate: ({commit}, sceneOperate) => {
|
||||
commit('setSceneOperate', sceneOperate);
|
||||
},
|
||||
@ -170,6 +166,12 @@ const training = {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
clearTrainingStepTip: ({ commit }) => {
|
||||
commit('clearTrainingStepTip');
|
||||
},
|
||||
setTrainingStepTip: ({ commit }, data) => {
|
||||
commit('setTrainingStepTip', data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ export function objectIsEqual(obj1, obj2) {
|
||||
}
|
||||
// 仅过滤值为null的项
|
||||
const arr1 = Object.keys(obj1).filter(key => { return obj1[key] != null; });
|
||||
const arr2 = Object.keys(obj2).filter(key => { return obj1[key] != null; });
|
||||
const arr2 = Object.keys(obj2).filter(key => { return obj2[key] != null; });
|
||||
if (arr1.length !== arr2.length) {
|
||||
return false;
|
||||
}
|
||||
|
@ -125,11 +125,11 @@ StompClient.prototype = {
|
||||
const subscription = this.subscribeMap.get(topic);
|
||||
if (subscription && subscription.count > 0) {
|
||||
subscription.count--;
|
||||
if (subscription && subscription.sub && subscription.count < 0) {
|
||||
if (subscription && subscription.sub && subscription.count <= 0) {
|
||||
subscription.sub.unsubscribe();
|
||||
this.subscribeMap.delete(topic);
|
||||
console.log('取消订阅:' + topic);
|
||||
} else if (subscription && subscription.count < 0) {
|
||||
} else if (subscription && subscription.count <= 0) {
|
||||
this.subscribeMap.delete(topic);
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,15 @@ export function getTopic(type, group, param) {
|
||||
// topic = `/user/queue/simulation/${group}/ctc/manage`;
|
||||
topic = `/user/queue/simulation/${group}/ctcManage`;
|
||||
break;
|
||||
case 'ATS_STATUS':
|
||||
topic = `/user/queue/simulation/${group}/device/status`;
|
||||
break;
|
||||
case 'COMMON':
|
||||
topic = `/user/queue/simulation/${group}`;
|
||||
break;
|
||||
case 'LPF':
|
||||
topic = `/user/queue/simulation/passenger/${group}`;
|
||||
break;
|
||||
}
|
||||
|
||||
return topic;
|
||||
|
@ -174,10 +174,6 @@ function handle(data) {
|
||||
case 'SIMULATION_RAIL_TICKET':
|
||||
store.dispatch('socket/setTicketInfo', msg);
|
||||
break;
|
||||
// // 实训提示消息
|
||||
// case 'Simulation_Training_Step_Tip':
|
||||
// store.dispatch('socket/setTrainingStepTip', msg);
|
||||
// break;
|
||||
case 'Simulation_Training_Finish':
|
||||
store.dispatch('socket/trainingOverCountIncrease');
|
||||
break;
|
||||
|
@ -146,7 +146,7 @@ export default {
|
||||
handlerEnd() {
|
||||
endTraining(this.group).then((resp) => {
|
||||
this.$store.dispatch('trainingNew/trainingEnd');
|
||||
this.$store.dispatch('socket/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearStepOrder');
|
||||
this.$store.dispatch('trainingNew/clearOperateOrder');
|
||||
this.$store.dispatch('trainingNew/setTrainingScore', resp.data);
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.trainingStepTip': function(val) {
|
||||
'$store.state.trainingNew.trainingStepTip': function(val) {
|
||||
if (val && this.trainingDetail.type === 'SINGLE') {
|
||||
const member = this.$store.state.training.memberData[val.memberId];
|
||||
this.$nextTick(function() {
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
if (steps && steps.length) {
|
||||
const step = steps[stepOrder - 1];
|
||||
const distance = 5;
|
||||
this.tip = this.$store.state.socket.trainingStepTip.content;
|
||||
this.tip = this.$store.state.trainingNew.trainingStepTip.content;
|
||||
if (step && step.tipPosition && step.tipPosition.deviceCode) {
|
||||
const position = this.getShapeTipPoint(step.tipPosition);
|
||||
if (position) {
|
||||
|
@ -144,7 +144,7 @@ export default {
|
||||
handlerEnd() {
|
||||
endTraining(this.group).then((resp) => {
|
||||
this.$store.dispatch('trainingNew/trainingEnd');
|
||||
this.$store.dispatch('socket/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearStepOrder');
|
||||
this.$store.dispatch('trainingNew/setTrainingScore', resp.data);
|
||||
}).catch(() => {
|
||||
|
@ -21,7 +21,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.trainingStepTip': function(val) {
|
||||
'$store.state.trainingNew.trainingStepTip': function(val) {
|
||||
if (val && this.trainingDetail.type === 'SCENE') {
|
||||
const member = this.$store.state.training.memberData[val.memberId];
|
||||
this.$nextTick(function() {
|
||||
|
@ -138,16 +138,19 @@ export default {
|
||||
this.flowDataShow = true;
|
||||
this.isDisabled = true;
|
||||
const simulationWorkParam = this.$store.state.socket.simulationWorkParam;
|
||||
if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) {
|
||||
const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; });
|
||||
if (currentFlowData) {
|
||||
this.currentFlowDataId = currentFlowData.id;
|
||||
this.currentFlowDataName = currentFlowData.name;
|
||||
}
|
||||
} else {
|
||||
if (this.currentFlowDataName) {
|
||||
const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; });
|
||||
if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; }
|
||||
} else {
|
||||
if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) {
|
||||
const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; });
|
||||
if (currentFlowData) {
|
||||
this.currentFlowDataId = currentFlowData.id;
|
||||
this.currentFlowDataName = currentFlowData.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
clearSubscribe() {
|
||||
|
@ -10,10 +10,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import { timeFormat } from '@/utils/date';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { mapGetters } from 'vuex';
|
||||
// import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||
import TerminalsPicture from './terminals/index';
|
||||
import SimulationMenu from './simulationMenu';
|
||||
import { clearSimulation, getSimulationInfoNew} from '@/api/simulation';
|
||||
@ -38,7 +36,6 @@ export default {
|
||||
// textStatusHeight: 0,
|
||||
// planRunning:false,
|
||||
dataError: false,
|
||||
group:'',
|
||||
terminalsShow: true
|
||||
// showMap: false
|
||||
};
|
||||
@ -62,6 +59,9 @@ export default {
|
||||
// 当前的所属项目
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@ -102,7 +102,6 @@ export default {
|
||||
},
|
||||
// 初始化
|
||||
initLoadData() {
|
||||
this.group = this.$route.query.group;
|
||||
// this.$store.dispatch('training/reset');
|
||||
this.loadSimulationInfo();
|
||||
},
|
||||
|
@ -1,342 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="920px" center>
|
||||
<el-tabs v-model="activeName" type="card" style="height:550px">
|
||||
<el-tab-pane label="主场景列表" name="first">
|
||||
<div v-if="!hasPermission" style="margin-bottom: 10px;color: #f00;width: 100%;text-align: center;">
|
||||
尊敬的用户,您好:由于您暂无场景权限,现仅提供场景1试用,如需使用其他场景请
|
||||
<el-button type="text" style="text-decoration: underline" @click="goToPay">购买权限</el-button>
|
||||
</div>
|
||||
<div v-if="permisson.endTime" style="margin-bottom: 10px;color: #f00;width: 100%;text-align: center;">
|
||||
{{ `您的场景权限截止时间:${permisson.endTime || '永久'}。` }}
|
||||
<el-button type="text" style="text-decoration: underline" @click="goToPay">立即续费</el-button>
|
||||
</div>
|
||||
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" height="465" stripe :cell-style="{padding: '8px 0'}">
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column prop="type" width="200" label="类别" />
|
||||
<el-table-column prop="scene" width="350" label="场景" />
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.result">
|
||||
<template v-for="(each, index) in scope.row.result">
|
||||
<el-button :key="index" type="primary" size="small" :disabled="!hasPermission && each.name !=='场景1'" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDraftScriptByGroupNew } from '@/api/script';
|
||||
import {loadCompetitionPracticalScene, getCompetitionPracticalScene, queryCompetitionPracticalPermissions} from '@/api/competition';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
export default {
|
||||
name:'ChangeMap',
|
||||
data() {
|
||||
return {
|
||||
projectMapList:[],
|
||||
dialogVisible: false,
|
||||
selectMapId:'',
|
||||
hasPermission: false,
|
||||
permisson: {},
|
||||
form: {
|
||||
type: ''
|
||||
},
|
||||
row: '',
|
||||
activeName: 'first',
|
||||
memberList: [],
|
||||
selectMapLineCode:'',
|
||||
mainSceneData: [
|
||||
{type: '车辆故障', scene: '列车救援', result:[]},
|
||||
{type: '信号系统故障', scene: '道岔故障', result:[]},
|
||||
{type: '信号系统故障', scene: '区域控制器故障', result:[]},
|
||||
{type: '信号系统故障', scene: '联锁故障', result:[]},
|
||||
{type: '供电系统故障', scene: '接触轨(网)断电', result:[]},
|
||||
{type: '供电系统故障', scene: '车站照明熄灭影响乘降', result:[]},
|
||||
{type: '车站机电设备故障', scene: '站台门故障', result:[]},
|
||||
// {type: '车站机电设备故障', scene: '车站照明故障', result:[]},
|
||||
{type: '限速', scene: '列车限速', result:[]},
|
||||
{type: '轨道故障', scene: '线路故障影响列车运行', result:[]},
|
||||
{type: '轨道故障', scene: '计轴故障', result:[]}
|
||||
// {type: '在区域控制器故障', scene: '线路故障多车降级', result:[]}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.payOrder':function (val) {
|
||||
this.queryPermission();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.queryPermission();
|
||||
getCompetitionPracticalScene({pageSize:100, pageNum:1}).then(res=>{
|
||||
if (res.data.list && res.data.list.length > 0) {
|
||||
const list = res.data.list.sort((a, b) => {
|
||||
return parseInt(a.name.replace('场景', '')) - parseInt(b.name.replace('场景', ''));
|
||||
});
|
||||
list.forEach(each=>{
|
||||
if (each.name == '场景1' || each.name == '场景2' || each.name == '场景3' || each.name == '场景7') {
|
||||
this.mainSceneData[1].result.push({id:each.id, name:each.name, description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景4') {
|
||||
this.mainSceneData[0].result.push({id:each.id, name:'场景4', description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景5' || each.name == '场景11') {
|
||||
this.mainSceneData[4].result.push({id:each.id, name:each.name, description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景6') {
|
||||
this.mainSceneData[9].result.push({id:each.id, name:each.name, description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景9') {
|
||||
this.mainSceneData[6].result.push({id:each.id, name:'场景9', description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景8') {
|
||||
this.mainSceneData[5].result.push({id:each.id, name:'场景8', description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景10') {
|
||||
this.mainSceneData[7].result.push({id:each.id, name:'场景10', description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
} else if (each.name == '场景12') {
|
||||
this.mainSceneData[2].result.push({id:each.id, name:'场景12', description: each.description, disposalProcesses: each.disposalProcesses});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
queryPermission() {
|
||||
this.permisson = {};
|
||||
queryCompetitionPracticalPermissions({mapId:this.$route.query.mapId}).then(res => {
|
||||
this.hasPermission = !!res.data;
|
||||
if (res.data) { this.permisson = res.data; }
|
||||
}).catch(() => {
|
||||
this.$message.error('获取场景权限异常!');
|
||||
});
|
||||
},
|
||||
async handleLoad(row) {
|
||||
this.row = row;
|
||||
const response = await loadCompetitionPracticalScene(this.$route.query.group, row.id);
|
||||
if (response.code == 200) {
|
||||
const res = await getDraftScriptByGroupNew(this.$route.query.group);
|
||||
if (res.code == 200) {
|
||||
const playerList = [];
|
||||
EventBus.$emit('clearRunSeries');
|
||||
EventBus.$emit('loadScene');
|
||||
const notifyData = this.$notify({
|
||||
title: res.data.name,
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<p><span style="color: #000;font-weight: bold;">场景描述:</span>${row.description}</p>`,
|
||||
customClass: 'notify_box',
|
||||
showClose: false,
|
||||
offset: 75,
|
||||
duration: 0
|
||||
});
|
||||
this.$store.commit('training/setNotifySelected', notifyData);
|
||||
if (res.data.memberList && res.data.memberList.length > 0) {
|
||||
this.form.type = '';
|
||||
res.data.memberList.sort((a, b) => {
|
||||
return parseInt(a.id) - parseInt(b.id);
|
||||
});
|
||||
this.$store.dispatch('training/setMemberList', {memberList:res.data.memberList, userId:this.$store.state.user.id});
|
||||
const activeMemberList = [];
|
||||
res.data.actionList.forEach((activeMember)=>{
|
||||
if (!(activeMemberList.length > 0 && activeMemberList.includes(activeMember.memberId))) {
|
||||
activeMemberList.push(activeMember.memberId);
|
||||
}
|
||||
});
|
||||
|
||||
res.data.memberList.forEach(member=>{
|
||||
if (activeMemberList.includes(member.id)) {
|
||||
playerList.push(Object.assign({}, member));
|
||||
}
|
||||
});
|
||||
|
||||
playerList.map(member=>{
|
||||
switch (member.type) {
|
||||
case 'DISPATCHER': {
|
||||
member.label = '行调' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_SUPERVISOR': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '行值' + device.name;
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'DRIVER': {
|
||||
member.deviceName = member.deviceCode;
|
||||
member.label = '司机' + member.deviceName;
|
||||
break;
|
||||
}
|
||||
case 'MAINTAINER': {
|
||||
member.label = '通号' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'DEPOT_DISPATCHER': {
|
||||
member.label = '车辆段/信号楼调度' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'PARENT_DEPARTMENT': {
|
||||
member.label = '上级部门' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'ELECTRIC_DISPATCHER': {
|
||||
member.label = '电力调度' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'SIGNAL_BUILDING': {
|
||||
member.label = '信号楼' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_ASSISTANT': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站助理-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站助理' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_MASTER': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站站长-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站站长' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_SIGNALER': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站信号员-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站信号员' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_PASSENGER': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站客运员-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站客运员' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_SWITCH_MAN': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站扳道员-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站扳道员' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_FACILITATOR': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站引导员-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '车站引导员' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'STATION_WORKER': {
|
||||
// member.label = '车站工务工' + (member.name ? member.name : '');
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '车站工务工-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'DEVICE_MANAGER': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
member.label = '设备管理员-' + device.name + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
// member.label = '设备管理员' + (member.name ? member.name : '');
|
||||
break;
|
||||
}
|
||||
case 'TRAIN_MASTER': {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
// + device.name
|
||||
member.label = '车务段段长-' + (member.name ? member.name : '');
|
||||
member.deviceName = device.name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (res.data.mapLocation) {
|
||||
this.mapLocation = res.data.mapLocation;
|
||||
}
|
||||
this.confirm(playerList);
|
||||
}
|
||||
}
|
||||
},
|
||||
async handleExplain(row) {
|
||||
const ossData = ConstConfig.ConstSelect.ossList.find(ele => { return ele.name == row.name; });
|
||||
const href = `https://joylink.club/oss/cbtc/race/${ossData.url}`;
|
||||
window.open(href, '_blank');
|
||||
},
|
||||
confirm(playerList) {
|
||||
this.$emit('selectScript', {playerList:playerList, mapLocation:this.mapLocation});
|
||||
this.doClose();
|
||||
},
|
||||
goToPay() {
|
||||
this.$emit('goToPay');
|
||||
this.doClose();
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
if (rowIndex === 1 && columnIndex === 1) {
|
||||
return {
|
||||
rowspan: 3,
|
||||
colspan: 1
|
||||
};
|
||||
} else if ((rowIndex === 4 || rowIndex === 8) && columnIndex === 1) {
|
||||
return {
|
||||
rowspan: 2,
|
||||
colspan: 1
|
||||
};
|
||||
} else if ((rowIndex === 2 || rowIndex === 3 || rowIndex === 5 || rowIndex === 9) && columnIndex === 1) {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowspan: 1,
|
||||
colspan: 1
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.tooltip-box {
|
||||
white-space:pre-wrap;
|
||||
}
|
||||
.notify_box{
|
||||
width: 300px;
|
||||
white-space: inherit;
|
||||
&.el-notification.right{
|
||||
right: 5px;
|
||||
padding: 6px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="simulationControlAll">
|
||||
<div class="simulationControlAll" style="z-index: 11;">
|
||||
<el-button class="controlButton" type="info" style="background: #000;" :loading="pauseLoading" circle :class="simulationPaused?'el-icon-video-play':'el-icon-video-pause'" @click="startOrPause" />
|
||||
<div>
|
||||
<div class="simulationMenu" @click="showMenuSpeedList">{{ `x${speed}` }}</div>
|
||||
@ -10,12 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="simulationMenu" style="width: 70px;" @click="showMenuModeList">{{ nowMode }}</div>
|
||||
<div v-show="isShowModeMenuList" class="simulationMenuList" style="width: 80px;">
|
||||
<div v-for="(each, index) in modeList" :key="index">
|
||||
<div class="eachSimulationMenu" style="width: 70px;" :class="{'active' :nowMode === each.label}" @click="changeOperateMode(each)">{{ each.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="simulationMenu" style="width: 70px;" :style="{background: nowMode === '正常操作' ? '#0fb20b' :'#efc007'}" @click="changeOperateMode">{{ nowMode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -30,13 +25,9 @@ export default {
|
||||
pauseLoading:false,
|
||||
group:'',
|
||||
speed: 1,
|
||||
nowMode: '普通模式',
|
||||
nowMode: '正常操作',
|
||||
isShowSpeedMenuList: false,
|
||||
isShowModeMenuList: false,
|
||||
modeList: [
|
||||
{label: '故障模式', value: OperateMode.FAULT},
|
||||
{label: '普通模式', value: OperateMode.NORMAL}
|
||||
]
|
||||
isShowModeMenuList: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -68,25 +59,27 @@ export default {
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
isShowDirective() { // 哈尔滨项目 行调设备显示
|
||||
return this.$route.query.type === 'CW' && this.project === 'heb';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.group = this.$route.query.group;
|
||||
if (this.isShowDirective) {
|
||||
this.menuList.unshift({label: '指令模式', value: OperateMode.DIRECTIVE});
|
||||
}
|
||||
window.addEventListener('click', this.close, false);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('click', this.close);
|
||||
},
|
||||
methods:{
|
||||
changeOperateMode(mode) {
|
||||
this.nowMode = mode.label;
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: mode.value });
|
||||
changeOperateMode() {
|
||||
// this.nowMode = mode.label;
|
||||
let val = '';
|
||||
if (this.nowMode === '正常操作') {
|
||||
this.nowMode = '特殊操作';
|
||||
val = OperateMode.FAULT;
|
||||
} else {
|
||||
this.nowMode = '正常操作';
|
||||
val = OperateMode.NORMAL;
|
||||
}
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: val });
|
||||
},
|
||||
showMenuModeList() {
|
||||
event.stopPropagation();
|
||||
|
@ -41,7 +41,6 @@
|
||||
<train-ticket ref="trainTicket" />
|
||||
<draw-select ref="drawSelect" />
|
||||
<line-board ref="lineBoard" />
|
||||
<scene-list ref="sceneList" @selectScript="selectScript" @goToPay="goToPay" />
|
||||
<theory-exam-select ref="theoryExamSelect" @startTheoryExam="startTheoryExam" />
|
||||
<theory-exam ref="theoryExam" />
|
||||
<pay-page ref="payPage" />
|
||||
@ -52,13 +51,13 @@
|
||||
<run-plan-view ref="runPlanView" :group="group" />
|
||||
<SelectExam ref="selectExam" @examStart="examStart" />
|
||||
<ExamPanel ref="examPanel" />
|
||||
<TrainingList ref="trainingList" />
|
||||
|
||||
<training-tip v-if="trainingDetail||trainingId" ref="trainingTip" />
|
||||
<training-position-tip v-if="trainingDetail||trainingId" ref="trainingPositionTip" />
|
||||
<training-menu v-if="trainingDetail" ref="trainingMenu" :offset-bottom="offsetBottom" />
|
||||
<training-menu v-if="hasTraining" ref="trainingMenu" :offset-bottom="offsetBottom" />
|
||||
<TrainingDesign v-if="trainingDesignShow" ref="trainingDesign" />
|
||||
|
||||
<voice-chat-box v-if="hasVoice" :group="group" />
|
||||
<design-training-menu v-if="trainingDesign && trainingDetail" ref="trainingMenu" :offset-bottom="offsetBottom" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -80,9 +79,7 @@ import RegisterBook from '../registerBook/index';
|
||||
import TrainTicket from '../trainTicket/index';
|
||||
import DrawSelect from '@/jmapNew/theme/datie_01/menus/dialog/drawSelect';
|
||||
import LineBoard from '../displayCity/lineBoard';
|
||||
// TrainingMode
|
||||
import { ScriptMode } from '@/scripts/ConstDic';
|
||||
import SceneList from './sceneList';
|
||||
import TheoryExamSelect from './theoryExamSelect';
|
||||
import TheoryExam from './theoryExam';
|
||||
import PayPage from '@/views/newMap/displayNew/demon/payPage';
|
||||
@ -92,45 +89,40 @@ import SchedulingView from './schedulingView';
|
||||
import RunPlanView from './runPlanView';
|
||||
import SelectExam from './exam/selectExam';
|
||||
import ExamPanel from './exam/examPanel';
|
||||
import TrainingList from './trainingList/index.vue';
|
||||
import TrainingTip from './trainingList/trainingTip.vue';
|
||||
import TrainingPositionTip from './trainingList/trainingPositionTip.vue';
|
||||
import TrainingMenu from './trainingList/trainingMenu';
|
||||
import TrainingDesign from '@/views/trainingManage/index.vue';
|
||||
import VoiceChatBox from './voiceChatBox/index';
|
||||
import DesignTrainingMenu from './trainingList/designTrainingMenu';
|
||||
|
||||
export default {
|
||||
name: 'SimulationMenu',
|
||||
components: {
|
||||
// ChatBox,
|
||||
// voiceChatBox,
|
||||
// QrCode,
|
||||
SetTime,
|
||||
ModifyTime,
|
||||
// DistributeDraft,
|
||||
FlowData,
|
||||
RegisterBook,
|
||||
TrainTicket,
|
||||
DrawSelect,
|
||||
LineBoard,
|
||||
SceneList,
|
||||
TheoryExam,
|
||||
TheoryExamSelect,
|
||||
PayPage,
|
||||
Scheduling,
|
||||
SchedulingView,
|
||||
RunPlanView,
|
||||
// Equipment,
|
||||
SelectExam,
|
||||
ExamPanel,
|
||||
ContectUs,
|
||||
Jl3dDevice,
|
||||
MemberManage,
|
||||
TrainingList,
|
||||
TrainingTip,
|
||||
TrainingPositionTip,
|
||||
TrainingMenu,
|
||||
TrainingDesign
|
||||
// StatusIcon
|
||||
TrainingDesign,
|
||||
VoiceChatBox,
|
||||
DesignTrainingMenu
|
||||
},
|
||||
props: {
|
||||
mode: {
|
||||
@ -431,7 +423,6 @@ export default {
|
||||
{ label: '考试', name: 'exam', click: this.goExam, isShow: true },
|
||||
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isShow: true },
|
||||
{ label: '成员管理', name: 'memberManage', click: this.memberManage, isShow: true },
|
||||
{ label: '实训', name: 'trainingPane', click: this.trainingPane, isShow: true },
|
||||
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isShow: true },
|
||||
// { label: '权限分发', name: 'distribute', click: this.distribute, isShow: true },
|
||||
{
|
||||
@ -450,7 +441,10 @@ export default {
|
||||
DEPOT_DISPATCHER: '09',
|
||||
DRIVER: '04',
|
||||
RAIL_CTC: '10'
|
||||
}
|
||||
},
|
||||
hasVoice: false,
|
||||
hasTraining: false,
|
||||
trainingDesign: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -505,7 +499,6 @@ export default {
|
||||
'$store.state.map.mapDataLoadedCount': function (val) { // 地图数据加载完成
|
||||
if (this.trainingId) {
|
||||
getPublishTrainingDetail(this.trainingId).then(detailResp=>{
|
||||
// this.training = res.data;
|
||||
if (detailResp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(parseInt(mapLocation.scale), {x:mapLocation.x, y:mapLocation.y});
|
||||
@ -539,6 +532,9 @@ export default {
|
||||
item.isShow = val.hasLpf;
|
||||
}
|
||||
});
|
||||
this.hasVoice = val.hasVoice;
|
||||
this.hasTraining = val.hasTraining;
|
||||
this.trainingDesign = val.trainingDesign;
|
||||
this.menuList = [...this.allMenuList];
|
||||
}
|
||||
},
|
||||
@ -588,8 +584,6 @@ export default {
|
||||
this.allMenuList.forEach(item => {
|
||||
if (item.name === 'memberManage') {
|
||||
item.isShow = !domConfig.singleMember;
|
||||
} else if (item.name === 'trainingPane') {
|
||||
item.isShow = domConfig.hasTraining;
|
||||
} else if (item.name === 'exam') {
|
||||
item.isShow = domConfig.hasExam;
|
||||
}
|
||||
@ -706,14 +700,8 @@ export default {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// || this.isCtc
|
||||
if (this.project === 'bjd') {
|
||||
window.close();
|
||||
} else {
|
||||
// this.$store.dispatch('map/setShowCentralizedStationCode', '');
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
}
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
}
|
||||
},
|
||||
// 数字沙盘
|
||||
@ -976,9 +964,6 @@ export default {
|
||||
memberManage() {
|
||||
this.$refs.memberManage.doShow();
|
||||
},
|
||||
trainingPane() {
|
||||
this.$refs.trainingList.doShow();
|
||||
},
|
||||
changeFlowData() {
|
||||
this.hideMenuList();
|
||||
this.$refs.flowData.doShow();
|
||||
|
@ -299,7 +299,7 @@ export default {
|
||||
this.$jlmap.updateShowMode(list, '02');
|
||||
}
|
||||
if (this.mapData && this.mapData.pictureList) {
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes.includes(this.roleDeviceCode) && picture.type === 'chainStation');
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === 'chainStation');
|
||||
if (picture) {
|
||||
const list = [];
|
||||
const deviceList = [];
|
||||
|
@ -19,8 +19,8 @@
|
||||
</div>
|
||||
<div class="create-cmd">
|
||||
<!-- <span>通信正常</span> -->
|
||||
<el-button type="primary" @click="refreshSearch">刷新</el-button>
|
||||
<el-button type="primary" style="width: 100px" @click="createCmd">新建调度命令</el-button>
|
||||
<el-button :id="getDomObj('refreshSearch').domId" type="primary" @click="refreshSearch">刷新</el-button>
|
||||
<el-button :id="getDomObj('createCmd').domId" type="primary" style="width: 100px" @click="createCmd">新建调度命令</el-button>
|
||||
</div>
|
||||
<div class="box-title">
|
||||
<div class="contant-null" />
|
||||
@ -212,7 +212,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="condition-btn">
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
<el-button :id="getDomObj('search').domId" type="primary" @click="search">查询</el-button>
|
||||
<el-button type="primary" style="width: 100px" @click="clearCondition">清除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@ -403,9 +403,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="midle-bottom">
|
||||
<el-button type="primary" :disabled="!allographRow" @click="allographCmd">代签</el-button>
|
||||
<el-button type="primary" :disabled="disabledSent" @click="sendCmd">下达</el-button>
|
||||
<el-button type="primary" :disabled="disabledSent" @click="saveCacheData(true)">缓存</el-button>
|
||||
<el-button :id="getDomObj('allographCmd').domId" type="primary" :disabled="!allographRow" @click="allographCmd">代签</el-button>
|
||||
<el-button :id="getDomObj('sendCmd').domId" type="primary" :disabled="disabledSent" @click="sendCmd">下达</el-button>
|
||||
<el-button :id="getDomObj('saveCacheData').domId" type="primary" :disabled="disabledSent" @click="saveCacheData(true)">缓存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -421,6 +421,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import { mapState } from 'vuex';
|
||||
import { parseTime } from '@/utils/index';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
export default {
|
||||
name:'DispatcherCmd',
|
||||
data() {
|
||||
@ -645,6 +646,9 @@ export default {
|
||||
this.getTableHeight();
|
||||
},
|
||||
methods:{
|
||||
getDomObj(key) {
|
||||
return OperationEvent.DispatchCmd.menuButton[key];
|
||||
},
|
||||
activeChange(key) {
|
||||
this[key] = !this[key];
|
||||
this.getOperateTableHeight();
|
||||
@ -749,9 +753,18 @@ export default {
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.searchTable = [];
|
||||
this.searchCmd().then(res => {
|
||||
this.getSearchTable();
|
||||
const operate = {
|
||||
operation: this.getDomObj('search').operation,
|
||||
param: this.searchObj,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.searchTable = [];
|
||||
this.searchCmd().then(res => {
|
||||
this.getSearchTable();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getSearchTable() {
|
||||
@ -868,6 +881,11 @@ export default {
|
||||
},
|
||||
refreshSearch() {
|
||||
console.log('刷新');
|
||||
const operate = {
|
||||
operation: this.getDomObj('refreshSearch').operation,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate);
|
||||
this.searchCmd();
|
||||
},
|
||||
clearCondition() {
|
||||
@ -913,6 +931,11 @@ export default {
|
||||
resolve();
|
||||
}
|
||||
}).then(() => {
|
||||
const operate = {
|
||||
operation: this.getDomObj('createCmd').operation,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate);
|
||||
this.initData();
|
||||
this.getSenderName();
|
||||
sendCommandNew(this.group, 'CTC_NEW_DIS_COMMAND', {}).then((res) => {
|
||||
@ -979,7 +1002,7 @@ export default {
|
||||
};
|
||||
if (obj) {
|
||||
data = {
|
||||
name: obj.label,
|
||||
name: obj.label || '',
|
||||
rsCompany: false,
|
||||
cpType: this.typeTransition[obj.type] || obj.type,
|
||||
code: obj.deviceCode || this.DisStationId
|
||||
@ -1037,9 +1060,19 @@ export default {
|
||||
this.$messageBox('请选择受令单位');
|
||||
return;
|
||||
}
|
||||
this.cacheCmd(showMsg).then(suc => {
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
const params = Object.assign({}, this.command);
|
||||
const operate = {
|
||||
operation: this.getDomObj('saveCacheData').operation,
|
||||
param: params,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.cacheCmd(showMsg).then(suc => {
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -1088,13 +1121,23 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('代签');
|
||||
sendCommandNew(this.group, 'CTC_SIGN_DIS_COMMAND', {cmdId: this.command.cmdId, rcId: this.allographRow.cpId, proxySign: true}).then((res) => {
|
||||
console.log(res, '---res');
|
||||
this.$message.success('代签成功!');
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
}).catch(error => {
|
||||
this.$messageBox('代签令失败:' + error.message);
|
||||
const params = {cmdId: this.command.cmdId, rcId: this.allographRow.cpId, proxySign: true};
|
||||
const operate = {
|
||||
operation: this.getDomObj('allographCmd').operation,
|
||||
param: params,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
sendCommandNew(this.group, 'CTC_SIGN_DIS_COMMAND', params).then((res) => {
|
||||
console.log(res, '---res');
|
||||
this.$message.success('代签成功!');
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
}).catch(error => {
|
||||
this.$messageBox('代签令失败:' + error.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
console.log('取消代签');
|
||||
@ -1125,17 +1168,27 @@ export default {
|
||||
this.$messageBox('请选择受令单位');
|
||||
return;
|
||||
}
|
||||
this.cacheCmd().then(suc => {
|
||||
sendCommandNew(this.group, 'CTC_SEND_DIS_COMMAND', {cmdId: this.command.cmdId}).then((res) => {
|
||||
console.log(res, '---res');
|
||||
this.$message.success('发送调度命令成功!');
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
}).catch(error => {
|
||||
this.$messageBox('发送调度命令失败:' + error.message);
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log('缓存调度命令失败', err);
|
||||
const params = Object.assign({}, this.command);
|
||||
const operate = {
|
||||
operation: this.getDomObj('sendCmd').operation,
|
||||
param: params,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.cacheCmd().then(suc => {
|
||||
sendCommandNew(this.group, 'CTC_SEND_DIS_COMMAND', params).then((res) => {
|
||||
console.log(res, '---res');
|
||||
this.$message.success('发送调度命令成功!');
|
||||
this.searchCmd();
|
||||
this.initData();
|
||||
}).catch(error => {
|
||||
this.$messageBox('发送调度命令失败:' + error.message);
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log('缓存调度命令失败', err);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -8,6 +8,7 @@
|
||||
<script>
|
||||
import StationDiagram from '../stationDiagram/index';
|
||||
import {mapGetters} from 'vuex';
|
||||
import { clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
export default {
|
||||
name: 'DispatchWork',
|
||||
components: {
|
||||
@ -30,6 +31,9 @@ export default {
|
||||
},
|
||||
mapDevice() {
|
||||
return this.$store.state.map.mapDevice;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -47,6 +51,10 @@ export default {
|
||||
return this.$store.state.map.mapDevice;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearSubscribe(getTopic('ATS_STATUS', this.group));
|
||||
clearSubscribe(getTopic('STATE', this.group));
|
||||
},
|
||||
methods: {
|
||||
setSelected(val) {
|
||||
this.selected = val;
|
||||
|
@ -13,7 +13,7 @@
|
||||
:src="item.imgUrl"
|
||||
/>
|
||||
</div>
|
||||
<div class="text">{{ item.label }}</div>
|
||||
<div :id="DispatcherManageDomObj[item.domId].domId" class="text">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -24,6 +24,7 @@
|
||||
import ZhanchangIcon from '@/assets/dispatcherStation/zhanchang.png';
|
||||
import YunxingIcon from '@/assets/dispatcherStation/yunxing.png';
|
||||
import CmdIcon from '@/assets/dispatcherStation/cmd.png';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
export default {
|
||||
name: 'DispatcherManage',
|
||||
components: {
|
||||
@ -37,26 +38,31 @@ export default {
|
||||
{
|
||||
label: '运行图',
|
||||
refPath: 'schedulingPlan',
|
||||
domId: 'schedulingPlan',
|
||||
imgUrl: YunxingIcon
|
||||
},
|
||||
{
|
||||
label: '调度命令',
|
||||
refPath: 'dispatchingCommand',
|
||||
domId: 'dispatchingCommand',
|
||||
imgUrl: CmdIcon
|
||||
},
|
||||
{
|
||||
label: '站场图',
|
||||
refPath: 'dispatchWork',
|
||||
domId: 'dispatchWork',
|
||||
imgUrl: ZhanchangIcon
|
||||
},
|
||||
{
|
||||
label: '数据更新',
|
||||
refPath: '',
|
||||
domId: 'dataUpdate',
|
||||
imgUrl: CmdIcon
|
||||
},
|
||||
{
|
||||
label: '时间同步',
|
||||
refPath: '',
|
||||
domId: 'timeLock',
|
||||
imgUrl: CmdIcon
|
||||
}
|
||||
],
|
||||
@ -75,6 +81,9 @@ export default {
|
||||
computed: {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
DispatcherManageDomObj() {
|
||||
return OperationEvent.DispatcherManage.menu || {};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -95,6 +104,11 @@ export default {
|
||||
this.$emit('pictureChange', refPath);
|
||||
}, 100);
|
||||
}
|
||||
const operate = {
|
||||
operation: this.DispatcherManageDomObj[refPath].operation,
|
||||
userOperationType: 'leftClick'
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate);
|
||||
},
|
||||
clickMenu(refPath) {
|
||||
this.$alert('实现中......', '提示', {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<script>
|
||||
import {getSimulationMemberList, getAllSimulationUser} from '@/api/simulation';
|
||||
import {getToken} from '@/utils/auth';
|
||||
import {creatSubscribe, clearSubscribe, displayTopic, getTopic} from '@/utils/stomp';
|
||||
import {creatSubscribe, clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
import { defaultCallback, stateCallback } from '@/utils/subscribeCallback';
|
||||
import DispatcherWork from './dispatchWork';
|
||||
import LocalWork from './localWork';
|
||||
@ -83,7 +83,8 @@ export default {
|
||||
menuShow: true,
|
||||
centralizedStationList: [],
|
||||
centralizedStationMap: {},
|
||||
loading: false
|
||||
loading: false,
|
||||
isFirst: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -108,7 +109,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
||||
this.subscribe();
|
||||
this.subscribe('STATE');
|
||||
this.subscribe('ATS_STATUS');
|
||||
if (this.isFirst) {
|
||||
this.$store.dispatch('training/setMapDefaultState');
|
||||
this.isFirst = false;
|
||||
}
|
||||
},
|
||||
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
|
||||
this.initMemberUserInfo();
|
||||
@ -126,6 +132,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.isFirst = true;
|
||||
this.subscribe('COMMON');
|
||||
this.$store.commit('training/notifyGetCommandDefinition', this.lineCode); // 获取指令列表
|
||||
},
|
||||
beforeDestroy() {
|
||||
@ -148,21 +156,37 @@ export default {
|
||||
this.$messageBox('获取仿真成员或用户列表失败!');
|
||||
}
|
||||
},
|
||||
async subscribe() { // 根据显示端分别订阅
|
||||
subscribe(type) { // 根据显示端分别订阅
|
||||
const header = {group: this.group || '', 'X-Token': getToken()};
|
||||
await creatSubscribe(`${displayTopic}\/${this.group}`, header, defaultCallback);
|
||||
await creatSubscribe(getTopic('STATE', this.group), header, stateCallback);
|
||||
if (this.picture === 'trafficTerminal') {
|
||||
await creatSubscribe(getTopic('CTC', this.group), header, defaultCallback);
|
||||
switch (type) {
|
||||
case 'COMMON':
|
||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||
break;
|
||||
case 'ATS_STATUS':
|
||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||
break;
|
||||
case 'STATE':
|
||||
creatSubscribe(getTopic(type, this.group), header, stateCallback);
|
||||
break;
|
||||
case 'CTC':
|
||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||
break;
|
||||
case 'LPF':
|
||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||
break;
|
||||
}
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
// creatSubscribe(`${displayTopic}\/${this.group}`, header, defaultCallback);
|
||||
// creatSubscribe(getTopic('STATE', this.group), header, stateCallback);
|
||||
// if (this.picture === 'trafficTerminal') {
|
||||
// creatSubscribe(getTopic('CTC', this.group), header, defaultCallback);
|
||||
// }
|
||||
// this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||
clearSubscribe(getTopic('COMMON', this.group));
|
||||
clearSubscribe(getTopic('ATS_STATUS', this.group));
|
||||
clearSubscribe(getTopic('STATE', this.group));
|
||||
if (this.picture === 'trafficTerminal') {
|
||||
clearSubscribe(getTopic('CTC', this.group));
|
||||
}
|
||||
clearSubscribe(getTopic('CTC', this.group));
|
||||
},
|
||||
loadingChange() {
|
||||
this.loading = true;
|
||||
@ -174,6 +198,10 @@ export default {
|
||||
this.$nextTick(() => { this.$refs.ibpPlate.show(this.roleDeviceCode, ''); });
|
||||
} else if (val === 'drivingPlan') {
|
||||
this.$nextTick(() => { this.$refs.jl3dDrive.show(this.mapId, this.group); this.mapViewLoaded(true); });
|
||||
} else if (val === 'trafficTerminal') {
|
||||
this.$nextTick(() => { this.subscribe('CTC'); });
|
||||
} else if (val === 'largePassengerView') {
|
||||
this.$nextTick(() => { this.subscribe('LPF'); });
|
||||
}
|
||||
this.$nextTick(() => { this.loading = false; });
|
||||
},
|
||||
|
@ -56,8 +56,8 @@
|
||||
import echarts from 'echarts';
|
||||
import { mapGetters } from 'vuex';
|
||||
// import { clearSimulation } from '@/api/simulation';
|
||||
import { creatSubscribe, clearSubscribe, LPFTopic} from '@/utils/stomp';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { clearSubscribe, LPFTopic} from '@/utils/stomp';
|
||||
// import { getToken } from '@/utils/auth';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
export default {
|
||||
name:'BigLPFStrategy',
|
||||
@ -167,7 +167,7 @@ export default {
|
||||
}
|
||||
});
|
||||
this.loadInitData();
|
||||
this.subscribe();
|
||||
// this.subscribe();
|
||||
},
|
||||
'$store.state.socket.standPfiNum':function(val) {
|
||||
if (val) {
|
||||
@ -199,11 +199,12 @@ export default {
|
||||
loadMapDataById(this.$route.query.mapId, 'parse');
|
||||
},
|
||||
methods:{
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header);
|
||||
},
|
||||
// async subscribe() {
|
||||
// this.clearSubscribe();
|
||||
// const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
// creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header);
|
||||
// console.log('----------------');
|
||||
// },
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${LPFTopic}\/${this.group}`);
|
||||
},
|
||||
|
@ -8,6 +8,7 @@
|
||||
<script>
|
||||
import StationDiagram from '../stationDiagram/index';
|
||||
import {mapGetters} from 'vuex';
|
||||
import { clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
export default {
|
||||
name: 'LocalWork',
|
||||
components: {
|
||||
@ -41,11 +42,14 @@ export default {
|
||||
return this.$store.state.map.mapDevice;
|
||||
},
|
||||
roleDeviceCode() {
|
||||
return this.$store.state.trainingNew.roleDeviceCode;
|
||||
return this.$store.state.training.roleDeviceCode;
|
||||
},
|
||||
// 大铁线路
|
||||
datie() {
|
||||
return ['16', '19'].includes(this.$route.query.lineCode);
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -58,8 +62,21 @@ export default {
|
||||
},
|
||||
'$store.state.map.initJlmapLoadedCount': function (val) {
|
||||
this.handleLocalWorkData();
|
||||
},
|
||||
'$store.state.training.roleDeviceCode': function (val) {
|
||||
const type = this.datie ? 'chainStation' : 'localWork';
|
||||
if (this.mapData && this.mapData.pictureList) {
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
|
||||
if (picture) {
|
||||
this.handlerPictureShow(picture);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearSubscribe(getTopic('ATS_STATUS', this.group));
|
||||
clearSubscribe(getTopic('STATE', this.group));
|
||||
},
|
||||
methods: {
|
||||
setSelected(val) {
|
||||
this.selected = val;
|
||||
@ -68,20 +85,13 @@ export default {
|
||||
const logicData = {routeData:this.$store.state.map.routeData, autoReentryData: this.$store.state.map.autoReentryData};
|
||||
const repaint = this.$store.state.map.initJlmapLoadedCount === 1;
|
||||
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
|
||||
// if (this.lineCode === '14') {
|
||||
// const list = [];
|
||||
// for (const key in this.mapDevice) {
|
||||
// list.push(this.mapDevice[key]);
|
||||
// }
|
||||
// this.$jlmap.updateShowMode(list, '02');
|
||||
// }
|
||||
if (this.mapData && this.mapData.pictureList) {
|
||||
let type = this.datie ? 'chainStation' : 'localWork';
|
||||
const station = this.mapDevice[this.roleDeviceCode];
|
||||
if (station && station.depot) {
|
||||
type = 'chainStation';
|
||||
}
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
|
||||
const station = this.mapDevice[this.roleDeviceCode];
|
||||
if (station && station.depot) {
|
||||
type = 'chainStation';
|
||||
}
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
|
||||
if (picture) {
|
||||
this.handlerPictureShow(picture);
|
||||
} else {
|
||||
|
@ -8,6 +8,7 @@
|
||||
<script>
|
||||
import StationDiagram from '../stationDiagram/index';
|
||||
import {mapGetters} from 'vuex';
|
||||
import { clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
export default {
|
||||
name: 'CtcWork',
|
||||
components: {
|
||||
@ -42,6 +43,9 @@ export default {
|
||||
},
|
||||
roleDeviceCode() {
|
||||
return this.$store.state.trainingNew.roleDeviceCode;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -56,6 +60,11 @@ export default {
|
||||
this.handleTrafficTerminalWorkData();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearSubscribe(getTopic('ATS_STATUS', this.group));
|
||||
clearSubscribe(getTopic('STATE', this.group));
|
||||
clearSubscribe(getTopic('CTC', this.group));
|
||||
},
|
||||
methods: {
|
||||
setSelected(val) {
|
||||
this.selected = val;
|
||||
@ -65,7 +74,7 @@ export default {
|
||||
const repaint = this.$store.state.map.initJlmapLoadedCount === 1;
|
||||
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
|
||||
if (this.mapData && this.mapData.pictureList) {
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes.includes(this.roleDeviceCode) && picture.type === 'chainStation');
|
||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === 'chainStation');
|
||||
if (picture) {
|
||||
this.handlerPictureShow(picture);
|
||||
} else {
|
||||
|
326
src/views/newMap/display/trainingList/designTrainingMenu.vue
Normal file
326
src/views/newMap/display/trainingList/designTrainingMenu.vue
Normal file
@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<!-- v-drag 拖拽 调整宽高 -->
|
||||
<div v-quickMenuDrag class="reminder-drag" :style="{bottom: offsetBottom + 'px'}">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<div>
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<i v-show="!isShrink && !trainingSwitch && trainingDetail" class="icon el-icon-video-play" @click="handlerStart" />
|
||||
<i v-show="!isShrink && trainingSwitch" class="icon el-icon-switch-button" @click="handlerEnd" />
|
||||
</div>
|
||||
<p style="color: #fff;">
|
||||
<span>{{ trainingDetail.name }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="isShrink" class="reminder-box-content">
|
||||
<div class="zhezhao" />
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('display.training.trainingName') }}</span>
|
||||
<span class="list-elem">{{ trainingDetail.name }}</span>
|
||||
</p>
|
||||
<p v-if="demoMode === TrainingMode.TEST" class="list-item">
|
||||
<span class="list-label">{{ $t('display.lesson.score') }}</span>
|
||||
<span class="list-elem">{{ trainingScore }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">实训模式:</span>
|
||||
<span class="list-elem">
|
||||
<el-radio-group v-model="demoMode" :disabled="trainingSwitch" class="mode" size="small" @change="changeMode">
|
||||
<el-radio :label="TrainingMode.TEACH" border>{{ $t('display.lesson.teachingMode') }}</el-radio>
|
||||
<el-radio :label="TrainingMode.PRACTICE" border>{{ $t('display.lesson.practiceMode') }}</el-radio>
|
||||
<el-radio :label="TrainingMode.TEST" border>{{ $t('display.lesson.testMode') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label" style="vertical-align: top;"> {{ $t('display.training.trainingInstructions') }}</span>
|
||||
<span class="list-elem elem-span">{{ trainingDetail.description }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">操作按钮:</span>
|
||||
<span class="list-elem">
|
||||
<el-button v-if="!trainingSwitch && trainingDetail" size="small" type="success" @click="handlerStart">开始</el-button>
|
||||
<el-button v-if="trainingSwitch" size="small" type="danger" @click="handlerEnd">结束</el-button>
|
||||
</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="drag-right" />
|
||||
<div class="drag-left" />
|
||||
<div class="drag-bottom" />
|
||||
<div class="drag-top" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scene-play-role ref="scenePlayRole" @startTraining="startTraining" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ScriptMode } from '@/scripts/ConstDic';
|
||||
import { clearSimulation } from '@/api/simulation';
|
||||
import { startTraining, endTraining } from '@/api/jmap/training';
|
||||
import ScenePlayRole from './scenePlayRole';
|
||||
|
||||
export default {
|
||||
name: 'TipTrainingDetail',
|
||||
components: {
|
||||
ScenePlayRole
|
||||
},
|
||||
props: {
|
||||
offsetBottom: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShrink: true,
|
||||
showSumbit: false,
|
||||
demoMode: ScriptMode.TEACH,
|
||||
TrainingMode: ScriptMode,
|
||||
scoreList: [],
|
||||
trainingScore: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
trainingSwitch() {
|
||||
return this.$store.state.trainingNew.trainingSwitch;
|
||||
},
|
||||
trainingDetail() {
|
||||
return this.$store.state.trainingNew.trainingDetail;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
teachMode() {
|
||||
return this.$store.state.trainingNew.teachMode;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.trainingNew.stepOrder': function(val) {
|
||||
const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson);
|
||||
const scoringRule = JSON.parse(this.$store.state.trainingNew.trainingDetail.scoringRuleJson);
|
||||
const rule = scoringRule.find(rule => rule.memberId == this.playerId);
|
||||
if (rule[val - 1]) {
|
||||
this.scoreList.push(rule[val - 1]);
|
||||
this.scoreList.reduce((previousValue, currentValue) => previousValue + currentValue, this.trainingScore);
|
||||
}
|
||||
if (val >= 1 && val < stepList.length) {
|
||||
const msg = {content:stepList[val].description, memberId:stepList[val].memberId};
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', msg);
|
||||
} else {
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', null);
|
||||
val && this.$store.dispatch('socket/trainingOverCountIncrease');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.showSumbit = false;
|
||||
},
|
||||
shrink() {
|
||||
if (this.isShrink) {
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.isShrink = true;
|
||||
this.$nextTick(()=>{
|
||||
const dragDom = document.querySelector('.reminder-drag').style.bottom;
|
||||
if (document.body.clientHeight - 300 - parseInt(dragDom.replace('px', '')) < 0) {
|
||||
document.querySelector('.reminder-drag').style.bottom = `${document.body.clientHeight - 300}px`;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
changeMode(val) {
|
||||
this.demoMode = val;
|
||||
this.$store.dispatch('trainingNew/changeTeachMode', this.demoMode);
|
||||
},
|
||||
handlerStart() {
|
||||
if (this.trainingDetail.type === 'SCENE') {
|
||||
this.$refs.scenePlayRole.doShow();
|
||||
} else {
|
||||
this.startTraining();
|
||||
}
|
||||
},
|
||||
startTraining() {
|
||||
this.$store.dispatch('trainingNew/changeTeachMode', this.demoMode);
|
||||
startTraining(this.group, {mode: this.demoMode}).then(() => {
|
||||
this.$store.dispatch('trainingNew/trainingStart');
|
||||
const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson);
|
||||
this.playerId = stepList[0].memberId;
|
||||
const msg = {content:stepList[0].description, memberId:stepList[0].memberId};
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', msg);
|
||||
}).catch(() => {
|
||||
this.$message.error('开始实训失败!');
|
||||
});
|
||||
},
|
||||
handlerEnd() {
|
||||
endTraining(this.group).then((resp) => {
|
||||
this.$store.dispatch('trainingNew/trainingEnd');
|
||||
this.$store.dispatch('trainingNew/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearStepOrder');
|
||||
this.$store.dispatch('trainingNew/clearOperateOrder');
|
||||
}).catch(() => {
|
||||
this.$message.error('结束实训失败!');
|
||||
});
|
||||
},
|
||||
back() {
|
||||
if (this.group) {
|
||||
clearSimulation(this.group);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.tip-body-box {
|
||||
height: 260px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.reminder-drag{
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 15px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.elem-span{
|
||||
display:inline-block;width:77%;line-height:26px;margin-top:-4px;
|
||||
}
|
||||
|
||||
.zhezhao{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
filter: blur(8px);
|
||||
background: rgba(255,255,255,0.9);
|
||||
position:absolute;
|
||||
}
|
||||
.reminder-box-content{
|
||||
width: 500px;
|
||||
height: 260px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
background: rgba(255,255,255,0.8);
|
||||
position: relative;
|
||||
}
|
||||
.reminder-box {
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
font-size: 18px;
|
||||
|
||||
.tip-title {
|
||||
width: 500px;
|
||||
overflow: hidden;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
background-color: rgba(64, 158, 255,1);
|
||||
border-radius: 5px 5px 0 0;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.drag-right,
|
||||
.drag-left {
|
||||
width: 10px;
|
||||
cursor: e-resize;
|
||||
background-color: yellow;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.drag-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.drag-bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
cursor: s-resize;
|
||||
background-color: yellow;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.drag-top {
|
||||
position: absolute;
|
||||
top: -45px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
cursor: s-resize;
|
||||
background-color: yellow;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.tip-body {
|
||||
height: 260px;
|
||||
padding: 10px;
|
||||
|
||||
.list-label {
|
||||
width: 105px;
|
||||
}
|
||||
}
|
||||
|
||||
.tip-foot {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background-color: #fff;
|
||||
padding: 10px 0 10px 10px;
|
||||
|
||||
.foot-detail {
|
||||
height: 100%;
|
||||
float: right;
|
||||
margin-top: 9px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.foot-submit {
|
||||
float: right;
|
||||
margin-top: 9px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/deep/ {
|
||||
.el-tree-node__content {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #d6e5f7;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,235 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="实训" :visible.sync="dialogVisible" width="1000px" :before-close="doClose" center>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<div style="margin-bottom: 10px;font-size: 16px;">{{ `当前实训名称:${training.name || ''}` }}</div>
|
||||
<div style="font-size: 16px;">{{ `当前实训描述:${training.description || ''}` }}</div>
|
||||
</el-card>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="单操实训" name="first">
|
||||
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="场景实训" name="second">
|
||||
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryListScene" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishSingleList, getPublishTrainingDetail, loadPublishTraining, getPublishScenesList } from '@/api/jmap/training';
|
||||
import Cookies from 'js-cookie';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
export default {
|
||||
name: 'TrainingList',
|
||||
components:{
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
activeName: 'first',
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
training: {},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
show:false
|
||||
},
|
||||
prdTypeMap: {
|
||||
DISPATCHER: '02',
|
||||
STATION_SUPERVISOR: '01',
|
||||
STATION_ASSISTANT: '01',
|
||||
DEPOT_DISPATCHER: '09',
|
||||
DRIVER: '04',
|
||||
RAIL_CTC: '10'
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
indexShow: true,
|
||||
height: 500,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('trainingManage.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.description'),
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.type'),
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.covertData(row); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.labelJson'),
|
||||
prop: 'labelJson'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('trainingManage.operate'),
|
||||
width: '150',
|
||||
buttons: [
|
||||
{
|
||||
name: '加载',
|
||||
handleClick: this.loadScript,
|
||||
type: 'primary',
|
||||
showControl:(row) => { return row.id; }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
queryListScene: {
|
||||
query: this.queryFunctionScene,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
indexShow: true,
|
||||
height: 500,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('trainingManage.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.description'),
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.type'),
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.covertData(row); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.labelJson'),
|
||||
prop: 'labelJson'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('trainingManage.operate'),
|
||||
width: '150',
|
||||
buttons: [
|
||||
{
|
||||
name: '加载',
|
||||
handleClick: this.loadScript,
|
||||
type: 'primary',
|
||||
showControl:(row) => { return row.id; }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
teachMode() {
|
||||
return this.$store.state.trainingNew.teachMode;
|
||||
},
|
||||
trainingSwitch() {
|
||||
return this.$store.state.trainingNew.trainingSwitch;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryFunction() {
|
||||
return getPublishSingleList(this.mapId);
|
||||
},
|
||||
queryFunctionScene() {
|
||||
return getPublishScenesList(this.mapId);
|
||||
},
|
||||
doShow() {
|
||||
this.getListData();
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
async loadScript(index, data) {
|
||||
if (this.trainingSwitch) {
|
||||
this.$message.error('请先结束当前实训后再加载新的实训!');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const detailResp = await getPublishTrainingDetail(data.id);
|
||||
this.training = detailResp.data;
|
||||
if (detailResp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
}
|
||||
if (detailResp.data.playerIdJson) {
|
||||
const playerId = JSON.parse(detailResp.data.playerIdJson)[0];
|
||||
if (playerId) {
|
||||
const member = this.$store.state.training.memberData[playerId];
|
||||
this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
|
||||
this.$store.dispatch('training/setRoles', member.type);
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
||||
this.$store.dispatch('trainingNew/setTrainingScore', '');
|
||||
await loadPublishTraining(this.group, data.id, {mode: this.teachMode});
|
||||
this.$message.success('加载实训成功!');
|
||||
} catch (e) {
|
||||
this.$message.error('加载实训失败!');
|
||||
}
|
||||
},
|
||||
covertData(row) {
|
||||
const releaseReview = ConstConfig.ConstSelect.trainingType;
|
||||
const lastData = Object.assign({}, row);
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
releaseReview.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (lastData.type == rolename) {
|
||||
lastData.type = element.enlabel;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
releaseReview.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (lastData.type == rolename) {
|
||||
lastData.type = element.label;
|
||||
}
|
||||
});
|
||||
}
|
||||
return lastData.type;
|
||||
},
|
||||
getListData() {
|
||||
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 10px 25px 10px 25px;
|
||||
}
|
||||
.box-card{
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.trainingHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 5px;
|
||||
.flexNull {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -3,19 +3,21 @@
|
||||
<div v-quickMenuDrag class="reminder-drag" :style="{bottom: offsetBottom + 'px'}">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<div>
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<div style="display: flex;justify-content: center;align-items: center;">
|
||||
<el-button v-show="showMenu" plain type="success" size="mini" style="margin-right: 10px;" @click="changeShow(false)">实训列表</el-button>
|
||||
<el-button v-show="!showMenu && trainingDetail" plain type="success" size="mini" style="margin-right: 10px;" @click="changeShow(true)">实训菜单</el-button>
|
||||
<i v-show="!isShrink && !trainingSwitch && trainingDetail" class="icon el-icon-video-play" @click="handlerStart" />
|
||||
<i v-show="!isShrink && trainingSwitch" class="icon el-icon-switch-button" @click="handlerEnd" />
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
</div>
|
||||
<p style="color: #fff;">
|
||||
<span>{{ trainingDetail.name }}</span>
|
||||
<span>{{ trainingDetail ?trainingDetail.name:'' }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="isShrink" class="reminder-box-content">
|
||||
<div class="zhezhao" />
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div v-if="showMenu" ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
@ -54,6 +56,16 @@
|
||||
<div class="drag-bottom" />
|
||||
<div class="drag-top" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="单操实训" name="first">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="场景实训" name="second">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryListScene" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scene-play-role ref="scenePlayRole" @startTraining="startTraining" />
|
||||
@ -65,7 +77,7 @@ import { ScriptMode } from '@/scripts/ConstDic';
|
||||
import { clearSimulation } from '@/api/simulation';
|
||||
import { startTraining, endTraining } from '@/api/jmap/training';
|
||||
import ScenePlayRole from './scenePlayRole';
|
||||
|
||||
import { getPublishSingleList, getPublishTrainingDetail, loadPublishTraining, getPublishScenesList } from '@/api/jmap/training';
|
||||
export default {
|
||||
name: 'TipTrainingDetail',
|
||||
components: {
|
||||
@ -82,16 +94,94 @@ export default {
|
||||
isShrink: true,
|
||||
showSumbit: false,
|
||||
demoMode: ScriptMode.TEACH,
|
||||
TrainingMode: ScriptMode
|
||||
TrainingMode: ScriptMode,
|
||||
activeName: 'first',
|
||||
showMenu: false,
|
||||
scoreList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
training: {},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
show:false
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
indexShow: true,
|
||||
height: 200,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('trainingManage.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.description'),
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.labelJson'),
|
||||
prop: 'labelJson'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('trainingManage.operate'),
|
||||
buttons: [
|
||||
{
|
||||
name: '加载',
|
||||
handleClick: this.loadScript,
|
||||
type: 'primary',
|
||||
showControl:(row) => { return row.id; }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
queryListScene: {
|
||||
query: this.queryFunctionScene,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
indexShow: true,
|
||||
height: 200,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('trainingManage.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.description'),
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
title: this.$t('trainingManage.labelJson'),
|
||||
prop: 'labelJson'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('trainingManage.operate'),
|
||||
buttons: [
|
||||
{
|
||||
name: '加载',
|
||||
handleClick: this.loadScript,
|
||||
type: 'primary',
|
||||
showControl:(row) => { return row.id; }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
playerId: '',
|
||||
trainingScore: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
trainingSwitch() {
|
||||
return this.$store.state.trainingNew.trainingSwitch;
|
||||
},
|
||||
trainingScore() {
|
||||
return this.$store.state.trainingNew.trainingScore;
|
||||
},
|
||||
trainingDetail() {
|
||||
return this.$store.state.trainingNew.trainingDetail;
|
||||
},
|
||||
@ -100,19 +190,29 @@ export default {
|
||||
},
|
||||
teachMode() {
|
||||
return this.$store.state.trainingNew.teachMode;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.trainingNew.stepOrder': function(val) {
|
||||
const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson);
|
||||
const scoringRule = JSON.parse(this.$store.state.trainingNew.trainingDetail.scoringRuleJson);
|
||||
const rule = scoringRule.find(rule => rule.memberId == this.playerId);
|
||||
if (rule.details && stepList[val - 1]) {
|
||||
const scoreRule = rule.details.find(item => item.elementId == stepList[val - 1].id );
|
||||
this.scoreList.push(scoreRule);
|
||||
this.trainingScore += scoreRule.score;
|
||||
console.log(this.scoreList, this.trainingScore, rule, scoreRule, stepList[val - 1].id, scoreRule.score, scoreRule.elementId);
|
||||
}
|
||||
if (val >= 1 && val < stepList.length) {
|
||||
const msg = {content:stepList[val].description, memberId:stepList[val].memberId};
|
||||
this.$store.dispatch('socket/setTrainingStepTip', msg);
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', msg);
|
||||
} else {
|
||||
this.$store.dispatch('socket/setTrainingStepTip', null);
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', null);
|
||||
val && this.$store.dispatch('socket/trainingOverCountIncrease');
|
||||
}
|
||||
// operateOrder;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -122,6 +222,9 @@ export default {
|
||||
loadInitData() {
|
||||
this.showSumbit = false;
|
||||
},
|
||||
changeShow(val) {
|
||||
this.showMenu = val;
|
||||
},
|
||||
shrink() {
|
||||
if (this.isShrink) {
|
||||
this.isShrink = false;
|
||||
@ -150,21 +253,21 @@ export default {
|
||||
this.$store.dispatch('trainingNew/changeTeachMode', this.demoMode);
|
||||
startTraining(this.group, {mode: this.demoMode}).then(() => {
|
||||
this.$store.dispatch('trainingNew/trainingStart');
|
||||
this.$store.dispatch('trainingNew/setTrainingScore', '');
|
||||
const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson);
|
||||
const msg = {content:stepList[0].description, memberId:stepList[0].memberId};
|
||||
this.$store.dispatch('socket/setTrainingStepTip', msg);
|
||||
this.$store.dispatch('trainingNew/setTrainingStepTip', msg);
|
||||
}).catch(() => {
|
||||
this.$message.error('开始实训失败!');
|
||||
});
|
||||
},
|
||||
handlerEnd() {
|
||||
endTraining(this.group).then((resp) => {
|
||||
endTraining(this.group, { scoreList: this.scoreList }).then((resp) => {
|
||||
this.$store.dispatch('trainingNew/trainingEnd');
|
||||
this.$store.dispatch('socket/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearTrainingStepTip');
|
||||
this.$store.dispatch('trainingNew/clearStepOrder');
|
||||
this.$store.dispatch('trainingNew/clearOperateOrder');
|
||||
this.$store.dispatch('trainingNew/setTrainingScore', resp.data);
|
||||
this.scoreList = [];
|
||||
this.trainingScore = 0;
|
||||
}).catch(() => {
|
||||
this.$message.error('结束实训失败!');
|
||||
});
|
||||
@ -173,6 +276,41 @@ export default {
|
||||
if (this.group) {
|
||||
clearSimulation(this.group);
|
||||
}
|
||||
},
|
||||
queryFunction() {
|
||||
return getPublishSingleList(this.mapId);
|
||||
},
|
||||
queryFunctionScene() {
|
||||
return getPublishScenesList(this.mapId);
|
||||
},
|
||||
async loadScript(index, data) {
|
||||
if (this.trainingSwitch) {
|
||||
this.$message.error('请先结束当前实训后再加载新的实训!');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const detailResp = await getPublishTrainingDetail(data.id);
|
||||
this.training = detailResp.data;
|
||||
if (detailResp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
}
|
||||
this.playerId = '';
|
||||
if (detailResp.data.playerIdJson) {
|
||||
this.playerId = JSON.parse(detailResp.data.playerIdJson)[0];
|
||||
// if (playerId) {
|
||||
// const member = this.$store.state.training.memberData[playerId];
|
||||
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
|
||||
// this.$store.dispatch('training/setRoles', member.type);
|
||||
// }
|
||||
}
|
||||
this.showMenu = true;
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
||||
await loadPublishTraining(this.group, data.id, {mode: this.teachMode});
|
||||
this.$message.success('加载实训成功!');
|
||||
} catch (e) {
|
||||
this.$message.error('加载实训失败!');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -190,7 +328,7 @@ export default {
|
||||
|
||||
.reminder-drag{
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
bottom: 0;
|
||||
left: 15px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.trainingStepTip': function(val) {
|
||||
'$store.state.trainingNew.trainingStepTip': function(val) {
|
||||
if (val && this.trainingDetail.type === 'SINGLE') {
|
||||
const member = this.$store.state.training.memberData[val.memberId];
|
||||
this.$nextTick(function() {
|
||||
@ -67,14 +67,13 @@ export default {
|
||||
this.position = { x: 0, y: 0 };
|
||||
},
|
||||
'$store.state.training.tipEvent': function (val) {
|
||||
setTimeout(() => { this.tipInit(); }, 300);
|
||||
this.$nextTick(function() {
|
||||
this.tipInit();
|
||||
});
|
||||
if (this.tip) {
|
||||
setTimeout(() => { this.tipInit(); }, 10);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tipInit() {
|
||||
async tipInit() {
|
||||
if (this.teachMode === ScriptMode.TEACH) {
|
||||
this.tipShow = true;
|
||||
const offset = this.$store.state.config.canvasOffset;
|
||||
@ -84,7 +83,7 @@ export default {
|
||||
if (steps && steps.length) {
|
||||
const step = steps[stepOrder];
|
||||
const distance = 5;
|
||||
this.tip = this.$store.state.socket.trainingStepTip ? this.$store.state.socket.trainingStepTip.content : '';
|
||||
this.tip = this.$store.state.trainingNew.trainingStepTip ? this.$store.state.trainingNew.trainingStepTip.content : '';
|
||||
if (step && step.tipPosition && step.tipPosition.deviceCode) {
|
||||
const position = this.getShapeTipPoint(step.tipPosition);
|
||||
if (position) {
|
||||
@ -95,7 +94,7 @@ export default {
|
||||
this.popTipShow();
|
||||
}
|
||||
} else if (step && step.tipPosition && step.tipPosition.domId) {
|
||||
const position = this.getOtherTipPoint(step.tipPosition);
|
||||
const position = await this.getOtherTipPoint(step.tipPosition);
|
||||
if (position) {
|
||||
this.position = position;
|
||||
this.position.y -= distance;
|
||||
@ -157,25 +156,48 @@ export default {
|
||||
// 获取地图菜单按钮和对话框按钮提示显示位置
|
||||
getOtherTipPoint(tipPosition) {
|
||||
const domId = OperationHandler.getDomIdByOperation(tipPosition.domId);
|
||||
const btnDom = document.getElementById(domId);
|
||||
if (btnDom) {
|
||||
const offset = getDomOffset(btnDom);
|
||||
if (offset.x == 0 && offset.y == 0) {
|
||||
return null;
|
||||
}
|
||||
if (!domId) { return null; }
|
||||
return new Promise(async(resolve, reject) => {
|
||||
try {
|
||||
let btnDom = document.getElementById(domId);
|
||||
if (!btnDom) {
|
||||
btnDom = await this.getAwaitDom(domId);
|
||||
}
|
||||
if (btnDom) {
|
||||
const offset = getDomOffset(btnDom);
|
||||
if (offset.x == 0 && offset.y == 0) {
|
||||
resolve(null);
|
||||
}
|
||||
|
||||
let align = 'bottom';
|
||||
if (this.tipAlignIsTop(tipPosition, domId)) {
|
||||
align = 'top';
|
||||
}
|
||||
let align = 'bottom';
|
||||
if (this.tipAlignIsTop(tipPosition, domId)) {
|
||||
align = 'top';
|
||||
}
|
||||
|
||||
return {
|
||||
align: align,
|
||||
x: offset.x + btnDom.clientWidth / 2,
|
||||
y: offset.y
|
||||
};
|
||||
}
|
||||
return null;
|
||||
resolve({
|
||||
align: align,
|
||||
x: offset.x + btnDom.clientWidth / 2,
|
||||
y: offset.y
|
||||
});
|
||||
} else {
|
||||
resolve(null);
|
||||
}
|
||||
} catch (err) {
|
||||
resolve(null);
|
||||
}
|
||||
});
|
||||
},
|
||||
getAwaitDom(domId) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
const btnDom = document.getElementById(domId);
|
||||
if (btnDom) {
|
||||
resolve(btnDom);
|
||||
} else {
|
||||
resolve(null);
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
},
|
||||
tipAlignIsTop(step, domId) {
|
||||
// 如果是tip框则箭头朝上
|
||||
|
@ -21,7 +21,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.trainingStepTip': function(val) {
|
||||
'$store.state.trainingNew.trainingStepTip': function(val) {
|
||||
if (val && this.trainingDetail.type === 'SCENE') {
|
||||
const member = this.$store.state.training.memberData[val.memberId];
|
||||
this.$nextTick(function() {
|
||||
@ -48,7 +48,7 @@ export default {
|
||||
this.trainingTipMessage = '实训完成,请点击结束按钮。';
|
||||
}
|
||||
},
|
||||
'$store.state.trainingNew.operateErrMsg': function (val) {
|
||||
'$store.state.training.operateErrMsg': function (val) {
|
||||
this.tipInfo({ color: val.color, message: val.errMsg });
|
||||
}
|
||||
},
|
||||
|
363
src/views/newMap/display/voiceChatBox/chatContent.vue
Normal file
363
src/views/newMap/display/voiceChatBox/chatContent.vue
Normal file
@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="chatcontentIn" :style="{width: width}">
|
||||
<div class="chatcontentInner">
|
||||
<div v-for="(chatContent,index) in messageList" :key="index" class="chatContentInClass">
|
||||
<div :class="chatContent.memberId == myMemberId?'rightUser':'leftUser'">
|
||||
<div class="userHeader">
|
||||
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.memberId) }}</div>
|
||||
<div :class="chatContent.memberId == myMemberId?'userChatTime textRight':'userChatTime'">{{ covertTime(chatContent.time) }}</div>
|
||||
</div>
|
||||
<div v-if="chatContent.type == 'Text'" class="userBubble">
|
||||
<div class="userMessage">
|
||||
<span class="messageText">{{ chatContent.content }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="userBubble" style="height: 30px;width: 140px;" @click="playAudio(baseUrl+chatContent.src, chatContent)">
|
||||
<div class="userMessage">
|
||||
<!-- <span class="el-icon-video-play playicon" /> -->
|
||||
<!-- <img :src="yuyin" class="playicon1"> -->
|
||||
<!-- 语音播放 -->
|
||||
<div class="wifi-symbol">
|
||||
<div class="wifi-circle first" />
|
||||
<div class="wifi-circle second" :class="{'second-amit': chatContent.activeAtuo}" />
|
||||
<div class="wifi-circle third" :class="{'third-amit': chatContent.activeAtuo}" />
|
||||
</div>
|
||||
<!-- <span class="messageText">{{ chatContent.content }}</span> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<audio id="audioPlay" style="display:none" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {overConversationMessage} from '@/api/chat';
|
||||
export default {
|
||||
props:{
|
||||
messageList:{
|
||||
type:Array,
|
||||
required:true
|
||||
},
|
||||
conversitionStateMap: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
isAnswering:{
|
||||
type:Boolean,
|
||||
required:true
|
||||
},
|
||||
conversitionId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
conversitionMemberList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
simulationUsers: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
commonConversation: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
myMemberId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default() {
|
||||
return '100%';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chatContentList:[],
|
||||
currentAudioList:[],
|
||||
// yuyin:yuyin,
|
||||
currentAudioIndex:0,
|
||||
isPlay:false,
|
||||
baseUrl: this.$store.state.user.resourcesUrl
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天
|
||||
const conversationInfo = this.$store.state.socket.conversationInfo;
|
||||
const member = this.$store.state.training.memberData[val.message.memberId];
|
||||
conversationInfo.message.src = `${conversationInfo.message.audioPath}`;
|
||||
this.$emit('changeMessageList', conversationInfo);
|
||||
if (this.conversitionId == val.id && this.conversitionStateMap[this.myMemberId] && this.conversitionStateMap[this.myMemberId].connect) {
|
||||
if (member && member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push({audioUrl:this.baseUrl + conversationInfo.message.audioPath, id:val.message.id});
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.$store.dispatch('scriptRecord/updateAudioPlay', true);
|
||||
this.playAllAudio();
|
||||
}
|
||||
}
|
||||
this.scrollTop();
|
||||
} else if (this.userRole === 'AUDIENCE' || this.commonConversation) {
|
||||
if (member && member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push({audioUrl:this.baseUrl + conversationInfo.message.audioPath, id:val.message.id});
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.$store.dispatch('scriptRecord/updateAudioPlay', true);
|
||||
this.playAllAudio();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.scriptRecord.audioPlay':function(val) {
|
||||
this.isPlay = val;
|
||||
if (!val) {
|
||||
this.currentAudioList = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
scrollTop() {
|
||||
this.$nextTick(function() {
|
||||
const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30;
|
||||
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
|
||||
});
|
||||
},
|
||||
|
||||
playAllAudio() {
|
||||
this.playEachAudio(this.currentAudioList[this.currentAudioIndex]);
|
||||
},
|
||||
playEachAudio(audioObject) {
|
||||
this.$nextTick(function() {
|
||||
this.messageList.forEach(item => {
|
||||
if (item.id == audioObject.id) {
|
||||
this.$set(item, 'activeAtuo', true);
|
||||
}
|
||||
});
|
||||
document.querySelector('#audioPlay').src = audioObject.audioUrl;
|
||||
document.querySelector('#audioPlay').play();
|
||||
const that = this;
|
||||
document.querySelector('#audioPlay').onended = function() {
|
||||
that.messageList.forEach(item => {
|
||||
if (item.id == audioObject.id) {
|
||||
that.$set(item, 'activeAtuo', false);
|
||||
}
|
||||
});
|
||||
overConversationMessage(that.$route.query.group, audioObject.id).then(res=>{
|
||||
that.currentAudioList.shift();
|
||||
if (that.currentAudioList.length > 0) {
|
||||
that.playEachAudio(that.currentAudioList[that.currentAudioIndex]);
|
||||
} else {
|
||||
that.isPlay = false;
|
||||
that.$store.dispatch('scriptRecord/updateAudioPlay', false);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
},
|
||||
covertName(memberId) {
|
||||
let name = '';
|
||||
const member = this.$store.state.training.memberData[memberId];
|
||||
if (member && member.userId) {
|
||||
const user = this.simulationUsers[member.userId];
|
||||
name = member.label + '(' + user.nickName + ')';
|
||||
} else if (member) {
|
||||
name = member.label;
|
||||
}
|
||||
return name;
|
||||
},
|
||||
covertTime(time) {
|
||||
const date = new Date(time);
|
||||
let hour = date.getHours();
|
||||
let minute = date.getMinutes();
|
||||
let second = date.getSeconds();
|
||||
hour = hour > 9 ? hour : '0' + hour;
|
||||
minute = minute > 9 ? minute : '0' + minute;
|
||||
second = second > 9 ? second : '0' + second;
|
||||
return hour + ':' + minute + ':' + second;
|
||||
},
|
||||
playAudio(audioUrl, data) {
|
||||
this.messageList.forEach(item => {
|
||||
this.$set(item, 'activeAtuo', false);
|
||||
});
|
||||
if (!this.isPlay) {
|
||||
const that = this;
|
||||
document.querySelector('#audioPlay').src = audioUrl;
|
||||
this.$set(data, 'activeAtuo', true);
|
||||
document.querySelector('#audioPlay').play();
|
||||
document.querySelector('#audioPlay').onended = function() {
|
||||
that.$set(data, 'activeAtuo', false);
|
||||
};
|
||||
}
|
||||
},
|
||||
conversationChange() {
|
||||
this.currentAudioList = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chatcontentIn{
|
||||
// height: 200px;
|
||||
height: calc(100% - 5px);
|
||||
// width: 360px;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
padding-bottom: 20px;
|
||||
cursor:auto;
|
||||
background: #fff;
|
||||
}
|
||||
.leftUser{
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
max-width: 80%;
|
||||
}
|
||||
.rightUser{
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
max-width: 80%;
|
||||
}
|
||||
.userHeader{margin-bottom: 2px;}
|
||||
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
|
||||
.userChatTime{font-size: 12px;display:inline-block;}
|
||||
.userBubble{
|
||||
font-size: 12px;
|
||||
// padding: 10px;
|
||||
padding: 5px 10px 6px 10px;
|
||||
min-width: 140px;
|
||||
background: #ccc;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
display:inline-block;
|
||||
// height: 30px;
|
||||
// overflow: hidden;
|
||||
}
|
||||
.playicon{
|
||||
font-size: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
// .playicon1{
|
||||
// width:17px;
|
||||
// }
|
||||
.wifi-symbol {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
transform: rotate(135deg);
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: -13px;
|
||||
}
|
||||
.wifi-circle {
|
||||
border: 1px solid #000000;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.first {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
background: #cccccc;
|
||||
top: 45px;
|
||||
left: 45px;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
|
||||
.second {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
top: 40px;
|
||||
left: 40px;
|
||||
&.second-amit{
|
||||
animation: fadeInOut 1s infinite 0.2s;
|
||||
}
|
||||
}
|
||||
|
||||
.third {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
top: 36px;
|
||||
left: 36px;
|
||||
&.third-amit{
|
||||
animation: fadeInOut 1s infinite 0.4s;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInOut {
|
||||
0% {
|
||||
opacity: 0; /*初始状态 透明度为0*/
|
||||
}
|
||||
100% {
|
||||
opacity: 1; /*结尾状态 透明度为1*/
|
||||
}
|
||||
}
|
||||
.textRight{text-align: right;}
|
||||
.userMessage{
|
||||
position: relative;
|
||||
}
|
||||
.messageText{
|
||||
line-height: 20px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.chatContentInClass{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rightUser .userBubble{
|
||||
float:right;
|
||||
}
|
||||
|
||||
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||
.chatcontentIn::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
// height: 110px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
/*定义滚动条轨道 内阴影+圆角*/
|
||||
.chatcontentIn::-webkit-scrollbar-track {
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #FFFFFF;;
|
||||
}
|
||||
/*定义滑块 内阴影+圆角*/
|
||||
.chatcontentIn::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
||||
background-color: #cacaca;
|
||||
}
|
||||
/*滑块效果*/
|
||||
.chatcontentIn::-webkit-scrollbar-thumb:hover {
|
||||
border-radius: 5px;
|
||||
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.4);
|
||||
}
|
||||
/*IE滚动条颜色*/
|
||||
html {
|
||||
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
|
||||
scrollbar-highlight-color:#000;
|
||||
scrollbar-3dlight-color:#000;
|
||||
scrollbar-darkshadow-color:#000;
|
||||
scrollbar-Shadow-color:#adadad;/*滑块边色*/
|
||||
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
|
||||
scrollbar-track-color:#eeeeee;/*背景颜色*/
|
||||
}
|
||||
</style>
|
127
src/views/newMap/display/voiceChatBox/chatSetting.vue
Normal file
127
src/views/newMap/display/voiceChatBox/chatSetting.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div v-show="dialogVisible" class="chat-popup">
|
||||
<div class="chat-setting-header">
|
||||
<div class="chat-setting-title">设置</div>
|
||||
<div class="chat-setting-close">
|
||||
<i class="el-icon-close" @click="dialogVisible=false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-setting-content">
|
||||
<div class="chat-setting-language">
|
||||
<div class="setting-language-title">语言: </div>
|
||||
<el-switch
|
||||
v-model="form.language"
|
||||
class="setting-language-select"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#ff4949"
|
||||
active-text="中"
|
||||
inactive-text="En"
|
||||
active-value="zh"
|
||||
inactive-value="en"
|
||||
@change="changeLanguage()"
|
||||
/>
|
||||
</div>
|
||||
<div class="chat-setting-sex">
|
||||
<div class="setting-sex-title">性别: </div>
|
||||
<el-switch
|
||||
v-model="form.sex"
|
||||
class="setting-sex-select"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#ff4949"
|
||||
active-icon-class="el-icon-male"
|
||||
inactive-icon-class="el-icon-female"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeSex()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ChatSetting',
|
||||
props:{
|
||||
form:{
|
||||
type:Object,
|
||||
required:true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading:false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
changeLanguage() {
|
||||
this.$emit('setSetting', this.form);
|
||||
},
|
||||
changeSex() {
|
||||
this.$emit('setSetting', this.form);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chat-popup{
|
||||
position: absolute;
|
||||
// width: 54%;
|
||||
width: 200px;
|
||||
height: 143px;
|
||||
border: 1px #dedede solid;
|
||||
left: 100px;
|
||||
top: 70px;
|
||||
z-index: 7;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 3px 3px 3px #928787;
|
||||
box-shadow: 3px 3px 3px #928787;
|
||||
background: #fff;
|
||||
}
|
||||
.chat-setting-header{
|
||||
padding-left: 10px;
|
||||
padding-top: 6px;
|
||||
font-size: 14px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
.chat-setting-title{
|
||||
display: inline-block;
|
||||
}
|
||||
.chat-setting-close{
|
||||
float: right;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-setting-content{
|
||||
|
||||
}
|
||||
.chat-setting-language,.chat-setting-sex{
|
||||
display: inline-block;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.setting-language-title,.setting-sex-title{
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
margin-left: 20px;
|
||||
vertical-align: top;
|
||||
margin-top: 3px;
|
||||
}
|
||||
.setting-language-select,.setting-sex-select{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.setting-sex-select .el-icon-male,.setting-sex-select .el-icon-female{
|
||||
font-size:18px !important;
|
||||
}
|
||||
</style>
|
1214
src/views/newMap/display/voiceChatBox/index.vue
Normal file
1214
src/views/newMap/display/voiceChatBox/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@
|
||||
>
|
||||
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="画面名称:" prop="name">
|
||||
<el-input v-model="ruleForm.name" />
|
||||
<el-input v-model="ruleForm.name" :disabled="edit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="画面类型:" prop="type">
|
||||
<el-select v-model="ruleForm.type" placeholder="请选择画面类型">
|
||||
@ -36,7 +36,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('ruleForm')">创建</el-button>
|
||||
<el-button v-if="!edit" type="primary" @click="submitForm('ruleForm')">创建</el-button>
|
||||
<el-button v-else type="primary" @click="updateData">修改</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
@ -57,7 +58,8 @@ export default {
|
||||
name: [{ required: true, message: '请输入画面名称', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择画面类型', trigger: 'change' }],
|
||||
lineCode: [{ required: true, message: '请选择线路', trigger: 'change' }]
|
||||
}
|
||||
},
|
||||
edit: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -97,12 +99,41 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
updateData() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
const map = this.$store.state.map.map;
|
||||
if (map && map.pictureList && map.pictureList.length) {
|
||||
const pictureModel = map.pictureList.find(elem => elem.name === this.ruleForm.name);
|
||||
pictureModel.type = this.ruleForm.type;
|
||||
pictureModel.stationCodes = this.ruleForm.stationCodes;
|
||||
pictureModel.lineCode = this.ruleForm.lineCode;
|
||||
if (map && parseInt(this.$route.params.mapId)) {
|
||||
saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(() => {
|
||||
this.$message.success('修改画面成功!');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$message.error('修改画面失败!');
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error('数据不存在!');
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.centerDialogVisible = false;
|
||||
},
|
||||
doShow() {
|
||||
doShow(data) {
|
||||
this.edit = false;
|
||||
this.centerDialogVisible = true;
|
||||
if (data) {
|
||||
this.ruleForm.name = data.name;
|
||||
this.ruleForm.type = data.type;
|
||||
this.ruleForm.stationCodes = data.stationCodes;
|
||||
this.ruleForm.lineCode = data.lineCode;
|
||||
this.edit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -27,6 +27,7 @@
|
||||
@createPicture="createPicture"
|
||||
@changePicture="changePicture"
|
||||
@deletePicture="deletePicture"
|
||||
@editPicture="editPicture"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</div>
|
||||
@ -375,6 +376,12 @@ export default {
|
||||
changePicture() {
|
||||
this.$refs.changePicture.doShow();
|
||||
},
|
||||
editPicture() {
|
||||
if (this.pictureName) {
|
||||
const pictureModel = this.$store.state.map.map.pictureList.find(elem => elem.name == this.pictureName);
|
||||
this.$refs.createPicture.doShow(pictureModel);
|
||||
}
|
||||
},
|
||||
// 撤销
|
||||
revocation() {
|
||||
this.$store.dispatch('map/setRevocation');
|
||||
|
@ -68,7 +68,7 @@ export default {
|
||||
deviceList () {
|
||||
return [...this.sectionList, ...this.signalList, ...this.psdList, ...this.stationStandList, ...this.stationList, ...this.trainWindowList,
|
||||
...this.arrowList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.directionRodList, ...this.espList,
|
||||
...this.indicatorLightList, ...this.lcList, ...this.lineList, ...this.outerFrameList, ...this.psdList, ...this.resourceList, ...this.responderList,
|
||||
...this.indicatorLightList, ...this.lcList, ...this.lineList, ...this.outerFrameList, ...this.resourceList, ...this.responderList,
|
||||
...this.signalButtonList, ...this.splitStationList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList,
|
||||
...this.zcList];
|
||||
},
|
||||
|
@ -33,9 +33,6 @@ export default {
|
||||
watch: {
|
||||
'$store.state.training.tipEvent': function (val) {
|
||||
setTimeout(() => { this.tipInit(); }, 300);
|
||||
this.$nextTick(function() {
|
||||
this.tipInit();
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -155,7 +155,8 @@ export default {
|
||||
{ key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'},
|
||||
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
|
||||
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
|
||||
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' }
|
||||
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
|
||||
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' }
|
||||
],
|
||||
endTableData: [
|
||||
{ key: 'DEFAULT_MEMBER', label: '默认仿真成员', value: '', type: 'select', optionList: [] },
|
||||
@ -359,7 +360,8 @@ export default {
|
||||
{ key: 'client', label: '初始客户端', value: '', type: 'select', optionList: this.clientList},
|
||||
{ key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'},
|
||||
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
|
||||
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }
|
||||
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
|
||||
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' }
|
||||
];
|
||||
this.endTableData = [
|
||||
{ key: 'DEFAULT_MEMBER', label: '默认仿真成员', value: '', type: 'select', optionList: [] },
|
||||
|
@ -35,25 +35,25 @@ const simTypeMap = {
|
||||
RAILWAY: '大铁CTC',
|
||||
EMERGENCY: '应急调度'
|
||||
};
|
||||
const clientMap = {
|
||||
C_ATS: '中心ATS工作站',
|
||||
C_ATS_BS: '中心ATS大屏',
|
||||
C_PA: '中心PA系统',
|
||||
C_CCTV: '中心视频监控系统',
|
||||
L_ATS: '现地ATS工作站',
|
||||
LCW: '本地控制工作站',
|
||||
L_CCTV: '现地视频监控系统',
|
||||
L_PA: '现地PA系统',
|
||||
GPC: '调度台终端',
|
||||
IPC: '联锁工作站',
|
||||
STPC: '车务终端',
|
||||
DMP: '车务管理终端',
|
||||
ISCS: 'ISCS',
|
||||
IBP: 'IBP',
|
||||
PSL: 'PSL',
|
||||
RUN_PLAN_DESIGN: '运行图编制',
|
||||
DRIVE: '列车驾驶'
|
||||
};
|
||||
// const clientMap = {
|
||||
// C_ATS: '中心ATS工作站',
|
||||
// C_ATS_BS: '中心ATS大屏',
|
||||
// C_PA: '中心PA系统',
|
||||
// C_CCTV: '中心视频监控系统',
|
||||
// L_ATS: '现地ATS工作站',
|
||||
// LCW: '本地控制工作站',
|
||||
// L_CCTV: '现地视频监控系统',
|
||||
// L_PA: '现地PA系统',
|
||||
// GPC: '调度台终端',
|
||||
// IPC: '联锁工作站',
|
||||
// STPC: '车务终端',
|
||||
// DMP: '车务管理终端',
|
||||
// ISCS: 'ISCS',
|
||||
// IBP: 'IBP',
|
||||
// PSL: 'PSL',
|
||||
// RUN_PLAN_DESIGN: '运行图编制',
|
||||
// DRIVE: '列车驾驶'
|
||||
// };
|
||||
export default {
|
||||
name: 'PublishMap',
|
||||
components: {
|
||||
@ -120,35 +120,35 @@ export default {
|
||||
title: '默认扮演成员',
|
||||
prop: 'DEFAULT_MEMBER',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('DEFAULT_MEMBER') ? '是' : '否'; },
|
||||
columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('DEFAULT_MEMBER') ? '是' : '否'; },
|
||||
tagType: () => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '大客流',
|
||||
prop: 'LPF',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('LPF') ? '是' : '否'; },
|
||||
columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('LPF') ? '是' : '否'; },
|
||||
tagType: () => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '真实设备',
|
||||
prop: 'REAL_DEVICE',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('REAL_DEVICE') ? '是' : '否'; },
|
||||
columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('REAL_DEVICE') ? '是' : '否'; },
|
||||
tagType: () => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载实训',
|
||||
prop: 'TRAINING',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('TRAINING') ? '是' : '否'; },
|
||||
columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('TRAINING') ? '是' : '否'; },
|
||||
tagType: () => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载试卷',
|
||||
prop: 'EXAM',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('EXAM') ? '是' : '否'; },
|
||||
columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('EXAM') ? '是' : '否'; },
|
||||
tagType: () => { return 'success'; }
|
||||
},
|
||||
{
|
||||
@ -219,6 +219,13 @@ export default {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
generateMapFunctionNew(this.$route.query.mapId, this.form).then(resp => {
|
||||
if (resp.data && resp.data.length) {
|
||||
let message = '';
|
||||
resp.data.forEach(item => {
|
||||
message = message + item + ';';
|
||||
});
|
||||
this.$messageBox(message);
|
||||
}
|
||||
this.reloadTable();
|
||||
this.doCloseGenerate();
|
||||
}).catch(error => {
|
||||
|
@ -388,6 +388,10 @@ export default {
|
||||
});
|
||||
},
|
||||
updateMapLocation() {
|
||||
if (!Vue.prototype.$jlmap) {
|
||||
this.$message.warning('请切换到站场图定位!');
|
||||
return;
|
||||
}
|
||||
const data = Vue.prototype.$jlmap.$options;
|
||||
const params = {scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
|
||||
updateTrainingMaplocation({id: this.editData.id, mapLocationJson: JSON.stringify(params)}).then(res => {
|
||||
|
@ -199,7 +199,7 @@ export default {
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', null);
|
||||
if (resp.data && resp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(resp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
}
|
||||
this.$emit('updateDetails', resp.data);
|
||||
this.doClose();
|
||||
@ -278,7 +278,7 @@ export default {
|
||||
this.training = detailResp.data;
|
||||
if (detailResp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
}
|
||||
if (detailResp.data.playerIdJson) {
|
||||
const playerId = JSON.parse(detailResp.data.playerIdJson)[0];
|
||||
|
Loading…
Reference in New Issue
Block a user