Merge branch 'test' of git.cloud.tencent.com:joylink/jl-nclient into test
This commit is contained in:
commit
84dc26574b
@ -40,7 +40,7 @@ export function getPublishMapDetailById(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取发布地图列表*/
|
||||
/** 获取发布地图列表(不包含项目线路)*/
|
||||
export function listPublishMap(params) {
|
||||
return request({
|
||||
url: `/api/map/list`,
|
||||
|
@ -44,14 +44,6 @@ export function sendTrainingNextStep(data, group) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取实训树*/
|
||||
export function getTrainingTree() {
|
||||
return request({
|
||||
url: `/api/training/tree`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取章节基本信息*/
|
||||
export function getTrainingDetail(trainingId) {
|
||||
return request({
|
||||
|
@ -87,132 +87,133 @@
|
||||
<script>
|
||||
import { checkRectCollision } from '@/utils/index';
|
||||
export default {
|
||||
name: 'PopMenu',
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
defaultFontSize: 14,
|
||||
tPosition: {
|
||||
x: -1000,
|
||||
y: -1000
|
||||
},
|
||||
height: 'auto'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
let fontNum = 0;
|
||||
let newLabel='';
|
||||
this.menu.forEach(elem => {
|
||||
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
||||
if (elem.label && newLabel.length > fontNum) {
|
||||
fontNum=newLabel.length;
|
||||
// fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
var width = fontNum/2 * this.defaultFontSize + 60 + 'px';
|
||||
// if(this.$t('global.lanuage')==='en'){
|
||||
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
||||
// }
|
||||
return width;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
resetShowPosition(point) {
|
||||
if (point) {
|
||||
this.show = true;
|
||||
const self = this;
|
||||
this.$nextTick(() => {
|
||||
const gutter = 3;
|
||||
// 位置
|
||||
const height = self.$el.clientHeight;
|
||||
const width = self.$el.clientWidth;
|
||||
let px = 0;
|
||||
let py = 0;
|
||||
if (point.x + width > document.documentElement.clientWidth) {
|
||||
px = document.documentElement.clientWidth - width - gutter;
|
||||
} else {
|
||||
px = point.x;
|
||||
}
|
||||
if (point.y + height > document.documentElement.clientHeight) {
|
||||
py = document.documentElement.clientHeight - height - gutter;
|
||||
} else {
|
||||
py = point.y;
|
||||
}
|
||||
// 处理和提示框重叠问题
|
||||
const popTipDialog = document.getElementById('pop_tip_dialog');
|
||||
if (popTipDialog) {
|
||||
const tipRect = {
|
||||
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
||||
width: popTipDialog.offsetWidth,
|
||||
height: popTipDialog.offsetHeight
|
||||
};
|
||||
const menuRect = {
|
||||
point: { x: px, y: py },
|
||||
width: self.$el.offsetWidth,
|
||||
height: self.$el.offsetHeight
|
||||
};
|
||||
const collision = checkRectCollision(tipRect, menuRect);
|
||||
// 若重叠,调整位置
|
||||
if (collision) {
|
||||
px = tipRect.point.x + tipRect.width + gutter;
|
||||
if (px + width > document.documentElement.clientWidth) {
|
||||
px = tipRect.point.x - menuRect.width - gutter;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tPosition.x = px;
|
||||
self.tPosition.y = py;
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
// 关闭时立即影藏popover组件
|
||||
const popoverList = document.getElementsByClassName('el-popover');
|
||||
for (let i = 0; i < popoverList.length; i++) {
|
||||
popoverList[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
checkIfDisabled(menuObj) {
|
||||
return menuObj.disabled === true;
|
||||
},
|
||||
isShow(menuObj) {
|
||||
if (typeof (menuObj.show) === 'undefined') {
|
||||
return true;
|
||||
} else {
|
||||
return menuObj.show;
|
||||
}
|
||||
},
|
||||
calculateSubWidth(item) {
|
||||
const children = item.children;
|
||||
let width = 0;
|
||||
let fontNum = 0;
|
||||
children.forEach(elem => {
|
||||
if (elem.label.length > fontNum) {
|
||||
fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
width = fontNum * this.defaultFontSize + 20 + 'px';
|
||||
return width;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.label][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.handler(file);
|
||||
obj.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'PopMenu',
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
defaultFontSize: 14,
|
||||
tPosition: {
|
||||
x: -1000,
|
||||
y: -1000
|
||||
},
|
||||
height: 'auto'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
let fontNum = 0;
|
||||
let newLabel = '';
|
||||
this.menu.forEach(elem => {
|
||||
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
||||
if (elem.label && newLabel.length > fontNum) {
|
||||
fontNum = newLabel.length;
|
||||
// fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
var width = fontNum / 2 * this.defaultFontSize + 60 + 'px';
|
||||
// if(this.$t('global.lanuage')==='en'){
|
||||
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
||||
// }
|
||||
return width;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
resetShowPosition(point) {
|
||||
console.log(point);
|
||||
if (point) {
|
||||
this.show = true;
|
||||
const self = this;
|
||||
this.$nextTick(() => {
|
||||
const gutter = 3;
|
||||
// 位置
|
||||
const height = self.$el.clientHeight;
|
||||
const width = self.$el.clientWidth;
|
||||
let px = 0;
|
||||
let py = 0;
|
||||
if (point.x + width > document.documentElement.clientWidth) {
|
||||
px = document.documentElement.clientWidth - width - gutter;
|
||||
} else {
|
||||
px = point.x;
|
||||
}
|
||||
if (point.y + height > document.documentElement.clientHeight) {
|
||||
py = document.documentElement.clientHeight - height - gutter;
|
||||
} else {
|
||||
py = point.y;
|
||||
}
|
||||
// 处理和提示框重叠问题
|
||||
const popTipDialog = document.getElementById('pop_tip_dialog');
|
||||
if (popTipDialog) {
|
||||
const tipRect = {
|
||||
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
||||
width: popTipDialog.offsetWidth,
|
||||
height: popTipDialog.offsetHeight
|
||||
};
|
||||
const menuRect = {
|
||||
point: { x: px, y: py },
|
||||
width: self.$el.offsetWidth,
|
||||
height: self.$el.offsetHeight
|
||||
};
|
||||
const collision = checkRectCollision(tipRect, menuRect);
|
||||
// 若重叠,调整位置
|
||||
if (collision) {
|
||||
px = tipRect.point.x + tipRect.width + gutter;
|
||||
if (px + width > document.documentElement.clientWidth) {
|
||||
px = tipRect.point.x - menuRect.width - gutter;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tPosition.x = px;
|
||||
self.tPosition.y = py;
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
// 关闭时立即影藏popover组件
|
||||
const popoverList = document.getElementsByClassName('el-popover');
|
||||
for (let i = 0; i < popoverList.length; i++) {
|
||||
popoverList[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
checkIfDisabled(menuObj) {
|
||||
return menuObj.disabled === true;
|
||||
},
|
||||
isShow(menuObj) {
|
||||
if (typeof (menuObj.show) === 'undefined') {
|
||||
return true;
|
||||
} else {
|
||||
return menuObj.show;
|
||||
}
|
||||
},
|
||||
calculateSubWidth(item) {
|
||||
const children = item.children;
|
||||
let width = 0;
|
||||
let fontNum = 0;
|
||||
children.forEach(elem => {
|
||||
if (elem.label.length > fontNum) {
|
||||
fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
width = fontNum * this.defaultFontSize + 20 + 'px';
|
||||
return width;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.label][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.handler(file);
|
||||
obj.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -376,6 +376,7 @@ export default {
|
||||
pointSystem2: 'TwoPointSystem',
|
||||
pointSystem5: 'FivePointSystem',
|
||||
skinType: 'SkinType',
|
||||
lineCode:'Line Type',
|
||||
turnoverTime: 'TurnoverTime',
|
||||
productList: 'ProductList',
|
||||
belongsToMapName: 'BelongsToMapName',
|
||||
|
@ -488,6 +488,7 @@ export default {
|
||||
pointSystem2: '2分制',
|
||||
pointSystem5: '5分制',
|
||||
skinType: '皮肤风格',
|
||||
lineCode:'线路类型',
|
||||
turnoverTime: '更新时间',
|
||||
productList: '产品列表',
|
||||
belongsToMapName: '所属地图名称',
|
||||
|
@ -262,9 +262,9 @@ class SkinCode extends defaultStyle {
|
||||
show: true // 控制模式箭头显隐
|
||||
},
|
||||
mouseOverStyle: { // 鼠标悬浮样式
|
||||
fontSize: 10,
|
||||
fontSize: null,
|
||||
fontFormat: 'consolas',
|
||||
fontColor: '#FFF000',
|
||||
fontColor: '#000',
|
||||
fontWeight: 'normal',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
@ -302,7 +302,7 @@ class SkinCode extends defaultStyle {
|
||||
offset: {x: 0, y: 8}, // 道岔名称与区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontColor: '#C0C0C0', // 道岔名称颜色
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontWeight: 'bold', // 字体粗细
|
||||
borderColor: '#FE0000', // 道岔边框颜色
|
||||
lossColor: '#FFFFFF', // 道岔失去颜色
|
||||
locateColor: '#00FF00', // 道岔定位颜色
|
||||
|
@ -126,5 +126,10 @@ deviceRender[deviceType.TRain] = {
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
};
|
||||
/** CheckBox渲染配置*/
|
||||
deviceRender[deviceType.CheckBox] = {
|
||||
_type: deviceType.CheckBox,
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -16,7 +16,8 @@ const deviceType = {
|
||||
Train: 'Train',
|
||||
TrainWindow: 'TrainWindow',
|
||||
Line: 'Line',
|
||||
Text: 'Text'
|
||||
Text: 'Text',
|
||||
CheckBox: 'CheckBox'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -371,6 +371,26 @@ class Jlmap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderCheckBox(model) {
|
||||
const type = model._type;
|
||||
const code = model.code;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, model);
|
||||
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
|
||||
delete this.mapDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
if (!model._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
}
|
||||
deleteCheckBox(code) {
|
||||
const oDevice = this.mapDevice[code];
|
||||
if (oDevice) {
|
||||
delete this.mapDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Jlmap;
|
||||
|
@ -13,6 +13,7 @@ class EventModel {
|
||||
if (Object.values(deviceType).includes(view._type)) {
|
||||
this.deviceCode = view._code;
|
||||
this.deviceType = view._type;
|
||||
this.eventTarget = view;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -32,6 +33,11 @@ class MouseController extends Eventful {
|
||||
constructor(jmap) {
|
||||
super();
|
||||
this.$jmap = jmap;
|
||||
this.deviceList = [];
|
||||
this.rightClickPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}; // 右键点击坐标
|
||||
this.$zr = jmap.getZr();
|
||||
this.events = jmap.getEvents();
|
||||
this.initHandler(this.$zr);
|
||||
@ -76,25 +82,31 @@ class MouseController extends Eventful {
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (eventTool.notLeftMouse(e)) {
|
||||
return;
|
||||
// if (eventTool.notLeftMouse(e)) {
|
||||
// return;
|
||||
// }
|
||||
if (e.which == 1 || e.which == 3) {
|
||||
var x = e.offsetX;
|
||||
var y = e.offsetY;
|
||||
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this._dragging = true;
|
||||
if (e.which == 3 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseDownRight(e);
|
||||
} else if (e.which == 1 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseDownLeft(e);
|
||||
}
|
||||
}
|
||||
|
||||
var x = e.offsetX;
|
||||
var y = e.offsetY;
|
||||
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this._dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (eventTool.notLeftMouse(e) ||
|
||||
!this._moveOnMouseMove ||
|
||||
!this._dragging
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// if (eventTool.notLeftMouse(e) ||
|
||||
// !this._moveOnMouseMove ||
|
||||
// !this._dragging
|
||||
// ) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
@ -105,9 +117,13 @@ class MouseController extends Eventful {
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
if (e.which == 1) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
} else if (e.which === 3 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
@ -192,6 +208,66 @@ class MouseController extends Eventful {
|
||||
|
||||
return newEm;
|
||||
}
|
||||
|
||||
// 处理鼠标右键按下事件
|
||||
handleMouseDownRight(e) {
|
||||
this.rightClickPoint.x = e.offsetX;
|
||||
this.rightClickPoint.y = e.offsetY;
|
||||
}
|
||||
// 处理鼠标左键按下事件
|
||||
handleMouseDownLeft(e) {
|
||||
const em = new EventModel(e);
|
||||
this.eventTarget = em.eventTarget;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
// this.handleBoundingRect(this.eventTarget);
|
||||
} else {
|
||||
this.$jmap.deleteCheckBox('check_box');
|
||||
this.eventTarget = '';
|
||||
}
|
||||
}
|
||||
// 通过包围盒筛选选中区域的元素
|
||||
handleBoundingRect(eventTarget) {
|
||||
console.log(eventTarget, '包围盒');
|
||||
this.deviceList = [];
|
||||
// let boundingRect = eventTarget.grouper.getBoundingRect();
|
||||
const boundingRect = this.createFakeBoundingRect(eventTarget);
|
||||
const deviceList = Object.values(this.$jmap.mapDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
|
||||
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item.instance);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deviceList = includeDeviceList;
|
||||
}
|
||||
// 创建假包围盒对象
|
||||
createFakeBoundingRect(instance) {
|
||||
return {
|
||||
x1: instance.model.point.x,
|
||||
y1: instance.model.point.y,
|
||||
x2: instance.model.point.x + instance.model.width,
|
||||
y2: instance.model.point.y + instance.model.height
|
||||
};
|
||||
}
|
||||
|
||||
// 判断元素包围盒是否在选中区域
|
||||
whetherInclude(boundingRect1, boundingRect2) {
|
||||
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
|
||||
}
|
||||
|
||||
// 右键拖动区域大小
|
||||
handleMouseMoveRight(point2) {
|
||||
const point1 = this.rightClickPoint;
|
||||
const x = Math.min(point1.x, point2.x) + this.$jmap.$options.offsetX;
|
||||
const y = Math.min(point1.y, point2.y) + this.$jmap.$options.offsetY;
|
||||
const width = Math.abs(point1.x - point2.x);
|
||||
const height = Math.abs(point1.y - point2.y);
|
||||
this.$jmap.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
|
||||
}
|
||||
}
|
||||
|
||||
export default MouseController;
|
||||
|
@ -2,61 +2,61 @@ import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
export default class EMouse extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z+1,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
||||
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance-40,
|
||||
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||
text: '填充',
|
||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 1,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
||||
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance - 40,
|
||||
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||
text: '',
|
||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.text);
|
||||
this.text.hide();
|
||||
}
|
||||
setTextContext(text) {
|
||||
if (text) {
|
||||
this.text.setStyle('text', text);
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e.target) {
|
||||
let name = '';
|
||||
switch (e.target.parent._subType) {
|
||||
case 'emergency':
|
||||
name = '紧急站控';
|
||||
break;
|
||||
case 'center':
|
||||
name = '中控';
|
||||
break;
|
||||
case 'substation':
|
||||
name = '站控';
|
||||
break;
|
||||
}
|
||||
// debugger;
|
||||
this.setTextContext(name);
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
this.add(this.text);
|
||||
this.text.hide();
|
||||
}
|
||||
setTextContext(text) {
|
||||
if (text) {
|
||||
this.text.setStyle('text', text);
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e.target) {
|
||||
let name = '';
|
||||
switch (e.target.parent._subType) {
|
||||
case 'emergency':
|
||||
name = '紧急站控';
|
||||
break;
|
||||
case 'center':
|
||||
name = '中控';
|
||||
break;
|
||||
case 'substation':
|
||||
name = '站控';
|
||||
break;
|
||||
}
|
||||
// debugger;
|
||||
this.setTextContext(name);
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.text.hide();
|
||||
}
|
||||
}
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.text.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
46
src/jmap/shape/checkBox/checkBox.js
Normal file
46
src/jmap/shape/checkBox/checkBox.js
Normal file
@ -0,0 +1,46 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class checkBox extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.model = model;
|
||||
this._type = model._type;
|
||||
this._code = model.code;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.box = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: 'rgb(135,206,250,0.2)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.box);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
setSize(width, height) {
|
||||
this.model.width = width;
|
||||
this.model.height = height;
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import TrainWindow from './TrainWindow/index.js';
|
||||
import Train from './Train/index.js';
|
||||
import Line from './Line/index.js';
|
||||
import Text2 from './Text/index.js';
|
||||
import CheckBox from './checkBox/checkBox.js';
|
||||
|
||||
/** 图库*/
|
||||
const mapShape = {};
|
||||
@ -38,6 +39,7 @@ mapShape[deviceType.TrainWindow] = TrainWindow;
|
||||
mapShape[deviceType.Train] = Train;
|
||||
mapShape[deviceType.Line] = Line;
|
||||
mapShape[deviceType.Text] = Text2;
|
||||
mapShape[deviceType.CheckBox] = CheckBox;
|
||||
|
||||
function shapefactory(device, jmap) {
|
||||
const type = device._type;
|
||||
|
@ -52,7 +52,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -52,7 +52,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -52,7 +52,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -52,7 +52,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.skinType'),
|
||||
title: this.$t('menu.lineCode'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.skinType'),
|
||||
title: this.$t('menu.lineCode'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.loadDate'),
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.loadDate'),
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.operationChartSchedule');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.operationChartSchedule');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success(this.$t('global.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox(this.$t('global.failDelete'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success(this.$t('global.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox(this.$t('global.failDelete'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,364 +1,364 @@
|
||||
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
/** 边缘高度*/
|
||||
EdgeHeight: 3,
|
||||
/** 边缘高度*/
|
||||
EdgeHeight: 3,
|
||||
|
||||
/** 间隔高度*/
|
||||
CoordMultiple: 3,
|
||||
/** 间隔高度*/
|
||||
CoordMultiple: 3,
|
||||
|
||||
/** 偏移时间*/
|
||||
TranslationTime: 60 * 60 * 2,
|
||||
/** 偏移时间*/
|
||||
TranslationTime: 60 * 60 * 2,
|
||||
|
||||
/** excel解析配置*/
|
||||
ExcelConfig: {
|
||||
beginRow: 1,
|
||||
beginCol: 0,
|
||||
// fieldNum: 10,
|
||||
columns: {
|
||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||
}
|
||||
},
|
||||
/** excel解析配置*/
|
||||
ExcelConfig: {
|
||||
beginRow: 1,
|
||||
beginCol: 0,
|
||||
// fieldNum: 10,
|
||||
columns: {
|
||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||
}
|
||||
},
|
||||
|
||||
/** 解析exal数据转换为Json后台数据*/
|
||||
importData(Sheet, JsonData) {
|
||||
const dataList = convertSheetToList(Sheet, true);
|
||||
const needList = Object.keys(this.ExcelConfig.columns);
|
||||
const tripObj = { upTrack: '', downTrack: '' };
|
||||
if (dataList && dataList.length) {
|
||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||
var isContinue = true;
|
||||
/** 解析exal数据转换为Json后台数据*/
|
||||
importData(Sheet, JsonData) {
|
||||
const dataList = convertSheetToList(Sheet, true);
|
||||
const needList = Object.keys(this.ExcelConfig.columns);
|
||||
const tripObj = { upTrack: '', downTrack: '' };
|
||||
if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||
var isContinue = true;
|
||||
|
||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||
isContinue = false;
|
||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||
isContinue = false;
|
||||
|
||||
var title = dataList[colIndex][0];
|
||||
var value = dataList[colIndex][rowIndex];
|
||||
var title = dataList[colIndex][0];
|
||||
var value = dataList[colIndex][rowIndex];
|
||||
|
||||
if (title && value) {
|
||||
// 数据列解析
|
||||
isContinue = true;
|
||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
||||
if (title && value) {
|
||||
// 数据列解析
|
||||
isContinue = true;
|
||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
||||
|
||||
// 取需要的字段
|
||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||
}
|
||||
}
|
||||
// 取需要的字段
|
||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** 解析二维数组为json对象*/
|
||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
||||
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** 解析二维数组为json对象*/
|
||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
||||
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||
|
||||
dataList.forEach((elem, i) => {
|
||||
var begin = -1;
|
||||
/** 跳过名称所在的行*/
|
||||
if (i != tIndex && elem && elem.length > 0) {
|
||||
elem.forEach((item, j) => {
|
||||
/** 过滤空值*/
|
||||
if (item) {
|
||||
var value = `${item}`.trim();
|
||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||
/** 匹配到开始位置或者结束位置*/
|
||||
if (reg0.test(value)) {
|
||||
if (begin == -1) {
|
||||
begin = value; // 设置初始索引
|
||||
JsonData.push({
|
||||
code: reg0.exec(value)[1],
|
||||
arrivalList: []
|
||||
});
|
||||
} else if (begin === value) {
|
||||
begin = -1; // 清空初始索引
|
||||
}
|
||||
} else if (begin !== -1) {
|
||||
/** 匹配到中间位置*/
|
||||
var begTime, endTime;
|
||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||
var stationName = title.replace(/\s/, '');
|
||||
var need = false;
|
||||
var flag = false;
|
||||
if (reg1.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg1.exec(value);
|
||||
dataList.forEach((elem, i) => {
|
||||
var begin = -1;
|
||||
/** 跳过名称所在的行*/
|
||||
if (i != tIndex && elem && elem.length > 0) {
|
||||
elem.forEach((item, j) => {
|
||||
/** 过滤空值*/
|
||||
if (item) {
|
||||
var value = `${item}`.trim();
|
||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||
/** 匹配到开始位置或者结束位置*/
|
||||
if (reg0.test(value)) {
|
||||
if (begin == -1) {
|
||||
begin = value; // 设置初始索引
|
||||
JsonData.push({
|
||||
code: reg0.exec(value)[1],
|
||||
arrivalList: []
|
||||
});
|
||||
} else if (begin === value) {
|
||||
begin = -1; // 清空初始索引
|
||||
}
|
||||
} else if (begin !== -1) {
|
||||
/** 匹配到中间位置*/
|
||||
var begTime, endTime;
|
||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||
var stationName = title.replace(/\s/, '');
|
||||
var need = false;
|
||||
var flag = false;
|
||||
if (reg1.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg1.exec(value);
|
||||
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg2.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg2.exec(value);
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg2.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg2.exec(value);
|
||||
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg3.test(value)) {
|
||||
/** 正常时间格式*/
|
||||
[, begTime, endTime] = reg3.exec(value);
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg3.test(value)) {
|
||||
/** 正常时间格式*/
|
||||
[, begTime, endTime] = reg3.exec(value);
|
||||
|
||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||
endTime = endTime || begTime;
|
||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||
endTime = endTime || begTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, false];
|
||||
}
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, false];
|
||||
}
|
||||
|
||||
/** 添加json数据*/
|
||||
if (need) { // 储存非空 数据
|
||||
var stationObj = {
|
||||
stationName: stationName
|
||||
};
|
||||
/** 添加json数据*/
|
||||
if (need) { // 储存非空 数据
|
||||
var stationObj = {
|
||||
stationName: stationName
|
||||
};
|
||||
|
||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
JsonData.forEach(item => {
|
||||
item['upTrack'] = tripObj.upTrack;
|
||||
item['downTrack'] = tripObj.downTrack;
|
||||
});
|
||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
JsonData.forEach(item => {
|
||||
item['upTrack'] = tripObj.upTrack;
|
||||
item['downTrack'] = tripObj.downTrack;
|
||||
});
|
||||
|
||||
return JsonData;
|
||||
},
|
||||
return JsonData;
|
||||
},
|
||||
|
||||
/** 将后台数据解析成图表*/
|
||||
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
||||
var models = [];
|
||||
/** 将后台数据解析成图表*/
|
||||
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
||||
var models = [];
|
||||
|
||||
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
||||
/** 按服务遍历数据*/
|
||||
data.serviceNumberDataList.forEach((service) => {
|
||||
/** 按车次遍历数据*/
|
||||
var isBackup = true;
|
||||
var opt = { name: '', markPointData: [], data: [] };
|
||||
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
||||
service.tripNumberDataList.forEach((train, j) => {
|
||||
var pointdata = {};
|
||||
var idx = 0;
|
||||
var lastPoint = null;
|
||||
var nextPoint = null;
|
||||
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
||||
/** 按服务遍历数据*/
|
||||
data.serviceNumberDataList.forEach((service) => {
|
||||
/** 按车次遍历数据*/
|
||||
var isBackup = true;
|
||||
var opt = { name: '', markPointData: [], data: [] };
|
||||
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
||||
service.tripNumberDataList.forEach((train, j) => {
|
||||
var pointdata = {};
|
||||
var idx = 0;
|
||||
var lastPoint = null;
|
||||
var nextPoint = null;
|
||||
|
||||
/** 创建标记点名称和坐标*/
|
||||
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
||||
pointdata.color = '#000' || lineStyle.color;
|
||||
pointdata.directionCode = train.directionCode;
|
||||
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
||||
/** 创建标记点名称和坐标*/
|
||||
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
||||
pointdata.color = '#000' || lineStyle.color;
|
||||
pointdata.directionCode = train.directionCode;
|
||||
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
||||
|
||||
/** 给服务对象添加服务名称和标记点*/
|
||||
opt.name = '' + service.serviceNumber;
|
||||
opt.markPointData.push(createMartPoint(pointdata));
|
||||
/** 给服务对象添加服务名称和标记点*/
|
||||
opt.name = '' + service.serviceNumber;
|
||||
opt.markPointData.push(createMartPoint(pointdata));
|
||||
|
||||
/** 计算非折返点车次点坐标集合*/
|
||||
train.stationTimeList.forEach((elem, index) => {
|
||||
idx = index;
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
|
||||
});
|
||||
/** 计算非折返点车次点坐标集合*/
|
||||
train.stationTimeList.forEach((elem, index) => {
|
||||
idx = index;
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
|
||||
});
|
||||
|
||||
/** 计算折返点车次坐标点集合*/
|
||||
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
|
||||
lastPoint = train.stationTimeList[idx];
|
||||
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
}
|
||||
/** 计算折返点车次坐标点集合*/
|
||||
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
|
||||
lastPoint = train.stationTimeList[idx];
|
||||
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
}
|
||||
|
||||
/** 如果是备用车,按车次添加线*/
|
||||
if (train.backup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
opt.name += j;
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
opt = { name: '', markPointData: [], data: [] };
|
||||
}
|
||||
}
|
||||
/** 如果是备用车,按车次添加线*/
|
||||
if (train.backup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
opt.name += j;
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
opt = { name: '', markPointData: [], data: [] };
|
||||
}
|
||||
}
|
||||
|
||||
isBackup = train.backup;
|
||||
});
|
||||
isBackup = train.backup;
|
||||
});
|
||||
|
||||
// 不是备用车,按服务添加线
|
||||
if (!isBackup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return models;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
// 不是备用车,按服务添加线
|
||||
if (!isBackup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return models;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
/** 更新数据并解析成图表*/
|
||||
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
/** 判断此条记录的服务号是否存在*/
|
||||
if (!runPlanData[elem.serviceNumber]) {
|
||||
/** 创建一个新服务号标记*/
|
||||
runPlanData[elem.serviceNumber] = {};
|
||||
/** 更新数据并解析成图表*/
|
||||
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
/** 判断此条记录的服务号是否存在*/
|
||||
if (!runPlanData[elem.serviceNumber]) {
|
||||
/** 创建一个新服务号标记*/
|
||||
runPlanData[elem.serviceNumber] = {};
|
||||
|
||||
/** 不存在此服务号,则需要创建一条新的line*/
|
||||
series.push(createSeriesModel({
|
||||
zlevel: 1,
|
||||
name: `run${elem.serviceNumber}`,
|
||||
data: [],
|
||||
markPointData: []
|
||||
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
||||
}
|
||||
/** 不存在此服务号,则需要创建一条新的line*/
|
||||
series.push(createSeriesModel({
|
||||
zlevel: 1,
|
||||
name: `run${elem.serviceNumber}`,
|
||||
data: [],
|
||||
markPointData: []
|
||||
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
||||
}
|
||||
|
||||
/** 添加数据*/
|
||||
series.forEach(serie => {
|
||||
/** 找到服务号所在图数据的位置*/
|
||||
if (serie.name == `run${elem.serviceNumber}`) {
|
||||
/** 添加车组号记录标记*/
|
||||
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
||||
}
|
||||
/** 添加数据*/
|
||||
series.forEach(serie => {
|
||||
/** 找到服务号所在图数据的位置*/
|
||||
if (serie.name == `run${elem.serviceNumber}`) {
|
||||
/** 添加车组号记录标记*/
|
||||
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
||||
}
|
||||
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
||||
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
||||
});
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
||||
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
||||
});
|
||||
|
||||
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
||||
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
||||
serie.markPoint.data.push(createMartPoint({
|
||||
directionCode: elem.directionCode,
|
||||
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
||||
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
||||
color: lineStyle.color || '#000'
|
||||
}));
|
||||
}
|
||||
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
||||
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
||||
serie.markPoint.data.push(createMartPoint({
|
||||
directionCode: elem.directionCode,
|
||||
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
||||
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
||||
color: lineStyle.color || '#000'
|
||||
}));
|
||||
}
|
||||
|
||||
/** 计算折返点*/
|
||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
||||
if (serie.data.length > 0) {
|
||||
var lastPoint = serie.data[serie.data.length - 1];
|
||||
if (lastPoint[2] !== nextPoint[2]) {
|
||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
}
|
||||
}
|
||||
/** 计算折返点*/
|
||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
||||
if (serie.data.length > 0) {
|
||||
var lastPoint = serie.data[serie.data.length - 1];
|
||||
if (lastPoint[2] !== nextPoint[2]) {
|
||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
}
|
||||
}
|
||||
|
||||
/** 添加车组号数据到对应的服务图数据中*/
|
||||
serie.data.push(nextPoint);
|
||||
/** 添加车组号数据到对应的服务图数据中*/
|
||||
serie.data.push(nextPoint);
|
||||
|
||||
/** 保证原始数据排序*/
|
||||
serie.data.sort((a, b) => {
|
||||
return parseInt(a[0]) - parseInt(b[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
/** 保证原始数据排序*/
|
||||
serie.data.sort((a, b) => {
|
||||
return parseInt(a[0]) - parseInt(b[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
return series;
|
||||
},
|
||||
|
||||
/** 将后台数据转换为试图序列模型*/
|
||||
convertStationsToMap(stations) {
|
||||
var map = {};
|
||||
if (stations && stations.length) {
|
||||
stations.forEach((elem, index) => {
|
||||
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
}
|
||||
/** 将后台数据转换为试图序列模型*/
|
||||
convertStationsToMap(stations) {
|
||||
var map = {};
|
||||
if (stations && stations.length) {
|
||||
stations.forEach((elem, index) => {
|
||||
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
}
|
||||
|
||||
return map;
|
||||
},
|
||||
/** 初始化Y轴*/
|
||||
initializeYaxis(stations) {
|
||||
return createMarkLineModels(stations, (elem, index) => {
|
||||
return this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
},
|
||||
return map;
|
||||
},
|
||||
/** 初始化Y轴*/
|
||||
initializeYaxis(stations) {
|
||||
return createMarkLineModels(stations, (elem, index) => {
|
||||
return this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
},
|
||||
|
||||
/** 计算y轴最小值*/
|
||||
computedYaxisMinValue() {
|
||||
return 0;
|
||||
},
|
||||
/** 计算y轴最小值*/
|
||||
computedYaxisMinValue() {
|
||||
return 0;
|
||||
},
|
||||
|
||||
/** 计算y轴最大值*/
|
||||
computedYaxisMaxValue(stations) {
|
||||
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
||||
},
|
||||
/** 计算y轴最大值*/
|
||||
computedYaxisMaxValue(stations) {
|
||||
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
||||
},
|
||||
|
||||
/** 格式化y轴数据*/
|
||||
computedFormatYAxis(stations, params) {
|
||||
var yText = '';
|
||||
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
||||
if (index >= 0 && index < stations.length) {
|
||||
yText = stations[index].kmRange + 'm';
|
||||
}
|
||||
return yText;
|
||||
},
|
||||
/** 格式化y轴数据*/
|
||||
computedFormatYAxis(stations, params) {
|
||||
var yText = '';
|
||||
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
||||
if (index >= 0 && index < stations.length) {
|
||||
yText = stations[index].kmRange + 'm';
|
||||
}
|
||||
return yText;
|
||||
},
|
||||
|
||||
/** 根据方向计算y折返偏移量*/
|
||||
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
||||
if (directionCode === '1') {
|
||||
defaultVlue -= this.EdgeHeight / 2;
|
||||
} else if (directionCode === '2') {
|
||||
defaultVlue += this.EdgeHeight / 2;
|
||||
}
|
||||
/** 根据方向计算y折返偏移量*/
|
||||
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
||||
if (directionCode === '1') {
|
||||
defaultVlue -= this.EdgeHeight / 2;
|
||||
} else if (directionCode === '2') {
|
||||
defaultVlue += this.EdgeHeight / 2;
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
},
|
||||
return defaultVlue;
|
||||
},
|
||||
|
||||
/** 根据elem计算y值*/
|
||||
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
||||
var defaultVlue = 0;
|
||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||
if (station) {
|
||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||
if (isSpecial) {
|
||||
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode);
|
||||
}
|
||||
}
|
||||
/** 根据elem计算y值*/
|
||||
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
||||
var defaultVlue = 0;
|
||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||
if (station) {
|
||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||
if (isSpecial) {
|
||||
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
}
|
||||
return defaultVlue;
|
||||
}
|
||||
};
|
||||
|
@ -47,26 +47,6 @@ function handle(state, data) {
|
||||
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
||||
state.userPermit = msg;
|
||||
break;
|
||||
case 'JointTraining_User_RoomKickOut': // 综合演练室-用户被踢出房间消息
|
||||
state.userRoomKickOut = msg; // 没有给被踢用户发送
|
||||
handleMessageInfo(state, 'userRoomKickOut', msg);
|
||||
break;
|
||||
case 'JointTraining_User_InRoom': // 综合演练室-用户从外部进入房间消息
|
||||
state.userInRoom = msg;
|
||||
handleMessageInfo(state, 'userInRoom', msg);
|
||||
break;
|
||||
case 'JointTraining_User_OutRoom': // 综合演练室-用户退出房间消息
|
||||
state.userOutRoom = msg;
|
||||
handleMessageInfo(state, 'userOutRoom', msg);
|
||||
break;
|
||||
case 'JointTraining_User_InSimulation': // 综合演练室-用户进入仿真消息
|
||||
state.userInSimulation = msg;
|
||||
handleMessageInfoSimulation(state, 'userInSimulation', msg);
|
||||
break;
|
||||
case 'JointTraining_User_BackRoom': // 综合演练室-用户从仿真返回房间消息
|
||||
state.userBackRoom = msg;
|
||||
handleMessageInfoSimulation(state, 'userBackRoom', msg);
|
||||
break;
|
||||
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
|
||||
state.roomInvite = msg;
|
||||
break;
|
||||
@ -130,7 +110,7 @@ function handleRecordList(state, data) {
|
||||
inRoom: true,
|
||||
date: +new Date(`${myDate1} ${data.chatTime}`)
|
||||
};
|
||||
state.chatContentList = param;
|
||||
state.chatContent = param;
|
||||
}
|
||||
// 仿真内部聊天
|
||||
function handleSimulationInfo(state, data) {
|
||||
@ -191,62 +171,11 @@ function handleSimulationInfo(state, data) {
|
||||
}
|
||||
state.simulationText = param;
|
||||
}
|
||||
|
||||
function handleUserinfo(state, data) {
|
||||
if (data.length) { // 分配角色信息
|
||||
state.roleInfo = data;
|
||||
}
|
||||
}
|
||||
function handleMessageInfo(state, type, data) {
|
||||
const message = {
|
||||
join: true,
|
||||
id: data.id,
|
||||
userName: data.nickName,
|
||||
userRole: data.userRole,
|
||||
name: data.name,
|
||||
roomTip: '',
|
||||
chatInfo: true,
|
||||
inSimulation: data.inSimulation,
|
||||
inRoom: data.inRoom,
|
||||
session: 'session',
|
||||
type: type,
|
||||
oneself: data.id === store.state.user.id
|
||||
};
|
||||
switch (type) {
|
||||
case 'userInRoom':
|
||||
message.roomTip = `${data.nickName}进入房间`;
|
||||
break;
|
||||
case 'userRoomKickOut':
|
||||
message.roomTip = `${data.nickName}被踢出房间`;
|
||||
break;
|
||||
case 'userOutRoom':
|
||||
message.roomTip = `${data.nickName}退出房间`;
|
||||
break;
|
||||
}
|
||||
state.chatContentList = message;
|
||||
}
|
||||
function handleMessageInfoSimulation(state, type, data) {
|
||||
const message = {
|
||||
join: true,
|
||||
id: data.id,
|
||||
userName: data.nickName,
|
||||
userRole: data.userRole,
|
||||
name: data.name,
|
||||
simulationTip: '',
|
||||
chatInfo: true,
|
||||
inSimulation: data.inSimulation,
|
||||
inRoom: data.inRoom,
|
||||
session: 'session'
|
||||
};
|
||||
switch (type) {
|
||||
case 'userInSimulation':
|
||||
message.simulationTip = `${data.nickName}进入仿真`;
|
||||
break;
|
||||
case 'userBackRoom':
|
||||
message.simulationTip = `${data.nickName}退出仿真`;
|
||||
break;
|
||||
}
|
||||
state.chatContentSimuList = message;
|
||||
state.roleList = (data instanceof Array) ? data : [data];
|
||||
}
|
||||
|
||||
function handlePushMsgQueue(state, msg) {
|
||||
if (msg instanceof Array) {
|
||||
state.msgQueue.concat(msg);
|
||||
@ -265,8 +194,8 @@ const socket = {
|
||||
state: {
|
||||
payOrder: {}, // 支付消息
|
||||
jointRoomInfo: {}, // 受邀请房间信息
|
||||
chatContentList: {}, // 聊天室聊天内容
|
||||
roleInfo: [], // 设置角色信息
|
||||
chatContent: {}, // 聊天室聊天内容
|
||||
roleList: [], // 设置角色信息
|
||||
jointRoomPrepare: false, // 演练房间准备状态
|
||||
equipmentStatus: [], // 仿真-设备状态消息
|
||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||
@ -274,6 +203,7 @@ const socket = {
|
||||
simulationStart: '', // 仿真-开始消息
|
||||
simulationReset: '', // 仿真-异常消息
|
||||
simulationText: {}, // 仿真-用户交互消息(聊天/命令)
|
||||
|
||||
message: {}, // 仿真聊天
|
||||
msgQueue: [], // 命令请求列表
|
||||
msgHead: null, // 消息头
|
||||
@ -285,7 +215,6 @@ const socket = {
|
||||
userInSimulation: {}, // 用户进入仿真消息
|
||||
userBackRoom: {}, // 用户从仿真返回房间消息
|
||||
roomInvite: {}, // 用户扫码信息
|
||||
chatContentSimuList: {}, // 进入仿真,离开仿真信息
|
||||
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
@ -300,8 +229,8 @@ const socket = {
|
||||
state.jointRoomInfo = jointRoomInfo;
|
||||
},
|
||||
|
||||
setChatContentList: (state, chatContentList) => {
|
||||
state.chatContentList = chatContentList;
|
||||
setChatContent: (state, chatContent) => {
|
||||
state.chatContent = chatContent;
|
||||
},
|
||||
|
||||
setEquipmentStatus: (state, equipmentStatus) => {
|
||||
@ -351,8 +280,8 @@ const socket = {
|
||||
handle(state, res);
|
||||
},
|
||||
|
||||
setChatContentList: ({ commit }, chatContentList) => {
|
||||
commit('setChatContentList', chatContentList);
|
||||
setChatContent: ({ commit }, chatContent) => {
|
||||
commit('setChatContent', chatContent);
|
||||
},
|
||||
|
||||
setJointRoomInfo: ({ commit }) => {
|
||||
|
@ -3,11 +3,11 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
14
src/utils/mapList.js
Normal file
14
src/utils/mapList.js
Normal file
@ -0,0 +1,14 @@
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
||||
import { ProjectCode } from '@/scripts/ConstDic';
|
||||
|
||||
export async function getMapListByProject() {
|
||||
const project = getSessionStorage('project');
|
||||
let mapList = [];
|
||||
if (project.endsWith('xty')) {
|
||||
mapList = await getMapListByProjectCode(ProjectCode[project]);
|
||||
} else {
|
||||
mapList = await listPublishMap();
|
||||
}
|
||||
return mapList;
|
||||
}
|
@ -7,6 +7,7 @@ export const displayTopic = '/user/queue/simulation'; // 其他仿真topic
|
||||
export const screenTopic = '/user/queue/simulation/bigScreen'; // 大屏仿真
|
||||
export const planTopic = '/user/queue/simulation/plan'; // 测试运行仿真
|
||||
export const commonTopic = '/topic/message'; // 公共topic(不区分用户)
|
||||
export const designDisplayTopic = '/user/queue/simulation/design'; // 设计平台仿真订阅路径
|
||||
|
||||
// 建立连接并订阅地址
|
||||
export function creatSubscribe(topic, header) {
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
import {adminPublishLesson, rejectedLessonRelease, reviewLessonList} from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import LessonDetail from './detail';
|
||||
|
||||
export default {
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listPublishMap().then(response=>{
|
||||
getPublishMapListOnline().then(response=>{
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
this.queryForm.queryObject.mapId.config.data = this.mapList;
|
||||
});
|
||||
|
@ -8,7 +8,7 @@
|
||||
<script>
|
||||
import RunPlanOperate from './operate';
|
||||
import { reviewRunPlanList, publishRunPlan, rejectRunPlan, previewRunPlan } from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
@ -117,7 +117,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
this.queryForm.queryObject.mapId.config.data = this.mapList;
|
||||
} catch (error) {
|
||||
|
@ -10,7 +10,7 @@ import { UrlConfig } from '@/router/index';
|
||||
import { scriptDraftRecordNotify } from '@/api/simulation';
|
||||
import ScriptOperate from './operate';
|
||||
import { reviewScriptList, publishScript, rejectScript } from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
export default {
|
||||
name: 'ScriptApproval',
|
||||
components: {
|
||||
@ -117,7 +117,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
this.allMapList = res.data;
|
||||
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
this.queryForm.queryObject.mapId.config.data = this.mapList;
|
||||
|
@ -100,8 +100,7 @@ export default {
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
setSessionStorage('designType', 'runPlanDesign');
|
||||
// ?skinCode=${obj.skinCode}
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}` });
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
case 'map': {
|
||||
@ -124,7 +123,6 @@ export default {
|
||||
} else {
|
||||
res = await listPublishMap({cityCode: filterSelect});
|
||||
}
|
||||
|
||||
res.data && res.data.forEach(elem=>{
|
||||
// elem.children.find(n => { return n.name.includes("行调")})
|
||||
elem.children = [
|
||||
@ -152,7 +150,7 @@ export default {
|
||||
name: this.$t('designPlatform.runPlanDesign'),
|
||||
type: 'runPlanDesign',
|
||||
mapId: elem.id,
|
||||
skinCode: elem.skinCode,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
|
@ -25,7 +25,7 @@
|
||||
ref="menu"
|
||||
:point="point"
|
||||
:edit-model="editModel"
|
||||
:skin-code="skinCode"
|
||||
:line-code="lineCode"
|
||||
@refresh="loadInitData"
|
||||
@jlmap3d="jlmap3d"
|
||||
/>
|
||||
@ -66,7 +66,7 @@ export default {
|
||||
y: 0
|
||||
},
|
||||
editModel: {},
|
||||
skinCode: ''
|
||||
lineCode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -109,7 +109,7 @@ export default {
|
||||
type: 'mapDesign',
|
||||
mapId: elem.id,
|
||||
mapName: elem.name,
|
||||
skinCode: elem.skinCode
|
||||
lineCode: elem.lineCode
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
@ -117,7 +117,7 @@ export default {
|
||||
type: 'runPlanDesign',
|
||||
mapId: elem.id,
|
||||
mapName: elem.name,
|
||||
skinCode: elem.skinCode
|
||||
lineCode: elem.lineCode
|
||||
}
|
||||
];
|
||||
});
|
||||
@ -139,8 +139,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
// ?skinCode=${obj.skinCode}
|
||||
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}` });
|
||||
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -156,7 +155,7 @@ export default {
|
||||
y: e.clientY
|
||||
};
|
||||
this.editModel = obj;
|
||||
this.editModel.skinCode = obj.skinCode;
|
||||
this.editModel.lineCode = obj.lineCode;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
|
@ -4,10 +4,10 @@
|
||||
<el-tabs v-model="activeTab" type="card">
|
||||
<el-tab-pane :label="$t('map.normalCreate')" name="first">
|
||||
<el-form ref="newForm" label-position="right" :model="newModel" label-width="140px" size="mini" :rules="newRules" @submit.native.prevent>
|
||||
<el-form-item :label="$t('map.skinName')" prop="skinCode">
|
||||
<el-select v-model="newModel.skinCode" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-form-item :label="$t('map.lineCode')" prop="lineCode">
|
||||
<el-select v-model="newModel.lineCode" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in skinCodeList"
|
||||
v-for="item in lineCodeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
@ -47,16 +47,16 @@
|
||||
|
||||
<script>
|
||||
import { newMap, newUsePublishMap } from '@/api/jmap/mapdraft';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
// import XLSX from 'xlsx';
|
||||
// import { translate, translateSheetTitle } from '@/scripts/translate';
|
||||
// import { sheet_to_json } from '@/utils/Export2Excel';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
import { getMapListByProject } from '@/utils/mapList';
|
||||
|
||||
export default {
|
||||
name: 'MapCreate',
|
||||
props: {
|
||||
skinCode: {
|
||||
lineCode: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
@ -72,12 +72,12 @@ export default {
|
||||
loadingUpload: false,
|
||||
resultJSON: {},
|
||||
activeTab: 'first',
|
||||
skinCodeList: [],
|
||||
lineCodeList: [],
|
||||
publishMapList: [],
|
||||
newModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
skinCode: ''
|
||||
lineCode: ''
|
||||
},
|
||||
pullModel: {
|
||||
id: '',
|
||||
@ -87,7 +87,7 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
],
|
||||
skinCode: [
|
||||
lineCode: [
|
||||
{ required: true, message: this.$t('rules.pleaseChooseSkinCode'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
@ -103,8 +103,8 @@ export default {
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
skinCode(val) {
|
||||
this.newModel.skinCode = val;
|
||||
lineCode(val) {
|
||||
this.newModel.lineCode = val;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -125,14 +125,14 @@ export default {
|
||||
this.close();
|
||||
},
|
||||
initLoadData() {
|
||||
this.skinCodeList = [];
|
||||
this.lineCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
this.lineCodeList = response.data;
|
||||
});
|
||||
this.$Dictionary.cityType().then(list => {
|
||||
this.cityList = list;
|
||||
});
|
||||
listPublishMap().then(response => {
|
||||
getMapListByProject().then(response => {
|
||||
this.publishMapList = response.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||
|
@ -3,10 +3,10 @@
|
||||
<div>
|
||||
<template v-if="basicInfo">
|
||||
<el-form ref="edit" label-position="right" :model="editModel" :rules="editRules" label-width="120px" size="mini" @submit.native.prevent>
|
||||
<el-form-item :label="$t('map.skinName')" prop="skinCode">
|
||||
<el-select v-model="editModel.skinCode" :placeholder="$t('map.pleaseSelect')" size="mini" disabled>
|
||||
<el-form-item :label="$t('map.lineCode')" prop="lineCode">
|
||||
<el-select v-model="editModel.lineCode" :placeholder="$t('map.pleaseSelect')" size="mini" disabled>
|
||||
<el-option
|
||||
v-for="item in skinCodeList"
|
||||
v-for="item in lineCodeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
skinCode: {
|
||||
lineCode: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
@ -68,12 +68,12 @@ export default {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
lineCodeList: [],
|
||||
cityList: [],
|
||||
editModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
skinCode: '01',
|
||||
lineCode: '01',
|
||||
cityCode: ''
|
||||
},
|
||||
updtModel: {
|
||||
@ -93,7 +93,7 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
],
|
||||
skinCode: [
|
||||
lineCode: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectAssociatedSkin'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
@ -131,7 +131,7 @@ export default {
|
||||
show(type) {
|
||||
const dataZoom = this.$store.state.map.dataZoom;
|
||||
if (type == 'editCode') {
|
||||
this.editModel.skinCode = this.editModel.skinCode ? this.editModel.skinCode : '';
|
||||
this.editModel.lineCode = this.editModel.lineCode ? this.editModel.lineCode : '';
|
||||
this.editModel.name = this.editModel.name ? this.editModel.name : '';
|
||||
} else if (type == 'editPoint') {
|
||||
if (dataZoom && dataZoom.offsetX) {
|
||||
@ -179,7 +179,7 @@ export default {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.updtModel.code = this.skinCode;
|
||||
this.updtModel.code = this.lineCode;
|
||||
const map = this.$store.state.map.map;
|
||||
this.$refs['updt'].validate((valid) => {
|
||||
if (valid) {
|
||||
@ -219,9 +219,9 @@ export default {
|
||||
this.$messageBox(this.$t('map.failedLoadCityList'));
|
||||
});
|
||||
|
||||
this.skinCodeList = [];
|
||||
this.lineCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
this.lineCodeList = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<map-edit ref="edit" :basic-info="true" :map="editModel" :skin-code="skinCode" @refresh="refresh" />
|
||||
<map-edit ref="edit" :basic-info="true" :map="editModel" :line-code="lineCode" @refresh="refresh" />
|
||||
<!-- <map-edit ref="axisEdit" :basic-info="false" :map="editModel" :skin-code="skinCode" @refresh="refresh" /> -->
|
||||
<map-save-as ref="saveAs" :map="editModel" @refresh="refresh" />
|
||||
<map-publish ref="publish" :map="editModel" />
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
skinCode: {
|
||||
lineCode: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
|
@ -251,7 +251,14 @@ export default {
|
||||
},
|
||||
// 右键点击事件
|
||||
onContextMenu(em) {
|
||||
this.$emit('onMenu', em);
|
||||
const path = window.location.href;
|
||||
let mouseWheelFlag = false;
|
||||
if (path.includes('design/userlist/map/draw')) {
|
||||
mouseWheelFlag = true;
|
||||
}
|
||||
if (!mouseWheelFlag) { // 地图绘制无右键操作
|
||||
this.$emit('onMenu', em);
|
||||
}
|
||||
},
|
||||
// 设置地图加载状态
|
||||
mapViewLoaded(loading) {
|
||||
|
@ -34,383 +34,383 @@ import { getJointTrainRoomUserList, getUserRoles } from '@/api/chat';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'ChartView',
|
||||
components: {
|
||||
DrapLeft,
|
||||
OperateMenu
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
stationList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 180,
|
||||
userId: '',
|
||||
code: '',
|
||||
label: '',
|
||||
selected: {},
|
||||
message: {},
|
||||
data: {}, // 数据内容
|
||||
userRole: '', // 个人权限
|
||||
userList: [], // 观众列表
|
||||
driverList: [], // 司机列表
|
||||
treeData: [ // 角色列表 顺序定死
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.admin'),
|
||||
nodeId: 'admin01',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.teacher'),
|
||||
nodeId: 'admin02',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.dispatcher'),
|
||||
nodeId: 'admin03',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.stationAttendant'),
|
||||
nodeId: 'admin04',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.driver'),
|
||||
nodeId: 'admin05',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.universalAccount'),
|
||||
nodeId: 'admin06',
|
||||
type: 'select',
|
||||
show: false
|
||||
}
|
||||
],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: this.formatName
|
||||
},
|
||||
driverMapDict: {},
|
||||
keyIdList: [],
|
||||
messageList: [],
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'stationList': async function (val) { // 执行一次 以后不会有变化
|
||||
if (val) {
|
||||
await this.getUserList();
|
||||
this.initMenu(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.roleInfo': function (val) { // 仿真聊天
|
||||
val.forEach(item => {
|
||||
this.treeData[4].children.forEach(elem => {
|
||||
if (elem.driver && item.userRole == 'Driver' && elem.driver.id == item.id) {
|
||||
this.selected = elem;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
'$store.state.training.simulationGroupCount': async function () {
|
||||
await this.loadRunData();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
EventBus.$on('trainView', this.updateTrainList);
|
||||
},
|
||||
beforeDestroy() {
|
||||
EventBus.$off('trainView');
|
||||
},
|
||||
methods: {
|
||||
async loadRunData() {
|
||||
await this.getUserList();
|
||||
name: 'ChartView',
|
||||
components: {
|
||||
DrapLeft,
|
||||
OperateMenu
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
stationList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 180,
|
||||
userId: '',
|
||||
code: '',
|
||||
label: '',
|
||||
selected: {},
|
||||
message: {},
|
||||
data: {}, // 数据内容
|
||||
userRole: '', // 个人权限
|
||||
userList: [], // 观众列表
|
||||
driverList: [], // 司机列表
|
||||
treeData: [ // 角色列表 顺序定死
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.admin'),
|
||||
nodeId: 'admin01',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.teacher'),
|
||||
nodeId: 'admin02',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.dispatcher'),
|
||||
nodeId: 'admin03',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.stationAttendant'),
|
||||
nodeId: 'admin04',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.driver'),
|
||||
nodeId: 'admin05',
|
||||
type: 'select',
|
||||
show: false
|
||||
},
|
||||
{
|
||||
children: [],
|
||||
name: this.$t('joinTraining.universalAccount'),
|
||||
nodeId: 'admin06',
|
||||
type: 'select',
|
||||
show: false
|
||||
}
|
||||
],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: this.formatName
|
||||
},
|
||||
driverMapDict: {},
|
||||
keyIdList: [],
|
||||
messageList: [],
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'stationList': async function (val) { // 执行一次 以后不会有变化
|
||||
if (val) {
|
||||
await this.getUserList();
|
||||
this.initMenu(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.roleList': function (val) { // 仿真聊天
|
||||
val.forEach(item => {
|
||||
this.treeData[4].children.forEach(elem => {
|
||||
if (elem.driver && item.userRole == 'Driver' && elem.driver.id == item.id) {
|
||||
this.selected = elem;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
'$store.state.training.simulationGroupCount': async function () {
|
||||
await this.loadRunData();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
EventBus.$on('trainView', this.updateTrainList);
|
||||
},
|
||||
beforeDestroy() {
|
||||
EventBus.$off('trainView');
|
||||
},
|
||||
methods: {
|
||||
async loadRunData() {
|
||||
await this.getUserList();
|
||||
|
||||
EventBus.$on('trainView', this.updateTrainList);
|
||||
EventBus.$on('trainView', this.updateTrainList);
|
||||
|
||||
this.getUserRole();
|
||||
},
|
||||
formatName(data, node) {
|
||||
let name = data.name ? data.name : data.groupNumber;
|
||||
if (data.driver) {
|
||||
name = `${name}(${data.driver.nickName})`;
|
||||
}
|
||||
this.getUserRole();
|
||||
},
|
||||
formatName(data, node) {
|
||||
let name = data.name ? data.name : data.groupNumber;
|
||||
if (data.driver) {
|
||||
name = `${name}(${data.driver.nickName})`;
|
||||
}
|
||||
|
||||
return name;
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
// 获取设备集中站
|
||||
initMenu(list) {
|
||||
this.treeData[3].children = [];
|
||||
list.forEach(station => {
|
||||
if (station.centralized) {
|
||||
const param = {
|
||||
name: station.name,
|
||||
code: station.code,
|
||||
id: '',
|
||||
nodeId: station.code,
|
||||
children: null,
|
||||
show: false,
|
||||
index: 3
|
||||
};
|
||||
this.treeData[3].children.push(param);
|
||||
}
|
||||
});
|
||||
return name;
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
// 获取设备集中站
|
||||
initMenu(list) {
|
||||
this.treeData[3].children = [];
|
||||
list.forEach(station => {
|
||||
if (station.centralized) {
|
||||
const param = {
|
||||
name: station.name,
|
||||
code: station.code,
|
||||
id: '',
|
||||
nodeId: station.code,
|
||||
children: null,
|
||||
show: false,
|
||||
index: 3
|
||||
};
|
||||
this.treeData[3].children.push(param);
|
||||
}
|
||||
});
|
||||
|
||||
this.userList.forEach(item => {
|
||||
if (item.userRole == 'Attendant') {
|
||||
this.treeData[3].children.forEach(nor => {
|
||||
if (nor.code == item.stationCode) {
|
||||
nor.name = `${nor.name}【${item.nickName}】`;
|
||||
nor.id = item.id;
|
||||
nor.nodeId = item.id;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取人成员列表
|
||||
async getUserList() {
|
||||
const rest = await getJointTrainRoomUserList(this.group);
|
||||
this.userList = rest.data;
|
||||
this.treeData[0].children = [];
|
||||
this.treeData[1].children = [];
|
||||
this.treeData[2].children = [];
|
||||
this.treeData[5].children = [];
|
||||
this.driverMapDict = {};
|
||||
this.driverList = [];
|
||||
this.userList.forEach(item => {
|
||||
if (item.userRole == 'Attendant') {
|
||||
this.treeData[3].children.forEach(nor => {
|
||||
if (nor.code == item.stationCode) {
|
||||
nor.name = `${nor.name}【${item.nickName}】`;
|
||||
nor.id = item.id;
|
||||
nor.nodeId = item.id;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取人成员列表
|
||||
async getUserList() {
|
||||
const rest = await getJointTrainRoomUserList(this.group);
|
||||
this.userList = rest.data;
|
||||
this.treeData[0].children = [];
|
||||
this.treeData[1].children = [];
|
||||
this.treeData[2].children = [];
|
||||
this.treeData[5].children = [];
|
||||
this.driverMapDict = {};
|
||||
this.driverList = [];
|
||||
|
||||
this.userList.forEach(item => {
|
||||
const param = {
|
||||
name: item.nickName,
|
||||
id: item.id,
|
||||
nodeId: item.id,
|
||||
children: null,
|
||||
show: false,
|
||||
index: ''
|
||||
};
|
||||
this.userList.forEach(item => {
|
||||
const param = {
|
||||
name: item.nickName,
|
||||
id: item.id,
|
||||
nodeId: item.id,
|
||||
children: null,
|
||||
show: false,
|
||||
index: ''
|
||||
};
|
||||
|
||||
if (item.userRole == 'Admin') {
|
||||
param.index = 0;
|
||||
this.treeData[0].children.push(param);
|
||||
} else if (item.userRole == 'Instructor') {
|
||||
param.index = 1;
|
||||
this.treeData[1].children.push(param);
|
||||
} else if (item.userRole == 'Dispatcher') {
|
||||
param.index = 2;
|
||||
this.treeData[2].children.push(param);
|
||||
} else if (item.userRole == 'Driver') {
|
||||
param.index = 4;
|
||||
this.driverList.push(param);
|
||||
} else if (item.userRole == 'Repair') {
|
||||
param.index = 5;
|
||||
this.treeData[5].children.push(param);
|
||||
}
|
||||
});
|
||||
if (item.userRole == 'Admin') {
|
||||
param.index = 0;
|
||||
this.treeData[0].children.push(param);
|
||||
} else if (item.userRole == 'Instructor') {
|
||||
param.index = 1;
|
||||
this.treeData[1].children.push(param);
|
||||
} else if (item.userRole == 'Dispatcher') {
|
||||
param.index = 2;
|
||||
this.treeData[2].children.push(param);
|
||||
} else if (item.userRole == 'Driver') {
|
||||
param.index = 4;
|
||||
this.driverList.push(param);
|
||||
} else if (item.userRole == 'Repair') {
|
||||
param.index = 5;
|
||||
this.treeData[5].children.push(param);
|
||||
}
|
||||
});
|
||||
|
||||
this.updateDriverInfo(this.userList);
|
||||
},
|
||||
// 点击左侧人员并选择
|
||||
async chatClick(obj) {
|
||||
if (obj.type && obj.type == 'select') {
|
||||
obj.show = false;
|
||||
this.$emit('showChatNone');
|
||||
} else {
|
||||
if (obj.show) {
|
||||
let data = {};
|
||||
this.messageList.forEach((item, index) => {
|
||||
if (item.member.id == obj.id) {
|
||||
data = item;
|
||||
this.messageList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
this.updateDriverInfo(this.userList);
|
||||
},
|
||||
// 点击左侧人员并选择
|
||||
async chatClick(obj) {
|
||||
if (obj.type && obj.type == 'select') {
|
||||
obj.show = false;
|
||||
this.$emit('showChatNone');
|
||||
} else {
|
||||
if (obj.show) {
|
||||
let data = {};
|
||||
this.messageList.forEach((item, index) => {
|
||||
if (item.member.id == obj.id) {
|
||||
data = item;
|
||||
this.messageList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
this.$emit('showChatSpeak', data);
|
||||
this.treeData[obj.index].show = false;
|
||||
obj.show = false;
|
||||
} else {
|
||||
this.updateConversationId(obj);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取个人权限
|
||||
async getUserRole() {
|
||||
const res = await getUserRoles(this.group);
|
||||
this.userRole = res.data.userRole;
|
||||
if (this.userRole != 'Audience' && this.userRole != '') {
|
||||
await this.getUserList();
|
||||
this.initMenu(this.stationList);
|
||||
}
|
||||
},
|
||||
// 更新聊天的回话Id
|
||||
updateConversationId(obj) {
|
||||
let id = obj.id;
|
||||
const code = obj.code || obj._code;
|
||||
if (obj.driver) {
|
||||
id = obj.driver.id;
|
||||
}
|
||||
this.$emit('showChatSpeak', data);
|
||||
this.treeData[obj.index].show = false;
|
||||
obj.show = false;
|
||||
} else {
|
||||
this.updateConversationId(obj);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取个人权限
|
||||
async getUserRole() {
|
||||
const res = await getUserRoles(this.group);
|
||||
this.userRole = res.data.userRole;
|
||||
if (this.userRole != 'Audience' && this.userRole != '') {
|
||||
await this.getUserList();
|
||||
this.initMenu(this.stationList);
|
||||
}
|
||||
},
|
||||
// 更新聊天的回话Id
|
||||
updateConversationId(obj) {
|
||||
let id = obj.id;
|
||||
const code = obj.code || obj._code;
|
||||
if (obj.driver) {
|
||||
id = obj.driver.id;
|
||||
}
|
||||
|
||||
if (code || id) {
|
||||
this.$emit('showChat', { code: code, id: id });
|
||||
}
|
||||
},
|
||||
// 更新列车列表
|
||||
updateTrainList() {
|
||||
const list = this.$store.getters['training/viewTrainList']();
|
||||
if (this.treeData[4].children.length != list.length) {
|
||||
this.treeData[4].children = [];
|
||||
if (list && list.length) {
|
||||
list.sort((a, b) => {
|
||||
return Number(a.groupNumber) - Number(b.groupNumber);
|
||||
});
|
||||
if (code || id) {
|
||||
this.$emit('showChat', { code: code, id: id });
|
||||
}
|
||||
},
|
||||
// 更新列车列表
|
||||
updateTrainList() {
|
||||
const list = this.$store.getters['training/viewTrainList']();
|
||||
if (this.treeData[4].children.length != list.length) {
|
||||
this.treeData[4].children = [];
|
||||
if (list && list.length) {
|
||||
list.sort((a, b) => {
|
||||
return Number(a.groupNumber) - Number(b.groupNumber);
|
||||
});
|
||||
|
||||
list.forEach(item => {
|
||||
item.driver = this.driverMapDict[item._code];
|
||||
item.nodeId = item._code;
|
||||
item.show = false;
|
||||
item.index = 4;
|
||||
this.treeData[4].children.push(item);
|
||||
});
|
||||
list.forEach(item => {
|
||||
item.driver = this.driverMapDict[item._code];
|
||||
item.nodeId = item._code;
|
||||
item.show = false;
|
||||
item.index = 4;
|
||||
this.treeData[4].children.push(item);
|
||||
});
|
||||
|
||||
this.$refs.personTree.updateKeyChildren('admin05', this.treeData[4].children.slice());
|
||||
}
|
||||
}
|
||||
},
|
||||
// 更新司机信息
|
||||
updateDriverInfo(list) {
|
||||
this.updateConversationId(this.selected);
|
||||
list.forEach(item => {
|
||||
if (item.userRole == 'Driver') {
|
||||
if (item.trainCode) {
|
||||
// 添加司机
|
||||
this.driverMapDict[item.trainCode] = item;
|
||||
} else {
|
||||
// 取消司机
|
||||
Object.keys(this.driverMapDict).forEach(key => {
|
||||
const oDriver = this.driverMapDict[key];
|
||||
const nDriver = this.selected.driver;
|
||||
if (oDriver && nDriver && oDriver.id == nDriver.id) {
|
||||
delete this.driverMapDict[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$refs.personTree.updateKeyChildren('admin05', this.treeData[4].children.slice());
|
||||
}
|
||||
}
|
||||
},
|
||||
// 更新司机信息
|
||||
updateDriverInfo(list) {
|
||||
this.updateConversationId(this.selected);
|
||||
list.forEach(item => {
|
||||
if (item.userRole == 'Driver') {
|
||||
if (item.trainCode) {
|
||||
// 添加司机
|
||||
this.driverMapDict[item.trainCode] = item;
|
||||
} else {
|
||||
// 取消司机
|
||||
Object.keys(this.driverMapDict).forEach(key => {
|
||||
const oDriver = this.driverMapDict[key];
|
||||
const nDriver = this.selected.driver;
|
||||
if (oDriver && nDriver && oDriver.id == nDriver.id) {
|
||||
delete this.driverMapDict[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.treeData[4].children = [];
|
||||
this.updateTrainList();
|
||||
},
|
||||
// 右键显示设置司机菜单
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (this.$store.state.map.roles == 'Admin') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.treeData[4].children = [];
|
||||
this.updateTrainList();
|
||||
},
|
||||
// 右键显示设置司机菜单
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (this.$store.state.map.roles == 'Admin') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
|
||||
if (obj._type == ModelType.Train) {
|
||||
this.selected = obj;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: DeviceMenu.SetDriver });
|
||||
}
|
||||
}
|
||||
},
|
||||
select(id) {
|
||||
this.keyIdList = [];
|
||||
this.$refs.personTree.setCurrentKey(null);
|
||||
if (id) {
|
||||
this.keyIdList = [id];
|
||||
this.$refs.personTree.setCurrentKey(id);
|
||||
const node = this.$refs.personTree.getCurrentNode();
|
||||
if (node) {
|
||||
node.show = false;
|
||||
this.treeData[node.index].show = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
hintInfo(data) {
|
||||
switch (data.member.role) {
|
||||
case '01':
|
||||
this.treeData[0].show = true;
|
||||
this.treeData[0].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '02':
|
||||
this.treeData[1].show = true;
|
||||
this.treeData[1].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '03':
|
||||
this.treeData[2].show = true;
|
||||
this.treeData[2].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '04':
|
||||
this.treeData[3].show = true;
|
||||
this.treeData[3].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '05':
|
||||
this.treeData[4].show = true;
|
||||
break;
|
||||
case '06':
|
||||
this.treeData[4].show = true;
|
||||
this.treeData[4].children.forEach(nor => {
|
||||
if (nor.driver && nor.driver.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '07':
|
||||
this.treeData[5].show = true;
|
||||
this.treeData[5].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
this.messageList.push(data);
|
||||
}
|
||||
}
|
||||
if (obj._type == ModelType.Train) {
|
||||
this.selected = obj;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: DeviceMenu.SetDriver });
|
||||
}
|
||||
}
|
||||
},
|
||||
select(id) {
|
||||
this.keyIdList = [];
|
||||
this.$refs.personTree.setCurrentKey(null);
|
||||
if (id) {
|
||||
this.keyIdList = [id];
|
||||
this.$refs.personTree.setCurrentKey(id);
|
||||
const node = this.$refs.personTree.getCurrentNode();
|
||||
if (node) {
|
||||
node.show = false;
|
||||
this.treeData[node.index].show = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
hintInfo(data) {
|
||||
switch (data.member.role) {
|
||||
case '01':
|
||||
this.treeData[0].show = true;
|
||||
this.treeData[0].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '02':
|
||||
this.treeData[1].show = true;
|
||||
this.treeData[1].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '03':
|
||||
this.treeData[2].show = true;
|
||||
this.treeData[2].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '04':
|
||||
this.treeData[3].show = true;
|
||||
this.treeData[3].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '05':
|
||||
this.treeData[4].show = true;
|
||||
break;
|
||||
case '06':
|
||||
this.treeData[4].show = true;
|
||||
this.treeData[4].children.forEach(nor => {
|
||||
if (nor.driver && nor.driver.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '07':
|
||||
this.treeData[5].show = true;
|
||||
this.treeData[5].children.forEach(nor => {
|
||||
if (nor.id == data.member.id) {
|
||||
nor.show = true;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
this.messageList.push(data);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
@ -130,7 +130,7 @@ export default {
|
||||
this.handleRoomInfo(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.chatContentList': function (val) { // 综合演练被踢出房间
|
||||
'$store.state.socket.chatContent': function (val) { // 综合演练被踢出房间
|
||||
if (val.type === 'userRoomKickOut' && val.oneself) {
|
||||
this.$router.push({ path: `/` });
|
||||
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
|
||||
|
@ -25,288 +25,288 @@ import { timeFormat } from '@/utils/date';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuDemonJoint',
|
||||
components: {
|
||||
QrCode,
|
||||
SetTime
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
deviceCode: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
timeNow: 0,
|
||||
remainingTime: 0,
|
||||
recordStep: 'BGSetting',
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
chatShow: true,
|
||||
isShowAuto: false,
|
||||
offset: 10,
|
||||
userId: '',
|
||||
activeName: 'first',
|
||||
activeName2: 'second',
|
||||
stationList: [],
|
||||
stationLists: [],
|
||||
minimize: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSpeaking() {
|
||||
return this.userRole != 'Driver' && this.userRole != '';
|
||||
},
|
||||
isDriver() {
|
||||
return this.userRole == 'Driver';
|
||||
},
|
||||
isAdmin() {
|
||||
return this.userRole == 'Admin';
|
||||
},
|
||||
isBigScreen() {
|
||||
return this.userRole == 'BigScreen';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.config.menuBarLoadedCount': function (val) {
|
||||
this.setPosition();
|
||||
},
|
||||
'$store.state.map.map.stationList': function (val) { // 执行一次 以后不会有变化
|
||||
if (val && val.length) {
|
||||
this.stationList = val;
|
||||
this.stationLists = val;
|
||||
}
|
||||
},
|
||||
'$store.state.socket.roleInfo': function (val) {
|
||||
if (val && val.length) {
|
||||
this.addrolesList(val);
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
});
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationStart': async function (val) {
|
||||
if (val) {
|
||||
await this.loadSystemTime();
|
||||
this.$store.dispatch('training/simulationStart', { start: true });
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.userId = this.$store.state.user.id;
|
||||
await this.initLoadPage();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch('training/setGroup', '');
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
const resp = await runDiagramIsStart(this.group);
|
||||
if (resp && resp.data) {
|
||||
this.isDisable = true;
|
||||
this.$store.dispatch('training/simulationStart');
|
||||
} else {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/over');
|
||||
}
|
||||
name: 'MenuDemonJoint',
|
||||
components: {
|
||||
QrCode,
|
||||
SetTime
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
deviceCode: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
timeNow: 0,
|
||||
remainingTime: 0,
|
||||
recordStep: 'BGSetting',
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
chatShow: true,
|
||||
isShowAuto: false,
|
||||
offset: 10,
|
||||
userId: '',
|
||||
activeName: 'first',
|
||||
activeName2: 'second',
|
||||
stationList: [],
|
||||
stationLists: [],
|
||||
minimize: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSpeaking() {
|
||||
return this.userRole != 'Driver' && this.userRole != '';
|
||||
},
|
||||
isDriver() {
|
||||
return this.userRole == 'Driver';
|
||||
},
|
||||
isAdmin() {
|
||||
return this.userRole == 'Admin';
|
||||
},
|
||||
isBigScreen() {
|
||||
return this.userRole == 'BigScreen';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.config.menuBarLoadedCount': function (val) {
|
||||
this.setPosition();
|
||||
},
|
||||
'$store.state.map.map.stationList': function (val) { // 执行一次 以后不会有变化
|
||||
if (val && val.length) {
|
||||
this.stationList = val;
|
||||
this.stationLists = val;
|
||||
}
|
||||
},
|
||||
'$store.state.socket.roleList': function (val) {
|
||||
if (val && val.length) {
|
||||
this.addrolesList(val);
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
});
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationStart': async function (val) {
|
||||
if (val) {
|
||||
await this.loadSystemTime();
|
||||
this.$store.dispatch('training/simulationStart', { start: true });
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.userId = this.$store.state.user.id;
|
||||
await this.initLoadPage();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch('training/setGroup', '');
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
const resp = await runDiagramIsStart(this.group);
|
||||
if (resp && resp.data) {
|
||||
this.isDisable = true;
|
||||
this.$store.dispatch('training/simulationStart');
|
||||
} else {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/over');
|
||||
}
|
||||
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换角色tab
|
||||
clickRoles(active) {
|
||||
if (active == 'first') {
|
||||
this.chatShow = true;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chatView.select(); // 清空选中
|
||||
this.$refs.chat.clearPlay('', ''); // 清空自动播放 会话id
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换角色tab
|
||||
clickRoles(active) {
|
||||
if (active == 'first') {
|
||||
this.chatShow = true;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chatView.select(); // 清空选中
|
||||
this.$refs.chat.clearPlay('', ''); // 清空自动播放 会话id
|
||||
|
||||
} else {
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = true;
|
||||
this.$refs.chat.getChathistory('', ''); // 获取所有人列表
|
||||
}
|
||||
this.activeName = active;
|
||||
},
|
||||
loadSystemTime() {
|
||||
runDiagramGetTime(this.group).then(response => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(response.data)}`));
|
||||
});
|
||||
},
|
||||
handleMinimality(data) {
|
||||
if (data == 'min') {
|
||||
this.minimize = true;
|
||||
} else {
|
||||
this.minimize = false;
|
||||
}
|
||||
},
|
||||
handleChatShow(data) {
|
||||
if (!this.minimize) { // 最大化状态
|
||||
if (this.activeName == 'first') {
|
||||
this.$refs.chatView.select(data.id);
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chat.handleTextList(data.conversationId);
|
||||
} else {
|
||||
this.activeName = 'first';
|
||||
this.handleChatShow(data);
|
||||
}
|
||||
} else { // 最小化状态
|
||||
this.minimize = false;
|
||||
this.handleChatShow(data);
|
||||
}
|
||||
},
|
||||
// 切到未读消息并说话
|
||||
showChatSpeak(data) {
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chat.handleTextList(data.conversationId);
|
||||
},
|
||||
// 获取历史纪录list
|
||||
showChat(obj) {
|
||||
this.chatShow = false;
|
||||
this.$refs.chat.getChathistory(obj.code, obj.id);
|
||||
},
|
||||
handleChatList(data) {
|
||||
this.$refs.chatView.hintInfo(data);
|
||||
},
|
||||
// 设置不显示
|
||||
showChatNone() {
|
||||
this.chatShow = true;
|
||||
},
|
||||
messageInfo(message, type) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: message,
|
||||
type: type
|
||||
});
|
||||
},
|
||||
setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let offset = 10;
|
||||
const menuBar = document.getElementById('menuBar');
|
||||
const menuTool = document.getElementById('menuTool');
|
||||
} else {
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = true;
|
||||
this.$refs.chat.getChathistory('', ''); // 获取所有人列表
|
||||
}
|
||||
this.activeName = active;
|
||||
},
|
||||
loadSystemTime() {
|
||||
runDiagramGetTime(this.group).then(response => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(response.data)}`));
|
||||
});
|
||||
},
|
||||
handleMinimality(data) {
|
||||
if (data == 'min') {
|
||||
this.minimize = true;
|
||||
} else {
|
||||
this.minimize = false;
|
||||
}
|
||||
},
|
||||
handleChatShow(data) {
|
||||
if (!this.minimize) { // 最大化状态
|
||||
if (this.activeName == 'first') {
|
||||
this.$refs.chatView.select(data.id);
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chat.handleTextList(data.conversationId);
|
||||
} else {
|
||||
this.activeName = 'first';
|
||||
this.handleChatShow(data);
|
||||
}
|
||||
} else { // 最小化状态
|
||||
this.minimize = false;
|
||||
this.handleChatShow(data);
|
||||
}
|
||||
},
|
||||
// 切到未读消息并说话
|
||||
showChatSpeak(data) {
|
||||
this.chatShow = false;
|
||||
this.isShowAuto = false;
|
||||
this.$refs.chat.handleTextList(data.conversationId);
|
||||
},
|
||||
// 获取历史纪录list
|
||||
showChat(obj) {
|
||||
this.chatShow = false;
|
||||
this.$refs.chat.getChathistory(obj.code, obj.id);
|
||||
},
|
||||
handleChatList(data) {
|
||||
this.$refs.chatView.hintInfo(data);
|
||||
},
|
||||
// 设置不显示
|
||||
showChatNone() {
|
||||
this.chatShow = true;
|
||||
},
|
||||
messageInfo(message, type) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: message,
|
||||
type: type
|
||||
});
|
||||
},
|
||||
setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let offset = 10;
|
||||
const menuBar = document.getElementById('menuBar');
|
||||
const menuTool = document.getElementById('menuTool');
|
||||
|
||||
if (menuBar) {
|
||||
offset += (menuBar.offsetHeight || 0);
|
||||
}
|
||||
if (menuBar) {
|
||||
offset += (menuBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (menuTool) {
|
||||
offset += (menuTool.offsetHeight || 0);
|
||||
}
|
||||
if (menuTool) {
|
||||
offset += (menuTool.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (this.offset != offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置用户角色 Admin 管理员 Instructor 教员 Dispatcher 行调 Attendant 车站 Audience 观众 Driver 司机 Repair 通号
|
||||
addrolesList(list) {
|
||||
list.forEach(item => {
|
||||
if (this.userId == item.id) {
|
||||
switch (item.userRole) {
|
||||
case 'Instructor':
|
||||
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Dispatcher':
|
||||
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Attendant':
|
||||
if (!item['stationCode']) {
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Attendant');
|
||||
break;
|
||||
}
|
||||
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Driver':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Repair':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'IBP':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'BigScreen':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
default:
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (this.$refs.chatView) {
|
||||
this.$refs.chatView.getUserRole();
|
||||
}
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (this.activeName == 'second') {
|
||||
this.$refs.chat.getChathistory();
|
||||
}
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
this.isDisable = true;
|
||||
runDiagramStart(model, this.group).then(res => {
|
||||
this.$store.dispatch('training/simulationStart').then(() => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.$messageBox(this.$t('error.startSimulationFailed'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
this.isDisable = false;
|
||||
EventBus.$emit('trainView');
|
||||
runDiagramOver(this.group).catch(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(this.$t('error.endSimulationFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
putJointTrainingSimulationUser(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
|
||||
exitFullscreen();
|
||||
});
|
||||
});
|
||||
},
|
||||
jumpjlmap3d() {
|
||||
this.$emit('hidepanel');
|
||||
}
|
||||
}
|
||||
if (this.offset != offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置用户角色 Admin 管理员 Instructor 教员 Dispatcher 行调 Attendant 车站 Audience 观众 Driver 司机 Repair 通号
|
||||
addrolesList(list) {
|
||||
list.forEach(item => {
|
||||
if (this.userId == item.id) {
|
||||
switch (item.userRole) {
|
||||
case 'Instructor':
|
||||
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Dispatcher':
|
||||
this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Attendant':
|
||||
if (!item['stationCode']) {
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Attendant');
|
||||
break;
|
||||
}
|
||||
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Driver':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'Repair':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'IBP':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
case 'BigScreen':
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
default:
|
||||
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience');
|
||||
this.$emit('getUserRole');
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (this.$refs.chatView) {
|
||||
this.$refs.chatView.getUserRole();
|
||||
}
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (this.activeName == 'second') {
|
||||
this.$refs.chat.getChathistory();
|
||||
}
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
this.isDisable = true;
|
||||
runDiagramStart(model, this.group).then(res => {
|
||||
this.$store.dispatch('training/simulationStart').then(() => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.$messageBox(this.$t('error.startSimulationFailed'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
this.isDisable = false;
|
||||
EventBus.$emit('trainView');
|
||||
runDiagramOver(this.group).catch(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(this.$t('error.endSimulationFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
putJointTrainingSimulationUser(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
|
||||
exitFullscreen();
|
||||
});
|
||||
});
|
||||
},
|
||||
jumpjlmap3d() {
|
||||
this.$emit('hidepanel');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
import { getProductList } from '@/api/management/mapprd';
|
||||
import { pageQueryTraining } from '@/api/jmap/training';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import localStore from 'storejs';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
@ -168,7 +168,7 @@ export default {
|
||||
});
|
||||
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
<script>
|
||||
import { createLesson, updateLesson, getLessonDetail } from '@/api/jmap/lessondraft';
|
||||
import { getCommodityMapProduct } from '@/api/management/mapprd';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
@ -106,7 +106,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<script>
|
||||
import { addAutoGenerateTask } from '@/api/management/task';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'CreateTask',
|
||||
@ -55,7 +55,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
});
|
||||
this.taskStatusList = [];
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<script>
|
||||
import { getTaskList, postTask, postTaskCancel } from '@/api/management/task';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import CreateTask from './createTask';
|
||||
|
||||
export default {
|
||||
@ -117,7 +117,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
this.taskStatusList = [];
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<script>
|
||||
import { postTrainingRulesData, putTrainingRulesData, getPlaceholderList } from '@/api/management/operation';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'TrainingEdit',
|
||||
@ -111,7 +111,7 @@ export default {
|
||||
// this.$refs.dataform.resetForm();
|
||||
this.mapIdList = [];
|
||||
this.productTypesList = [{ value:'01', label:'现地'}, {value:'02', label:'行调'}];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<script>
|
||||
import { postOperateSaveAs } from '@/api/management/operation';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'AddBatch',
|
||||
@ -86,7 +86,7 @@ export default {
|
||||
init() {
|
||||
// 获取已发布地图列表
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
|
@ -21,7 +21,7 @@ import { pageQueryTraining } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import TrainingDraft from './draft';
|
||||
import localStore from 'storejs';
|
||||
@ -162,7 +162,7 @@ export default {
|
||||
async loadInitData() {
|
||||
this.mapIdList = [];
|
||||
this.queryForm.queryObject.prdId.config.data = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
getCommodityMapProduct(this.$route.query.mapId).then((response) => {
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-button size="small" :disabled="!recoverStepData.length" @click="recover">恢复</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" />
|
||||
</div>
|
||||
<div class="map-draft">
|
||||
<div v-show="viewDraft === 'draft'" class="box">
|
||||
@ -49,7 +49,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { saveMap, getMapDetail, verifyMap, postBuildMapImport } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
|
||||
import { ViewMode, TrainingMode } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import JlmapVisual from '@/views/jlmap/index';
|
||||
import MapOperate from './mapoperate/index';
|
||||
@ -204,16 +204,16 @@ export default {
|
||||
this.selected = device || null;
|
||||
this.selected && this.handleSelectControlPage(device);
|
||||
},
|
||||
onContextmenu(em) {
|
||||
this.point = {
|
||||
x: em.clientX,
|
||||
y: em.clientY
|
||||
};
|
||||
if (!em.deviceType) {
|
||||
var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
// onContextmenu(em) {
|
||||
// this.point = {
|
||||
// x: em.clientX,
|
||||
// y: em.clientY
|
||||
// };
|
||||
// if (!em.deviceType) {
|
||||
// var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
// this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
// }
|
||||
// },
|
||||
saveMapEvent() {
|
||||
if (this.$refs.jlmapVisual) {
|
||||
const map = this.$store.state.map.map;
|
||||
|
@ -38,15 +38,6 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.signal')" class="tab_pane_box" name="Signal">
|
||||
<signal-draft
|
||||
ref="Signal"
|
||||
:selected="selected"
|
||||
@updateMapModel="updateMapModel"
|
||||
@setCenter="setCenter"
|
||||
@signalSectionCode="selectEnabledTab"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.station')" class="tab_pane_box" name="Station">
|
||||
<station-draft
|
||||
ref="Station"
|
||||
@ -64,6 +55,15 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.signal')" class="tab_pane_box" name="Signal">
|
||||
<signal-draft
|
||||
ref="Signal"
|
||||
:selected="selected"
|
||||
@updateMapModel="updateMapModel"
|
||||
@setCenter="setCenter"
|
||||
@signalSectionCode="selectEnabledTab"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.platform')" class="tab_pane_box" name="StationStand">
|
||||
<station-stand-draft
|
||||
ref="StationStand"
|
||||
|
@ -72,6 +72,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.equipmentStation')" prop="stationCode">
|
||||
<el-select v-model="addModel.stationCode" filterable>
|
||||
<el-option
|
||||
v-for="item in stationList"
|
||||
:key="item.code"
|
||||
:label="item.name + item.code"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@ -151,7 +161,8 @@ export default {
|
||||
directionType: '01',
|
||||
directionShowType: '01',
|
||||
leftOrRight: '0',
|
||||
positionType: '01'
|
||||
positionType: '01',
|
||||
stationCode: ''
|
||||
},
|
||||
mergeRules: {
|
||||
sectionCode: [
|
||||
@ -168,6 +179,9 @@ export default {
|
||||
],
|
||||
positionType: [
|
||||
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.positionType'), trigger: 'change' }
|
||||
],
|
||||
stationCode: [
|
||||
{ required: true, message: this.$t('map.pleaseSelect') + '' + this.$t('map.equipmentStation'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -353,7 +367,8 @@ export default {
|
||||
potLampType: '01',
|
||||
lampPostType: '01',
|
||||
lampPositionType: '01',
|
||||
guideShow: false
|
||||
guideShow: false,
|
||||
stationCode: this.addModel.stationCode
|
||||
};
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.code === this.addModel.sectionCode) {
|
||||
|
@ -7,8 +7,9 @@
|
||||
<script>
|
||||
import MapCommon from './common/index';
|
||||
import { handleToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic, planTopic } from '@/utils/stomp';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic, planTopic, designDisplayTopic} from '@/utils/stomp';
|
||||
import { sendCommand } from '@/api/jmap/training';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'MapSystemDraft',
|
||||
@ -20,7 +21,8 @@ export default {
|
||||
topic: '/user/queue/training',
|
||||
stomp: null,
|
||||
currentMap: null,
|
||||
mode: ''
|
||||
mode: '',
|
||||
isDesignPlatform: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -60,6 +62,7 @@ export default {
|
||||
this.$store.dispatch('config/resetCanvasOffset');
|
||||
}, 100);
|
||||
});
|
||||
this.isDesignPlatform = getSessionStorage('project').startsWith('design');
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
@ -108,7 +111,7 @@ export default {
|
||||
} else if (this.mode === 'plan') {
|
||||
creatSubscribe(planTopic, header);
|
||||
} else {
|
||||
creatSubscribe(displayTopic, header);
|
||||
creatSubscribe(this.isDesignPlatform ? designDisplayTopic : displayTopic, header);
|
||||
}
|
||||
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
@ -119,7 +122,7 @@ export default {
|
||||
} else if (this.mode === 'plan') {
|
||||
clearSubscribe(planTopic);
|
||||
} else {
|
||||
clearSubscribe(displayTopic);
|
||||
clearSubscribe(this.isDesignPlatform ? designDisplayTopic : displayTopic);
|
||||
}
|
||||
},
|
||||
sendDeviceChangeEvent(data, header) {
|
||||
|
@ -77,7 +77,7 @@
|
||||
<script>
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { createLessonPermisson, getPermissionList, putPermissonDetail } from '@/api/management/author';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import ChoosePermission from './choosePermission';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { setTimeout } from 'timers';
|
||||
@ -143,7 +143,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
res.data.forEach(elem => {
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<script>
|
||||
import { getLessonPermissonPageList } from '@/api/management/author';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import Edit from './draft/edit';
|
||||
import Create from './create';
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
});
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
listPublishMap().then(res => {
|
||||
getPublishMapListOnline().then(res => {
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
import { getCommodityList } from '@/api/management/goods';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'AddGoods',
|
||||
@ -153,7 +153,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
|
@ -108,7 +108,7 @@
|
||||
|
||||
<script>
|
||||
import ChoosePermission from '../../author/draft/choosePermission';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { getPermissionGoods, postsPermissionGoods } from '@/api/management/goods';
|
||||
import { postFindPermission } from '@/api/management/order';
|
||||
|
||||
@ -237,7 +237,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
res.data.forEach(elem => {
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
|
@ -67,13 +67,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getCommodityMapProduct } from '@/api/management/mapprd';
|
||||
import { packagePermissionDistribute } from '@/api/management/distribute';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import EditRule from './editRule';
|
||||
import CanTransfer from './canDistribute';
|
||||
import { getMapListByProject } from '@/utils/mapList';
|
||||
|
||||
export default {
|
||||
name: 'PackRule',
|
||||
@ -160,7 +160,7 @@ export default {
|
||||
});
|
||||
|
||||
this.PublishMapList = [];
|
||||
listPublishMap().then(response => {
|
||||
getMapListByProject().then(response => {
|
||||
const list = response.data || [];
|
||||
this.PublishMapList = list.map(elem => {
|
||||
return { value: elem.id, label: elem.name };
|
||||
|
@ -78,9 +78,6 @@ export default {
|
||||
height() {
|
||||
return this.$store.state.app.height - 60 - 30;
|
||||
},
|
||||
// skinCode() {
|
||||
// return this.$route.query.skinCode || '02';
|
||||
// },
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
@ -92,7 +89,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
|
||||
},
|
||||
mounted() {
|
||||
this.getRunPlanList();
|
||||
|
@ -3,12 +3,12 @@
|
||||
<div class="nav" style="height:45px;">
|
||||
<template v-for="(item,i) in menus">
|
||||
<template v-if="noShowingChildren(item.children)">
|
||||
<li :key="i" class="nav-li" @click="hookClick(item)" v-if="isNotUser">
|
||||
<li v-if="isNotUser" :key="i" class="nav-li" @click="hookClick(item)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else >
|
||||
<li :key="i" class="nav-li" :class="{'menu_active' :i==classA}" @click.stop="popupMenuA(item, i)" v-if="isNotUser">
|
||||
<template v-else>
|
||||
<li v-if="isNotUser" :key="i" class="nav-li" :class="{'menu_active' :i==classA}" @click.stop="popupMenuA(item, i)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
<ul class="nav-ul" :class="{'active' :i==classA}">
|
||||
<template v-for="(child,j) in item.children">
|
||||
@ -120,403 +120,403 @@ import { UrlConfig } from '@/router/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'PlanMenuBar',
|
||||
props: {
|
||||
// skinCode: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// },
|
||||
planConvert: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true,
|
||||
classA: -1,
|
||||
classB: -1,
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
menuBase: [
|
||||
{
|
||||
title: this.$t('planMonitor.file'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('planMonitor.modifyStationIntervalTime'),
|
||||
click: this.handleModifyingStationIntervalTime
|
||||
// disabledCallback: () => { return !this.$route.query.planId },
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.view'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.tool'),
|
||||
children: [
|
||||
// {
|
||||
// title: '自动生成',
|
||||
// click: this.handleAutoGenerate,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.validityCheck'),
|
||||
click: this.handlePlanEffectiveCheck
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.testRunningDiagram'),
|
||||
click: this.handleTestRunPlan
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modify'),
|
||||
children: [
|
||||
// {
|
||||
// title: '计划参数',
|
||||
// click: this.handleParameter,
|
||||
// },
|
||||
// {
|
||||
// title: '打印参数',
|
||||
// click: this.undeveloped,
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.addPlan'),
|
||||
click: this.handleAddPlanningTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deletePlan'),
|
||||
click: this.handleDeletePlanningTrain
|
||||
},
|
||||
// {
|
||||
// title: '修改计划',
|
||||
// click: this.handleEditPlanningTrain,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.duplicatePlan'),
|
||||
click: this.handleDuplicateTrain
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.addTask'),
|
||||
click: this.handleAddTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deleteTask'),
|
||||
click: this.handleDeleteTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modifyTask'),
|
||||
click: this.handleModifyingTask
|
||||
}
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// title: '修改交路',
|
||||
// click: this.handleModifyingRouting,
|
||||
// },
|
||||
// {
|
||||
// title: '修改开始时间',
|
||||
// click: this.handleModifyingStartTime,
|
||||
// },
|
||||
// {
|
||||
// title: '快速增加任务',
|
||||
// click: this.undeveloped,
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.option'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.help'),
|
||||
children: [
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
created(){
|
||||
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
|
||||
this.isNotUser=false;
|
||||
}else{
|
||||
this.isNotUser=true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
tempClassA() {
|
||||
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
|
||||
},
|
||||
tempClassB() {
|
||||
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
|
||||
},
|
||||
'$store.state.menuOperation.break': function (val) {
|
||||
if (val) {
|
||||
this.classA = this.classB = -1;
|
||||
} else {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$route.query.planId': function () {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
name: 'PlanMenuBar',
|
||||
props: {
|
||||
// skinCode: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// },
|
||||
planConvert: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true,
|
||||
classA: -1,
|
||||
classB: -1,
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
menuBase: [
|
||||
{
|
||||
title: this.$t('planMonitor.file'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('planMonitor.modifyStationIntervalTime'),
|
||||
click: this.handleModifyingStationIntervalTime
|
||||
// disabledCallback: () => { return !this.$route.query.planId },
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.view'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.tool'),
|
||||
children: [
|
||||
// {
|
||||
// title: '自动生成',
|
||||
// click: this.handleAutoGenerate,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.validityCheck'),
|
||||
click: this.handlePlanEffectiveCheck
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.testRunningDiagram'),
|
||||
click: this.handleTestRunPlan
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modify'),
|
||||
children: [
|
||||
// {
|
||||
// title: '计划参数',
|
||||
// click: this.handleParameter,
|
||||
// },
|
||||
// {
|
||||
// title: '打印参数',
|
||||
// click: this.undeveloped,
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.addPlan'),
|
||||
click: this.handleAddPlanningTrain
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deletePlan'),
|
||||
click: this.handleDeletePlanningTrain
|
||||
},
|
||||
// {
|
||||
// title: '修改计划',
|
||||
// click: this.handleEditPlanningTrain,
|
||||
// },
|
||||
{
|
||||
title: this.$t('planMonitor.duplicatePlan'),
|
||||
click: this.handleDuplicateTrain
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.addTask'),
|
||||
click: this.handleAddTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.deleteTask'),
|
||||
click: this.handleDeleteTask
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.modifyTask'),
|
||||
click: this.handleModifyingTask
|
||||
}
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// title: '修改交路',
|
||||
// click: this.handleModifyingRouting,
|
||||
// },
|
||||
// {
|
||||
// title: '修改开始时间',
|
||||
// click: this.handleModifyingStartTime,
|
||||
// },
|
||||
// {
|
||||
// title: '快速增加任务',
|
||||
// click: this.undeveloped,
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.option'),
|
||||
children: [
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.help'),
|
||||
children: [
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.isNotUser = false;
|
||||
} else {
|
||||
this.isNotUser = true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
tempClassA() {
|
||||
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
|
||||
},
|
||||
tempClassB() {
|
||||
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
|
||||
},
|
||||
'$store.state.menuOperation.break': function (val) {
|
||||
if (val) {
|
||||
this.classA = this.classB = -1;
|
||||
} else {
|
||||
this.classA = this.tempClassA;
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
'$route.query.planId': function () {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMenu();
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
this.$router.go(-1);
|
||||
},
|
||||
menuConvert(menuBase) {
|
||||
const menus = [];
|
||||
menuBase.forEach(elem => {
|
||||
const item = {};
|
||||
Object.keys(elem).forEach(key => {
|
||||
if (key == 'disabledCallback') {
|
||||
item['disabled'] = elem.disabledCallback();
|
||||
} else if (key != 'children') {
|
||||
item[key] = elem[key];
|
||||
} else {
|
||||
item.children = this.menuConvert(elem.children || []);
|
||||
}
|
||||
});
|
||||
menus.push(item);
|
||||
});
|
||||
},
|
||||
menuConvert(menuBase) {
|
||||
const menus = [];
|
||||
menuBase.forEach(elem => {
|
||||
const item = {};
|
||||
Object.keys(elem).forEach(key => {
|
||||
if (key == 'disabledCallback') {
|
||||
item['disabled'] = elem.disabledCallback();
|
||||
} else if (key != 'children') {
|
||||
item[key] = elem[key];
|
||||
} else {
|
||||
item.children = this.menuConvert(elem.children || []);
|
||||
}
|
||||
});
|
||||
menus.push(item);
|
||||
});
|
||||
|
||||
return menus;
|
||||
},
|
||||
initMenu() {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
this.clickEvent();
|
||||
this.closeMenu();
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.closeMenu(false);
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu() {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.closeMenu();
|
||||
// launchFullscreen();
|
||||
if (!item.disabled) {
|
||||
setTimeout(() => {
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
popupMenuA(item, index) {
|
||||
this.clickEvent();
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.tempClassB = index;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.title][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.click(file);
|
||||
obj.value = '';
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('closeMenu');
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert( this.$t('planMonitor.implemented'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
loadingScreen() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('tip.underImport'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 修改站间运行时间
|
||||
handleModifyingStationIntervalTime() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
},
|
||||
// 自动生成
|
||||
handleAutoGenerate() {
|
||||
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });
|
||||
},
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
const query = {
|
||||
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
|
||||
});
|
||||
},
|
||||
// 计划参数
|
||||
handleParameter() {
|
||||
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint')+serviceNumber+'?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 修改计划
|
||||
handleEditPlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改交路
|
||||
handleModifyingRouting() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingRouting', params });
|
||||
},
|
||||
// 修改开始时间
|
||||
handleModifyingStartTime() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingBeginTime', params });
|
||||
}
|
||||
}
|
||||
return menus;
|
||||
},
|
||||
initMenu() {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
this.clickEvent();
|
||||
this.closeMenu();
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.closeMenu(false);
|
||||
};
|
||||
},
|
||||
noShowingChildren(children) {
|
||||
if (!children || children.length <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
hasShowingChildren(children) {
|
||||
if (children && children.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
closeMenu() {
|
||||
this.classA = this.tempClassA = -1;
|
||||
this.classB = this.tempClassB = -1;
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.closeMenu();
|
||||
// launchFullscreen();
|
||||
if (!item.disabled) {
|
||||
setTimeout(() => {
|
||||
if (item && typeof item.click == 'function') {
|
||||
item.click();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
popupMenuA(item, index) {
|
||||
this.clickEvent();
|
||||
this.tempClassA = index;
|
||||
this.tempClassB = -1;
|
||||
},
|
||||
popupMenuB(item, index) {
|
||||
this.tempClassB = index;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.title][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.click(file);
|
||||
obj.value = '';
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('closeMenu');
|
||||
});
|
||||
},
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.closeMenu(true);
|
||||
EventBus.$emit('refresh');
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert( this.$t('planMonitor.implemented'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
loadingScreen() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('tip.underImport'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 修改站间运行时间
|
||||
handleModifyingStationIntervalTime() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
},
|
||||
// 自动生成
|
||||
handleAutoGenerate() {
|
||||
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });
|
||||
},
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
const query = {
|
||||
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
});
|
||||
},
|
||||
// 计划参数
|
||||
handleParameter() {
|
||||
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint') + serviceNumber + '?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 修改计划
|
||||
handleEditPlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改交路
|
||||
handleModifyingRouting() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingRouting', params });
|
||||
},
|
||||
// 修改开始时间
|
||||
handleModifyingStartTime() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingBeginTime', params });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -222,16 +222,20 @@ export default {
|
||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
|
||||
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
|
||||
if (!jsonData[0].downTrack && !jsonData[0].upTrack) {
|
||||
that.loadingDig.close();
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
that.$emit('refresh');
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
}).catch(error => {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
||||
});
|
||||
|
||||
that.$message.warning(`运行图暂无默认上行折返轨或默认下行折返轨,请输入`);
|
||||
} else {
|
||||
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
|
||||
that.loadingDig.close();
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
that.$emit('refresh');
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
}).catch(error => {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
|
||||
|
@ -24,127 +24,127 @@ import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'PlanStatusBar',
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
name: 'PlanStatusBar',
|
||||
data() {
|
||||
return {
|
||||
isNotUser: true
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.isNotUser=false;
|
||||
} else {
|
||||
this.isNotUser=true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showTrain() {
|
||||
this.$emit('showTrain');
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint')+serviceNumber+'?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.isNotUser = false;
|
||||
} else {
|
||||
this.isNotUser = true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showTrain() {
|
||||
this.$emit('showTrain');
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
type: 'warning',
|
||||
width: 260,
|
||||
message: this.$t('tip.deleteTrainHint') + serviceNumber + '?',
|
||||
operate: 'DeletePlanningTrain',
|
||||
serviceNumber: serviceNumber,
|
||||
refresh: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
if (resp.data) {
|
||||
const query = {
|
||||
skinCode: this.$route.query.skinCode, prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.checkTheValidityFirst'));
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
width: 600,
|
||||
contextList: resp.data
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
if (resp.data) {
|
||||
const query = {
|
||||
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.checkTheValidityFirst'));
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -13,28 +13,28 @@ import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'PlanTitleBar',
|
||||
data() {
|
||||
return {
|
||||
mapName: '',
|
||||
logoImg: logo_
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
runPlanName() {
|
||||
return this.$route.query.planName || '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = resp.data.name;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
}
|
||||
}
|
||||
name: 'PlanTitleBar',
|
||||
data() {
|
||||
return {
|
||||
mapName: '',
|
||||
logoImg: logo_
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
runPlanName() {
|
||||
return this.$route.query.planName || '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = resp.data.name;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
|
@ -1,139 +0,0 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('global.mapList') }}</span>
|
||||
</div>
|
||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
:default-expanded-keys="defaultShowKeys"
|
||||
:props="defaultProps"
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
@node-contextmenu="showContextMenu"
|
||||
>
|
||||
<span slot-scope="{ node: nd, data }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
></span>
|
||||
<span :style="{color: data.valid ? 'green':''}"> {{ nd.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
// import { queryPermissionScreen } from '@/api/management/author';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ExamDetailList',
|
||||
components: {
|
||||
FilterCity
|
||||
},
|
||||
props: {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
queryFunction: listPublishMap,
|
||||
defaultShowKeys: [],
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
screenList: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.treeList = this.treeData.filter((res) => {
|
||||
return res.name.includes(val);
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
beforeDestroy () {
|
||||
removeSessionStorage('planMonitorList');
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
}
|
||||
},
|
||||
clickEvent(obj) {
|
||||
setSessionStorage('planMonitorList', obj.id);
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${obj.id}` });
|
||||
},
|
||||
refresh(filterSelect) {
|
||||
this.loading = true;
|
||||
this.treeData = this.treeList = [];
|
||||
listPublishMap().then(res => {
|
||||
(res.data || []).forEach(ele => {
|
||||
if (ele.cityCode == filterSelect) {
|
||||
ele.valid = true;
|
||||
this.treeData.push(ele);
|
||||
}
|
||||
});
|
||||
|
||||
this.treeList = this.filterText
|
||||
? this.treeData.filter((res) => {
|
||||
return res.name.includes(this.filterText);
|
||||
})
|
||||
: this.treeData;
|
||||
|
||||
if (this.treeList.length == 0) {
|
||||
this.$router.push({ path: `${UrlConfig.plan.prefix}/home` });
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
const mapId = getSessionStorage('planMonitorList') || (this.treeList[0] || { id: 0 }).id;
|
||||
this.$router.push({ path: `${UrlConfig.plan.detail}/${mapId}` });
|
||||
this.$refs.tree.setCurrentKey(mapId); // value 绑定的node-key
|
||||
});
|
||||
}
|
||||
|
||||
this.$nextTick(() => { this.loading = false; });
|
||||
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.el-tree {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
</style>
|
@ -6,7 +6,7 @@
|
||||
|
||||
<script>
|
||||
import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'PublishExam',
|
||||
@ -25,10 +25,6 @@ export default {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('publish.productName')
|
||||
},
|
||||
code: {
|
||||
type: 'text',
|
||||
label: this.$t('publish.productCode')
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -48,10 +44,6 @@ export default {
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.productCode'),
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.productType'),
|
||||
prop: 'prdType',
|
||||
@ -95,7 +87,7 @@ export default {
|
||||
});
|
||||
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -26,7 +26,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
cityList: [],
|
||||
skinCodeList: [],
|
||||
lineCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -67,9 +67,9 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.lineType'),
|
||||
prop: 'skinCode',
|
||||
prop: 'lineCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.lineCode, this.lineCodeList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -153,9 +153,9 @@ export default {
|
||||
this.$messageBox(this.$t('error.loadingCityListFailed'));
|
||||
});
|
||||
|
||||
this.skinCodeList = [];
|
||||
this.lineCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
this.lineCodeList = response.data;
|
||||
});
|
||||
},
|
||||
// 编辑名称
|
||||
@ -212,7 +212,7 @@ export default {
|
||||
},
|
||||
|
||||
publicList(index, row) {
|
||||
this.$router.push({ path: `/publish/map/detail`, query: { code: row.skinCode } });
|
||||
this.$router.push({ path: `/publish/map/detail`, query: { code: row.lineCode } });
|
||||
},
|
||||
|
||||
handlePutaway(index, row) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
loadInitData() {
|
||||
this.mapIdList = [];
|
||||
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -36,7 +36,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { createRunPlanCommon } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
|
||||
@ -82,7 +82,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
listPublishMap().then(resp => {
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
},
|
||||
|
@ -8,7 +8,7 @@
|
||||
import { superAdmin } from '@/router';
|
||||
import { getRunPlanLoadList, listAllTempLateRunPlan, deleteDailyRunPlanLoad, postDailyRunPlanLoadGenerate, postSchedulingCommonGenerate } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'RunPlanCommon',
|
||||
@ -95,7 +95,7 @@ export default {
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
this.mapList.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<script>
|
||||
import { superAdmin } from '@/router';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
@ -93,7 +93,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
|
@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
this.formMdoel.name = row.name;
|
||||
this.formMdoel.mapId = '';
|
||||
this.show = true;
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
if (this.mapIdList.length) {
|
||||
this.mapIdList.forEach(item => {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<script>
|
||||
import { superAdmin } from '@/router';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import CopyPlan from './copyPlan.vue';
|
||||
@ -102,7 +102,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
|
@ -9,7 +9,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getQuestById} from '@/api/quest';
|
||||
|
||||
export default {
|
||||
|
@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.commandData.param.signal = em.code;
|
||||
this.commandData.param.signal = em.name;
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
|
@ -34,13 +34,6 @@ export default {
|
||||
type: 'text',
|
||||
label: this.$t('global.mobile')
|
||||
},
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
label: this.$t('system.skinCode'),
|
||||
config: {
|
||||
data: this.$ConstSelect.skinCode
|
||||
}
|
||||
},
|
||||
prdType: {
|
||||
type: 'select',
|
||||
label: this.$t('system.prdType'),
|
||||
@ -115,13 +108,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('system.skinCode'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.simulationType'),
|
||||
prop: 'type',
|
||||
|
@ -12,7 +12,6 @@
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
// import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getCommodityMapProduct } from '@/api/management/mapprd';
|
||||
export default {
|
||||
name: 'CreateSubSystem',
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { generateMapSystem, getMapSystemPageList, createMapSubSystem, getSubSystemInfo, updateSubSystem, deleteSubSystem} from '@/api/trainingPlatform';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import OnceGenerate from './generate';
|
||||
@ -168,7 +168,7 @@ export default {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
const res = await getPublishMapListOnline();
|
||||
this.allMapList = res.data;
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
|
@ -8,77 +8,77 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleCorrelation">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{$t('global.cancel')}}</el-button>
|
||||
<el-button type="primary" @click="handleCorrelation">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { getUserSubscribe, saveUserSubscribe } from '@/api/management/user';
|
||||
|
||||
export default {
|
||||
name: 'MapCorrelation',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapDict: {},
|
||||
mapList: [],
|
||||
formModel: {
|
||||
wxId: '',
|
||||
userId: '',
|
||||
mapIdList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.mapDict = {};
|
||||
listPublishMap().then(response => {
|
||||
this.mapList = response.data;
|
||||
this.mapList.forEach(elem => {
|
||||
this.mapDict[elem.id] = elem.name;
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doClose(done) {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
this.formModel.userId = data.id;
|
||||
this.formModel.wxId = data.wxId;
|
||||
this.formModel.mapIdList = [];
|
||||
if (this.formModel.userId) {
|
||||
getUserSubscribe(this.formModel.userId).then(response => {
|
||||
const list = response.data;
|
||||
list.forEach(elem => {
|
||||
this.formModel.mapIdList.push(elem.id);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCorrelation() {
|
||||
const model = {
|
||||
userId: this.formModel.userId,
|
||||
wxId: this.formModel.wxId,
|
||||
mapList: []
|
||||
};
|
||||
name: 'MapCorrelation',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapDict: {},
|
||||
mapList: [],
|
||||
formModel: {
|
||||
wxId: '',
|
||||
userId: '',
|
||||
mapIdList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.mapDict = {};
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapList = response.data;
|
||||
this.mapList.forEach(elem => {
|
||||
this.mapDict[elem.id] = elem.name;
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doClose(done) {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
this.formModel.userId = data.id;
|
||||
this.formModel.wxId = data.wxId;
|
||||
this.formModel.mapIdList = [];
|
||||
if (this.formModel.userId) {
|
||||
getUserSubscribe(this.formModel.userId).then(response => {
|
||||
const list = response.data;
|
||||
list.forEach(elem => {
|
||||
this.formModel.mapIdList.push(elem.id);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCorrelation() {
|
||||
const model = {
|
||||
userId: this.formModel.userId,
|
||||
wxId: this.formModel.wxId,
|
||||
mapList: []
|
||||
};
|
||||
|
||||
if (this.formModel.mapIdList && this.formModel.mapIdList.length) {
|
||||
this.formModel.mapIdList.forEach(mapId => {
|
||||
model.mapList.push({ id: mapId, name: this.mapDict[mapId] });
|
||||
});
|
||||
}
|
||||
saveUserSubscribe(model).then(response => {
|
||||
this.$message.success(this.$t('tip.setUpASubscriptionMapSuccessfully'));
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$message.success(this.$t('tip.setUpASubscriptionMapFailed'));
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.formModel.mapIdList && this.formModel.mapIdList.length) {
|
||||
this.formModel.mapIdList.forEach(mapId => {
|
||||
model.mapList.push({ id: mapId, name: this.mapDict[mapId] });
|
||||
});
|
||||
}
|
||||
saveUserSubscribe(model).then(response => {
|
||||
this.$message.success(this.$t('tip.setUpASubscriptionMapSuccessfully'));
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$message.success(this.$t('tip.setUpASubscriptionMapFailed'));
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -12,118 +12,118 @@ import DictionaryEdit from './edit';
|
||||
import CorrelationMap from './correlationMap';
|
||||
|
||||
export default {
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
CorrelationMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('system.name')
|
||||
},
|
||||
roles: {
|
||||
type: 'select',
|
||||
label: this.$t('system.roles'),
|
||||
config: {
|
||||
data: this.$ConstSelect.roleList
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
CorrelationMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('system.name')
|
||||
},
|
||||
roles: {
|
||||
type: 'select',
|
||||
label: this.$t('system.roles'),
|
||||
config: {
|
||||
data: this.$ConstSelect.roleList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: getUserList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.nickname'),
|
||||
prop: 'nickname'
|
||||
},
|
||||
{
|
||||
title: this.$t('global.mobile'),
|
||||
prop: 'mobile'
|
||||
},
|
||||
{
|
||||
title: this.$t('global.email'),
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.roles'),
|
||||
prop: 'roles',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.edit'),
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: this.$t('system.subscribeMap'),
|
||||
handleClick: this.handleMapCorrelation,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 编辑
|
||||
handleUserEdit(index, row) {
|
||||
this.$refs.edit.doShow(row);
|
||||
},
|
||||
},
|
||||
queryList: {
|
||||
query: getUserList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.nickname'),
|
||||
prop: 'nickname'
|
||||
},
|
||||
{
|
||||
title: this.$t('global.mobile'),
|
||||
prop: 'mobile'
|
||||
},
|
||||
{
|
||||
title: this.$t('global.email'),
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.roles'),
|
||||
prop: 'roles',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.edit'),
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: this.$t('system.subscribeMap'),
|
||||
handleClick: this.handleMapCorrelation,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 编辑
|
||||
handleUserEdit(index, row) {
|
||||
this.$refs.edit.doShow(row);
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleUserDelete(index, row) {
|
||||
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// delPublishMap(row.id).then(response => {
|
||||
// this.$message.success('删除成功')
|
||||
// this.reloadTable()
|
||||
// localStore.remove('mapId')
|
||||
// }).catch(error => {
|
||||
// this.reloadTable()
|
||||
// this.$messageBox('删除失败')
|
||||
// })
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
handleUserDelete(index, row) {
|
||||
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// delPublishMap(row.id).then(response => {
|
||||
// this.$message.success('删除成功')
|
||||
// this.reloadTable()
|
||||
// localStore.remove('mapId')
|
||||
// }).catch(error => {
|
||||
// this.reloadTable()
|
||||
// this.$messageBox('删除失败')
|
||||
// })
|
||||
});
|
||||
},
|
||||
|
||||
// 关联地图
|
||||
handleMapCorrelation(index, row) {
|
||||
this.$refs.correlationMap.doShow(row);
|
||||
},
|
||||
// 关联地图
|
||||
handleMapCorrelation(index, row) {
|
||||
this.$refs.correlationMap.doShow(row);
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
<script>
|
||||
import { getSimulationList, deleteSimulationStats } from '@/api/simulation';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
|
||||
import UsersTrainingEdit from './edit';
|
||||
@ -23,7 +22,6 @@ export default {
|
||||
return {
|
||||
examResultList: [],
|
||||
LessonList: [],
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -103,8 +101,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
const res = await listPublishMap();
|
||||
this.mapList = res.data;
|
||||
const response = await getPublishLessonList();
|
||||
const data = response.data;
|
||||
if (data && data.length) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
v-model="item.select"
|
||||
class="checkbox"
|
||||
type="checkbox"
|
||||
@change="nodeClick(item)"
|
||||
>
|
||||
<span>{{ item.node.nickName }}</span>
|
||||
</li>
|
||||
@ -43,8 +42,11 @@ export default {
|
||||
props() {
|
||||
return { label: 'name' };
|
||||
},
|
||||
personList() {
|
||||
return this.audienceList.map(e => { return { select: false, node: e }; });
|
||||
},
|
||||
filterList() {
|
||||
return this.audienceList.filter(e => e.nickName.includes(this.filterText)).map(e => { return {select: false, node: e}; });
|
||||
return this.personList.filter(e => e.node.nickName.includes(this.filterText));
|
||||
},
|
||||
titleI18n() {
|
||||
return {
|
||||
@ -66,14 +68,11 @@ export default {
|
||||
},
|
||||
doClose() {
|
||||
this.visible = false;
|
||||
},
|
||||
nodeClick(data) {
|
||||
|
||||
},
|
||||
commit() {
|
||||
this.$emit('handleDispatch', this.personList);
|
||||
const userList = this.personList.filter(e => { return e.select; }).map(e=> { return e.node; });
|
||||
this.$emit('dispatch', {roleType: this.roleType, userList: userList});
|
||||
this.visible = false;
|
||||
this.personList = [];
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
@ -98,6 +97,10 @@ export default {
|
||||
background-color: #c7c7c7;
|
||||
}
|
||||
|
||||
/deep/ .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.person {
|
||||
&__container {
|
||||
max-height: 270px;
|
||||
|
@ -10,43 +10,41 @@ import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { putJointTrainingUserkicked } from '@/api/chat';
|
||||
|
||||
export default {
|
||||
name: 'TrainingOperateMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
point: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
clickUserId: {
|
||||
type: String,
|
||||
required: true
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuShow: [
|
||||
{
|
||||
label: this.$t('trainRoom.kickOutTheRoom'),
|
||||
handler: this.kicked
|
||||
}
|
||||
],
|
||||
userId: ''
|
||||
menu: [{
|
||||
label: this.$t('trainRoom.kickOutTheRoom'),
|
||||
handler: this.kicked
|
||||
}]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
position() {
|
||||
return this.$store.state.menuOperation.menuPosition;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.JointRoom)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
this.doShow();
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userId = this.$store.state.user.id;
|
||||
this.closeEvent();
|
||||
},
|
||||
methods: {
|
||||
@ -56,17 +54,13 @@ export default {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
doShow() {
|
||||
this.closeEvent();
|
||||
if (this.userId != this.clickUserId) {
|
||||
this.menu = this.menuShow;
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
this.$refs.popMenu.resetShowPosition(this.position);
|
||||
}
|
||||
} else {
|
||||
this.menu = [];
|
||||
}
|
||||
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
@ -4,7 +4,7 @@
|
||||
<div class="chat__head">
|
||||
<div class="chat__head--title"> 会话窗口</div>
|
||||
</div>
|
||||
<div class="chat__container" :style="{height: listHeight+'px'}">
|
||||
<div ref="content" class="chat__container" :style="{height: listHeight+'px'}">
|
||||
<ul class="chat__container--list">
|
||||
<div v-for="(nor, index) in textList" :key="index" style="margin-top: 5px;">
|
||||
<li v-if="nor.self" style="position: relative">
|
||||
@ -33,6 +33,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { chatWithText } from '@/api/chat';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -52,32 +53,63 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
textList: [],
|
||||
topic: '/user/topic/chatroom',
|
||||
text: '',
|
||||
recorders: null,
|
||||
stomp: null,
|
||||
speak: this.$t('trainRoom.holdAndTalk'),
|
||||
sending: false,
|
||||
background: '',
|
||||
userId: '',
|
||||
disabled:true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listHeight() {
|
||||
return this.height - 90;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.chatContent': function (val) { // 房间内语音聊天
|
||||
if (val.chatInfo) {
|
||||
this.handelTextList(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSetInputState() {
|
||||
async handleSetInputState() {
|
||||
if (!this.text.trim()) {
|
||||
this.disabled = true;
|
||||
} else {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
handleSendText() {
|
||||
|
||||
async handleSendText() {
|
||||
try {
|
||||
if (this.text.trim()) {
|
||||
await chatWithText(this.text, this.group);
|
||||
this.text = '';
|
||||
this.disabled = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
async handelTextList(params) {
|
||||
if (!params.inSimulation) {
|
||||
this.textList.push(params);
|
||||
this.textList.sort((a, b) => {
|
||||
return a.date - b.date;
|
||||
});
|
||||
}
|
||||
this.sending = false;
|
||||
this.$store.dispatch('socket/setChatContent', {});
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.content) {
|
||||
this.$refs.content.scrollTop = this.$refs.content.scrollHeight;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,26 +2,34 @@
|
||||
<div class="device">
|
||||
<div class="device__head">
|
||||
<div class="device__head--title">
|
||||
{{ $t(titleI18n) }}<span>-{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}</span>
|
||||
{{ $t(titleI18n) }}<span>-{{ hasPlc? $t('trainRoom.plcGatewayOnline') : $t('trainRoom.plcGatewayOffline') }}</span>
|
||||
</div>
|
||||
<div class="device__head--add">
|
||||
<el-button v-if="userId == room.creatorId" icon="el-icon-plus" circle plain @click="handleAddUser()" />
|
||||
<el-button v-if="userId == room.creatorId" icon="el-icon-plus" circle plain @click="handleAddDevice()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="device__container">
|
||||
<ul class="device__container--list">
|
||||
<li v-for="(node, index) in options" :key="index">
|
||||
<span>{{ node.nickName }}</span>
|
||||
<i v-if="userId == room.creatorId" class="el-icon-close delete" @click="handleDelUser(node, index)" />
|
||||
<span>{{ realDeviceType[node.deviceType] }}</span>
|
||||
<i v-if="userId == room.creatorId" class="el-icon-close delete" @click="handleDelDevice(node, index)" />
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-cascader
|
||||
<el-select
|
||||
v-model="node.deviceCode"
|
||||
size="mini"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="userId != room.creatorId"
|
||||
:options="stationList"
|
||||
@change="handleSetUser(node, index)"
|
||||
/>
|
||||
@change="handleUpdDevice(node, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@ -30,6 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { RealDeviceType } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -37,10 +46,6 @@ export default {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
room: {
|
||||
type:Object,
|
||||
required: true
|
||||
@ -49,7 +54,11 @@ export default {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
stationList: {
|
||||
deviceType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
deviceList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
@ -62,15 +71,23 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
realDeviceType: RealDeviceType
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAddDevice() {
|
||||
this.$emit('addDevice',);
|
||||
this.$emit('addDevice', { deviceType: this.deviceType });
|
||||
},
|
||||
handleSetDevice(node, index) {
|
||||
handleUpdDevice(node, index) {
|
||||
this.$emit('changeDevice', { deviceType: this.deviceType, device: node, deviceList: this.deviceList });
|
||||
},
|
||||
handleDelDevice(node, index) {
|
||||
this.$emit('delDevice', { deviceType: this.deviceType, device: node, deviceList: this.deviceList });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -22,13 +22,18 @@
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<content-menu ref="menu" :click-user-id="clickUserId" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import ContentMenu from './content-menu';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ContentMenu
|
||||
},
|
||||
props: {
|
||||
room: {
|
||||
type: Object,
|
||||
@ -45,7 +50,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterText: ''
|
||||
filterText: '',
|
||||
clickUserId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -57,6 +63,9 @@ export default {
|
||||
},
|
||||
filterMembers() {
|
||||
return this.members.filter(e =>{ return e.nickName.includes(this.filterText); });
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -66,13 +75,14 @@ export default {
|
||||
},
|
||||
handleShowContextMenu(e, obj, node, vueElem) {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
const position = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
|
||||
if (this.userId == this.room.creatorId) {
|
||||
this.clickUserId = obj.id;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: DeviceMenu.JointRoom });
|
||||
this.clickUserId = `${obj.id || ''}`;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,31 @@
|
||||
<i v-if="userId == room.creatorId" class="el-icon-close delete" @click="handleDelUser(node, index)" />
|
||||
<div v-if="hasDevice" style="float: right; margin-right: 15px;">
|
||||
<el-cascader
|
||||
v-if="roleType == 'IBP'"
|
||||
v-model="node.deviceCode"
|
||||
size="mini"
|
||||
:placeholder="$t('global.choose')"
|
||||
:disabled="userId != room.creatorId"
|
||||
:disabled="isDisable"
|
||||
:options="deviceList"
|
||||
@change="handleSetUser(node, index)"
|
||||
@change="handleUpdUser(node, index)"
|
||||
/>
|
||||
<el-select
|
||||
v-if="roleType == 'Attendant'"
|
||||
v-model="node.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="isDisable"
|
||||
@change="handleUpdUser(node, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@ -37,10 +55,6 @@ export default {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
room: {
|
||||
type:Object,
|
||||
required: true
|
||||
@ -66,16 +80,24 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
hasDevice() {
|
||||
return ['Driver', 'Attendant', 'IBP'].includes(this.roleType);
|
||||
return ['Attendant', 'IBP'].includes(this.roleType);
|
||||
},
|
||||
isDisable() {
|
||||
return this.userId != this.room.creatorId;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAddUser() {
|
||||
this.$emit('addUser', this.roleType);
|
||||
this.$emit('addUser', { roleType: this.roleType });
|
||||
},
|
||||
handleSetUser(node, index) {
|
||||
handleUpdUser(node, index) {
|
||||
this.$emit('changeUser', { roleType: this.roleType, user: node, deviceList: this.deviceList });
|
||||
},
|
||||
handleDelUser(node, index) {
|
||||
this.$emit('delUser', { roleType: this.roleType, user: node, deviceList: this.deviceList });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -12,13 +12,80 @@
|
||||
<div class="roles__container">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: rolesHeight+'px', width: '100%'}">
|
||||
<div class="roles">
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="dispatcherList" title-i18n="trainRoom.dispatcher" role-type="Dispatcher" @addUser="handleAddUser" />
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="attendantList" title-i18n="trainRoom.stationAttendant" role-type="Attendant" @addUser="handleAddUser" />
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="instructorList" title-i18n="trainRoom.teacher" role-type="Instructor" @addUser="handleAddUser" />
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="repairList" title-i18n="trainRoom.universalAccount" role-type="Repair" @addUser="handleAddUser" />
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="driverList" title-i18n="trainRoom.driver" role-type="Driver" @addUser="handleAddUser" />
|
||||
<e-role class="role" :user-id="userId" :room="room" :options="ibpList" title-i18n="trainRoom.ibp" role-type="IBP" @addUser="handleAddUser" />
|
||||
<e-device class="role" :user-id="userId" :room="room" :options="realDeviceList" title-i18n="trainRoom.realDevice" :has-plc="hasPlc" @addDevice="handleDeviceUser" />
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.dispatcher"
|
||||
role-type="Dispatcher"
|
||||
:room="room"
|
||||
:options="dispatcherList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.stationAttendant"
|
||||
role-type="Attendant"
|
||||
:room="room"
|
||||
:options="attendantList"
|
||||
:device-list="stationListForAttendant"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.teacher"
|
||||
role-type="Instructor"
|
||||
:room="room"
|
||||
:options="instructorList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.universalAccount"
|
||||
role-type="Repair"
|
||||
:room="room"
|
||||
:options="repairList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.driver"
|
||||
role-type="Driver"
|
||||
:room="room"
|
||||
:options="driverList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.ibp"
|
||||
role-type="IBP"
|
||||
:room="room"
|
||||
:options="ibpList"
|
||||
:device-list="stationListForIBP"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-device
|
||||
class="role"
|
||||
title-i18n="trainRoom.realDevice"
|
||||
device-type="StationStand"
|
||||
:room="room"
|
||||
:options="standList"
|
||||
:device-list="doorList"
|
||||
:has-plc="hasPlc"
|
||||
@addDevice="handleAddDevice"
|
||||
@changeDevice="handleUpdDevice"
|
||||
@delDevice="handleDelDevice"
|
||||
/>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@ -34,7 +101,8 @@
|
||||
</template>
|
||||
<el-button type="" @click="handleBack">{{ $t('global.back') }}</el-button>
|
||||
</div>
|
||||
<add-person ref="addPerson" :audience-list="audienceList" @dispatch="handleDispatch" />
|
||||
<add-person ref="addPerson" :audience-list="audienceList" @dispatch="handleDispatchUser" />
|
||||
<qr-code ref="qrCode" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -42,18 +110,18 @@
|
||||
import eRole from './e-role';
|
||||
import eDevice from './e-device';
|
||||
import AddPerson from './add-person';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import { getJoinTrainCode, startJointTraining, deljointTrainRoom, putJointTrainingExit, putJointTrainingSimulation, putUserRoles, setRealDevice, delRealDevice } from '@/api/chat';
|
||||
import { getPlcGateway } from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
components : {
|
||||
eRole,
|
||||
eDevice,
|
||||
AddPerson
|
||||
AddPerson,
|
||||
QrCode
|
||||
},
|
||||
props: {
|
||||
userId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
room: {
|
||||
type: Object,
|
||||
required: true
|
||||
@ -65,83 +133,240 @@ export default {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
stationList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
standList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
doorList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
starting: false,
|
||||
hasPlc: false
|
||||
// dispatcherList: [],
|
||||
// attendantList: [],
|
||||
// instructorList: [],
|
||||
// repairList: [],
|
||||
// driverList: [],
|
||||
// ibpList: [],
|
||||
// audienceList: [],
|
||||
// realDeviceList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rolesHeight() {
|
||||
return this.height - 100;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
starting() {
|
||||
return this.room.state == '02';
|
||||
},
|
||||
stationListForAttendant() {
|
||||
return this.stationList.filter(elem => { return elem.centralized; }).map(item => {
|
||||
const elem = { code: item.code, name: item.name, disabled: false };
|
||||
this.attendantList.forEach(nor => {
|
||||
if (elem.code == nor.deviceCode) {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
return elem;
|
||||
});
|
||||
},
|
||||
stationListForIBP() {
|
||||
return this.stationList.map(item => {
|
||||
const elem = { value: item.code, label: item.name, children: [{value: 'left', label: this.$t('trainRoom.left')}, {value: 'right', label: this.$t('trainRoom.right')}] };
|
||||
return elem;
|
||||
});
|
||||
},
|
||||
dispatcherList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Dispatcher'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Dispatcher'); });
|
||||
},
|
||||
attendantList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Attendant'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Attendant'); });
|
||||
},
|
||||
instructorList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Instructor'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Instructor'); });
|
||||
},
|
||||
repairList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Repair'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Repair'); });
|
||||
},
|
||||
driverList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Drive'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Driver'); });
|
||||
},
|
||||
ibpList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('IBP'); });
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('IBP'); });
|
||||
},
|
||||
audienceList() {
|
||||
return this.members.filter(elem => { return elem.role.includes('Audience'); });
|
||||
},
|
||||
realDeviceList() {
|
||||
return [];
|
||||
return this.members.filter(elem => { return [elem.userRole].includes('Audience'); });
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
await this.checkPlcGateway();
|
||||
},
|
||||
methods: {
|
||||
async checkPlcGateway() {
|
||||
try {
|
||||
const resp = await getPlcGateway(this.group);
|
||||
this.hasPlc = !!resp.data;
|
||||
} catch (e) {
|
||||
this.hasPlc = false;
|
||||
this.$messageBox(this.$t('error.inquiryPLCDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handlePostQrcode() {
|
||||
|
||||
this.loading = true;
|
||||
const res = await getJoinTrainCode({}, this.group);
|
||||
if (res.code == '200') {
|
||||
const param = {
|
||||
url: res.data,
|
||||
title: this.$t('trainRoom.distributeTheRoomQRCode')
|
||||
};
|
||||
if (this.$refs) {
|
||||
this.$refs.qrCode.doShow(param);
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
async handleJoinTraining() {
|
||||
|
||||
this.$emit('joinTraining');
|
||||
},
|
||||
async handleDeviceUser(params) {
|
||||
async handleAddDevice({deviceType}) {
|
||||
const roomDeviceVo = {id: '', deviceType: 'ScreenDoor', deviceCode: ''};
|
||||
if (this.standList.findIndex(elem => { return elem.deviceType == roomDeviceVo.deviceType; }) > -1) {
|
||||
this.$message.info(this.$t('error.theDeviceTypeAlreadyExists'));
|
||||
return;
|
||||
}
|
||||
|
||||
await setRealDevice(this.group, roomDeviceVo);
|
||||
},
|
||||
async handleAddUser(roleType) {
|
||||
async handleUpdDevice({deviceType, device}) {
|
||||
try {
|
||||
await setRealDevice(this.group, device);
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.connectToRealDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handleDelDevice({deviceType, device}) {
|
||||
try {
|
||||
await delRealDevice(device.id, this.group);
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.deleteRealDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handleAddUser({roleType}) {
|
||||
this.$refs.addPerson.doShow(roleType);
|
||||
},
|
||||
async handleDispatch() {
|
||||
async handleDelUser({roleType, user}) {
|
||||
const params = [{
|
||||
id: user.id,
|
||||
nickName: user.nickName,
|
||||
userRole: 'Audience',
|
||||
deviceCode: ''
|
||||
}];
|
||||
|
||||
await putUserRoles(params, this.group);
|
||||
},
|
||||
async handleUpdUser({roleType, user, deviceList}) {
|
||||
let deviceCode = '';
|
||||
if (roleType === 'IBP') {
|
||||
user.ibpPart = user.deviceCode[1];
|
||||
deviceCode = user.deviceCode[0];
|
||||
} else {
|
||||
user.ibpPart = '';
|
||||
deviceCode = user.deviceCode;
|
||||
}
|
||||
|
||||
const params = [{
|
||||
id: user.id,
|
||||
nickName: user.nickName,
|
||||
userRole: roleType,
|
||||
deviceCode: deviceCode,
|
||||
ibpPart: user.ibpPart
|
||||
}];
|
||||
|
||||
await putUserRoles(params, this.group);
|
||||
|
||||
this.stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
deviceList.forEach(nor => {
|
||||
if (item.code === nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
async handleDispatchUser({roleType, userList}) {
|
||||
const list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType }; });
|
||||
if (list.length) {
|
||||
try {
|
||||
await putUserRoles(list, this.group);
|
||||
list.forEach(item => {
|
||||
this.treeData.forEach(nor => {
|
||||
if (item.id == nor.id) {
|
||||
nor.userRole = item.userRole;
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
if (error.code == 500009) {
|
||||
this.messageInfo({error:'error', message: this.$t('error.exceededTheTotalNumberOfAssignableRoles')} );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async handleStart() {
|
||||
|
||||
this.loading = true;
|
||||
if (this.attendantList.findIndex(item => { return !item.deviceCode; }) < 0) {
|
||||
try {
|
||||
await startJointTraining(this.group);
|
||||
this.loading = false;
|
||||
} catch (error) {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.startedComprehensiveDrillFailure')});
|
||||
this.loading = false;
|
||||
}
|
||||
} else {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.stationAttendantStationCannotBeEmpty')});
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async handleStop() {
|
||||
|
||||
this.loading = true;
|
||||
const res = await putJointTrainingSimulation(this.group);
|
||||
this.mapId = res.data.mapId;
|
||||
if (res.data.state == '01') {
|
||||
this.starting = false;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
async handleExit() {
|
||||
|
||||
this.loading = false;
|
||||
this.$confirm( this.$t('tip.destroyRoomHint'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
try {
|
||||
await deljointTrainRoom(this.group);
|
||||
} catch (error) {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.destroyedRoomFailed')});
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleBack() {
|
||||
try {
|
||||
this.loading = true;
|
||||
// 调用仿真退出接口
|
||||
await putJointTrainingExit(this.group);
|
||||
this.loading = false;
|
||||
if (this.$route.query.subSystem) {
|
||||
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.room.mapId}});
|
||||
@ -149,7 +374,7 @@ export default {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
} catch (error) {
|
||||
this.messageInfo( this.$t('error.operationFailure'), 'error');
|
||||
this.$emit('message', {type:'error', message: this.$t('error.operationFailure')});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,13 +5,35 @@
|
||||
{{ $t('trainRoom.comprehensiveDrillRoom') }}
|
||||
</div>
|
||||
<div class="room__head--notes">
|
||||
{{ $t('trainRoom.comprehensiveTrainingManager') + room.creator }}
|
||||
{{ $t('trainRoom.comprehensiveTrainingManager') + room.creator.nickName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="room__container">
|
||||
<e-members class="room__container--members" :user-id="userId" :room="room" :members="members" :height="height" />
|
||||
<e-roles class="room__container--roles" :user-id="userId" :room="room" :members="members" :height="height" />
|
||||
<e-chat class="room__container--chat" :user-id="userId" :room="room" :members="members" :height="height" />
|
||||
<e-members
|
||||
class="room__container--members"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
<e-roles
|
||||
class="room__container--roles"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
:station-list="stationList"
|
||||
:stand-list="standList"
|
||||
:door-list="doorList"
|
||||
@message="messageInfo"
|
||||
@joinTraining="jumpInSimulation"
|
||||
/>
|
||||
<e-chat
|
||||
class="room__container--chat"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
</div>
|
||||
<div class="room__footer" />
|
||||
</div>
|
||||
@ -21,8 +43,11 @@
|
||||
import eMembers from './e-members';
|
||||
import eChat from './e-chat';
|
||||
import eRoles from './e-roles';
|
||||
import { postRoomDetail } from '@/api/chat';
|
||||
import { postRoomDetail, getJointTrainRoomUserList, getRealDevices, putJointTrainingSimulationEntrance } from '@/api/chat';
|
||||
import { getPublishMapInfo, hasDoorStationList } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -33,103 +58,191 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
room: {
|
||||
totalNum: 12,
|
||||
totalNum: 0,
|
||||
group: '',
|
||||
mapId: '',
|
||||
creatorId: 1,
|
||||
creator: 'Ival',
|
||||
permissionRest: 1,
|
||||
permissionNum: 20
|
||||
creatorId: '',
|
||||
creator: {
|
||||
nickName: ''
|
||||
},
|
||||
permissionRest: 0,
|
||||
permissionNum: 0,
|
||||
state: ''
|
||||
},
|
||||
members: [
|
||||
{
|
||||
nickName: 'Ival',
|
||||
inRoom: true,
|
||||
role: 'Instructor'
|
||||
},
|
||||
{
|
||||
nickName: 'Dispatcher',
|
||||
inRoom: true,
|
||||
role: 'Dispatcher'
|
||||
},
|
||||
{
|
||||
nickName: 'Instructor',
|
||||
inRoom: true,
|
||||
role: 'Instructor'
|
||||
},
|
||||
{
|
||||
nickName: 'Attendant',
|
||||
inRoom: true,
|
||||
role: 'Attendant'
|
||||
},
|
||||
{
|
||||
nickName: 'Repair',
|
||||
inRoom: true,
|
||||
role: 'Repair'
|
||||
},
|
||||
{
|
||||
nickName: 'Driver',
|
||||
inRoom: true,
|
||||
role: 'Driver'
|
||||
},
|
||||
{
|
||||
nickName: 'IBP',
|
||||
inRoom: true,
|
||||
role: 'IBP'
|
||||
},
|
||||
{
|
||||
nickName: 'Audience1',
|
||||
inRoom: true,
|
||||
role: 'Audience'
|
||||
},
|
||||
{
|
||||
nickName: 'Audience2',
|
||||
inRoom: true,
|
||||
role: 'Audience'
|
||||
},
|
||||
{
|
||||
nickName: 'Audience3',
|
||||
inRoom: true,
|
||||
role: 'Audience'
|
||||
}
|
||||
],
|
||||
stationList: []
|
||||
userMap: [],
|
||||
members: [],
|
||||
stationList: [],
|
||||
standList: [],
|
||||
doorList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 100;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userId() {
|
||||
if (this.$store.state.user) {
|
||||
return this.$store.state.user.id;
|
||||
}
|
||||
return '';
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.handleGetRoomInfo();
|
||||
watch: {
|
||||
members: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.room.permissionRest = this.members.filter(elem => ['Audience'].includes(elem.userRole)).length;
|
||||
}
|
||||
},
|
||||
// 用户信息
|
||||
'$store.state.socket.roleList': async function (val) {
|
||||
if (val.length) {
|
||||
await this.dispatchUsers(val);
|
||||
}
|
||||
},
|
||||
// 房间消息
|
||||
'$store.state.socket.jointRoomInfo': async function (val) {
|
||||
if (val.creatorId) {
|
||||
await this.dispatchRoomInfo(val);
|
||||
}
|
||||
},
|
||||
// 设备信息
|
||||
'$store.state.socket.realDeviceInfo': async function (val) {
|
||||
await this.getStandList();
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getRoomInfo();
|
||||
await this.getUserList();
|
||||
await this.getStandList();
|
||||
await this.getStaionList(this.room.mapId);
|
||||
await this.getDoorList(this.room.mapId, this.stationList);
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
},
|
||||
methods: {
|
||||
async handleGetRoomInfo() {
|
||||
// 获取房间信息 创建人和权限总数
|
||||
const res = await postRoomDetail(this.$route.query.group);
|
||||
this.starting = res.data.state == '02';
|
||||
|
||||
async getRoomInfo() {
|
||||
const resp = await postRoomDetail(this.group);
|
||||
this.room = {
|
||||
mapId: res.data.mapId,
|
||||
creatorId: res.data.creatorId,
|
||||
totalNum: Number(res.data.permissionNum) + Number(res.data.audiencePermissionNum),
|
||||
creator: res.data.creator.nickName,
|
||||
group: res.data.group,
|
||||
audienceNum: res.data.audiencePermissionNum,
|
||||
permissionNum: res.data.permissionNum,
|
||||
permissionRest: 10
|
||||
permissionRest: 0,
|
||||
totalNum: Number(resp.data.permissionNum) + Number(resp.data.audiencePermissionNum),
|
||||
...resp.data || {}
|
||||
};
|
||||
},
|
||||
async getStandList() {
|
||||
const resp = await getRealDevices(this.group);
|
||||
this.standList = resp.data || [];
|
||||
},
|
||||
async getStaionList(mapId) {
|
||||
const resp = await getStationList(mapId);
|
||||
this.stationList = resp.data || [];
|
||||
},
|
||||
async getDoorList(mapId, stationList) {
|
||||
const doorList = [];
|
||||
hasDoorStationList(mapId).then(res =>{
|
||||
stationList.forEach(item => {
|
||||
res.data.forEach(it =>{
|
||||
if (item.code === it.stationCode) {
|
||||
const direction = parseInt(it.doorLocationType) % 2 === 0 ? this.$t('trainRoom.uplinkPlatform') : this.$t('trainRoom.downlinkPlatform');
|
||||
doorList.push({code: it.code, name: item.name + direction});
|
||||
}
|
||||
});
|
||||
});
|
||||
this.doorList = doorList;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.getScreenDoorsListFailed'));
|
||||
});
|
||||
},
|
||||
async getUserList() {
|
||||
const res = await getJointTrainRoomUserList(this.group);
|
||||
this.members = (res.data || []).map(elem => { return this.transformUser(elem); });
|
||||
},
|
||||
async dispatchUsers(users) {
|
||||
users.forEach(user => {
|
||||
const index = this.members.findIndex(elem => { return user.id == elem.id; });
|
||||
if (user.userRole) {
|
||||
if (index >= 0) {
|
||||
this.members.splice(index, 1, Object.assign(this.members[index], this.transformUser(user)));
|
||||
this.checkUserState(user, 'upd');
|
||||
} else {
|
||||
this.members.push(this.transformUser(user));
|
||||
this.checkUserState(user, 'add');
|
||||
}
|
||||
} else {
|
||||
this.members.splice(index, 1);
|
||||
this.checkUserState(user, 'del');
|
||||
}
|
||||
});
|
||||
},
|
||||
async dispatchRoomInfo(room) {
|
||||
Object.assign(this.room, room);
|
||||
switch (room.state) {
|
||||
case '03': // 房间销毁
|
||||
this.$router.go(-1);
|
||||
break;
|
||||
case '02': // 开始仿真
|
||||
this.jumpInSimulation();
|
||||
break;
|
||||
}
|
||||
|
||||
// 获取设备集中站
|
||||
const resp = await getStationList(res.data.mapId);
|
||||
this.stationList = resp.data;
|
||||
// 清空房间信息
|
||||
this.$store.dispatch('socket/setJointRoomInfo');
|
||||
},
|
||||
async checkUserState(user, operate) {
|
||||
switch (operate) {
|
||||
case 'add':
|
||||
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}进入房间`});
|
||||
break;
|
||||
case 'upd':
|
||||
if (!user.inRoom) {
|
||||
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}退出房间`});
|
||||
if (this.userId == user.id) {
|
||||
this.jumpOutRoom();
|
||||
}
|
||||
}
|
||||
|
||||
if (user.inSimulation) {
|
||||
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}进入仿真`});
|
||||
if (this.userId == user.id) {
|
||||
this.jumpInSimulation();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'del':
|
||||
this.$store.dispatch('socket/setChatContent', {roomTip: `${user.nickName}被提出房间`});
|
||||
if (this.userId == user.id) {
|
||||
this.jumpOutRoom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
async jumpInSimulation() {
|
||||
const room = this.room;
|
||||
await putJointTrainingSimulationEntrance(room.group);
|
||||
const rest = await getPublishMapInfo(room.mapId);
|
||||
const query = { skinCode: rest.data.skinCode, mapId: room.mapId, group: room.group, subSystem: this.$route.query.subSystem };
|
||||
this.$router.replace({ path: `/jointTraining`, query: query });
|
||||
launchFullscreen();
|
||||
// 清空房间信息
|
||||
this.$store.dispatch('socket/setJointRoomInfo');
|
||||
},
|
||||
async jumpOutRoom() {
|
||||
this.$router.push({ path: `/` });
|
||||
this.messageInfo({error: 'warning', message: this.$t('tip.beKickedOut')});
|
||||
},
|
||||
transformUser(user) {
|
||||
// 根据用户角色专用数据数据
|
||||
switch (user.userRole) {
|
||||
case 'IBP':
|
||||
user.deviceCode = [user.deviceCode || '', user.ibpPart || ''];
|
||||
break;
|
||||
}
|
||||
|
||||
return user;
|
||||
},
|
||||
messageInfo(info) {
|
||||
this.$message({ showClose: true, ...info });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user