Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2020-11-05 18:41:17 +08:00
commit f301a89815
56 changed files with 1028 additions and 223 deletions

View File

@ -53,3 +53,11 @@ export function overConversationMessage(group, conversationMessageId) {
method: 'put'
});
}
/** 发送会话文字 */
export function sendConversationText (group, id, data) {
return request({
url: `/api/simulation/${group}/conversation/${id}/chat/text?`,
method: 'post',
data
});
}

View File

@ -118,3 +118,26 @@ export function getScriptExport(id) {
method: 'get'
});
}
/** 删除会话动作(新版)*/
export function deleteScriptAction(group, actionId) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/delete`,
method: 'delete'
});
}
/** 修改剧本活动条件 */
export function updateActionCondition(group, actionId, data) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/updateCondition`,
method: 'put',
data
});
}
/** 查询剧本活动条件 */
export function getActionCondition(group, actionId) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/condition`,
method: 'get'
});
}

View File

@ -147,6 +147,30 @@ export function modifyScriptActionNew(group, data) {
});
}
/** 开始替换 */
export function startReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/start`,
method: 'put'
});
}
/** 确认替换 */
export function confirmReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/confirm`,
method: 'put'
});
}
/** 放弃替换 */
export function cancelReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/cancel`,
method: 'put'
});
}
/** 分页查询存在的仿真 */
export function getExistingSimulation(params) {
return request({

View File

@ -28,8 +28,6 @@ export default {
const l = e.clientX - disX;
const t = e.clientY - disY;
console.log(l, l + styL, dragDom.style.left);
/** 移动当前元素*/
if (l + styL < 0) {
dragDom.style.left = `0px`;

View File

@ -109,5 +109,10 @@ export default {
revokeScriptTip: 'This action will undo release script, whether to continue?',
inputScriptName: 'Please input script name',
selectMap: 'Please select map',
inputScriptDescription: 'Please input script description'
inputScriptDescription: 'Please input script description',
startReplaceBg: '替换背景',
confirmReplaceBg: '确认替换',
cancelReplaceBg: '放弃替换'
};

View File

@ -110,5 +110,9 @@ export default {
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
inputScriptName: '请输入剧本名称',
selectMap: '请选择地图',
inputScriptDescription: '请输入剧本描述'
inputScriptDescription: '请输入剧本描述',
startReplaceBg: '替换背景',
confirmReplaceBg: '确认替换',
cancelReplaceBg: '放弃替换'
};

View File

@ -321,7 +321,8 @@ class SkinCode extends defaultStyle {
z:0,
position: -1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 13 }, // 扣车偏移量
insideOffset: { x: -8, y: 13 }, // 内站台扣车偏移量
outsideOffset: { x: -8, y: 13 }, // 外站台扣车偏移量
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -238,7 +238,8 @@ class SkinCode extends defaultStyle {
z:0,
position: -1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 13 }, // 扣车偏移量
insideOffset: { x: -8, y: 13 }, // 内站台扣车偏移量
outsideOffset:{ x: -8, y: 13 }, // 外站台扣车偏移量
centerTrainColor: 'white', // 中心扣车颜色
andCenterTrainColor: 'red', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -259,7 +259,8 @@ class SkinCode extends defaultStyle {
z:0,
position: -1, // 扣车标识在站台上显示方向
text: '扣', // 扣车显示内容
offset: {x: -8, y: 20}, // 扣车偏移量
insideOffset: {x: -8, y: 20}, // 内站台扣车偏移量
outsideOffset: {x: -8, y: 20}, // 外站台扣车偏移量
centerTrainColor: '#C0C0C0', // 中心扣车颜色
andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -229,7 +229,8 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: {x: -8, y: 17}, // 扣车偏移量
insideOffset: {x: -8, y: 17}, // 内站台扣车偏移量
outsideOffset: {x: -8, y: 17}, // 外站台扣车偏移量
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -228,7 +228,8 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: {x: -8, y: 25}, // 扣车偏移量
insideOffset: {x: -8, y: 25}, // 内站台扣车偏移量
outsideOffset: {x: -8, y: 25}, // 外站台扣车偏移量
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -216,7 +216,7 @@ class SkinCode extends defaultStyle {
this[deviceType.StationStand] = {
// 哈尔滨一号线站台元素 站台 站台紧急关闭 扣车元素 停站时间 运行等级 跳停
elemnetType:['gapStand', 'emergentArrow', 'detainNormal', 'level', 'jump', 'trainStop', 'trainDepart'],
elemnetType:['gapStand', 'emergentArrow', 'detainNormal', 'level', 'jump', 'trainStop', 'trainDepart', 'trainSetButton'],
// 站台
gapStand:{
// 层级
@ -245,7 +245,8 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: 60, y: -18 }, // 扣车偏移量
insideOffset: { x: 60, y: -18 }, // 内站台扣车偏移量
outsideOffset: { x: 60, y: 25 }, // 外站台扣车偏移量
centerTrainColor: '#F61107', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
@ -288,8 +289,16 @@ class SkinCode extends defaultStyle {
textBorderColor: '#00FF00', // 文字边框颜色
fontSize: 10 // 字体大小
},
// 站台 扣车/取消扣车,越站/取消越站 设置按钮
trainSetButton:{
z:1,
offset: { x: 80, y:10}, // 按钮偏移
textFontSize: 13, // 按钮字体大小
textColor:'#00FF00'
},
common: { // 通用属性
bgShow: true, // 是否被选中
textFontSize: 11, // 站台默认字体大小
functionButtonShow: '03' // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
},

View File

@ -354,7 +354,8 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 10 }, // 扣车偏移量
insideOffset: { x: -8, y: 10 }, // 内站台扣车偏移量
outsideOffset: { x: -8, y: 10 }, // 外站台扣车偏移量
centerTrainColor: 'white', // 中心扣车颜色
andCenterTrainColor: 'red', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色

View File

@ -337,7 +337,8 @@ class SkinCode extends defaultStyle {
z:0,
position: -1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 13 }, // 扣车偏移量
insideOffset: { x: -8, y: 13 }, // 内站台扣车偏移量
outsideOffset: { x: -8, y: 13 }, // 外站台扣车偏移量
centerTrainColor: '#00FF00', // 中心扣车颜色
andCenterTrainColor: '#00FF00', // 车站+中心扣车颜色
detainTrainTextColor: '#00FF00', // 车站扣车文字颜色
@ -658,7 +659,7 @@ class SkinCode extends defaultStyle {
], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
trainBodyFillColor: 'rgba(0,0,0,0)', // 列车车身填充颜色
trainBodyFillColor: '#000', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:tripNumber', // 列车显示格式
trainSidelineColor:'#A5A5A5' // 列车边框颜色
},

View File

@ -237,7 +237,8 @@ class SkinCode extends defaultStyle {
z:0,
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: {x: -8, y: -6}, // 扣车偏移量
insideOffset: {x: -8, y: -6}, // 内站台扣车偏移量
outsideOffset: {x: -8, y: 16}, // 外站台扣车偏移量
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色

View File

@ -0,0 +1,54 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
class ETime extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
const buttonD = model.right ? 1 : -1;
const buttonX = model.position.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2);
const buttonY = model.position.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2);
this.trainSetButton = new Text({
zlevel: this.model.zlevel,
z: this.model.z,
position: [0, 0],
_subType: 'trainSetButton',
style: {
x: buttonX,
y: buttonY,
fontWeight: style.textStyle.fontWeight,
fontSize: style.StationStand.trainSetButton.textFontSize,
fontFamily: style.fontFamily,
text: 'E',
textFill: style.StationStand.trainSetButton.textColor,
textAlign: style.textStyle.textAlign,
textVerticalAlign: style.textStyle.textVerticalAlign
}
});
this.add(this.trainSetButton);
}
hideMode() {
this.trainSetButton && this.trainSetButton.hide();
}
showMode() {
this.trainSetButton && this.trainSetButton.show();
}
recover() {
}
setState(model) {
}
}
export default ETime;

View File

@ -16,9 +16,10 @@ class EDetain extends Group {
this.isNew = true;
/** 站台扣车*/
const detainOffset = model.inside ? deviceParam.insideOffset : deviceParam.outsideOffset;
const detainD = model.right ? 1 : -1;
const detainX = model.position.x - detainD * (deviceParam.offset.x - model.width / 2);
const detainY = model.position.y + detainD * (deviceParam.offset.y - model.height / 2);
const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
this.detain = new Text({
zlevel: this.model.zlevel,

View File

@ -12,9 +12,10 @@ class EDetainHollow extends EDetain {
const model = this.model.modelData;
const style = this.model.style;
/** 站台扣车*/
const detainOffset = model.inside ? style.StationStand.detainHollow.insideOffset : style.StationStand.detainHollow.outsideOffset;
const detainD = model.right ? 1 : -1;
const detainX = model.position.x - detainD * (style.StationStand.detainHollow.offset.x - model.width / 2);
const detainY = model.position.y + detainD * (style.StationStand.detainHollow.offset.y - model.height / 2);
const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2);
const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2);
if (!this.isNew) {
super.create(style.StationStand.detainHollow);
const offsetX = model.right ? 8 : -8;

View File

@ -33,6 +33,8 @@ import ECancelStopJumpLamp from './functionButton/ECancelStopJumpLamp';
import EUpDetainLamp from './functionButton/EUpDetainLamp';
import EDownDetainLamp from './functionButton/EDownDetainLamp';
import ETrainSetButton from './ETrainSetButton';
import {isShowThePrdType} from '../../utils/handlePath';
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
@ -85,7 +87,8 @@ class StationStand extends Group {
'reentry':EReentry, // 站台折返策略
'trainStop':ETrainStop, // 列车停车点标识 哈尔滨一号线
'trainDepart':ETrainDepart// 列车停站时间 哈尔滨一号线
'trainDepart':ETrainDepart, // 列车停站时间 哈尔滨一号线
'trainSetButton':ETrainSetButton // 站台 扣车/取消扣车,越站/取消越站 设置按钮 哈尔滨一号线
};
// 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.StationStand, elementTypeList, model, style, this);
@ -117,6 +120,10 @@ class StationStand extends Group {
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
if (this.style.StationStand.common.bgShow) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
}
}
}
@ -180,6 +187,10 @@ class StationStand extends Group {
rect = this.downDetainLamp.getBoundingRect();
break;
}
case 'trainSetButton': {
rect = this.trainSetButton.getBoundingRect();
break;
}
default: {
rect = this.getBoundingRect();
break;

View File

@ -1,5 +1,5 @@
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 600,
@ -110,7 +110,11 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
// pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -203,8 +207,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPointReverse({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 3,
@ -297,7 +297,11 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
// pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -388,8 +392,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -126,7 +126,8 @@ export default {
this.canCommand = true;
const step = {
operation: 'click',
code: this.selectedObj.code
code: this.selectedObj.code,
subType:this.$store.state.menuOperation.subType
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
@ -152,7 +153,9 @@ export default {
this.oldDevice = this.selectedObj;
break;
case 'StationStand':
if (this.$store.state.menuOperation.subType == 'trainSetButton') {
this.handleStandMenu();
}
break;
case 'DirectionRod':
this.handleDirectionRodMenu();
@ -432,10 +435,16 @@ export default {
},
handleStandMenu() {
this.clearAllMenuShow();
if (this.$store.state.training.prdType === '02') {
this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;
}
this.centralizedStationList = new Array(15).fill({});
this.standParamList.forEach((stand, index) => {
this.centralizedStationList[index] = stand;
});
this.tempData = [];
const data = Object.assign(this.selectedObj);
const station = this.$store.getters['map/getDeviceByCode'](this.selectedObj.stationCode);

View File

@ -876,7 +876,8 @@ export default {
trainingType: 'Stand',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
// { deviceType: '04', orderNum: 1, tip: '鼠标左键点击选择该站台' },
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'},
{ deviceType: '04', orderNum: 2, operateCode: '5041', tip: '鼠标左键点击【扣车】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
@ -891,7 +892,8 @@ export default {
trainingType: 'Stand',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
// { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'},
{ deviceType: '04', orderNum: 2, operateCode: '5052', tip: '鼠标左键点击【取消扣车】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
@ -906,7 +908,8 @@ export default {
trainingType: 'Stand',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
// { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'},
{ deviceType: '04', orderNum: 2, operateCode: '5025', tip: '鼠标左键点击【越站】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]
@ -921,7 +924,8 @@ export default {
trainingType: 'Stand',
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
// { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' },
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'},
{ deviceType: '04', orderNum: 2, operateCode: '5035', tip: '鼠标左键点击【取消越站】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
]

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 3,
@ -168,6 +168,7 @@ export default {
var isBackup = true;
var opt = { name: '', markPointData: [], data: [] };
if (service.tripNumberDataList && service.tripNumberDataList.length) {
debugger;
service.tripNumberDataList.forEach((train, j) => {
var pointdata = {};
var idx = 0;
@ -178,7 +179,10 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -271,8 +275,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 600,
@ -137,7 +137,11 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.tripNumber}${train.destinationCode || ''}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
// pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -230,8 +234,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -12,14 +12,14 @@
>
<el-row>
<el-col :span="11">车组号</el-col>
<el-col :span="11" :offset="2">服务</el-col>
<el-col :span="11" :offset="2">车次</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="addModel.groupNumber" size="mini" :disabled="trueValue" />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="addModel.serviceNumber" size="mini" />
<el-input v-model="addModel.tripNumber" size="mini" />
<div style="color:red;font-size:13px;margin-top:5px;">{{ messageTip1 }}</div>
</el-col>
</el-row>
@ -63,7 +63,7 @@ export default {
addModel: {
groupNumber: '',
destinationCode: '',
serviceNumber: ''
tripNumber: ''
},
messageTip1:'',
messageTip2:'',
@ -110,7 +110,7 @@ export default {
//
if (!this.dialogShow) {
this.addModel.groupNumber = selected.groupNumber;
this.addModel.serviceNumber = selected.serviceNumber;
this.addModel.tripNumber = selected.tripNumber;
}
this.dialogShow = true;
this.$nextTick(function () {
@ -125,8 +125,8 @@ export default {
mouseCancelState(this.selected);
},
commit() {
if (!this.addModel.serviceNumber) {
this.messageTip1 = '请输入服务号';
if (!this.addModel.tripNumber) {
this.messageTip1 = '请输入车次号';
return;
}
if (!this.addModel.destinationCode) {
@ -137,7 +137,7 @@ export default {
const params = {
groupNumber: this.addModel.groupNumber,
destinationCode: this.addModel.destinationCode,
serviceNumber: this.addModel.serviceNumber
tripNumber: this.addModel.tripNumber
};
this.messageTip1 = '';
this.messageTip2 = '';

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 600,
@ -113,7 +113,10 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.right, false)];
/** 给服务对象添加服务名称和标记点*/
@ -211,8 +214,13 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
// console.log(elem.right, 'elem.right');
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -1,5 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
export default {
/** 边缘高度*/
EdgeHeight: 600,
@ -123,7 +123,11 @@ export default {
// pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
// pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -221,8 +225,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -1,4 +1,5 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import store from '@/store/index_APP_TARGET';
const StationMap = {
YARD1: '潏河停车场',
YARD2: '潏河停车场',
@ -176,7 +177,11 @@ export default {
/** 创建标记点名称和坐标*/
pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
// pointdata.directionCode = train.directionCode;
pointdata.directionCode = train.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
pointdata.directionCode = train.right ? '1' : '2';
}
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
@ -275,8 +280,12 @@ export default {
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`);
if (!result) {
let directionCode = elem.right ? '2' : '1';
if (!store.state.map.mapConfig.upRight) {
directionCode = elem.right ? '1' : '2';
}
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
directionCode: directionCode,
coord: [parseInt(time), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'

View File

@ -97,7 +97,8 @@ export default {
{label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '},
{label: '电力调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
{label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'}
{label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'},
{label: '停车场信号楼', value: 'PARKING_LOT_SIGNAL_BUILDING', enLabel: 'Parking Signal Building'}
],
SimulationType: [
@ -212,7 +213,8 @@ export default {
ControlConvertMenu: {enlabel: 'Control mode training', label:'控制模式实训'},
LimitControl: {enlabel: 'Control mode limit', label:'全线限速实训'},
TrainWindow: {enlabel: 'TrainWindow training', label:'车次窗实训'},
Driver:{enlabel: 'Driver training', label:'司机实训'}
Driver:{enlabel: 'Driver training', label:'司机实训'},
DirectionRod:{enlabel: 'Direction rod training', label:'方向杆实训'}
},
interfaceErrorConfig: {
'500000': { type: '权限错误:', message: '您尚未有该操作权限!'},

View File

@ -57,7 +57,8 @@ class ValidateHandler {
if (operate && standard &&
operate.code == standard.code &&
operate.operation == standard.operation &&
operate.val == standard.val) {
operate.val == standard.val &&
(!standard.subType || standard.subType && operate.subType == standard.subType) ) {
valid = true;
}
}

View File

@ -141,6 +141,13 @@ function handle(state, data) {
case 'Simulation_Alarm':
state.simulationAlarmInfo = msg;
break;
case 'Simulation_Scenes_Reload':
if (msg) {
store.dispatch('training/start');
} else {
store.dispatch('training/over');
}
break;
}
}

View File

@ -22,6 +22,7 @@ export function createMartPoint(opt) {
/** 创建一个车次数据点*/
export function createMartPointReverse(opt) {
debugger;
const rotate = opt.directionCode == '1' ? 45 : (opt.directionCode == '2' ? -45 : 0);
const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft';
return {
@ -70,7 +71,7 @@ export function createMarkLineModels(stations, computedYaxis) {
markLineModel.markLine.data = [];
markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 };
markLineModel.markLine.symbol = 'none';
markLineModel.elements = []
markLineModel.elements = [];
stations.forEach((elem, index) => {
markLineModel.markLine.data.push(
{

View File

@ -88,6 +88,8 @@
</el-button>
</div>
<div v-else>
<el-input v-if="isRecord" v-model="textContent" size="small" placeholder="请输入会话文字点击T发送" style="width: 340px;margin-top: 10px;margin-left: 6px;" :rows="1" />
<el-button v-if="isRecord" size="mini" class="chat-box-footer-create" style="right: 105px" :disabled="contentSend" @click="sendText">T</el-button>
<el-button v-if="isButtonShow && !commonConversation" size="mini" type="danger" class="chat-box-footer-create chat-box-footer-quit" :disabled="audioPlay" :loading="quitLoading" @click="quitConversition()">
<i class="el-icon-phone" />
</el-button>
@ -138,6 +140,7 @@
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" />
</div>
</template>
<div v-if="maskShow&&drawer" class="mask" />
</div>
<audio id="teleRing" :src="teleRing" preload loop />
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
@ -149,7 +152,7 @@ import ChatSetting from './chatSetting';
import ChatContent from './chatContent';
import ChatMemberList from './chatMemberList';
import RecordRTC from 'recordrtc';
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition, acceptConversitionInvite} from '@/api/chat';
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition, acceptConversitionInvite, sendConversationText} from '@/api/chat';
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'ChatBox',
@ -166,6 +169,10 @@ export default {
userRole: {
type: String,
required: true
},
isReplaceBg: {
type: Boolean,
default: false
}
},
data() {
@ -205,24 +212,30 @@ export default {
commonMessageList: [],
conversitionStateMap:{},
myMemberId: '',
audioPlay:false
audioPlay:false,
textContent: ''
};
},
computed:{
isButtonShow() {
return this.userRole != 'AUDIENCE';
},
contentSend() {
return !this.textContent;
},
project() {
return getSessionStorage('project');
},
IsAnswering() {
return !(this.$route.path.includes('refereeJsxtDisplay'));
},
maskShow() {
return this.isReplaceBg;
},
userId() {
return this.$store.state.user.id;
},
conversitionId() {
// console.log(this.conversitionStateMap, this.myMemberId, this.conversitionStateMap[this.myMemberId], (this.conversitionStateMap[this.myMemberId] || {conversitionId:''}));
return (this.conversitionStateMap[this.myMemberId] || {conversitionId:''}).conversitionId;
},
connect() {
@ -233,6 +246,9 @@ export default {
},
privateMessageList() {
return (this.conversitionStateMap[this.myMemberId] || {privateMessageList: []}).privateMessageList;
},
isRecord() {
return !!this.$route.query.record;
}
},
watch:{
@ -310,9 +326,6 @@ export default {
if (activeTrainList.length <= 0) {
this.resetCoversition();
}
// if (this.$refs.tree) {
// this.$refs.tree.filter(this.queryMember);
// }
},
'$store.state.training.simulationUserList': {
handler(val, o) {
@ -363,6 +376,7 @@ export default {
const driverList = {};
const maintainerList = {};
const parentDepartmentList = {};
const parkingLotSignalBuilding = {};
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
this.memberData[item.id]['active'] = false;
@ -399,13 +413,18 @@ export default {
case 'MAINTAINER':
this.memberData[item.id].label = '通号' + (item.name || '');
this.memberData[item.id].labelName = '通号' + (item.name || '');
// this.memberData[item.id].label = item.name || '';
maintainerList[item.id] = this.memberData[item.id];
break;
case 'PARENT_DEPARTMENT':
this.memberData[item.id].label = '上级部门' + (item.name || '');
this.memberData[item.id].labelName = '上级部门' + (item.name || '');
parentDepartmentList[item.id] = this.memberData[item.id];
break;
case 'PARKING_LOT_SIGNAL_BUILDING':
this.memberData[item.id].label = '停车场信号楼' + (item.name || '');
this.memberData[item.id].labelName = '停车场信号楼' + (item.name || '');
parkingLotSignalBuilding[item.id] = this.memberData[item.id];
break;
}
});
// { label: '', value: 'allConcentrateStation', active: false, sign: 'DEVICE_STATION' },
@ -446,6 +465,11 @@ export default {
id: 'electricDispatcher',
type: 'role',
children: electricDispatcherList
}, {
label: '停车场信号楼',
id: 'parkingLotSignalBuilding',
type: 'role',
children: parkingLotSignalBuilding
}];
this.initCommonMemberList();
this.filterNode();
@ -458,7 +482,10 @@ export default {
},
'$store.state.socket.simulationReset': function () { // 仿
this.conversitionStateMap = {};
document.querySelector('#teleName').classList.remove('flash');
const teleName = document.querySelector('#teleName');
if (teleName) {
teleName.classList.remove('flash');
}
document.querySelector('#teleRing').pause();
},
'$store.state.socket.acceptConversionInvite':function(val) {
@ -478,6 +505,55 @@ export default {
},
'$store.state.scriptRecord.audioPlay':function(val) {
this.audioPlay = val;
},
'$store.state.scriptRecord.updateRoleId':function(val) {
// val
if (this.conversitionStateMap[val]) {
this.treeData.forEach(item => {
if (item.children) {
const memberList = Object.values(item.children);
memberList.forEach(data =>{
const member = this.conversitionStateMap[val];
// && privateMem.connect;
const memberInfo = member.privateMemberList.find(privateMem=>{ return privateMem.memberId == data.id; });
// member.connect
if (member && data.id != val && memberInfo) {
data.isConnect = true;
data.active = true;
this.connectSuccess = true;
} else {
data.active = false;
data.isConnect = false;
this.connectSuccess = false;
}
data.loading = false;
data.disabled = false;
data.isInviting = false;
});
}
});
if (!this.connect) {
this.memberIdList = [];
this.memberObject = '';
}
} else {
this.memberIdList = [];
this.memberObject = '';
this.connectSuccess = false;
this.treeData.forEach(item => {
if (item.children) {
const memberList = Object.values(item.children);
memberList.forEach(data =>{
data.active = false;
data.isConnect = false;
data.loading = false;
data.disabled = false;
data.isInviting = false;
});
}
});
}
}
},
beforeDestroy() {
@ -696,9 +772,11 @@ export default {
fd.append('file', blob);
sendSimulationConversition(that.group, that.conversitionId, fd)
.then((data) => {
that.textContent = '';
})
.catch(error => {
console.log(error);
that.$message.error('语音发送失败: ' + error.message);
});
if (that.microphone) {
that.microphone.stop();
@ -708,6 +786,13 @@ export default {
}
});
},
sendText() {
sendConversationText(this.group, this.conversitionId, {content: this.textContent}).then(resp => {
this.textContent = '';
}).catch(() => {
this.$message.error('发送会话文字失败');
});
},
handleSetting() {
this.$refs.chatSetting.doShow();
},
@ -916,15 +1001,11 @@ export default {
},
changeMessageList(data) {
this.commonMessageList.push(data.message);
// if (this.conversitionStateMap[data.message.memberId]) {
// this.conversitionStateMap[data.message.memberId].privateMessageList.push(data.message);
// }
if (this.conversitionStateMap[data.message.memberId]) {
(this.conversitionStateMap[data.message.memberId].privateMemberList || []).forEach(member => {
this.conversitionStateMap[member.memberId] && this.conversitionStateMap[member.memberId].privateMessageList.push(data.message);
});
}
// console.log(this.commonConversation, this.conversitionId, data.id, this.myMemberId, this.conversitionId === data.id, this.conversitionStateMap, '/////////////////////////');
if (this.commonConversation) {
this.messageList.push(data.message);
} else if (!this.commonConversation && this.conversitionId === data.id) {
@ -960,8 +1041,9 @@ export default {
resetCoversition() {
this.commonMessageList = [];
this.conversitionStateMap = {};
this.messageList = this.commonMessageList;
this.messageList = [];
this.connectSuccess = false;
this.$store.dispatch('scriptRecord/updateAudioPlay', false);
this.treeData.forEach(item => {
if (item.children) {
const memberList = Object.values(item.children);
@ -1249,6 +1331,27 @@ export default {
-webkit-animation: isInviting infinite 1s; /* Safari 和 Chrome */
-o-animation: isInviting infinite 1s; /* Opera */
}
.mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.7;
z-index: 2000;
&::before{
content: '';
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
background: #aaa;
filter: blur(20px);
}
}
#teleName{
background: #6BBE16;
position: absolute;

View File

@ -96,7 +96,6 @@ export default {
this.isPlay = true;
this.$store.dispatch('scriptRecord/updateAudioPlay', true);
this.playAllAudio();
//
}
}
this.scrollTop();

View File

@ -149,7 +149,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -198,6 +197,9 @@ export default {
},
scriptModeList() {
return ScriptMode;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -223,6 +225,9 @@ export default {
'$store.state.socket.simulationStart':function(val) {
if (val) {
this.setRuning(true);
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}
},
'$store.state.socket.simulationReset':function(val) {
@ -233,8 +238,6 @@ export default {
const initTime = new Date(this.$store.state.training.initTime || null);
const model = {initTime:this.formatTime(initTime)};
this.start(model);
} else {
this.isDisable = true;
}
}
},
@ -283,9 +286,6 @@ export default {
const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`;
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -331,7 +331,6 @@ export default {
});
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -339,12 +338,8 @@ export default {
data.loadNumber = model.loadNum;
}
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -375,7 +370,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -385,7 +379,6 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
@ -517,16 +510,16 @@ export default {
}
});
if (currentPlayList.length > 0) {
if (currentPlayList.length > 1) {
this.currentPlayList = currentPlayList;
this.$refs.selectRole.doShow();
} else {
// if (currentPlayList.length > 1) {
// this.currentPlayList = currentPlayList;
// this.$refs.selectRole.doShow();
// } else {
const member = currentPlayList[0];
const memberId = member.id;
(this.$store.state.training.memberData[member.id] || {}).userId = this.$store.state.user.id;
(this.$store.state.training.memberData[member.id] || {}).disabled = true;
this.runScriptMode(memberId);
}
// }
}
},
runScriptMode(memberId) {

View File

@ -77,13 +77,16 @@ export default {
mounted() {
getCompetitionPracticalScene({pageSize:100, pageNum:1}).then(res=>{
if (res.data.list && res.data.list.length > 0) {
res.data.list.forEach(each=>{
const list = res.data.list.sort((a, b) => {
return parseInt(a.name.replace('场景', '')) - parseInt(b.name.replace('场景', ''));
});
list.forEach(each=>{
if (each.name == '场景1' || each.name == '场景2' || each.name == '场景3' || each.name == '场景7') {
this.mainSceneData[1].result.push({id:each.id, name:each.name});
} else if (each.name == '场景4') {
this.mainSceneData[0].result.push({id:each.id, name:'场景4'});
} else if (each.name == '场景5') {
this.mainSceneData[4].result.push({id:each.id, name:'场景5'});
} else if (each.name == '场景5' || each.name == '场景11') {
this.mainSceneData[4].result.push({id:each.id, name:each.name});
} else if (each.name == '场景9') {
this.mainSceneData[6].result.push({id:each.id, name:'场景9'});
} else if (each.name == '场景8') {
@ -174,6 +177,9 @@ export default {
member.label = '电力调度' + (member.name ? member.name : '');
break;
}
case 'PARKING_LOT_SIGNAL_BUILDING': {
member.label = '停车场信号楼' + (member.name ? member.name : '');
}
}
// if (member.type === 'DISPATCHER') {
// this.memberId = member.id;

View File

@ -233,11 +233,8 @@ export default {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
} else if (this.isScript) {
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;

View File

@ -98,7 +98,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -140,6 +139,9 @@ export default {
},
projectDevice() {
return this.$route.query.projectDevice;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -162,6 +164,9 @@ export default {
'$store.state.socket.simulationStart':function(val) {
if (val) {
this.setRuning(true);
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}
},
'$store.state.socket.simulationReset':function(val) {
@ -207,9 +212,6 @@ export default {
console.log(error);
}
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -236,7 +238,6 @@ export default {
this.$refs.setTime.doShow();
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -244,12 +245,8 @@ export default {
data.loadNumber = model.loadNum;
}
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -280,7 +277,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -290,14 +286,12 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then((res)=>{
this.isDisable = false;
EventBus.$emit('clearRunSeries');
this.quitQuest();
this.initLoadPage();

View File

@ -51,6 +51,24 @@ export const operateEnum = {
Section_Set_Limit_Speed:{
code:'speedLimitValue',
name:'限速值为'
},
Train_Load_Spare_Train:{
isList:true,
params:[
{
code:'groupNumber',
name:'车组号'
},
{
code:'right',
name:'方向',
function:judgeUpDown
// result:[
// {data:true, name:'右行', judge:'='},
// {data:false, name:'左行', judge:'='}
// ]
}
]
}
// Section_Cancel_Limit_Speed:{
// code:'speedLimitValue',
@ -188,8 +206,8 @@ export const operateEnum = {
isList:true,
params:[
{
code:'serviceNumber',
name:'服务号'
code:'tripNumber',
name:'车次号'
},
{
code:'destinationCode',
@ -208,9 +226,13 @@ export function covertOperate(operationType, operationParamMap) {
if (device._type == 'StationStand' || device._type == 'Signal' || device._type == 'Switch') {
const station = store.getters['map/getDeviceByCode'](device.stationCode);
deviceName += '【车站-' + station.name + '】 / ' + deviceType[device._type] + device.name;
} else {
if (device._type == 'Power') {
deviceName = '供电线(' + device.code + ')';
} else {
deviceName = '' + device.name;
}
}
let tip = '请找到' + deviceName + ',';
if (operationType == 'Set_Fault') {
tip += '设置故障,';
@ -230,6 +252,9 @@ export function covertOperate(operationType, operationParamMap) {
if (device == 'CM') {
device = 'ControlConvertMenu';
}
if (operationType == 'Train_Load_Spare_Train') {
device = 'Section';
}
const list = ['Train_Update_Type',
'Train_Add_Train_Trace',
'Train_Remove_Train_Trace',
@ -358,9 +383,13 @@ function covertOperation(deviceType, operationParamMap, operationType) {
}
}
});
} else {
if (param.function) {
paramName += covertFunction(param.function, data);
} else {
paramName += ',值为' + data;
}
}
if (index != params.length - 1) {
paramName += ',';
@ -399,3 +428,11 @@ function getStationResultById(stationResult) {
return station.name + ' ' + param;
}
function judgeUpDown(right) {
if (store.state.map.mapConfig.upRight) {
return right ? '上行' : '下行';
} else {
return right ? '下行' : '上行';
}
}

View File

@ -119,7 +119,8 @@ export default {
transform: translateX(-50%);
color: #000;
line-height: 180%;
z-index: 1501;
// z-index: 1501;
z-index: 15;
font-size: 14px;
}
</style>

View File

@ -228,6 +228,12 @@ export default {
id: 'electricDispatcher',
type: 'role',
children: result.deviceListData[6]
},
{
label: '停车场信号楼',
id: 'parkingLotSignalBuilding',
type: 'role',
children: result.deviceListData[7]
}];
const lastMemberList = result.lastMemberList;
this.$emit('setTreeData', treeData);

View File

@ -2,9 +2,9 @@
<div>
<div class="display-draft">
<el-button-group>
<el-button v-if="!isScriptCommand" type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<el-button v-if="!isScriptCommand" type="danger" :disabled="dataError" @click="end">初始化</el-button>
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
<el-button v-if="!isScriptCommand||isReplaceBg" type="success" :disabled="isDisable||dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<el-button v-if="!isScriptCommand||isReplaceBg" type="danger" :disabled="dataError" @click="end">初始化</el-button>
<el-button v-if="!isReplaceBg" type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group>
</div>
<demon-menu
@ -34,12 +34,15 @@
:group="group"
:offset-bottom="offsetBottom"
:offset="offset"
:is-replace-bg="isReplaceBg"
@resetChat="resetChat"
@setReplace="setReplace"
/>
<chat-box
ref="chatbox"
:group="group"
:user-role="userRole"
:is-replace-bg="isReplaceBg"
/>
</div>
</template>
@ -95,8 +98,8 @@ export default {
},
data() {
return {
isDisable: false,
isScriptCommand:false,
isReplaceBg: false,
userRole:''
};
},
@ -119,12 +122,20 @@ export default {
},
isStation() {
return this.$store.state.training.prdType == '01';
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
'$store.state.scriptRecord.bgSet':function (val) {
this.isScriptCommand = val;
},
'$store.state.socket.simulationStart': function(val) {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('map/setShowCentralizedStationNum');
});
},
'$store.state.map.mapViewLoadedCount': function (val) { //
getSimulationMemberList(this.group).then(resp => {
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
@ -133,7 +144,7 @@ export default {
return mem.userId != '' && mem.userId != undefined;
});
if (member) {
const memberType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER', 'PARENT_DEPARTMENT', 'ELECTRIC_DISPATCHER'];
const memberType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER', 'PARENT_DEPARTMENT', 'ELECTRIC_DISPATCHER', 'PARKING_LOT_SIGNAL_BUILDING'];
const prdTypeList = ['01', '02', '04', '', '05', '', ''];
const index = memberType.indexOf(member.type);
let prdType;
@ -173,21 +184,13 @@ export default {
selectBeginTime() {
this.$refs.setTime.doShow();
},
resetBeginTime() {
this.isDisable = false;
},
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -212,7 +215,6 @@ export default {
});
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -222,7 +224,6 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
@ -234,6 +235,9 @@ export default {
},
resetChat() {
// this.$refs.chatbox.resetCoversition();
},
setReplace(isRp) {
this.isReplaceBg = isRp;
}
}
};

View File

@ -15,7 +15,7 @@ export function covertMemberData (activeTrainList, resp) {
lastData = JSON.parse(lastData);
const lastMemberList = [];
// const electricDispatcherList = [];
const deviceListData = [[], [], [], [], [], [], []];
const deviceListData = [[], [], [], [], [], [], [], []];
const driverList = [];
lastData.forEach((member, index)=>{
if (member.userId && member.userId == store.state.user.id) {
@ -37,7 +37,7 @@ export function covertMemberData (activeTrainList, resp) {
member.label = member.type + name + userName;
member.normalName = member.type + name;
}
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度', '上级部门', '电力调度'];
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度', '上级部门', '电力调度', '停车场信号楼'];
const deviceTypeIndex = deviceType.indexOf(member.type);
if (deviceTypeIndex >= 0) {
if (deviceTypeIndex == 3) {

View File

@ -109,7 +109,6 @@ export default {
},
data() {
return {
isDisable: false,
backLoading: false,
chatShow: true,
jsStart: true,
@ -161,6 +160,9 @@ export default {
isDeviceLogin() {
const typeList = ['LW', 'CW'];
return typeList.includes(this.$route.query.type);
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -172,11 +174,6 @@ export default {
});
}
},
'$store.state.training.started': function (val) {
if (val) {
this.isDisable = true;
}
},
'$store.state.socket.simulationOver':function(val) {
if (val && this.project == 'refereeJsxt') {
this.$router.go(-1);
@ -284,19 +281,15 @@ export default {
},
// 仿
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
ranAsPlan(data, this.group).then(res => {
// this.$store.dispatch('training/simulationStart').then(() => {
if (this.project == 'jsxt') {
this.jsStart = false;
}
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
// });
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -321,13 +314,11 @@ export default {
});
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/resetActiveTrainList', false);
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList', false);
this.$messageBox(this.$t('error.endSimulationFailed'));
});

View File

@ -15,8 +15,8 @@ class Model {
this.destinationCode = ''; // 目的地码
this.destinationCodePoint = { x: 0, y: 0 }; // 目的地码坐标
this.namePosition = { x: 0, y: 0 };
this.kmRangeRight = 0;
this.kmRangeLeft = 0;
// this.kmRangeRight = 0;
// this.kmRangeLeft = 0;
this.region = '';
this.logicSectionCodeList = [];
this.logicSectionShow = false; // 是否显示逻辑区段
@ -135,8 +135,8 @@ class Model {
this.position = { x: 0, y: 0 };
this.kilometerPosition = { x: 0, y: 0 }; // 公里标偏移坐标
this.createControlMode = false;
this.createTurnBack = false;
this.turnBackPoint = {x: 0, y: 0}; // 按图折返坐标
// this.createTurnBack = false;
// this.turnBackPoint = {x: 0, y: 0}; // 按图折返坐标
this.controlModePoint = { x: 0, y: 0 }; // 控制模式坐标
}
StationStandModel() {

View File

@ -203,9 +203,9 @@ export default {
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, //
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, //
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
{ prop: 'trainWindowCode', label: '关联车次窗', type: 'input', disabled: true, isHidden: !this.isSwitchSectionShow },
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') }
{ prop: 'trainWindowCode', label: '关联车次窗', type: 'input', disabled: true, isHidden: !this.isSwitchSectionShow }
// { prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
// { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') }
]
}
}

View File

@ -198,12 +198,12 @@ export default {
{ prop: 'controlModePoint', label: this.$t('map.stationControlPosition'), type: 'coordinate', width: '120px', isHidden:!this.editModel.createControlMode, children: [
{ prop: 'controlModePoint.x', firstLevel: 'controlModePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px'},
{ prop: 'controlModePoint.y', firstLevel: 'controlModePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px'}
] },
{ prop: 'createTurnBack', label: '按图折返:', type: 'checkbox' },
{ prop: 'turnBackPoint', label: '按图折返坐标:', type: 'coordinate', width: '120px', isHidden: !this.isPointsShow, children: [
{ prop: 'turnBackPoint.x', firstLevel: 'turnBackPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'turnBackPoint.y', firstLevel: 'turnBackPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
// { prop: 'createTurnBack', label: ':', type: 'checkbox' },
// { prop: 'turnBackPoint', label: ':', type: 'coordinate', width: '120px', isHidden: !this.isPointsShow, children: [
// { prop: 'turnBackPoint.x', firstLevel: 'turnBackPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
// { prop: 'turnBackPoint.y', firstLevel: 'turnBackPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
// ] }
]
},
map: {

View File

@ -115,32 +115,32 @@
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{ $t('global.details')+$t('global.colon') }}
{{ '经停转换轨 / 站台轨'+$t('global.colon') }}
</el-row>
<el-row>
<el-table :data="addModel.arriveConfigList" border :height="230">
<el-table-column prop="stationCode" :label="this.$t('planMonitor.station')">
<el-table-column prop="stationCode" :label="this.$t('planMonitor.station')" width="160">
<template slot-scope="scope">
{{ formatName(scope.row.stationCode) }}
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="this.$t('planMonitor.section')">
<el-table-column prop="sectionCode" :label="this.$t('planMonitor.section')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" />
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" width="100px" />
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')">
<el-table-column :label="this.$t('planMonitor.stopTime')" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" />
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" />
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" width="100px" />
<el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
{{ scope.row.speedLevel }}
<el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
<span style="font-size:13px;">{{ scope.row.speedLevel }}</span>
<el-input v-model="scope.row.speedLevelTime" style="width:70px" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
</template>
</el-table-column>
</el-table>
@ -233,6 +233,7 @@ export default {
if (planId) {
getRoutingList(planId).then(resp => {
this.routingList = resp.data;
// debugger;
const startStationFilterMap = {};
const endStationFilterMap = {};
this.routingList.forEach(routing=>{
@ -242,6 +243,18 @@ export default {
if (!endStationFilterMap[routing.endStationCode]) {
endStationFilterMap[routing.endStationCode] = {text:formatName(routing.endStationCode), value:routing.endStationCode};
}
let length = routing.parkSectionCodeList.length;
if ( length >= 4) {
if (routing.parkSectionCodeList[0].stationCode == routing.parkSectionCodeList[1].stationCode) {
// routing.startSectionCode = routing.parkSectionCodeList[1].sectionCode;
routing.parkSectionCodeList.shift();
}
length = routing.parkSectionCodeList.length;
if (routing.parkSectionCodeList[length - 1].stationCode == routing.parkSectionCodeList[length - 2].stationCode) {
// routing.endSectionCode = routing.parkSectionCodeList[length - 2].sectionCode;
routing.parkSectionCodeList.pop();
}
}
});
this.startStationFilters = Object.values(startStationFilterMap);
this.endStationFilters = Object.values(endStationFilterMap);
@ -387,7 +400,7 @@ export default {
},
handleClick(row, column, event) {
const arriveConfigList = [];
row.parkSectionCodeList.forEach(parkSectionCode=>{
row.parkSectionCodeList.forEach((parkSectionCode, index)=>{
arriveConfigList.push({arriveTime:'', departureTime:'', sectionCode:parkSectionCode.sectionCode, stationCode:parkSectionCode.stationCode});
});
this.$set(this.addModel, 'arriveConfigList', arriveConfigList);

View File

@ -190,7 +190,7 @@
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{ $t('planMonitor.modifying.detail') }}
{{ '经停转换轨 / 站台轨:' }}
</el-row>
<el-row>
<el-table :data="editModel.arriveConfigList" border :height="230">
@ -406,17 +406,24 @@ export default {
planId: this.$route.query.planId || this.loadRunPlanId,
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
};
this.editModel.routingList = [];
this.routingList = [];
getRoutingBySDTNumber(model).then(resp => { //
// const routingObj = resp.data;
const editData = this.$store.state.runPlan.editData[this.serviceNumber];
if (editData) {
const trainInfo = editData.trainMap[this.tripNumber];
const lastIndex = trainInfo.stationTimeList.length - 1;
this.routingList.push({
code:resp.data.code,
startStationCode:resp.data.startStationCode,
endStationCode:resp.data.endStationCode,
endSectionCode:resp.data.endSectionCode,
startSectionCode:resp.data.startSectionCode
});
this.editModel = {
tripNumber: this.tripNumber,
startStationCode: resp.data.startStationCode,
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
endStationCode: resp.data.endStationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
routingCode : resp.data.code,

View File

@ -293,9 +293,11 @@ export default {
const op = this.myChart.getOption();
op.series.forEach((item, index) => {
item.lineStyle.color = '#000';
item.lineStyle.width = 0.5;
switch (item.name) {
case serviceNumber: {
item.lineStyle.color = 'red';
item.lineStyle.width = 1;
break;
}
case 'trainLabel': {
@ -327,6 +329,8 @@ export default {
data.push(nor);
}
});
// item.lineStyle.color = '#000';
item.lineStyle.width = 0.5;
break;
}
case 'trainLabel': {
@ -339,7 +343,8 @@ export default {
op.series.push({
name: 'trainLabel',
lineStyle: {
color: 'green'
color: 'green',
width:2
},
type: 'line',
data: data

View File

@ -116,11 +116,14 @@ export default {
.settingBtn{
color: #409eff;
cursor: pointer;
padding: 5px 10px;
padding: 2px 10px;
border-radius: 4px;
border: 1px #409eff solid;
}
.hasSetted{
width: 50px;
text-align: center;
display: inline-block;
}
</style>
<style>

View File

@ -0,0 +1,284 @@
<template>
<div v-if="dialogVisible" v-quickMenuDrag class="reminder-drag">
<div style="width: 100%;text-align: center;font-size: 18px;padding-top: 8px;">条件管理</div>
<i style="position: relative;top: -25px;right: -370px;font-size: 20px;" class="el-icon-close" @click="handleClose" />
<el-tabs v-model="activeName">
<el-tab-pane label="列车触发" name="first">
<div>
<el-table
:data="tableData"
style="width: 100%"
height="200px"
>
<el-table-column prop="code" label="触发列车" />
<el-table-column prop="physicalCode" label="到达区段">
<template slot-scope="scope">
<span>{{ getSectionName(scope.row.physicalCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="stop" label="是否停车">
<template slot-scope="scope">
<span>{{ handleStopValue(scope.row.stop) }}</span>
</template>
</el-table-column>
<el-table-column width="150">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.$index, scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-form ref="form" label-width="80px" style="margin-top: 8px;padding: 10px;" :model="formModel" :rules="rules">
<el-form-item label="触发列车" prop="code">
<el-select v-model="formModel.code" size="small" filterable placeholder="请选择">
<el-option
v-for="item in trainList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
<el-button :type="field === 'triggerTrain'? 'danger': 'primary'" size="small" @click="hover('triggerTrain')">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="到达区段" prop="physicalCode">
<el-select v-model="formModel.physicalCode" size="small" filterable placeholder="请选择">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button :type="field === 'triggerSection'? 'danger': 'primary'" size="small" @click="hover('triggerSection')">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="是否停车">
<el-select v-model="formModel.stop" clearable size="small" placeholder="请选择">
<el-option
v-for="item in stopList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item style="text-align: center;" label-width="0">
<el-button v-if="!update" size="small" type="primary" @click="onCommit">添加</el-button>
<el-button v-if="update" size="small" type="primary" @click="onUpdate">修改</el-button>
<el-button v-if="update" size="small" @click="initData">取消</el-button>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
<el-tab-pane label="延时触发" name="second">
<div style="text-align: center;">
<div style="display: inline-block;margin-right: 10px;font-size: 14px;">延时条件</div>
<el-input-number v-model="delay" size="small" controls-position="right" :min="0" />
<div style="margin-top: 10px;">
<el-button type="primary" size="mini" @click="onUpdateDelay">修改</el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { updateActionCondition, getActionCondition } from '@/api/script';
import { mapGetters } from 'vuex';
export default {
name: 'ConditionManage',
data() {
return {
dialogVisible: false,
tableData: [],
stopList: [
{label: '是', value: 1},
{label: '否', value: 0}
],
formModel: {
code: '',
physicalCode: '',
stop: ''
},
rules: {
code: [
{ required: true, message: '请选择触发列车', trigger: 'change' }
],
physicalCode: [
{ required: true, message: '请选择到达区段', trigger: 'change' }
]
},
actionId: '',
update: false,
updateIndex: '',
field: '',
delay: 0,
activeName: 'first'
};
},
computed: {
...mapGetters('map', [
'trainList',
'sectionList'
])
},
watch: {
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device.code) {
this.deviceSelect(device);
}
}
},
methods:{
doShow(actionId) {
if (this.actionId === actionId && this.dialogVisible) {
this.handleClose();
} else {
this.tableData = [];
this.delay = 0;
this.actionId = actionId;
getActionCondition(this.$route.query.group, this.actionId).then(resp => {
if (resp.data) {
this.tableData = resp.data.trainStatuses;
this.delay = (resp.data.delay || 0) / 1000;
}
}).catch(()=> {
this.$message.error('获取条件失败');
});
this.dialogVisible = true;
}
},
handleClose() {
this.dialogVisible = false;
this.$emit('clearConditionActionId');
this.initData();
},
getSectionName(code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
return section.name;
},
handleStopValue(stop) {
if (stop === 0) {
return '否';
} else if (stop === 1) {
return '是';
} else {
return '/';
}
},
handleEdit(index, row) {
this.updateIndex = index;
this.update = true;
this.formModel.code = row.code;
this.formModel.physicalCode = row.physicalCode;
this.formModel.stop = row.stop;
},
handleDelete(index, row) {
const data = [...this.tableData];
data.splice(index, 1);
const param = { trainStatuses: data };
if (this.delay) {
param.delay = this.delay * 1000;
}
updateActionCondition(this.$route.query.group, this.actionId, param).then(resp => {
this.tableData = data;
this.initData();
this.$message.success('删除条件成功');
}).catch(()=>{
this.$message.error('删除条件失败');
});
},
onUpdate() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = [...this.tableData];
data[this.updateIndex] = {code: this.formModel.code, physicalCode: this.formModel.physicalCode, stop: this.formModel.stop};
const param = { trainStatuses: data };
if (this.delay) {
param.delay = this.delay * 1000;
}
updateActionCondition(this.$route.query.group, this.actionId, param).then(resp => {
this.tableData = data;
this.initData();
this.$message.success('修改条件成功');
}).catch(()=>{
this.$message.error('修改条件失败');
});
}
});
},
onUpdateDelay() {
const param = { trainStatuses: this.tableData };
if (this.delay) {
param.delay = this.delay * 1000;
}
updateActionCondition(this.$route.query.group, this.actionId, param).then(resp => {
this.initData();
this.$message.success('修改条件成功');
}).catch(()=>{
this.$message.error('修改条件失败');
});
},
initData() {
this.update = false;
this.updateIndex = '';
this.$refs.form && this.$refs.form.resetFields();
},
onCommit() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = [...this.tableData];
data.push({code: this.formModel.code, physicalCode: this.formModel.physicalCode, stop: this.formModel.stop});
const param = { trainStatuses: data };
if (this.delay) {
param.delay = this.delay * 1000;
}
updateActionCondition(this.$route.query.group, this.actionId, param).then(resp => {
this.tableData = data;
this.initData();
this.$message.success('添加条件成功');
}).catch(()=>{
this.$message.error('添加条件失败');
});
}
});
},
hover(field) {
if (this.field === field) {
this.field = '';
} else {
this.field = field;
}
},
deviceSelect(em) {
if (this.field.toUpperCase() === 'triggerSection'.toUpperCase() && em._type.toUpperCase() === 'Section'.toUpperCase()) {
this.formModel.physicalCode = em.code;
} else if (this.field.toUpperCase() === 'triggerTrain'.toUpperCase() && em._type.toUpperCase() === 'Train'.toUpperCase()) {
this.formModel.code = em.code;
}
}
}
};
</script>
<style scoped>
.reminder-drag{
position: absolute;
bottom: 10px;
left: 15px;
z-index: 200;
padding: 5px;
background: #FFF;
width: 400px;
height: 600px;
border-radius: 5px;
}
</style>

View File

@ -43,10 +43,11 @@
</span>
</div>
<div class="btnGroup">
<el-button :type="conditionActionId === actionInfo.id? 'danger':'primary'" size="mini" @click="handleCondition(actionInfo)">{{ conditionActionId === actionInfo.id? '关闭条件':'触发条件' }}</el-button>
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="danger" size="mini" :loading="deleteLoading" @click="deleteAction(actionInfo.id)">删除</el-button>
</div>
</el-card>
</el-timeline-item>
@ -55,6 +56,7 @@
</template>
<script>
import {getScriptAllAction, modifyScriptActionNew } from '@/api/simulation';
import {deleteScriptAction } from '@/api/script';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
@ -82,20 +84,26 @@ export default {
// isModify:false,
// modifyText:'',
modifyTextLoading:false,
deleteLoading:false,
// behaviorName:"",
memberName: ''
memberName: '',
conditionActionId: ''
};
},
watch: {
actionInfoList: function(val) {
// actionInfoList: function(val) {
// this.$nextTick(function() {
// var div = this.$refs['elActionScrollbar'].$refs['wrap'];
// div.scrollTop = this.$refs['elActionScrollbar'].wrap.scrollHeight;
// });
// },
'$store.state.socket.scriptAction':function(val) {
this.covertData(this.memberList, val);
this.$nextTick(function() {
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop = this.$refs['elActionScrollbar'].wrap.scrollHeight;
});
},
'$store.state.socket.scriptAction':function(val) {
this.covertData(this.memberList, val);
},
'memberList':function(val) {
this.loadInitData();
}
@ -106,6 +114,14 @@ export default {
loadInitData() {
this.loadOtherData(this.$route.query);
},
handleCondition(actionInfo) {
if (this.conditionActionId === actionInfo.id) {
this.conditionActionId = '';
} else {
this.conditionActionId = actionInfo.id;
}
this.$emit('showConditionManage', actionInfo.id);
},
covertData(memberList, element) {
const member = memberList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.type + member.deviceName + (member.name ? member.name : '');
@ -149,29 +165,42 @@ export default {
// const command = CommandHandler.getScriptDefinition(element.operationType);
const commandName = element.operationType;
if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
const list = ['Train_Update_Type',
'Train_Add_Train_Trace',
'Train_Remove_Train_Trace',
'Train_Move_Train_Trace',
'Train_Set_Plan',
'Train_Set_Head',
'Train_Set_Manual',
'Train_Set_Crew_Number',
'Train_Tag_Atp_Cut',
'Train_Tag_Atp_Recover',
'Train_Allow_Pass',
'Train_Info'];
let operateType = commandName.split('_')[0];
if (list.includes(commandName)) {
operateType = 'TrainWindow';
// const list = ['Train_Update_Type',
// 'Train_Add_Train_Trace',
// 'Train_Remove_Train_Trace',
// 'Train_Move_Train_Trace',
// 'Train_Set_Plan',
// 'Train_Set_Head',
// 'Train_Set_Manual',
// 'Train_Set_Crew_Number',
// 'Train_Tag_Atp_Cut',
// 'Train_Tag_Atp_Recover',
// 'Train_Allow_Pass',
// 'Train_Info'];
// let operateType = commandName.split('_')[0];
// if (list.includes(commandName)) {
// operateType = 'TrainWindow';
// }
// if (operateType == 'CM') {
// operateType = 'ControlConvertMenu';
// }
let operateName = null;
let operateType = '';
Object.keys(CMD).forEach(key => {
Object.values(CMD[key]).forEach(el => {
if (el.value == commandName) {
operateType = key;
operateName = el;
return;
}
if (operateType == 'CM') {
operateType = 'ControlConvertMenu';
}
const operateName = Object.values(CMD[operateType]).find(res=>{ return res.value == commandName; });
});
});
// const operateName = Object.values(CMD[operateType]).find(res=>{ return res.value == commandName; });
if (operateName) {
const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', ControlConvertMenu:'控制模式', Driver:'司机', Train:'列车'};
const operateTypeName = deviceTypeList[operateType];
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false});
}
} else {
// deviceFaultType
// element.operationParamMap.faultType;
@ -209,20 +238,29 @@ export default {
return '';
}
},
loadOtherData(obj) {
loadOtherData(obj, judge = true) {
const group = obj.group;
const scrollTop = this.$refs.elActionScrollbar.wrap.scrollTop;
getScriptAllAction(group).then(resp=>{
this.actionInfoList = [];
const actionList = resp.data;
actionList.forEach(element => {
this.covertData(this.memberList, element);
});
this.$nextTick(() => {
if (judge) {
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop = this.$refs['elActionScrollbar'].wrap.scrollHeight;
} else {
this.$refs.elActionScrollbar.wrap.scrollTop = scrollTop;
}
});
}).catch(error => {
this.$message(error.message);
});
},
reloadTable() {
this.loadInitData();
this.loadOtherData(this.$route.query, false);
},
modifyAction(actionInfo) {
actionInfo.modifyText = actionInfo.row.content;
@ -257,6 +295,16 @@ export default {
actionInfo.isModify = false;
}
}
},
deleteAction(actionId) {
this.deleteLoading = true;
deleteScriptAction(this.group, actionId).then(res=>{
this.deleteLoading = false;
this.reloadTable();
}).catch(error=>{
this.deleteLoading = false;
this.$messageBox('删除会话/动作失败:' + error.message);
});
}
}
};

View File

@ -145,7 +145,7 @@ export default {
},
drawUp(index, row) {
scriptRecordNotifyNew(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode};
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode, record: true};
this.$router.push({ path: `${UrlConfig.scriptDisplayNew}/script`, query });
launchFullscreen();
}).catch(error => {

View File

@ -1,5 +1,5 @@
<template>
<div>
<div style="position:relative">
<div class="scriptRecordNew" :style="{bottom:(offsetBottom-15)+'px'}">
<div v-show="isShow" class="scriptRecordNewIn">
<el-tabs type="card">
@ -24,18 +24,28 @@
</div>
</div>
</div>
<el-button-group class="button-group">
<el-button-group v-if="!isReplaceBg" class="button-group">
<el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button>
<el-button size="small" type="danger" :disabled="!backDisabled" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button>
<el-button size="small" type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button v-if="backDisabled" size="small" type="primary" @click="startReplaceBg">{{ $t('scriptRecord.startReplaceBg') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button size="small" type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
</el-button-group>
</div>
<div class="scriptPanelRight">
<get-action-new ref="getAction" :group="group" :size="size" :member-list="memberList" />
<get-action-new ref="getAction" :group="group" :size="size" :member-list="memberList" @showConditionManage="showConditionManage" />
</div>
</div>
<template v-if="isReplaceBg">
<div class="mask" />
<el-button-group class="button-group">
<el-button v-if="isPause" size="small" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else size="small" type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复</el-button>
<el-button size="small" type="primary" @click="confirmReplaceBg">{{ $t('scriptRecord.confirmReplaceBg') }}</el-button>
<el-button size="small" type="info" @click="cancelReplaceBg">{{ $t('scriptRecord.cancelReplaceBg') }}</el-button>
</el-button-group>
</template>
</el-tab-pane>
<el-tab-pane label="所有成员">
<div class="eachScriptPanel">
@ -56,6 +66,7 @@
</div>
</div>
<add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" />
<condition-manage ref="conditionManage" @clearConditionActionId="clearConditionActionId" />
</div>
</template>
<script>
@ -68,13 +79,15 @@ import {covertMemberData} from '@/views/newMap/displayNew/utils';
import GetActionNew from './getAction';
import AllScriptRole from './allScriptRole';
import { getToken } from '@/utils/auth';
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
import ConditionManage from './conditionManage';
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause, startReplaceBg, confirmReplaceBg, cancelReplaceBg} from '@/api/simulation';
export default {
name:'TipScriptRecord',
components: {
GetActionNew,
AllScriptRole,
AddScriptMember
AddScriptMember,
ConditionManage
},
props: {
group: {
@ -88,6 +101,10 @@ export default {
offset:{
type: Number,
required: true
},
isReplaceBg: {
type: Boolean,
default: false
}
},
data() {
@ -192,6 +209,12 @@ export default {
id: 'electricDispatcher',
type: 'role',
children: result.deviceListData[6]
},
{
label: '停车场信号楼',
id: 'parkingLotSignalBuilding',
type: 'role',
children: result.deviceListData[7]
}
// PARENT_DEPARTMENT
];
@ -250,7 +273,7 @@ export default {
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
const newMember = covertmember[0];
this.memberList.push(newMember);
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段调度', '上级部门', '电力调度'];
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段调度', '上级部门', '电力调度', '停车场信号楼'];
const index = deviceTypeList.indexOf(newMember.type);
if (index >= 0) {
const treeDataIn = this.treeData[index];
@ -407,6 +430,8 @@ export default {
this.quickChangeMember.list = [new_member];
this.$emit('resetChat');
}
this.$refs.conditionManage && this.$refs.conditionManage.handleClose();
this.$refs.getAction.conditionActionId = '';
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('scriptRecord/updateRole', new_member.type + ':' + this.orignalUserRoleId);
@ -465,6 +490,10 @@ export default {
prdType = '';
role.type = 'ELECTRIC_DISPATCHER';
this.$store.dispatch('training/setRoles', 'ELECTRIC_DISPATCHER');
} else if (role.type == '停车场信号楼') {
prdType = '';
role.type = 'PARKING_LOT_SIGNAL_BUILDING';
this.$store.dispatch('training/setRoles', 'PARKING_LOT_SIGNAL_BUILDING');
} else {
prdType = '';
}
@ -492,7 +521,8 @@ export default {
'MAINTAINER':'通号',
'DEPOT_DISPATCHER':'车辆段调度',
'PARENT_DEPARTMENT':'上级部门',
'ELECTRIC_DISPATCHER':'电力调度'
'ELECTRIC_DISPATCHER':'电力调度',
'PARKING_LOT_SIGNAL_BUILDING':'停车场信号楼'
};
newRole.type = roleTypeEnumMap[newRole.type];
this.quickChangeMember.list.push(newRole);
@ -507,6 +537,34 @@ export default {
);
this.oldMember = Object.assign({}, role);
this.$refs.allScriptRole.updateLoading();
},
startReplaceBg() {
startReplaceBg(this.group).then(resp => {
this.$emit('setReplace', true);
}).catch(error => {
this.$messageBox(error.message);
});
},
confirmReplaceBg() {
confirmReplaceBg(this.group).then(resp => {
this.$message.success('替换成功');
this.$emit('setReplace', false);
}).catch(error => {
this.$messageBox(error.message);
});
},
cancelReplaceBg() {
cancelReplaceBg(this.group).then(resp => {
this.$emit('setReplace', false);
}).catch(error => {
this.$messageBox(error.message);
});
},
showConditionManage(actionId) {
this.$refs.conditionManage.doShow(actionId);
},
clearConditionActionId() {
this.$refs.getAction.conditionActionId = '';
}
}
};
@ -517,7 +575,9 @@ export default {
}
.button-group{
position: absolute;
left: 0;
bottom: 0;
z-index: 5;
}
.eachScriptPanel{
height: 300px;
@ -535,6 +595,7 @@ export default {
}
.scriptPanelRight{
width: 680px;
position: relative;
}
.scriptRecordNew{
position: absolute;
@ -583,8 +644,9 @@ export default {
.settingBtn{
color: #409eff;
cursor: pointer;
padding: 5px 10px;
padding: 2px 10px;
border-radius: 4px;
border: 1px #409eff solid;
}
.setGroupOut{
padding: 4px 6px;
@ -592,5 +654,30 @@ export default {
.setGroupOut:hover{
background-color:#ccc;
}
.hasSetted{
width: 50px;
text-align: center;
display: inline-block;
}
.mask {
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
opacity: 0.5;
z-index: 2;
&::before {
content: '';
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
background: #aaa;
filter: blur(20px);
}
}
</style>