Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-06-02 21:50:36 +08:00
commit 944d828d66
86 changed files with 3618 additions and 1590 deletions

View File

@ -1,40 +0,0 @@
import request from '@/utils/request';
/** 创建实操 */
export function createPractical(data) {
return request({
url: `/api/v1/competitionPractical`,
method: 'post',
data: data
});
}
/** 加载实操及内容 */
export function loadingPractical(data) {
return request({
url: `/api/v1/competitionPractical/distribute`,
method: 'post',
data: data
});
}
/** 查询地图下的实操列表 */
export function getPracticalListByMapId(mapId) {
return request({
url: `/api/v1/competitionPractical/map/${mapId}`,
method: 'get'
});
}
/** 删除实操 */
export function deletePractical(practicalId) {
return request({
url: `/api/v1/competitionPractical/${practicalId}`,
method: 'delete'
});
}
/** 更新实操 */
export function updatePractical(practicalId, data) {
return request({
url: `/api/v1/competitionPractical/{practicalId}`,
method: 'put',
data: data
});
}

View File

@ -26,52 +26,10 @@ export function updateRace(id, data) {
} }
/** 获取实操试题列表(题库)*/ /** 获取实操试题列表(题库)*/
export function getPracticeList() { export function getPracticeList(params) {
return request({ return request({
url: `/api/v1/competitionPractical/competition`, url: `/api/v1/competitionPractical`,
method: 'get' method: 'get',
params
}); });
} }
/** 获取单个实操试题详情(题库)*/
export function getPracticeByIdBasic() {
return request({
url: `/api/v1/competitionPractical/competition`,
method: 'get'
});
}
/** 创建实操试题 */
export function createPractice(data) {
return request({
url: `/api/v1/competitionPractical/competition`,
method: 'post',
data
});
}
/** 更新实操试题信息 */
export function putPracticeInfo(id, params) {
return request({
url: `/api/v1/competitionPractical/competition/${id}`,
method: 'put',
data: params
});
}
/** 删除实操试题 */
export function deletePractice(id) {
return request({
url: `/api/v1/competitionPractical/competition/${id}`,
method: 'delete'
});
}
/** 录制实操试题 */
export function practiceRecordNotify(practiceId) {
return request({
url: `/api/scriptSimulation/${practiceId}/scriptWrite`,
method: 'get'
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

View File

@ -242,5 +242,22 @@ deviceRender[deviceType.StateTable] = {
zlevel: 1, zlevel: 1,
z: 5 z: 5
}; };
/** 照明组 */
deviceRender[deviceType.LightingGroup] = {
_type: deviceType.LightingGroup,
zlevel: 1,
z: 5
};
/** 平衡电动阀 */
deviceRender[deviceType.BalancedElectric] = {
_type: deviceType.BalancedElectric,
zlevel: 1,
z: 5
};
/** 电动蝶阀 */
deviceRender[deviceType.ElectricButterflyValve] = {
_type: deviceType.ElectricButterflyValve,
zlevel: 1,
z: 5
};
export default deviceRender; export default deviceRender;

View File

@ -36,7 +36,10 @@ const deviceType = {
SingleStaircase: 'SingleStaircase', SingleStaircase: 'SingleStaircase',
ArcStatus: 'ArcStatus', ArcStatus: 'ArcStatus',
IscsButton: 'IscsButton', IscsButton: 'IscsButton',
StateTable: 'StateTable' StateTable: 'StateTable',
LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve'
}; };
export default deviceType; export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
export const keyboardEvents = {
C: {altKey:false, ctrlKey:true, shiftKey:false, event: 'Ctrl_C'}, // 绘图复制
V: {altKey:false, ctrlKey:true, shiftKey:false, event: 'Ctrl_V'} // 绘图粘贴
// DELETE: {altKey:false, ctrlKey:false, shiftKey:false, event: 'Delete'}, // 快捷删除绘图元素
// ENTER: {altKey:false, ctrlKey:false, shiftKey:false, event: 'Update'} // 快捷修改绘图元素
};

View File

@ -4,6 +4,7 @@ import Options from './options';
import MouseController from './mouseController'; import MouseController from './mouseController';
import Painter from './painter'; import Painter from './painter';
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import KeyboardController from './keyboardController';
import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser'; import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser';
import { updateIscsData } from './utils/parser'; import { updateIscsData } from './utils/parser';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
@ -16,7 +17,7 @@ class Iscs {
this.methods = opts.methods; this.methods = opts.methods;
// 鼠标事件 // 鼠标事件
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu'}; this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu', Keyboard: 'keyboard'};
// 设备数据 // 设备数据
this.iscsDevice = {}; this.iscsDevice = {};
@ -41,6 +42,8 @@ class Iscs {
this.$painter.updateTransform(this.$options, this.canvasSize); this.$painter.updateTransform(this.$options, this.canvasSize);
this.optionsHandler = this.setOptions.bind(this); this.optionsHandler = this.setOptions.bind(this);
this.$keyboardController = new KeyboardController(this);
this.$keyboardController.enable();
this.$mouseController.on(this.events.__Pan, this.optionsHandler); this.$mouseController.on(this.events.__Pan, this.optionsHandler);
} }
@ -241,6 +244,7 @@ class Iscs {
this.clear(); this.clear();
this.$mouseController.dispose(); this.$mouseController.dispose();
this.$keyboardController.dispose();
this.$iscsZr && zrender.dispose(this.$iscsZr); this.$iscsZr && zrender.dispose(this.$iscsZr);
this.$painter.dispose(); this.$painter.dispose();
} }
@ -258,6 +262,9 @@ class Iscs {
case this.events.DataZoom: case this.events.DataZoom:
this.$mouseController.on(this.events.DataZoom, cb, context); this.$mouseController.on(this.events.DataZoom, cb, context);
break; break;
case this.events.Keyboard:
this.$keyboardController.on(this.events.Keyboard, cb, context);
break;
} }
} }
} }
@ -275,6 +282,9 @@ class Iscs {
case this.events.DataZoom: case this.events.DataZoom:
this.$mouseController.off(this.events.DataZoom, cb); this.$mouseController.off(this.events.DataZoom, cb);
break; break;
case this.events.Keyboard:
this.$keyboardController.off(this.events.Keyboard, cb);
break;
} }
} }
} }

View File

@ -0,0 +1,51 @@
import Eventful from 'zrender/src/mixin/Eventful';
import { keyboardEvents } from './constant/keyboardEvents';
class KeyboardController extends Eventful {
constructor(iscs) {
super();
this.$iscs = iscs;
this.$zr = iscs.getZr();
this.events = iscs.getEvents();
this.initData();
this.initHandler(this.$zr);
}
initHandler(zr) {
if (zr) {
var keydownHandle = this.keydown.bind(this);
this.enable = function (opts) {
opts = opts || {};
this._keyOnDownUp = opts.keyOnDownUp || true;
window.addEventListener('keyup', keydownHandle, false);
};
this.disable = function () {
window.removeEventListener('keyup', keydownHandle, false);
};
this.dispose = function() {
this.disable();
};
}
}
initData() {
}
keydown(e) {
if (this._keyOnDownUp && !e.repeat) {
const currentEvent = keyboardEvents[e.key.toUpperCase()];
let str = '';
if (currentEvent && currentEvent.altKey === e.altKey && currentEvent.ctrlKey === e.ctrlKey && currentEvent.shiftKey === e.shiftKey) {
str = currentEvent.event;
}
this.trigger(this.events.Keyboard, str);
}
}
}
export default KeyboardController;

View File

@ -22,6 +22,9 @@ export default class airConditioner extends Group {
this.grouper.origin = [this.model.width / 2, this.model.width * 0.571 / 2]; this.grouper.origin = [this.model.width / 2, this.model.width * 0.571 / 2];
this.grouper.scale = [-1, -1]; this.grouper.scale = [-1, -1];
} }
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper); this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {

View File

@ -0,0 +1,30 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner 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.path = createPathSvg(this.model);
this.grouper.add(this.path);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -0,0 +1,30 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner 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.path = createPathSvg(this.model);
this.grouper.add(this.path);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -48,6 +48,9 @@ export default class frozenPump extends Group {
}); });
this.grouper.add(this.circleOutside); this.grouper.add(this.circleOutside);
this.grouper.add(this.triangle); this.grouper.add(this.triangle);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
this.add(this.grouper); this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {

View File

@ -1,6 +1,8 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Image from 'zrender/src/graphic/Image';
import buttonImg from '@/assets/iscs_icon/button.png';
import buttonActive from '@/assets/iscs_icon/button_active.png';
export default class Button extends Group { export default class Button extends Group {
constructor(device) { constructor(device) {
@ -37,24 +39,24 @@ export default class Button extends Group {
}); });
const textRect = this.buttonText.getBoundingRect(); const textRect = this.buttonText.getBoundingRect();
this.buttonText.setStyle('textLineHeight', textRect.height); this.buttonText.setStyle('textLineHeight', textRect.height);
this.buttonRect = new Rect({ this.imageButton = new Image({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
shape: { style: {
x: textRect.x - model.levelPadding, x: textRect.x - model.levelPadding,
y: textRect.y - model.verticalPadding, y: textRect.y - model.verticalPadding,
image: buttonImg,
width: textRect.width + 2 * model.levelPadding, width: textRect.width + 2 * model.levelPadding,
height: textRect.height + 2 * model.verticalPadding height: textRect.height + 2 * model.verticalPadding
},
style: {
fill: '#879096',
stroke: '#132E48',
lineWidth: 1
} }
}); });
this.grouper.add(this.buttonRect); this.grouper.add(this.imageButton);
this.grouper.add(this.buttonText); this.grouper.add(this.buttonText);
this.add(this.grouper); this.add(this.grouper);
this.on('mouseout', (e) => { this.buttonText && this.buttonText.setStyle({textFill: '#FFF'}); });
this.on('mouseover', (e) => { this.buttonText && this.buttonText.setStyle({textFill: '#000'}); });
this.on('mousedown', (e) => { this.imageButton && this.imageButton.setStyle({image: buttonActive}); });
this.on('mouseup', (e) => { this.imageButton && this.imageButton.setStyle({image: buttonImg}); });
} }
setModel(dx, dy) { setModel(dx, dy) {
this.model.point.x += dx; this.model.point.x += dx;

View File

@ -59,7 +59,15 @@ const map = {
SingleStaircase: { SingleStaircase: {
width: 58, width: 58,
path: 'M0,32V24H5V8H0V0H58V8H51V24h7v8H0Zm8-8h3V8H8V24ZM55,5V3H3V5H55ZM14,8V24h2V8H14Zm5,0V24h3V8H19Zm6,0V24h2V8H25Zm5,0V24h2V8H30Zm5,0V24h2V8H35Zm5,0V24h3V8H40Zm6,0V24h2V8H46Zm9,19H3v2H55V27Z' path: 'M0,32V24H5V8H0V0H58V8H51V24h7v8H0Zm8-8h3V8H8V24ZM55,5V3H3V5H55ZM14,8V24h2V8H14Zm5,0V24h3V8H19Zm6,0V24h2V8H25Zm5,0V24h2V8H30Zm5,0V24h2V8H35Zm5,0V24h3V8H40Zm6,0V24h2V8H46Zm9,19H3v2H55V27Z'
} },
BalancedElectric: {
width: 73,
path: 'M77,24V61L63,55V71H55V52L40.476,45.165,30,50V71H22V53L4,61V24L37,40.923V34.835C28.523,33.828,22,27.8,22,20.5,22,12.492,29.835,6,39.5,6S57,12.492,57,20.5c0,7.3-6.523,13.328-15,14.335v7.113ZM50.8,22H47l-4,3-4-3H30l3-5h5l4,2,3-1h5.534C48.973,14.409,43.6,10.881,38,11c-6.646.141-11,5.858-11,10s4.516,9.141,13,9C47.178,29.88,50.075,25.771,50.8,22Z'
},
ElectricButterflyValve: {
width: 39,
path: 'M38,24V44H1V24H18.237L18,21s-6.5.6-9-8C7.705,8.542,10.288,2,20,2S31.849,8.083,31,13c-1.586,9.183-9,8-9,8v3H38Zm-3,4.077L24,34a4.361,4.361,0,0,1-3,5c-3.052,1.215-7,0-7,0L9,41H35V28.077ZM25.872,17.466A6.259,6.259,0,0,0,29,12a18.6,18.6,0,0,0-1-4L25,5H16L12.511,7.279C10.464,8.908,11.044,14.092,11,10.9a10.963,10.963,0,0,0,2.23,5.284L14,7h2l3.181,6.95L23,7h2Zm-1.924.915L23.261,10.13,19.91,17H18l-2.341-5.907L15.1,17.8A8.481,8.481,0,0,0,20,19C17.855,19.073,20.85,19.478,23.948,18.38ZM4,27V39.556L12,36a6.888,6.888,0,0,1,3-7c4.261-2.736,8,1,8,1l6-3H4Z'
}
}; };
export default function createPathSvg(model) { export default function createPathSvg(model) {

View File

@ -25,6 +25,7 @@ import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine';
import TicketMachine from './ticketMachine'; import TicketMachine from './ticketMachine';
import AirConditioner from './bas/airConditioner'; import AirConditioner from './bas/airConditioner';
import VolumeControlDamper from './bas/volumeControlDamper'; import VolumeControlDamper from './bas/volumeControlDamper';
import BalancedElectric from './bas/balancedElectric';
import IscsText from './text'; import IscsText from './text';
import IscsLine from './line'; import IscsLine from './line';
import IscsRect from './rect'; import IscsRect from './rect';
@ -37,6 +38,8 @@ import ArcStatus from './ArcStatus';
import IscsButton from './button'; import IscsButton from './button';
import SmookExhaustFd from './bas/smookExhaustFd'; import SmookExhaustFd from './bas/smookExhaustFd';
import StateTable from './stateTable'; import StateTable from './stateTable';
import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve';
const iscsShape = {}; const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -78,6 +81,9 @@ iscsShape[deviceType.SingleStaircase] = SingleStaircase;
iscsShape[deviceType.ArcStatus] = ArcStatus; iscsShape[deviceType.ArcStatus] = ArcStatus;
iscsShape[deviceType.IscsButton] = IscsButton; iscsShape[deviceType.IscsButton] = IscsButton;
iscsShape[deviceType.StateTable] = StateTable; iscsShape[deviceType.StateTable] = StateTable;
iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
function shapefactory(device, iscs) { function shapefactory(device, iscs) {
const type = device.model._type; const type = device.model._type;

View File

@ -9,7 +9,7 @@ export default class FireHydrantAlarmButton extends Group {
this._type = device.model._type; this._type = device.model._type;
this._code = device.model.code; this._code = device.model.code;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.zlevel; this.z = device.model.z;
this.create(); this.create();
} }
create() { create() {

186
src/iscs/shape/lighting.js Normal file
View File

@ -0,0 +1,186 @@
import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class lighting extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.outsideRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: model.width,
height: model.height
},
style: {
lineWidth: 2,
fill: 'rgba(0,0,0,0)',
stroke: '#4CCDE4'
}
});
this.grouper.add(this.outsideRect);
this.verticalLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width * 2 / 5,
y1: 0,
x2: model.width * 2 / 5,
y2: model.height
},
style: {
lineWidth: 2,
stroke: '#4CCDE4'
}
});
this.grouper.add(this.verticalLine);
this.horizontalLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width * 2 / 5,
y1: model.height / 2,
x2: model.width,
y2: model.height / 2
},
style: {
lineWidth: 2,
stroke: '#4CCDE4'
}
});
this.grouper.add(this.horizontalLine);
this.insideCircle = new Circle({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
cx: model.width / 5,
cy: model.height / 2,
r: model.width / 10
},
style: {
lineWidth: 1,
fill: 'rgba(0,0,0,0)',
stroke: '#0F0'
}
});
this.grouper.add(this.insideCircle);
this.topCircle = new Circle({
zlevel: this.zlevel,
z: this.z + 2,
shape: {
cx: model.width / 5,
cy: model.height / 2,
r: model.width / 10
},
style: {
fill: '#45607B'
}
});
this.grouper.add(this.topCircle);
this.underlyingRect = new Rect({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x: model.width * 7 / 40,
y: model.height / 2 - model.width / 5,
width: model.width / 20,
height: model.width / 5
},
style: {
lineWidth: 1,
fill: 'rgba(0,0,0,0)',
stroke: '#0F0'
}
});
this.grouper.add(this.underlyingRect);
this.topRect = new Rect({
zlevel: this.zlevel,
z: this.z + 2,
shape: {
x: model.width * 7 / 40,
y: model.height / 2 - model.width / 5,
width: model.width / 20,
height: model.width / 5
},
style: {
fill: '#45607B'
}
});
this.grouper.add(this.topRect);
this.lines = [];
for (let i = 0; i < 7; i++) {
const lightingLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width / 5 + Math.cos(Math.PI / 6 * i) * (model.width / 10 + 2),
y1: model.height / 2 + Math.sin(Math.PI / 6 * i) * (model.width / 10 + 2),
x2: model.width / 5 + Math.cos( Math.PI / 6 * i) * (model.width / 5 - 2),
y2: model.height / 2 + Math.sin(Math.PI / 6 * i) * (model.width / 5 - 2)
},
style: {
lineWidth: 1,
stroke: '#0F0'
}
});
this.grouper.add(lightingLine);
this.lines.push(lightingLine);
}
this.topText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.width * 7 / 10,
y: model.height / 4,
fontSize: model.topFontSize,
fontFamily: 'consolas',
text: model.topContext,
textFill: model.topTextFill,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'middle',
textLineHeight: model.topFontSize
}
});
this.grouper.add(this.topText);
this.bottomText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.width * 7 / 10,
y: model.height * 3 / 4,
fontSize: model.bottomFontSize,
fontFamily: 'consolas',
text: model.bottomContext,
textFill: model.bottomTextFill,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'middle',
textLineHeight: model.bottomFontSize
}
});
this.grouper.add(this.bottomText);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -34,7 +34,7 @@ export default class line extends Group {
} }
}); });
if (model.classify == 'dashed') { if (model.classify == 'dashed') {
this.iscsLine.setStyle('lineDash', [2, 2]); this.iscsLine.setStyle('lineDash', [8, 6]);
} }
this.grouper.add(this.iscsLine); this.grouper.add(this.iscsLine);
this.add(this.grouper); this.add(this.grouper);

View File

@ -10,7 +10,7 @@ export default class manualAlarmButton extends Group {
this._type = device.model._type; this._type = device.model._type;
this._code = device.model.code; this._code = device.model.code;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.zlevel; this.z = device.model.z;
this.create(); this.create();
} }
create() { create() {
@ -21,7 +21,7 @@ export default class manualAlarmButton extends Group {
this.add(this.grouper); this.add(this.grouper);
this.rect = new Rect({ this.rect = new Rect({
zlevel: this.model.zlevel, zlevel: this.model.zlevel,
z: this.model.z - 1, z: this.model.z,
shape: { shape: {
x: 0, x: 0,
y: 0, y: 0,
@ -37,7 +37,7 @@ export default class manualAlarmButton extends Group {
this.grouper.add(this.rect); this.grouper.add(this.rect);
this.text = new Text({ this.text = new Text({
zlevel: this.model.zlevel, zlevel: this.model.zlevel,
z: this.model.z, z: this.model.z + 1,
style: { style: {
x: 0, x: 0,
y: this.model.width * 2 / 5, y: this.model.width * 2 / 5,
@ -56,7 +56,7 @@ export default class manualAlarmButton extends Group {
this.grouper.add(this.text); this.grouper.add(this.text);
this.circleOutside = new Circle({ this.circleOutside = new Circle({
zlevel: this.model.zlevel, zlevel: this.model.zlevel,
z: this.model.z, z: this.model.z + 1,
shape: { shape: {
cx: this.model.width * 2 / 3, cx: this.model.width * 2 / 3,
cy: this.model.width * 2.2 / 3, cy: this.model.width * 2.2 / 3,
@ -69,7 +69,7 @@ export default class manualAlarmButton extends Group {
this.grouper.add(this.circleOutside); this.grouper.add(this.circleOutside);
this.circleInside = new Circle({ this.circleInside = new Circle({
zlevel: this.model.zlevel, zlevel: this.model.zlevel,
z: this.model.z, z: this.model.z + 1,
shape: { shape: {
cx: this.model.width * 2 / 3, cx: this.model.width * 2 / 3,
cy: this.model.width * 2.2 / 3, cy: this.model.width * 2.2 / 3,

View File

@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle';
const stateMap = { const stateMap = {
slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障', slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障',
slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障', slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障',
@ -20,25 +21,32 @@ const stateMap = {
systemControlPowerFailure: '系统控制电源故障', systemControlPowerFailure: '系统控制电源故障',
monitorPowerFailure: '监视电源故障', monitorPowerFailure: '监视电源故障',
fieldBusFault:'现场总线故障', fieldBusFault:'现场总线故障',
fasSystemFailure: { default: '正常'}, // 火灾系统故障 fasSystemFailure: { default: '正常', color: '#38984F'}, // 火灾系统故障
facpAutoMode: { default: '手动' }, // FACP自动状态 facpAutoMode: { default: '手动', color: '#38984F'}, // FACP自动状态
gesControlStatus: { default: '手动'}, // 气灭控制系统状态 gesControlStatus: { default: '手动', color: '#38984F'}, // 气灭控制系统状态
hydrantStartupStatus: { default: '停止'}, // 消火栓泵启动状态 hydrantStartupStatus: { default: '停止', color: '#38984F'}, // 消火栓泵启动状态
tscFireCondition: { default: '正常'}, // 感温电缆火警状态 tscFireCondition: { default: '正常', color: '#38984F'}, // 感温电缆火警状态
aEquipmentAreaFireDetector: { default: '正常'}, // 站厅A端设备区点型火灾探测器 aEquipmentAreaFireDetector: { default: '正常', color: '#38984F'}, // 站厅A端设备区点型火灾探测器
bEquipmentAreaFireDetector: { default: '正常'}, // 站厅B端设备区点型火灾探测器 bEquipmentAreaFireDetector: { default: '正常', color: '#38984F'}, // 站厅B端设备区点型火灾探测器
pcaFireDetector: { default: '正常' }, // 站台公共区点型火灾探测器 pcaFireDetector: { default: '正常', color: '#38984F' }, // 站台公共区点型火灾探测器
scaFireDetector: { default: '正常'}, // 站厅公共区点型火灾探测器 scaFireDetector: { default: '正常', color: '#38984F'}, // 站厅公共区点型火灾探测器
elevatorCutFirePowerSupply: { default: '正常'}, // 站内垂直电梯切非站台B消 elevatorCutFirePowerSupply: { default: '正常', color: '#38984F'}, // 站内垂直电梯切非站台B消
otherCutFirePowerSupply: { default: '正常'}, // 其他切非回路站台B消 otherCutFirePowerSupply: { default: '正常', color: '#38984F'}, // 其他切非回路站台B消
inDownLeftManualAlarm: { default: '正常' }, // 站内下行左线手动报警按钮 inDownLeftManualAlarm: { default: '正常', color: '#38984F' }, // 站内下行左线手动报警按钮
inUpRightManualAlarm: { default: '正常'}, // 站内上行右线手动报警按钮 inUpRightManualAlarm: { default: '正常', color: '#38984F'}, // 站内上行右线手动报警按钮
outDownLeftManualAlarm: { default: '正常'}, // 站间下行左线手动报警按钮 outDownLeftManualAlarm: { default: '正常', color: '#38984F'}, // 站间下行左线手动报警按钮
outUpRightManualAlarm: { default: '正常'}, // 站间上行右线手动报警按钮 outUpRightManualAlarm: { default: '正常', color: '#38984F'}, // 站间上行右线手动报警按钮
inDownLeftHydrant: { default: '正常'}, // 站内下行左线消火栓按钮 inDownLeftHydrant: { default: '正常', color: '#38984F'}, // 站内下行左线消火栓按钮
inUpRightHydrant: { default: '正常'}, // 站内上行右线消火栓按钮 inUpRightHydrant: { default: '正常', color: '#38984F'}, // 站内上行右线消火栓按钮
outDownLeftHydrant: { default: '正常'}, // 站间下行左线消火栓按钮 outDownLeftHydrant: { default: '正常', color: '#38984F'}, // 站间下行左线消火栓按钮
outUpRightHydrant: { default: '正常'} // 站间上行右线消火栓按钮 outUpRightHydrant: { default: '正常', color: '#38984F'}, // 站间上行右线消火栓按钮
videoServerStatus: { default: true, type: 'Circle', color: '#4CCDE4'}, // 视屏服务器状态
dataServerStatus: { default: true, type: 'Circle', color: '#4CCDE4'}, // 数据服务器状态
mediaServerStatus: { default: true, type: 'Circle', color: '#4CCDE4'}, // 媒体交换服务器状态
decoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 解码器状态
quadDecoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 四路解码器状态
quadDecoderModeState: { default: '监视器', color: '#4CCDE4'}, // 四路解码器模式状态
controlKeyboardState: { default: true, type: 'Circle', color: '#4CCDE4'} // 控制键盘状态
}; };
export default class StateTable extends Group { export default class StateTable extends Group {
@ -168,26 +176,44 @@ export default class StateTable extends Group {
model.tableData.forEach((item, i)=> { model.tableData.forEach((item, i)=> {
let width = 0; let width = 0;
model.columnWidthList.forEach((elem, j) => { model.columnWidthList.forEach((elem, j) => {
const text = new Text({ if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].type === 'Circle') {
zlevel: model.zlevel, const circle = new Circle({
z: model.z + 1, zlevel: model.zlevel,
_subType: stateMap[item['column' + (j + 1)]], z: model.z + 1,
style:{ _subType: stateMap[item['column' + (j + 1)]],
x: elem / 2 + width, shape: {
y: model.rowHeight * (i + contentIndex), cx: elem / 2 + width,
fontWeight: 'normal', cy: model.rowHeight * (i + contentIndex) - model.rowHeight / 2,
fontSize: model.fontSize, r: model.rowHeight / 3
fontFamily: 'consolas', },
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)], style: {
textFill: stateMap[item['column' + (j + 1)]] ? '#38984F' : '#4CCDE4', fill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : '#4CCDE4'
textAlign: 'center', }
textPosition: 'inside', });
textVerticalAlign: 'bottom', this.grouper.add(circle);
textLineHeight: model.rowHeight this.tabelContent.push(circle);
} } else {
}); const text = new Text({
this.grouper.add(text); zlevel: model.zlevel,
this.tabelContent.push(text); z: model.z + 1,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: elem / 2 + width,
y: model.rowHeight * (i + contentIndex),
fontWeight: 'normal',
fontSize: model.fontSize,
fontFamily: 'consolas',
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)],
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : '#4CCDE4',
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'bottom',
textLineHeight: model.rowHeight
}
});
this.grouper.add(text);
this.tabelContent.push(text);
}
width += elem; width += elem;
}); });
}); });

View File

@ -157,6 +157,15 @@ export function parser(data) {
zrUtil.each(data.stateTableList || [], elem=> { zrUtil.each(data.stateTableList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.StateTable, elem); iscsDevice[elem.code] = deviceFactory(deviceType.StateTable, elem);
}); });
zrUtil.each( data.lightingGroupList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.LightingGroup, elem);
});
zrUtil.each(data.balancedElectricList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.BalancedElectric, elem);
});
zrUtil.each(data.electricButterflyValveList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.ElectricButterflyValve, elem);
});
} }
return iscsDevice; return iscsDevice;
@ -293,6 +302,15 @@ export function updateIscsData(state, device) {
case deviceType.StateTable: case deviceType.StateTable:
updateIscsListByDevice(state, 'stateTableList', device); updateIscsListByDevice(state, 'stateTableList', device);
break; break;
case deviceType.LightingGroup:
updateIscsListByDevice(state, 'lightingGroupList', device);
break;
case deviceType.BalancedElectric:
updateIscsListByDevice(state, 'balancedElectricList', device);
break;
case deviceType.ElectricButterflyValve:
updateIscsListByDevice(state, 'electricButterflyValveList', device);
break;
} }
// store.dispatch('iscs/setIscsData', state.iscs); // store.dispatch('iscs/setIscsData', state.iscs);
} }

View File

@ -203,14 +203,14 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
scope.modelmanager.switchmodel.code = data.code; scope.modelmanager.switchmodel.code = data.code;
scope.showmodel = scope.modelmanager.switchmodel.mesh; scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel); scope.scene.add(scope.showmodel);
// scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh); scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh);
scope.nowobject = scope.modelmanager.switchmodel.mesh; scope.nowobject = scope.modelmanager.switchmodel.mesh;
// updatemenulist(scope.devicetext.devicelist); updatemenulist(scope.devicetext.devicelist);
scope.raycasterstatus = true; scope.raycasterstatus = true;
}else{ }else{
scope.raycasterstatus = false; scope.raycasterstatus = false;
scope.nowobject = ""; scope.nowobject = "";
// updatemenulist(); updatemenulist();
} }
if (data.type == "SIGNAL") { if (data.type == "SIGNAL") {
scope.modelmanager.signalmodel.code = data.code; scope.modelmanager.signalmodel.code = data.code;

View File

@ -0,0 +1,85 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
// 定于仿真socket接口
export function PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,routegroup) {
const scope = this;
this.controlstation = nowstation;
this.teststomp = new StompClient();
let trainleftnow = null;
let trainrightnow = null;
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
const data = JSON.parse(Response.body);
if(data.type == "DeviceCtrl_3D"){
//PS目前模型车门位置颠倒
if(data.body.type == "PSD"){
if(data.body.code == nowstation.toppsd){
if(data.body.open == 0){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
}else{
deviceaction.down.action.reset();
deviceaction.down.action.time = 0;
deviceaction.down.action.timeScale = 1;
deviceaction.down.action.play();
}
}
if(data.body.code == nowstation.downpsd){
if(data.body.open == 0){
deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration;
deviceaction.top.action.timeScale = -1;
deviceaction.top.action.play();
}else{
deviceaction.top.action.reset();
deviceaction.top.action.time = 0;
deviceaction.top.action.timeScale = 1;
deviceaction.top.action.play();
}
}
}
if(data.body.type == "TRAIN_DOOR"){
}
}
if(data.type == "TrainRun_3D"){
console.log(data.body);
console.log(nowstation);
for(let i=0,leni = data.body.length;i<leni;i++){
if(data.body[i].section == scope.controlstation.topsection){
}
if(data.body[i].section == scope.controlstation.downsection){
}
}
}
// console.log(data);
}
}

View File

@ -26,6 +26,8 @@ let originhuman1 = null;
let originhuman2 = null; let originhuman2 = null;
let originanima1 = null; let originanima1 = null;
let originanima2 = null; let originanima2 = null;
let lefttrain = null;
let righttrain = null;
let moveanimatelist = []; let moveanimatelist = [];
let zhajiin = []; let zhajiin = [];
@ -805,7 +807,7 @@ export function Jl3dpassflow(dom) {
} }
function zhajicontrol(type,door){ function zhajicontrol(type,door){
let devicenum = door-1; let devicenum = door-1;
if(type == "in"){ if(type == "in"){
deviceaction[zhajiin[devicenum].id].action.reset(); deviceaction[zhajiin[devicenum].id].action.reset();

View File

@ -12,6 +12,9 @@ import { Pathfinding } from '@/jlmap3d/jl3dpassflow/utils/Pathfinding.js';
// const Pathfinding = window.threePathfinding.Pathfinding; // const Pathfinding = window.threePathfinding.Pathfinding;
import { ZoneManager } from '@/jlmap3d/jl3dpassflow/model/zonemanager.js'; import { ZoneManager } from '@/jlmap3d/jl3dpassflow/model/zonemanager.js';
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import { PassflowConnect } from '@/jlmap3d/jl3dpassflow/connect/passflowconnect.js';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
@ -38,7 +41,8 @@ let originhuman1 = null;
let originhuman2 = null; let originhuman2 = null;
let originanima1 = null; let originanima1 = null;
let originanima2 = null; let originanima2 = null;
let lefttrain = null;
let righttrain = null;
let zhajiin = []; let zhajiin = [];
let zhajiout = []; let zhajiout = [];
@ -143,7 +147,7 @@ var views = [
]; ];
export function Jl3dpassflow(dom) { export function Jl3dpassflow(dom,skinCode,routegroup) {
var scope = this; var scope = this;
this.dom = dom; this.dom = dom;
@ -235,6 +239,9 @@ export function Jl3dpassflow(dom) {
let mouse = new THREE.Vector2(); let mouse = new THREE.Vector2();
let raycaster = new THREE.Raycaster(); let raycaster = new THREE.Raycaster();
var loader = new THREE.OBJLoader(); var loader = new THREE.OBJLoader();
// load a resource // load a resource
@ -358,13 +365,20 @@ export function Jl3dpassflow(dom) {
this.modelmanager = new ModelManager(); this.modelmanager = new ModelManager();
let loadingInstance = Loading.service({ fullscreen: true }); let loadingInstance = Loading.service({ fullscreen: true });
let nowstation = null;
let stationlist = [];
let socktest = null;
this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) { this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
// console.log(scope.modelmanager); console.log(scope.modelmanager);
initstationanimation(scope.modelmanager.station.mesh); initstationanimation(scope.modelmanager.station.mesh);
initzhajiinaimation(scope.modelmanager.zhajiin.mesh); initzhajiinaimation(scope.modelmanager.zhajiin.mesh);
initzhajioutanimation(scope.modelmanager.zhajiout.mesh); initzhajioutanimation(scope.modelmanager.zhajiout.mesh);
inittrain(scope.modelmanager.train.mesh);
scene.add(scope.modelmanager.section.mesh); scene.add(scope.modelmanager.section.mesh);
scene.add(scope.modelmanager.train.mesh); // scene.add(scope.modelmanager.train.mesh);
level = scope.modelmanager.station.mesh; level = scope.modelmanager.station.mesh;
monitor = scope.modelmanager.monitor.mesh; monitor = scope.modelmanager.monitor.mesh;
@ -377,7 +391,14 @@ export function Jl3dpassflow(dom) {
loadingInstance.close(); loadingInstance.close();
scope.switchrender(true); scope.switchrender(false);
getPublishMapDetail(skinCode).then(netdata => {
console.log(netdata);
initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
socktest = new PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,routegroup);
});
animate(); animate();
}) })
@ -446,15 +467,14 @@ export function Jl3dpassflow(dom) {
newhumancreate(stationzon.getinitposition("entergate"),2); newhumancreate(stationzon.getinitposition("entergate"),2);
} }
for(let i=0;i<6;i++){ for(let i=0;i<6;i++){
newhumancreate(stationzon.getinitposition("standtop"),3); newhumancreate(stationzon.getinitposition("standtop"),4);
} }
for(let i=0;i<6;i++){ for(let i=0;i<6;i++){
newhumancreate(stationzon.getinitposition("standdown"),3); newhumancreate(stationzon.getinitposition("standdown"),4);
} }
for(let i=0;i<5;i++){ for(let i=0;i<5;i++){
newhumancreate(stationzon.getinitposition("exitgate"),4); newhumancreate(stationzon.getinitposition("exitgate"),4);
} }
console.log(humanlist);
} }
function startWorker(){ function startWorker(){
initpasser(); initpasser();
@ -470,6 +490,11 @@ export function Jl3dpassflow(dom) {
mixers[i].update( delta ); mixers[i].update( delta );
} }
} }
for(let i=humanlist.children.length-1;i>=0;i--){
if(humanlist.children[i].mixer._actions[0].isRunning()){
humanlist.children[i].mixer.update( delta );
}
}
}; };
stationwebwork.onmessage = function (event) { stationwebwork.onmessage = function (event) {
@ -511,13 +536,13 @@ export function Jl3dpassflow(dom) {
if(humanlist.children[i].status == 0){ if(humanlist.children[i].status == 0){
if(humanlist.children[i].stage == 0){ if(humanlist.children[i].stage == 0){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position );
targetPosition = stationzon.getzoneposition("security");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID );
let points = []; let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z)); points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("security");
path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
for(let i=0;i<path.length;i++){ for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z)); points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
} }
@ -526,14 +551,14 @@ export function Jl3dpassflow(dom) {
} }
if(humanlist.children[i].stage == 1){ if(humanlist.children[i].stage == 1){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("entergate"); targetPosition = stationzon.getzoneposition("entergate");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
let points = []; for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z)); points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
} }
moveanimateinit(humanlist.children[i],i,points,i); moveanimateinit(humanlist.children[i],i,points,i);
@ -551,21 +576,28 @@ export function Jl3dpassflow(dom) {
var direct = Math.floor(Math.random()*(3-1+1))+1; var direct = Math.floor(Math.random()*(3-1+1))+1;
let points = []; let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z)); points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
// points.push(new THREE.Vector3(11.81,9.8,13.11));
//1--top //1--top
//2-- down //2-- down
if(direct == 1){ if(direct == 1){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("standtop"); targetPosition = stationzon.getzoneposition("standtop");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
}else{ }else{
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("standdown"); targetPosition = stationzon.getzoneposition("standdown");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
}
if(path[0].y<9.84){
points.push(new THREE.Vector3(11.81,9.8,13.11));
points.push(new THREE.Vector3(29.5,1.77,13.16));
} }
for(let i=0;i<path.length;i++){ for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z)); points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
} }
moveanimateinit(humanlist.children[i],i,points,i); moveanimateinit(humanlist.children[i],i,points,i);
} }
// //出站 // //出站
@ -600,13 +632,13 @@ export function Jl3dpassflow(dom) {
// // moveanimateinit(humans[i],i,points,i,0.002); // // moveanimateinit(humans[i],i,points,i,0.002);
// } // }
if(humanlist.children[i].stage == 4){ if(humanlist.children[i].stage == 4){
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("exitgate"); targetPosition = stationzon.getzoneposition("exitgate");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
let points = [];
points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z));
for(let i=0;i<path.length;i++){ for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z)); points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
} }
@ -628,18 +660,20 @@ export function Jl3dpassflow(dom) {
//1--top //1--top
//2-- down //2-- down
if(direct == 1){ if(direct == 1){
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("exit1"); targetPosition = stationzon.getzoneposition("exit1");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
}else{ }else{
groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); groupID = pathfinder.getGroup( ZONE, points[0] );
targetPosition = stationzon.getzoneposition("exit2"); targetPosition = stationzon.getzoneposition("exit2");
path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID );
} }
for(let i=0;i<path.length;i++){ for(let i=0;i<path.length;i++){
points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z)); points.push(new THREE.Vector3(path[i].x,path[i].y,path[i].z));
} }
moveanimateinit(humanlist.children[i],i,points,i); moveanimateinit(humanlist.children[i],i,points,i);
} }
} }
} }
@ -649,7 +683,7 @@ export function Jl3dpassflow(dom) {
function moveanimateinit(model,name,points,index){ function moveanimateinit(model,name,points,index){
model.status = 1; model.status = 1;
let curve = new THREE.CatmullRomCurve3(points); let curve = new THREE.CatmullRomCurve3(points);
curve.curvrtype = "centripetal"; curve.curvrtype = "catmullrom";
// curve.getLength(); // curve.getLength();
// curve动画轨迹 // curve动画轨迹
// progress动画进度 // progress动画进度
@ -671,10 +705,7 @@ export function Jl3dpassflow(dom) {
//更新模型坐标 //更新模型坐标
if(humanlist.children[i].status == 1){ if(humanlist.children[i].status == 1){
// humanlist.children[i].runrail.enable = false; // humanlist.children[i].runrail.enable = false;
humanlist.children[i].progress = 1;
// humanlist.children[i].mixer.runplay = false;
humanlist.children[i].action.stop();
humanlist.children[i].status = 0;
// if(humanlist.children[i].stage == 4){ // if(humanlist.children[i].stage == 4){
// //
@ -682,6 +713,12 @@ export function Jl3dpassflow(dom) {
// // humans.splice(i,1); // // humans.splice(i,1);
// } // }
// //
humanlist.children[i].progress = 1;
// humanlist.children[i].mixer.runplay = false;
humanlist.children[i].action.stop();
humanlist.children[i].status = 0;
if(humanlist.children[i].stage == 6){ if(humanlist.children[i].stage == 6){
humanlist.remove(humanlist.children[i]); humanlist.remove(humanlist.children[i]);
// humanlist.children[i].stage = 7; // humanlist.children[i].stage = 7;
@ -773,11 +810,149 @@ export function Jl3dpassflow(dom) {
newhuman.mixer = mixer; newhuman.mixer = mixer;
newhuman.runrail = null; newhuman.runrail = null;
newhuman.speed = 0; newhuman.speed = 0;
mixers.push(mixer); newhuman.mixer = mixer;
humanlist.add(newhuman); humanlist.add(newhuman);
// console.log(humanlist.children.length);
}
function initstationlist(stationdata,standdata,psddata){
let list = [];
for(let i=0,leni = standdata.length;i<leni;i++){
for(let j=0,lenj = psddata.length;j<lenj;j++){
if(standdata[i].code == psddata[j].standCode){
standdata[i].name = psddata[j].code;
}
}
}
for(let i=0,leni = stationdata.length;i<leni;i++){
if(stationdata[i].depot == false){
list[stationdata[i].name] = [];
for(let j=0,lenj = standdata.length;j<lenj;j++){
if(standdata[j].stationCode == stationdata[i].code){
list[stationdata[i].name].push(standdata[j]);
}
}
}
}
for(let k in list){
if(list[k].length>0){
let stationobject = {
code : list[k][0].stationCode,
name : k,
toppsd:null,
downpsd:null,
topsection:null,
downsection:null,
};
if(list[k][0].position.y>list[k][1].position.y){
stationobject.toppsd = list[k][0].name;
stationobject.downpsd = list[k][1].name;
stationobject.topsection = list[k][0].standTrackCode;
stationobject.downsection = list[k][1].standTrackCode;
}else{
stationobject.toppsd = list[k][1].name;
stationobject.downpsd = list[k][0].name;
stationobject.topsection = list[k][1].standTrackCode;
stationobject.downsection = list[k][0].standTrackCode;
}
stationlist.push(stationobject);
}
}
nowstation = stationlist[0];
updatestationlist(stationlist);
console.log(nowstation);
}
function inittrain(object){
let ntracks1,ntracks2,tclip,fclip;
ntracks1 = object.animations.slice(16,27);
tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks2 = object.animations.slice(0,15);
fclip = new THREE.AnimationClip("four",2,ntracks2);
lefttrain = object.clone(true);
lefttrain.action = {
top:[],
down:[]
};
righttrain = object.clone(true);
righttrain.action = {
top:[],
down:[]
};
inittrainanimation(lefttrain,tclip,fclip);
inittrainanimation(righttrain,tclip,fclip);
lefttrain.position.z = 30;
righttrain.position.z = -10;
// scene.add(lefttrain);
// scene.add(righttrain);
} }
function inittrainanimation(train,tclip,fclip){
for(let j=0;j<train.children.length;j++){
if(train.children[j].name == "c1" || train.children[j].name == "c6"){
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
if(train.children[j].children[n].name == "top"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(tclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.top.push(action);
mixers.push(mixer);
}
if(train.children[j].children[n].name == "down"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(tclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.down.push(action);
mixers.push(mixer);
}
}
}else{
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
if(train.children[j].children[n].name == "top"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.top.push(action);
mixers.push(mixer);
}
if(train.children[j].children[n].name == "down"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true;
train.action.down.push(action);
mixers.push(mixer);
}
}
}
}
}
function initstationanimation(object){ function initstationanimation(object){
let mixer = new THREE.AnimationMixer( object ); let mixer = new THREE.AnimationMixer( object );
@ -794,7 +969,7 @@ export function Jl3dpassflow(dom) {
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
// action.play(); // action.play();
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -813,7 +988,7 @@ export function Jl3dpassflow(dom) {
// action.play(); // action.play();
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -823,6 +998,7 @@ export function Jl3dpassflow(dom) {
} }
} }
station = object; station = object;
// console.log(deviceaction);
scene.add(object); scene.add(object);
} }
@ -841,7 +1017,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -858,7 +1034,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -875,7 +1051,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -892,7 +1068,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -909,7 +1085,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -939,7 +1115,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -956,7 +1132,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -973,7 +1149,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -990,7 +1166,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,
@ -1007,7 +1183,7 @@ export function Jl3dpassflow(dom) {
let action =mixer.clipAction( newzhaji.children[i].animations[0]); let action =mixer.clipAction( newzhaji.children[i].animations[0]);
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
mixer.runplay = true;
mixers.push(mixer); mixers.push(mixer);
let device = { let device = {
action:action, action:action,

View File

@ -20,6 +20,7 @@ export function ModelManager(){
this.station = { this.station = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
@ -27,12 +28,14 @@ export function ModelManager(){
this.zhajiin = { this.zhajiin = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
this.zhajiout = { this.zhajiout = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
@ -40,6 +43,7 @@ export function ModelManager(){
this.monitor = { this.monitor = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
@ -47,6 +51,7 @@ export function ModelManager(){
this.train = { this.train = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
@ -55,6 +60,7 @@ export function ModelManager(){
this.section = { this.section = {
code:null, code:null,
screenDoorOpenStatus:"01", screenDoorOpenStatus:"01",
animations:null,
mesh:null, mesh:null,
action:null action:null
}; };
@ -95,8 +101,28 @@ function fbxpromise(asset,mixers,model){
// child.receiveShadow = true; // child.receiveShadow = true;
// } // }
// } ); // } );
if(asset.deviceType == "train"){
// let mixer = new THREE.AnimationMixer( object );
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
model.mesh = object; object.children[i].position.x = object.children[i].position.x;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
model.mesh = realtrain;
model.mesh.animations = object.animations[0].tracks;
//
}else{
model.mesh = object;
}

View File

@ -19,8 +19,8 @@ let enter2 = {
stage : "0", stage : "0",
randompoint : new THREE.Vector3(27,9.8,16), randompoint : new THREE.Vector3(27,9.8,16),
railpoints : [ railpoints : [
new THREE.Vector3(35,9.8,31.5), new THREE.Vector3(34,9.8,31.5),
new THREE.Vector3(31,9.8,31.5) new THREE.Vector3(32,9.8,31.5)
] ]
}; };
@ -43,11 +43,11 @@ let entergate = {
stage : "2", stage : "2",
randompoint : new THREE.Vector3(2.3,9.8,13), randompoint : new THREE.Vector3(2.3,9.8,13),
railpoints : [ railpoints : [
new THREE.Vector3(6.3,9.8,17.4), new THREE.Vector3(6.3,9.8,18.1),
new THREE.Vector3(4.8,9.8,17.4), new THREE.Vector3(4.8,9.8,18.1),
new THREE.Vector3(3.4,9.8,17.4), new THREE.Vector3(3.4,9.8,18.1),
new THREE.Vector3(2.1,9.8,17.4), new THREE.Vector3(2.1,9.8,18.1),
new THREE.Vector3(0.7,9.8,17.4) new THREE.Vector3(0.7,9.8,18.1)
] ]
}; };
@ -82,11 +82,11 @@ let exitgate = {
stage : "5", stage : "5",
randompoint : new THREE.Vector3(-16,9.8,-0.4), randompoint : new THREE.Vector3(-16,9.8,-0.4),
railpoints : [ railpoints : [
new THREE.Vector3(18.8,9.8,-0.27), new THREE.Vector3(18,9.8,-0.27),
new THREE.Vector3(18.8,9.8,1.18), new THREE.Vector3(18,9.8,1.18),
new THREE.Vector3(18.8,9.8,2.64), new THREE.Vector3(18,9.8,2.64),
new THREE.Vector3(18.8,9.8,4.1), new THREE.Vector3(18,9.8,4.1),
new THREE.Vector3(18.8,9.8,5.4) new THREE.Vector3(18,9.8,5.4)
] ]
}; };
@ -109,8 +109,8 @@ let exit2 = {
stage : "6", stage : "6",
randompoint : new THREE.Vector3(), randompoint : new THREE.Vector3(),
railpoints : [ railpoints : [
new THREE.Vector3(28.3,9.8,28.8), new THREE.Vector3(28.3,9.8,28),
new THREE.Vector3(31.2,9.8,28.8) new THREE.Vector3(30.2,9.8,28)
] ]
}; };

View File

@ -419,9 +419,7 @@ class Jlmap {
} else { } else {
if (elem.deviceType === 'TRAIN') { if (elem.deviceType === 'TRAIN') {
store.dispatch('map/updateTrainState', elem); store.dispatch('map/updateTrainState', elem);
if (index >= list.length - 1) { store.dispatch('map/setActiveTrainList', elem);
store.dispatch('map/setTrainListUpdate');
}
} else if (elem.deviceType === 'STAND') { } else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem); store.dispatch('map/updateStationStand', elem);
} }

View File

@ -588,10 +588,15 @@ class Signal extends Group {
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭 model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
/** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过 // 联锁自动进路通过
model.fleetMode && this.setAutoRouteOpen(); model.fleetMode && this.setAutoRouteOpen();
// 联锁自动触发
if (model.ciControl) {
this.setAutoTriggerOpen();
} else {
!model.atsControl && this.setArtificialRouteClose(); /** 进路交人工控或自动控 */
}
// 设置点灯类型 必须在最后设置不能放前面 logicLight 0 物理点灯 1 逻辑点灯 // 设置点灯类型 必须在最后设置不能放前面 logicLight 0 物理点灯 1 逻辑点灯
if (model.logicLight) { if (model.logicLight) {
this.logicalLight(); // 设置逻辑点灯 this.logicalLight(); // 设置逻辑点灯

View File

@ -194,8 +194,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
textAlign: 'center', textAlign: 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'top'
}); });
this.add(this.travelSigns); this.add(this.travelSigns);
} }
@ -211,8 +211,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
textAlign: 'center', textAlign: 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'top'
}); });
this.add(this.crewNum); this.add(this.crewNum);
} }
@ -228,8 +228,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
textAlign: 'center', textAlign: 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'top'
}); });
this.add(this.travelNum); this.add(this.travelNum);
} }
@ -245,8 +245,8 @@ export default class TrainBody extends Group {
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
textAlign: 'center', textAlign: 'left',
textVerticalAlign: 'middle' textVerticalAlign: 'top'
}); });
this.add(this.delayTime); this.add(this.delayTime);
} }

View File

@ -146,12 +146,16 @@ export default {
// //
cancelTrainRoute() { cancelTrainRoute() {
this.loading = true; this.loading = true;
commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 2).then(({valid})=>{ commitOperate(menuOperate.Signal.cancelTrainRoute, {}, 1).then(({valid, operate})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['messages'] = `取消以信号机${this.selected.name}为始端的进路,该进路即将由自动信号模式转为人工模式!`;
this.$refs.confirmControl.doShow(operate);
} }
}).catch(() => { }).catch((error) => {
console.log(error);
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
@ -198,7 +202,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -218,7 +222,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -238,7 +242,7 @@ export default {
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
@ -259,7 +263,7 @@ export default {
this.doClose(); this.doClose();
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -166,7 +166,7 @@ export default {
// //
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置'; this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
// //
this.treeData[0].children[2].value = selected.parkingTime == 0 ? '自动' : `${selected.parkingTime}`; this.treeData[0].children[2].value = selected.parkingTime <= 0 ? '自动' : `${selected.parkingTime}`;
// //
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置'; this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') { // if (selected.direction == '01') {

View File

@ -71,13 +71,18 @@ export default {
handler: this.unlock, handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
}, },
{
label: '信号关灯',
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{ {
label: '信号重开', label: '信号重开',
handler: this.reopenSignal, handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
}, },
{ {
label: '进路引导', label: '引导进路办理',
handler: this.guide, handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
}, },
@ -102,9 +107,19 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
}, },
{ {
label: '信号关灯', label: '进路交人工控',
handler: this.signalClose, handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路状态',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
} }
], ],
Center: [ Center: [
@ -314,6 +329,22 @@ export default {
} }
}); });
}, },
//
setAutoTrigger() {
commitOperate(menuOperate.Signal.setAutoTrigger, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
},
//
cancelAutoTrigger() {
commitOperate(menuOperate.Signal.cancelAutoTrigger, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
},
// //
signalClose() { signalClose() {
commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{ commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{

View File

@ -43,6 +43,11 @@ export default {
menu: [], menu: [],
menuNormal: { menuNormal: {
Local: [ Local: [
{
label: '上电解锁',
handler: this.powerUnLock,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK
},
{ {
label: '全站设置联锁自动触发', label: '全站设置联锁自动触发',
handler: this.setAutoTrigger, handler: this.setAutoTrigger,
@ -52,13 +57,18 @@ export default {
label: '全站取消联锁自动触发', label: '全站取消联锁自动触发',
handler: this.cancelAutoTrigger, handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
},
{
label: '所有进路交ATS自动控',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
},
{
label: '所有进路交人工控',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING
} }
// { // {
// label: '',
// handler: this.powerUnLock,
// cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
// },
// {
// label: '', // label: '',
// handler: this.execKeyOperationTest, // handler: this.execKeyOperationTest,
// cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST, // cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
@ -188,14 +198,15 @@ export default {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
operation: OperationEvent.Station.setAutoTrigger.menu.operation operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch(() => { }).catch(error => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow(error.message);
}); });
}, },
// //
@ -204,14 +215,15 @@ export default {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch(() => { }).catch(error => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow(error.message);
}); });
}, },
// //
@ -226,6 +238,8 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(operate, this.selected); this.$refs.stationCmdControl.doShow(operate, this.selected);
} }
}).catch(error => {
this.$refs.noticeInfo.doShow(error.message);
}); });
}, },
// //

View File

@ -68,7 +68,7 @@ export default {
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
{ {
label: '故障解锁', label: '道岔故障解锁',
handler: this.fault, handler: this.fault,
cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
}, },
@ -88,12 +88,12 @@ export default {
cmdType:CMD.Switch.CMD_SWITCH_ACTIVE cmdType:CMD.Switch.CMD_SWITCH_ACTIVE
}, },
{ {
label: '设置限速', label: '道岔设置限速',
handler: this.setSpeed, handler: this.setSpeed,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
}, },
{ {
label: '取消限速', label: '道岔取消限速',
handler: this.cancelSpeed, handler: this.cancelSpeed,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
} }

View File

@ -98,12 +98,12 @@ export const menuOperate = {
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
}, },
setAutoInterlock:{ setAutoInterlock:{
// 设置通过模式 // 设置通过模式 设置联锁自动进路
operation: OperationEvent.Signal.setAutoInterlock.menu.operation, operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
}, },
cancelAutoInterlock:{ cancelAutoInterlock:{
// 取消通过模式 // 取消通过模式 取消联锁自动进路
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation, operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
}, },
@ -125,6 +125,16 @@ export const menuOperate = {
// 取消自动折返 // 取消自动折返
operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation, operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
},
setAutoTrigger: {
// 设置联锁自动触发
operation: OperationEvent.Signal.setAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
cancelAutoTrigger: {
// 取消联锁自动触发
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
} }
}, },
Switch:{ Switch:{

View File

@ -199,10 +199,10 @@ export default {
CMD_STATION_SET_MASTER_GUIDE_LOCK: {value: 'Station_Set_Master_Guide_Lock', label: '设置引导总锁'}, CMD_STATION_SET_MASTER_GUIDE_LOCK: {value: 'Station_Set_Master_Guide_Lock', label: '设置引导总锁'},
/** 取消引导总锁 */ /** 取消引导总锁 */
CMD_STATION_CANCEL_MASTER_GUIDE_LOCK: {value: 'Station_Cancel_Master_Guide_Lock', label: '取消引导总锁'}, CMD_STATION_CANCEL_MASTER_GUIDE_LOCK: {value: 'Station_Cancel_Master_Guide_Lock', label: '取消引导总锁'},
/** 封锁车站所有信号机 */ // /** 封锁车站所有信号机 */
CMD_STATION_CANCEL_MASTER_GUIDE: {value: 'Station_Cancel_Master_Guide_Lock', label: '封锁集中站信号'}, // CMD_STATION_CANCEL_MASTER_GUIDE: {value: 'Station_Cancel_Master_Guide_Lock', label: '封锁集中站信号'},
/** 上电解锁 */ /** 上电解锁 */
CMD_STATION_POWER_ON_UNLOCK: {value: ' Station_Power_On_Unlock', label: '上电解锁'}, CMD_STATION_POWER_ON_UNLOCK: {value: 'Station_Power_On_Unlock', label: '上电解锁'},
/** 执行关键操作测试 */ /** 执行关键操作测试 */
CMD_STATION_KEY_OPERATION_TEST: {value: 'Station_Key_Operation_Test', label: '执行关键操作测试'} CMD_STATION_KEY_OPERATION_TEST: {value: 'Station_Key_Operation_Test', label: '执行关键操作测试'}
}, },

View File

@ -205,7 +205,8 @@ const map = {
updateCount: 0, // 绘图快捷修改标识 updateCount: 0, // 绘图快捷修改标识
mousemove: 0, // 实训战场图移动标识 mousemove: 0, // 实训战场图移动标识
version: '', // 地图版本, version: '', // 地图版本,
trainListUpdate:0, // 列车列表更新标识, activeTrainList:{}, // 当前按计划行车的列车列表,
activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识
runPlanStatus:false, // 是否正处于按计划行车 runPlanStatus:false, // 是否正处于按计划行车
showCentralizedStationCode: '', // 现地分集中站显示(集中站code) showCentralizedStationCode: '', // 现地分集中站显示(集中站code)
showCentralizedStationNum: 0, // 现地分集中站显示判断 showCentralizedStationNum: 0, // 现地分集中站显示判断
@ -719,8 +720,13 @@ const map = {
} }
}); });
}, },
setTrainListUpdate:(state) => { setActiveTrainList:(state, data) => {
state.trainListUpdate++; state.activeTrainList[data.code] = data;
state.activeTrainListUpdate++;
},
resetActiveTrainList:(state, data) => {
state.activeTrainList = {};
state.activeTrainListUpdate = 0;
}, },
setDeleteCount: (state) => { setDeleteCount: (state) => {
state.deleteCount++; state.deleteCount++;
@ -973,8 +979,11 @@ const map = {
setDeleteCount: ({ commit }) => { setDeleteCount: ({ commit }) => {
commit('setDeleteCount'); commit('setDeleteCount');
}, },
setTrainListUpdate: ({ commit }) => { setActiveTrainList: ({ commit }, data) => {
commit('setTrainListUpdate'); commit('setActiveTrainList', data);
},
resetActiveTrainList: ({ commit }) => {
commit('resetActiveTrainList');
}, },
setUpdateCount: ({ commit }) => { setUpdateCount: ({ commit }) => {
commit('setUpdateCount'); commit('setUpdateCount');

View File

@ -9,7 +9,7 @@
</template> </template>
<script> <script>
import { getPracticeByIdBasic} from '@/api/race'; import { getScriptByIdBasic} from '@/api/script';
export default { export default {
name: 'ScriptDraft', name: 'ScriptDraft',
@ -20,7 +20,7 @@ export default {
return ''; return '';
} }
}, },
raceList:{ mapList:{
type: Array, type: Array,
default() { default() {
return ''; return '';
@ -39,19 +39,12 @@ export default {
}; };
}, },
computed: { computed: {
raceInfoList() {
const racelist = [];
this.raceList.forEach(each=>{
racelist.push({label:each.name, value:each.id});
});
return racelist;
},
form() { form() {
const form = { const form = {
labelWidth: '120px', labelWidth: '120px',
items: [ items: [
{ prop: 'name', label: '实操名称', type: 'text' }, { prop: 'name', label: '实操名称', type: 'text' },
{ prop:'raceId', label:'竞赛名称', type:'select', options:this.raceInfoList, disabled:this.isEdit}, { prop:'mapId', label:'实操地图', type:'select', options:this.mapList, disabled:this.isEdit},
{ prop: 'description', label: '实操描述', type: 'textarea' } { prop: 'description', label: '实操描述', type: 'textarea' }
] ]
}; };
@ -67,8 +60,8 @@ export default {
{ validator: this.validateDescription, trigger: 'blur' }, { validator: this.validateDescription, trigger: 'blur' },
{ validator: this.validateDescription, trigger: 'change' } { validator: this.validateDescription, trigger: 'change' }
], ],
raceId:[ mapId:[
{ required: true, message: '请选择竞赛', trigger: 'change' } { required: true, message: '请选择地图', trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -93,15 +86,15 @@ export default {
}, },
doShow(questid) { doShow(questid) {
if (questid) { if (questid) {
getPracticeByIdBasic(questid).then(resp=>{ getScriptByIdBasic(questid).then(resp=>{
const data = {'name':resp.data.name, 'description':resp.data.description, 'mapId':resp.data.mapId}; const data = {'name':resp.data.name, 'description':resp.data.description, 'mapId':resp.data.mapId, isRace:resp.data.isRace};
this.formModel = data; this.formModel = data;
this.formModel.id = questid; this.formModel.id = questid;
this.dialogVisible = true; this.dialogVisible = true;
this.isEdit = true; this.isEdit = true;
}); });
} else { } else {
this.formModel.mapId = this.$route.params.mapId; this.formModel.isRace = true;
this.dialogVisible = true; this.dialogVisible = true;
this.isEdit = false; this.isEdit = false;
} }

View File

@ -1,12 +1,17 @@
<template> <template>
<div> <div>
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-practice ref="createPractice" :race-list="raceList" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" /> <create-practice ref="createPractice" :map-list="mapList" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-practice ref="modifyPractice" :race-list="raceList" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" /> <create-practice ref="modifyPractice" :map-list="mapList" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
</div> </div>
</template> </template>
<script> <script>
import { getPracticeList, getRaceList, putPracticeInfo, deletePractice, createPractice, practiceRecordNotify } from '@/api/race'; import Cookies from 'js-cookie';
import { getPublishMapListOnline, getPublishMapInfo } from '@/api/jmap/map';
import { getPracticeList } from '@/api/race';
import {updateScript, deleteScript, createScript} from '@/api/script';
import { scriptRecordNotifyNew } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic';
import CreatePractice from './create'; import CreatePractice from './create';
@ -17,7 +22,7 @@ export default {
}, },
data() { data() {
return { return {
raceList:[], mapList:[],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -26,9 +31,9 @@ export default {
reset: true, reset: true,
labelWidth: '80px', labelWidth: '80px',
queryObject: { queryObject: {
raceId: { mapId: {
type: 'select', type: 'select',
label: '竞赛名称', label: '实操地图',
config: { config: {
data: [] data: []
} }
@ -40,33 +45,31 @@ export default {
} }
}, },
queryList: { queryList: {
// query: getPracticeList, query: getPracticeList,
data:[ // data:[
{id:1, raceId:2, name:'行调进行扣车操作', creatorName:'水墨'}, // {id:1, raceId:2, name:'', creatorName:''},
{id:2, raceId:4, name:'行调进行扣车操作', creatorName:'zyy'}, // {id:2, raceId:4, name:'', creatorName:'zyy'},
{id:3, raceId:3, name:'行调进行扣车操作', creatorName:'水墨'} // {id:3, raceId:3, name:'', creatorName:''}
], // ],
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '竞赛名称', title: '实操地图',
prop: 'raceId', prop: 'mapId',
type: 'tag', type: 'tag',
width: '320', width: '320',
columnValue: (row) => { return this.getRaceName(row.raceId); }, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { tagType: (row) => { return 'success'; }
return '';
}
}, },
{ {
title: '实操名称', title: '实操名称',
prop: 'name' prop: 'name',
width: '400'
}, },
{ {
title: '创建人', title: '实操描述',
prop: 'creatorName', prop: 'description'
width: '100'
}, },
{ {
type: 'button', type: 'button',
@ -102,12 +105,9 @@ export default {
}; };
}, },
mounted() { mounted() {
getRaceList({pageSize:999, pageNum:1}).then(res=>{ getPublishMapListOnline().then(response=>{
this.raceList = res.data.list; this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.raceId.config.data = []; this.queryForm.queryObject.mapId.config.data = this.mapList;
this.raceList.forEach(each=>{
this.queryForm.queryObject.raceId.config.data.push({label:each.name, value:each.id});
});
}); });
}, },
methods:{ methods:{
@ -123,7 +123,7 @@ export default {
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deletePractice(row.id).then(response => { deleteScript(row.id).then(response => {
this.$message.success('删除实操试题成功'); this.$message.success('删除实操试题成功');
this.reloadTable(); this.reloadTable();
}).catch((error) => { }).catch((error) => {
@ -132,20 +132,30 @@ export default {
}).catch(() => { }); }).catch(() => { });
}, },
doRecord(index, row) { doRecord(index, row) {
getPublishMapInfo(row.mapId).then(response=>{
const lineCode = response.data.lineCode;
scriptRecordNotifyNew(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, drawWay:true, lineCode:lineCode};
this.$router.push({ path: `${UrlConfig.scriptDisplayNew}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
});
});
// row.id // row.id
let raceInfo; // let raceInfo;
this.raceList.forEach(each=>{ // this.raceList.forEach(each=>{
if (each.id == row.raceId) { // if (each.id == row.raceId) {
raceInfo = each; // raceInfo = each;
} // }
}); // });
practiceRecordNotify(83).then(resp => { // practiceRecordNotify(83).then(resp => {
const query = { mapId: raceInfo.mapId, group: resp.data, scriptId: row.id, lineCode:raceInfo.lineCode}; // const query = { mapId: raceInfo.mapId, group: resp.data, scriptId: row.id, lineCode:raceInfo.lineCode};
this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query }); // this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
launchFullscreen(); // launchFullscreen();
}).catch(error => { // }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); // this.$messageBox(`仿: ${error.message}`);
}); // });
}, },
// //
doUpdate(index, row) { doUpdate(index, row) {
@ -166,7 +176,12 @@ export default {
} }
}, },
handleConfirmCreate(data) { handleConfirmCreate(data) {
createPractice(data).then(resp => { if (Cookies.get('user_lang') == 'en') {
data.lang = 'en';
} else {
data.lang = 'zh';
}
createScript(data).then(resp => {
this.reloadTable(); this.reloadTable();
this.$message.success('创建实操试题成功'); this.$message.success('创建实操试题成功');
}).catch(error => { }).catch(error => {
@ -174,7 +189,7 @@ export default {
}); });
}, },
handleConfirmModify(data) { handleConfirmModify(data) {
putPracticeInfo(data.id, data).then(resp => { updateScript(data.id, data).then(resp => {
this.reloadTable(); this.reloadTable();
this.$message.success('修改实操试题成功'); this.$message.success('修改实操试题成功');
}).catch(error => { }).catch(error => {

View File

@ -117,7 +117,7 @@ export default {
this.tryUser = 0; this.tryUser = 0;
this.loading = false; this.loading = false;
this.drawWay = res.data.drawWay; this.drawWay = res.data.drawWay;
const remarksList = {'01':'ATS现地工作站原理级仿真实训课程', '02':'ATS行调工作站原理级仿真实训课程', '03':'各岗位应急综合演练', '04':'桌面版模拟驾驶系统', '05':'派班工作站主要是供车辆段/停车场派班员进行派班操作,可以自动生成派班计划,极大的简化了派班计划管理的复杂性', '06': '综合监控管理原理及仿真实训'}; const remarksList = {'01':'ATS现地工作站原理级仿真系统,实现车站值班员培训功能。', '02':'ATS行调工作站原理级仿真系统实现行车调度员培训功能。', '03':'各岗位应急综合演练', '04':'桌面版模拟驾驶系统,实现列车驾驶员培训功能。', '05':'派班工作站主要是供车辆段/停车场派班员进行派班操作,可以自动生成派班计划,极大的简化了派班计划管理的复杂性', '06': '综合监控工作站原理级仿真系统,实现电调、环调及车站值班员培训功能。', '07':'大屏仿真系统,可显示全线全站场实时状况,便于教学及观摩使用。'};
this.courseModel = { this.courseModel = {
id: resp.data.id, id: resp.data.id,
name: resp.data.name, name: resp.data.name,

View File

@ -93,6 +93,12 @@ export default {
{ {
name: '站台报警', name: '站台报警',
mode: 'fas', mode: 'fas',
id: '14',
type: 'interface'
},
{
name: '站台报警-公共',
mode: 'fas',
id: '12', id: '12',
type: 'interface' type: 'interface'
}, },
@ -121,6 +127,24 @@ export default {
mode: 'bas', mode: 'bas',
id: '22', id: '22',
type: 'interface' type: 'interface'
},
{
name: '水系统',
mode: 'bas',
id: '23',
type: 'interface'
},
{
name: '照明',
mode: 'bas',
id: '24',
type: 'interface'
},
{
name: 'EPS系统',
mode: 'bas',
id: '25',
type: 'interface'
} }
] ]
}, },
@ -155,6 +179,12 @@ export default {
mode: 'cctv', mode: 'cctv',
id: '42', id: '42',
type: 'interface' type: 'interface'
},
{
name: '中心设备状态',
mode: 'cctv',
id: '43',
type: 'interface'
} }
] ]
}, },

View File

@ -10,6 +10,9 @@
<el-form-item label="空调机朝右" prop="isRight"> <el-form-item label="空调机朝右" prop="isRight">
<el-checkbox v-model="form.isRight" /> <el-checkbox v-model="form.isRight" />
</el-form-item> </el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
@ -38,6 +41,7 @@ export default {
code:'', code:'',
isRight:true, isRight:true,
width: 40, width: 40,
rotate: 0,
x: 10, x: 10,
y: 10 y: 10
}, },
@ -71,6 +75,7 @@ export default {
this.isUpdate = true; this.isUpdate = true;
this.form.code = model.code; this.form.code = model.code;
this.form.width = model.width; this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.isRight = model.isRight; this.form.isRight = model.isRight;
@ -92,7 +97,8 @@ export default {
_type: 'AirConditioner', _type: 'AirConditioner',
code: this.isUpdate ? this.form.code : getUID('AirConditioner', this.iscs.airConditionerList), code: this.isUpdate ? this.form.code : getUID('AirConditioner', this.iscs.airConditionerList),
width: this.form.width, width: this.form.width,
isRight:this.form.isRight, isRight: this.form.isRight,
rotate: this.form.rotate,
color:'#00ff00' color:'#00ff00'
}; };
this.$emit('createAirConditioner', airConditionerModel); this.$emit('createAirConditioner', airConditionerModel);

View File

@ -0,0 +1,134 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
rotate: 0,
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'BalancedElectric' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'BalancedElectric',
code: this.isUpdate ? this.form.code : getUID('BalancedElectric', this.iscs.balancedElectricList || []),
width: this.form.width,
rotate: this.form.rotate,
color:'#00ff00'
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'BalancedElectric',
code: this.form.code,
width: this.form.width,
color:'#00ff00'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -0,0 +1,134 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
rotate: 0,
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'ElectricButterflyValve' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'ElectricButterflyValve',
code: this.isUpdate ? this.form.code : getUID('ElectricButterflyValve', this.iscs.electricButterflyValveList || []),
width: this.form.width,
rotate: this.form.rotate,
color:'#00ff00'
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'ElectricButterflyValve',
code: this.form.code,
width: this.form.width,
color:'#00ff00'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -13,6 +13,9 @@
<el-form-item label="图形宽度" prop="width"> <el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" /> <el-input-number v-model="form.width" :min="10" />
</el-form-item> </el-form-item>
<el-form-item label="旋转角度" prop="rotate">
<el-input-number v-model="form.rotate" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x"> <el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
@ -41,6 +44,7 @@ export default {
code:'', code:'',
type:'', type:'',
width: 25, width: 25,
rotate: 0,
x: 10, x: 10,
y: 10 y: 10
}, },
@ -77,7 +81,8 @@ export default {
this.isUpdate = true; this.isUpdate = true;
this.form.code = model.code; this.form.code = model.code;
this.form.width = model.width; this.form.width = model.width;
this.form.pumpType = model.pumpType; this.form.type = model.pumpType;
this.form.rotate = model.rotate || 0;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
} }
@ -99,7 +104,8 @@ export default {
code: this.isUpdate ? this.form.code : getUID('FrozenPump', this.iscs.frozenPumpList), code: this.isUpdate ? this.form.code : getUID('FrozenPump', this.iscs.frozenPumpList),
width: this.form.width, width: this.form.width,
color:'#00ff00', color:'#00ff00',
pumpType:this.form.type rotate: this.form.rotate,
pumpType: this.form.type
}; };
this.$emit('createFrozenPump', frozenPumpModel); this.$emit('createFrozenPump', frozenPumpModel);
this.initPage(); this.initPage();

View File

@ -107,6 +107,31 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="平衡电动阀" name="BalancedElectric">
<balanced-electric
ref="balancedElectric"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="电动蝶阀" name="ElectricButterflyValve">
<electric-butterfly-valve
ref="electricButterflyValve"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup">
<lighting-group
ref="lightingGroup"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="按钮" name="IscsButton"> <el-tab-pane label="按钮" name="IscsButton">
<iscs-button <iscs-button
ref="iscsButton" ref="iscsButton"
@ -162,6 +187,9 @@ import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text'; import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect'; import IscsRect from '../iscsCommonElem/rect';
import SmookExhaustFd from './smookExhaustFd'; import SmookExhaustFd from './smookExhaustFd';
import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',
@ -181,7 +209,10 @@ export default {
IscsButton, IscsButton,
IscsText, IscsText,
IscsRect, IscsRect,
IscsLine IscsLine,
LightingGroup,
BalancedElectric,
ElectricButterflyValve
}, },
mixins: [ mixins: [
], ],
@ -218,5 +249,66 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.map-control {
float: right;
width: 100%;
height: 100%;
.border-card{
height: 100%;
}
}
.mapEdit{
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
/deep/ .el-card__body{
height:100%;
}
/deep/ {
.mapEdit .el-tabs__nav-wrap.is-scrollable {
padding: 0 20px;
}
.mapEdit .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #f5f7fa;
background: #f5f7fa;
}
.mapEdit .el-tabs__active-bar{
background: transparent;
}
.mapEdit .el-tabs__content {
height: calc(100% - 56px);
}
.mapEdit .el-tab-pane {
height: 100%;
}
.card .el-tabs__nav .el-tabs__item.is-active {
border-bottom: 2px solid #E4E7ED;
background: #409eff;
color: #fff;
}
.card .el-tabs__nav .el-tabs__item{
padding: 0 20px!important;
}
.mapEdit .el-tabs__nav-prev {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
.mapEdit .el-tabs__nav-next {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
}
.heightClass{height:100%;} .heightClass{height:100%;}
</style> </style>

View File

@ -0,0 +1,200 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px);">
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item v-if="isUpdate" label="编号:" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="宽度:" prop="width">
<el-input-number v-model="form.width" :min="1" />
</el-form-item>
<el-form-item label="高度:" prop="height">
<el-input-number v-model="form.height" :min="1" />
</el-form-item>
<el-form-item label="顶部文字内容:" prop="topContext">
<el-input v-model="form.topContext" type="textarea" :rows="2" />
</el-form-item>
<el-form-item label="顶部字体大小:" prop="topFontSize">
<el-input-number v-model="form.topFontSize" :min="1" />
</el-form-item>
<el-form-item label="顶部字体颜色:" prop="topTextFill">
<el-color-picker v-model="form.topTextFill" />
</el-form-item>
<el-form-item label="底部文字内容:" prop="bottomContext">
<el-input v-model="form.bottomContext" type="textarea" :row="2" />
</el-form-item>
<el-form-item label="底部字体大小:" prop="bottomFontSize">
<el-input-number v-model="form.bottomFontSize" :min="1" />
</el-form-item>
<el-form-item label="底部字体颜色:" prop="bottomTextFill">
<el-color-picker v-model="form.bottomTextFill" />
</el-form-item>
<el-form-item label="X轴坐标:" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标:" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 110,
height: 60,
topContext: '',
topFontSize: 10,
topTextFill: '#B4AF5B',
bottomContext: '',
bottomFontSize: 18,
bottomTextFill: '#FFFFFF',
x: 10,
y: 10
},
rules: {
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
height: [
{ required: true, message: '请输入设备图形高度', trigger: 'blur'}
],
topContext: [
{ required: true, message: '请输入顶部文字内容', trigger: 'blur'}
],
topFontSize: [
{required: true, message: '请输入顶部字体大小', trigger: 'blur'}
],
topTextFill: [
{required: true, message: '请输入顶部字体颜色', trigger: 'blur'}
],
bottomContext: [
{required: true, message: '请输入底部文字内容', trigger: 'blur'}
],
bottomFontSize: [
{required: true, message: '请输入底部字体大小', trigger: 'blur'}
],
bottomTextFill: [
{required: true, message: '请输入底部字体颜色', trigger: 'blur'}
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'LightingGroup' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.height = model.height;
this.form.topContext = model.topContext;
this.form.topFontSize = model.topFontSize;
this.form.topTextFill = model.topTextFill;
this.form.bottomContext = model.bottomContext;
this.form.bottomFontSize = model.bottomFontSize;
this.form.bottomTextFill = model.bottomTextFill;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'LightingGroup',
code: this.isUpdate ? this.form.code : getUID('LightingGroup', this.iscs.lightingGroupList),
width: this.form.width,
height:this.form.height,
topContext: this.form.topContext,
topFontSize: this.form.topFontSize,
topTextFill: this.form.topTextFill,
bottomContext: this.form.bottomContext,
bottomFontSize: this.form.bottomFontSize,
bottomTextFill: this.form.bottomTextFill
};
this.$emit('createDataModel', airConditionerModel);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 110,
height: 60,
topContext: '',
topFontSize: 10,
topTextFill: '#B4AF5B',
bottomContext: '',
bottomFontSize: 18,
bottomTextFill: '#FFFFFF',
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const lightingGroupModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'LightingGroup',
code: this.form.code,
width: this.form.width,
height:this.form.height,
topContext: this.form.topContext,
topFontSize: this.form.topFontSize,
topTextFill: this.form.topTextFill,
bottomContext: this.form.bottomContext,
bottomFontSize: this.form.bottomFontSize,
bottomTextFill: this.form.bottomTextFill
};
this.$emit('deleteDataModel', lightingGroupModel );
this.initPage();
}
}
};
</script>

View File

@ -1,148 +1,158 @@
<template> <template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="map-control heightClass"> <div class="map-control heightClass">
<el-card type="border-card" class="heightClass"> <el-card type="border-card" class="heightClass">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button <el-button
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
@click="handleSave" @click="handleSave"
>{{ $t('ibp.save') }}</el-button> >{{ $t('ibp.save') }}</el-button>
</div>
<el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick">
<el-tab-pane label="固定摄像机" name="Vidicon">
<vidicon
ref="vidiconCloud"
style="width:90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="云台摄像机" name="VidiconCloud">
<vidicon-cloud
ref="vidicon"
style="width:90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="闸机" name="BrakeMachine">
<brake-machine
ref="brakeMachine"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="扶梯" name="Staircase">
<staircase
ref="staircase"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="单向楼梯" name="SingleStaircase">
<single-staircase
ref="singleStaircase"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="文字" name="IscsText">
<iscs-text
ref="iscsText"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel">
</iscs-text>
</el-tab-pane>
<el-tab-pane label="线段" name="IscsLine">
<iscs-line
ref="iscsLine"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel">
</iscs-line>
</el-tab-pane>
<el-tab-pane label="矩形" name="IscsRect">
<iscs-rect
ref="iscsRect"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel">
</iscs-rect>
</el-tab-pane>
</el-tabs>
</el-card>
</div> </div>
</transition> <el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick">
<el-tab-pane label="固定摄像机" name="Vidicon">
<vidicon
ref="vidiconCloud"
style="width:90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="云台摄像机" name="VidiconCloud">
<vidicon-cloud
ref="vidicon"
style="width:90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="闸机" name="BrakeMachine">
<brake-machine
ref="brakeMachine"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="扶梯" name="Staircase">
<staircase
ref="staircase"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="单向楼梯" name="SingleStaircase">
<single-staircase
ref="singleStaircase"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="文字" name="IscsText">
<iscs-text
ref="iscsText"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="线段" name="IscsLine">
<iscs-line
ref="iscsLine"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="状态表" name="StateTable">
<state-table
ref="stateTable"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="矩形" name="IscsRect">
<iscs-rect
ref="iscsRect"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</transition>
</template> </template>
<script> <script>
import {deviceFactory} from '@/iscs/utils/parser'; import {deviceFactory} from '@/iscs/utils/parser';
import Vidicon from './vidicon'; import Vidicon from './vidicon';
import VidiconCloud from './vidiconCloud'; import VidiconCloud from './vidiconCloud';
import IscsLine from '../iscsCommonElem/line'; import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text'; import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect'; import IscsRect from '../iscsCommonElem/rect';
import BrakeMachine from '../iscsAfcOperate/brakeMachine'; import BrakeMachine from '../iscsAfcOperate/brakeMachine';
import Staircase from '../iscsOperate/staircase'; import Staircase from '../iscsOperate/staircase';
import SingleStaircase from './singleStaircase'; import SingleStaircase from './singleStaircase';
export default { import StateTable from '../iscsOperate/stateTable';
name: 'IscsOperate', export default {
components: { name: 'IscsOperate',
Vidicon, components: {
VidiconCloud, Vidicon,
IscsRect, VidiconCloud,
IscsLine, IscsRect,
IscsText, IscsLine,
BrakeMachine, IscsText,
Staircase, BrakeMachine,
SingleStaircase Staircase,
}, SingleStaircase,
mixins: [ StateTable
], },
data() { mixins: [
return { ],
enabledTab: 'Vidicon', data() {
data: '', return {
stationCode: '' enabledTab: 'Vidicon',
}; data: '',
}, stationCode: ''
computed: { };
height() { },
return this.$store.state.config.height; computed: {
} height() {
}, return this.$store.state.config.height;
watch: {
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
this.enabledTab = model._type;
}
},
mounted() {
this.$emit('iscsChange', this.$route.params.id);
},
beforeDestroy() {
},
methods: {
createDataModel(model) {
const newModel = deviceFactory(model._type, model);
this.$store.dispatch('iscs/updateIscsDevices', newModel.model);
},
deleteDataModel(model) {
this.$store.dispatch('iscs/deleteIscsDevices', model);
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
},
handleTabClick() {
}
} }
}; },
watch: {
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
this.enabledTab = model._type;
}
},
mounted() {
this.$emit('iscsChange', this.$route.params.id);
},
beforeDestroy() {
},
methods: {
createDataModel(model) {
const newModel = deviceFactory(model._type, model);
this.$store.dispatch('iscs/updateIscsDevices', newModel.model);
},
deleteDataModel(model) {
this.$store.dispatch('iscs/deleteIscsDevices', model);
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
},
handleTabClick() {
}
}
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -151,4 +161,57 @@
width: 100%; width: 100%;
} }
.heightClass{height:100%;} .heightClass{height:100%;}
.mapEdit{
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
/deep/ {
.mapEdit .el-tabs__nav-wrap.is-scrollable {
padding: 0 20px;
}
.mapEdit .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #f5f7fa;
background: #f5f7fa;
}
.mapEdit .el-tabs__active-bar{
background: transparent;
}
.mapEdit .el-tabs__content {
height: calc(100% - 56px);
}
.mapEdit .el-tab-pane {
height: 100%;
}
.card .el-tabs__nav .el-tabs__item.is-active {
border-bottom: 2px solid #E4E7ED;
background: #409eff;
color: #fff;
}
.card .el-tabs__nav .el-tabs__item{
padding: 0 20px!important;
}
.mapEdit .el-tabs__nav-prev {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
.mapEdit .el-tabs__nav-next {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
}
/deep/ .el-card__body{
height:100%;
}
</style> </style>

View File

@ -56,7 +56,9 @@ export default {
functionList: [ functionList: [
{label: '图元说明', value: 'GraphicEle'}, {label: '图元说明', value: 'GraphicEle'},
{label: '公共区域', value: 'PublicArea'}, {label: '公共区域', value: 'PublicArea'},
{label: '返回', value: 'GoBack'} {label: '操作按钮', value: 'OperatingButton'},
{label: '返回', value: 'GoBack'},
{label: '至EPS系统及导向照明', value: 'GoEPS'}
], ],
form: { form: {
code: '', code: '',

View File

@ -124,7 +124,14 @@ export default {
{label: '站内下行左线消火栓按钮', value: 'inDownLeftHydrant'}, {label: '站内下行左线消火栓按钮', value: 'inDownLeftHydrant'},
{label: '站内上行右线消火栓按钮', value: 'inUpRightHydrant'}, {label: '站内上行右线消火栓按钮', value: 'inUpRightHydrant'},
{label: '站间下行左线消火栓按钮', value: 'outDownLeftHydrant'}, {label: '站间下行左线消火栓按钮', value: 'outDownLeftHydrant'},
{label: '站间上行右线消火栓按钮', value: 'outUpRightHydrant'} {label: '站间上行右线消火栓按钮', value: 'outUpRightHydrant'},
{label: '视屏服务器状态', value: 'videoServerStatus'},
{label: '数据服务器状态', value: 'dataServerStatus'},
{label: '媒体交换服务区状态', value: 'mediaServerStatus'},
{label: '解码器状态', value: 'decoderState'},
{label: '四路解码器状态', value: 'quadDecoderState'},
{label: '四路解码器模式状态', value: 'quadDecoderModeState'},
{label: '控制键盘状态', value: 'controlKeyboardState'}
], ],
rules: { rules: {
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }], width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],

View File

@ -0,0 +1,37 @@
<template>
<div class="bigSystemBox">
<div class="title-name">{{ $route.query.stationName }}机电照明</div>
<div class="">
<iscsSystem ref="iscsPlate" :width-canvas="1220" :canvas-height="650" />
</div>
</div>
</template>
<script>
import iscsSystem from '../canvas/iscsCanvas';
export default {
name: 'LightingSystem',
components: {
iscsSystem
},
data() {
return {
mes: '1111'
};
},
mounted() {
this.$refs.iscsPlate.show('24');
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.title-name{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<div class="bigSystemBox">
<div class="title-name">{{ $route.query.stationName }}机电水系统</div>
<div class="">
<iscsSystem ref="iscsPlate" :width-canvas="1300" :canvas-height="650" />
</div>
</div>
</template>
<script>
import iscsSystem from '../canvas/iscsCanvas';
export default {
components: {
iscsSystem
},
data() {
return {
mes: '1111'
};
},
mounted() {
this.$refs.iscsPlate.show('23');
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.title-name{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
}
</style>

View File

@ -10,7 +10,7 @@ import Iscs from '@/iscs/iscs';
import { parser } from '@/iscs/utils/parser'; import { parser } from '@/iscs/utils/parser';
import iscsData from '@/iscs/constant/iscsData'; import iscsData from '@/iscs/constant/iscsData';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen'; // import { exitFullscreen } from '@/utils/screen';
// import { handlerIscsEvent } from '@/api/simulation'; // import { handlerIscsEvent } from '@/api/simulation';
// import { IscsOperation } from '@/scripts/ConstDic'; // import { IscsOperation } from '@/scripts/ConstDic';

View File

@ -1,10 +1,36 @@
<template> <template>
<div> <div>
中心设备状态 <div class="stand_title">{{ $route.query.stationName }}闭路电视中心设备状态</div>
<div style="margin: auto">
<iscsSystem ref="iscsPlate" :width-canvas="1000" :canvas-height="700" />
</div>
</div> </div>
</template> </template>
<script> <script>
import iscsSystem from '../canvas/iscsCanvas';
export default { export default {
components: {
iscsSystem
},
data() {
return {
};
},
mounted() {
this.$refs.iscsPlate.show('43');
},
methods: {
}
}; };
</script> </script>
<style lang="scss" scoped>
.stand_title{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
margin-bottom: 30px;
}
</style>

View File

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<div class="stand_title">{{ $route.query.stationName }}火灾报警站台报警</div> <div class="stand_title">{{ $route.query.stationName }}火灾报警站台报警</div>
<div class=""> <div style="margin: auto">
<iscsSystem ref="iscsPlate" :width-canvas="1520" :canvas-height="500" /> <iscsSystem ref="iscsPlate" :width-canvas="width" :canvas-height="500" />
</div> </div>
</div> </div>
</template> </template>
@ -15,10 +15,23 @@ export default {
}, },
data() { data() {
return { return {
width: 1100
}; };
}, },
watch: {
'$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected;
if (device && device._type === 'IscsButton' && device.function === 'PublicArea') {
this.width = 1520;
this.$refs.iscsPlate.show('12');
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
this.width = 1100;
this.$refs.iscsPlate.show('14');
}
}
},
mounted() { mounted() {
this.$refs.iscsPlate.show('12'); this.$refs.iscsPlate.show('14');
}, },
methods: { methods: {

View File

@ -26,6 +26,8 @@
<sensor v-else-if="mode==='sensor'" /> <sensor v-else-if="mode==='sensor'" />
<big-system v-else-if="mode==='bigSystem'" /> <big-system v-else-if="mode==='bigSystem'" />
<small-system v-else-if="mode==='smallSystem'" /> <small-system v-else-if="mode==='smallSystem'" />
<water-system v-else-if="mode==='waterSystem'" />
<lighting-system v-else-if="mode === 'lighting'" />
<graphic-ele ref="graphicEle" /> <graphic-ele ref="graphicEle" />
<device-control ref="deviceControl" /> <device-control ref="deviceControl" />
</div> </div>
@ -58,6 +60,8 @@ import doorFG from './fg/doorFG';
import Sensor from './bas/sensor'; import Sensor from './bas/sensor';
import BigSystem from './bas/bigSystem'; import BigSystem from './bas/bigSystem';
import SmallSystem from './bas/smallSystem'; import SmallSystem from './bas/smallSystem';
import waterSystem from './bas/waterSystem';
import LightingSystem from './bas/lightingSystem';
import GraphicEle from './graphicEle'; import GraphicEle from './graphicEle';
import DeviceControl from './deviceControl'; import DeviceControl from './deviceControl';
@ -90,7 +94,9 @@ export default {
GraphicEle, GraphicEle,
DeviceControl, DeviceControl,
SmallSystem, SmallSystem,
BigSystem BigSystem,
waterSystem,
LightingSystem
}, },
data() { data() {
return { return {

View File

@ -8,11 +8,11 @@
<el-table-column prop="level" label="等级" /> <el-table-column prop="level" label="等级" />
</el-table> </el-table>
<div style="margin-top: 10px;width: 100%;"> <div style="margin-top: 10px;width: 100%;">
<div style="width: 75%;background: #FFF;padding: 2px;display: inline-block;vertical-align:top;margin-left: 3%"> <div style="width: 77%;background: #FFF;padding: 2px;display: inline-block;vertical-align:top;margin-left: 3%">
<div style="width: 100%;text-align: center;font-size: 13px;padding-top:5px;">显示内容</div> <div style="width: 100%;text-align: center;font-size: 13px;padding-top:5px;">显示内容</div>
<div style="width:100%; height: 100px; border: 1px solid #000;" /> <div style="width:100%; height: 100px; border: 1px solid #000;" />
</div> </div>
<div style="width: 15%;background: #939FAC; display: inline-block;margin-left: 2%;"> <div style="width: 14%;background: #939FAC; display: inline-block;margin-left: 2%;">
<div class="emergency_select_button">区域详细</div> <div class="emergency_select_button">区域详细</div>
<div style="width: 100%;text-align: center;color: #FFF;font-size: 13px;background: #121A86;height: 30px;line-height: 30px;">紧急信息清除</div> <div style="width: 100%;text-align: center;color: #FFF;font-size: 13px;background: #121A86;height: 30px;line-height: 30px;">紧急信息清除</div>
<div class="emergency_select_button">清除</div> <div class="emergency_select_button">清除</div>

View File

@ -3,7 +3,7 @@
<div class="lcdControl_title">LCD控制屏</div> <div class="lcdControl_title">LCD控制屏</div>
<div class="area_select" style="margin-top: 110px;"> <div class="area_select" style="margin-top: 110px;">
<div class="area_select_title">特定区域</div> <div class="area_select_title">特定区域</div>
<div class="area_select_button" @click="selectedAllArea">全线</div> <div class="area_select_button" :class="{'active': activeFlag}" @click="selectedAllArea">全线</div>
</div> </div>
<div class="area_select" style="margin-top: 200px;"> <div class="area_select" style="margin-top: 200px;">
<div> <div>
@ -42,6 +42,7 @@ export default {
columns: ['车站', '选择'], columns: ['车站', '选择'],
stationList: ['会展中心站', '世纪大道站', '交通大学站', '市图书馆站', '中心医院站', '未来路站', '火车站', '人民广场站', '体育中心站'], stationList: ['会展中心站', '世纪大道站', '交通大学站', '市图书馆站', '中心医院站', '未来路站', '火车站', '人民广场站', '体育中心站'],
lcdSwitch: true, lcdSwitch: true,
activeFlag: false,
selectedAreaList:[] selectedAreaList:[]
}; };
}, },
@ -71,7 +72,12 @@ export default {
} }
}, },
selectedAllArea() { selectedAllArea() {
this.selectedAreaList = [...this.stationList]; this.activeFlag = !this.activeFlag;
if (this.activeFlag) {
this.selectedAreaList = [...this.stationList];
} else {
this.selectedAreaList = [];
}
} }
} }
}; };
@ -120,13 +126,14 @@ export default {
-moz-user-select:none; -moz-user-select:none;
-ms-user-select:none; -ms-user-select:none;
user-select:none; user-select:none;
} &:active,
.area_select_button:active { &.active {
border-top: 2px solid #898888; border-top: 2px solid #898888;
border-left: 2px solid #898888; border-left: 2px solid #898888;
border-right: 2px solid #FFF; border-right: 2px solid #FFF;
border-bottom: 2px solid #FFF; border-bottom: 2px solid #FFF;
} }
}
.each_station_info{ .each_station_info{
vertical-align:top; vertical-align:top;
font-size: 13px; font-size: 13px;

View File

@ -170,30 +170,22 @@ export default {
} else { } else {
let areaIndex; let areaIndex;
this.verticalHeader.map((item, index) => { this.verticalHeader.map((item, index) => {
if (item.key === data.key) { if (item.key == data.key) {
areaIndex = index; areaIndex = index;
} }
}); });
const flag = data.active; const flag = data.active;
// this.stationList.forEach(station => { this.stationList.forEach(station => {
// station.children.forEach((item, index) => { station.children.forEach((item, index) => {
// const elem = station.stationName + '-' + index; const elem = station.stationName + '-' + index;
// if (item.status === 'default' && index === areaIndex && !flag) { if (item.status == 'default' && (index + 1) == areaIndex && !flag) {
// const selectedAreaIndex = this.selectedAreaList.indexOf(elem); const selectedAreaIndex = this.selectedAreaList.indexOf(elem);
// this.selectedAreaList.splice(selectedAreaIndex, 1); this.selectedAreaList.splice(selectedAreaIndex, 1);
// } else if (item.status === 'default' && index === areaIndex && !flag && !this.selectedAreaList.includes(elem)) { } else if (item.status == 'default' && (index + 1) == areaIndex && flag) {
// this.selectedAreaList.push(elem); this.selectedAreaList.push(elem);
// } }
// }); });
// }); });
for (let j = 0; j < this.stationList.length; j++) {
if (!this.selectedAreaList.includes(areaIndex + '-' + j) && flag) {
this.selectedAreaList.push(areaIndex + '-' + j);
} else if (!flag) {
const index = this.selectedAreaList.indexOf(areaIndex + '-' + j);
this.selectedAreaList.splice(index, 1);
}
}
} }
}, },
selectedAllLine(data) { selectedAllLine(data) {

View File

@ -1,7 +1,5 @@
<template> <template>
<div> <div />
车站网络
</div>
</template> </template>
<script> <script>
export default { export default {

View File

@ -45,9 +45,9 @@
<div class="time_preview_footer"> <div class="time_preview_footer">
<div class="preview_footer_top">操作</div> <div class="preview_footer_top">操作</div>
<div class="preview_footer_content"> <div class="preview_footer_content">
<div class="each_preview_btn each_preview_back">区域<br>详细</div> <div class="each_preview_btn">区域<br>详细</div>
<div class="each_preview_btn each_preview_back">删除</div> <div class="each_preview_btn">删除</div>
<div class="each_preview_btn each_preview_back">停用</div> <div class="each_preview_btn">停用</div>
<div class="each_preview_btn each_preview_back1">激活</div> <div class="each_preview_btn each_preview_back1">激活</div>
<div class="each_preview_btn each_preview_back2">修改</div> <div class="each_preview_btn each_preview_back2">修改</div>
</div> </div>
@ -85,32 +85,60 @@ export default {
.el-table .time_preview_column .cell{font-size:12px;} .el-table .time_preview_column .cell{font-size:12px;}
.el-table td.time_preview_column{padding:5px 0px;} .el-table td.time_preview_column{padding:5px 0px;}
.preview_footer_top{width:646px;font-weight:bold;padding:10px 0px;text-align:center;background:#000077;color:#fff;font-size:12px;} .preview_footer_top{width:646px;font-weight:bold;padding:10px 0px;text-align:center;background:#000077;color:#fff;font-size:12px;}
.each_preview_btn{width:80px;text-align:center; .each_preview_btn{
height:38px; width:80px;
display:flex; text-align:center;
align-items: center; height:38px;
justify-content:center; display:flex;
margin-left:4px; align-items: center;
font-size:12px; justify-content:center;
cursor: pointer;vertical-align:top;font-weight:bold;} margin-left:4px;
.each_preview_back{border-top: 3px solid #f9f9f9; font-size:12px;
border-left: 3px solid #f6f8f8; cursor: pointer;
border-right: 3px solid #565656; vertical-align:top;
border-bottom: 3px solid #565656;background: #cccccc;} font-weight:bold;
border-top: 3px solid #f9f9f9;
border-left: 3px solid #f6f8f8;
border-right: 3px solid #565656;
border-bottom: 3px solid #565656;
background: #cccccc;
&:active{
border-top: 3px solid #565656;
border-left: 3px solid #565656;
border-right: 3px solid #f6f8f8;
border-bottom: 3px solid #f9f9f9;
background: #cccccc;
}
}
.each_preview_back1{ .each_preview_back1{
border-top: 3px solid #63dcf8; border-top: 3px solid #63dcf8;
border-left: 3px solid #7cdeed; border-left: 3px solid #7cdeed;
border-right: 3px solid #2a5bab; border-right: 3px solid #2a5bab;
border-bottom: 3px solid #1d61b4;background: #01abff; border-bottom: 3px solid #1d61b4;
color:#fff; background: #01abff;
color:#fff;
&:active{
border-top: 3px solid #1d61b4;
border-left: 3px solid #2a5bab;
border-right: 3px solid #7cdeed;
border-bottom: 3px solid #63dcf8;
background: #01abff;
}
} }
.each_preview_back2{ .each_preview_back2{
border-top: 3px solid #638df8; border-top: 3px solid #638df8;
border-left: 3px solid #86a1e4; border-left: 3px solid #86a1e4;
border-right: 3px solid #1d2881; border-right: 3px solid #1d2881;
border-bottom: 3px solid #1e3388; border-bottom: 3px solid #1e3388;
background: #0156ff; background: #0156ff;
color:#fff; color:#fff;
&:active{
border-top: 3px solid #1e3388;
border-left: 3px solid #1d2881;
border-right: 3px solid #86a1e4;
border-bottom: 3px solid #638df8;
background: #0156ff;
}
} }
.el-table .time_preview_thead:not(:first-child){background:#000077;color:#fff;padding: 5px 0px;text-align:center;font-size: 12px;} .el-table .time_preview_thead:not(:first-child){background:#000077;color:#fff;padding: 5px 0px;text-align:center;font-size: 12px;}
.preview_footer_content{margin-top:15px;margin-left:20px;margin-bottom:10px;display:flex;flex-direction:row} .preview_footer_content{margin-top:15px;margin-left:20px;margin-bottom:10px;display:flex;flex-direction:row}

View File

@ -256,7 +256,8 @@ export default {
children: [ children: [
{ {
name: '网络状态', name: '网络状态',
type: 'standFAS' type: 'netState',
showType: ['center', 'local']
} }
] ]
} }
@ -301,17 +302,7 @@ export default {
] ]
}; };
}, },
watch: { watch: {},
'$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected;
if (device._type === 'IscsButton' && device.function === 'PublicArea') {
this.selectChildIndex = 1;
this.$router.push({ path: `/iscs/system/config/stationHallFAS`, query: {currentSystem:this.$route.query.currentSystem, stationName: this.$route.query.stationName, stationId: this.$route.query.stationId } });
} else if (device._type === 'IscsButton' && device.function === 'GoBack') {
this.$router.go(-1);
}
}
},
mounted() { mounted() {
this.navList.forEach((nav, navIndex)=>{ this.navList.forEach((nav, navIndex)=>{
if (nav.children && nav.children.length > 0) { if (nav.children && nav.children.length > 0) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div :id="iscsId" v-loading="loading" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#45607B' }" class="iscs-canvas" /> <div :id="iscsId" v-loading="loading" :style="{ width: canvasWidth +'px', height: canvasHeight +'px',background:'#45607B' }" class="iscs-canvas" />
<el-button v-if="showBackButton" class="iscs-button" type="primary" @click="back">{{ $t('global.back') }}</el-button> <el-button v-if="showBackButton" class="iscs-button" type="primary" @click="back">{{ $t('global.back') }}</el-button>
</div> </div>
</template> </template>
@ -8,7 +8,7 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Iscs from '@/iscs/iscs'; import Iscs from '@/iscs/iscs';
import { parser } from '@/iscs/utils/parser'; import { parser, deviceFactory } from '@/iscs/utils/parser';
import iscsData from '@/iscs/constant/iscsData'; import iscsData from '@/iscs/constant/iscsData';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
@ -16,6 +16,8 @@ import { putJointTrainingSimulationUser } from '@/api/chat';
import { putJointTrainingSimulationUserNew} from '@/api/jointTraining'; import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
// import { handlerIscsEvent } from '@/api/simulation'; // import { handlerIscsEvent } from '@/api/simulation';
// import { IscsOperation } from '@/scripts/ConstDic'; // import { IscsOperation } from '@/scripts/ConstDic';
import { deepAssign } from '@/utils/index';
import { getUID } from '@/iscs/utils/Uid';
export default { export default {
name: 'Iscs', name: 'Iscs',
@ -41,6 +43,8 @@ export default {
y: 0 y: 0
} }
}, },
selected: null, //
copyModel: {}, //
showBackButton: true, showBackButton: true,
initTime: '', initTime: '',
started: false, started: false,
@ -55,6 +59,9 @@ export default {
'canvasWidth', 'canvasWidth',
'canvasHeight' 'canvasHeight'
]), ]),
...mapGetters('iscs', [
'iscs'
]),
iscsId() { iscsId() {
return ['iscs', (Math.random().toFixed(5)) * 100000].join('_'); return ['iscs', (Math.random().toFixed(5)) * 100000].join('_');
}, },
@ -117,6 +124,9 @@ export default {
} }
this.setIscs(data, iscsData[deviceCode]); this.setIscs(data, iscsData[deviceCode]);
this.$store.dispatch('iscs/setIscsData', iscsData[deviceCode]); this.$store.dispatch('iscs/setIscsData', iscsData[deviceCode]);
if (this.$route.path.startsWith('/iscs/design')) {
this.$iscs.on('keyboard', this.onKeyboard, this);
}
window.document.oncontextmenu = function () { window.document.oncontextmenu = function () {
return false; return false;
}; };
@ -124,6 +134,35 @@ export default {
setIscs(data, oldData) { setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data); this.$iscs.setIscs(oldData, data);
}, },
//
onKeyboard(hook) {
if (this.selected && this.selected.code) {
switch (hook) {
case 'Ctrl_C': {
this.copyModel = deepAssign({}, this.selected);
this.copyModel.point = {
x: this.selected.point.x + 10,
y: this.selected.point.y + 10
};
const type1 = this.selected._type.charAt(0).toLowerCase() + this.selected._type.slice(1); // .toLowerCase()
this.copyModel.code = getUID(this.selected._type, this.iscs[type1 + 'List'] || []);
} break;
case 'Ctrl_V':
this.copyModel.code && this.createDataModel(this.copyModel);
break;
// case 'Delete': this.$store.dispatch('map/setDeleteCount');
// break;
// case 'Update':
// this.$refs.offsetX.focus();
// this.$store.dispatch('map/setUpdateCount');
// break;
}
}
},
createDataModel(model) {
const newModel = deviceFactory(model._type, model);
this.$store.dispatch('iscs/updateIscsDevices', newModel.model);
},
// //
onSelected(em) { onSelected(em) {
if (em.deviceModel.mean) { if (em.deviceModel.mean) {
@ -157,6 +196,7 @@ export default {
// //
onContextMenu(em) { onContextMenu(em) {
if (em.eventTarget) { if (em.eventTarget) {
this.selected = em.eventTarget.model;
this.$store.dispatch('iscs/setUpdateDeviceData', em.eventTarget.model); this.$store.dispatch('iscs/setUpdateDeviceData', em.eventTarget.model);
} }
}, },

View File

@ -84,7 +84,7 @@ export default {
position: absolute; position: absolute;
float:right; float:right;
left:2%; left:2%;
top:6%; top:7%;
width: 20%; width: 20%;
height: 50%; height: 50%;
// background-color: #FFFFFF; // background-color: #FFFFFF;

View File

@ -0,0 +1,154 @@
<template>
<div class="editassets">
<div class="asset-list">
<!-- <el-tabs v-model="activeName"> -->
<div class="devicelisttop">
<p style="font-size:20px;color:#FFFFFF;">设备部件</p>
</div>
<div class="devicelistbottom">
<div class="displaylist " v-for="(part,index) in devicelist" @click="deviceselect(index,part)" v-show="true" >
<div >
<p style="border:1px solid #FFFFFF;">{{part.text}}</p>
</div>
</div>
</div>
<!-- </el-tabs> -->
</div>
</div>
</template>
<script>
export default {
name: 'Jl3ddeviceList',
components: {
},
props: ['devicelist'],
data() {
return {
activeName: 'train',
filterText: '',
defaultProps: {
children: 'children',
label: 'label'
},
devicetype:true,
}
},
beforeDestroy() {
},
watch: {
filterText(val) {
this.$refs.tree2.filter(val);
},
},
methods: {
deviceselect(index,train){
this.$emit('sdevice',train);
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
init: function() {
},
back() {
},
},
mounted() {
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.editassets {
position: absolute;
float:right;
right:15px;
top:7%;
width: 20%;
height: 75%;
// background-color: #FFFFFF;
// border-radius:5px;
background-image:url("/static/texture/devicelistpane.png");
background-repeat: no-repeat;
overflow: hidden;
background-size:90% 100%;
text-align: center;
z-index: 10;
}
.asset-list{
// position:absolute;
width: 85%;
height: 100%;
}
.el-tabs{
height:100%;
}
.el-scrollbar__wrap.default-scrollbar__wrap {
overflow-x: hidden;
overflow-y: auto;
}
.devicelisttop{
height:10%;
width:100%;
top:0;
}
.devicelistbottom{
height:85%;
width:100%;
top:10%;
overflow-y: auto;
}
.displaylist {
float:left;
position: relative;
width:90px;
// height:20px;
font-size:19px;
color:#FFFFFF;
margin:0px 5px 0px 5px;
}
.modelpic{
left:0;
position: absolute;
width:100%;
height:100%;
}
.modeltop{
bottom:0;
z-index:0;
}
.modeldown{
top:0;
z-index:0;
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div class="devicemsg" v-show="msgshow">
<div class="msgtop">
{{devicename}}
</div>
<div class="msgdown">
{{devicemsg}}
</div>
</div>
</template>
<script>
export default {
name: 'Jl3ddeviceMsg',
components: {
},
data() {
return {
msgshow:false,
devicename:"",
devicemsg:"",
}
},
beforeDestroy() {
},
watch: {
},
methods: {
updatemsg(name,text) {
// console.log(name);
// console.log(text);
if(name){
this.msgshow = true;
this.devicename = name;
this.devicemsg = text;
}else{
this.msgshow = false;
}
},
},
mounted() {
window.updatemsg = this.updatemsg;
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.devicemsg{
position: absolute;
float:left;
left:23%;
top:7%;
width: 20%;
height: 50%;
z-index: 10;
background-image:url("/static/texture/devicemsgpane.png");
background-repeat:no-repeat;
background-size: 90% 100%;
}
.msgtop{
text-align: center;
width: 80%;
height:10%;
float: left;
position: absolute;
top:10%;
font-size:20px;
color:#FFFFFF;
}
.msgdown{
position: absolute;
top:20%;
left:5%;
width: 80%;
height:75%;
float: left;
font-size:19px;
color:#FFFFFF;
word-wrap:break-word;
letter-spacing:2px;
overflow-y:scroll;
}
</style>

View File

@ -11,12 +11,28 @@
</div> --> </div> -->
<div id="jl3ddevicerepir" class="repirbutton" @click="devicerepir"></div> <div id="jl3ddevicerepir" class="repirbutton" @click="devicerepir"></div>
<div id="jl3dclose" class="backbutton" @click="close3ddeviceview"></div> <div id="jl3dclose" class="backbutton" @click="close3ddeviceview"></div>
<Jl3ddevice-Msg v-show="isswitch">
</Jl3ddevice-Msg>
<Jl3ddevice-List v-show="isswitch" :devicelist="equiplist" @sdevice="sdevice">
</Jl3ddevice-List>
<canvas id="canvastexture" />
<div class="jl3dcontrolpane" v-show="isswitch">
<el-button-group>
<el-button type="primary" @click="initdevice">初始化</el-button>
<el-button type="primary" @click="alldisper">{{disperreset}}</el-button>
<el-button type="primary" @click="dispersed">{{devicestats}}</el-button>
<el-button type="primary" @click="switchhide">{{switchshow}}</el-button>
</el-button-group>
</div>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import { Jl3dfaultdevice } from '@/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js'; import { Jl3dfaultdevice } from '@/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js';
import Jl3ddeviceMsg from '@/views/jlmap3d/maintainer/component/devicemsg';
import Jl3ddeviceList from '@/views/jlmap3d/maintainer/component/devicelist';
import { sendCommandNew } from '@/api/jmap/training'; import { sendCommandNew } from '@/api/jmap/training';
import Command from '@/scripts/cmdPlugin/Command'; import Command from '@/scripts/cmdPlugin/Command';
import Handler from '@/scripts/cmdPlugin/Handler'; import Handler from '@/scripts/cmdPlugin/Handler';
@ -24,6 +40,9 @@
export default { export default {
name: 'FaultDevice', name: 'FaultDevice',
components: { components: {
//
Jl3ddeviceMsg,
Jl3ddeviceList
}, },
data() { data() {
return { return {
@ -31,13 +50,15 @@
jl3d: null, jl3d: null,
psdlist:this.$store.state.map.map.psdList, psdlist:this.$store.state.map.map.psdList,
windowstatus:false, windowstatus:false,
devicelist:[], nowdevice:null,
//
equiplist:[],
switchstatus:true,
isswitch:false,
devicestats:"分步拆解", devicestats:"分步拆解",
disperreset:"整体拆解", disperreset:"整体拆解",
switchshow:"隐藏轨道", switchshow:"隐藏轨道",
switchstatus:true,
isswitch:false,
nowdevice:null,
} }
}, },
watch: { watch: {
@ -194,6 +215,42 @@
back(){ back(){
this.jl3d.resetmodel(); this.jl3d.resetmodel();
}, },
//
sdevice(changedata) {
this.jl3d.updateselect(changedata);
},
dispersed(){
this.jl3d.disperdevice1();
},
alldisper(){
this.jl3d.disperdevice2();
},
initdevice(){
this.jl3d.resetmodel();
},
switchhide(){
if(this.switchstatus){
this.switchstatus = false;
this.switchshow = "显示轨道";
this.jl3d.hideswitch(this.switchstatus);
}else{
this.switchstatus = true;
this.switchshow = "隐藏轨道";
this.jl3d.hideswitch(this.switchstatus);
}
},
updatemenulist(equiplist) {
if(equiplist){
this.equiplist = equiplist;
this.isswitch = true;
}else{
this.equiplist = [];
this.isswitch = false;
}
},
} }
} }
</script> </script>
@ -251,7 +308,8 @@
.jl3dcontrolpane{ .jl3dcontrolpane{
position: absolute; position: absolute;
top:0; top:0;
left:0; right:85px;
z-index: 10;
} }
</style> </style>

View File

@ -32,6 +32,9 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -48,9 +51,11 @@
// import { UrlConfig } from '@/router/index'; // import { UrlConfig } from '@/router/index';
import { JLmap3dMaintainer } from '@/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js'; import { JLmap3dMaintainer } from '@/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js';
import DevicefaultList from '@/views/jlmap3d/maintainer/component/devicefaultlist'; import DevicefaultList from '@/views/jlmap3d/maintainer/component/devicefaultlist';
import FaultDevice from '@/views/jlmap3d/maintainer/component/faultdevice'; import FaultDevice from '@/views/jlmap3d/maintainer/component/faultdevice';
import Jlmap3dConfig from '@/views/jlmap3d/simulation/show/configmenu'; import Jlmap3dConfig from '@/views/jlmap3d/simulation/show/configmenu';
import { ProjectIcon } from '@/scripts/ProjectConfig'; import { ProjectIcon } from '@/scripts/ProjectConfig';
@ -61,7 +66,8 @@ export default {
name: 'Jl3dMaintainer', name: 'Jl3dMaintainer',
components: { components: {
DevicefaultList, DevicefaultList,
FaultDevice FaultDevice,
// Jlmap3dMsg // Jlmap3dMsg
// ShowProperty // ShowProperty
}, },
@ -84,6 +90,7 @@ export default {
deviceShow:true, deviceShow:true,
msgshow:false, msgshow:false,
controlmsg:"", controlmsg:"",
}; };
}, },
beforeDestroy() { beforeDestroy() {
@ -204,7 +211,8 @@ export default {
}, },
back() { back() {
this.$emit('back'); this.$emit('back');
} this.isswitch = false;
},
} }
}; };
@ -296,4 +304,6 @@ export default {
left: 0; left: 0;
z-index: -12; z-index: -12;
} }
</style> </style>

View File

@ -3,11 +3,25 @@
<div id="jl3d" class="jl3ddraw"> <div id="jl3d" class="jl3ddraw">
</div> </div>
<div class="menutop"> <div class = "station">
<div style="margin-top:5%;font-size: 30px;">当前车站:</div>
<el-select class="listmenu" v-model="value" placeholder="当前车站" >
<el-option
v-for="item in stationlist"
:key="item.name"
:label="item.name"
:value="item.name"
:disabled="item.disabled"
>
</el-option>
</el-select>
</div>
<!-- <div class="menutop">
<el-button-group> <el-button-group>
<el-button type="primary" @click="switchrender">{{rendermode}}</el-button> <el-button type="primary" @click="switchrender">{{rendermode}}</el-button>
</el-button-group> </el-button-group>
</div> </div> -->
<div class="menudown"> <div class="menudown">
<el-button-group> <el-button-group>
<el-button type="primary" @click="back">退出</el-button> <el-button type="primary" @click="back">退出</el-button>
@ -30,7 +44,9 @@ export default {
return { return {
jl3d: null, jl3d: null,
rendermode:'监控视角', rendermode:'监控视角',
renderswitch:false renderswitch:false,
stationlist:[],
value:"",
}; };
}, },
computed: { computed: {
@ -46,6 +62,7 @@ export default {
}, },
mounted() { mounted() {
this.init(); this.init();
window.updatestationlist = this.updatestationlist;
}, },
beforeDestroy() { beforeDestroy() {
@ -54,7 +71,7 @@ export default {
init: function () { init: function () {
// let mapdata = this.$store.state.socket.device; // let mapdata = this.$store.state.socket.device;
const dom = document.getElementById('jl3d'); const dom = document.getElementById('jl3d');
this.jl3d = new Jl3dpassflow(dom); this.jl3d = new Jl3dpassflow(dom,this.$route.query.mapid,this.$route.query.group);
}, },
switchrender() { switchrender() {
if (this.renderswitch == true) { if (this.renderswitch == true) {
@ -67,9 +84,14 @@ export default {
this.jl3d.switchrender(this.renderswitch); this.jl3d.switchrender(this.renderswitch);
} }
}, },
updatestationlist(list){
console.log(list);
this.value = list[0].name
this.stationlist = list;
},
back() { back() {
window.close(); window.close();
} },
} }
}; };
</script> </script>
@ -91,6 +113,22 @@ export default {
height: 100%; height: 100%;
z-index: 0; z-index: 0;
} }
.station{
width:250px;
height:100px;
top:0;
left:0;
text-align: center;
/* right:500px; */
/* bottom:0; */
position: absolute;
background-size: 100% 100%;
background-image: url('/static/texture/scene.png');
border-radius:10px;
}
.listmenu{
top:50%;
}
.menutop{ .menutop{
top:0; top:0;
right:0; right:0;

View File

@ -1,7 +1,7 @@
<template> <template>
<!-- v-quickMenuDrag --> <!-- v-quickMenuDrag -->
<div class="chatBox"> <div class="chatBox">
<div v-if="!minimize" class="chat-box"> <div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" /> <chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<div class="chat-box-main"> <div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" /> <chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />

View File

@ -627,6 +627,7 @@ export default {
path:'/jlmap3d/passengerflow', path:'/jlmap3d/passengerflow',
query:{ query:{
mapid:this.mapId, mapid:this.mapId,
group:this.group,
project: this.project project: this.project
} }
}); });

View File

@ -69,30 +69,25 @@ export default {
} }
}, },
watch:{ watch:{
'$store.state.map.trainListUpdate': function (val) { '$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') { if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = this.$store.state.map.map.trainList.filter((train)=>{ this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right; return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
}); });
this.bottomTrainList = this.$store.state.map.map.trainList.filter((train)=>{ this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right; return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
}); });
} else { } else {
this.trainList = this.$store.state.map.map.trainList.filter((train)=>{ this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined; return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
}); });
} }
}, },
'$store.state.map.runPlanStatus': function (val) { '$store.state.map.runPlanStatus': function (val) {
if (!val) { if (!val) {
if (this.lineCode == '10' || this.lineCode == '11') { this.$store.dispatch('map/resetActiveTrainList');
this.topTrainList = [];
this.bottomTrainList = [];
} else {
this.trainList = [];
}
} }
} }
}, },

View File

@ -4,7 +4,7 @@
<div v-show="!minimize" class="chat-box"> <div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" /> <chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main"> <div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" :group="group" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" /> <chat-coversition-list ref="chatCoversitionList" :group="group" :user-role="userRole" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window"> <div class="chat-window">
<div class="chat-box-header"> <div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div> <div class="chat-box-header-title">{{ headerTitle }}</div>
@ -30,7 +30,7 @@
</div> </div>
<div class="chat-box-footer"> <div class="chat-box-footer">
<div class="chat-box-footer-tool" /> <div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div> <div v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div> </div>
</div> </div>
</div> </div>
@ -95,6 +95,9 @@ export default {
computed:{ computed:{
isShow() { isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition; return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
},
isButtonShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
} }
}, },
mounted() { mounted() {
@ -118,8 +121,12 @@ export default {
this.$refs.chatCoversitionList.initPage(false); this.$refs.chatCoversitionList.initPage(false);
}, },
setCurrentCoversition(coversition) { setCurrentCoversition(coversition) {
this.currentCoversition = coversition; if (coversition) {
this.headerTitle = coversition.name; this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
}
if (this.recordSending) { if (this.recordSending) {
this.cancleRecording(); this.cancleRecording();
} }

View File

@ -94,20 +94,22 @@ export default {
}, },
methods:{ methods:{
inintData() { inintData() {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{ if (this.coversition) {
const userId = this.$store.state.user.id; getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const coversitionList = res.data.map(coversition=>{ const userId = this.$store.state.user.id;
coversition.self = false; const coversitionList = res.data.map(coversition=>{
if (coversition.member.userId == userId) { coversition.self = false;
coversition.self = true; if (coversition.member.userId == userId) {
} coversition.self = true;
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : ''; }
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All'; coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
return coversition; coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
this.scrollTop();
}); });
this.chatContentList = coversitionList; }
this.scrollTop();
});
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList); // const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
// const coversitionList = coversitionListAll[this.coversition.id] || []; // const coversitionList = coversitionListAll[this.coversition.id] || [];
// // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id])); // // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id]));

View File

@ -9,7 +9,7 @@
@click="changeCoversition(coversition)" @click="changeCoversition(coversition)"
> >
<div class="coversitionName">{{ coversition.name }}</div> <div class="coversitionName">{{ coversition.name }}</div>
<div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" /> <!-- <div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -22,6 +22,10 @@ export default {
group: { group: {
type: String, type: String,
required: true required: true
},
userRole: {
type: String,
required: true
} }
}, },
data() { data() {
@ -30,21 +34,40 @@ export default {
currentCoversition:{} currentCoversition:{}
}; };
}, },
watch:{
'userRole':function(val) {
this.initPage(true);
}
},
mounted() { mounted() {
this.initPage(true); // this.initPage(true);
}, },
methods:{ methods:{
initPage(status) { initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{ getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) { if (resp.data) {
const data = resp.data; const data = resp.data;
this.coversitionList = data; if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
if (resp.data.length >= 2) { this.coversitionList = data;
this.$emit('hideAddCoversition'); } else {
this.coversitionList = data.filter(coversition=>{ return coversition.all == false; });
if (this.coversitionList.length >= 1) {
this.$emit('hideAddCoversition');
}
} }
if (resp.data && resp.data.length && resp.data.length > 0 && status) { if (resp.data && resp.data.length && resp.data.length > 0 && status) {
this.currentCoversition = data[0]; if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
this.$emit('setCurrentCoversition', resp.data[0]); this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
if (this.coversitionList.length >= 1) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
this.currentCoversition = null;
this.$emit('setCurrentCoversition', this.currentCoversition);
}
}
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) { } else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
const coversition = data.filter(coversition=>{ return coversition.all == false; }); const coversition = data.filter(coversition=>{ return coversition.all == false; });
this.currentCoversition = coversition[0]; this.currentCoversition = coversition[0];

View File

@ -59,27 +59,29 @@ export default {
methods:{ methods:{
getSimulationMembers() { getSimulationMembers() {
this.memberList = []; this.memberList = [];
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => { if (this.currentCoversition) {
let lastData = JSON.stringify(resp.data); getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; let lastData = JSON.stringify(resp.data);
roleTypeList.forEach(function(element) { const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
const rolename = element.value; roleTypeList.forEach(function(element) {
if (Cookies.get('user_lang') == 'en') { const rolename = element.value;
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); if (Cookies.get('user_lang') == 'en') {
} else { lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); } else {
} lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
}); });
lastData = JSON.parse(lastData); }
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
});
} }
} }
}; };

View File

@ -69,30 +69,25 @@ export default {
} }
}, },
watch:{ watch:{
'$store.state.map.trainListUpdate': function (val) { '$store.state.map.activeTrainListUpdate': function (val) {
const trainList = Object.values(this.$store.state.map.activeTrainList);
if (this.lineCode == '10' || this.lineCode == '11') { if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = this.$store.state.map.map.trainList.filter((train)=>{ this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right; return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
}); });
this.bottomTrainList = this.$store.state.map.map.trainList.filter((train)=>{ this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right; return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
}); });
} else { } else {
this.trainList = this.$store.state.map.map.trainList.filter((train)=>{ this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined; return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
}); });
} }
}, },
'$store.state.map.runPlanStatus': function (val) { '$store.state.map.runPlanStatus': function (val) {
if (!val) { if (!val) {
if (this.lineCode == '10' || this.lineCode == '11') { this.$store.dispatch('map/resetActiveTrainList');
this.topTrainList = [];
this.bottomTrainList = [];
} else {
this.trainList = [];
}
} }
} }
}, },
@ -114,11 +109,13 @@ export default {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
covert(data) { covert(data) {
let min = (Math.abs(data) - Math.abs(data) % 60) / 60; const hours = Math.floor(data / 3600);
let seconds = Math.abs(data) % 60; let min = Math.floor((data % 3600) / 60);
let seconds = (data % 3600) % 60;
min = min > 9 ? min : '0' + min; min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds; seconds = seconds > 9 ? seconds : '0' + seconds;
return data == 0 ? '00:00' : (data > 0 ? min + ':' + seconds + 'E' : min + ':' + seconds + 'L'); const time = hours + ':' + min + ':' + seconds;
return data == 0 ? '00:00:00' : (data > 0 ? time + 'E' : time + 'L');
} }
} }
}; };

View File

@ -127,10 +127,13 @@ export default {
case 'Command': case 'Command':
{ {
const command = CommandHandler.getScriptDefinition(element.operationType); const command = CommandHandler.getScriptDefinition(element.operationType);
const operateType = command.operate.split('_')[0]; let operateType = command.operate.split('_')[0];
const data = command.operate.toUpperCase(); const data = command.operate.toUpperCase();
if (operateType == 'CM') {
operateType = 'ControlConvertMenu';
}
const operateName = CMD[operateType]['CMD_' + data]; const operateName = CMD[operateType]['CMD_' + data];
const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', CM:'控制模式'}; const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', ControlConvertMenu:'控制模式'};
const operateTypeName = deviceTypeList[operateType]; const operateTypeName = deviceTypeList[operateType];
this.actionInfoList.push({id: element.id, isCoversition: false, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false}); this.actionInfoList.push({id: element.id, isCoversition: false, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false});
break; break;

View File

@ -27,9 +27,9 @@ export default {
expression:'' expression:''
}, },
expressionList:[ expressionList:[
{label:'等于',value:'eq'}, {label:'等于', value:'eq'},
{label:'不等于', value:'neq'}, {label:'不等于', value:'neq'}
] ]
}; };
}, },
computed: { computed: {
@ -38,7 +38,7 @@ export default {
labelWidth: '100px', labelWidth: '100px',
items: [ items: [
{ prop: 'name', label: '参数名', type: 'text' }, { prop: 'name', label: '参数名', type: 'text' },
{ prop: 'expression', label:'操作符', type: 'select',options:this.expressionList}, { prop: 'expression', label:'操作符', type: 'select', options:this.expressionList},
{ prop: 'value', label: '参数值', type: 'text' } { prop: 'value', label: '参数值', type: 'text' }
] ]
}; };
@ -90,7 +90,7 @@ export default {
return { return {
name: this.formModel.name, name: this.formModel.name,
value: this.formModel.value, value: this.formModel.value,
expression:this.formModel.expression, expression:this.formModel.expression
}; };
}, },
create() { create() {

View File

@ -6,7 +6,7 @@
</template> </template>
<script> <script>
import { getCommandList, delCommand } from '@/api/management/dictionary'; import { createCommand, getCommandList, delCommand } from '@/api/management/dictionary';
import { getLineCodeList } from '@/api/management/mapline'; import { getLineCodeList } from '@/api/management/mapline';
import CommandEnum from '@/scripts/cmdPlugin/CommandEnum'; import CommandEnum from '@/scripts/cmdPlugin/CommandEnum';
import ShowCondition from './showCondition'; import ShowCondition from './showCondition';
@ -105,6 +105,10 @@ export default {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.handleEdit handleClick: this.handleEdit
}, },
{
name: '复制',
handleClick: this.handleCopy
},
{ {
name: this.$t('global.delete'), name: this.$t('global.delete'),
handleClick: this.handleDelete, handleClick: this.handleDelete,
@ -187,6 +191,21 @@ export default {
}); });
}); });
}, },
handleCopy(index, row) { //
this.$confirm('您是否确认复制该指令?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
const param = row;
createCommand(param).then(response => {
this.$message.success('复制指令成功!');
}).catch(error => {
console.log(error);
this.$message.error('复制指令失败!');
});
});
},
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
} }

View File

@ -45,7 +45,7 @@
<span class="el-icon-microphone" /> <span class="el-icon-microphone" />
</div> </div>
</div> </div>
<textarea id="dope" v-model="text" class="chat__footer--text" style="width: 99%;height: 47px; border: none;outline: none;" @keyup="handleSetInputState" /> <textarea id="dope" v-model="text" class="chat__footer--text" style="width: 99%;height: 47px; border: none;outline: none;" @keyup="handleSetInputState" @keyup.enter="handleSendText" />
<button class="chat__footer--send" :disabled="disabled" @click="handleSendText">{{ $t('trainRoom.sendText') }}</button> <button class="chat__footer--send" :disabled="disabled" @click="handleSendText">{{ $t('trainRoom.sendText') }}</button>
</div> </div>
</div> </div>
@ -109,7 +109,7 @@ export default {
} }
}, },
methods: { methods: {
async handleSetInputState() { async handleSetInputState(keyCode) {
if (!this.text.trim()) { if (!this.text.trim()) {
this.disabled = true; this.disabled = true;
} else { } else {

File diff suppressed because it is too large Load Diff

BIN
static/texture/scene.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB