Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
528af2fea6
94
src/api/rtSimulation.js
Normal file
94
src/api/rtSimulation.js
Normal file
@ -0,0 +1,94 @@
|
||||
import request from '@/utils/request';
|
||||
/** 创建仿真 */
|
||||
export function createSimulation(data) {
|
||||
return request({
|
||||
url: `/rtSimulation?mapId=${data.mapId}&prdType=${data.prdType}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 根据仿真group获取仿真基础信息 */
|
||||
export function getSimulationInfoByGroup(groupId) {
|
||||
return request({
|
||||
url: `/common/simulation/${groupId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 根据仿真group获取仿真地图数据 */
|
||||
export function getMapDataByGroup(groupId) {
|
||||
return request({
|
||||
url: `/rtSimulation/${groupId}/mapData`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 仿真发送指令 */
|
||||
export function sendSimulationCommand(group, memberId, type, data) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/member/${memberId}/operate/${type}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 获取仿真成员列表 */
|
||||
export function getMemberListCommon(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取仿真用户列表 */
|
||||
export function getUserListCommon(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/users`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 销毁仿真 */
|
||||
export function destroySimulation(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/destroy`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 初始化仿真 */
|
||||
export function initSimulation(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/init`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 设置故障 */
|
||||
export function setSimulationFault(group, data) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/fault`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 取消故障 */
|
||||
export function cancelSimulationFault(group, deviceId, faultType) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/device/${deviceId}/fault/${faultType}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 仿真运行倍速 */
|
||||
export function timesSpeedPlayback(group, speed) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/updateSpeed/${speed}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 仿真暂停 */
|
||||
export function simulationPause(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/pause`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 仿真开始 */
|
||||
export function simulationStart(group) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/start`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
@ -15,6 +15,13 @@ export function generateMapSystem(mapId) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 生成指定子系统 */
|
||||
export function generateAppointMapSystem(mapId, prdType) {
|
||||
return request({
|
||||
url: `/api/mapSystem/generate/${mapId}/${prdType}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 查询子系统信息 */
|
||||
export function getSubSystemInfo(id) {
|
||||
return request({
|
||||
|
@ -168,6 +168,7 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
colorSpecial: true, // 特殊处理灯位颜色
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
@ -182,9 +183,18 @@ class SkinCode extends defaultStyle {
|
||||
fontSize: 11, // 信号机名称字体大小
|
||||
fontWeight: 'bold', // 信号机名称字体粗细
|
||||
defaultColor: '#FFFFFF', // 信号灯字体默认色
|
||||
blockColor: '#EF0C08', // 信号灯字体锁定颜色
|
||||
blockColor: '#FFFFFF', // 信号灯字体锁定颜色
|
||||
checkColor: '#00FF00' // 信号保护区段检查颜色
|
||||
},
|
||||
remainTimeColor: '#F00',
|
||||
tText: {
|
||||
offsetX: 0,
|
||||
offsetY: -30,
|
||||
fontSize: 11, // 信号机名称字体大小
|
||||
fontWeight: 'bold', // 信号机名称字体粗细
|
||||
defaultColor: '#F00', // 信号灯字体默认色
|
||||
defaultText: 0
|
||||
},
|
||||
lamp: {
|
||||
bgShow: false, // 是否被选中
|
||||
guidName: 'singleRY', // 成都三号线引导类型
|
||||
|
@ -529,8 +529,8 @@ class SkinCode extends defaultStyle {
|
||||
core: {
|
||||
length: 6, // 道岔单边长度
|
||||
graphShow: true, // 图形显示
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
graphInversionColor: '#FFFF00', // 反位颜色
|
||||
graphLocalColor: '#00FF00' // 定位颜色
|
||||
},
|
||||
jointImg: { // 道岔 A B C D四元素属性配置
|
||||
trapezoidLength: 8, // 直角梯形元素默认长度
|
||||
@ -662,13 +662,14 @@ class SkinCode extends defaultStyle {
|
||||
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [
|
||||
{
|
||||
type: '03',
|
||||
type: 'MANUAL',
|
||||
serviceNumber: 'M0',
|
||||
nameFormat: 'serviceNumber:groupNumber'
|
||||
},
|
||||
{
|
||||
type: '02',
|
||||
nameFormat: 'targetCode:groupNumber'
|
||||
type: 'HEAD',
|
||||
serviceNumber: 'M0',
|
||||
nameFormat: 'serviceNumber:targetCode'
|
||||
}
|
||||
], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 4, // 两边间隔
|
||||
@ -697,8 +698,8 @@ class SkinCode extends defaultStyle {
|
||||
textAContent: 'A'// textA文本
|
||||
},
|
||||
trainNumber: {
|
||||
targetCodePrefix: '000', // 目的地码前缀
|
||||
trainNumberOffset: { x: 0, y: 1 }// 目的地码偏移量
|
||||
targetCodePrefix: '00', // 目的地码前缀
|
||||
trainNumberOffset: { x: 0, y: 4 }// 目的地码偏移量
|
||||
},
|
||||
trainServer: {
|
||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||
@ -803,7 +804,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.FloodGate] = {};
|
||||
this[deviceType.DirectionRod] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
this[deviceType.IndicatorLight] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,13 +44,23 @@ class ESigName extends Group {
|
||||
getNameText() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.name.hide();
|
||||
}
|
||||
show() {
|
||||
this.name.show();
|
||||
}
|
||||
setAnimationStart(color) {
|
||||
this.name && this.name.animateStyle(true)
|
||||
.when(0, { textFill: this.model.style.backgroundColor })
|
||||
.when(1000, { textFill: color })
|
||||
.when(2000, { textFill: this.model.style.backgroundColor })
|
||||
.when(3000, { textFill: color })
|
||||
.start();
|
||||
}
|
||||
setAnimationEnd() {
|
||||
this.name && this.name.stopAnimation(false);
|
||||
}
|
||||
}
|
||||
|
||||
export default ESigName;
|
||||
|
@ -18,6 +18,7 @@ import Text from 'zrender/src/graphic/Text';
|
||||
import Isogon from 'zrender/src/graphic/shape/Isogon';
|
||||
import deviceType from '../../constant/deviceType';
|
||||
import { findDeviceByModelDepType } from '../utils/ShapeDepFind';
|
||||
import store from '@/store/index';
|
||||
// import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
// import background from './../../../ibp/shape/background';
|
||||
|
||||
@ -164,6 +165,22 @@ const SignalAspectMap = {
|
||||
3: () => {}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
},
|
||||
// 12 红闪
|
||||
12: (lamps, style) => {
|
||||
const lampsMap = {
|
||||
1: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
lamps[0].setAnimationStart(style.Signal.lamp.redColor);
|
||||
},
|
||||
2: () => {
|
||||
lamps[0].setColor(style.Signal.lamp.redColor);
|
||||
lamps[0].setAnimationStart(style.Signal.lamp.redColor);
|
||||
lamps[1].setColor(style.backgroundColor);
|
||||
},
|
||||
3: () =>{}
|
||||
};
|
||||
exec(lampsMap[lamps.length]);
|
||||
}
|
||||
};
|
||||
|
||||
@ -262,8 +279,8 @@ class Signal extends Group {
|
||||
z: this.z,
|
||||
_val: '3',
|
||||
style: {
|
||||
x: endPoint.x,
|
||||
y: endPoint.y,
|
||||
x: endPoint.x + (style.Signal.tText.offsetX || 0),
|
||||
y: endPoint.y + (style.Signal.tText.offsetY || 0),
|
||||
fontWeight: style.Signal.tText.fontWeight,
|
||||
fontSize: style.Signal.tText.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
@ -359,7 +376,7 @@ class Signal extends Group {
|
||||
fontWeight: style.Signal.text.fontWeight,
|
||||
fontSize: 12,
|
||||
fontFamily: style.fontFamily,
|
||||
textFill: '#FFF',
|
||||
textFill: style.Signal.remainTimeColor || '#FFF',
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'middle'
|
||||
});
|
||||
@ -682,7 +699,7 @@ class Signal extends Group {
|
||||
if (this.style.Signal.text.nameBorderShow) {
|
||||
this.sigName.setStyle({ textBorderWidth: 1 });
|
||||
}
|
||||
if (this.sigBack) {
|
||||
if (this.sigBack && (!this.model.signalButtonList || !this.model.signalButtonList.length)) {
|
||||
this.sigBack.show();
|
||||
this.sigBack.setStyle('fill', this.style.Signal.sigBack.fillColor);
|
||||
}
|
||||
@ -690,6 +707,12 @@ class Signal extends Group {
|
||||
this.lamps[0].setBorderColor(this.style.Signal.lamp.borderColor);
|
||||
this.lamps[0].setAnimationStart(this.style.Signal.lamp.blockColor);
|
||||
}
|
||||
if (this.model.signalButtonList && this.model.signalButtonList.length) {
|
||||
this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
button && button.instance && button.instance.blockShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
reblock() {
|
||||
this.sigPost.setHorColor(this.style.Signal.post.reblockHorColor);
|
||||
@ -835,6 +858,15 @@ class Signal extends Group {
|
||||
showRemainTime(number) {
|
||||
this.remainTImeName.show();
|
||||
this.remainTImeName && this.remainTImeName.setStyle({ text: number });
|
||||
this.model.signalButtonList && this.model.signalButtonList.length && this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
if (button.type === 'PICK') {
|
||||
button && button.instance && button.instance.startAnimate();
|
||||
}
|
||||
});
|
||||
if (this.model.type === 'SHUNTING') {
|
||||
this.sigName && this.sigName.setAnimationStart(this.style.Signal.text.defaultColor);
|
||||
}
|
||||
}
|
||||
setAshShow() {
|
||||
this.lamps.forEach(item=> { item.setStyle({fill: '#7F7F7F', stroke: '#7F7F7F'}); });
|
||||
@ -844,6 +876,7 @@ class Signal extends Group {
|
||||
}
|
||||
// 恢复状态
|
||||
recover() {
|
||||
this.sigName && this.sigName.setAnimationEnd();
|
||||
this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); });
|
||||
this.sigName.setStyle({ textBorderWidth: 0 });
|
||||
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
||||
@ -883,9 +916,16 @@ class Signal extends Group {
|
||||
this.ciConfirm && this.ciConfirm.stopAnimation(false);
|
||||
this.ciConfirm && this.ciConfirm.hide();
|
||||
this.sigBack && this.sigBack.hide();
|
||||
this.tText && this.tText.hide();
|
||||
this.sigBack && this.sigBack.stopAnimation(false);
|
||||
this.lamps && this.lamps[0] && this.lamps[0].setAnimationEnd();
|
||||
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
|
||||
if (this.model.signalButtonList && this.model.signalButtonList.length) {
|
||||
this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
button && button.instance && button.instance.recover();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
@ -913,10 +953,19 @@ class Signal extends Group {
|
||||
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
|
||||
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
|
||||
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
|
||||
if (model.remainTime) {
|
||||
this.showRemainTime(model.remainTime);
|
||||
} else {
|
||||
this.model.signalButtonList && this.model.signalButtonList.length && this.model.signalButtonList.forEach(item => {
|
||||
const button = store.getters['map/getDeviceByCode'](item);
|
||||
if (button.type === 'PICK') {
|
||||
button && button.instance && button.instance.setState(button);
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 信号机封锁 */ // 缺一个功能封锁
|
||||
model.blockade && this.block();
|
||||
model.blockade && this.block(); // 因大铁处理信号按钮状态 封锁处理需在延时解锁时间之后处理
|
||||
model.reblockade && this.reblock();
|
||||
model.remainTime && this.showRemainTime(model.remainTime);
|
||||
if (!path.includes('/map/draw')) {
|
||||
// 联锁自动进路通过
|
||||
model.fleetMode && this.setAutoRouteOpen();
|
||||
@ -980,9 +1029,15 @@ class Signal extends Group {
|
||||
// 灯是否点灯显示
|
||||
this.lamps.forEach(lamp => { lamp.setStop(model.signalLight); });
|
||||
}
|
||||
|
||||
if (model.hasSelected) {
|
||||
this.sigName && this.sigName.setAnimationStart(this.style.Signal.text.defaultColor);
|
||||
}
|
||||
// 信号机故障
|
||||
model.fault && this.fault();
|
||||
if (model.guideTime) {
|
||||
this.tText && this.tText.setStyle('text', model.guideTime);
|
||||
this.tText && this.tText.show();
|
||||
}
|
||||
// 设置灰显
|
||||
if (model.noStatus || model.level === 0) {
|
||||
this.setAshShow();
|
||||
|
@ -20,12 +20,7 @@ export default class SignalButton extends Group {
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
let fillColor = '#008000';
|
||||
if (model.type === 'GUIDE') {
|
||||
fillColor = '#5050E1';
|
||||
} else if (model.type === 'FLEXIBLE' || model.type === 'SHUNT_TERMINAL') {
|
||||
fillColor = '#808080';
|
||||
}
|
||||
const fillColor = this.getTypeColor();
|
||||
this.rectButton = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -75,7 +70,7 @@ export default class SignalButton extends Group {
|
||||
});
|
||||
this.add(this.rightLine);
|
||||
this.rightLine.hide();
|
||||
if (model.name) {
|
||||
if (model.type === 'PASS') {
|
||||
this.buttonText = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -95,23 +90,42 @@ export default class SignalButton extends Group {
|
||||
}
|
||||
}
|
||||
startAnimate() {
|
||||
let color = '#008000';
|
||||
if (this.model.type === 'TRAIN_TERMINAL') {
|
||||
color = '#008000';
|
||||
} else if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') {
|
||||
color = '#808080';
|
||||
}
|
||||
this.rectButton && this.rectButton.animateStyle(true)
|
||||
.when(0, { fill: '#000' })
|
||||
.when(1000, { fill: color })
|
||||
.when(1000, { fill: this.getTypeColor() })
|
||||
.when(2000, { fill: '#000' })
|
||||
.start();
|
||||
}
|
||||
stopAnimation() {
|
||||
this.rectButton && this.rectButton.stopAnimation(true);
|
||||
}
|
||||
getTypeColor() {
|
||||
let color = '';
|
||||
if (this.model.type === 'FLEXIBLE' || this.model.type === 'SHUNT_TERMINAL') {
|
||||
color = '#808080';
|
||||
} else if (this.model.type === 'GUIDE') {
|
||||
color = '#5050E1';
|
||||
} else {
|
||||
color = '#008000';
|
||||
}
|
||||
return color;
|
||||
}
|
||||
recover() {
|
||||
this.stopAnimation();
|
||||
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
|
||||
this.rightLine && this.rightLine.hide();
|
||||
this.leftLine && this.leftLine.hide();
|
||||
}
|
||||
blockShow() {
|
||||
this.rightLine && this.rightLine.show();
|
||||
this.leftLine && this.leftLine.show();
|
||||
}
|
||||
setState(model) {
|
||||
this.recover();
|
||||
if (!this.isShowShape) return;
|
||||
if (model.hasSelected) {
|
||||
this.startAnimate();
|
||||
}
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
|
@ -230,16 +230,16 @@ export default class Switch extends Group {
|
||||
offsetX = directx * this.style.Switch.rectLock.offset.x;
|
||||
offsetY = directy * this.style.Switch.rectLock.offset.y;
|
||||
}
|
||||
let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX;
|
||||
let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY;
|
||||
if (this.style.Switch.rectLock.followName) {
|
||||
const directx = this.triangle.drictx;
|
||||
const rect = this.name.getBoundingRect();
|
||||
const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0? rect.width: rect.width/2);
|
||||
const hLen = this.style.Switch.rectLock.rectWidth - rect.height
|
||||
x = rect.x - wLen/2;
|
||||
y = rect.y - hLen/2
|
||||
}
|
||||
let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX;
|
||||
let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY;
|
||||
if (this.style.Switch.rectLock.followName) {
|
||||
const directx = this.triangle.drictx;
|
||||
const rect = this.name.getBoundingRect();
|
||||
const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0 ? rect.width : rect.width / 2);
|
||||
const hLen = this.style.Switch.rectLock.rectWidth - rect.height;
|
||||
x = rect.x - wLen / 2;
|
||||
y = rect.y - hLen / 2;
|
||||
}
|
||||
|
||||
this.lockRect = new ELockRect({ // 单锁矩形框
|
||||
zlevel: this.zlevel,
|
||||
@ -326,7 +326,7 @@ export default class Switch extends Group {
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect && this.lockRect.hide(); // 矩形包围框
|
||||
this.lockCircle && this.lockCircle.hide(); // 圆形包围框
|
||||
this.lockCircle && this.lockCircle.hide(); // 圆形包围框
|
||||
this.lockArc && this.lockArc.hide(); // 圆形单锁框
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.shapeModelC.hide(); // 形状 C
|
||||
@ -703,6 +703,9 @@ export default class Switch extends Group {
|
||||
this.setInversionAction(model); /** 反位*/
|
||||
} else {
|
||||
this.setLossAction(model.fault); // 失去
|
||||
if (model.switchSplit) {
|
||||
this.setForkAction();
|
||||
}
|
||||
}
|
||||
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
|
||||
|
||||
|
@ -40,21 +40,11 @@ export default class TrainBody extends Group {
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.nameFormat = model.nameFormat;
|
||||
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
|
||||
? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
|
||||
: model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号
|
||||
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (style.Train.trainTargetNumber.lineNumber || '') + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber); // 车组号
|
||||
let serviceNumber = ''; // 服务号(表号)
|
||||
if (this.model.type == 'PLAN') { // 计划车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);
|
||||
} else if (this.model.type == 'HEAD') { // 头码车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode);
|
||||
this.nameFormat = 'serviceNumber:groupNumber';
|
||||
} else if (this.model.type == 'MANUAL') { // 人工车
|
||||
serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceHeadNum);
|
||||
this.nameFormat = 'serviceNumber:groupNumber';
|
||||
}
|
||||
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);// 服务号(表号)
|
||||
let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码
|
||||
if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好
|
||||
targetCode = '01';
|
||||
|
@ -39,6 +39,9 @@ class Model {
|
||||
this['private'][deviceType.TrainWindow] = {
|
||||
trainWindowShow: true
|
||||
};
|
||||
this['private'][deviceType.SignalButton] = {
|
||||
hasSelected: 0
|
||||
};
|
||||
}
|
||||
|
||||
initPublicProps(model) {
|
||||
|
@ -110,7 +110,7 @@ export default {
|
||||
},
|
||||
groupNumber: '',
|
||||
field: '',
|
||||
selected: null,
|
||||
selected: null,
|
||||
rules: {
|
||||
faultType: [
|
||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
||||
@ -172,8 +172,8 @@ export default {
|
||||
this.field = field == this.field ? '' : field;
|
||||
},
|
||||
doShow(operate, selected, judge) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
@ -210,7 +210,7 @@ export default {
|
||||
this.dialogShow = false;
|
||||
this.form.faultType = '';
|
||||
this.$refs.form.resetFields();
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
|
400
src/jmapNew/theme/components/menus/dialog/setFaultNew.vue
Normal file
400
src/jmapNew/theme/components/menus/dialog/setFaultNew.vue
Normal file
@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<div v-dialogDrag>
|
||||
<!-- <el-dialog v-dialogDrag :class="popClass" :title="title" :visible.sync="show" width="350px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> -->
|
||||
<div
|
||||
v-show="show"
|
||||
class="iscs_fuzhou-01__systerm route-detail el-dialog"
|
||||
>
|
||||
<div class="el-dialog__header">
|
||||
<span class="el-dialog__title">{{ title }}</span>
|
||||
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
|
||||
<i class="el-dialog__close el-icon el-icon-close" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="el-dialog__body">
|
||||
<template v-if="judge">
|
||||
<el-row>
|
||||
<el-form ref="form" :model="formModel" :rules="rules">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="targetDeviceCode" label="目的地:">
|
||||
<el-select v-model="formModel.targetDeviceCode" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in selectedList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="field == 'selectedCode' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('selectedCode')"
|
||||
>激活</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>设备:</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>故障类型:</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="form" :rules="rules">
|
||||
<el-col :span="11">
|
||||
<el-form-item>
|
||||
<el-input v-model="deviceName" size="small" style="height: 32px;line-height: 32px;" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-form-item prop="faultType">
|
||||
<el-select v-model="form.faultType" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in faultList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
|
||||
import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import { setSimulationFault, cancelSimulationFault } from '@/api/rtSimulation';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
props: {
|
||||
popClass: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
activeShow: false,
|
||||
judge: false,
|
||||
deviceName: '',
|
||||
faultList: [],
|
||||
form: { faultType: ''},
|
||||
formModel: {
|
||||
targetDeviceCode: ''
|
||||
},
|
||||
groupNumber: '',
|
||||
field: '',
|
||||
selected: null,
|
||||
rules: {
|
||||
faultType: [
|
||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'trainList'
|
||||
]),
|
||||
selectedList() {
|
||||
let list = [];
|
||||
let sectionList = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
sectionList = this.sectionList.filter(elem => { return (elem.standTrack || elem.reentryTrack || elem.transferTrack); });
|
||||
}
|
||||
list = [...sectionList, ...this.trainList];
|
||||
return list;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.MixinCommand.stoppage.menu.operation) {
|
||||
return '设置故障';
|
||||
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
|
||||
return '取消故障';
|
||||
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
|
||||
return '设置托管';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.keyboardEnterCount': function (val) {
|
||||
if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
|
||||
this.commit();
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount':function(em) {
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (device && device.code && this.judge && this.field) {
|
||||
if (device._type == 'Section' || device._type == 'Train') {
|
||||
this.deviceSelect(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
},
|
||||
doShow(operate, selected, judge) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
this.operation = operate.operation;
|
||||
this.cmdType = operate.cmdType;
|
||||
let name = selected.name;
|
||||
if (selected._type == 'Train') {
|
||||
name = selected.serviceNumber;
|
||||
}
|
||||
if (name) {
|
||||
this.deviceName = deviceType[selected._type] + '-' + name;
|
||||
} else {
|
||||
this.deviceName = deviceType[selected._type];
|
||||
}
|
||||
if (selected._type === 'Switch') {
|
||||
this.faultList = [
|
||||
{label: '失表', value: 'SPLIT'},
|
||||
{label: '定位失表', value: 'NORMAL_SPLIT'},
|
||||
{label: '反位失表', value: 'REVERSE_SPLIT'},
|
||||
{label: '挤岔', value: 'SQUEEZE'},
|
||||
{label: '计轴故障', value: 'AXLE_FAULT'}
|
||||
];
|
||||
} else if (selected._type === 'Section') {
|
||||
this.faultList = [
|
||||
{label: '计轴故障', value: 'AXLE_FAULT'},
|
||||
{label: '通信车占用', value: 'CBTC_OCCUPIED_FAULT'}
|
||||
];
|
||||
} else if (selected._type === 'Signal') {
|
||||
this.faultList = [
|
||||
{label: '灯丝熔断', value: 'DS'}
|
||||
];
|
||||
} else {
|
||||
this.faultList = deviceFaultType[selected._type];
|
||||
}
|
||||
if (this.faultList && this.faultList.length) {
|
||||
this.form.faultType = this.faultList[0].value;
|
||||
}
|
||||
this.judge = false;
|
||||
if (judge) {
|
||||
this.judge = judge;
|
||||
this.groupNumber = selected.groupNumber;
|
||||
}
|
||||
}
|
||||
if (selected._type) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.form.faultType = '';
|
||||
this.$refs.form.resetFields();
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.operation == OperationEvent.MixinCommand.stoppage.menu.operation) {
|
||||
this.sendInstructions();
|
||||
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
|
||||
this.cancelCommand();
|
||||
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
|
||||
this.handleCollocation();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelCommand() {
|
||||
// const setp = {
|
||||
// over: true,
|
||||
// operation: menuOperate.Common.cancelFault.operation,
|
||||
// cmdType: menuOperate.Common.cancelFault.cmdType,
|
||||
// param: {
|
||||
// faultType: this.form.faultType
|
||||
// }
|
||||
// };
|
||||
// this.sendCommand(setp);
|
||||
this.loading = true;
|
||||
cancelSimulationFault(this.$route.query.group, this.selected.code, this.form.faultType).then(resp => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '取消故障操作失败!');
|
||||
});
|
||||
},
|
||||
sendInstructions() { // 发送指令
|
||||
// const setp = {
|
||||
// over: true,
|
||||
// operation: menuOperate.Common.setFault.operation,
|
||||
// cmdType: menuOperate.Common.setFault.cmdType,
|
||||
// param: {
|
||||
// faultType: this.form.faultType
|
||||
// }
|
||||
// };
|
||||
// this.sendCommand(setp);
|
||||
const data = {
|
||||
deviceId: this.selected.code,
|
||||
fault: this.form.faultType,
|
||||
deviceType: this.selected._type,
|
||||
params: {}
|
||||
};
|
||||
this.loading = true;
|
||||
setSimulationFault(this.$route.query.group, data).then(resp => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '设置故障操作失败!');
|
||||
});
|
||||
},
|
||||
handleCollocation() { // 设置托管
|
||||
const setp = {
|
||||
over: true,
|
||||
operation: menuOperate.Common.collocation.operation,
|
||||
cmdType: menuOperate.Common.collocation.cmdType,
|
||||
param: {
|
||||
groupNumber: this.groupNumber,
|
||||
targetDeviceCode: this.formModel.targetDeviceCode
|
||||
}
|
||||
};
|
||||
this.sendCommand(setp);
|
||||
|
||||
},
|
||||
sendCommand(setp) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', setp).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$messageBox('设置或取消故障操作失败!');
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '设置或取消故障操作失败!');
|
||||
});
|
||||
},
|
||||
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field == 'selectedCode' && em._type == 'Section') {
|
||||
this.formModel.targetDeviceCode = em.code;
|
||||
this.field = '';
|
||||
} else if (this.field == 'selectedCode' && em._type == 'Train') {
|
||||
this.formModel.targetDeviceCode = em.code;
|
||||
this.field = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-select-dropdown.el-popper{
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.route-detail{
|
||||
position: absolute;
|
||||
left:50%;
|
||||
transform: translateX(-175px);
|
||||
margin-top: 15vh;
|
||||
width: 350px;
|
||||
z-index: 2000;
|
||||
box-sizing: border-box;
|
||||
background: rgba(100, 100, 100, 0.3);
|
||||
border: 2px solid rgba(144, 144, 144, 0.8);
|
||||
border-radius: 6px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
.el-dialog__header{
|
||||
padding: 0px 8px;
|
||||
height: 26px;
|
||||
.el-dialog__title{
|
||||
color: #fff;
|
||||
}
|
||||
.el-dialog__headerbtn{
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
top: 4px;
|
||||
right: 12px;
|
||||
line-height: 16px;
|
||||
color: #fff;
|
||||
.el-icon{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-dialog__body{
|
||||
background: #fff;
|
||||
margin: 5px;
|
||||
margin-top: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -102,7 +102,7 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.password.domId : ''
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.password.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="menus" :style="{width: width + 'px'}">
|
||||
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
|
||||
<menu-button ref="menuButton" />
|
||||
<menu-button ref="menuButton" :selected="selected" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import SectionDetail from './dialog/sectionDetail';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -51,16 +51,16 @@ export default {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Section.CMD_SECTION_DETAILS
|
||||
}
|
||||
// {
|
||||
// label: '区故解',
|
||||
// handler: this.fault,
|
||||
// cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '属性',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Section.CMD_SECTION_DETAILS
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import RouteSelection from './dialog/routeSelection';
|
||||
import RouteDetail from './dialog/routeDetail';
|
||||
import RouteHandControl from './dialog/routeHandControl';
|
||||
@ -92,56 +92,56 @@ export default {
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '办理进路',
|
||||
handler: this.arrangementRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
},
|
||||
{
|
||||
label: '办理引导进路',
|
||||
handler: this.guide,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
},
|
||||
{
|
||||
label: '取消进路',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
},
|
||||
{
|
||||
label: '总人解',
|
||||
handler: this.humanTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
handler: this.reopenSignal,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
},
|
||||
{
|
||||
label: '信号封锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
|
||||
},
|
||||
{
|
||||
label: '信号解封',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: '进路收人工控',
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
},
|
||||
{
|
||||
label: '进路交自动控',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
},
|
||||
{
|
||||
label: '进路信息',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
}
|
||||
// {
|
||||
// label: '办理进路',
|
||||
// handler: this.arrangementRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '办理引导进路',
|
||||
// handler: this.guide,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||
// },
|
||||
// {
|
||||
// label: '取消进路',
|
||||
// handler: this.cancelTrainRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '总人解',
|
||||
// handler: this.humanTrainRoute,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
// },
|
||||
// {
|
||||
// label: '信号重开',
|
||||
// handler: this.reopenSignal,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
// },
|
||||
// {
|
||||
// label: '信号封锁',
|
||||
// handler: this.lock,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '信号解封',
|
||||
// handler: this.unlock,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '进路收人工控',
|
||||
// handler: this.humanControl,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
// },
|
||||
// {
|
||||
// label: '进路交自动控',
|
||||
// handler: this.atsAutoControl,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
// },
|
||||
// {
|
||||
// label: '进路信息',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -13,7 +13,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
@ -40,6 +40,26 @@ export default {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
{
|
||||
label: '系统结构图一前置图',
|
||||
file: '01-系统结构图一前视图.pdf',
|
||||
handler: this.handlerOpenPdf
|
||||
},
|
||||
{
|
||||
label: '系统结构图二后视图',
|
||||
file: '02-系统结构图二后视图.pdf',
|
||||
handler: this.handlerOpenPdf
|
||||
},
|
||||
{
|
||||
label: '系统供电示意图',
|
||||
file: '03-系统供电示意图.pdf',
|
||||
handler: this.handlerOpenPdf
|
||||
},
|
||||
{
|
||||
label: '车站布线图',
|
||||
file: '04-车站布线图.pdf',
|
||||
handler: this.handlerOpenPdf
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
]
|
||||
@ -82,8 +102,8 @@ export default {
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
|
||||
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menu = this.menuNormal.Local;
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
@ -124,6 +144,10 @@ export default {
|
||||
},
|
||||
triggerFaultManagement() {
|
||||
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
|
||||
},
|
||||
handlerOpenPdf(elem) {
|
||||
const url = `https://joylink.club/oss/projects/wjls/${this.selected.jp}/${elem.file}`;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ import PopMenu from '@/components/PopMenu';
|
||||
import StandControl from './dialog/standControl';
|
||||
import StandDetail from './dialog/standDetail';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
@ -44,41 +44,41 @@ export default {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
},
|
||||
{
|
||||
label: '设置站间运行等级',
|
||||
handler: this.setRunLevel,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
},
|
||||
{
|
||||
label: '显示站台信息',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
// {
|
||||
// label: '设置扣车',
|
||||
// handler: this.setDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '取消扣车',
|
||||
// handler: this.cancelDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
// },
|
||||
// {
|
||||
// label: '设置跳停',
|
||||
// handler: this.setJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '取消跳停',
|
||||
// handler: this.cancelJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
// },
|
||||
// {
|
||||
// label: '设置停站时间',
|
||||
// handler: this.setStopTime,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '设置站间运行等级',
|
||||
// handler: this.setRunLevel,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
// },
|
||||
// {
|
||||
// label: '显示站台信息',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
|
@ -13,7 +13,7 @@
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock';
|
||||
@ -50,41 +50,41 @@ export default {
|
||||
menuNormal: {
|
||||
Local: [],
|
||||
Center: [
|
||||
{
|
||||
label: '单操到定位',
|
||||
handler: this.locate,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
},
|
||||
{
|
||||
label: '单操到反位',
|
||||
handler: this.reverse,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
},
|
||||
{
|
||||
label: '道岔单锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
},
|
||||
{
|
||||
label: '道岔解锁',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
},
|
||||
{
|
||||
label: '道岔封锁',
|
||||
handler: this.block,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
},
|
||||
{
|
||||
label: '道岔解封',
|
||||
handler: this.unblock,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
}
|
||||
// {
|
||||
// label: '单操到定位',
|
||||
// handler: this.locate,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '单操到反位',
|
||||
// handler: this.reverse,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
// },
|
||||
// {
|
||||
// label: '道岔单锁',
|
||||
// handler: this.lock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔解锁',
|
||||
// handler: this.unlock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔封锁',
|
||||
// handler: this.block,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '道岔解封',
|
||||
// handler: this.unblock,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
|
||||
// },
|
||||
// {
|
||||
// label: '区故解',
|
||||
// handler: this.fault,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
// }
|
||||
// {
|
||||
// label: '属性',
|
||||
// handler: this.undeveloped,
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
@ -184,7 +184,6 @@ export default {
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
|
@ -264,10 +264,6 @@ export function parser(data, skinCode, showConfig) {
|
||||
mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.signalButtonList || [], elem=> {
|
||||
mapDevice[elem.code] = createDevice(deviceType.SignalButton, elem, propConvert, showConfig);
|
||||
});
|
||||
|
||||
zrUtil.each(data.responderList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
@ -296,6 +292,16 @@ export function parser(data, skinCode, showConfig) {
|
||||
actual.aliasCodes.push(elem.code);
|
||||
}
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.signalButtonList || [], elem=> {
|
||||
mapDevice[elem.code] = createDevice(deviceType.SignalButton, elem, propConvert, showConfig);
|
||||
if (elem.signalCode) {
|
||||
const signal = mapDevice[elem.signalCode];
|
||||
if (signal.signalButtonList) {
|
||||
signal.signalButtonList.push(elem.code);
|
||||
} else { signal.signalButtonList = [elem.code]; }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mapDevice;
|
||||
|
@ -98,6 +98,16 @@ export const loginInfo = {
|
||||
navigationMarginLeft: '60px',
|
||||
systemType: '011'
|
||||
},
|
||||
wjls: {
|
||||
title: '微机联锁仿真系统',
|
||||
loginPath: '/login?project=wjls',
|
||||
loginParam: 'WJLS',
|
||||
loginTitle: '空串',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px',
|
||||
logoWidth: '0',
|
||||
systemType: '011'
|
||||
},
|
||||
drts: {
|
||||
title: '2020年“新誉杯”全国行车调度员大赛训练系统',
|
||||
loginPath: '/login?project=drts',
|
||||
@ -430,6 +440,7 @@ export const ProjectIcon = {
|
||||
designcrsc: FaviconCrsc,
|
||||
hls: FaviconHls,
|
||||
designhls: FaviconHls,
|
||||
wjls: Favicon,
|
||||
drts: Favicon,
|
||||
designdrts: Favicon,
|
||||
nty: FaviconNty,
|
||||
@ -457,6 +468,7 @@ export const ProjectCode = {
|
||||
designheb: 'HEB',
|
||||
xadt: 'XADT',
|
||||
designxadt: 'XADT',
|
||||
wjls: 'WJLS',
|
||||
drts: 'DRTS',
|
||||
designdrts: 'DRTS',
|
||||
nty: 'NTY',
|
||||
@ -473,12 +485,12 @@ export const ProjectCode = {
|
||||
designcgy: 'CGY'
|
||||
};
|
||||
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy']; // 底部栏仅展示公司信息不展示备案号
|
||||
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy']; // 实训设计平台通过项目code获取地图列表的项目
|
||||
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy']; // 实训设计平台通过项目code获取地图列表的项目
|
||||
export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目
|
||||
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'cgy', 'designcgy']; // 登录页右下角版本开发基于不展示
|
||||
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy']; // 登录页右下角版本开发基于不展示
|
||||
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy']; // 登录页右下角主体不展示
|
||||
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc',
|
||||
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy']; // 登录页样式
|
||||
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy']; // 登录页样式
|
||||
export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl'];
|
||||
export const NoSimulationQrCodeList = ['heb', 'bjd'];
|
||||
export const RegisterCodeList = ['cgy', 'designcgy'];
|
||||
@ -530,7 +542,8 @@ export const ProjectList = [
|
||||
{value: 'bjd', label: '北交大'},
|
||||
{value: 'urtss', label: '陪标项目'},
|
||||
{value: 'sdy', label: '苏电院'},
|
||||
{value: 'cgy', label: '成都工业'}
|
||||
{value: 'cgy', label: '成都工业'},
|
||||
{value: 'wjls', label: '微机联锁'}
|
||||
];
|
||||
export const localPackageProject = {
|
||||
localdesign: 'designheb',
|
||||
|
@ -41,7 +41,11 @@ export default {
|
||||
/** 挤岔恢复 */
|
||||
CMD_SWITCH_SQUEEZE_RECOVERY: {value: 'Switch_Squeeze_Recovery', label: '挤岔恢复'},
|
||||
/** 道岔命令 */
|
||||
CMD_SWITCH_COMMAND: {value: 'Switch_Command', label: '道岔命令'}
|
||||
CMD_SWITCH_COMMAND: {value: 'Switch_Command', label: '道岔命令'},
|
||||
/** 引导总锁 */
|
||||
CMD_SWITCH_MASTER_LOCK: {value:'Switch_Master_Lock', label: '设置引导总锁' },
|
||||
/** 取消引导总锁 */
|
||||
CMD_SWITCH_MASTER_UNBLOCK: {value: 'Switch_Master_Unblock', label: '取消引导总锁'}
|
||||
},
|
||||
|
||||
// 控制模式操作
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import { sendSimulationCommand } from '@/api/rtSimulation';
|
||||
import router from '@/router/index';
|
||||
import store from '@/store/index';
|
||||
import Command from './Command';
|
||||
import Handler from './Handler';
|
||||
|
||||
@ -96,11 +98,22 @@ class CommandHandle {
|
||||
execute(id, command) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const group = router.currentRoute.query.group;
|
||||
sendCommandNew(group, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
const newApi = router.currentRoute.query.newApi + '';
|
||||
if (newApi === 'true') {
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
sendSimulationCommand(group, userInfo.memberId, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
} else {
|
||||
sendCommandNew(group, id, command).then((response) => {
|
||||
resolve(response);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1106,6 +1106,14 @@ export const OperationEvent = {
|
||||
button: {
|
||||
operation: '1190',
|
||||
domId: '_Tips-Switch-GuideLock-Button{TOP}'
|
||||
},
|
||||
leftButton: {
|
||||
operation: '1191',
|
||||
domId: '_Tips-Switch-GuideLock-LeftButton{TOP}'
|
||||
},
|
||||
rightButton: {
|
||||
operation: '1192',
|
||||
domId: '_Tips-Switch-GuideLock-RightButton{TOP}'
|
||||
}
|
||||
},
|
||||
// 挤岔恢复
|
||||
|
@ -244,7 +244,8 @@ const map = {
|
||||
keyboardEnterCount: 0, // 键盘enter键触发
|
||||
controlTransfer:[], // 控制权转移消息
|
||||
mapDataParseCount: 0,
|
||||
foldLineMap: {} // 现地折行线map数据
|
||||
foldLineMap: {}, // 现地折行线map数据
|
||||
clearButtonCount: 0 // 清除操作按钮计数器
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -937,6 +938,9 @@ const map = {
|
||||
},
|
||||
mapDataParseCountIncrease: (state) => {
|
||||
state.mapDataLoadedCount += 1;
|
||||
},
|
||||
initSimulationButton: (state) => {
|
||||
state.clearButtonCount += 1;
|
||||
}
|
||||
},
|
||||
|
||||
@ -1154,6 +1158,9 @@ const map = {
|
||||
},
|
||||
mapDataParseCountIncrease: ({ commit }) => {
|
||||
commit('mapDataParseCountIncrease');
|
||||
},
|
||||
initSimulationButton: ({ commit }) => {
|
||||
commit('initSimulationButton');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,31 @@
|
||||
import store from '@/store/index';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handleSockInfo(state, msg, type) {
|
||||
switch (type) {
|
||||
case 'ats':
|
||||
state.deviceStateMessages = msg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handleSimulationStateMsg(state, type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
state.simulationPause = true;
|
||||
store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
break;
|
||||
case 1:
|
||||
store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
state.simulationPause = false;
|
||||
break;
|
||||
case 4:
|
||||
state.simulationError++;
|
||||
break;
|
||||
case 7:
|
||||
state.simulationOver++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handle(state, data) {
|
||||
// console.log(data, 'socket订阅');
|
||||
const msg = data.body;
|
||||
@ -305,7 +330,10 @@ const socket = {
|
||||
LPFstrategy:[], // 北交大 大客流 推荐策略
|
||||
isFirst:false, // 第一次是否已经订阅
|
||||
competitionPracticeFinish:0, // 竞赛场景结束标识
|
||||
simulationAlarmInfo: [] // 仿真报警信息
|
||||
simulationAlarmInfo: [], // 仿真报警信息
|
||||
deviceStateMessages: null, // 新版订阅设备状态消息
|
||||
simulationSpeed: 1, // 仿真倍速
|
||||
simulationPause: false
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
@ -326,6 +354,10 @@ const socket = {
|
||||
state.equipmentStatus = equipmentStatus;
|
||||
},
|
||||
|
||||
setDeviceStateMessages: (state, deviceStateMessages) => {
|
||||
state.deviceStateMessages = deviceStateMessages;
|
||||
},
|
||||
|
||||
setTrainStationList: (state, trainStationList) => {
|
||||
state.trainStationList = trainStationList;
|
||||
},
|
||||
@ -372,6 +404,12 @@ const socket = {
|
||||
},
|
||||
clearSimulationRoleList: (state)=>{
|
||||
state.simulationRoleList = [];
|
||||
},
|
||||
setSimulationTimeSync: (state, time) => {
|
||||
state.simulationTimeSync = time;
|
||||
},
|
||||
setSimulationSpeed: (state, speed) => {
|
||||
state.simulationSpeed = speed;
|
||||
}
|
||||
},
|
||||
|
||||
@ -379,7 +417,15 @@ const socket = {
|
||||
setStomp: ({ state }, res) => {
|
||||
handle(state, res);
|
||||
},
|
||||
|
||||
handleSock: ({ state }, data) => {
|
||||
handleSockInfo(state, data.res, data.type);
|
||||
},
|
||||
handleSimulationState: ({ state }, data) => {
|
||||
handleSimulationStateMsg(state, data);
|
||||
},
|
||||
setSimulationSpeed: ({ commit }, speed) => {
|
||||
commit('setSimulationSpeed', speed);
|
||||
},
|
||||
setChatContent: ({ commit }, chatContent) => {
|
||||
commit('setChatContent', chatContent);
|
||||
},
|
||||
@ -396,6 +442,10 @@ const socket = {
|
||||
commit('setEquipmentStatus', []);
|
||||
},
|
||||
|
||||
setDeviceStateMessages: ({ commit }) => {
|
||||
commit('setDeviceStateMessages', null);
|
||||
},
|
||||
|
||||
setTrainStationList: ({ commit }) => {
|
||||
commit('setTrainStationList', []);
|
||||
},
|
||||
@ -442,6 +492,9 @@ const socket = {
|
||||
},
|
||||
clearSimulationRoleList:({ commit }) => {
|
||||
commit('clearSimulationRoleList');
|
||||
},
|
||||
setSimulationTimeSync:({ commit }, time) => {
|
||||
commit('setSimulationTimeSync', time);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -532,7 +532,6 @@ const training = {
|
||||
updateMapState: ({ commit }, deviceStatus) => {
|
||||
commit('updateMapState', deviceStatus);
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始教学模式
|
||||
*/
|
||||
|
@ -4,8 +4,9 @@ export function getBaseUrl() {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.8.169:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.203:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
|
86
src/utils/parseStatus.js
Normal file
86
src/utils/parseStatus.js
Normal file
@ -0,0 +1,86 @@
|
||||
import deviceType from '@/jmapNew/constant/deviceType';
|
||||
export default function parseStatus(deviceStatus) {
|
||||
const msgList = [];
|
||||
(deviceStatus.switch || []).forEach(msg => {
|
||||
const elem = {};
|
||||
elem.code = msg[0];
|
||||
elem.deviceType = deviceType.Switch;
|
||||
switch (msg[1]) {
|
||||
case 0:
|
||||
elem.normalPosition = 0;
|
||||
elem.reversePosition = 0;
|
||||
elem.switchSplit = 0;
|
||||
break;
|
||||
case 1:
|
||||
elem.normalPosition = 1;
|
||||
elem.reversePosition = 0;
|
||||
elem.switchSplit = 0;
|
||||
break;
|
||||
case 2:
|
||||
elem.normalPosition = 0;
|
||||
elem.reversePosition = 1;
|
||||
elem.switchSplit = 0;
|
||||
break;
|
||||
case 4:
|
||||
elem.normalPosition = 0;
|
||||
elem.reversePosition = 0;
|
||||
elem.switchSplit = 1;
|
||||
break;
|
||||
}
|
||||
elem.blockade = msg[2];
|
||||
elem.singleLock = msg[3];
|
||||
elem.routeLock = msg[4];
|
||||
elem.overlapLock = msg[5];
|
||||
elem.fpLock = msg[6];
|
||||
msgList.push(elem);
|
||||
});
|
||||
(deviceStatus.section || []).forEach(msg => {
|
||||
const elem = {};
|
||||
elem.code = msg[0];
|
||||
elem.deviceType = deviceType.Section;
|
||||
elem.ctOccupied = msg[1];
|
||||
elem.nctOccupied = msg[2];
|
||||
elem.routeLock = msg[3];
|
||||
elem.lockRight = msg[4];
|
||||
elem.overlapLock = msg[5];
|
||||
msgList.push(elem);
|
||||
});
|
||||
(deviceStatus.signal || []).forEach(msg => {
|
||||
const elem = {};
|
||||
elem.code = msg[0];
|
||||
elem.deviceType = deviceType.Signal;
|
||||
elem.signalAspect = msg[1];
|
||||
elem.logicLight = msg[2];
|
||||
elem.forceLight = msg[3];
|
||||
elem.blockade = msg[4];
|
||||
elem.reblockade = msg[5];
|
||||
switch (msg[6]) {
|
||||
case 1:
|
||||
elem.level = 1;
|
||||
break;
|
||||
case 2:
|
||||
elem.level = 2;
|
||||
break;
|
||||
case 3:
|
||||
elem.level = 4;
|
||||
break;
|
||||
case 4:
|
||||
elem.level = 3;
|
||||
break;
|
||||
}
|
||||
elem.routeLock = msg[7];
|
||||
elem.remainTime = msg[8] / 1000;
|
||||
elem.guideTime = msg[9] / 1000;
|
||||
msgList.push(elem);
|
||||
});
|
||||
(deviceStatus.route || []).forEach(msg => {
|
||||
const elem = {};
|
||||
elem.code = msg[0];
|
||||
elem.deviceType = 'Route';
|
||||
elem.atsControl = msg[1];
|
||||
elem.ciControl = msg[2];
|
||||
elem.fleetMode = msg[3];
|
||||
msgList.push(elem);
|
||||
});
|
||||
return msgList;
|
||||
}
|
@ -9,6 +9,22 @@ export const roomTopic = '/user/queue/room'; // 房间topic
|
||||
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
|
||||
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
|
||||
|
||||
export function getTopic(type, group) {
|
||||
let topic = '';
|
||||
switch (type) {
|
||||
case 'SYSTIME':
|
||||
topic = `/user/queue/simulation/${group}/sysTime`;
|
||||
break;
|
||||
case 'ATS':
|
||||
topic = `/user/queue/simulation/${group}/ats`;
|
||||
break;
|
||||
case 'STATE':
|
||||
topic = `/user/queue/simulation/${group}/state`;
|
||||
break;
|
||||
}
|
||||
return topic;
|
||||
}
|
||||
|
||||
// 建立连接并订阅地址
|
||||
export function creatSubscribe(topic, header) {
|
||||
try {
|
||||
@ -20,13 +36,20 @@ export function creatSubscribe(topic, header) {
|
||||
console.error('websocket订阅失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 回调函数
|
||||
function callback(Response) {
|
||||
if (store) {
|
||||
var data = JSON.parse(Response.body);
|
||||
// console.log(Response.body);
|
||||
store.dispatch('socket/setStomp', data);
|
||||
if (Response.headers.destination.includes('ats')) {
|
||||
const data = {res:JSON.parse(Response.body), type:'ats' };
|
||||
store.dispatch('socket/handleSock', data);
|
||||
} else if (Response.headers.destination.includes('sysTime')) {
|
||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||
} else if (Response.headers.destination.includes('state')) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||
} else {
|
||||
const data = JSON.parse(Response.body);
|
||||
store.dispatch('socket/setStomp', data);
|
||||
}
|
||||
} else {
|
||||
callback(Response);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { PermissionType, UrlConfig } from '@/scripts/ConstDic';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { createSimulationNew } from '@/api/simulation';
|
||||
import { createSimulation } from '@/api/rtSimulation';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
@ -42,6 +43,7 @@ export default {
|
||||
tryTime: 0,
|
||||
goodsId: '',
|
||||
tryUser: 0,
|
||||
newApi: false,
|
||||
loading: false,
|
||||
disabled: false,
|
||||
currentPrdType: '',
|
||||
@ -131,6 +133,7 @@ export default {
|
||||
pmsList: resp.data.permissionList || [],
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
this.newApi = resp.data.newApi;
|
||||
this.currentPrdType = resp.data.prdType;
|
||||
if (!this.courseModel.pmsList) {
|
||||
this.tryUser = 1;
|
||||
@ -222,22 +225,42 @@ export default {
|
||||
jumpSimulation() {
|
||||
this.disabled = true;
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error=>{
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
if (this.newApi) {
|
||||
createSimulation(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project, newApi: this.newApi };
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
this.$router.push({ path: `/displayCity/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error=>{
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
} else {
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project, newApi: this.newApi };
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error=>{
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
jumpScheduling() {
|
||||
this.jumpSimulation();
|
||||
|
@ -149,6 +149,7 @@ import { removeToken, getToken } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import FloatPart from './floatPart';
|
||||
import { getSimulationInfoNew } from '@/api/simulation';
|
||||
import { getSimulationInfoByGroup } from '@/api/rtSimulation';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import Register from './register';
|
||||
@ -515,33 +516,49 @@ export default {
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (this.project === 'drts' || this.project === 'bjd') {
|
||||
} else if (this.project === 'drts' || this.project === 'bjd' || this.project === 'wjls') {
|
||||
getLoginInfo(getToken()).then(res => {
|
||||
getSimulationInfoNew(res.data.group).then(resp => {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
if (this.project === 'drts') {
|
||||
this.$router.push({ path: `/displayNew/demon`, query: {
|
||||
if (this.project === 'wjls') {
|
||||
getSimulationInfoByGroup(res.data.group).then(resp =>{
|
||||
this.$router.push({ path: `/displayCity/demon`, query: {
|
||||
lineCode: resp.data.map.lineCode,
|
||||
group: res.data.group,
|
||||
prdType: resp.data.prodType,
|
||||
mapId: resp.data.map.id,
|
||||
goodsId:'',
|
||||
try:'0',
|
||||
newApi:true,
|
||||
project:this.project
|
||||
}});
|
||||
} else {
|
||||
this.$router.push({ path: `/practiceDisplay`, query: {
|
||||
lineCode: resp.data.map.lineCode,
|
||||
group: res.data.group,
|
||||
prdType: resp.data.prodType,
|
||||
mapId: resp.data.map.id,
|
||||
project:this.project
|
||||
}});
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
launchFullscreen();
|
||||
});
|
||||
this.loading = false;
|
||||
launchFullscreen();
|
||||
});
|
||||
} else {
|
||||
getSimulationInfoNew(res.data.group).then(resp => {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
if (this.project === 'drts') {
|
||||
this.$router.push({ path: `/displayNew/demon`, query: {
|
||||
lineCode: resp.data.map.lineCode,
|
||||
group: res.data.group,
|
||||
prdType: resp.data.prodType,
|
||||
mapId: resp.data.map.id,
|
||||
goodsId:'',
|
||||
try:'0',
|
||||
project:this.project
|
||||
}});
|
||||
} else {
|
||||
this.$router.push({ path: `/practiceDisplay`, query: {
|
||||
lineCode: resp.data.map.lineCode,
|
||||
group: res.data.group,
|
||||
prdType: resp.data.prodType,
|
||||
mapId: resp.data.map.id,
|
||||
project:this.project
|
||||
}});
|
||||
}
|
||||
this.loading = false;
|
||||
launchFullscreen();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$router.push({ path: this.path });
|
||||
|
@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<div class="main" :style="{width: canvasWidth+'px',height:'100%',position:'absolute',overflow:'hidden'}">
|
||||
<div
|
||||
v-loading="loading"
|
||||
element-loading-text="玩命初始化中"
|
||||
element-loading-background="rgba(0, 0, 0, 0.5)"
|
||||
class="main"
|
||||
:style="{width: canvasWidth+'px',height:'100%',position:'absolute',overflow:'hidden'}"
|
||||
>
|
||||
<template>
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<map-system-draft ref="mapCanvas" @back="back" />
|
||||
@ -17,7 +23,8 @@ import { timeFormat } from '@/utils/date';
|
||||
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||
import MenuDemon from './menuDemon';
|
||||
import MenuSystemTime from '@/views/newMap/displayCity/menuSystemTime';
|
||||
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { getSimulationInfoNew, ranAsPlan } from '@/api/simulation';
|
||||
import { destroySimulation, initSimulation, getSimulationInfoByGroup } from '@/api/rtSimulation';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
@ -36,7 +43,8 @@ export default {
|
||||
textStatusHeight: 0,
|
||||
planRunning:false,
|
||||
dataError: false,
|
||||
group:''
|
||||
group:'',
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -83,10 +91,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 此处代码似乎没什么用,之前从menuSchema复制过来的
|
||||
'$store.state.training.prdType':function(val) {
|
||||
if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); }
|
||||
},
|
||||
'$store.state.config.menuBarLoadedCount': function (val) { // menuBar加载完成
|
||||
this.setPosition();
|
||||
},
|
||||
@ -95,6 +99,7 @@ export default {
|
||||
},
|
||||
'$store.state.training.prdType': function (val) { // 根据权限类型计算高度
|
||||
this.setPosition();
|
||||
if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); }
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
|
||||
if (this.planRunning) {
|
||||
@ -108,7 +113,7 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearSimulation(this.group);
|
||||
destroySimulation(this.group);
|
||||
this.$store.dispatch('training/reset');
|
||||
// this.$store.dispatch('map/mapClear');
|
||||
},
|
||||
@ -185,13 +190,12 @@ export default {
|
||||
},
|
||||
// 新版地图根据仿真group获取仿真基础信息
|
||||
async loadSimulationInfo() {
|
||||
const resp = await getSimulationInfoNew(this.group);
|
||||
const resp = await getSimulationInfoByGroup(this.group);
|
||||
if (resp && resp.code == 200 && resp.data) {
|
||||
if (!resp.data.dataError) {
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
|
||||
this.$store.dispatch('training/countTime');
|
||||
this.$store.dispatch('socket/handleSimulationState', resp.data.state);
|
||||
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
|
||||
this.$store.dispatch('socket/setSimulationSpeed', resp.data.speed);
|
||||
this.planRunning = resp.data.planRunning;
|
||||
if (resp.data.planRunning) {
|
||||
this.$store.commit('training/start');
|
||||
@ -290,15 +294,21 @@ export default {
|
||||
});
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.loading = true;
|
||||
initSimulation(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$store.dispatch('map/initSimulationButton');
|
||||
});
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
}, 1500);
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
}
|
||||
|
@ -21,14 +21,16 @@
|
||||
:offset-bottom="offsetBottom"
|
||||
/>
|
||||
|
||||
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'||$route.query.lineCode == '14'}" :style="{bottom: offsetBottom + 'px'}">
|
||||
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'||$route.query.lineCode == '14'}" :style="{bottom: offsetBottom + 'px'}">
|
||||
<el-button-group class="button-group-box">
|
||||
<template v-if="!dataError">
|
||||
<template v-if="!projectDevice">
|
||||
<el-button v-if="simulationPause" v-loading="pauseLoading" type="primary" size="small" @click="start">开始</el-button>
|
||||
<el-button v-if="!simulationPause" v-loading="pauseLoading" type="warning" size="small" @click="pause">暂停</el-button>
|
||||
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
|
||||
</template>
|
||||
</template>
|
||||
<el-button v-if="project !='bjd'" type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
|
||||
<el-button v-if="project !='bjd'" type="primary" size="small" @click="back">{{ projectDevice || project === 'wjls'?'退出':$t('display.demon.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,17 +43,18 @@ import DemonMenu from './demonMenu';
|
||||
import { Notification } from 'element-ui';
|
||||
import MenuSchema from '@/views/newMap/displayCity/menuSchema';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import {getSimulationInfoNew, clearSimulation } from '@/api/simulation';
|
||||
import {clearSimulation } from '@/api/simulation';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { getCountTime } from '@/utils/index';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
import { quitScriptNew } from '@/api/simulation';
|
||||
// import { quitScriptNew } from '@/api/simulation';
|
||||
import { setGoodsTryUse } from '@/api/management/goods';
|
||||
import {loadScriptNew } from '@/api/simulation';
|
||||
// import {loadScriptNew } from '@/api/simulation';
|
||||
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
|
||||
import Vue from 'vue';
|
||||
import { simulationPause, simulationStart } from '../../../api/rtSimulation';
|
||||
// import Vue from 'vue';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
// import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuDemon',
|
||||
@ -103,6 +106,7 @@ export default {
|
||||
isShow3dmodel :true,
|
||||
isGoback: false,
|
||||
runing:false,
|
||||
pauseLoading: false,
|
||||
prdTypeMap: {
|
||||
'01': '01', // 现地 => 现地
|
||||
'02': '02', // 行调 => 行调
|
||||
@ -126,6 +130,9 @@ export default {
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
simulationPause() {
|
||||
return this.$store.state.socket.simulationPause;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -213,8 +220,22 @@ export default {
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
this.$emit('start', model);
|
||||
start() {
|
||||
this.pauseLoading = true;
|
||||
simulationStart(this.$route.query.group).then(resp => {
|
||||
this.pauseLoading = false;
|
||||
}).catch((e) =>{
|
||||
this.$message.error('仿真开始失败!');
|
||||
});
|
||||
},
|
||||
pause() {
|
||||
this.pauseLoading = true;
|
||||
simulationPause(this.$route.query.group).then(resp => {
|
||||
this.pauseLoading = false;
|
||||
}).catch((e) => {
|
||||
this.pauseLoading = false;
|
||||
this.$message.error('仿真暂停失败!');
|
||||
});
|
||||
},
|
||||
setRuning(run) {
|
||||
this.runing = run;
|
||||
@ -227,7 +248,7 @@ export default {
|
||||
},
|
||||
async back() {
|
||||
this.isGoback = true;
|
||||
if (this.projectDevice) {
|
||||
if (this.projectDevice || this.project === 'wjls') {
|
||||
clearSimulation(this.group).then(res=>{
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
|
@ -1,8 +1,16 @@
|
||||
<template>
|
||||
<div class="schema" :style="{top: offset+'px'}">
|
||||
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}</el-button>
|
||||
<fault-choose ref="faultChoose" :group="group" :offset="offset" />
|
||||
</div>
|
||||
<div class="schema" :style="{top: offset+'px'}">
|
||||
<el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange">
|
||||
<el-option
|
||||
v-for="item in speedList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式[Tab]':'切换到故障模式[Tab]' }}</el-button>
|
||||
<fault-choose ref="faultChoose" :group="group" :offset="offset" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import FaultChoose from './demon/faultChoose';
|
||||
@ -11,6 +19,7 @@ import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { loadRunPlanData } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { timesSpeedPlayback } from '@/api/rtSimulation';
|
||||
|
||||
// 右上角操作
|
||||
export default {
|
||||
@ -35,7 +44,20 @@ export default {
|
||||
mode: OperateMode.NORMAL,
|
||||
OperateMode: OperateMode,
|
||||
viewDisabled: true,
|
||||
faultMode: false
|
||||
faultMode: false,
|
||||
speedList:[
|
||||
{ value: 1, label: '1倍速' },
|
||||
{ value: 2, label: '2倍速' },
|
||||
{ value: 3, label: '3倍速' },
|
||||
{ value: 4, label: '4倍速' },
|
||||
{ value: 5, label: '5倍速' },
|
||||
{ value: 6, label: '6倍速' },
|
||||
{ value: 7, label: '7倍速' },
|
||||
{ value: 8, label: '8倍速' },
|
||||
{ value: 9, label: '9倍速' },
|
||||
{ value: 10, label: '10倍速' }
|
||||
],
|
||||
speed: 1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -58,6 +80,9 @@ export default {
|
||||
},
|
||||
'$store.state.runPlan.loadRunPlanCount': function () {
|
||||
this.viewDisabled = false;
|
||||
},
|
||||
'$store.state.socket.simulationSpeed': function (val) {
|
||||
this.speed = val;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -91,6 +116,13 @@ export default {
|
||||
}
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: mode });
|
||||
},
|
||||
speedChange(val) {
|
||||
timesSpeedPlayback(this.$route.query.group, val).then(resp => {
|
||||
this.$message.success(`设置${val}倍速成功!`);
|
||||
}).catch(e => {
|
||||
this.$message.error('设置倍速失败!');
|
||||
});
|
||||
},
|
||||
setFault() {
|
||||
this.$refs.faultChoose.doShow();
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<div v-if="isShowSystemTime" class="display-card" :style="{top: top+'px', right: newRight+'px'}">
|
||||
<template v-if="pause">
|
||||
<span class="display-pause">{{ $t('display.systemTime.timePause') }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<system-time
|
||||
class="display-time"
|
||||
:time="time"
|
||||
/>
|
||||
<div v-if="isShowDate" style="width: 80px;height: 58px;float: right;box-shadow: 0 0 5px #eee;">
|
||||
<div class="display-date-box">{{ dateString }}</div>
|
||||
<div class="display-date-box">{{ dayString }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<template v-if="pause">-->
|
||||
<!--<span class="display-pause">{{ $t('display.systemTime.timePause') }}</span>-->
|
||||
<!--</template>-->
|
||||
<!--<template v-else>-->
|
||||
<system-time
|
||||
class="display-time"
|
||||
:time="time"
|
||||
/>
|
||||
<div v-if="isShowDate" style="width: 80px;height: 58px;float: right;box-shadow: 0 0 5px #eee;">
|
||||
<div class="display-date-box">{{ dateString }}</div>
|
||||
<div class="display-date-box">{{ dayString }}</div>
|
||||
</div>
|
||||
<!--</template>-->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -7,9 +7,11 @@
|
||||
<script>
|
||||
import MapCommon from './common/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic } from '@/utils/stomp';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, getTopic } from '@/utils/stomp';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
|
||||
import parseStatus from '@/utils/parseStatus';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
@ -42,6 +44,11 @@ export default {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.deviceStateMessages': function (val) {
|
||||
if (val) {
|
||||
this.statusMessageNew(val);
|
||||
}
|
||||
},
|
||||
'$store.state.map.mousemove': function (val) {
|
||||
this.mousemove();
|
||||
},
|
||||
@ -68,7 +75,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onbeforeunload = this.clearSubscribe;
|
||||
const _that = this;
|
||||
window.onbeforeunload = () => { _that.clearSubscribe(); _that.clearSubscribeNew(); };
|
||||
this.mode = this.$route.params.mode || '';
|
||||
this.currentMap = this.$refs.mapCommon;
|
||||
this.groupModel = this.$route.query.group;
|
||||
@ -82,6 +90,7 @@ export default {
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
this.clearSubscribeNew();
|
||||
this.clearAllTimer();
|
||||
},
|
||||
methods: {
|
||||
@ -92,17 +101,20 @@ export default {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
async statusMessageNew(deviceStatus) {
|
||||
const list = parseStatus(deviceStatus);
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setDeviceStateMessages');
|
||||
},
|
||||
async simulationError() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
// this.clearSubscribe();
|
||||
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
showCancelButton: false,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// this.$emit('back');
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
@ -112,6 +124,19 @@ export default {
|
||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
async subscribeNew() {
|
||||
this.clearSubscribeNew();
|
||||
const header = { 'X-Token': getToken() };
|
||||
creatSubscribe(getTopic('ATS', this.$route.query.group), header);
|
||||
creatSubscribe(getTopic('SYSTIME', this.$route.query.group), header);
|
||||
creatSubscribe(getTopic('STATE', this.$route.query.group), header);
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribeNew() {
|
||||
clearSubscribe(getTopic('ATS', this.$route.query.group));
|
||||
clearSubscribe(getTopic('SYSTIME', this.$route.query.group));
|
||||
clearSubscribe(getTopic('STATE', this.$route.query.group));
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.groupModel}`);
|
||||
},
|
||||
@ -164,20 +189,34 @@ export default {
|
||||
}, 1000);
|
||||
},
|
||||
initMemberUserInfo(isFirst = false) {
|
||||
// 获取仿真成员列表
|
||||
getSimulationMemberList(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
|
||||
getAllSimulationUser(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setSimulationUserList', resp.data);
|
||||
if (isFirst) {
|
||||
this.subscribe();
|
||||
}
|
||||
if (this.$route.query.newApi + '' === 'true') {
|
||||
getMemberListCommon(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
|
||||
getUserListCommon(this.$route.query.group).then(res => {
|
||||
this.$store.dispatch('training/setSimulationUserList', res.data);
|
||||
if (isFirst) { this.subscribeNew(); }
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取所有仿真用户失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取所有仿真用户失败!');
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
} else {
|
||||
// 获取仿真成员列表
|
||||
getSimulationMemberList(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
|
||||
getAllSimulationUser(this.$route.query.group).then(res => {
|
||||
this.$store.dispatch('training/setSimulationUserList', res.data);
|
||||
if (isFirst) {
|
||||
this.subscribe();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取所有仿真用户失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
}
|
||||
},
|
||||
handlerMemberOnOff(data) {
|
||||
this.$store.dispatch('training/updateMemberAndUser', { simulationUserList: data, userId: this.userId });
|
||||
|
@ -243,10 +243,10 @@ export default {
|
||||
const nameList = [];
|
||||
if (multiRoute) {
|
||||
routeAspectList.forEach(item => {
|
||||
const route = this.filterRouteList[item.routeCode];
|
||||
const route = this.filterRouteMap[item.routeCode];
|
||||
if (route) {
|
||||
const signalAspect = this.$convertField(route.signalAspect, this.signalAspectList, ['value', 'label']) || '';
|
||||
nameList.push(route.name + '(' + signalAspect + ')');
|
||||
const signalAspect = this.$convertField(item.signalAspect, this.signalAspectList, ['value', 'label']) || '';
|
||||
nameList.push(route + '(' + signalAspect + ')');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -113,9 +113,9 @@ export default {
|
||||
{ prop: 'code', label: this.$t('map.signalCodeColon'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.signalNameColon'), type: 'input' },
|
||||
{ prop: 'type', label: '信号机类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.signalTypeList},
|
||||
{ prop: 'positionPoint', label: '信号机偏移坐标:', type: 'coordinate', width: '140px', children: [
|
||||
{ prop: 'positionPoint.x', firstLevel: 'positionPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'positionPoint.y', firstLevel: 'positionPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
{ prop: 'position', label: '信号机坐标:', type: 'coordinate', width: '140px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
] },
|
||||
{ prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalLampPostTypeList },
|
||||
{ prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="title_content">{{ $store.state.user.companyName + '教学管理' }}</div>
|
||||
<el-button type="text" class="lessonManageBack" @click="back">返回</el-button>
|
||||
<div class="lessonManageInfo">
|
||||
<el-menuclass="lessonManageMenu" default-active="2-1">
|
||||
<el-menu class="lessonManageMenu" default-active="2-1">
|
||||
<el-menu-item index="1" @click="clickMenu">
|
||||
<img :src="classIcon" class="teachMenu">
|
||||
<span class="teachMenuTitle" :style="{color: $route.path.includes('classManage')?'#5BDBFF': '#000'}">班级管理</span>
|
||||
@ -26,11 +26,11 @@
|
||||
<img :src="ruleIcon" class="teachMenu">
|
||||
<span slot="title" :style="{color: $route.path.includes('ruleManage')?'#5BDBFF': '#000'}" class="teachMenuTitle">评价管理</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<div class="lessonManageOther">
|
||||
<router-view />
|
||||
</div>
|
||||
</el-menuclass="lessonmanagemenu"></div>
|
||||
</el-menu>
|
||||
<div class="lessonManageOther">
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {createMapSubSystem, updateSubSystem, generateMapSystem} from '@/api/trainingPlatform';
|
||||
import {createMapSubSystem, updateSubSystem, generateMapSystem, generateAppointMapSystem} from '@/api/trainingPlatform';
|
||||
import { ProjectList} from '@/scripts/ProjectConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
export default {
|
||||
@ -37,6 +37,8 @@ export default {
|
||||
name: '',
|
||||
prdType: '',
|
||||
type: '',
|
||||
newApi: false,
|
||||
appoint: false,
|
||||
id:null
|
||||
}
|
||||
};
|
||||
@ -67,7 +69,9 @@ export default {
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList}
|
||||
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList},
|
||||
{ prop: 'appoint', label: '是否指定生成', type: 'switch'},
|
||||
{ prop: 'prdType', label: '产品类型', type: 'select', required: true, options: this.prdTypeList, show: this.formModel.appoint }
|
||||
]
|
||||
};
|
||||
} else {
|
||||
@ -75,7 +79,8 @@ export default {
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true}
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
|
||||
{ prop: 'newApi', label: '是否使用新API', type: 'switch' }
|
||||
]
|
||||
};
|
||||
}
|
||||
@ -120,6 +125,7 @@ export default {
|
||||
this.isGernerate = false;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.id = row.id;
|
||||
this.formModel.newApi = row.newApi || false;
|
||||
} else {
|
||||
if (type == 'add') {
|
||||
this.title = this.$t('systemGenerate.createSubSystem');
|
||||
@ -128,7 +134,7 @@ export default {
|
||||
this.formModel.mapId = '';
|
||||
this.formModel.name = '';
|
||||
} else {
|
||||
this.title = this.$t('systemGenerate.generation');
|
||||
this.title = '生成子系统';
|
||||
this.isAdd = false;
|
||||
this.isGernerate = true;
|
||||
this.formModel.mapId = '';
|
||||
@ -151,14 +157,24 @@ export default {
|
||||
this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));
|
||||
});
|
||||
} else if (this.isGernerate) {
|
||||
generateMapSystem(this.formModel.mapId).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.generateSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.generateFail'));
|
||||
});
|
||||
if (this.formModel.appoint) {
|
||||
generateAppointMapSystem(this.formModel.mapId, this.formModel.prdType).then(resp => {
|
||||
this.$message.success('生成指定子系统成功!');
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox('生成指定子系统异常!');
|
||||
});
|
||||
} else {
|
||||
generateMapSystem(this.formModel.mapId).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.generateSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.generateFail'));
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
const datainfo = {'name': this.formModel.name};
|
||||
const datainfo = {name: this.formModel.name, newApi: this.formModel.newApi};
|
||||
updateSubSystem(this.formModel.id, datainfo).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.updateMapSystemSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
|
@ -2,30 +2,34 @@
|
||||
<div>
|
||||
<el-card style="width: 80%;margin: 30px auto;">
|
||||
<div slot="header" style="text-align: center;display: flex;align-items: center;justify-content: space-between;">
|
||||
<span class="userBubble">
|
||||
<el-button class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" size="mini" type="primary" @click="startRecording()">
|
||||
<el-progress id="record_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
|
||||
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
|
||||
<span class="iconfont icon-yuyin"></span>
|
||||
</el-button>
|
||||
<span class="userBubble">
|
||||
<el-button class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" size="mini" type="primary" @click="startRecording()">
|
||||
<el-progress id="record_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
|
||||
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
|
||||
<span class="iconfont icon-yuyin"></span>
|
||||
</el-button>
|
||||
</span>
|
||||
<span style="font-size: 20px;color: #000;">语音识别训练</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="messageList=[]">清空</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="(chatContent,index) in messageList" :key="index" class="chatContentInClass">
|
||||
<div class="userHeader" style="display:flex;justify-content:flex-start;align-items:center;margin-bottom: 2px;padding: 7px 17px;">
|
||||
<div style="display: flex;flex-direction: column;">
|
||||
<audio :src="getUrl(chatContent)" controls="controls">
|
||||
Your browser does not support the audio tag.
|
||||
</audio>
|
||||
</div>
|
||||
<div style="flex: 1;padding: 7px; 17px">
|
||||
<div style="word-break: break-all"> {{chatContent.result||"无"}} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="userHeader" style="display:flex;justify-content:flex-start;align-items:center;margin-bottom: 2px;padding: 7px 17px;">
|
||||
<div style="display: flex;flex-direction: column;">
|
||||
<audio :src="getUrl(chatContent)" controls="controls">
|
||||
Your browser does not support the audio tag.
|
||||
</audio>
|
||||
</div>
|
||||
<div style="flex: 1;padding: 7px 17px">
|
||||
<div style="word-break: break-all"> {{ chatContent.result||"无" }} </div>
|
||||
</div>
|
||||
<div style="">
|
||||
<el-input v-model="chatContent.command" type="textarea" style="width:300px;vertical-align:top;margin-right:100px;" placeholder="备注" />
|
||||
<el-button type="text" style="margin-right:10px;" @click="deleteRecord(index)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!messageList.length" style="text-align: center;padding: 17px;color: #a1a1a1;">暂无数据</div>
|
||||
<div v-if="!messageList.length" style="text-align: center;padding: 17px;color: #a1a1a1;">暂无数据</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
@ -46,10 +50,10 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getUrl(el) {
|
||||
return `https://oss.joylink.club/oss/joylink${el.filePath}`;
|
||||
},
|
||||
covertTime(time) {
|
||||
getUrl(el) {
|
||||
return `https://oss.joylink.club/oss/joylink${el.filePath}`;
|
||||
},
|
||||
covertTime(time) {
|
||||
const date = new Date(time);
|
||||
let hour = date.getHours();
|
||||
let minute = date.getMinutes();
|
||||
@ -66,60 +70,60 @@ export default {
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
|
||||
navigator.getUserMedia({ audio: true }, function (stream) {
|
||||
that.microphone = stream;
|
||||
that.recorders = new RecordRTC(that.microphone, {
|
||||
type: 'audio',
|
||||
recorderType: StereoAudioRecorder,
|
||||
numberOfAudioChannels: 1,
|
||||
bitsPerSecond:256000,
|
||||
desiredSampRate: 16000
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.audioPlay = false;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
that.stopRecording();
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
switch (error.code || error.name) {
|
||||
case 'PERMISSION_DENIED':
|
||||
case 'PermissionDeniedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '用户拒绝提供信息',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'NOT_SUPPORTED_ERROR':
|
||||
case 'NotSupportedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '浏览器不支持硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'MANDATORY_UNSATISFIED_ERROR':
|
||||
case 'MandatoryUnsatisfiedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法发现指定的硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法打开麦克风',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
that.microphone = stream;
|
||||
that.recorders = new RecordRTC(that.microphone, {
|
||||
type: 'audio',
|
||||
recorderType: StereoAudioRecorder,
|
||||
numberOfAudioChannels: 1,
|
||||
bitsPerSecond:256000,
|
||||
desiredSampRate: 16000
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.audioPlay = false;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
that.stopRecording();
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
switch (error.code || error.name) {
|
||||
case 'PERMISSION_DENIED':
|
||||
case 'PermissionDeniedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '用户拒绝提供信息',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'NOT_SUPPORTED_ERROR':
|
||||
case 'NotSupportedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '浏览器不支持硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'MANDATORY_UNSATISFIED_ERROR':
|
||||
case 'MandatoryUnsatisfiedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法发现指定的硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法打开麦克风',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@ -149,7 +153,8 @@ export default {
|
||||
uploadAudioFiles(fd)
|
||||
.then((resp) => {
|
||||
that.audioPlay = false;
|
||||
that.messageList.push(resp.data);
|
||||
resp.data.command = '';
|
||||
that.messageList.push(resp.data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
@ -163,6 +168,9 @@ export default {
|
||||
that.recorders = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteRecord(index) {
|
||||
this.messageList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -232,4 +240,5 @@ export default {
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
.deleteRecord{}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user