Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/views/jlmap3d/passflow/jl3dpassflow.vue
This commit is contained in:
commit
5428f98843
@ -613,11 +613,19 @@ export function getPlcGateway(group) {
|
||||
}
|
||||
|
||||
/** 处理ibp盘事件 */
|
||||
// export function handlerIbpEvent(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/ibp/event`,
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// });
|
||||
// }
|
||||
|
||||
export function handlerIbpEvent(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/ibp/event`,
|
||||
method: 'post',
|
||||
data: data
|
||||
url: `/simulation/${group}/ibp/button`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import Painter from './painter';
|
||||
import deviceType from './constant/deviceType';
|
||||
import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser';
|
||||
import { updateIbpData } from './utils/parser';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
@ -16,7 +17,7 @@ class IbpPan {
|
||||
this.methods = opts.methods;
|
||||
|
||||
// 鼠标事件
|
||||
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu'};
|
||||
this.events = { __Pan: 'pan', Selected: 'selected', MouseDown: 'mouseDown', Contextmenu: 'contextmenu'};
|
||||
|
||||
// 设备数据
|
||||
this.ibpDevice = {};
|
||||
@ -24,6 +25,8 @@ class IbpPan {
|
||||
// 展示的画布大小
|
||||
this.canvasSize = {};
|
||||
|
||||
this.optsPan = {};
|
||||
|
||||
this.initIbpPage(opts);
|
||||
}
|
||||
initIbpPage(opts) {
|
||||
@ -98,6 +101,7 @@ class IbpPan {
|
||||
if (this.$options.disabled == true) {
|
||||
this.$mouseController.disable();
|
||||
} else {
|
||||
opts = Object.assign(opts, this.optsPan);
|
||||
this.$mouseController.enable(opts);
|
||||
}
|
||||
|
||||
@ -135,8 +139,9 @@ class IbpPan {
|
||||
delete this.ibpDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
if (!elem._dispose) {
|
||||
this.ibpDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
// this.ibpDevice[code] = nDevice;
|
||||
this.mapDevice[code] = deepAssign(this.mapDevice[code] || {}, nDevice);
|
||||
this.$painter.add(this.mapDevice[code]);
|
||||
}
|
||||
});
|
||||
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
|
||||
@ -199,6 +204,13 @@ class IbpPan {
|
||||
this.$mouseController.setAllowDragging(true);
|
||||
}
|
||||
|
||||
setMoveOnMouseMove(data) {
|
||||
this.$mouseController.setMoveOnMouseMove(data);
|
||||
this.optsPan = {
|
||||
moveOnMouseMove: data || false
|
||||
};
|
||||
}
|
||||
|
||||
pullBack(payload) {
|
||||
if (payload.type === 'zoom') {
|
||||
const zrWidth = this.$ibpZr.getWidth();
|
||||
@ -277,12 +289,18 @@ class IbpPan {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.on(this.events.Selected, cb, context);
|
||||
break;
|
||||
case this.events.MouseDown:
|
||||
this.$mouseController.on(this.events.MouseDown, cb, context);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.on(this.events.DataZoom, cb, context);
|
||||
break;
|
||||
case this.events.__Pan:
|
||||
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -294,12 +312,18 @@ class IbpPan {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.off(this.events.Selected, cb);
|
||||
break;
|
||||
case this.events.MouseDown:
|
||||
this.$mouseController.off(this.events.MouseDown, cb);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.off(this.events.Contextmenu, cb);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.off(this.events.DataZoom, cb);
|
||||
break;
|
||||
case this.events.__Pan:
|
||||
this.$mouseController.off(this.events.__Pan, cb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,10 +43,11 @@ class MouseController extends Eventful {
|
||||
zr.on('contextmenu', this.contextmenu, this);
|
||||
zr.on('mousemove', this.moveEvent, this);
|
||||
zr.on('click', this.click, this);
|
||||
zr.on('mousedown', this.mousedown, this);
|
||||
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || false;
|
||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||
|
||||
this.disable();
|
||||
@ -72,6 +73,7 @@ class MouseController extends Eventful {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
zr.off('mousedown', this.mousedown);
|
||||
this.disable();
|
||||
};
|
||||
|
||||
@ -83,6 +85,10 @@ class MouseController extends Eventful {
|
||||
this.isAllowDragging = data;
|
||||
}
|
||||
|
||||
setMoveOnMouseMove(data) {
|
||||
this._moveOnMouseMove = data;
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
e.event.preventDefault();
|
||||
e.event.stopPropagation();
|
||||
@ -100,6 +106,7 @@ class MouseController extends Eventful {
|
||||
} else if (e.which === 2) {
|
||||
this.handleMouseDownWheel(e);
|
||||
}
|
||||
this.trigger(this.events.MouseDown, em);
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -140,6 +147,13 @@ class MouseController extends Eventful {
|
||||
if (this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
if (this.eventTarget.grouper) {
|
||||
if (e.target._subType == 'buttonImag') {
|
||||
this.targetView = this.checkEvent(e);
|
||||
this.targetView.eventTarget.close();
|
||||
this.boundingRect = {};
|
||||
}
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
@ -211,6 +225,14 @@ class MouseController extends Eventful {
|
||||
} else {
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
}
|
||||
if (this.eventTarget.grouper) {
|
||||
if (e.target._subType == 'buttonImag') {
|
||||
this.targetView = this.checkEvent(e);
|
||||
this.targetView.eventTarget.open();
|
||||
this.boundingRect = this.eventTarget.grouper.getBoundingRect();
|
||||
this.boundingRect = this.createFakeBoundingRect(this.eventTarget, this.boundingRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 处理滚轮按下事件 */
|
||||
handleMouseDownWheel(e) {
|
||||
@ -232,6 +254,19 @@ class MouseController extends Eventful {
|
||||
}
|
||||
/** 处理左键拖动事件--- 图形移动 */
|
||||
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
|
||||
if (this._dragging && this.eventTarget && this._moveOnMouseMove) {
|
||||
if (( this.eventTarget._type == deviceType.Background)) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
}
|
||||
}
|
||||
if (this.eventTarget.grouper) {
|
||||
const x = e.event.x + this.$ibp.$options.offsetX;
|
||||
const y = e.event.y + this.$ibp.$options.offsetY;
|
||||
if (!(x <= this.boundingRect.x2 && x >= this.boundingRect.x1 && y <= this.boundingRect.y2 && y >= this.boundingRect.y1)) {
|
||||
this.targetView.eventTarget.close();
|
||||
}
|
||||
}
|
||||
if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
|
||||
return;
|
||||
}
|
||||
@ -241,10 +276,7 @@ class MouseController extends Eventful {
|
||||
item.grouper.drift(dx, dy, e);
|
||||
});
|
||||
} else if (this._dragging && this.eventTarget) { // 选中元素图形移动
|
||||
if (( this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
} else if (this.isAllowDragging) {
|
||||
if (this.isAllowDragging && this.eventTarget.grouper) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as vector from 'zrender/src/core/vector';
|
||||
// import * as vector from 'zrender/src/core/vector';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import deviceType from './constant/deviceType';
|
||||
import shapefactory from './shape/factory';
|
||||
|
@ -11,108 +11,127 @@ import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png';
|
||||
import grayButtonPic from '@/assets/ibp_images/gray_button.png';
|
||||
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
|
||||
|
||||
const colors = new Map([
|
||||
['red_on', [redButtonPicOn]],
|
||||
['red_off', [redButtonPic]],
|
||||
['green_on', [greenButtonPicOn]],
|
||||
['green_off', [greenButtonPic]],
|
||||
['blue_on', [blueButtonPicOn]],
|
||||
['blue_off', [blueButtonPic]],
|
||||
['yellow_on', [yellowButtonPicOn]],
|
||||
['yellow_off', [yellowButtonPic]],
|
||||
['gray_on', [grayButtonPicOn]],
|
||||
['gray_off', [grayButtonPic]]
|
||||
]);
|
||||
export default class button extends Group {
|
||||
static colors = new Map([
|
||||
['red_on', [redButtonPicOn]],
|
||||
['red_off', [redButtonPic]],
|
||||
['green_on', [greenButtonPicOn]],
|
||||
['green_off', [greenButtonPic]],
|
||||
['blue_on', [blueButtonPicOn]],
|
||||
['blue_off', [blueButtonPic]],
|
||||
['yellow_on', [yellowButtonPicOn]],
|
||||
['yellow_off', [yellowButtonPic]],
|
||||
['gray_on', [grayButtonPicOn]],
|
||||
['gray_off', [grayButtonPic]]
|
||||
]);
|
||||
constructor(device) {
|
||||
super();
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getImagePic(),
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 70,
|
||||
height: 80
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.imageBg);
|
||||
this.add(this.grouper);
|
||||
this.transformScale();
|
||||
}
|
||||
constructor(device) {
|
||||
super();
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.imageBg = new Image({
|
||||
_subType: 'buttonImag',
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getImagePic(),
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 70,
|
||||
height: 80
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.imageBg);
|
||||
this.add(this.grouper);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [0, 0];
|
||||
this.imageBg.scale = [this.model.width / 70, this.model.width / 70];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [0, 0];
|
||||
this.imageBg.scale = [this.model.width / 70, this.model.width / 70];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getImagePic() {
|
||||
const color = button.colors.get(`${this.model.color}_${this.model.status}`);
|
||||
return color[0];
|
||||
}
|
||||
getImagePic() {
|
||||
const color = colors.get(`${this.model.color}_${this.model.status}`);
|
||||
return color[0];
|
||||
}
|
||||
|
||||
// 设置按钮状态
|
||||
setState(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 开放
|
||||
this.open();
|
||||
this.model.status = 'on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 关闭
|
||||
this.close();
|
||||
this.model.status = 'off';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设置按钮状态
|
||||
setState(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 开放
|
||||
this.open();
|
||||
this.model.status = 'on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 关闭
|
||||
this.close();
|
||||
this.model.status = 'off';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onclick() {
|
||||
// if (!this.model.draggable) {
|
||||
// switch (this.model.status) {
|
||||
// case 'off': {
|
||||
// this.open();
|
||||
// this.model.status='on';
|
||||
// break;
|
||||
// }
|
||||
// case 'on': {
|
||||
// this.close();
|
||||
// this.model.status='off';
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// 关闭
|
||||
close() {
|
||||
const color = button.colors.get(`${this.model.color}_off`);
|
||||
this.imageBg.setStyle({image: color[0]});
|
||||
}
|
||||
// 开放
|
||||
open() {
|
||||
const color = button.colors.get(`${this.model.color}_on`);
|
||||
this.imageBg.setStyle({image: color[0]});
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
// onmousedown() {
|
||||
// console.log('按下');
|
||||
// this.mouse = true;
|
||||
// this.model.status = 'on';
|
||||
// }
|
||||
// onmousemove(e) {
|
||||
// if (this.mouse) {
|
||||
// console.log(e, '元素移动');
|
||||
// }
|
||||
// }
|
||||
// onmouseup() {
|
||||
// if (this.mouse) {
|
||||
// console.log('抬起');
|
||||
// this.model.status = 'off';
|
||||
// this.mouse = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
onclick() {
|
||||
// if (!this.model.draggable) {
|
||||
// switch (this.model.status) {
|
||||
// case 'off': {
|
||||
// this.open();
|
||||
// this.model.status='on';
|
||||
// break;
|
||||
// }
|
||||
// case 'on': {
|
||||
// this.close();
|
||||
// this.model.status='off';
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// 关闭
|
||||
close() {
|
||||
const color = colors.get(`${this.model.color}_off`);
|
||||
this.imageBg.setStyle({image: color[0]});
|
||||
}
|
||||
// 开放
|
||||
open() {
|
||||
const color = colors.get(`${this.model.color}_on`);
|
||||
this.imageBg.setStyle({image: color[0]});
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
||||
|
@ -296,4 +296,9 @@ deviceRender[deviceType.IscsImage] = {
|
||||
zlevel: 1,
|
||||
z: 5
|
||||
};
|
||||
deviceRender[deviceType.OrdinaryDoor] = {
|
||||
_type: deviceType.OrdinaryDoor,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
export default deviceRender;
|
||||
|
@ -45,7 +45,8 @@ const deviceType = {
|
||||
Stairs: 'Stairs',
|
||||
Elevator: 'Elevator',
|
||||
Draught: 'Draught',
|
||||
IscsImage: 'IscsImage'
|
||||
IscsImage: 'IscsImage',
|
||||
OrdinaryDoor: 'ordinaryDoor'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -46,6 +46,7 @@ import Stairs from './bas/stairs';
|
||||
import Elevator from './bas/elevator';
|
||||
import Draught from './bas/draught';
|
||||
import IscsImage from './iscsImage';
|
||||
import OrdinaryDoor from './ordinaryDoor';
|
||||
|
||||
const iscsShape = {};
|
||||
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
|
||||
@ -96,6 +97,7 @@ iscsShape[deviceType.Stairs] = Stairs;
|
||||
iscsShape[deviceType.Elevator] = Elevator;
|
||||
iscsShape[deviceType.Draught] = Draught;
|
||||
iscsShape[deviceType.IscsImage] = IscsImage;
|
||||
iscsShape[deviceType.OrdinaryDoor] = OrdinaryDoor;
|
||||
|
||||
function shapefactory(device, iscs) {
|
||||
const type = device.model._type;
|
||||
|
105
src/iscs/shape/ordinaryDoor.js
Normal file
105
src/iscs/shape/ordinaryDoor.js
Normal file
@ -0,0 +1,105 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import Sector from 'zrender/src/graphic/shape/Sector';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
|
||||
export default class OrdinaryDoor extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.grouper = new Group({
|
||||
id: this.model.code,
|
||||
position: [this.model.point.x, this.model.point.y]
|
||||
});
|
||||
this.sector1 = new Sector({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
cx: this.model.point.x,
|
||||
cy: this.model.point.y - this.model.r,
|
||||
r: this.model.r,
|
||||
startAngle: Math.PI / 2,
|
||||
endAngle: Math.PI
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0, 0, 0, 0)',
|
||||
stroke: '#FFF',
|
||||
lineWidth: 1
|
||||
}
|
||||
});
|
||||
if (this.model.doorType === '1') {
|
||||
this.createLine(this.model.r);
|
||||
} else if (this.model.doorType === '2') {
|
||||
this.createSector2();
|
||||
this.createLine(this.model.r * 2);
|
||||
} else if (this.model.doorType === '3') {
|
||||
this.createRect(this.model.r);
|
||||
this.createLine(this.model.r);
|
||||
} else if (this.model.doorType === '4') {
|
||||
this.createSector2();
|
||||
this.createRect(this.model.r * 2);
|
||||
this.createLine(this.model.r * 2);
|
||||
}
|
||||
}
|
||||
createSector2() {
|
||||
this.sector2 = new Sector({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
cx: this.model.point.x + this.model.r * 2,
|
||||
cy: this.model.point.y,
|
||||
r: this.model.r,
|
||||
startAngle: 0,
|
||||
endAngle: Math.PI / 2
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0,0,0,0)',
|
||||
stroke: '#FFF',
|
||||
lineWidth: 1
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.sector2);
|
||||
}
|
||||
createLine(length) {
|
||||
this.maskLine = new Line({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: this.model.point.x,
|
||||
y1: this.model.point.y - this.model.r,
|
||||
x2: this.model.point.x + length,
|
||||
y2: this.model.point.y - this.model.r
|
||||
},
|
||||
style: {
|
||||
stroke: '#45607B',
|
||||
lineWidth: 2
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.maskLine);
|
||||
}
|
||||
createRect(length) {
|
||||
this.bottomRect = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y - this.model.r,
|
||||
width: length,
|
||||
height: this.model.r
|
||||
},
|
||||
style: {
|
||||
stroke: '#FFF',
|
||||
lineWidth: 1,
|
||||
fill: 'rgba(0, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.bottomRect);
|
||||
}
|
||||
}
|
@ -184,6 +184,9 @@ export function parser(data) {
|
||||
zrUtil.each(data.iscsImageList || [], elem => {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.IscsImage, elem);
|
||||
});
|
||||
zrUtil.each(data.ordinaryDoorList || [], elem => {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.OrdinaryDoor, elem);
|
||||
});
|
||||
}
|
||||
|
||||
return iscsDevice;
|
||||
|
@ -162,7 +162,7 @@ export function jl3dEditorLoader(mapid,scope){
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
|
||||
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
|
||||
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,mapdata.sectionList,mapdata.switchList,scene);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
|
@ -282,11 +282,12 @@ export function JLmap3dEdit(dom, data, mapid) {
|
||||
}
|
||||
|
||||
|
||||
this.vexscal = function(){
|
||||
this.vexscal = function(scalMode){
|
||||
scope.transcontrol.detach()
|
||||
this.scalswitch = true;
|
||||
if(scope.selectmodel.railpoint){
|
||||
scalControls.attach(scope.selectmodel,scope.selectmodel.railpoint);
|
||||
scalControls.updateDatalist(scope.mapdata.sectionlist.sections.datalist);
|
||||
scalControls.attach(scope.selectmodel,scope.selectmodel.railpoint,scalMode);
|
||||
}else{
|
||||
scalControls.attach(scope.selectmodel);
|
||||
}
|
||||
@ -315,6 +316,120 @@ export function JLmap3dEdit(dom, data, mapid) {
|
||||
// scope.mapdata.signallist.resetsignal(scope.mapdata.linklist);
|
||||
};
|
||||
|
||||
//区段跟左右相邻的区段对齐
|
||||
this.alignmentSection = function(alignmentCode,direct){
|
||||
let oldobject = scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh;
|
||||
let alignmentModel = scope.mapdata.sectionlist.sections.datalist[alignmentCode];
|
||||
let objectparent = oldobject.parent;
|
||||
objectparent.remove(oldobject);
|
||||
|
||||
let newRailPoint = [];
|
||||
if(direct == "left"){
|
||||
if(alignmentModel.lsection){
|
||||
let connectSectionCode = alignmentModel.lsection;
|
||||
let offsetX = alignmentModel.mesh.railpoint[0].x - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].x;
|
||||
let offsetY = alignmentModel.mesh.railpoint[0].y - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].y;
|
||||
let offsetZ = alignmentModel.mesh.railpoint[0].z - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].z;
|
||||
|
||||
alignmentModel.railpoint[0].x = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].x;
|
||||
alignmentModel.railpoint[0].y = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].y;
|
||||
alignmentModel.railpoint[0].z = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[2].z;
|
||||
|
||||
alignmentModel.railpoint[1].x -= offsetX;
|
||||
alignmentModel.railpoint[1].y -= offsetY;
|
||||
alignmentModel.railpoint[1].z -= offsetZ;
|
||||
|
||||
alignmentModel.railpoint[2].x -= offsetX;
|
||||
alignmentModel.railpoint[2].y -= offsetY;
|
||||
alignmentModel.railpoint[2].z -= offsetZ;
|
||||
|
||||
}
|
||||
}
|
||||
if(direct == "right"){
|
||||
if(alignmentModel.rsection){
|
||||
let connectSectionCode = alignmentModel.rsection;
|
||||
let offsetX = alignmentModel.mesh.railpoint[2].x - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].x;
|
||||
let offsetY = alignmentModel.mesh.railpoint[2].y - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].y;
|
||||
let offsetZ = alignmentModel.mesh.railpoint[2].z - scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].z;
|
||||
|
||||
alignmentModel.railpoint[2].x = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].x;
|
||||
alignmentModel.railpoint[2].y = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].y;
|
||||
alignmentModel.railpoint[2].z = scope.mapdata.sectionlist.sections.datalist[connectSectionCode].mesh.railpoint[0].z;
|
||||
|
||||
alignmentModel.railpoint[1].x -= offsetX;
|
||||
alignmentModel.railpoint[1].y -= offsetY;
|
||||
alignmentModel.railpoint[1].z -= offsetZ;
|
||||
|
||||
alignmentModel.railpoint[0].x -= offsetX;
|
||||
alignmentModel.railpoint[0].y -= offsetY;
|
||||
alignmentModel.railpoint[0].z -= offsetZ
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let newpointlist = [];
|
||||
for(let i=0;i<alignmentModel.railpoint.length;i++){
|
||||
newpointlist.push(new THREE.Vector3(alignmentModel.railpoint[i].x,alignmentModel.railpoint[i].y,alignmentModel.railpoint[i].z));
|
||||
}
|
||||
let closedSpline = new THREE.CatmullRomCurve3(newpointlist);
|
||||
closedSpline.type = 'catmullrom';
|
||||
closedSpline.closed = false;
|
||||
|
||||
let extrudeSettings = {
|
||||
steps : 5,
|
||||
curveSegments : 1,
|
||||
bevelSegments : 1,
|
||||
bevelEnabled : false,
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
|
||||
var shape = new THREE.Shape();
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
let selectmaterial = oldobject.material;
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
let newAlignmentSection = new THREE.Mesh( geometry, selectmaterial );
|
||||
newAlignmentSection.code = oldobject.code;
|
||||
newAlignmentSection.railpoint = [];
|
||||
for(let i=0;i<newpointlist.length;i++){
|
||||
newAlignmentSection.railpoint[i] = {
|
||||
x:newpointlist[i].x,
|
||||
y:newpointlist[i].y,
|
||||
z:newpointlist[i].z
|
||||
}
|
||||
}
|
||||
newAlignmentSection.lengthFact = closedSpline.arcLengthDivisions/4;
|
||||
if(newpointlist.length>2){
|
||||
newAlignmentSection.lengthFact = newAlignmentSection.lengthFact/5;
|
||||
}
|
||||
|
||||
let len = newAlignmentSection.lengthFact;
|
||||
// closedSpline.arcLengthDivisions;
|
||||
let count = newAlignmentSection.geometry.attributes.position.count/3;
|
||||
|
||||
for(let i=0;i<count;i++){
|
||||
let ui=i*6;
|
||||
if(i%2 != 0){
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui] = 0;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+1] = 1;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+2] = len;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+3] = 1;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+4] = len;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}else{
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui] = 0;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+1] = 0;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+2] = 0;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+3] = 1;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+4] = len;
|
||||
newAlignmentSection.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}
|
||||
}
|
||||
newAlignmentSection.meshtype = "section";
|
||||
scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh = newAlignmentSection;
|
||||
objectparent.add(newAlignmentSection);
|
||||
};
|
||||
|
||||
function onWindowResize() {
|
||||
//窗口自适应
|
||||
scope.camera.aspect = window.innerWidth / window.innerHeight;
|
||||
|
@ -331,11 +331,7 @@ export function SectionList() {
|
||||
console.log(stopsections[i]);
|
||||
if(stopsections[i+1] ){
|
||||
for(let j=0,lenj=stopsections[i].reals.length;j<lenj;j++){
|
||||
console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
|
||||
|
||||
console.log(stopsections[i].reals[j]);
|
||||
console.log(scope.sections.datalist);
|
||||
console.log(scope.sections.datalist[stopsections[i].reals[j].section.rightSectionCode]);
|
||||
let topnextpoint = {};
|
||||
|
||||
if(scope.sections.datalist[stopsections[i].reals[j].section.code].railpoint == 0){
|
||||
@ -388,14 +384,14 @@ export function SectionList() {
|
||||
assetloader.modellist[num2].mesh.rotation.x = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//根据站台区段创建站台位置 128停车点距离
|
||||
for(let j=0,lenj=stations.length;j<lenj;j++){
|
||||
// console.log(j);
|
||||
console.log(stations[j]);
|
||||
let direction1 = scope.sections.datalist[stations[j].stands[0].section];
|
||||
let direction2 = scope.sections.datalist[stations[j].stands[1].section];
|
||||
console.log(direction1);
|
||||
let x = direction1.railpoint[0].x+direction1.leftStopPointOffset+62;
|
||||
let x = direction1.railpoint[0].x+direction1.leftStopPointOffset+64;
|
||||
let z = (direction1.railpoint[0].z+direction2.railpoint[0].z)/2;
|
||||
let mesh;
|
||||
if(stations[j].stands[0].inside == true){
|
||||
@ -804,21 +800,16 @@ export function SectionList() {
|
||||
data.mesh = testmesh2;
|
||||
}
|
||||
|
||||
// var box = new THREE.BoxHelper( testmesh2, 0xffffff );
|
||||
// scope.sectiongroup.add( box );
|
||||
|
||||
}
|
||||
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,scene){
|
||||
// console.log("-------------------");
|
||||
// console.log(jlmap3ddata.sectionlist.sections.datalist);
|
||||
// console.log(sectiondata);
|
||||
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,section2d,switch2d,scene){
|
||||
|
||||
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' );
|
||||
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
||||
texture.repeat.set( 1,1);
|
||||
|
||||
var selectmaterial = new THREE.MeshPhongMaterial( { map: texture,transparent:true,alphaTest:0.1 } );
|
||||
|
||||
|
||||
scene.add(scope.sectiongroup);
|
||||
return new Promise(function(resolve, reject){
|
||||
for(let i=0,leni = sectiondata.length;i<leni;i++){
|
||||
@ -835,24 +826,14 @@ export function SectionList() {
|
||||
};
|
||||
|
||||
let testmesh2 = null;
|
||||
if(newsection.standTrack == true){
|
||||
|
||||
|
||||
}
|
||||
if(newsection.railpoint.length>2){
|
||||
|
||||
// console.log(newsection);
|
||||
console.log("=======================");
|
||||
if(newsection.code == "T27"){
|
||||
console.log(newsection.railpoint[0]);
|
||||
console.log(newsection.railpoint[1]);
|
||||
console.log(newsection.railpoint[2]);
|
||||
}
|
||||
let height = Math.random()/1000;
|
||||
var closedSpline = new THREE.CatmullRomCurve3( [
|
||||
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,height,newsection.railpoint[2].z)
|
||||
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
|
||||
] );
|
||||
closedSpline.type = 'catmullrom';
|
||||
closedSpline.closed = false;
|
||||
@ -864,8 +845,14 @@ export function SectionList() {
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
var shape = new THREE.Shape();
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
if(newsection.railpoint[0].y != newsection.railpoint[2].y){
|
||||
shape.moveTo( -2, 0 );
|
||||
shape.lineTo( 2, 0 );
|
||||
}else{
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
}
|
||||
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
|
||||
var randomMaterail = new THREE.MeshLambertMaterial({
|
||||
@ -874,15 +861,15 @@ export function SectionList() {
|
||||
});
|
||||
|
||||
if(newsection.standTrack == false){
|
||||
testmesh2 = new THREE.Mesh( geometry, randomMaterail );
|
||||
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
|
||||
}else{
|
||||
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
|
||||
}
|
||||
|
||||
testmesh2.railpoint = [
|
||||
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
|
||||
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[1].z},
|
||||
{x:newsection.railpoint[2].x,y:height,z:newsection.railpoint[2].z},
|
||||
{x:newsection.railpoint[0].x,y:newsection.railpoint[0].y,z:newsection.railpoint[0].z},
|
||||
{x:newsection.railpoint[1].x,y:newsection.railpoint[1].y,z:newsection.railpoint[1].z},
|
||||
{x:newsection.railpoint[2].x,y:newsection.railpoint[2].y,z:newsection.railpoint[2].z},
|
||||
];
|
||||
testmesh2.lengthFact = newsection.railpoint[2].x-newsection.railpoint[0].x;
|
||||
let len = testmesh2.lengthFact;
|
||||
@ -999,6 +986,100 @@ export function SectionList() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
for(let i=0;i<section2d.length;i++){
|
||||
if(section2d[i].type == "01" || section2d[i].type == "03"){
|
||||
scope.sections.datalist[section2d[i].code].rsection = section2d[i].rightSectionCode;
|
||||
scope.sections.datalist[section2d[i].code].lsection = section2d[i].leftSectionCode;
|
||||
scope.sections.datalist[section2d[i].code].points = section2d[i].points;
|
||||
scope.sections.datalist[section2d[i].code].pointslength = section2d[i].points.length-1;
|
||||
if(section2d[i].standTrack == true){
|
||||
|
||||
scope.sections.datalist[section2d[i].code].standLeftX = section2d[i].points[0].x;
|
||||
scope.sections.datalist[section2d[i].code].standLeftY = section2d[i].points[0].y;
|
||||
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
|
||||
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
|
||||
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
|
||||
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+124;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//连接区段
|
||||
for(let i=0;i<switch2d.length;i++){
|
||||
let acode = switch2d[i].sectionACode;
|
||||
let bcode = switch2d[i].sectionBCode;
|
||||
let ccode = switch2d[i].sectionCCode;
|
||||
// console.log(switchdata[i]);
|
||||
|
||||
|
||||
let aposx = (scope.sections.datalist[acode].points[0].x + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].x)/2;
|
||||
let cposx = (scope.sections.datalist[ccode].points[0].x + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].x)/2;
|
||||
|
||||
let aposy = (scope.sections.datalist[acode].points[0].y + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].y)/2;
|
||||
let cposy = (scope.sections.datalist[ccode].points[0].y + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].y)/2;
|
||||
|
||||
// console.log("----------------");
|
||||
if(aposx > cposx){
|
||||
if(aposy < cposy){
|
||||
// ——A
|
||||
// /C
|
||||
scope.sections.datalist[ccode].ctype = 1;
|
||||
}else{
|
||||
// \C
|
||||
// ——A
|
||||
scope.sections.datalist[ccode].ctype = 2;
|
||||
}
|
||||
}else{
|
||||
if(aposy < cposy){
|
||||
// A——
|
||||
// \C
|
||||
scope.sections.datalist[ccode].ctype = 3;
|
||||
}else{
|
||||
// /C
|
||||
// A——
|
||||
scope.sections.datalist[ccode].ctype = 4;
|
||||
}
|
||||
}
|
||||
|
||||
scope.sections.datalist[acode].csection = ccode;
|
||||
|
||||
if(scope.sections.datalist[ccode].ctype == 1 || scope.sections.datalist[ccode].ctype == 2){
|
||||
if(scope.sections.datalist[acode].lsection == "" || scope.sections.datalist[acode].lsection == undefined){
|
||||
scope.sections.datalist[acode].lsection = bcode;
|
||||
}
|
||||
|
||||
if(scope.sections.datalist[bcode].rsection == "" || scope.sections.datalist[bcode].rsection == undefined){
|
||||
scope.sections.datalist[bcode].rsection = acode;
|
||||
}
|
||||
|
||||
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
|
||||
scope.sections.datalist[ccode].rsection = acode;
|
||||
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
|
||||
scope.sections.datalist[ccode].lsection = acode;
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.sections.datalist[ccode].ctype == 3 || scope.sections.datalist[ccode].ctype == 4){
|
||||
if(scope.sections.datalist[acode].rsection == "" || scope.sections.datalist[acode].rsection == undefined){
|
||||
scope.sections.datalist[acode].rsection = bcode;
|
||||
}
|
||||
|
||||
if(scope.sections.datalist[bcode].lsection == "" ||scope.sections.datalist[bcode].lsection == undefined ){
|
||||
scope.sections.datalist[bcode].lsection = acode;
|
||||
}
|
||||
|
||||
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
|
||||
scope.sections.datalist[ccode].rsection = acode;
|
||||
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
|
||||
scope.sections.datalist[ccode].lsection = acode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
resolve("loadersection");
|
||||
});
|
||||
|
||||
|
@ -126,10 +126,9 @@ export function StationStandList() {
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
let newstationmesh;
|
||||
let stands = [];
|
||||
console.log("--------------------");
|
||||
for(let j=0;j<jlmapstanddata.length;j++){
|
||||
if(jlmapstanddata[j].stationCode == standsdata[i].code && jlmapstanddata[j].small != true){
|
||||
console.log(jlmapstanddata[j]);
|
||||
|
||||
let changestand = {
|
||||
code : jlmapstanddata[j].code,
|
||||
position : jlmapstanddata[j].position,
|
||||
|
@ -110,7 +110,7 @@ let views4 = [
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
@ -118,9 +118,9 @@ let views4 = [
|
||||
fov: 30
|
||||
},
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0.5,
|
||||
width: 0.5,
|
||||
left:0.25,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7,17,-4 ],
|
||||
@ -130,7 +130,7 @@ let views4 = [
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
@ -138,9 +138,9 @@ let views4 = [
|
||||
fov: 45
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0.5,
|
||||
width: 0.5,
|
||||
left: 0.75,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.7, 0.7 ),
|
||||
eye: [ -7,17,2],
|
||||
@ -154,7 +154,7 @@ let views2 = [
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
up: [3.7, 10 ,16 ],
|
||||
@ -164,16 +164,83 @@ let views2 = [
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
up: [ -59, 5.9,11 ],
|
||||
fov: 60
|
||||
},
|
||||
];
|
||||
export function Jl3dpassflow(dom,skinCode,routegroup) {
|
||||
let scope = this;
|
||||
|
||||
//
|
||||
// let views4 = [
|
||||
// {
|
||||
// left: 0,
|
||||
// bottom: 0,
|
||||
// width: 0.5,
|
||||
// height: 0.5,
|
||||
// background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
// eye: [ 3.7, 16, 26 ],
|
||||
// up: [3.7, 10 ,16 ],
|
||||
// fov: 30
|
||||
// },
|
||||
// {
|
||||
// left: 0,
|
||||
// bottom: 0.5,
|
||||
// width: 0.5,
|
||||
// height: 0.5,
|
||||
// background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
// eye: [ 3.7,17,-4 ],
|
||||
// up: [ 3.7, 10 ,16],
|
||||
// fov: 30
|
||||
// },
|
||||
// {
|
||||
// left: 0.5,
|
||||
// bottom: 0,
|
||||
// width: 0.5,
|
||||
// height: 0.5,
|
||||
// background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
// eye: [ -60, 6,11],
|
||||
// up: [ -59, 5.9,11 ],
|
||||
// fov: 45
|
||||
// },
|
||||
// {
|
||||
// left: 0.5,
|
||||
// bottom: 0.5,
|
||||
// width: 0.5,
|
||||
// height: 0.5,
|
||||
// background: new THREE.Color( 0.5, 0.7, 0.7 ),
|
||||
// eye: [ -7,17,2],
|
||||
// up: [-7, 10, 8],
|
||||
// fov: 60
|
||||
// }
|
||||
// ];
|
||||
//
|
||||
// let views2 = [
|
||||
// {
|
||||
// left: 0,
|
||||
// bottom: 0,
|
||||
// width: 0.5,
|
||||
// height: 1,
|
||||
// background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
// eye: [ 3.7, 16, 26 ],
|
||||
// up: [3.7, 10 ,16 ],
|
||||
// fov: 60
|
||||
// },
|
||||
// {
|
||||
// left: 0.5,
|
||||
// bottom: 0,
|
||||
// width: 0.5,
|
||||
// height: 1,
|
||||
// background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
// eye: [ -60, 6,11],
|
||||
// up: [ -59, 5.9,11 ],
|
||||
// fov: 60
|
||||
// },
|
||||
// ];
|
||||
export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
||||
let scope = this;
|
||||
initView(viewMap);
|
||||
this.dom = dom;
|
||||
this.nowcode = null;
|
||||
this.animateswitch = false;
|
||||
@ -440,6 +507,142 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
|
||||
animate();
|
||||
})
|
||||
});
|
||||
function initView(viewMap){
|
||||
if(viewMap == "normal"){
|
||||
views4 = [
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
up: [3.7, 10 ,16 ],
|
||||
fov: 30
|
||||
},
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0.5,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7,17,-4 ],
|
||||
up: [ 3.7, 10 ,16],
|
||||
fov: 30
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
up: [ -59, 5.9,11 ],
|
||||
fov: 45
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0.5,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.7, 0.7 ),
|
||||
eye: [ -7,17,2],
|
||||
up: [-7, 10, 8],
|
||||
fov: 60
|
||||
}
|
||||
];
|
||||
|
||||
views2 = [
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
up: [3.7, 10 ,16 ],
|
||||
fov: 60
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
up: [ -59, 5.9,11 ],
|
||||
fov: 60
|
||||
},
|
||||
];
|
||||
}else{
|
||||
views4 = [
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
up: [3.7, 10 ,16 ],
|
||||
fov: 30
|
||||
},
|
||||
{
|
||||
left:0.25,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7,17,-4 ],
|
||||
up: [ 3.7, 10 ,16],
|
||||
fov: 30
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
up: [ -59, 5.9,11 ],
|
||||
fov: 45
|
||||
},
|
||||
{
|
||||
left: 0.75,
|
||||
bottom: 0,
|
||||
width: 0.24,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.7, 0.7 ),
|
||||
eye: [ -7,17,2],
|
||||
up: [-7, 10, 8],
|
||||
fov: 60
|
||||
}
|
||||
];
|
||||
|
||||
views2 = [
|
||||
{
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.5, 0.5, 0.7 ),
|
||||
eye: [ 3.7, 16, 26 ],
|
||||
up: [3.7, 10 ,16 ],
|
||||
fov: 60
|
||||
},
|
||||
{
|
||||
left: 0.5,
|
||||
bottom: 0,
|
||||
width: 0.5,
|
||||
height: 0.5,
|
||||
background: new THREE.Color( 0.7, 0.5, 0.5 ),
|
||||
eye: [ -60, 6,11],
|
||||
up: [ -59, 5.9,11 ],
|
||||
fov: 60
|
||||
},
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
function inithumans(){
|
||||
originhuman1 = scope.modelmanager.man1.mesh;
|
||||
originhuman1.progress = 1;
|
||||
|
@ -266,33 +266,41 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
// }
|
||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||
trainlisttest.list[code].status = '1';
|
||||
if(trainlisttest.list[code].children[0].position.z != point.z){
|
||||
if(trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
||||
|
||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = rails.sectionrail[data.section].lineleft.getTangentAt(data.offset).normalize();
|
||||
trainlisttest.list[code].children[0].axis.crossVectors(trainlisttest.list[code].children[0].up, tangent).normalize();
|
||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||
|
||||
|
||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||
trainlisttest.list[code].children[0].rotation.y = 0;
|
||||
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
||||
let rotas = {
|
||||
posr:point,
|
||||
rota:trainlisttest.list[code].children[0].rotation.z
|
||||
roty:trainlisttest.list[code].children[0].rotation.y,
|
||||
rotz:trainlisttest.list[code].children[0].rotation.z
|
||||
}
|
||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||
|
||||
|
||||
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
|
||||
trainlisttest.list[code].children[0].position.z += offsetz;
|
||||
// let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
||||
// trainlisttest.list[code].children[0].position.y += offsety;
|
||||
}
|
||||
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
//console.log(rs);
|
||||
if(trainlisttest.list[code].children[rs].rotalist[0]){
|
||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
|
||||
|
||||
trainlisttest.list[code].children[rs].position.z += offsetz;
|
||||
// let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
||||
// trainlisttest.list[code].children[rs].position.y += offsety;
|
||||
|
||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||
@ -307,7 +315,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
}
|
||||
|
||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
||||
// trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||
xh--;
|
||||
}else{
|
||||
@ -348,7 +357,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
// trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||
trainlisttest.list[code].status = '0';
|
||||
|
||||
if(-trainlisttest.list[code].children[0].position.z != point.z){
|
||||
if(-trainlisttest.list[code].children[0].position.z != point.z || trainlisttest.list[code].children[0].position.y != point.y){
|
||||
|
||||
|
||||
trainlisttest.list[code].children[0].up = new THREE.Vector3(-1,0,0);
|
||||
@ -357,16 +366,21 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
let radians = Math.acos(trainlisttest.list[code].children[0].up.dot(tangent));
|
||||
trainlisttest.list[code].children[0].quaternion.setFromAxisAngle(trainlisttest.list[code].children[0].axis, radians);
|
||||
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
|
||||
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
|
||||
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
|
||||
trainlisttest.list[code].children[0].rotation.y = 0;
|
||||
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
|
||||
|
||||
let rotas = {
|
||||
posr:point,
|
||||
rota:trainlisttest.list[code].children[0].rotation.z
|
||||
roty:trainlisttest.list[code].children[0].rotation.y,
|
||||
rotz:trainlisttest.list[code].children[0].rotation.z
|
||||
}
|
||||
trainlisttest.list[code].children[1].rotalist.push(rotas);
|
||||
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
|
||||
trainlisttest.list[code].children[0].position.z -= offsetz;
|
||||
// let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
|
||||
// trainlisttest.list[code].children[0].position.y += offsety;
|
||||
// trainlisttest.list[code].position.z = point.z;
|
||||
|
||||
}
|
||||
@ -378,6 +392,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
|
||||
trainlisttest.list[code].children[rs].position.z -= offsetz;
|
||||
// let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
|
||||
// trainlisttest.list[code].children[rs].position.y += offsety;
|
||||
|
||||
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
|
||||
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
|
||||
@ -385,11 +401,10 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
if(rs != 5){
|
||||
let asd = trainlisttest.list[code].children[rs].rotalist[0];
|
||||
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
|
||||
|
||||
}
|
||||
//let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
|
||||
|
||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rota;
|
||||
// trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
|
||||
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
|
||||
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
|
||||
xh--;
|
||||
}else{
|
||||
|
@ -14,7 +14,7 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
var objectparent = null;
|
||||
var selectmaterial = null;
|
||||
var oldobject = null;
|
||||
|
||||
var sectionList = [];
|
||||
var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
|
||||
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
|
||||
|
||||
@ -58,7 +58,7 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
cube.name = "left";
|
||||
cubegroup.add( cube );
|
||||
_objects.push(cube);
|
||||
|
||||
let scalMode = null;
|
||||
|
||||
if ( _objects instanceof THREE.Camera ) {
|
||||
|
||||
@ -130,7 +130,12 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
|
||||
if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
|
||||
_selected.position.copy( _intersection.sub( _offset ).applyMatrix4( _inverseMatrix ) );
|
||||
_selected.position.y = 0;
|
||||
// if(scalMode == "plane"){
|
||||
// _selected.position.y = 0;
|
||||
// }else{
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
if(_movemesh.meshtype = "section"){
|
||||
newsectioncreate();
|
||||
@ -263,7 +268,6 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
|
||||
_selected = null;
|
||||
|
||||
console.log("mouseup");
|
||||
}
|
||||
|
||||
_domElement.style.cursor = _hovered ? 'pointer' : 'auto';
|
||||
@ -362,29 +366,56 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
for(let i=0;i<_movemesh.railpoint.length;i++){
|
||||
newpointlist.push(new THREE.Vector3(_movemesh.railpoint[i].x,_movemesh.railpoint[i].y,_movemesh.railpoint[i].z));
|
||||
}
|
||||
console.log(scalMode);
|
||||
|
||||
if(_movemesh.railpoint.length>2){
|
||||
if(scalMode == "plane"){
|
||||
if(_movemesh.railpoint.length>2){
|
||||
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
}
|
||||
if(_selected.name == "mid"){
|
||||
newpointlist[1] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[1].y,_selected.position.z);
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[2] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[2].y,_selected.position.z);
|
||||
}
|
||||
curvestep = 10;
|
||||
}else{
|
||||
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[1] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[1].y,_selected.position.z);
|
||||
}
|
||||
curvestep =1;
|
||||
}
|
||||
if(_selected.name == "mid"){
|
||||
newpointlist[1] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[2] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
}
|
||||
curvestep = 10;
|
||||
}else{
|
||||
if(_movemesh.railpoint.length>2){
|
||||
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_movemesh.railpoint[0].x,_selected.position.y,_movemesh.railpoint[0].z);
|
||||
}
|
||||
if(_selected.name == "mid"){
|
||||
newpointlist[1] = new THREE.Vector3(_movemesh.railpoint[1].x,_selected.position.y,_movemesh.railpoint[1].z);
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[2] = new THREE.Vector3(_movemesh.railpoint[2].x,_selected.position.y,_movemesh.railpoint[2].z);
|
||||
}
|
||||
curvestep = 10;
|
||||
}else{
|
||||
|
||||
if(_selected.name == "left"){
|
||||
newpointlist[0] = new THREE.Vector3(_movemesh.railpoint[0].x,_selected.position.y,_movemesh.railpoint[0].z);
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[1] = new THREE.Vector3(_movemesh.railpoint[1].x,_selected.position.y,_movemesh.railpoint[1].z);
|
||||
}
|
||||
curvestep =1;
|
||||
}
|
||||
if(_selected.name == "right"){
|
||||
newpointlist[1] = new THREE.Vector3(_selected.position.x,_movemesh.railpoint[0].y,_selected.position.z);
|
||||
}
|
||||
curvestep =1;
|
||||
}
|
||||
|
||||
closedSpline = new THREE.CatmullRomCurve3(newpointlist);
|
||||
closedSpline.type = 'catmullrom';
|
||||
closedSpline.closed = false;
|
||||
@ -398,8 +429,16 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
};
|
||||
|
||||
var shape = new THREE.Shape();
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
if(newpointlist[0].y != newpointlist[2].y){
|
||||
shape.moveTo( -2, 0 );
|
||||
shape.lineTo( 2, 0 );
|
||||
}else{
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
selectmaterial = _movemesh.material;
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
_movemesh = new THREE.Mesh( geometry, selectmaterial );
|
||||
@ -440,6 +479,8 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
}
|
||||
}
|
||||
_movemesh.meshtype = "section";
|
||||
sectionList[_movemesh.code].mesh = _movemesh;
|
||||
sectionList[_movemesh.code].railpoint = _movemesh.railpoint;
|
||||
// _movemesh.geometry.computeBoundingBox();
|
||||
// _movemesh.geometry.center()
|
||||
// _movemesh.position.set(oldobject.position.x,oldobject.position.y,oldobject.position.z);
|
||||
@ -458,8 +499,12 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
this.deactivate = deactivate;
|
||||
this.dispose = dispose;
|
||||
|
||||
this.updateDatalist = function(sectionDataList){
|
||||
sectionList = sectionDataList;
|
||||
}
|
||||
// Backward compatibility
|
||||
this.attach = function(movemesh,points){
|
||||
this.attach = function(movemesh,points,mode){
|
||||
scalMode = mode;
|
||||
if(!helpmove){
|
||||
if(points){
|
||||
|
||||
|
@ -162,12 +162,12 @@ THREE.TransformControls = function ( camera, domElement ) {
|
||||
|
||||
let len = object.railpoint.length-1;
|
||||
|
||||
cube1.position.set(object.railpoint[0].x-object.position.x,0,object.railpoint[0].z-object.position.z);
|
||||
cube3.position.set(object.railpoint[len].x-object.position.x,0,object.railpoint[len].z-object.position.z);
|
||||
cube1.position.set(object.railpoint[0].x-object.position.x,object.railpoint[0].y,object.railpoint[0].z-object.position.z);
|
||||
cube3.position.set(object.railpoint[len].x-object.position.x,object.railpoint[len].y,object.railpoint[len].z-object.position.z);
|
||||
atobject.add(cube1);
|
||||
atobject.add(cube3);
|
||||
if(object.railpoint.length>2){
|
||||
cube2.position.set(object.railpoint[1].x-object.position.x,0,object.railpoint[1].z-object.position.z);
|
||||
cube2.position.set(object.railpoint[1].x-object.position.x,object.railpoint[1].y,object.railpoint[1].z-object.position.z);
|
||||
atobject.add(cube2);
|
||||
virtualmovebox.position.set(cube2.position.x,cube2.position.y,cube2.position.z);
|
||||
}else{
|
||||
|
@ -231,14 +231,15 @@ export function RailListN(){
|
||||
}
|
||||
|
||||
scope.sectionrail[sectioncode].lineleft = new THREE.CatmullRomCurve3(leftpoints);
|
||||
scope.sectionrail[sectioncode].lineleft.curveType = "centripetal";
|
||||
scope.sectionrail[sectioncode].lineleft.type = "catmullrom";
|
||||
scope.sectionrail[sectioncode].lineleft.closed = false;
|
||||
scope.sectionrail[sectioncode].lineleft.name = sectioncode;
|
||||
|
||||
scope.sectionrail[sectioncode].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
||||
scope.sectionrail[sectioncode].lineright.curveType = "centripetal";
|
||||
scope.sectionrail[sectioncode].lineright.type = "catmullrom";
|
||||
scope.sectionrail[sectioncode].lineright.closed = false;
|
||||
scope.sectionrail[sectioncode].lineright.name = sectioncode;
|
||||
|
||||
// //
|
||||
// for(let n=0,nm=scope.sectionrail[sectioncode].lineleft.points.length;n<nm;n++){
|
||||
// var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
|
@ -100,9 +100,9 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
|
||||
// console.log(newsection);
|
||||
let height = Math.random()/1000;
|
||||
var closedSpline = new THREE.CatmullRomCurve3( [
|
||||
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,height,newsection.railpoint[2].z)
|
||||
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
|
||||
] );
|
||||
|
||||
closedSpline.type = 'catmullrom';
|
||||
@ -115,8 +115,15 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
var shape = new THREE.Shape();
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
|
||||
if(newsection.railpoint[0].y != newsection.railpoint[2].y){
|
||||
console.log(newsection);
|
||||
shape.moveTo( -2, 0 );
|
||||
shape.lineTo( 2, 0 );
|
||||
}else{
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
}
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
var mesh = new THREE.Mesh( geometry, selectmaterial );
|
||||
let count = mesh.geometry.attributes.position.count/3;
|
||||
@ -155,15 +162,14 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
|
||||
closedSpline.closed = false;
|
||||
// Set up settings for later extrusion
|
||||
var extrudeSettings = {
|
||||
steps : 1,
|
||||
steps : 5,
|
||||
curveSegments : 1,
|
||||
bevelSegments : 1,
|
||||
bevelEnabled : false,
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
var shape = new THREE.Shape();
|
||||
shape.moveTo( -2,0 );
|
||||
shape.lineTo( 2,0 );
|
||||
|
||||
// Extrude the triangle along the CatmullRom curve
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
var mesh = new THREE.Mesh( geometry, selectmaterial );
|
||||
|
@ -211,9 +211,7 @@ export function StationStandListN() {
|
||||
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
for(let m=0;m<newstationstand.stands.length;m++){
|
||||
console.log("====================");
|
||||
console.log(newstationstand.stands[m]);
|
||||
console.log(psddata[n]);
|
||||
|
||||
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == false){
|
||||
|
||||
let key = psddata[n].code;
|
||||
@ -241,9 +239,7 @@ export function StationStandListN() {
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
for(let m=0;m<newstationstand.stands.length;m++){
|
||||
console.log("====================");
|
||||
console.log(newstationstand.stands[m]);
|
||||
console.log(psddata[n]);
|
||||
|
||||
if(psddata[n].standCode == newstationstand.stands[m].code && newstationstand.stands[m].right == true){
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
|
@ -210,6 +210,13 @@ export function TrainListN() {
|
||||
|
||||
fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
|
||||
// ntracks2 = assetloader.modellist[n].animations.slice(6,13);
|
||||
//
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
//
|
||||
// ntracks1 = assetloader.modellist[n].animations.slice(0,5);
|
||||
//
|
||||
// tclip = new THREE.AnimationClip("three",2,ntracks1);
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 10, // 文字离区段距离
|
||||
fontSize: 12, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: 'lightgreen', // 字体颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
@ -27,7 +27,7 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 12, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
@ -38,8 +38,8 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 24, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
@ -49,8 +49,8 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 36, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
@ -60,8 +60,8 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 36, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
@ -71,8 +71,8 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 12, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'bold', // 字体粗细
|
||||
fontColor: 'yellow', // 字体颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
fontColor: '#000', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
@ -314,7 +314,7 @@ class SkinCode extends defaultStyle {
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
offset: { x: 5, y: -10 }, // 道岔名称与区段距离
|
||||
fontSize: 12, // 字体大小
|
||||
fontColor: '#C0C0C0', // 道岔名称颜色
|
||||
fontColor: '#333', // 道岔名称颜色
|
||||
fontWeight: '600', // 字体粗细
|
||||
borderColor: '#FE0000', // 道岔名称边框颜色
|
||||
lossColor: 'lightgreen', // 道岔名称失去颜色
|
||||
|
@ -23,32 +23,34 @@ export default class ELimitLines extends Group {
|
||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||
if (x == Infinity) { x = 0; }
|
||||
if (y == Infinity) { y = 0; }
|
||||
// 上侧临时限速线
|
||||
const speedLimitLeft = this.createLimit({
|
||||
position: [x, -y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
// 下侧临时限速线
|
||||
const speedLimitRight = this.createLimit({
|
||||
position: [-x, y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
speedLimitLeft.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
speedLimitRight.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
if (model.switch) {
|
||||
// 上侧临时限速线
|
||||
const speedLimitLeft = this.createLimit({
|
||||
position: [x, -y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
// 下侧临时限速线
|
||||
const speedLimitRight = this.createLimit({
|
||||
position: [-x, y],
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
speedLimitLeft.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
speedLimitRight.forEach(item => {
|
||||
this.add(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ const PracticeDisplayNew = () => import('@/views/competitionManage/practiceList/
|
||||
|
||||
const IbpHome = () => import('@/views/ibp/home');
|
||||
const IbpDraw = () => import('@/views/ibp/ibpDraw/index');
|
||||
const IbpShow = () => import('@/views/ibp/ibpsystem/index');
|
||||
|
||||
const TeachDetail = () => import('@/views/teach/detail/index');
|
||||
const TeachHome = () => import('@/views/teach/index');
|
||||
@ -278,6 +279,11 @@ export const publicAsyncRoute = [
|
||||
component: Display,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/ibpShow',
|
||||
component: IbpShow,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/displayNew/:mode',
|
||||
component: DisplayNew,
|
||||
|
@ -2198,14 +2198,25 @@ export function checkOperationIsCurrentOperate(operation, operate) {
|
||||
* ibp操作
|
||||
*/
|
||||
export const IbpOperation = {
|
||||
Up_Hold_Train: {operate: '01', event: 'UpHoldTrain'},
|
||||
Up_Cancel_Hold_Train: {operate: '02', event: 'UpCancelHoldTrain'},
|
||||
Down_Hold_Train: {operate: '03', event: 'DownHoldTrain'},
|
||||
Down_Cancel_Hold_Train: {operate: '04', event: 'DownCancelHoldTrain'},
|
||||
Up_Open_Screen_Door: {operate: '05', event: 'UpOpenScreenDoor'},
|
||||
Down_Open_Screen_Door: {operate: '06', event: 'DownOpenScreenDoor'},
|
||||
Ban_Up_Open_Screen_Door: {operate: '', event: 'BanUpOpenScreenDoor'},
|
||||
Ban_Down_Open_Screen_Door: {operate: '', event: 'BanDownOpenScreenDoor'}
|
||||
// Up_Hold_Train: {operate: '01', event: 'UpHoldTrain'},
|
||||
// Up_Cancel_Hold_Train: {operate: '02', event: 'UpCancelHoldTrain'},
|
||||
// Down_Hold_Train: {operate: '03', event: 'DownHoldTrain'},
|
||||
// Down_Cancel_Hold_Train: {operate: '04', event: 'DownCancelHoldTrain'},
|
||||
// Up_Open_Screen_Door: {operate: '05', event: 'UpOpenScreenDoor'},
|
||||
// Down_Open_Screen_Door: {operate: '06', event: 'DownOpenScreenDoor'},
|
||||
// Ban_Up_Open_Screen_Door: {operate: '', event: 'BanUpOpenScreenDoor'},
|
||||
// Ban_Down_Open_Screen_Door: {operate: '', event: 'BanDownOpenScreenDoor'}
|
||||
XXKC: {operate: '01', event: 'XXKC', name: '下行扣车'},
|
||||
XXZZKC: {operate: '02', event: 'XXZZKC', name: '下行终止扣车'},
|
||||
SXKC: {operate: '03', event: 'SXKC', name: '上行扣车'},
|
||||
SXZZKC: {operate: '04', event: 'SXZZKC', name: '上行终止扣车'},
|
||||
JJTC: {operate: '05', event: 'JJTC', name: '紧急停车'},
|
||||
QXJJTC: {operate: '06', event: 'QXJJTC', name: '取消紧急停车'},
|
||||
BJQC: {operate: '07', event: 'BJQC', name: '报警切除'},
|
||||
XXKM: {operate: '08', event: 'XXKM', name: '下行屏蔽门开门'},
|
||||
SXKM: {operate: '10', event: 'SXKM', name: '上行屏蔽门开门'},
|
||||
XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'},
|
||||
SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'}
|
||||
};
|
||||
/**
|
||||
* ibp状态显示条件
|
||||
|
@ -66,6 +66,7 @@ function queryDeleteModels(state, device, dict) {
|
||||
copyModel.isSwitchSection = false;
|
||||
copyModel.switchSection = false;
|
||||
copyModel.type = '01';
|
||||
copyModel.name = copyModel.name.split('-')[0];
|
||||
dict[elem.code] = copyModel;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ const training = {
|
||||
memberData: {}, // 综合仿真成员列表
|
||||
simulationUserList: [], // 综合仿真用户列表
|
||||
orignalUserRoleId:'', // 设置旧的角色的id
|
||||
scriptQuitCount: 0 // 主动退出剧本
|
||||
scriptQuitCount: 0, // 主动退出剧本
|
||||
scriptOperationType: '' // 剧本操作类型
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -107,6 +108,9 @@ const training = {
|
||||
},
|
||||
scriptQuitCount: (state) => {
|
||||
return state.scriptQuitCount;
|
||||
},
|
||||
scriptOperationType: (state) => {
|
||||
return state.scriptOperationType;
|
||||
}
|
||||
},
|
||||
|
||||
@ -297,6 +301,9 @@ const training = {
|
||||
},
|
||||
setScriptQuit: (state) => {
|
||||
state.scriptQuitCount++;
|
||||
},
|
||||
setScriptOperationType: (state, scriptOperationType) => {
|
||||
state.scriptOperationType = scriptOperationType;
|
||||
}
|
||||
},
|
||||
|
||||
@ -726,6 +733,10 @@ const training = {
|
||||
/** 剧本仿真 设置旧的角色的id */
|
||||
setOrignalUserRoleId:({ commit }, data) => {
|
||||
commit('setOrignalUserRoleId', data);
|
||||
},
|
||||
/** 操作剧本类型(教学、练习、考试)*/
|
||||
setScriptOperationType: ({ commit }, data) => {
|
||||
commit('setScriptOperationType', data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -27,7 +27,6 @@
|
||||
|
||||
<script>
|
||||
import Question from '@/views/jsxt/competition/theory/quiz/question';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Question
|
||||
|
@ -73,8 +73,8 @@ export default {
|
||||
{
|
||||
name: '发布',
|
||||
handleClick: this.publishScript,
|
||||
type: 'primary',
|
||||
showControl: (row) => { return !row.publish; }
|
||||
type: 'primary'
|
||||
// showControl: (row) => { return !row.publish; }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -54,12 +54,15 @@ export default {
|
||||
buttonText: this.$t('ibp.createNow'),
|
||||
showDeleteButton: false,
|
||||
operateMeanList: [
|
||||
{ label: '上行扣车', value: 'Up_Hold_Train' },
|
||||
{ label: '下行扣车', value: 'Down_Hold_Train' },
|
||||
{ label: '上行取消扣车', value: 'Up_Cancel_Hold_Train' },
|
||||
{ label: '下行取消扣车', value: 'Down_Cancel_Hold_Train' },
|
||||
{ label: '上行打开屏蔽门', value: 'Up_Open_Screen_Door' },
|
||||
{ label: '下行打开屏蔽门', value: 'Down_Open_Screen_Door' }
|
||||
{ label: '上行扣车', value: 'SXKC' },
|
||||
{ label: '下行扣车', value: 'XXKC' },
|
||||
{ label: '上行终止扣车', value: 'SXZZKC' },
|
||||
{ label: '下行终止扣车', value: 'XXZZKC' },
|
||||
{ label: '紧急停车', value: 'JJTC' },
|
||||
{ label: '取消紧急停车', value: 'QXJJTC' },
|
||||
{ label: '报警切除', value: 'BJQC' },
|
||||
{ label: '下行屏蔽门开门', value: 'XXKM' },
|
||||
{ label: '上行屏蔽门开门', value: 'SXKM' }
|
||||
],
|
||||
form: {
|
||||
code: '',
|
||||
@ -116,7 +119,7 @@ export default {
|
||||
color: this.form.buttonColor,
|
||||
status: 'off',
|
||||
width: this.form.buttonWidth,
|
||||
mean: this.from.mean
|
||||
mean: this.form.mean
|
||||
};
|
||||
this.$emit('createData', buttonModel);
|
||||
this.initPage();
|
||||
|
@ -66,8 +66,8 @@ export default {
|
||||
bottomText:''
|
||||
},
|
||||
operateMeanList: [
|
||||
{ label: '上行屏蔽门操作开关', value: 'Ban_Up_Open_Screen_Door' },
|
||||
{ label: '下行屏蔽门操作开关', value: 'Ban_Down_Open_Screen_Door' }
|
||||
{ label: '上行钥匙', value: 'SXYS' },
|
||||
{ label: '下行钥匙', value: 'XXYS' }
|
||||
],
|
||||
rules: {
|
||||
code: [
|
||||
|
@ -49,6 +49,7 @@ export default {
|
||||
mounted() {
|
||||
this.$refs.ibpPlate.show();
|
||||
this.$refs.ibpPlate.drawIbpInit();
|
||||
this.$refs.ibpPlate.setMoveInit(true);
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
@ -57,11 +58,13 @@ export default {
|
||||
ibpChange(stationCode) {
|
||||
this.$refs.ibpPlate.show(stationCode);
|
||||
this.$refs.ibpPlate.drawIbpInit();
|
||||
this.$refs.ibpPlate.setMoveInit(true);
|
||||
},
|
||||
setIbpShow(data) {
|
||||
const newData = parser(data, {width: this.canvasWidth, height: this.canvasHeight});
|
||||
this.$refs.ibpPlate.setIbp(newData, data);
|
||||
this.$refs.ibpPlate.drawIbpInit();
|
||||
this.$refs.ibpPlate.setMoveInit(true);
|
||||
},
|
||||
setEmptyShow() {
|
||||
this.$nextTick(() => { // 执行一次 微任务 等待this.$ibp加载完成
|
||||
|
@ -86,9 +86,14 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
this.setWindowSize();
|
||||
this.initIbp();
|
||||
if (this.$route.query.loadAll && this.$route.query.stationCode) {
|
||||
await this.show(this.$route.query.stationCode);
|
||||
await this.setMoveInit(true);
|
||||
this.showBackButton = false;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.ibpDestroy();
|
||||
@ -117,6 +122,7 @@ export default {
|
||||
this.$ibp.on('contextmenu', this.onContextMenu, this);
|
||||
if (this.$route.query.group) {
|
||||
this.$ibp.on('selected', this.onSelected, this);
|
||||
this.$ibp.on('mouseDown', this.onMouseDown, this);
|
||||
}
|
||||
},
|
||||
async show (deviceCode, ibpPart) {
|
||||
@ -171,43 +177,27 @@ export default {
|
||||
},
|
||||
handleBanOpenScreenDoorStatus() {
|
||||
this.$store.state.ibp.ibp['keyList'].forEach(item => {
|
||||
if (item.mean === 'Ban_Down_Open_Screen_Door') {
|
||||
if (item.mean === 'SXYS') {
|
||||
item.status === 'on' ? this.banDownOpenScreenDoor = false : this.banDownOpenScreenDoor = true;
|
||||
} else if (item.mean === 'Ban_Up_Open_Screen_Door') {
|
||||
} else if (item.mean === 'XXYS') {
|
||||
item.status === 'on' ? this.banUpOpenScreenDoor = false : this.banUpOpenScreenDoor = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击选择事件
|
||||
onSelected(em) {
|
||||
|
||||
},
|
||||
onMouseDown(em) {
|
||||
if (em.deviceModel.mean) {
|
||||
if (IbpOperation[em.deviceModel.mean]) {
|
||||
switch (IbpOperation[em.deviceModel.mean].event) {
|
||||
case 'UpHoldTrain':
|
||||
case 'UpCancelHoldTrain':
|
||||
case 'DownHoldTrain':
|
||||
case 'DownCancelHoldTrain':
|
||||
handlerIbpEvent(this.$route.query.group, {operate: IbpOperation[em.deviceModel.mean].operate, stationCode: this.stationCode});
|
||||
break;
|
||||
case 'BanUpOpenScreenDoor':
|
||||
this.banUpOpenScreenDoor = !this.banUpOpenScreenDoor;
|
||||
break;
|
||||
case 'BanDownOpenScreenDoor':
|
||||
this.banDownOpenScreenDoor = !this.banDownOpenScreenDoor;
|
||||
break;
|
||||
case 'UpOpenScreenDoor':
|
||||
this.openScreenDoor(this.banUpOpenScreenDoor, IbpOperation[em.deviceModel.mean].operate);
|
||||
break;
|
||||
case 'DownOpenScreenDoor':
|
||||
this.openScreenDoor(this.banDownOpenScreenDoor, IbpOperation[em.deviceModel.mean].operate);
|
||||
break;
|
||||
}
|
||||
handlerIbpEvent(this.$route.query.group, {button: IbpOperation[em.deviceModel.mean].event, stationCode: this.stationCode});
|
||||
}
|
||||
}
|
||||
},
|
||||
openScreenDoor(flag, operate) {
|
||||
openScreenDoor(flag, buttonOperate) {
|
||||
if (flag) {
|
||||
handlerIbpEvent(this.$route.query.group, {operate: operate, stationCode: this.stationCode});
|
||||
handlerIbpEvent(this.$route.query.group, {button: buttonOperate, stationCode: this.stationCode});
|
||||
}
|
||||
},
|
||||
// 右键点击事件
|
||||
@ -219,6 +209,10 @@ export default {
|
||||
this.$ibp && this.$ibp.drawIbpInit();
|
||||
this.showBackButton = false;
|
||||
},
|
||||
// 地图可拖拽
|
||||
setMoveInit(data) {
|
||||
this.$ibp && this.$ibp.setMoveOnMouseMove(data);
|
||||
},
|
||||
// 初始化电子表时间
|
||||
initClockTime(initTime) {
|
||||
this.$ibp.initClockTime(initTime);
|
||||
|
@ -451,6 +451,102 @@ export default {
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '自动售检票/门禁',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: '',
|
||||
children: [
|
||||
{
|
||||
name: '自动售检票系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '门禁系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '火灾报警系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: '',
|
||||
children: [
|
||||
{
|
||||
name: '火灾报警系统-FAS联动',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '火灾报警系统-站厅层',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '火灾报警系统-站台层',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '火灾报警系统-区间',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '感温光纤探测系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '气体灭火系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '信号系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: '',
|
||||
children: [
|
||||
{
|
||||
name: 'TIS管理器',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '列车时刻表',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '信号系统',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '全线信号系统界面',
|
||||
mode: '',
|
||||
id: '',
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
},
|
||||
|
@ -50,6 +50,14 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-table-column label="扇门" name="ordinaryDoor">
|
||||
<ordinary-door
|
||||
ref="ordinaryDoor"
|
||||
style="width: 100%;height: 100%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-table-column>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
@ -62,6 +70,7 @@ import IscsButton from '../iscsCommonElem/button';
|
||||
import IscsLine from '../iscsCommonElem/line';
|
||||
import IscsText from '../iscsCommonElem/text';
|
||||
import IscsRect from '../iscsCommonElem/rect';
|
||||
import OrdinaryDoor from '../iscsCommonElem/ordinaryDoor';
|
||||
|
||||
export default {
|
||||
name: 'IscsAcsOperate',
|
||||
@ -70,7 +79,8 @@ export default {
|
||||
IscsButton,
|
||||
IscsLine,
|
||||
IscsText,
|
||||
IscsRect
|
||||
IscsRect,
|
||||
OrdinaryDoor
|
||||
},
|
||||
mixins: [
|
||||
],
|
||||
|
149
src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue
Normal file
149
src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue
Normal file
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
||||
<el-form-item label="类型:" prop="width">
|
||||
<el-select v-model="form.doorType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="门半径:" prop="height">
|
||||
<el-input-number v-model="form.r" controls-position="right" :min="1" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="旋转角度:">
|
||||
<el-input-number v-model="form.rotationAngle" size="small" :min="0" :max="360" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X轴坐标:">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Y轴坐标:">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
|
||||
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'OrdinaryDoor',
|
||||
data() {
|
||||
return {
|
||||
form:{
|
||||
code: '',
|
||||
doorType: '1',
|
||||
r: 1,
|
||||
rotationAngle: 0,
|
||||
x: 10,
|
||||
y: 10
|
||||
},
|
||||
options: [
|
||||
{label: '单扇无矩形', value: '1'},
|
||||
{label: '双扇无矩形', value: '2'},
|
||||
{label: '单扇有矩形', value: '3'},
|
||||
{label: '双扇有矩形', value: '4'}
|
||||
],
|
||||
isUpdate: false,
|
||||
buttonText: '立即创建',
|
||||
showDeleteButton: false
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
...mapGetters('iscs', [
|
||||
'iscs'
|
||||
])
|
||||
},
|
||||
watch:{
|
||||
'$store.state.iscs.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['iscs/updateDeviceData'];
|
||||
if (model._type === 'OrdinaryDoor' ) {
|
||||
this.buttonText = '修改';
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.form.code = model.code;
|
||||
this.form.x = model.point.x;
|
||||
this.form.y = model.point.y;
|
||||
this.form.r = model.r;
|
||||
this.form.rotationAngle = model.rotationAngle;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
onSubmit(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = {
|
||||
point: {
|
||||
x: this.form.x1,
|
||||
y: this.form.y1
|
||||
},
|
||||
code: this.isUpdate ? this.form.code : getUID('OrdinaryDoor', this.iscs.ordinaryDoorList),
|
||||
_type: 'OrdinaryDoor',
|
||||
lineWidth: this.form.lineWidth,
|
||||
fillColor: this.form.fillColor,
|
||||
classify: this.form.classify,
|
||||
arrowShow: this.form.arrowShow,
|
||||
arrowSize: this.form.arrowSize
|
||||
};
|
||||
this.$emit('createDataModel', model);
|
||||
this.initPage();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDevice() {
|
||||
const lineModel = {
|
||||
point1: {
|
||||
x: this.form.x1,
|
||||
y: this.form.y1
|
||||
},
|
||||
point2: {
|
||||
x: this.form.x2,
|
||||
y: this.form.y2
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IscsLine',
|
||||
lineWidth: this.form.lineWidth,
|
||||
fillColor: this.form.fillColor,
|
||||
classify: this.form.classify,
|
||||
arrowShow: this.form.arrowShow,
|
||||
arrowSize: this.form.arrowSize
|
||||
};
|
||||
this.$emit('deleteDataModel', lineModel);
|
||||
},
|
||||
initPage() {
|
||||
this.isUpdate = false;
|
||||
this.buttonText = '立即创建';
|
||||
this.showDeleteButton = false;
|
||||
this.form = {
|
||||
code: '',
|
||||
lineWidth: '',
|
||||
fillColor: '#fff',
|
||||
arrowShow: 'none',
|
||||
arrowSize: 5,
|
||||
x1: 10,
|
||||
y1: 10,
|
||||
x2: 20,
|
||||
y2: 10,
|
||||
classify:'solid'
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -8,7 +8,7 @@
|
||||
|
||||
<el-button type="transscal" @click="transscal">放大缩小</el-button>
|
||||
|
||||
<el-button type="vexscal" @click="vexscal">拉伸</el-button>
|
||||
|
||||
|
||||
<el-button type="testrail" @click="testrail">测试轨迹</el-button>
|
||||
|
||||
@ -57,9 +57,6 @@ export default {
|
||||
async transscal(){
|
||||
this.$emit('transscal');
|
||||
},
|
||||
async vexscal(){
|
||||
this.$emit('vexscal');
|
||||
},
|
||||
async testrail(){
|
||||
this.$emit('testrail');
|
||||
},
|
||||
|
@ -45,6 +45,13 @@
|
||||
<el-input ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-button v-if="selectmodel.meshtype == 'section'" @click="leftAlignment">区段左对齐</el-button>
|
||||
|
||||
<el-button v-if="selectmodel.meshtype == 'section'" @click="rightAlignment">区段右对齐</el-button>
|
||||
|
||||
<el-button type="vexscal" @click="vexScalPlane">平面拉伸</el-button>
|
||||
|
||||
<el-button type="vexscal" @click="vexScalVertical">高度改变</el-button>
|
||||
|
||||
<!-- <el-form-item label="是否显示:" prop="visible">
|
||||
<el-checkbox ></el-checkbox>
|
||||
@ -160,6 +167,20 @@ export default {
|
||||
},
|
||||
init: function() {
|
||||
|
||||
},
|
||||
leftAlignment(){
|
||||
this.$emit('alignment',this.selectmodel.code,"left");
|
||||
},
|
||||
rightAlignment(){
|
||||
this.$emit('alignment',this.selectmodel.code,"right");
|
||||
},
|
||||
vexScalPlane(scalMode){
|
||||
|
||||
this.$emit('vexscal',"plane");
|
||||
},
|
||||
vexScalVertical(scalMode){
|
||||
|
||||
this.$emit('vexscal',"vertical");
|
||||
},
|
||||
switchproperty(){
|
||||
this.activeName = "second";
|
||||
|
@ -8,13 +8,13 @@
|
||||
<Edit-Action ref="action" @saction="saction" @actionevent="actionevent">
|
||||
</Edit-Action>
|
||||
|
||||
<Edit-Property ref="property" :selectmodel='selectmodel'>
|
||||
<Edit-Property ref="property" :selectmodel='selectmodel' @alignment="alignment" @vexscal= "vexscal" >
|
||||
</Edit-Property>
|
||||
|
||||
<Edit-Assets ref="assets" @smodel="smodel" @stexture="stexture">
|
||||
</Edit-Assets>
|
||||
|
||||
<Edit-Menu ref="menu" @transpos="transpos" @transrota="transrota" @transscal="transscal" @vexscal= "vexscal" @testrail="testrail" @autoss="autoss" @expo="expo" @save="save"
|
||||
<Edit-Menu ref="menu" @transpos="transpos" @transrota="transrota" @transscal="transscal" @testrail="testrail" @autoss="autoss" @expo="expo" @save="save"
|
||||
@savetest="savetest" @back="back">
|
||||
</Edit-Menu>
|
||||
|
||||
@ -171,10 +171,10 @@
|
||||
this.jlmap3dedit.transcontrol.setMode('scale');
|
||||
this.jlmap3dedit.vexscaloff();
|
||||
},
|
||||
vexscal(){
|
||||
vexscal(scalMode){
|
||||
|
||||
this.jlmap3dedit.transcontrol.detach();
|
||||
this.jlmap3dedit.vexscal();
|
||||
this.jlmap3dedit.vexscal(scalMode);
|
||||
console.log("vexscal");
|
||||
},
|
||||
testrail(){
|
||||
@ -187,6 +187,10 @@
|
||||
|
||||
this.jlmap3dedit.exportsection();
|
||||
},
|
||||
alignment(alignmentCode,direct){
|
||||
|
||||
this.jlmap3dedit.alignmentSection(alignmentCode,direct);
|
||||
},
|
||||
save() {
|
||||
//console.log("save");
|
||||
console.log(this.jlmap3dedit.assetManager);
|
||||
|
@ -138,7 +138,7 @@ export default {
|
||||
init: function () {
|
||||
// let mapdata = this.$store.state.socket.device;
|
||||
const dom = document.getElementById('jl3d');
|
||||
this.jl3d = new Jl3dpassflow(dom, this.$route.query.mapid, this.$route.query.group);
|
||||
this.jl3d = new Jl3dpassflow(dom, this.$route.query.mapid, this.$route.query.group, 'normal');
|
||||
},
|
||||
switchrender() {
|
||||
if (this.renderswitch == true) {
|
||||
|
130
src/views/newMap/displayNew/demon/selectIbp.vue
Normal file
130
src/views/newMap/displayNew/demon/selectIbp.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="$t('display.script.scriptList')"
|
||||
:visible.sync="show"
|
||||
top="50px"
|
||||
width="60%"
|
||||
:before-do-close="doClose"
|
||||
:close-on-click-modal="false"
|
||||
:z-index="2000"
|
||||
>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
:pager-config="pagerConfig"
|
||||
:query-form="queryForm"
|
||||
:query-list="queryList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getScriptPageListOnlineNew } from '@/api/script';
|
||||
|
||||
// 剧本弹窗
|
||||
export default {
|
||||
name: 'AddQuest',
|
||||
props: {
|
||||
trainings: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: false,
|
||||
show: false,
|
||||
queryObject: {
|
||||
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.listQuest,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '关联站台',
|
||||
prop: 'name'
|
||||
},
|
||||
// {
|
||||
// title: '创建时间',
|
||||
// prop: 'createTime'
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '预览',
|
||||
type: 'primary',
|
||||
handleClick: this.handleLoad
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.reloadTable();
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
listQuest(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
return getScriptPageListOnlineNew(params);
|
||||
},
|
||||
async loadInitData() {
|
||||
|
||||
},
|
||||
|
||||
async handleLoad(index, row) {
|
||||
this.row = row;
|
||||
// const routeData = this.$router.resolve({
|
||||
// path:`/ibpShow`,
|
||||
// query:{
|
||||
// lineCode: this.$route.query.lineCode,
|
||||
// mapId: this.$route.query.mapId,
|
||||
// group: this.$route.query.group
|
||||
// }
|
||||
// });
|
||||
// window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -57,200 +57,11 @@ export default {
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
// '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始获取仿真成员
|
||||
// getSimulationMemberList(this.group).then(resp => {
|
||||
// this.driverList = [];
|
||||
// this.treeData = [];
|
||||
// const result = covertMemberData(this.activeTrainList, resp.data);
|
||||
// this.driverList = result.driverList;
|
||||
// this.treeData = [{
|
||||
// label: '行调',
|
||||
// id: 'dispatcher',
|
||||
// type: 'role',
|
||||
// children: result.deviceListData[0]
|
||||
// }, {
|
||||
// label: '车站值班员',
|
||||
// id: 'stationSupervisor',
|
||||
// type: 'role',
|
||||
// children: result.deviceListData[2]
|
||||
// }, {
|
||||
// label: '司机',
|
||||
// id: 'driver',
|
||||
// type: 'role',
|
||||
// children: result.deviceListData[3]
|
||||
// }, {
|
||||
// label: '通号',
|
||||
// id: 'maintainer',
|
||||
// type: 'role',
|
||||
// children: result.deviceListData[1]
|
||||
// }, {
|
||||
// label: '车辆段',
|
||||
// id: 'depotDispatcher',
|
||||
// type: 'role',
|
||||
// children: result.deviceListData[4]
|
||||
// }];
|
||||
// this.memberData = result.lastMemberList;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox('获取仿真成员列表失败!');
|
||||
// });
|
||||
// },
|
||||
// 创建会话
|
||||
// '$store.state.socket.createConversition':function(val) {
|
||||
// if (this.memberData.length > 0) {
|
||||
// const conversitionMember = this.memberData.find(member=>{ return member.userId == this.$store.state.user.id; });
|
||||
// if (conversitionMember && val.memberIds.includes(conversitionMember.id)) {
|
||||
// // 当前用户创建的会话
|
||||
// if (val.creatorId !== conversitionMember.id) {
|
||||
// this.$message.success(this.coverName(val) + '与你开启会话');
|
||||
// }
|
||||
// this.isHasCoversition = true;
|
||||
// this.isStartRecord = true;
|
||||
// this.isQuitShow = true;
|
||||
// this.conversitionId = val.id;
|
||||
// const memberList = [];
|
||||
// val.memberIds.forEach(id=>{
|
||||
// if (val.creatorId == id) {
|
||||
// const member = this.memberData.find(member=>{ return member.id == id; });
|
||||
// member.connect = true;
|
||||
// memberList.push(member);
|
||||
// } else {
|
||||
// const member = this.memberData.find(member=>{ return member.id == id; });
|
||||
// // member.connect = false;
|
||||
// member.connect = true;
|
||||
// member && memberList.push(member);
|
||||
// }
|
||||
// });
|
||||
// this.currentMemberList = memberList;
|
||||
// } else {
|
||||
// // 如果是观众看所有人的会话
|
||||
// if (this.userRole == 'AUDIENCE') {
|
||||
// this.isHasCoversition = true;
|
||||
// this.currentMemberList = this.memberData;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// 用户接受会话
|
||||
// '$store.state.socket.acceptConversionInvite':function(val) {
|
||||
// this.conversitionId = val.id;
|
||||
// if (this.conversitionId) {
|
||||
// let result = false;
|
||||
// // 更改成员列表里面的成员状态
|
||||
// const memberList = this.currentMemberList.map(member => {
|
||||
// if (member.id == val.memberId) {
|
||||
// member.connect = true;
|
||||
// result = true;
|
||||
// }
|
||||
// return member;
|
||||
// });
|
||||
// // 如果该用户不在成员列表里面,就动态加进去(当前会话)
|
||||
// if (!result && this.conversitionId) {
|
||||
// const member = this.memberData.find(member=>{ return member.id == val.memberId; });
|
||||
// if (member) {
|
||||
// member.connect = true;
|
||||
// memberList.push(member);
|
||||
// // 如果是当前的用户
|
||||
// if (member.userId == this.$store.state.user.id) {
|
||||
// memberList.push(this.inviteUser);
|
||||
// this.isStartRecord = true;
|
||||
// this.isQuitShow = true;
|
||||
// this.inviteUser = {};
|
||||
// this.isHasCoversition = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.currentMemberList = memberList;
|
||||
// }
|
||||
// },
|
||||
// 会话聊天消息
|
||||
// '$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天
|
||||
// const simulationText = this.$store.state.socket.conversationInfo;
|
||||
// if (val.messageType == 'MESSAGE' && (this.conversitionId == val.id || this.userRole == 'AUDIENCE')) {
|
||||
// const content = this.addContent(simulationText.message);
|
||||
// this.chatContentList.push(content);
|
||||
// if (!content.self) {
|
||||
// this.$refs.chatbox.addAudioList(content);
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// 按计划行车的列车列表更新(更新司机列表)
|
||||
// '$store.state.map.activeTrainListChange': function (val) {
|
||||
// const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
// activeTrainList.sort((a, b) => {
|
||||
// return parseInt(a) - parseInt(b);
|
||||
// });
|
||||
// if (this.driverList.length > 0) {
|
||||
// const driverList = [];
|
||||
// if (activeTrainList && activeTrainList.length) {
|
||||
// activeTrainList.forEach(groupNumber => {
|
||||
// const drivers = this.driverList.find(driver=>{
|
||||
// return driver.deviceCode == groupNumber;
|
||||
// });
|
||||
// if (drivers) {
|
||||
// driverList.push(drivers);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// this.treeData[2].children = driverList;
|
||||
// this.memberData = [...this.treeData[0].children, ...this.treeData[1].children, ...this.treeData[2].children, ...this.treeData[3].children, ...this.treeData[4].children];
|
||||
// } else {
|
||||
// this.activeTrainList = activeTrainList;
|
||||
// }
|
||||
// },
|
||||
// 剧本执行完成消息
|
||||
'$store.state.socket.scriptFinish':function(val, old) {
|
||||
this.$message('剧本演出完毕');
|
||||
this.$refs.scriptTip.resetScriptTip();
|
||||
},
|
||||
// 退出会话消息
|
||||
// '$store.state.socket.overConversition': function (val) {
|
||||
// if (val.id === this.conversitionId) {
|
||||
// this.conversitionId = '';
|
||||
// this.currentMemberList = [];
|
||||
// this.chatContentList = [];
|
||||
// this.isHasCoversition = false;
|
||||
// this.isStartRecord = false;
|
||||
// }
|
||||
// },
|
||||
// '$store.state.socket.exitConversition': function (val) {
|
||||
// const member = this.memberData.find(member=>{ return member.memberId == val.member; });
|
||||
// if (val.id === this.conversitionId && member.userId == this.$store.state.user.id) {
|
||||
// this.conversitionId = '';
|
||||
// this.currentMemberList = [];
|
||||
// this.chatContentList = [];
|
||||
// this.isHasCoversition = false;
|
||||
// this.isStartRecord = false;
|
||||
// } else if (val.id === this.conversitionId) {
|
||||
// const mList = [];
|
||||
// this.currentMemberList.forEach(member => {
|
||||
// if (member.memberId != val.memberId) {
|
||||
// mList.push(member);
|
||||
// }
|
||||
// });
|
||||
// this.currentMemberList = mList;
|
||||
// }
|
||||
// },
|
||||
// 邀请会话的消息
|
||||
'$store.state.socket.inviteSimulationConversition':function(val) {
|
||||
// const conversitionMember = this.memberData.find(member=>{ return member.id == val.creatorId; });
|
||||
// if (conversitionMember) {
|
||||
// this.inviteUserName = conversitionMember.label;
|
||||
// this.conversitionId = val.id;
|
||||
// conversitionMember.connect = true;
|
||||
// conversitionMember.online = true;
|
||||
// this.inviteUser = conversitionMember;
|
||||
//
|
||||
// this.currentMemberList.push(conversitionMember);
|
||||
// const member = this.memberData.find(member=>{ return member.id == val.memberId; });
|
||||
// member.connect = true;
|
||||
// this.currentMemberList.push(member);
|
||||
// this.isStartRecord = true;
|
||||
// this.isHasCoversition = true;
|
||||
// // this.$refs.chatbox.inviteMember();
|
||||
// this.$message.success(this.inviteUserName + '与你开启会话');
|
||||
// }
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
|
@ -20,6 +20,8 @@
|
||||
<el-button v-if="scheduleLoadShow" type="primary" size="small" @click="jumpScheduling">派班计划加载</el-button>
|
||||
<el-button v-if="schedulePreviewShow" type="primary" size="small" @click="schedulingView">派班计划预览</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="fieldPractice">实操练习</el-button>
|
||||
<el-button v-if="isContest" size="small" @click=" fieldTeach">实操教学</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="goTheoryQuiz">理论考试</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="viewChangeMap">切换地图</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
@ -207,7 +209,13 @@ export default {
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
fieldPractice() {
|
||||
this.$emit('fieldPractice');
|
||||
this.$emit('fieldPractice', 'practice');
|
||||
},
|
||||
fieldTeach() {
|
||||
this.$emit('fieldPractice', 'teach');
|
||||
},
|
||||
goTheoryQuiz() {
|
||||
this.$emit('goTheoryQuiz');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -19,6 +19,7 @@
|
||||
:all-style="'top:'+(offset+textStatusHeight)+'px'"
|
||||
@changeMap="changeMap"
|
||||
@fieldPractice="fieldPractice"
|
||||
@goTheoryQuiz="goTheoryQuiz"
|
||||
/>
|
||||
|
||||
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
|
||||
@ -52,6 +53,7 @@
|
||||
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
<scene-list ref="sceneList" @selectQuest="selectQuest" />
|
||||
<theory-quiz ref="theoryQuiz" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@ -63,6 +65,7 @@ import DemonMenu from '../demonMenu';
|
||||
import DemonChat from '../demonChat';
|
||||
import SceneList from './sceneList';
|
||||
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
||||
import TheoryQuiz from './quiz';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
@ -83,7 +86,8 @@ export default {
|
||||
DemonChat,
|
||||
MenuSchema,
|
||||
DemonMenu,
|
||||
SceneList
|
||||
SceneList,
|
||||
TheoryQuiz
|
||||
},
|
||||
props: {
|
||||
offset: {
|
||||
@ -376,7 +380,7 @@ export default {
|
||||
}
|
||||
this.userRole = userRole;
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', true);
|
||||
this.$refs.chatbox.setMembers(id);
|
||||
// this.$refs.chatbox.setMembers(id);
|
||||
const res = await loadScriptNew(row.id, id, this.group);
|
||||
if (res && res.code == 200) {
|
||||
if (mapLocation) {
|
||||
@ -410,7 +414,7 @@ export default {
|
||||
}
|
||||
}
|
||||
this.userRole = userRole;
|
||||
this.$refs.chatbox.setMembers(this.$store.state.training.orignalUserRoleId);
|
||||
// this.$refs.chatbox.setMembers(this.$store.state.training.orignalUserRoleId);
|
||||
this.$refs.chatbox.clearAllData();
|
||||
this.$store.dispatch('training/setPrdType', this.$route.query.prdType);
|
||||
this.$store.dispatch('training/setRoles', userRole);
|
||||
@ -441,8 +445,11 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
fieldPractice() {
|
||||
this.$refs.sceneList.doShow();
|
||||
fieldPractice(param) {
|
||||
this.$refs.sceneList.doShow(param);
|
||||
},
|
||||
goTheoryQuiz() {
|
||||
this.$refs.theoryQuiz.doShow();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
91
src/views/newMap/displayNew/dispatherContest/question.vue
Normal file
91
src/views/newMap/displayNew/dispatherContest/question.vue
Normal file
@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="question">
|
||||
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key)" />
|
||||
<template v-if="checkType(option, 'judge')">
|
||||
<el-radio-group v-model="answer" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
|
||||
<span>{{ el.content }}</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<template v-else-if="checkType(option, 'select')">
|
||||
<el-radio-group v-model="answer" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
|
||||
<span>{{ $asc2chart(i+65) }}. </span>
|
||||
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
option: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
answer: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.changeValue();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.changeValue();
|
||||
},
|
||||
methods: {
|
||||
changeValue() {
|
||||
this.answer = parseInt(this.value);
|
||||
},
|
||||
checkType(option, type) {
|
||||
return option.type == type;
|
||||
},
|
||||
appendIndex(str, index) {
|
||||
return `${index + 1}. ${str}`;
|
||||
},
|
||||
onChnage(e) {
|
||||
const answer = `${e}`;
|
||||
this.$emit('input', answer);
|
||||
this.$emit('save', {userExamQuestionId: this.option.id, answer: answer});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.rich-text {
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.question {
|
||||
/deep/ {
|
||||
.ql-editor {
|
||||
line-height: 26px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-radio {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.el-radio__label {
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
334
src/views/newMap/displayNew/dispatherContest/quiz.vue
Normal file
334
src/views/newMap/displayNew/dispatherContest/quiz.vue
Normal file
@ -0,0 +1,334 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialogVisible" fullscreen>
|
||||
<el-container class="quiz">
|
||||
<el-container class="quiz__container">
|
||||
<el-header class="quiz__container-header layer-center">
|
||||
<div class="title">{{ formModel.name }}</div>
|
||||
<div class="notes">{{ formModel.description }}</div>
|
||||
</el-header>
|
||||
<el-main class="quiz__container-main layer-center">
|
||||
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
|
||||
<template v-if="el.children.length">
|
||||
<div class="caption">{{ index2UnicodeList[i] }}、{{ el.title }} </div>
|
||||
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" @save="onSave" />
|
||||
</template>
|
||||
</div>
|
||||
</el-main>
|
||||
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
|
||||
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;float: left;color:#F00;font-size: 12px;">温馨提示:考试过程中请退出或关闭本页面不会终止计时!</div>
|
||||
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;margin-right: 10px;font-weight:bold;">{{ '剩余时间:'+countdownTime }}</div>
|
||||
<el-button-group class="buttons">
|
||||
<el-button v-loading="loading" type="primary" @click="commit">提 交</el-button>
|
||||
</el-button-group>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import Question from './question';
|
||||
import localStore from 'storejs';
|
||||
import { postCompetitionTheory, getTheoryQuestion, quitCurrentRace } from '@/api/competition';
|
||||
import { computationTime } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Question
|
||||
},
|
||||
mixins: [
|
||||
// WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
height: 0,
|
||||
loading: false,
|
||||
formModel: {
|
||||
description: '',
|
||||
duration: 10,
|
||||
name: '',
|
||||
status: '',
|
||||
totalScore: 0,
|
||||
passScore: 10
|
||||
},
|
||||
examQuestions: [],
|
||||
theoryAnswersMap: {},
|
||||
countdownTime: '00:00:00',
|
||||
theoryExamTime: 0,
|
||||
countdown: null,
|
||||
dialogVisible: false,
|
||||
data: {
|
||||
theoryExamTime:1,
|
||||
questions:[
|
||||
{
|
||||
id:1,
|
||||
type:'select',
|
||||
topic:'。。。。。',
|
||||
optionList:[
|
||||
{
|
||||
id:1,
|
||||
questionId:1,
|
||||
content:'啊'
|
||||
},
|
||||
{
|
||||
id:2,
|
||||
questionId:1,
|
||||
content:'吧'
|
||||
},
|
||||
{
|
||||
id:3,
|
||||
questionId:1,
|
||||
content:'从'
|
||||
},
|
||||
{
|
||||
id:4,
|
||||
questionId:1,
|
||||
content:'的'
|
||||
}
|
||||
],
|
||||
score:10
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
examId() {
|
||||
return this.$route.params.examId;
|
||||
},
|
||||
userExamId() {
|
||||
return this.$route.params.userExamId;
|
||||
},
|
||||
question() {
|
||||
return this.examQuestions[this.index] || {};
|
||||
},
|
||||
index2UnicodeList() {
|
||||
return ['一', '二', '三', '四'];
|
||||
},
|
||||
sortedList() {
|
||||
return [
|
||||
{
|
||||
title: '判断题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
|
||||
},
|
||||
{
|
||||
title: '选择题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'select'; })
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$router': function() {
|
||||
this.loadInitData();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
quitCurrentRace(this.$route.query.raceId, {}).then(res=>{
|
||||
});
|
||||
if (this.countdown) {
|
||||
clearInterval(this.countdown);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
loadInitData() {
|
||||
// this.theoryAnswers = [];
|
||||
this.theoryAnswersMap = {};
|
||||
// getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
|
||||
// const storeAnswersKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
|
||||
// const storeAnswers = localStore.get(storeAnswersKey);
|
||||
// if (storeAnswers) {
|
||||
// this.theoryAnswersMap = storeAnswers;
|
||||
// }
|
||||
if (this.data) {
|
||||
this.examQuestions = this.data.questions.map((el, i) => {
|
||||
el.index = i;
|
||||
el.answer = this.theoryAnswersMap[el.id];
|
||||
return el;
|
||||
});
|
||||
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
|
||||
const startTime = localStore.get(storeKey);
|
||||
if (startTime) {
|
||||
const dt = new Date().getTime() - startTime;
|
||||
this.theoryExamTime = this.data.theoryExamTime * 60 - Math.floor(dt / 1000);
|
||||
} else {
|
||||
this.theoryExamTime = this.data.theoryExamTime * 60;
|
||||
const storeValue = new Date().getTime();
|
||||
localStore.set(storeKey, storeValue);
|
||||
}
|
||||
this.countdownTime = computationTime(this.theoryExamTime);
|
||||
|
||||
this.countdown = setInterval(() => {
|
||||
if (this.theoryExamTime <= 0) {
|
||||
if (this.countdown) {
|
||||
clearInterval(this.countdown);
|
||||
}
|
||||
this.commit();
|
||||
}
|
||||
this.theoryExamTime--;
|
||||
this.countdownTime = computationTime(this.theoryExamTime);
|
||||
}, 1000);
|
||||
}
|
||||
// }).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
|
||||
},
|
||||
resizeHandler() {
|
||||
this.height = this._clientHeight;
|
||||
},
|
||||
appendIndex(str, index) {
|
||||
return `${index + 1}. ${str}`;
|
||||
},
|
||||
goAnchor(selector) {
|
||||
const anchor = this.$el.querySelector(selector);
|
||||
const el = this.$el.querySelector('.el-main');
|
||||
if (anchor && el) {
|
||||
el.scrollTop = anchor.offsetTop;
|
||||
}
|
||||
},
|
||||
returnTop() {
|
||||
document.querySelector('.el-header').scrollIntoView(true);
|
||||
},
|
||||
commit() {
|
||||
let isFinish = true;
|
||||
this.examQuestions.forEach(el => {
|
||||
if (!el.answer) { isFinish = false; }
|
||||
});
|
||||
|
||||
if (isFinish || this.theoryExamTime <= 0) {
|
||||
this.doEnd();
|
||||
} else {
|
||||
this.$confirm('存在试题未完成,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doEnd();
|
||||
}).catch( () => { });
|
||||
}
|
||||
},
|
||||
doEnd() {
|
||||
const theoryAnswers = [];
|
||||
for (const key in this.theoryAnswersMap) {
|
||||
theoryAnswers.push({questionId: key, answerOptionId: this.theoryAnswersMap[key]});
|
||||
}
|
||||
const params = {
|
||||
competitionId: this.$route.query.raceId,
|
||||
theoryAnswers: theoryAnswers
|
||||
};
|
||||
// postCompetitionTheory(params).then(()=>{
|
||||
// const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
|
||||
// localStore.remove(storeKey);
|
||||
// this.$router.push({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
|
||||
// });
|
||||
},
|
||||
onSave(data) {
|
||||
// this.theoryAnswers.push({
|
||||
// answerOptionId: data.answer,
|
||||
// questionId: data.userExamQuestionId
|
||||
// });
|
||||
this.theoryAnswersMap[data.userExamQuestionId] = data.answer;
|
||||
// console.log(data, '问答题', this.theoryAnswers, this.theoryAnswersMap);
|
||||
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
|
||||
localStore.set(storeKey, this.theoryAnswersMap);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.layer-center {
|
||||
width: 900px;
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.quiz {
|
||||
background: #eee;
|
||||
height: 100%;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display:none
|
||||
}
|
||||
|
||||
&__card {
|
||||
height: 100%;
|
||||
.dir-item {
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.dir-caption {
|
||||
padding-left: 10px;
|
||||
line-height: 26px;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&__container {
|
||||
height: 100%;
|
||||
|
||||
&-header {
|
||||
height: auto !important;
|
||||
|
||||
.title {
|
||||
font-size: 24px;
|
||||
line-height: 60px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.notes {
|
||||
color:#606266;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin: 0 20px;
|
||||
}
|
||||
}
|
||||
|
||||
&-main {
|
||||
.section {
|
||||
padding: 5px 20px;
|
||||
.caption {
|
||||
line-height: 26px;
|
||||
}
|
||||
.context {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-footer {
|
||||
text-align: right;
|
||||
position: sticky;
|
||||
bottom: 0px;
|
||||
padding: 40px ;
|
||||
.buttons {
|
||||
position: relative;
|
||||
bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/{
|
||||
.el-dialog__body{
|
||||
height: 100%;
|
||||
}
|
||||
.el-dialog__header{
|
||||
padding: 0;
|
||||
}
|
||||
.el-dialog__headerbtn{
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -48,6 +48,7 @@ export default {
|
||||
memberList: [],
|
||||
memberId:'',
|
||||
selectMapLineCode:'',
|
||||
operationType: '',
|
||||
mainSceneData: [
|
||||
{type: '车辆故障', scene: '列车救援'},
|
||||
{type: '信号系统故障', scene: '道岔故障', id: '9'},
|
||||
@ -83,7 +84,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
doShow(param) {
|
||||
this.operationType = param;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
@ -133,6 +135,7 @@ export default {
|
||||
this.confirm();
|
||||
},
|
||||
confirm() {
|
||||
this.$store.dispatch('training/setScriptOperationType', this.operationType);
|
||||
this.$emit('selectQuest', {row:this.row, id:this.memberId, mapLocation:this.mapLocation});
|
||||
this.doClose();
|
||||
},
|
||||
|
@ -332,7 +332,7 @@ export default {
|
||||
this.$store.dispatch('training/setRoles', 'AUDIENCE');
|
||||
this.$store.dispatch('training/setPrdType', '');
|
||||
}
|
||||
this.$refs.menuSchema.loadRunData();
|
||||
// this.$refs.menuSchema.loadRunData();
|
||||
this.userRole = userRole;
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', true);
|
||||
// this.$refs.chatbox.setMembers(id);
|
||||
|
@ -26,7 +26,7 @@ export default {
|
||||
watch:{
|
||||
// 剧本提示
|
||||
'$store.state.socket.simulationScriptTip':function(val, old) {
|
||||
if (val) {
|
||||
if (val && this.$store.state.training.scriptOperationType === 'teach') {
|
||||
if (val.type == 'Conversation') {
|
||||
this.scriptTipMessage = '请说:' + val.content;
|
||||
} else if (val.type == 'Operation') {
|
||||
|
@ -5,6 +5,7 @@
|
||||
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button-group>
|
||||
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goIbp">IBP盘</el-button>
|
||||
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goBigScreen">大屏</el-button>
|
||||
<el-button v-if="running && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
<template v-if="isAdmin">
|
||||
@ -20,6 +21,7 @@
|
||||
<el-button v-if="isShowDirective" size="small" :type="directiveMode ? 'primary' : ''" @click="changeDirectiveMode()">{{ directiveMode? '切换到普通模式':'切换到指令模式' }}</el-button>
|
||||
</div>
|
||||
<join-run-plan-view v-if="running && !dataError" ref="runPlanView" :group="group" />
|
||||
<select-ibp ref="selectIbp" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@ -30,10 +32,12 @@ import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import { getEveryDayRunPlanNew } from '@/api/simulation';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
|
||||
import SelectIbp from '@/views/newMap/displayNew/demon/selectIbp';
|
||||
export default {
|
||||
name: 'MenuDemonSchema',
|
||||
components:{
|
||||
JoinRunPlanView
|
||||
JoinRunPlanView,
|
||||
SelectIbp
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
@ -199,6 +203,21 @@ export default {
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
// 点击ibp预览
|
||||
goIbp() {
|
||||
// this.$refs.selectIbp.doShow();
|
||||
const routeData = this.$router.resolve({
|
||||
path:`/ibpShow`,
|
||||
query:{
|
||||
lineCode: this.$route.query.lineCode,
|
||||
mapId: this.$route.query.mapId,
|
||||
group: this.$route.query.group,
|
||||
stationCode: 'Station25166',
|
||||
loadAll: true
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -164,8 +164,10 @@ export default {
|
||||
this.$emit('hover', filed);
|
||||
},
|
||||
addModelList() {
|
||||
const uname = getUID('T', [...this.sectionList, ...this.createModel.modelList]);
|
||||
const param = {
|
||||
sectionName: 'T',
|
||||
code: uname,
|
||||
sectionName: uname,
|
||||
length: ''
|
||||
};
|
||||
this.createModel.modelList.push(param);
|
||||
|
@ -380,7 +380,7 @@ export default {
|
||||
createControlMode: item.control
|
||||
};
|
||||
const model = Object.assign(stationModel, data);
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
||||
const sectionModel = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.sectionCode));
|
||||
const last = sectionModel.points.length - 1;
|
||||
model.position = {
|
||||
x: sectionModel.points[0].x + (sectionModel.points[last].x - sectionModel.points[0].x) / 2,
|
||||
@ -393,6 +393,9 @@ export default {
|
||||
};
|
||||
}
|
||||
models.push(model);
|
||||
sectionModel.standTrack = true;
|
||||
sectionModel.belongStation = uid;
|
||||
models.push(sectionModel);
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.addModel = {
|
||||
|
@ -24,13 +24,16 @@ export default {
|
||||
const createArr = []; // 创建model列表
|
||||
const changeSectionList = this.changeSectionAttr();
|
||||
changeSectionList.forEach(section => {
|
||||
// if (section.code == 'T449' || section.code == 'T501' || section.code == 'T502') {
|
||||
// debugger;
|
||||
// }
|
||||
if (!section.rightSectionCode) { // 右侧关联关系为空 且 道岔区段
|
||||
const list = this.findSectionA(section.points[section.points.length - 1].x, section.points[section.points.length - 1].y);
|
||||
let sectionB = {};
|
||||
let sectionC = {};
|
||||
if (list.length >= 2) {
|
||||
list.forEach(item => {
|
||||
if (item.points[1].y == section.points[section.points.length - 1].y) { // 是否水平拿第二个点判断
|
||||
if ((item.points[1].y == section.points[section.points.length - 1].y) || (item.points[1].x == section.points[section.points.length - 1].x)) { // 是否水平拿第二个点判断
|
||||
sectionB = item;
|
||||
} else {
|
||||
sectionC = item;
|
||||
@ -70,7 +73,7 @@ export default {
|
||||
let sectionC = {};
|
||||
if (list.length >= 2) {
|
||||
list.forEach(item => {
|
||||
if (item.points[item.points.length - 2].y == section.points[0].y) { // 是否水平拿倒数第二个点判断
|
||||
if ((item.points[item.points.length - 2].y == section.points[0].y) || (item.points[item.points.length - 2].x == section.points[0].x)) { // 是否水平拿倒数第二个点判断
|
||||
sectionB = item;
|
||||
} else {
|
||||
sectionC = item;
|
||||
@ -258,6 +261,7 @@ export default {
|
||||
sectionb.parentCode = elem['uid'];
|
||||
sectionc.parentCode = elem['uid'];
|
||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
|
||||
elem['relSwitchCode'] = elem.code;
|
||||
sectionList.push(elem);
|
||||
switchList.forEach(ele => {
|
||||
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
||||
@ -287,6 +291,9 @@ export default {
|
||||
sectiona.relSwitchCode = elem.code;
|
||||
sectionb.relSwitchCode = elem.code;
|
||||
sectionc.relSwitchCode = elem.code;
|
||||
sectiona.name = `${sectiona.name}-A`;
|
||||
sectionb.name = `${sectionb.name}-B`;
|
||||
sectionc.name = `${sectionc.name}-C`;
|
||||
sectiona.switchSection = true;
|
||||
sectionb.switchSection = true;
|
||||
sectionc.switchSection = true;
|
||||
@ -309,12 +316,14 @@ export default {
|
||||
point = { x: sectiona.points[0].x, y: sectiona.points[0].y };
|
||||
}
|
||||
const sectionModel = getModel('Section');
|
||||
const name = sectiona.name;
|
||||
const data = {
|
||||
code: elem.uid,
|
||||
name: sectiona.name,
|
||||
name: name.split('-')[0],
|
||||
type: '04',
|
||||
namePosition: point,
|
||||
switchSection: true,
|
||||
relSwitchCode: elem.relSwitchCode,
|
||||
relevanceSectionList: elem.relevanceSectionList,
|
||||
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
|
||||
sepTypeLeft: '00',
|
||||
|
@ -312,7 +312,6 @@ export default {
|
||||
this.$router.back();
|
||||
},
|
||||
handelQuit() {
|
||||
console.log('------------', this.$route.path);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user