Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-06-05 18:23:29 +08:00
commit 6a25abd809
94 changed files with 3568 additions and 599 deletions

View File

@ -29,13 +29,6 @@ export function participantCreatTrainingRoom(id, data) {
data: data data: data
}); });
} }
/** 参赛者完成竞赛 */
export function participantCompleteCompetition(id, group) {
return request({
url: `/api/v1/competition/${id}/room/${group}`,
method: 'post'
});
}
/** 分页获取地图下的实操列表 */ /** 分页获取地图下的实操列表 */
export function getQuestionListByMapId(params) { export function getQuestionListByMapId(params) {
@ -184,3 +177,66 @@ export function getPracticalCompetitionResult(competitionId) {
method: 'get' method: 'get'
}); });
} }
/** 回访准备 */
export function playBackReady(params) {
return request({
url: `/api/v1/simulationRecord/playback/ready`,
method: 'get',
params
});
}
/** 设置倍速 */
export function setPlaySpeed(params) {
return request({
url: `/api/v1/simulationRecord/playback/setPlaySpeed`,
method: 'get',
params
});
}
/** 开始播放 */
export function startPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/startPlaying`,
method: 'get',
params
});
}
/** 暂停播放 */
export function playingPause(params) {
return request({
url: `/api/v1/simulationRecord/playback/pausePlaying`,
method: 'get',
params
});
}
/** 结束播放 */
export function endPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/endPlaying`,
method: 'get',
params
});
}
/** 从暂停中播放 */
export function fromPauseToPlay(params) {
return request({
url: `/api/v1/simulationRecord/playback/playing`,
method: 'get',
params
});
}
/** 裁判查询理论考试结果 */
export function getTheroyCompetitionResult(competitionId, raceUserId) {
return request({
url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`,
method: 'get'
});
}

View File

@ -385,6 +385,15 @@ export function modifyScriptAction(group, actionId, data) {
}); });
} }
/** 修改剧本动作(新版) */
export function modifyScriptActionNew(group, data) {
return request({
url: `/api/scriptSimulation/${group}/action/update`,
method: 'put',
data
});
}
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
export function getExistingSimulation(params) { export function getExistingSimulation(params) {
return request({ return request({
@ -604,6 +613,15 @@ export function getNewMapDataByGroup(group) {
method: 'get' method: 'get'
}); });
} }
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}
/** 新版地图指令操作定义 */ /** 新版地图指令操作定义 */
export function newMapOperate(group, operationId, data) { export function newMapOperate(group, operationId, data) {
return request({ return request({
@ -700,3 +718,4 @@ export function getMemberInfo(group, memberId) {
method: 'get' method: 'get'
}); });
} }

View File

@ -265,5 +265,29 @@ deviceRender[deviceType.Cistern] = {
_type: deviceType.Cistern, _type: deviceType.Cistern,
zlevel: 1, zlevel: 1,
z: 5 z: 5
} };
// 电动阀
deviceRender[deviceType.Electrically] = {
_type: deviceType.Electrically,
zlevel: 1,
z: 5
};
// 扶梯
deviceRender[deviceType.Stairs] = {
_type: deviceType.Stairs,
zlevel: 1,
z: 5
};
// 电梯
deviceRender[deviceType.Elevator] = {
_type: deviceType.Elevator,
zlevel: 1,
z: 5
};
// 风机
deviceRender[deviceType.Draught] = {
_type: deviceType.Draught,
zlevel: 1,
z: 5
};
export default deviceRender; export default deviceRender;

View File

@ -40,7 +40,11 @@ const deviceType = {
LightingGroup: 'LightingGroup', LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric', BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve', ElectricButterflyValve: 'ElectricButterflyValve',
Cistern: 'Cistern' Cistern: 'Cistern',
Electrically: 'Electrically',
Stairs: 'Stairs',
Elevator: 'Elevator',
Draught: 'Draught'
}; };
export default deviceType; export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,275 @@
import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event';
import store from '@/store/index_APP_TARGET';
class EventModel {
constructor(e) {
this.clientX = e.event.clientX;
this.clientY = e.event.clientY;
let view = e.target;
while (view) {
if (Object.values(deviceType).includes(view._type)) {
this.deviceCode = view._code;
this.deviceType = view._type;
this.deviceModel = view.model;
this.eventTarget = view;
break;
}
view = view.parent;
}
}
}
class MouseController extends Eventful {
constructor(iscs) {
super();
this.$iscs = iscs;
this.$zr = iscs.getZr();
this.isAllowDragging = iscs.isAllowDragging || false; // 是否在绘图中,仅绘图状态下可拖拽
this.events = iscs.getEvents();
// this._dragging = false; // 是否在拖拽状态
this.deviceList = [];
this.rightClickPoint = {
x: 0,
y: 0
}; // 右键点击坐标
this.initHandler(this.$zr);
}
initHandler(zr) {
if (zr) {
zr.on('contextmenu', this.contextmenu, this);
zr.on('mousemove', this.moveEvent, this);
zr.on('click', this.click, this);
this.enable = function (opts) {
opts = opts || {};
this._moveOnMouseMove = opts.moveOnMouseMove || true;
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
this.disable();
zr.on('mousedown', this.mousedown, this);
zr.on('mousemove', this.mousemove, this);
zr.on('mouseup', this.mouseup, this);
zr.on('touchstart', this.mousedown, this);
zr.on('touchmove', this.mousemove, this);
zr.on('touchend', this.mouseup, this);
};
this.disable = function () {
zr.off('mousedown', this.mousedown);
zr.off('mousemove', this.mousemove);
zr.off('mouseup', this.mouseup);
zr.off('touchstart', this.mousedown);
zr.off('touchmove', this.mousemove);
zr.off('touchend', this.mouseup);
};
this.dispose = function () {
zr.off('click', this.click);
zr.off('contextmenu', this.contextmenu);
zr.off('mousemove', this.moveEvent);
this.disable();
};
// this.isDragging = function () { return this._dragging; };
}
}
setAllowDragging(data) {
this.isAllowDragging = data;
}
mousedown(e) {
e.event.preventDefault();
e.event.stopPropagation();
const em = new EventModel(e);
this.eventTarget = em.eventTarget;
this._offsetX = e.offsetX;
this._offsetY = e.offsetY;
this._x = e.offsetX;
this._y = e.offsetY;
// this._dragging = true;
console.log(e, e.which);
if (e.which === 3) {
this.handleMouseDownRight(e);
} else if (e.which === 1) {
this.handleMouseDownLeft(e);
}
console.log(this.deviceList);
}
mousemove(e) {
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this._x = e.offsetX;
this._y = e.offsetY;
if (e.which === 3) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
} else if (e.which === 1) {
this.handleMouseMoveLeft(e, dx, dy, oldX, oldY);
}
}
mouseup(e) {
console.log(e);
if (eventTool.notLeftMouse(e) || !this.eventTarget ) {
return;
}
// if (this.deviceList.length) {
// this.deviceList.forEach(item => {
// item.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
// });
// this.deviceList = [];
// this.$iscs.deleteCheckBox('check_box');
// this.eventTarget = '';
// // this._dragging = false;
// this.deviceList = [];
// return;
// }
// if (this.isAllowDragging) {
// this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
// this.eventTarget.dirty();
// }
// this.eventTarget = '';
// // this._dragging = false;
// this.deviceList = [];
}
contextmenu(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Contextmenu, em);
}
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
}
moveEvent(e) {
const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails;
if (trainDetails) {
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
var instance = (this.$iscs.getDeviceByCode(trainDetails.code) || {} ).instance;
instance && instance.removeTrainDetail && instance.removeTrainDetail();
}
}
}
checkEvent(e) {
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
var newEm = new EventModel(e);
if ([1, 3].includes(e.which)) {
// 查找之前和当前鼠标选中的实例
var oldDevice = this.$iscs.getDeviceByCode(oldEm.deviceCode) || {};
var newDevice = this.$iscs.getDeviceByCode(newEm.deviceCode) || {};
var oldInstance = (this.$iscs.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
var newInstance = (this.$iscs.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
// 如果之前和当前选中的实例不一致
if (oldInstance != newInstance) {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}
// 保存当前实例到全局
this.$zr.curEvent = e;
}
return newEm;
}
/** 处理鼠标右键按下事件 */
handleMouseDownRight(e) {
this.deviceList = [];
this.$iscs.deleteCheckBox('check_box'); // 清空上次操作
this.rightClickPoint.x = e.offsetX;
this.rightClickPoint.y = e.offsetY;
}
/** 处理鼠标左键按下事件 */
handleMouseDownLeft(e) {
if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
this.handleBoundingRect(this.eventTarget);
} else {
this.$iscs.deleteCheckBox('check_box');
}
}
/** 处理右键拖动事件--- 改变选中区域大小 */
handleMouseMoveRight(point2) {
const point1 = this.rightClickPoint;
const x = Math.min(point1.x, point2.x) + this.$iscs.$options.offsetX;
const y = Math.min(point1.y, point2.y) + this.$iscs.$options.offsetY;
const width = Math.abs(point1.x - point2.x);
const height = Math.abs(point1.y - point2.y);
this.$iscs.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
}
/** 处理左键拖动事件--- 图形移动 */
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
// if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
// return;
// }
// 选中区域图形移动
// if (this.deviceList.length) {
// this.deviceList.forEach(item => {
// item.grouper.drift(dx, dy, e);
// });
// } else if (this._dragging && this.eventTarget) { // 选中元素图形移动
// if (!this.isAllowDragging) {
// this._preventDefaultMouseMove && eventTool.stop(e.event);
// this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
// } else if (this.isAllowDragging) {
// this.eventTarget.grouper.drift(dx, dy, e);
// }
// } else if (this._dragging) {
// this._preventDefaultMouseMove && eventTool.stop(e.event);
// this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
// }
}
/** 通过包围盒筛选选中区域的元素 */
handleBoundingRect(eventTarget) {
this.deviceList = [];
let boundingRect = eventTarget.grouper.getBoundingRect();
boundingRect = this.createFakeBoundingRect(eventTarget, boundingRect);
const deviceList = Object.values(this.$iscs.iscsDevice);
const includeDeviceList = [];
deviceList.forEach( item =>{
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
includeDeviceList.push(item.instance);
}
});
this.deviceList = includeDeviceList;
}
/** 创建假包围盒对象 */
createFakeBoundingRect(instance, boundingRect) {
return {
x1: instance.model.point.x + boundingRect.x,
y1: instance.model.point.y + boundingRect.y,
x2: instance.model.point.x + boundingRect.width,
y2: instance.model.point.y + boundingRect.height
};
}
/** 判断元素包围盒是否在选中区域 */
whetherInclude(boundingRect1, boundingRect2) {
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
}
}
export default MouseController;

View File

@ -0,0 +1,27 @@
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);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -0,0 +1,85 @@
import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Isogon from 'zrender/src/graphic/shape/Isogon';
// 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() {
// const model = this.model;
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.control = new Arc({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: 0,
cy: 0,
r: 4
},
style: {
lineWidth: 2,
fill: 'rgba(0,0,0,0)',
stroke: '#00FF00'
}
});
this.isogon1 = new Isogon({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 8,
y: -6,
r: 5,
n: 3
},
origin: [8, -6],
rotation: Math.PI,
style: {
lineWidth: 2,
fill: '#00FF00',
stroke: '#00FF00'
}
});
this.isogon2 = new Isogon({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 8,
y: 6,
r: 5,
n: 3
},
origin: [8, 6],
style: {
lineWidth: 2,
fill: '#00FF00',
stroke: '#00FF00'
}
});
// this.path = createPathSvg(this.model);
this.grouper.add(this.control);
this.grouper.add(this.isogon1);
this.grouper.add(this.isogon2);
if (this.model.rotate) {
this.grouper.rotation = -Math.PI / 180 * Number(this.model.rotate);
}
const scale = this.model.width / 20;
this.grouper.scale = [scale, scale];
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

@ -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

@ -75,6 +75,22 @@ const map = {
StaircaseOneWay: { StaircaseOneWay: {
width: 51, width: 51,
path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z' path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z'
},
Electrically: { // 电动阀
width: 73,
path: 'M 26 0 H 72 L 56 35 V 46 L 73 82 H 26 L 38 51 a 27.845 27.845 0 0 1 -20 9 C 7.082 60.076 0.422 50.8 0 41 c -0.3 -6.868 4.7 -19.035 19 -19 c 15.658 0.038 18 8 18 8 Z m 6 39 c 0.391 11.618 -7.282 14.527 -14 14 c -5.872 -0.461 -11.018 -4.744 -11 -13 C 7.033 24.563 31.537 25.228 32 39 Z'
},
Stairs: { // 扶梯
width: 154,
path: 'M397,235l-98,64H269V256h26l88-57h40v36H397ZM297,261H274v33h24l22.522-14.478L313,272l-13-1,4.468-14.893Zm14.575-9.549,15.385,23.932,22.764-14.634L345,254l-13-2,5.2-17.339Zm46.67,3.82,23.686-15.227L377,233l-13-2,5.189-17.3-26.5,17.364ZM418,204H384l-9.3,6.092,15.738,24.482L396,231h22V204Z'
},
Elevator: { // 电梯
width: 134,
path: 'M124,10V129H9V10H124ZM16,121H117V15H16V121Zm91.5-59a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,107.5,62Zm0-11a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,107.5,51Zm0-11a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,107.5,40Zm0-10a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,107.5,30ZM67,64H64V82l-2,1v22l-5-2V85H55v21l-5-1L49,54H43V69l-4-2V50l12-1s-3.327-1.327-4-3c-1.151-2.858-2.493-7.956,5-10s10.62,2.4,11,5c0.861,5.9-2,7-2,7v3l5,2,10,9,13-2v3s-6.188,4.864-13,5S67,64,67,64Zm59-10V8H7V131H126V82h8v55H0V0H134V54h-8Z'
},
Draught: {
width: 58,
path: 'M51,37H40s-7.972-2.382-9-13c-0.861-8.9,8-13,8-13h5l2-2V0H58V28ZM56,2H48V4h8V2Zm0,4H48V8h8V6Zm0,4H48l-3,3H40s-7.193,3.874-7,11c0.212,7.819,8,11,8,11h9l6-8V10ZM37,24s-0.648-7.966,8-9c0,0,9,.386,9,8,0,0-.386,8.444-8,9C46,32,37,31.614,37,24ZM8,36S1.028,34.618,0,24c-0.861-8.9,8-14,8-14h5l2-3V0H28V28l-8,8H8ZM17,2V4.82L23.658,2H17Zm9,1.18L19.343,6H26V3.18ZM26,8H17l-3,4H10S1.807,15.874,2,23A13,13,0,0,0,9,34H19l7-7V8ZM6,24c-0.08-2.305,1.386-9,9-9,0,0,8,.386,8,8,0,0,.54,7.739-8,9C12.306,32.4,6.224,30.493,6,24Z'
} }
}; };

View File

@ -41,6 +41,10 @@ import StateTable from './stateTable';
import LightingGroup from './lighting'; import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve'; import ElectricButterflyValve from './bas/electricButterflyValve';
import Cistern from './bas/cistern'; import Cistern from './bas/cistern';
import Electrically from './bas/electrically';
import Stairs from './bas/stairs';
import Elevator from './bas/elevator';
import Draught from './bas/draught';
const iscsShape = {}; const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -86,6 +90,10 @@ iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric; iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve; iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
iscsShape[deviceType.Cistern] = Cistern; iscsShape[deviceType.Cistern] = Cistern;
iscsShape[deviceType.Electrically] = Electrically;
iscsShape[deviceType.Stairs] = Stairs;
iscsShape[deviceType.Elevator] = Elevator;
iscsShape[deviceType.Draught] = Draught;
function shapefactory(device, iscs) { function shapefactory(device, iscs) {
const type = device.model._type; const type = device.model._type;

View File

@ -46,7 +46,17 @@ const stateMap = {
decoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 解码器状态 decoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 解码器状态
quadDecoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 四路解码器状态 quadDecoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 四路解码器状态
quadDecoderModeState: { default: '监视器', color: '#4CCDE4'}, // 四路解码器模式状态 quadDecoderModeState: { default: '监视器', color: '#4CCDE4'}, // 四路解码器模式状态
controlKeyboardState: { default: true, type: 'Circle', color: '#4CCDE4'} // 控制键盘状态 controlKeyboardState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 控制键盘状态
coilInPower: { default: '正常', color: '#FF0000'}, // 进线电源
bypassSwitchStatus: { default: '旁路关', color: '#FFF'}, // 旁路开关状态
powerUnderVoltageAlarm: { default: '正常', color: '#FF0000'}, // 电源欠压报警
fanRunningState: { default: '运行', color: '#FFF'}, // 风扇运行状态
generalAlarmSignal: { default: '正常', color: '#FF0000'}, // 总报警信号
batteryCapacity: { default: '100', color: '#FFF', unit: '%', unitColor: '#4CCDE4'}, // 电池容量
chargingTime: { default: '0', color: '#FFF', unit: 'h', unitColor: '#4CCDE4'}, // 充电时间
dischargeTime: { default: '0', color: '#FFF', unit: 'h', unitColor: '#4CCDE4'}, // 放电时间
acOutputVoltage: { default: '220.0', color: '#FFF', unit: 'V', unitColor: '#4CCDE4'}, // 交流输出电压
dcVoltageSignal: { default: '545.0', color: '#FFF', unit: 'V', unitColor: '#4CCDE4'} // 直流电压信号
}; };
export default class StateTable extends Group { export default class StateTable extends Group {
@ -211,6 +221,28 @@ export default class StateTable extends Group {
textLineHeight: model.rowHeight textLineHeight: model.rowHeight
} }
}); });
if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) {
const unitText = new Text({
zlevel: model.zlevel,
z: model.z + 1,
_subType: stateMap[item['column' + (j + 1)]],
style:{
x: elem + width - 5,
y: model.rowHeight * (i + contentIndex),
fontWeight: 'normal',
fontSize: model.fontSize,
fontFamily: 'consolas',
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '',
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : '#4CCDE4',
textAlign: 'right',
textPosition: 'inside',
textVerticalAlign: 'bottom',
textLineHeight: model.rowHeight
}
});
this.grouper.add(unitText);
this.tabelContent.push(unitText);
}
this.grouper.add(text); this.grouper.add(text);
this.tabelContent.push(text); this.tabelContent.push(text);
} }

View File

@ -2,8 +2,8 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix'; import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType'; import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender'; import deviceRender from '../constant/deviceRender';
import store from '@/store/index_APP_TARGET'; // import store from '@/store/index_APP_TARGET';
import { deepClone } from '@/utils/index'; // import { deepClone } from '@/utils/index';
export function createTransform(opts) { export function createTransform(opts) {
let transform = matrix.create(); let transform = matrix.create();
@ -168,7 +168,19 @@ export function parser(data) {
}); });
zrUtil.each(data.cisternList || [], elem => { zrUtil.each(data.cisternList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Cistern, elem); iscsDevice[elem.code] = deviceFactory(deviceType.Cistern, elem);
}) });
zrUtil.each(data.electricallyList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Electrically, elem);
});
zrUtil.each(data.stairsList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Stairs, elem);
});
zrUtil.each(data.elevatorList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Elevator, elem);
});
zrUtil.each(data.draughtList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Draught, elem);
});
} }
return iscsDevice; return iscsDevice;
@ -194,129 +206,50 @@ function updateIscsListByDevice(state, name, device) {
export function updateIscsData(state, device) { export function updateIscsData(state, device) {
// const state = store.state; // const state = store.state;
switch (device._type) { switch (device._type) {
case deviceType.Vidicon : case deviceType.Vidicon : updateIscsListByDevice(state, 'vidiconList', device); break;
updateIscsListByDevice(state, 'vidiconList', device); case deviceType.VidiconCloud : updateIscsListByDevice(state, 'vidiconCloudList', device); break;
break; case deviceType.ManualAlarmButton : updateIscsListByDevice(state, 'manualAlarmButtonList', device); break;
case deviceType.VidiconCloud : case deviceType.FireHydranAlarmButton: updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); break;
updateIscsListByDevice(state, 'vidiconCloudList', device); case deviceType.GasFireControl: updateIscsListByDevice(state, 'gasFireControlList', device); break;
break; case deviceType.SmokeDetector: updateIscsListByDevice(state, 'smokeDetectorList', device); break;
case deviceType.ManualAlarmButton : case deviceType.TemperatureDetector: updateIscsListByDevice(state, 'temperatureDetectorList', device); break;
updateIscsListByDevice(state, 'manualAlarmButtonList', device); case deviceType.PlatformScreenDoor: updateIscsListByDevice(state, 'platformScreenDoorList', device); break;
break; case deviceType.FrozenPump : updateIscsListByDevice(state, 'frozenPumpList', device); break;
case deviceType.FireHydranAlarmButton: case deviceType.Ventilator : updateIscsListByDevice(state, 'ventilatorList', device); break;
updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); case deviceType.Chiller : updateIscsListByDevice(state, 'chillerList', device); break;
break; case deviceType.CoolTower : updateIscsListByDevice(state, 'coolTowerList', device); break;
case deviceType.GasFireControl: case deviceType.EndDoor: updateIscsListByDevice(state, 'endDoorList', device); break;
updateIscsListByDevice(state, 'gasFireControlList', device); case deviceType.BorderRadius: updateIscsListByDevice(state, 'borderRadiusList', device); break;
break; case deviceType.BrakeMachine: updateIscsListByDevice(state, 'brakeMachineList', device); break;
case deviceType.SmokeDetector: case deviceType.EntranceGuard: updateIscsListByDevice(state, 'entranceGuardList', device); break;
updateIscsListByDevice(state, 'smokeDetectorList', device); case deviceType.TicketMachine: updateIscsListByDevice(state, 'ticketMachineList', device); break;
break; case deviceType.SemiAutomaticTicketMachine: updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device); break;
case deviceType.TemperatureDetector: case deviceType.AirConditioner: updateIscsListByDevice(state, 'airConditionerList', device); break;
updateIscsListByDevice(state, 'temperatureDetectorList', device); case deviceType.OrbitalVentilator: updateIscsListByDevice(state, 'orbitalVentilatorList', device); break;
break; case deviceType.JetFan: updateIscsListByDevice(state, 'jetFanList', device); break;
case deviceType.PlatformScreenDoor: case deviceType.TunnelFan: updateIscsListByDevice(state, 'tunnelFanList', device); break;
updateIscsListByDevice(state, 'platformScreenDoorList', device); case deviceType.FireDamper: updateIscsListByDevice(state, 'fireDamperList', device); break;
break; case deviceType.SmookExhaustFd: updateIscsListByDevice(state, 'smookExhaustFdList', device); break;
case deviceType.FrozenPump : case deviceType.SmookProofFd: updateIscsListByDevice(state, 'smookProofFdList', device); break;
updateIscsListByDevice(state, 'frozenPumpList', device); case deviceType.VolumeControlDamper: updateIscsListByDevice(state, 'volumeControlDamperList', device); break;
break; case deviceType.IscsRect: updateIscsListByDevice(state, 'iscsRectList', device); break;
case deviceType.Ventilator : case deviceType.IscsText: updateIscsListByDevice(state, 'iscsTextList', device); break;
updateIscsListByDevice(state, 'ventilatorList', device); case deviceType.IscsLine: updateIscsListByDevice(state, 'iscsLineList', device); break;
break; case deviceType.Escalator: updateIscsListByDevice(state, 'escalatorList', device); break;
case deviceType.Chiller : case deviceType.StairControl: updateIscsListByDevice(state, 'stairControlList', device); break;
updateIscsListByDevice(state, 'chillerList', device); case deviceType.FasBrakeMachine: updateIscsListByDevice(state, 'fasBrakeMachineList', device); break;
break; case deviceType.Staircase: updateIscsListByDevice(state, 'staircaseList', device); break;
case deviceType.CoolTower : case deviceType.SingleStaircase: updateIscsListByDevice(state, 'singleStaircaseList', device); break;
updateIscsListByDevice(state, 'coolTowerList', device); case deviceType.ArcStatus: updateIscsListByDevice(state, 'arcStatusList', device); break;
break; case deviceType.IscsButton: updateIscsListByDevice(state, 'iscsButtonList', device); break;
case deviceType.EndDoor: case deviceType.StateTable: updateIscsListByDevice(state, 'stateTableList', device); break;
updateIscsListByDevice(state, 'endDoorList', device); case deviceType.LightingGroup: updateIscsListByDevice(state, 'lightingGroupList', device); break;
break; case deviceType.BalancedElectric: updateIscsListByDevice(state, 'balancedElectricList', device); break;
case deviceType.BorderRadius: case deviceType.ElectricButterflyValve: updateIscsListByDevice(state, 'electricButterflyValveList', device); break;
updateIscsListByDevice(state, 'borderRadiusList', device); case deviceType.Cistern: updateIscsListByDevice(state, 'cisternList', device); break;
break; case deviceType.Electrically: updateIscsListByDevice(state, 'electricallyList', device); break;
case deviceType.BrakeMachine: case deviceType.Stairs: updateIscsListByDevice(state, 'stairsList', device); break;
updateIscsListByDevice(state, 'brakeMachineList', device); case deviceType.Elevator: updateIscsListByDevice(state, 'elevatorList', device); break;
break; case deviceType.Draught: updateIscsListByDevice(state, 'draughtList', device); break;
case deviceType.EntranceGuard:
updateIscsListByDevice(state, 'entranceGuardList', device);
break;
case deviceType.TicketMachine:
updateIscsListByDevice(state, 'ticketMachineList', device);
break;
case deviceType.SemiAutomaticTicketMachine:
updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device);
break;
case deviceType.AirConditioner:
updateIscsListByDevice(state, 'airConditionerList', device);
break;
case deviceType.OrbitalVentilator:
updateIscsListByDevice(state, 'orbitalVentilatorList', device);
break;
case deviceType.JetFan:
updateIscsListByDevice(state, 'jetFanList', device);
break;
case deviceType.TunnelFan:
updateIscsListByDevice(state, 'tunnelFanList', device);
break;
case deviceType.FireDamper:
updateIscsListByDevice(state, 'fireDamperList', device);
break;
case deviceType.SmookExhaustFd:
updateIscsListByDevice(state, 'smookExhaustFdList', device);
break;
case deviceType.SmookProofFd:
updateIscsListByDevice(state, 'smookProofFdList', device);
break;
case deviceType.VolumeControlDamper:
updateIscsListByDevice(state, 'volumeControlDamperList', device);
break;
case deviceType.IscsRect:
updateIscsListByDevice(state, 'iscsRectList', device);
break;
case deviceType.IscsText:
updateIscsListByDevice(state, 'iscsTextList', device);
break;
case deviceType.IscsLine:
updateIscsListByDevice(state, 'iscsLineList', device);
break;
case deviceType.Escalator:
updateIscsListByDevice(state, 'escalatorList', device);
break;
case deviceType.StairControl:
updateIscsListByDevice(state, 'stairControlList', device);
break;
case deviceType.FasBrakeMachine:
updateIscsListByDevice(state, 'fasBrakeMachineList', device);
break;
case deviceType.Staircase:
updateIscsListByDevice(state, 'staircaseList', device);
break;
case deviceType.SingleStaircase:
updateIscsListByDevice(state, 'singleStaircaseList', device);
break;
case deviceType.ArcStatus:
updateIscsListByDevice(state, 'arcStatusList', device);
break;
case deviceType.IscsButton:
updateIscsListByDevice(state, 'iscsButtonList', device);
break;
case deviceType.StateTable:
updateIscsListByDevice(state, 'stateTableList', device);
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;
case deviceType.Cistern:
updateIscsListByDevice(state, 'cisternList', device);
break;
} }
// store.dispatch('iscs/setIscsData', state.iscs);
} }

View File

@ -608,14 +608,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: { x: -4, y: 4 }// 车组号偏移量 trainTargetNumberOffset: { x: -4, y: 4 }// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1 }, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10 }, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
trainConntWidth: 3, // 列车竖杠的宽度 trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 6, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -544,14 +544,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 5, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -729,14 +729,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 3, // 列车竖杠的宽度 trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 6, // 列车车头三角宽度
trainHeadArrowOffsetX: 5 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -582,14 +582,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 5, y: 9}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 18, // 列车车头矩形高度 trainHeadRectHeight: 18, // 列车车头矩形高度
trainConntWidth: 5, // 列车竖杠的宽度 trainConntWidth: 5, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 5, // 列车车头三角宽度
trainHeadArrowOffsetX: 3 // 列车车头三角偏移
}, },
common: { common: {
useSelfFormat: true, useSelfFormat: true,

View File

@ -570,14 +570,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 5, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 17, // 列车高度 trainHeight: 17, // 列车高度

View File

@ -630,14 +630,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: { x: 5, y: 25 }// 车组号偏移量 trainTargetNumberOffset: { x: 5, y: 25 }// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0 }, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5 }, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 0, // 列车竖杠的宽度 trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 5, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
hasTravelSigns: true, // 是否有行进标志 hasTravelSigns: true, // 是否有行进标志

View File

@ -581,14 +581,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 4, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 9, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量
trainConntWidth: 2, // 列车竖杠的宽度 trainConntWidth: 2, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色 trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 5, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -502,6 +502,23 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.StationTurnBack] = { // 站后折返
lamp: {
fill: '#FFFF00', // 填充色
radiusR: 6 // 控制灯大小
},
text: {
fontWeight: 'normal',
fontSize: 12,
distance: 10
},
rect: {
fill: 'rgba(0,0,0,0)',
stroke: '#fff',
lineWidth: 2,
padding: 6
}
};
this[deviceType.LimitControl] = { this[deviceType.LimitControl] = {
text: { text: {
fontSize: 10, // 字体大小 fontSize: 10, // 字体大小
@ -618,14 +635,13 @@ class SkinCode extends defaultStyle {
headTypeColor: '#FF0' // 头码车 headTypeColor: '#FF0' // 头码车
}, },
trainHead: { trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度 trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色 trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 4, // 列车车头三角宽度
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 17, // 列车高度 trainHeight: 17, // 列车高度

View File

@ -716,14 +716,13 @@ class SkinCode extends defaultStyle {
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
}, },
trainHead: { trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: -1, y: -1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 15, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量
trainConntWidth: 0, // 列车竖杠的宽度 trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色 trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色
trainHeadRectHeight: 20, // 列车车头矩形高度 trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常 directionStopType:'special', // special 西安二号线 停车 列车方向图标不消失 normal 正常
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
trainHeadArrowWidth: 16, // 列车车头三角宽度
trainHeadArrowOffsetX: -0.5 // 列车车头三角偏移
}, },
common: { common: {
trainHeight: 20, // 列车高度 trainHeight: 20, // 列车高度

View File

@ -250,4 +250,9 @@ deviceRender[deviceType.Power] = {
_type: deviceType.Power, _type: deviceType.Power,
zlevel: 1 zlevel: 1
}; };
// 站后折返
deviceRender[deviceType.StationTurnBack] = {
_type: deviceType.StationTurnBack,
zlevel: 1
};
export default deviceRender; export default deviceRender;

View File

@ -43,7 +43,8 @@ const deviceType = {
SplitStation:'SplitStation', SplitStation:'SplitStation',
SwitchFault: 'SwitchFault', SwitchFault: 'SwitchFault',
Arrow: 'Arrow', Arrow: 'Arrow',
Power: 'Power' Power: 'Power',
StationTurnBack: 'StationTurnBack'
}; };
export default deviceType; export default deviceType;

View File

@ -110,6 +110,9 @@ class Status {
handleLimitControl(device) { handleLimitControl(device) {
this.statusObj = { }; this.statusObj = { };
} }
handleStationTurnBack(device) {
this.statusObj = { };
}
getStatus() { getStatus() {
return this.statusObj; return this.statusObj;
} }

View File

@ -224,7 +224,16 @@ export default class SaidLamp extends Group {
this.isShowShape = false; this.isShowShape = false;
} }
} }
setControlColor(color) { setControlColor(color, flag) {
this.control && this.control.getControl().stopAnimation(false);
this.control && this.control.setControlColor(color); this.control && this.control.setControlColor(color);
if (flag) {
this.control && this.control.getControl().animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: color })
.when(2000, { fill: this.style.backgroundColor })
.start();
}
} }
} }

View File

@ -12,6 +12,8 @@ import Rect from 'zrender/src/graphic/shape/Rect';
import BoundingRect from 'zrender/src/core/BoundingRect'; import BoundingRect from 'zrender/src/core/BoundingRect';
// import {isShowThePrdType} from '../../utils/handlePath'; // import {isShowThePrdType} from '../../utils/handlePath';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import store from '@/store/index_APP_TARGET';
import Vue from 'vue';
export default class Station extends Group { export default class Station extends Group {
constructor(model, style) { constructor(model, style) {
@ -319,6 +321,15 @@ export default class Station extends Group {
if (!this.isShowShape) return; if (!this.isShowShape) return;
this.recover(); this.recover();
model.controlMode && this['handle' + model.controlMode](); model.controlMode && this['handle' + model.controlMode]();
if (model.tbStrategyId) {
store.state.map.map.tbStrategyList.forEach(item => {
if (item.stationCode == model.code) {
const modelData = Vue.prototype.$jlmap.mapDevice[item.code];
modelData && modelData.instance && modelData.instance.setState(modelData, model.tbStrategyId);
}
});
}
} }
getShapeTipPoint(opts) { getShapeTipPoint(opts) {

View File

@ -0,0 +1,136 @@
import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class StationTurnBack extends Group {
constructor(model, style) {
super();
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.z = 40;
this.model = model;
this.style = style;
// this.isShowShape = true;
this.create();
this.setState(model);
}
create() {
const model = this.model;
const style = this.style;
if (model.show) {
this.control = new Circle({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: model.position.x,
cy: model.position.y,
r: style.StationTurnBack.lamp.radiusR
},
style: {
fill: style.StationTurnBack.lamp.fill
}
});
this.controlRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.position.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2,
width: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding,
height: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding
},
style: {
fill: style.StationTurnBack.rect.fill,
stroke: style.StationTurnBack.rect.stroke,
lineWidth: style.StationTurnBack.rect.lineWidth
}
});
this.text = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance,
fontWeight: style.StationTurnBack.text.fontWeight,
fontSize: style.StationTurnBack.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: '#fff',
textAlign: 'center',
textVerticalAlign: 'bottom'
}
});
this.strategyText = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance,
fontWeight: style.StationTurnBack.text.fontWeight,
fontSize: style.StationTurnBack.text.fontSize,
fontFamily: style.fontFamily,
text: '按计划执行',
textFill: '#fff',
textAlign: 'center',
textVerticalAlign: 'top'
}
});
this.add(this.control);
this.add(this.controlRect);
this.add(this.text);
this.add(this.strategyText);
}
}
recover() {
this.strategyText.hide();
}
handleStatus(name) {
this.strategyText.show();
this.strategyText.attr({
style: {
text: name
}
});
}
// 设置状态
setState(model, tbStrategyId = null) {
// if (!this.isShowShape) return;
this.recover();
if (tbStrategyId) {
model.tbStrategyId = tbStrategyId;
model.optionList.forEach(item => {
if (item.id == tbStrategyId) {
this.handleStatus(item.label);
}
});
}
// console.log(model, '站后折返model')
}
setShowMode() {
}
setShowStation(flag) {
// if (flag) {
// this.eachChild(item => {
// item.show();
// });
// this.isShowShape = true;
// this.setState(this.model);
// } else {
// this.eachChild(item => {
// item.hide();
// });
// this.isShowShape = false;
// }
}
}

View File

@ -349,10 +349,10 @@ export default class Switch extends Group {
setSwitchFault(split) { setSwitchFault(split) {
if (this.model.switchFaultCode && split) { if (this.model.switchFaultCode && split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode); const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor('#F00'); switchFault.instance.setControlColor('#F00', true);
} else if (this.model.switchFaultCode && !split) { } else if (this.model.switchFaultCode && !split) {
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode); const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
switchFault.instance.setControlColor(this.style.backgroundColor); switchFault.instance.setControlColor(this.style.backgroundColor, false);
} }
} }
/** 挤叉*/ /** 挤叉*/

View File

@ -12,16 +12,16 @@ export default class TrainHead extends Group {
create() { create() {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;
const baseMargin = (model.drect === -1 ? 1 : 0); const baseMargin = (model.drect === -1 ? -1 : 0);
if (style.Train.trainHead.trainConntWidth) { if (style.Train.trainHead.trainConntWidth) {
this.line = new Rect({ this.line = new Rect({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
shape: { shape: {
x: model.point.x - baseMargin * (style.Train.trainHead.trainConntWidth * model.scale), x: model.point.x + baseMargin * ((style.Train.trainHead.trainConntWidth + style.Train.trainBody.trainBodyLineWidth) * model.scale),
y: model.point.y, y: model.point.y,
width: style.Train.trainHead.trainConntWidth * model.scale, width: style.Train.trainHead.trainConntWidth * model.scale,
height: model.height || style.Train.trainHead.trainHeadRectHeight * model.scale height: style.Train.trainHead.trainHeadHeight === 'trainBox' ? style.Train.common.trainHeight : model.height
}, },
style: { style: {
lineWidth: 0.1, lineWidth: 0.1,
@ -31,12 +31,12 @@ export default class TrainHead extends Group {
}); });
this.add(this.line); this.add(this.line);
} }
const height = model.height / 2; const height = style.Train.trainHead.trainHeadHeight === 'trainBox' ? style.Train.common.trainHeight / 2 : model.height / 2;
const startX = model.point.x + model.drect * (style.Train.trainHead.trainConntWidth * model.scale); const startX = model.point.x + model.drect * (style.Train.trainHead.trainHeadArrowOffsetX * model.scale);
const points = [ const points = [
[startX + model.drect * 2 * model.scale, (model.point.y + height)], [startX + model.drect * style.Train.trainHead.trainHeadArrowWidth * model.scale, (model.point.y + height)],
[startX + model.drect * -2 * model.scale, (model.point.y + height) + height], [startX, (model.point.y + height) + height],
[startX + model.drect * -2 * model.scale, (model.point.y + height) - height] [startX, (model.point.y + height) - height]
]; ];
this.arrow = new Polygon({ this.arrow = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,

View File

@ -112,4 +112,5 @@ export default class EControl extends Group {
this.text.setStyle('textFill', color); this.text.setStyle('textFill', color);
} }
} }
getControl() { return this.control; }
} }

View File

@ -25,6 +25,7 @@ import SaidLamp from './SaidLamp/index.js';
import SplitStation from './SplitStation/index'; import SplitStation from './SplitStation/index';
import Arrow from './Arrow/index'; import Arrow from './Arrow/index';
import Power from './Power/index'; import Power from './Power/index';
import StationTurnBack from './StationTurnBack/index';
/** 图库*/ /** 图库*/
const mapShape = {}; const mapShape = {};
@ -71,6 +72,7 @@ mapShape[deviceType.SwitchFault] = SaidLamp;
mapShape[deviceType.SplitStation] = SplitStation; mapShape[deviceType.SplitStation] = SplitStation;
mapShape[deviceType.Arrow] = Arrow; mapShape[deviceType.Arrow] = Arrow;
mapShape[deviceType.Power] = Power; mapShape[deviceType.Power] = Power;
mapShape[deviceType.StationTurnBack] = StationTurnBack;
function shapefactory(device, jmap) { function shapefactory(device, jmap) {
const type = device._type; const type = device._type;

View File

@ -1,10 +1,10 @@
<template> <template>
<el-dialog <el-dialog
v-dialogDrag
class="foshan-01__systerm two-confirmation" class="foshan-01__systerm two-confirmation"
title="二次确认" title="二次确认"
:visible.sync="show" :visible.sync="show"
width="360px" width="360px"
v-dialogDrag
:before-close="doClose" :before-close="doClose"
:show-close="false" :show-close="false"
:z-index="2000" :z-index="2000"
@ -32,6 +32,7 @@
<script> <script>
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic'; import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'TwoConfirmation', name: 'TwoConfirmation',
@ -90,11 +91,9 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation operation: OperationEvent.Command.close.confirm.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose(); this.doClose();
@ -104,20 +103,21 @@ export default {
commit() { commit() {
const operate = { const operate = {
send: true, send: true,
type: this.operate.type, operation: this.operation,
val: this.operate.val over: true
}; };
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) { if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation; operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) { } else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation; operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) { } else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation; operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
} else if (this.operation == OperationEvent.StationControl.forcedStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL;
} }
this.doClose(); this.doClose();
this.$store.dispatch('training/next', operate).then(({ valid, response }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }

View File

@ -12,24 +12,31 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row> 集中站 </el-row> <el-row> 集中站 </el-row>
<el-form ref="form" :model="formModel" :rules="rules">
<el-row style="margin-bottom: 20px"> <el-row style="margin-bottom: 20px">
<el-form-item prop="stationCode">
<el-select <el-select
:id="domIdChooseStation" :id="domIdChooseStation"
v-model="stationCode" v-model="formModel.stationCode"
filterable filterable
placeholder="请选择" placeholder="请选择"
style="width: 100%;" style="width: 100%;"
@change="handleChooseChangeStation" @change="handleChooseChangeStation"
> >
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item.code" /> <el-option v-for="item in centralizedStationList" :key="item.code" :label="item.name" :value="item.code" />
</el-select> </el-select>
</el-form-item>
</el-row> </el-row>
<el-radio-group :id="domIdChooseControl" v-model="stationType"> <el-form-item prop="stationType">
<el-radio-group :id="domIdChooseControl" v-model="formModel.stationType">
<el-row v-for="item in Object.keys(controlProps)" :key="item" style="padding-bottom: 10px"> <el-row v-for="item in Object.keys(controlProps)" :key="item" style="padding-bottom: 10px">
<el-radio :label="item" @change="handleChooseChangeControl"> <el-radio :label="item" :disabled="!controlModeList.includes(item)" @change="handleChooseChangeControl">
{{ controlProps[item] }}</el-radio> {{ controlProps[item] }}</el-radio>
</el-row> </el-row>
</el-radio-group> </el-radio-group>
</el-form-item>
</el-form>
<el-row type="flex" justify="center" class="button-group"> <el-row type="flex" justify="center" class="button-group">
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button> <el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
<el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出 <el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出
@ -41,7 +48,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/ConstDic';
import TwoConfirmation from './childDialog/twoConfirmation'; import TwoConfirmation from './childDialog/twoConfirmation';
export default { export default {
@ -50,18 +57,39 @@ export default {
TwoConfirmation TwoConfirmation
}, },
data() { data() {
var validatePass = (rule, value, callback) => {
const centralizedStation = this.$store.getters['map/getDeviceByCode'](value);
if (this.controlModeList.includes(centralizedStation.controlMode)) {
callback(new Error(`该集中站已经是${this.controlProps[centralizedStation.controlMode]}模式`));
} else {
callback();
}
};
return { return {
operate: null, operate: null,
dialogShow: false, dialogShow: false,
disabledClose: false, disabledClose: false,
disabledCommit: false, disabledCommit: false,
stationType: '01', controlModeList: [],
formModel: {
stationCode: '', stationCode: '',
stationType: ''
},
controlProps: { controlProps: {
'03': '紧急站控', 'Emergency': '紧急站控',
'02': '站控', 'Local': '站控',
'01': '遥控' 'Center': '遥控'
} },
rules: {
stationCode: [
{ required: true, message: '请选择集中站', trigger: 'change' },
{ validator: validatePass, trigger: 'change' }
],
stationType: [
{required: true, message: '请选择控制模式', trigger: 'change'}
]
},
centralizedStationList: []
}; };
}, },
computed: { computed: {
@ -83,30 +111,53 @@ export default {
}, },
domIdCommit() { domIdCommit() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.stationType == '01') { if (this.formModel.stationType === 'Center') {
return OperationEvent.StationControl.requestCentralControl.menu.domId; return OperationEvent.StationControl.requestCentralControl.menu.domId;
} else if (this.stationType == '02') { } else if (this.formModel.stationType === 'Local') {
return OperationEvent.StationControl.requestStationControl.menu.domId; return OperationEvent.StationControl.requestStationControl.menu.domId;
} else if (this.stationType == '03') { } else if (this.formModel.stationType === 'Emergency') {
return OperationEvent.StationControl.emergencyStationControl.menu.domId; return OperationEvent.StationControl.emergencyStationControl.menu.domId;
} }
} else {
return '';
} }
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
} }
}, },
watch: {
'$store.state.training.prdType': function (val) {
this.initControlModeList(val);
}
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
initControlModeList(val) {
if (val === '01') {
this.controlModeList = ['Emergency', 'Local'];
} else if (val === '02') {
this.controlModeList = ['Center'];
} else {
this.controlModeList = [];
}
},
doShow(operate) { doShow(operate) {
if (!this.dialogShow) { if (!this.dialogShow) {
this.operate = operate || {}; this.operate = operate || {};
this.operation = operate.operation; this.operation = operate.operation;
} }
this.initControlModeList(this.$store.state.training.prdType);
this.centralizedStationList = [];
this.stationList.forEach(item => {
if (item.centralized) {
this.centralizedStationList.push(item);
}
});
this.dialogShow = true; this.dialogShow = true;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
@ -128,20 +179,21 @@ export default {
}, },
handleChooseChangeStation() { handleChooseChangeStation() {
const operate = { const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.Command.order.choose1.operation, operation: OperationEvent.Command.order.choose1.operation,
val: this.stationCode param: {
stationCodes: [this.formModel.stationCode]
}
}; };
// if (this.stationType == '01') { // if (this.stationType === 'Center') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation // operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation;
// } else if (this.stationType == '02') { // } else if (this.stationType === 'Local') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation // operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation;
// } else if (this.stationType == '03') { // } else if (this.stationType === 'Emergency') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation // operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation;
// } // }
this.$store.dispatch('training/next', 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 });
} }
@ -149,20 +201,9 @@ export default {
}, },
handleChooseChangeControl() { handleChooseChangeControl() {
const operate = { const operate = {
type: MapDeviceType.StationControl.type, operation: OperationEvent.Command.order.choose.operation
operation: OperationEvent.Command.order.choose.operation,
val: this.stationCode
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (this.stationType == '01') {
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation
// } else if (this.stationType == '02') {
// operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation
// } else if (this.stationType == '03') {
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose.operation
// }
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -170,30 +211,33 @@ export default {
}, },
// //
handleCommit() { handleCommit() {
if (this.stationType == '01') { this.$refs.form.validate((valid) => {
if (valid) {
if (this.formModel.stationType === 'Center') {
// //
this.conterCommit(); this.conterCommit();
} else if (this.stationType == '02') { } else if (this.formModel.stationType === 'Local') {
// //
this.requestCommit(); this.requestCommit();
} else if (this.stationType == '03') { } else if (this.formModel.stationType === 'Emergency') {
// //
this.emergencyCommit(); this.emergencyCommit();
} }
}
});
}, },
// //
conterCommit() { conterCommit() {
const operate = { const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation, operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由站控转为中控:'], messages: ['确认将如下操作区域的控制模式由站控转为中控:']
val: `${this.stationCode}::`
}; };
this.$store.dispatch('training/next', 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 });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);
this.doClose();
} else { } else {
this.disabledSure = false; this.disabledSure = false;
} }
@ -202,16 +246,15 @@ export default {
// //
requestCommit() { requestCommit() {
const operate = { const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.requestStationControl.menu.operation, operation: OperationEvent.StationControl.requestStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'], messages: ['确认将如下操作区域的控制模式由中控转为站控:']
val: `${this.stationCode}::`
}; };
this.$store.dispatch('training/next', 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 });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);
this.doClose();
} else { } else {
this.disabledSure = false; this.disabledSure = false;
} }
@ -220,16 +263,15 @@ export default {
// //
emergencyCommit() { emergencyCommit() {
const operate = { const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
messages: ['确认将如下操作区域的控制模式由中控转为站控:'], messages: ['确认将如下操作区域的控制模式由中控转为站控:']
val: `${this.stationCode}::`
}; };
this.$store.dispatch('training/next', 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 });
this.$refs.twoConfirmation.doShow(operate); this.$refs.twoConfirmation.doShow(operate);
this.doClose();
} else { } else {
this.disabledSure = false; this.disabledSure = false;
} }

View File

@ -125,19 +125,19 @@ export default {
}, },
watch: { watch: {
'$store.state.socket.msgHead': function (elem) { '$store.state.socket.msgHead': function (elem) {
if (elem && elem.hasOwnProperty('success')) { // if (elem && elem.hasOwnProperty('success')) {
if (elem.success) { // if (elem.success) {
const operate = this.$store.state.training.operate; // const operate = this.$store.state.training.operate;
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode); // const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode); // const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
const newOperate = { // const newOperate = {
type: operate.type, // type: operate.type,
name: station.name // name: station.name
}; // };
//
this.doShow(newOperate); // this.doShow(newOperate);
} // }
} // }
} }
}, },
mounted() { mounted() {

View File

@ -2,7 +2,7 @@
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
class="foshan-01__systerm passive-control" class="foshan-01__systerm passive-control"
title="控制模式请求" :title="$t('menu.passiveDialog.controlModeRequest')"
:visible.sync="show" :visible.sync="show"
width="700px" width="700px"
:before-close="doClose" :before-close="doClose"
@ -11,7 +11,7 @@
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span> <span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="tableData"
@ -23,35 +23,35 @@
size="mini" size="mini"
highlight-current-row highlight-current-row
> >
<el-table-column prop="operate" label="操作区域"> <el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="control" label="当前控制模式" width="120"> <el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="target" label="请求控制模式" width="120"> <el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="agree" label="是否同意" width="140"> <el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" /> <el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<span class="control-label">距离对话还有{{ count }}请应答</span> <span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
<el-row class="button-group"> <el-row class="button-group">
<el-col :span="10" :offset="3"> <el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意 <el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="6" :offset="4"> <el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button> <el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
@ -59,8 +59,10 @@
</template> </template>
<script> <script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
export default { export default {
name: 'RequestControl', name: 'RequestControl',
@ -72,26 +74,28 @@ export default {
dialogShow: false, dialogShow: false,
disabledAgree: false, disabledAgree: false,
disabledRefuse: false, disabledRefuse: false,
requestInfo: '调度员1工作站', requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
controlProps: { controlProps: {
'01': '中控', 'Center': this.$t('menu.passiveDialog.inTheControl'),
'02': '站控' 'Local': this.$t('menu.passiveDialog.stationControl')
}, },
selection: [], selection: [],
tableData: [], tableData: [],
timer: null, timer: null,
timeout: 61, timeout: 55,
count: 0 count: 0,
sourceMemberId: ''
}; };
}, },
computed: { computed: {
targetStatus() { targetStatus() {
if (this.$store.state.training.prdType == '01') { if (this.$store.state.training.prdType == '01') {
return '01'; return 'Center';
} }
if (this.$store.state.training.prdType == '02') { if (this.$store.state.training.prdType == '02') {
return '02'; return 'Local';
} }
return '';
}, },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -114,9 +118,10 @@ export default {
deep: true deep: true
}, },
'$store.state.socket.msgHead': function (elem) { '$store.state.socket.msgHead': function (elem) {
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) { if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
if (elem.stationControlCode) { if (elem.params.stationCodes && elem.params.stationCodes.length) {
this.doShow(elem); this.doShow(elem);
this.sourceMemberId = elem.sourceMemberId;
} }
} }
} }
@ -160,9 +165,9 @@ export default {
this.disabledAgree = this.selection.length <= 0; this.disabledAgree = this.selection.length <= 0;
} }
}, },
updateTableData(code) { updateTableData(codes) {
this.tableData = []; this.tableData = [];
(codes || []).forEach(code=> {
const model = { const model = {
code: code, code: code,
operate: '', operate: '',
@ -174,29 +179,29 @@ export default {
const device = this.$store.getters['map/getDeviceByCode'](code); const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) { if (device) {
const control = (device || {}).state; const control = (device || {}).controlMode;
if (control) { if (control) {
model.control = { status: control.status, name: this.controlProps[control.status] }; model.control = { status: control, name: this.controlProps[control] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] }; model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
} }
model.operate = device.name || '';
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (station) {
model.operate = station.name || '';
} }
}
this.tableData.push(model); this.tableData.push(model);
});
}, },
doShow(msgHead) { doShow(msgHead) {
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
}
});
this.dialogShow = true; this.dialogShow = true;
this.disabledAgree = true; this.disabledAgree = true;
this.createTimer(); this.createTimer();
this.updateTableData(msgHead.stationControlCode); this.updateTableData(msgHead.params.stationCodes);
const operate = { const operate = {
start: true, start: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.menu.operation operation: OperationEvent.StationControl.controlResponse.menu.operation
}; };
@ -213,29 +218,19 @@ export default {
if (this.dialogShow) { if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue'); this.$store.dispatch('socket/shiftMsgQueue');
} }
this.count = 0; this.count = 0;
this.dialogShow = false; this.dialogShow = false;
this.clearTimer(); this.clearTimer();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow(); this.$refs.multipleTable.setCurrentRow();
}, },
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) { handleChooseChange(selection) {
this.selection = selection; this.selection = selection;
if (selection && selection.length) { if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
const operate = { const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation, operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::') val: codeList.join('::')
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -244,48 +239,67 @@ export default {
} }
}); });
} else if (!selection) { } else if (!selection) {
this.$messageBox('请选择一条数据'); this.$messageBox(this.$t('menu.passiveDialog.selectData'));
} }
}, },
agree() { agree() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = { const operate = {
send: true, start: true,
over: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.agree.operation, operation: OperationEvent.StationControl.controlResponse.agree.operation,
val: this.selection[0].code, send: true,
prdType: this.$store.state.training.prdType cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: true
}
}; };
this.clearTimer(); this.clearTimer();
this.disabledAgree = true; this.disabledAgree = true;
this.$store.dispatch('training/next', 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 });
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow();
}); });
}, },
refuse() { refuse() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = { const operate = {
send: true, start: true,
over: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.refuse.operation, operation: OperationEvent.StationControl.controlResponse.refuse.operation,
val: this.tableData[0].code, send: true,
prdType: this.$store.state.training.prdType cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: false
}
}; };
this.clearTimer(); this.clearTimer();
this.disabledAgree = true; this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow();
}); });
} }
} }

View File

@ -101,8 +101,8 @@ export default {
signalParamList: [ signalParamList: [
{ name: '追踪单开', cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, operate: OperationEvent.Signal.setAutoInterlock.menu, show: false }, { name: '追踪单开', cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, operate: OperationEvent.Signal.setAutoInterlock.menu, show: false },
{ name: '追踪单关', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, operate: OperationEvent.Signal.cancelAutoInterlock.menu, show: false }, { name: '追踪单关', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, operate: OperationEvent.Signal.cancelAutoInterlock.menu, show: false },
{ name: '自排开', cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, operate: OperationEvent.Signal.atsAutoControl.menu, show: false }, { name: '自排开', cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, operate: OperationEvent.Signal.atsAutoControl.menu, show: false },
{ name: '自排关', cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, operate: OperationEvent.Signal.humanControl.menu, show: false }, { name: '自排关', cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, operate: OperationEvent.Signal.humanControl.menu, show: false },
{ name: '重复开放', cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, operate: OperationEvent.Signal.reopenSignal.menu, show: false }, { name: '重复开放', cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, operate: OperationEvent.Signal.reopenSignal.menu, show: false },
{ name: '封锁信号', cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, operate: OperationEvent.Signal.lock.menu, show: false }, { name: '封锁信号', cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, operate: OperationEvent.Signal.lock.menu, show: false },
{ name: '解封信号', cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, operate: OperationEvent.Signal.unlock.menu, show: false }, { name: '解封信号', cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, operate: OperationEvent.Signal.unlock.menu, show: false },
@ -125,7 +125,8 @@ export default {
], ],
stationParamList: [ stationParamList: [
{ name: '关站信号', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false } // { name: '关站信号', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false } //
] ],
ciStationParamList: []
}; };
}, },
computed: { computed: {

View File

@ -566,13 +566,13 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Signal_Open_Auto_Setting', operateType: 'Signal_Open_Auto_Setting',
skinCode: '07', skinCode: '07',
trainingName: '自排开({5})', trainingName: '自排开({5})',
trainingRemark: '自排开', trainingRemark: '自排开',
trainingType: 'Signal', trainingType: 'Signal',
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该信号机' }, { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该信号机' },
{ deviceType: '04', orderNum: 2, operateCode: '315', tip: '鼠标左键点击【自排开】按钮' }, { deviceType: '04', orderNum: 2, operateCode: '315', tip: '鼠标左键点击【自排开】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' } { deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' }
] ]
}, },

View File

@ -55,6 +55,7 @@ export default {
doShow(messages) { doShow(messages) {
this.dialogShow = true; this.dialogShow = true;
this.messages = [this.$t('tip.commandFailed')]; this.messages = [this.$t('tip.commandFailed')];
console.log(this.messages);
if (messages && messages != 'null') { if (messages && messages != 'null') {
this.messages.push(messages); this.messages.push(messages);
} }

View File

@ -61,13 +61,12 @@
<el-button :id="domIdCancel" @click="cancel">取消</el-button> <el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl" /> <!-- <confirm-control ref="confirmControl" /> -->
<notice-info ref="noticeInfo" /> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -76,7 +75,6 @@ import { mapGetters } from 'vuex';
export default { export default {
name: 'StandBackStrategy', name: 'StandBackStrategy',
components: { components: {
ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
@ -141,7 +139,23 @@ export default {
const station = this.stationList.find(n => n.code == selected.stationCode); const station = this.stationList.find(n => n.code == selected.stationCode);
this.tempData.push({ name: station.name, station: selected.name, strategy: selected.reentryStrategy || '04' }); this.tempData.push({ name: station.name, station: selected.name, strategy: selected.reentryStrategy || '04' });
}, },
strategySelectChange(strategy) {
const operate = {
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
val: `${strategy}`
};
this.strategy = strategy;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) { if (!this.dialogShow) {
this.standStatus = ''; this.standStatus = '';
this.stationName = ''; this.stationName = '';
@ -160,6 +174,18 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
clickEvent(row, column, event) {
const operate = {
operation: OperationEvent.StationStand.setBackStrategy.choose.operation
};
this.strategyId = row.id;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkTableDataSelction(data) { checkTableDataSelction(data) {
const selection = []; const selection = [];
if (data && data.length > 0) { if (data && data.length > 0) {
@ -175,21 +201,6 @@ export default {
this.selection = selection; this.selection = selection;
} }
}, },
strategySelectChange(strategy) {
const operate = {
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
val: `${strategy}`
};
this.strategy = strategy;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
@ -197,6 +208,7 @@ export default {
}, },
commit() { commit() {
if (this.isConfirm) { if (this.isConfirm) {
this.loading = true;
const operate = { const operate = {
over: true, over: true,
operation: OperationEvent.StationStand.setBackStrategy.menu.operation, operation: OperationEvent.StationStand.setBackStrategy.menu.operation,

View File

@ -0,0 +1,179 @@
<template>
<el-dialog
v-dialogDrag
class="xian-01__systerm stand-run-level"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="font-size: 16px; margin-bottom: 5px;">变通节点</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationName" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">当前变通策略</div>
<div style="margin-bottom: 5px;">
<el-input v-model="stationStrategy" size="mini" disabled />
</div>
<div style="font-size: 16px; margin-bottom: 5px;">变通策略选项</div>
<el-table
ref="table"
:data="strategyList"
border
:cell-style="tableStyle"
style="width: 100%; margin-top:10px"
size="mini"
height="180"
highlight-current-row
:show-header="false"
@row-click="clickEvent"
>
<el-table-column :id="domIdChoose" prop="label" style="margin-left:30px" />
</el-table>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'StandBackStrategy',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
strategyList: [],
stationName: '',
stationStrategy: '',
selection: [],
isConfirm: false,
strategyId: '',
tableStyle: {
'border-bottom': 'none'
}
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Station.setBackStrategy.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Station.setBackStrategy.choose.domId : '';
},
title() {
return '策略选择';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
const name = selected.optionList.find(ele => ele.id == selected.tbStrategyId).label;
this.stationName = selected.name || '';
this.stationStrategy = selected.tbStrategyId ? name : '无策略折返'; //
this.strategyList = selected.optionList; //
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
clickEvent(row, column, event) {
const operate = {
operation: OperationEvent.Station.setBackStrategy.choose.operation
};
this.strategyId = row.id;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.selection = selection;
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.isConfirm) {
this.loading = true;
commitOperate(menuOperate.StationControl.setBackStrategy, {id: this.strategyId}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
this.doClose();
}
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -9,6 +9,7 @@
<menu-section ref="menuSection" :selected="selected" /> <menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" />
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" /> <passive-contorl ref="passiveControl" />
<passive-Timeout ref="passiveTimeout" /> <passive-Timeout ref="passiveTimeout" />
@ -26,6 +27,7 @@ import MenuSection from './menuSection';
import MenuTrain from './menuTrain'; import MenuTrain from './menuTrain';
import MenuStation from './menuStation'; import MenuStation from './menuStation';
import MenuBar from './menuBar'; import MenuBar from './menuBar';
import MenuStationTurnBack from './menuStationTurnBack';
import PassiveAlarm from './passiveDialog/alarm'; import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control'; import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout'; import PassiveTimeout from './passiveDialog/timeout';
@ -42,6 +44,7 @@ export default {
MenuStation, MenuStation,
MenuTrain, MenuTrain,
PassiveAlarm, PassiveAlarm,
MenuStationTurnBack,
PassiveContorl, PassiveContorl,
PassiveTimeout PassiveTimeout
}, },

View File

@ -0,0 +1,112 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<station-back-strategy ref="stationBackStrategy" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import StationBackStrategy from './dialog/stationBackStrategy';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from './utils/menuOperate';
export default {
name: 'MenuStationTurnBack',
components: {
PopMenu,
StationBackStrategy
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
}
],
Center: [
{
label: '设置折返策略',
handler: this.setBackStrategy,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
}
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationTurnBack) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.menu) {
this.setBackStrategy();
}
// if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
// this.$refs.popMenu.resetShowPosition(point);
// }
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setBackStrategy() {
commitOperate(menuOperate.StationControl.setBackStrategy, {stationCode: this.selected.stationCode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.stationBackStrategy.doShow(operate, this.selected);
}
});
}
}
};
</script>

View File

@ -256,6 +256,7 @@ export const menuOperate = {
operation: OperationEvent.StationStand.detail.menu.operation operation: OperationEvent.StationStand.detail.menu.operation
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS // cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
} }
//
}, },
StationControl:{ StationControl:{
requestCentralControl:{ requestCentralControl:{
@ -272,7 +273,12 @@ export const menuOperate = {
// 紧急站控 // 紧急站控
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
} },
setBackStrategy:{
// 设置折返策略
operation: OperationEvent.Station.setBackStrategy.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
},
}, },
TrainWindow: { TrainWindow: {
editTrainId: { editTrainId: {

View File

@ -144,6 +144,10 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.splitStationList || [], elem => { zrUtil.each(data.splitStationList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.SplitStation, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.SplitStation, elem, propConvert, showConfig);
}, this); }, this);
zrUtil.each(data.tbStrategyList || [], elem => { // 站后折返按钮
mapDevice[elem.code] = createDevice(deviceType.StationTurnBack, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.arrowList || [], elem => { zrUtil.each(data.arrowList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig);
}, this); }, this);
@ -330,6 +334,7 @@ export function updateMapData(state, model) {
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break; case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break; case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
case deviceType.Power: updateForList(model, state, 'powerLineList'); break; case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
case deviceType.StationTurnBack : updateForList(model, state, 'tbStrategyList'); break;
} }
} }
} }

View File

@ -139,6 +139,7 @@ const JsxtExamResult = () => import('@/views/jsxt/competition/result');
const JsxtApply = () => import('@/views/jsxt/apply/index'); const JsxtApply = () => import('@/views/jsxt/apply/index');
// const theoryManage = () => import('@/views/jsxt/competition/theory/index'); // const theoryManage = () => import('@/views/jsxt/competition/theory/index');
const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeList = () => import('@/views/jsxt/refereeList/index');
const RefereeDisplay = () => import('@/views/jsxt/refereeList/display');
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -304,6 +305,11 @@ export const publicAsyncRoute = [
component: JointTraining, component: JointTraining,
hidden: true hidden: true
}, },
{
path: '/refereeJsxtDisplay',
component: RefereeDisplay,
hidden: true
},
{ {
path: '/jointTrainingNew', path: '/jointTrainingNew',
component: JointTrainingNew, component: JointTrainingNew,

View File

@ -90,11 +90,13 @@ export default {
roleTypeNew:[ roleTypeNew:[
{label: '管理员', value: 'ADMIN', enLabel: 'Admin '}, {label: '管理员', value: 'ADMIN', enLabel: 'Admin '},
{label: '教员', value: 'Instructor', enLabel: 'Instructor '}, {label: '教员', value: 'Instructor', enLabel: 'Instructor '},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
{label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '}, {label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '},
{label: '观众', value: 'AUDIENCE', enLabel: 'Audience '}, {label: '观众', value: 'AUDIENCE', enLabel: 'Audience '},
{label: '司机', value: 'DRIVER', enLabel: 'Driver '}, {label: '司机', value: 'DRIVER', enLabel: 'Driver '},
{label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '} {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '},
{label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '},
{label: '工电调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '}
], ],
SimulationType: [ SimulationType: [
{ label: '实训', value: 'Training'}, { label: '实训', value: 'Training'},

View File

@ -107,6 +107,7 @@ export const DeviceMenu = {
AutoTurnBack: '11', AutoTurnBack: '11',
AxleReset: '12', AxleReset: '12',
Enabled: '13', Enabled: '13',
StationTurnBack: '14',
Map: '100', Map: '100',
PrdCategory: '101', PrdCategory: '101',

View File

@ -204,7 +204,9 @@ export default {
/** 上电解锁 */ /** 上电解锁 */
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: '执行关键操作测试'},
// 设置折返策略
CMD_STATION_SET_TURN_BACK_STRATEGY: {value: 'Station_Set_Turn_Back_Strategy', label: '设置折返策略'}
}, },
// 列车 // 列车

View File

@ -1711,8 +1711,23 @@ export const OperationEvent = {
operation: '609', operation: '609',
domId: '_Tips-Station-GuideLock-Button{TOP}' domId: '_Tips-Station-GuideLock-Button{TOP}'
} }
},
// 设置折返策略
setBackStrategy: {
menu: {
operation: '610',
domId: '_Tips-Station-SetBackStrategy-Menu'
},
choose: {
operation: '6101',
domId: '_Tips-Station-setBackStrategy-Choose'
},
confirm: {
operation: '6102',
domId: '_Tips-Station-setBackStrategy-confirm'
} }
}, },
},
// 列车 // 列车
Train: { Train: {

View File

@ -364,6 +364,13 @@ const map = {
return []; return [];
} }
}, },
tbStrategyList: (state) => {
if (state.map) {
return state.map.tbStrategyList || [];
} else {
return [];
}
},
axleCounterResetButtonList: (state) => { axleCounterResetButtonList: (state) => {
if (state.map) { if (state.map) {
return state.map.axleCounterResetButtonList || []; return state.map.axleCounterResetButtonList || [];

View File

@ -38,8 +38,8 @@ function handle(state, data) {
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息 case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
state.quitCoversition = msg; state.quitCoversition = msg;
break; break;
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息 case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息 state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
break; break;
case 'Simulation_Over': // 用户退出仿真推送消息 case 'Simulation_Over': // 用户退出仿真推送消息
state.simulationOver++; // 用户退出仿真推送消息 state.simulationOver++; // 用户退出仿真推送消息
@ -212,7 +212,7 @@ const socket = {
simulationRoleList:[], // 设置仿真的聊天角色信息 simulationRoleList:[], // 设置仿真的聊天角色信息
simulationScriptTip:{}, // 剧本推送提示信息 simulationScriptTip:{}, // 剧本推送提示信息
scriptFinish:0, // 剧本执行完成提示信息 scriptFinish:0, // 剧本执行完成提示信息
competitionStart:0, // 竞赛裁判系统裁判开始考试推送消息 playBackFinish:0, // 竞赛裁判系统裁判回放结束推送
jointRoomPrepare: false, // 演练房间准备状态 jointRoomPrepare: false, // 演练房间准备状态
equipmentStatus: [], // 仿真-设备状态消息 equipmentStatus: [], // 仿真-设备状态消息
trainStationList: [], // 仿真-列车实际到发车站消息 trainStationList: [], // 仿真-列车实际到发车站消息

View File

@ -1,6 +1,6 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map'; import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
import { getNewMapDataByGroup } from '@/api/simulation'; import { getNewMapDataByGroup, getNewMapDataByMapId } from '@/api/simulation';
// 获取地图版本数据和store里面的map版本做比较如果不同 // 获取地图版本数据和store里面的map版本做比较如果不同
// 获取发布的地图数据 // 获取发布的地图数据
@ -35,9 +35,28 @@ export function loadMapDataById(mapId) {
}); });
}); });
} }
export function loadNewMapDataByMapId(mapId) {
return new Promise((resolve, reject) => {
getNewMapDataByMapId(mapId).then(resp => {
covertData(resp, resolve);
}).catch(error => {
reject(error);
});
});
}
export function loadNewMapDataByGroup(group) { export function loadNewMapDataByGroup(group) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getNewMapDataByGroup(group).then(resp => { getNewMapDataByGroup(group).then(resp => {
covertData(resp, resolve);
}).catch(error => {
reject(error);
});
});
}
export function covertData(resp, resolve) {
resp.data.graphDataNew && resp.data.graphDataNew.trainList && resp.data.graphDataNew.trainList.forEach(item => { resp.data.graphDataNew && resp.data.graphDataNew.trainList && resp.data.graphDataNew.trainList.forEach(item => {
item.code = item.groupNumber; item.code = item.groupNumber;
}); });
@ -58,8 +77,5 @@ export function loadNewMapDataByGroup(group) {
const mapConfig = resp.data.configVO; const mapConfig = resp.data.configVO;
store.dispatch('map/setMapConfig', mapConfig); store.dispatch('map/setMapConfig', mapConfig);
store.dispatch('map/setMapVersion', resp.data.version); store.dispatch('map/setMapVersion', resp.data.version);
}).catch(error => {
reject(error);
});
});
} }

View File

@ -145,6 +145,24 @@ export default {
mode: 'bas', mode: 'bas',
id: '25', id: '25',
type: 'interface' type: 'interface'
},
{
name: '电扶梯',
mode: 'bas',
id: '26',
type: 'interface'
},
{
name: '机电排水',
mode: 'bas',
id: '27',
type: 'interface'
},
{
name: '隧道通风',
mode: 'bas',
id: '28',
type: 'interface'
} }
] ]
}, },

View File

@ -0,0 +1,133 @@
<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="fill">
<el-color-picker v-model="form.fill" />
</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: 40,
fill: '#fff',
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 === 'Draught' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.fill = model.fill;
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: 'Draught',
code: this.isUpdate ? this.form.code : getUID('Draught', this.iscs.draughtList || []),
width: this.form.width,
fill: this.form.fill
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 40,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Draught',
code: this.form.code,
width: this.form.width,
fill: '#fff'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -0,0 +1,132 @@
<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 === 'Electrically' ) {
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: 'Electrically',
code: this.isUpdate ? this.form.code : getUID('Electrically', this.iscs.electricallyList || []),
width: this.form.width,
rotate: this.form.rotate
};
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: 'Electrically',
code: this.form.code,
width: this.form.width
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -0,0 +1,132 @@
<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 === 'Elevator' ) {
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: 'Elevator',
code: this.isUpdate ? this.form.code : getUID('Elevator', this.iscs.elevatorList || []),
width: this.form.width,
rotate: this.form.rotate
};
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: 'Elevator',
code: this.form.code,
width: this.form.width
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -123,6 +123,14 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="电动阀" name="Electrically">
<electrically
ref="electrically"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="水池" name="Cistern"> <el-tab-pane label="水池" name="Cistern">
<cistern <cistern
ref="cistern" ref="cistern"
@ -131,6 +139,46 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="楼梯" name="Escalator">
<escalator
ref="escalator"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="扶梯" name="Stairs">
<stairs
ref="stairs"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="电梯" name="Elevator">
<elevator
ref="elevator"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="风机" name="Draught">
<draught
ref="draught"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="闸机" name="FasBrakeMachine">
<fas-brake-machine
ref="fasBrakeMachine"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup"> <el-tab-pane label="照明组" name="LightingGroup">
<lighting-group <lighting-group
ref="lightingGroup" ref="lightingGroup"
@ -139,6 +187,14 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </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="IscsButton"> <el-tab-pane label="按钮" name="IscsButton">
<iscs-button <iscs-button
ref="iscsButton" ref="iscsButton"
@ -198,6 +254,13 @@ import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric'; import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve'; import ElectricButterflyValve from './electricButterflyValve';
import Cistern from './cistern'; import Cistern from './cistern';
import Electrically from './electrically';
import Escalator from '../iscsOperate/escalator'; //
import FasBrakeMachine from '../iscsOperate/brakeMachine'; //
import StateTable from '../iscsCommonElem/stateTable';
import Stairs from './stairs';
import Elevator from './elevator';
import Draught from './draught';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',
@ -221,7 +284,14 @@ export default {
LightingGroup, LightingGroup,
BalancedElectric, BalancedElectric,
ElectricButterflyValve, ElectricButterflyValve,
Cistern Cistern,
Escalator,
Electrically,
FasBrakeMachine,
StateTable,
Stairs,
Elevator,
Draught
}, },
mixins: [ mixins: [
], ],

View File

@ -0,0 +1,132 @@
<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 === 'Stairs' ) {
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: 'Stairs',
code: this.isUpdate ? this.form.code : getUID('Stairs', this.iscs.stairsList || []),
width: this.form.width,
rotate: this.form.rotate
};
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: 'Stairs',
code: this.form.code,
width: this.form.width
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -97,7 +97,7 @@ 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';
import StateTable from '../iscsOperate/stateTable'; import StateTable from '../iscsCommonElem/stateTable';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',
components: { components: {

View File

@ -56,7 +56,7 @@
<el-table-column :key="i" :label="'列'+(i + 1)" :prop="'column'+ (i + 1)"> <el-table-column :key="i" :label="'列'+(i + 1)" :prop="'column'+ (i + 1)">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="i === 0" v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small" /> <el-input v-if="i === 0" v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small" />
<el-select v-else v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small"> <el-select v-else v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" filterable size="small">
<el-option <el-option
v-for="it in stateList" v-for="it in stateList"
:key="it.value" :key="it.value"
@ -131,7 +131,17 @@ export default {
{label: '解码器状态', value: 'decoderState'}, {label: '解码器状态', value: 'decoderState'},
{label: '四路解码器状态', value: 'quadDecoderState'}, {label: '四路解码器状态', value: 'quadDecoderState'},
{label: '四路解码器模式状态', value: 'quadDecoderModeState'}, {label: '四路解码器模式状态', value: 'quadDecoderModeState'},
{label: '控制键盘状态', value: 'controlKeyboardState'} {label: '控制键盘状态', value: 'controlKeyboardState'},
{label: '进线电源', value: 'coilInPower'},
{label: '旁路开关状态', value: 'bypassSwitchStatus'},
{label: '电源欠压报警', value: 'powerUnderVoltageAlarm'},
{label: '风扇运行状态', value: 'fanRunningState'},
{label: '总报警信号', value: 'generalAlarmSignal'},
{label: '电池容量', value: 'batteryCapacity'},
{label: '充电时间', value: 'chargingTime'},
{label: '放电时间', value: 'dischargeTime'},
{label: '交流输出电压', value: 'acOutputVoltage'},
{label: '直流电压信号', value: 'dcVoltageSignal'}
], ],
rules: { rules: {
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }], width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],

View File

@ -142,7 +142,7 @@ 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 IscsButton from '../iscsCommonElem/button'; import IscsButton from '../iscsCommonElem/button';
import StateTable from './stateTable'; import StateTable from '../iscsCommonElem/stateTable';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',

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('26');
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.title-name{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
}
</style>

View File

@ -18,6 +18,18 @@ export default {
mes: '1111' mes: '1111'
}; };
}, },
watch: {
'$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected;
if (device && device._type === 'IscsButton' && device.function === 'GoEPS') {
this.width = 1520;
this.$refs.iscsPlate.show('25');
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
this.width = 1220;
this.$refs.iscsPlate.show('24');
}
}
},
mounted() { mounted() {
this.$refs.iscsPlate.show('24'); this.$refs.iscsPlate.show('24');
}, },

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('27');
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.title-name{
width: 100%;
text-align: center;
font-size: 26px;
margin-top: 30px;
color: #56E5DE;
}
</style>

View File

@ -74,6 +74,9 @@ export default {
'$store.state.config.canvasSizeCount': function (val) { '$store.state.config.canvasSizeCount': function (val) {
this.reSize(); this.reSize();
}, },
widthCanvas() {
this.reSize();
},
'$store.state.socket.equipmentStatus': function (val) { '$store.state.socket.equipmentStatus': function (val) {
if (val.length) { if (val.length) {
this.statusMessage(val); this.statusMessage(val);
@ -95,12 +98,12 @@ export default {
}; };
this.iscsDestroy(); this.iscsDestroy();
this.loading = true; this.loading = true;
const data = parser(iscsData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight}); const data = parser(iscsData[deviceCode], {width: this.widthCanvas, height: this.canvasHeight});
this.$iscs = new Iscs({ this.$iscs = new Iscs({
dom: document.getElementById(this.iscsId), dom: document.getElementById(this.iscsId),
config: { config: {
renderer: 'canvas', renderer: 'canvas',
width: this.canvasWidth, width: this.widthCanvas,
height: this.canvasHeight height: this.canvasHeight
}, },
options: { options: {
@ -150,7 +153,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
// this.width = this.$store.state.config.width; // this.width = this.$store.state.config.width;
// this.height = this.$store.state.config.height; // this.height = this.$store.state.config.height;
// this.$iscs && this.$iscs.resize({ width: this.width, height: this.height }); this.$iscs && this.$iscs.resize({ width: this.widthCanvas, height: this.canvasHeight });
}); });
}, },
iscsDestroy() { iscsDestroy() {

View File

@ -14,8 +14,9 @@
<el-row style="font-size: 14px;color: #6F49FE; height: 30px; line-height: 30px;"> <el-row style="font-size: 14px;color: #6F49FE; height: 30px; line-height: 30px;">
<el-col :span="4"><div>设备名称</div></el-col> <el-col :span="4"><div>设备名称</div></el-col>
<el-col :span="4"><div style="width: 100%; background: #FFF; padding-left: 5px;">{{ modeName }}</div></el-col> <el-col :span="4"><div style="width: 100%; background: #FFF; padding-left: 5px;">{{ modeName }}</div></el-col>
<el-col :span="8"><div style="width: 100%; background: #FFF;">{{ stationName }}</div></el-col> <el-col :span="6"><div style="width: 100%; background: #FFF;">{{ stationName }}</div></el-col>
<el-col :span="8"><div style="width: 100%; background: #FFF;">{{ deviceType }}</div></el-col> <el-col :span="6"><div style="width: 100%; background: #FFF;">{{ deviceType }}</div></el-col>
<el-col :span="4"><div style="width: 100%; background: #FFF;">{{ deviceCode|| '&nbsp;' }}</div></el-col>
</el-row> </el-row>
<el-row v-if="operation==='home'" style="margin-top: 10px;font-size: 14px;color: #6F49FE; height: 30px; line-height: 30px;"> <el-row v-if="operation==='home'" style="margin-top: 10px;font-size: 14px;color: #6F49FE; height: 30px; line-height: 30px;">
<el-col :span="4"><div>状态</div></el-col> <el-col :span="4"><div>状态</div></el-col>
@ -92,11 +93,20 @@ export default {
modeName: '', modeName: '',
status: '', status: '',
operation: 'home', operation: 'home',
deviceCode: '',
deviceMap: { deviceMap: {
ManualAlarmButton:'手动报警按钮', ManualAlarmButton:'手动报警按钮',
SmokeDetector: '消火栓按钮', SmokeDetector: '消火栓按钮',
FireHydranAlarmButton: '点型火灾探测器', FireHydranAlarmButton: '点型火灾探测器',
GasFireControl:'气体灭火控制器' GasFireControl:'气体灭火控制器',
LightingGroup: '照明',
Electrically: '',
VolumeControlDamper: '电动风阀',
SmookExhaustFd: '排烟防火阀',
Ventilator: '普通风机',
AirConditioner: '组合式空调机组',
FireDamper: '防火阀',
SmookProofFd: '防烟防火阀'
}, },
modeMap: { modeMap: {
standFAS: '火灾报警', standFAS: '火灾报警',
@ -142,10 +152,14 @@ export default {
}, },
methods: { methods: {
doShow(device) { doShow(device) {
this.deviceCode = '';
this.deviceType = this.deviceMap[device._type]; this.deviceType = this.deviceMap[device._type];
this.modeName = this.modeMap[this.$route.params.mode]; this.modeName = this.modeMap[this.$route.params.mode];
this.stationName = this.$route.query.stationName; this.stationName = this.$route.query.stationName;
this.dialogShow = true; this.dialogShow = true;
if (device._type === 'LightingGroup') {
this.deviceCode = device.topContext.split(/[(\r\n)\r\n]+/)[0];
}
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;

View File

@ -23,10 +23,15 @@ export default {
const device = this.$store.state.iscs.selected; const device = this.$store.state.iscs.selected;
if (device && device._type === 'IscsButton' && device.function === 'PublicArea') { if (device && device._type === 'IscsButton' && device.function === 'PublicArea') {
this.width = 1520; this.width = 1520;
this.$nextTick(() => {
this.$refs.iscsPlate.show('12'); this.$refs.iscsPlate.show('12');
});
console.log(this.width);
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') { } else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
this.width = 1100; this.width = 1100;
this.$nextTick(() => {
this.$refs.iscsPlate.show('14'); this.$refs.iscsPlate.show('14');
});
} }
} }
}, },

View File

@ -45,6 +45,21 @@ export default {
{graphicEle: 'smokeDetector', deviceType: '点型火灾探测器'}, {graphicEle: 'smokeDetector', deviceType: '点型火灾探测器'},
{graphicEle: 'gasFireControl', deviceType: '气体灭火控制器'} {graphicEle: 'gasFireControl', deviceType: '气体灭火控制器'}
], ],
basData: [
{graphicEle: 'AirConditioner', deviceType: '组合式空调机组、空调器'},
{graphicEle: 'Ventilator', deviceType: '普通风机'},
{graphicEle: '', deviceType: '隧道风机'},
{graphicEle: '', deviceType: '排热风机'},
{graphicEle: 'FireDamper', deviceType: '防火阀'},
{graphicEle: 'SmookExhaustFd', deviceType: '排烟防火阀'},
{graphicEle: 'VolumeControlDamper', deviceType: '电动风阀'},
{graphicEle: 'SmookProofFd', deviceType: '防烟防火阀'},
{graphicEle: '', deviceType: '冷却塔'},
{graphicEle: '', deviceType: '冷水机组'},
{graphicEle: '', deviceType: '电动蝶阀'},
{graphicEle: '', deviceType: '动态平衡电动调节阀'},
{graphicEle: '', deviceType: '冷冻泵、冷却泵'}
],
graphicEleMap: { graphicEleMap: {
manualAlarm: ManualAlarm, manualAlarm: ManualAlarm,
fireHydrant: FireHydrant, fireHydrant: FireHydrant,

View File

@ -1,8 +1,8 @@
<template> <template>
<div style="height: 100%; width: 100%;overflow-y: auto;"> <div style="height: 100%; width: 100%;overflow-y: auto;">
<standFAS v-if="mode == 'standFAS'" /> <standFAS v-if="mode === 'standFAS'" />
<stationHallFAS v-else-if="mode == 'stationHallFAS'" /> <stationHallFAS v-else-if="mode === 'stationHallFAS'" />
<systemFAS v-else-if="mode == 'systemFAS'" /> <systemFAS v-else-if="mode === 'systemFAS'" />
<home-screen v-else-if="mode === 'mainScreenPA'" /> <home-screen v-else-if="mode === 'mainScreenPA'" />
<main-screen v-else-if="mode === 'MainScreen'" /> <main-screen v-else-if="mode === 'MainScreen'" />
<lcd-control v-else-if="mode === 'LCDcontrol'" /> <lcd-control v-else-if="mode === 'LCDcontrol'" />
@ -28,6 +28,8 @@
<small-system v-else-if="mode==='smallSystem'" /> <small-system v-else-if="mode==='smallSystem'" />
<water-system v-else-if="mode==='waterSystem'" /> <water-system v-else-if="mode==='waterSystem'" />
<lighting-system v-else-if="mode === 'lighting'" /> <lighting-system v-else-if="mode === 'lighting'" />
<electric-escalator v-else-if="mode === 'electricEscalator'" />
<water-supply v-else-if="mode === 'waterSupply'" />
<graphic-ele ref="graphicEle" /> <graphic-ele ref="graphicEle" />
<device-control ref="deviceControl" /> <device-control ref="deviceControl" />
</div> </div>
@ -64,6 +66,8 @@ import waterSystem from './bas/waterSystem';
import LightingSystem from './bas/lightingSystem'; import LightingSystem from './bas/lightingSystem';
import GraphicEle from './graphicEle'; import GraphicEle from './graphicEle';
import DeviceControl from './deviceControl'; import DeviceControl from './deviceControl';
import ElectricEscalator from './bas/electricEscalator';
import WaterSupply from './bas/waterSupply';
export default { export default {
components: { components: {
@ -96,12 +100,27 @@ export default {
SmallSystem, SmallSystem,
BigSystem, BigSystem,
waterSystem, waterSystem,
LightingSystem LightingSystem,
ElectricEscalator,
WaterSupply
}, },
data() { data() {
return { return {
mode: 'standFAS', mode: 'standFAS',
deviceList: ['ManualAlarmButton', 'SmokeDetector', 'FireHydranAlarmButton', 'GasFireControl'] deviceList: [
'ManualAlarmButton',
'SmokeDetector',
'FireHydranAlarmButton',
'GasFireControl',
'LightingGroup',
'Electrically',
'VolumeControlDamper',
'SmookExhaustFd',
'Ventilator',
'AirConditioner',
'FireDamper',
'SmookProofFd'
]
}; };
}, },
watch: { watch: {
@ -110,9 +129,10 @@ export default {
}, },
'$store.state.iscs.selectedCount': function() { '$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected; const device = this.$store.state.iscs.selected;
if (device._type === 'IscsButton' && device.function === 'GraphicEle') { console.log(device, '11111111111111');
if (device && device._type === 'IscsButton' && device.function === 'GraphicEle') {
this.$refs.graphicEle.doShow(); this.$refs.graphicEle.doShow();
} else if (this.deviceList.includes(device._type)) { } else if (device && this.deviceList.includes(device._type)) {
this.$refs.deviceControl.doShow(device); this.$refs.deviceControl.doShow(device);
} }
} }

View File

@ -139,6 +139,7 @@ export default {
if (this.selected && this.selected.code) { if (this.selected && this.selected.code) {
switch (hook) { switch (hook) {
case 'Ctrl_C': { case 'Ctrl_C': {
if (this.selected._type != "CheckBox") {
this.copyModel = deepAssign({}, this.selected); this.copyModel = deepAssign({}, this.selected);
this.copyModel.point = { this.copyModel.point = {
x: this.selected.point.x + 10, x: this.selected.point.x + 10,
@ -146,6 +147,9 @@ export default {
}; };
const type1 = this.selected._type.charAt(0).toLowerCase() + this.selected._type.slice(1); // .toLowerCase() 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'] || []); this.copyModel.code = getUID(this.selected._type, this.iscs[type1 + 'List'] || []);
} else {
this.copyModel = {}
}
} break; } break;
case 'Ctrl_V': case 'Ctrl_V':
this.copyModel.code && this.createDataModel(this.copyModel); this.copyModel.code && this.createDataModel(this.copyModel);

View File

@ -58,7 +58,7 @@
<div class="img_box"><img :src="SAFS" alt=""></div> <div class="img_box"><img :src="SAFS" alt=""></div>
<div style="width: 100%;text-align:center;margin-top:120px;"><i class="el-icon-success" style="color: green; font-size: 100px;" /></div> <div style="width: 100%;text-align:center;margin-top:120px;"><i class="el-icon-success" style="color: green; font-size: 100px;" /></div>
<div style="width: 100%;margin-top: 25px;"> <div style="width: 100%;margin-top: 25px;">
<div class="apply_box_title">报名成功!:<br> 您的赛事信息如下: <div class="apply_box_title">报名成功!<br> 您的赛事信息如下:
<br>竞赛名称{{ compition.name }} <br>竞赛名称{{ compition.name }}
<br>竞赛时间{{ compition.startDate }} <br>竞赛时间{{ compition.startDate }}
<br>姓名{{ formModel.name }} <br>姓名{{ formModel.name }}
@ -85,7 +85,7 @@
</div> </div>
</div> </div>
</div> </div>
</template></div></template> </template>
</div> </div>
</template> </template>

View File

@ -4,7 +4,7 @@
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span> <span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div> </div>
<div class="context"> <div class="context">
<div>{{ `得分:${operateScore}` }}</div> <!--<div>{{ `得分:${operateScoreData}` }}</div>-->
<!-- <el-form ref="form" :model="resultModel" size="mini"> <!-- <el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score"> <el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span> <span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
@ -13,14 +13,11 @@
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span> <span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item> </el-form-item>
</el-form> --> </el-form> -->
<!--<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">--> <el-table :data="operateScoreData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
<!--<el-table-column prop="title" label="题目">--> <el-table-column prop="name" label="题目" />
<!--<template slot-scope="scope">--> <el-table-column prop="description" label="描述" />
<!--<div v-html="scope.row.title" />--> <el-table-column prop="totalScore" label="分值" />
<!--</template>--> <el-table-column prop="score" label="得分" />
<!--</el-table-column>>-->
<!--<el-table-column prop="score" label="分值" />-->
<!--<el-table-column prop="goal" label="得分" />-->
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />--> <!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />-->
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />--> <!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">--> <!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">-->
@ -31,7 +28,7 @@
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointScore" label="得分点分值" />--> <!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointScore" label="得分点分值" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointGoal" label="得分点得分" />--> <!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointGoal" label="得分点得分" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />--> <!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
<!--</el-table>--> </el-table>
</div> </div>
<div class="draf_box"> <div class="draf_box">
<el-button type="primary " @click="back">返回首页</el-button> <el-button type="primary " @click="back">返回首页</el-button>
@ -71,7 +68,7 @@ export default {
], ],
loading: true, loading: true,
tableData: [], tableData: [],
operateScore: 0 operateScoreData: []
}; };
}, },
computed: { computed: {
@ -91,7 +88,7 @@ export default {
sums[index] = this.$t('exam.totalScore'); sums[index] = this.$t('exam.totalScore');
return; return;
} }
if (column.property === 'score' || column.property === 'goal' || column.property === 'scoringPointScore' || column.property === 'scoringPointGoal') { if (column.property === 'score' || column.property === 'totalScore') {
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
@ -128,7 +125,7 @@ export default {
} else if (this.$route.query.type == 'operate') { } else if (this.$route.query.type == 'operate') {
this.tableData = []; this.tableData = [];
getPracticalCompetitionResult(this.$route.query.raceId).then(res => { getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
this.operateScore = res.data; this.operateScoreData = res.data;
}); });
// this.operateData.forEach(item => { // this.operateData.forEach(item => {
// if (item.scoringPoints && item.scoringPoints.length) { // if (item.scoringPoints && item.scoringPoints.length) {

View File

@ -115,18 +115,18 @@ export default {
el.answer = this.theoryAnswersMap[el.id]; el.answer = this.theoryAnswersMap[el.id];
return el; return el;
}); });
this.theoryExamTime = resp.data.theoryExamTime * 60;
this.countdownTime = this.computationTime(this.theoryExamTime);
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory'; const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
const startTime = localStore.get(storeKey); const startTime = localStore.get(storeKey);
if (startTime) { if (startTime) {
const dt = new Date().getTime() - startTime; const dt = new Date().getTime() - startTime;
this.theoryExamTime = resp.data.theoryExamTime * 60 - Math.floor(dt / 1000); this.theoryExamTime = resp.data.theoryExamTime * 60 - Math.floor(dt / 1000);
} else { } else {
this.theoryExamTime = resp.data.theoryExamTime * 60;
const storeValue = new Date().getTime(); const storeValue = new Date().getTime();
localStore.set(storeKey, storeValue); localStore.set(storeKey, storeValue);
} }
this.countdownTime = this.computationTime(this.theoryExamTime);
this.countdown = setInterval(() => { this.countdown = setInterval(() => {
if (this.theoryExamTime <= 0) { if (this.theoryExamTime <= 0) {
if (this.countdown) { if (this.countdown) {
@ -184,6 +184,8 @@ export default {
theoryAnswers: theoryAnswers theoryAnswers: theoryAnswers
}; };
postCompetitionTheory(params).then(()=>{ postCompetitionTheory(params).then(()=>{
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
localStore.remove(storeKey);
this.$router.push({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` }); this.$router.push({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
}); });
}, },
@ -203,13 +205,19 @@ export default {
const newTime = time % 3600; const newTime = time % 3600;
let minutes = Math.floor(newTime / 60) + ''; let minutes = Math.floor(newTime / 60) + '';
let seconds = newTime % 60; let seconds = newTime % 60;
if (hours < 10) { if (hours < 0) {
hours = '00';
} else if (hours < 10) {
hours = '0' + hours; hours = '0' + hours;
} }
if (minutes < 10) { if (minutes < 0) {
minutes = '00';
} else if (minutes < 10) {
minutes = '0' + minutes; minutes = '0' + minutes;
} }
if (seconds < 10) { if (seconds < 0) {
seconds = '00';
} else if (seconds < 10) {
seconds = '0' + seconds; seconds = '0' + seconds;
} }
return hours + ':' + minutes + ':' + seconds; return hours + ':' + minutes + ':' + seconds;

View File

@ -0,0 +1,285 @@
<template>
<!-- :style="{width: canvasWidth+'px'}" -->
<div class="main" style="overflow:hidden;width:auto;height:100%;">
<div class="map-view" style="width:auto;overflow:hidden;height:100%;">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" />
<pop-menu ref="popMenu" :menu="menu" />
</div>
<menu-replay ref="menuReplay" />
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import PopMenu from '@/components/PopMenu';
import { loadNewMapDataByMapId } from '@/utils/loaddata';
import { mapGetters } from 'vuex';
import { checkLoginLine } from '@/api/login';
import { EventBus } from '@/scripts/event-bus';
import MenuReplay from './menuReplay';
import { getToken } from '@/utils/auth';
import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
export default {
name:'RefereeDisplay',
components: {
JlmapVisual,
PopMenu,
MenuReplay
},
data() {
return {
checkLine: null,
menu: [],
menuNormal: []
};
},
computed: {
...mapGetters([
'canvasWidth'
]),
mapId() {
return this.$route.query.mapId;
},
...mapGetters('map', [
'stationList'
]),
...mapGetters('training', [
'offsetStationCode'
]),
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) { //
this.subscribe();
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = '';
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
'$store.state.socket.trainStationList': function (val) {
if (val.length) {
this.runFactMessage(val);
}
},
// '$store.state.socket.simulationError': function (val) {
// if (val) {
// this.simulationError(val);
// }
// },
'$store.state.socket.simulationReset': function (val) {
if (val) {
this.simulationReset(val);
}
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
}
},
async mounted() {
window.onbeforeunload = this.clearSubscribe;
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
this.clearSubscribe();
await this.clearAllTimer();
await this.quit();
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
},
methods:{
// 仿退
async back() {
// await this.$refs.menuScript.back();
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
async runFactMessage(list) {
await this.$store.dispatch('runPlan/updateRunPlanData', list);
await this.$store.dispatch('socket/setTrainStationList');
},
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('socket/setSimulationReset');
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');
},
// async simulationError() {
// await this.$store.dispatch('map/clearJlmapTrainView');
// await this.$store.dispatch('map/setTrainWindowShow', false);
// await this.$store.dispatch('socket/setSimulationError');
// await this.$store.dispatch('training/setMapDefaultState');
// this.clearSubscribe();
// this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
// confirmButtonText: this.$t('global.confirm'),
// showCancelButton: false,
// type: 'warning'
// }).then(() => {
// this.$emit('back');
// }).catch(() => {
// });
// },
//
async initLoadData() {
this.$store.dispatch('training/reset');
try {
// await this.loadSimulationInfo();
await this.initLoadRecordData();
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
}
},
onContextmenu(em) {
this.point = {
x: em.clientX,
y: em.clientY
};
if (!em.deviceType) {
var menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearTimeout(this.checkLine);
this.checkLine = null;
}
},
// 仿
async quit() {
await this.$store.dispatch('training/over');
},
// 线
checkLoginLineTimer() {
if (this.checkLine) {
clearTimeout(this.checkLine);
}
this.checkLine = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
},
//
checkMouseStatusTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
}
this.ierval = setInterval(() => {
if (this.mouseNum) {
this.mouseNum = 0;
this.mouseNumTime = 0;
if (this.mapBoxP) {
this.mapBoxP.style.cursor = this.mapBoxP.style.cursor != 'none' ? this.mapBoxP.style.cursor : '';
}
} else {
this.mouseNumTime += 1;
}
if (this.mapBoxP) {
if (this.mouseNumTime >= 12) {
this.mapBoxP.style.cursor = 'none';
}
}
}, 1000);
},
//
async initLoadRecordData() {
this.switchMode('01');
if (parseInt(this.mapId)) {
await this.loadNewMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
},
async loadNewMapDataById(mapId) {
try {
await loadNewMapDataByMapId(mapId);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// 仿
// async loadSimulationInfo() {
// this.dataError = false;
// const resp = await getSimulationInfoNew(this.group);
// if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
// this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
// this.questId = Number(resp.data.questId) || 0;
// this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
// if (resp.data.planRunning) {
// this.planRunning = resp.data.planRunning;
// } else {
// this.$store.dispatch('training/over');
// }
// if (this.isDemon) {
// this.$refs.menuDemon.initPlannedDriving(resp.data.planRunning);
// } else if (this.isScript) {
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
// }
// } else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
// this.dataError = true;
// this.$messageBox(',');
// }
// },
setWindowSize() {
this.$nextTick(() => {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}
}
};
</script>

View File

@ -1,18 +1,23 @@
<template> <template>
<div class="refereeList"> <div class="refereeList">
<div class="raceName">{{ raceName }}竞赛</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-score ref="editScore" /> <edit-score ref="editScore" />
<theory-result ref="theoryResult" />
</div> </div>
</template> </template>
<script> <script>
import { refereeEnterSimulation, loadingPaper, getRaceUserList } from '@/api/competition'; import { refereeEnterSimulation, loadingPaper, getRaceUserList, getRaceById, playBackReady } from '@/api/competition';
import { getPublishMapInfo } from '@/api/jmap/map';
import editScore from './editScore'; import editScore from './editScore';
import TheoryResult from './theoryResult';
export default { export default {
name: 'RefereeList', name: 'RefereeList',
components:{ components:{
editScore editScore,
TheoryResult
}, },
data() { data() {
return { return {
@ -42,15 +47,18 @@ export default {
columns: [ columns: [
{ {
title: '名字', title: '名字',
prop: 'name' prop: 'name',
width:200
}, },
{ {
title: '手机号', title: '手机号',
prop: 'mobile' prop: 'mobile',
width:140
}, },
{ {
title: '公司', title: '公司',
prop: 'organization' prop: 'organization',
width:180
}, },
{ {
title: '部门', title: '部门',
@ -58,11 +66,13 @@ export default {
}, },
{ {
title: '报名时间', title: '报名时间',
prop: 'time' prop: 'time',
width:180
}, },
{ {
title: '状态', title: '状态',
prop: 'status', prop: 'status',
width:100,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.covertStatus(row.status); }, columnValue: (row) => { return this.covertStatus(row.status); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
@ -70,20 +80,23 @@ export default {
{ {
title: '理论分数', title: '理论分数',
prop: 'theoryScore', prop: 'theoryScore',
width:100,
type: 'tag', type: 'tag',
columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || '0'; }, columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : this.covert(row.theoryScore); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: '实操分数', title: '实操分数',
prop: 'practiceScore', prop: 'practiceScore',
width:100,
type: 'tag', type: 'tag',
columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || '0'; }, columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : this.covert(row.practiceScore); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: '总分', title: '总分',
prop: 'totalScore' prop: 'totalScore',
width:100
}, },
// { // {
// title: '', // title: '',
@ -106,13 +119,13 @@ export default {
name: '理论结果', name: '理论结果',
handleClick: this.handleTheoryResult, handleClick: this.handleTheoryResult,
type: '', type: '',
showControl: (row) => { return row.status == '5'; } showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; }
}, },
{ {
name: '实操回放', name: '实操回放',
handleClick: this.playBack, handleClick: this.playBack,
type: '', type: '',
showControl: (row) => { return row.status == '4'; } showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; }
}, },
{ {
name: '修改', name: '修改',
@ -128,7 +141,9 @@ export default {
] ]
}, },
isLeaving:false, isLeaving:false,
inter:null inter:null,
mapId:'',
raceName:''
}; };
}, },
computed: { computed: {
@ -137,6 +152,10 @@ export default {
}, },
mounted() { mounted() {
this.getData(); this.getData();
getRaceById(this.$route.query.raceId).then(res=>{
this.mapId = res.data.mapId;
this.raceName = res.data.name;
});
}, },
beforeDestroy() { beforeDestroy() {
this.isLeaving = true; this.isLeaving = true;
@ -160,8 +179,20 @@ export default {
}, 2000); }, 2000);
}); });
}, },
handleTheoryResult() { handleTheoryResult(index, row) {
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` }); this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId});
// this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
},
covert(data) {
if (data != undefined) {
if (data > 0) {
return data;
} else {
return '0';
}
} else {
return '';
}
}, },
handleAdd() { handleAdd() {
const loading = this.$loading({ const loading = this.$loading({
@ -201,12 +232,26 @@ export default {
}, },
handleClick(index, row) { handleClick(index, row) {
const group = row.group; const group = row.group;
getPublishMapInfo(this.mapId).then(resp=>{
refereeEnterSimulation(group).then(response=>{ refereeEnterSimulation(group).then(response=>{
const query = { lineCode: '11', mapId: '41', group: group, raceId: this.$route.query.raceId}; const query = { lineCode: resp.data.lineCode, mapId: this.mapId, group: group, raceId: this.$route.query.raceId};
this.$router.push({ path: `/jointTrainingNew`, query: query}); this.$router.push({ path: `/jointTrainingNew`, query: query});
}); });
});
}, },
playBack(index, row) { playBack(index, row) {
const group = row.group;
getPublishMapInfo(this.mapId).then(resp=>{
playBackReady({group:group}).then(res=>{
if (res.data) {
const query = { lineCode: resp.data.lineCode, mapId: this.mapId, group: group, raceId: this.$route.query.raceId, userName:row.name};
this.$router.push({ path: `/refereeJsxtDisplay`, query: query});
} else {
this.$messageBox('回放数据出错!');
}
});
});
}, },
gradeScore(index, row) { // gradeScore(index, row) { //
this.$refs.editScore.doShow(row); this.$refs.editScore.doShow(row);
@ -221,4 +266,11 @@ export default {
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.raceName{
padding: 15px 0px;
font-size: 18px;
background: #fff;
text-align: center;
color: #409eff;
}
</style> </style>

View File

@ -0,0 +1,204 @@
<template>
<div>
<div class="menuReplay">
<div class="replay" @click="startPlaying">
<span v-if="isPlaying" class="ToPause" style="padding: 3px 0px">||</span>
<span v-else class="el-icon-caret-right" />
</div>
<div class="playSpeedGroup">
<div class="speedAdd" :style="isAddDisabled?'cursor:no-drop;':''" @click="addSpeed">
<span class="el-icon-plus" />
</div>
<div class="speedNum">{{ playSpeedList[playSpeedIndex].name }}</div>
<div class="speedMinus" :style="isMinusDisabled?'cursor:no-drop;':''" @click="minusSpeed">
<span class="el-icon-minus" />
</div>
</div>
</div>
<div class="comercialName">{{ userName }}的实操回放</div>
<el-button type="primary" class="back" @click="back">返回</el-button>
<chat-box :group="group" :user-role="userRole" />
</div>
</template>
<script>
import { Notification } from 'element-ui';
import ChatBox from '@/views/newMap/jointTrainingNew/chatView/chatBox';
import {setPlaySpeed, startPlaying, playingPause, endPlaying, fromPauseToPlay} from '@/api/competition';
export default {
name:'MenuPlay',
components:{
ChatBox
},
data() {
return {
playSpeedIndex:5,
playSpeedList:[
{level:'-5', name:'-5X'},
{level:'-4', name:'-4X'},
{level:'-3', name:'-3X'},
{level:'-2', name:'-2X'},
{level:'-1', name:'-1X'},
{level:'1', name:'1X'},
{level:'2', name:'2X'},
{level:'3', name:'3X'},
{level:'4', name:'4X'},
{level:'5', name:'5X'}
],
userRole:'AUDIENCE',
isFirstPlay:true,
isPlaying:false
};
},
computed:{
userName() {
return this.$route.query.userName;
},
group() {
return this.$route.query.group;
},
isAddDisabled() {
return this.playSpeedIndex >= this.playSpeedList.length - 1;
},
isMinusDisabled() {
return this.playSpeedIndex <= 0;
}
},
watch: {
'$store.state.socket.playBackFinish':function() {
this.isPlaying = false;
this.isFirstPlay = true;
}
},
beforeDestroy() {
// if (this.isPlaying) {
endPlaying({}).then(res=>{
});
// }
},
methods:{
back() {
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();
});
},
addSpeed() {
if (this.playSpeedIndex < this.playSpeedList.length - 1) {
this.playSpeedIndex++;
// if (this.isPlaying) {
// //
// playingPause({}).then(res=>{
// this.isPlaying = false;
// setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
// });
// });
// } else {
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
// }
}
},
minusSpeed() {
if (this.playSpeedIndex > 0) {
this.playSpeedIndex--;
// if (this.isPlaying) {
// //
// playingPause({}).then(res=>{
// this.isPlaying = false;
// setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
// });
// });
// } else {
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
// }
}
},
startPlaying() {
if (this.isPlaying) {
//
playingPause({}).then(res=>{
this.isPlaying = false;
});
} else {
if (this.isFirstPlay) {
//
startPlaying({}).then(res=>{
this.isPlaying = true;
this.isFirstPlay = false;
});
} else {
//
fromPauseToPlay({}).then(res=>{
this.isPlaying = true;
});
}
}
}
}
};
</script>
<style lang="scss" scoped>
.ToPause{
display: inline-block;
}
.menuReplay{
position: absolute;
width: 215px;
height: 40px;
right: 20px;
top: 15px;
z-index: 2;
background: #fff;
border-radius: 4px;
font-size: 0px;
}
.replay,.speedAdd,.speedMinus{
display: inline-block;
width: 40px;
text-align: center;
background: #409EFF;
border-radius: 5px;
margin-left: 9px;
margin-top: 8px;
cursor: pointer;
color: #fff;
}
.replay span,.speedAdd span,.speedMinus span{
font-size: 16px;
padding: 4px 0px;
}
.playSpeedGroup{display: inline-block;font-size:0px;}
.speedNum{
display: inline-block;
width: 50px;
text-align: center;
border: 1px #dedede solid;
padding: 3px 0px;
margin-left: 9px;
font-size: 15px;
height: 24px;
vertical-align: bottom;
}
.back{
position: absolute;
right: 20px;
bottom: 15px;
}
.comercialName{
position: absolute;
left: 50%;
top: 0px;
padding: 10px 30px;
color: #000;
font-size: 18px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
background: #fff;
border-radius: 0px 0px 10px 10px;
}
</style>

View File

@ -0,0 +1,81 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" class="TheroyResult" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false">
<div style="max-height:500px;overflow:auto;">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length">
<div class="caption">{{ index2UnicodeList[i] }}{{ el.title }}</div>
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
</template>
</div>
</div>
<div style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span>
</div>
</el-dialog>
</template>
<script>
import Question from '@/views/jsxt/competition/theory/question';
import { getTheroyCompetitionResult } from '@/api/competition';
export default {
name:'TheroyResult',
components:{
Question
},
data() {
return {
title:'',
show: false,
loading:false,
totalScore: 0,
examQuestions: []
};
},
computed: {
question() {
return this.examQuestions[this.index] || {};
},
index2UnicodeList() {
return ['一', '二', '三', '四'];
},
sortedList() {
return [
{
title: '判断题',
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
},
{
title: '选择题',
children: this.examQuestions.filter(el => { return el.type === 'select'; })
}
];
}
},
methods:{
doShow({row, raceId}) {
this.loadInitData(raceId, row.id);
this.show = true;
this.title = '【' + row.organization + '】' + row.name + ' 理论结果';
},
doClose() {
this.show = false;
},
loadInitData(raceId, userId) {
this.examQuestions = [];
getTheroyCompetitionResult(raceId, userId).then((resp)=>{
if (resp.data) {
resp.data.forEach((item, i) => {
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
});
this.totalScore = resp.data.reduce((pre, ver) => pre + ver.score, 0);
}
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
}
}
};
</script>
<style lang="scss">
.TheroyResult .el-dialog .el-dialog__body{
padding-top:10px !important;
}
</style>

View File

@ -176,7 +176,7 @@ export default {
this.$refs.queryListPage.refresh(true); this.$refs.queryListPage.refresh(true);
}, },
lessonCreate() { lessonCreate() {
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode} }); this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode, drawWay: this.$route.query.drawWay} });
}, },
lessonCreateByPublish() { lessonCreateByPublish() {
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -125,7 +125,7 @@ export default {
'$store.state.map.mapViewLoadedCount':function(val) { '$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton'); const object = document.querySelector('.menuButton');
if (object) { if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0; const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom; this.bottom = this.bottom + object.offsetHeight + objectBottom;
} }
} }

View File

@ -178,7 +178,6 @@ export default {
drivingShow: false, drivingShow: false,
deviceShow: false, deviceShow: false,
questId: 0, // Id questId: 0, // Id
group: '',
showStation: '', showStation: '',
stationList: [], stationList: [],
showSelectStation: false, // select showSelectStation: false, // select
@ -256,6 +255,9 @@ export default {
project() { project() {
return getSessionStorage('project'); return getSessionStorage('project');
}, },
group() {
return this.$route.query.group;
},
userRole() { userRole() {
if (this.$route.query.prdType == '02') { if (this.$route.query.prdType == '02') {
return 'DISPATCHER'; return 'DISPATCHER';
@ -327,7 +329,6 @@ export default {
}, },
async created() { async created() {
this.mode = this.$route.params.mode; this.mode = this.$route.params.mode;
this.group = this.$route.query.group || '';
}, },
async mounted() { async mounted() {
EventBus.$on('clearCheckLogin', () => { EventBus.$on('clearCheckLogin', () => {

View File

@ -2,7 +2,7 @@
<!-- v-quickMenuDrag --> <!-- v-quickMenuDrag -->
<div class="chatBox" :style="{'bottom':bottom+'px'}"> <div class="chatBox" :style="{'bottom':bottom+'px'}">
<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 v-if="project!='refereeJsxt'" ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main"> <div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" /> <chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window"> <div class="chat-window">
@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="chat-box-content"> <div class="chat-box-content">
<chat-content ref="chatContent" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" /> <chat-content ref="chatContent" :project="project" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
<div v-if="recordSending" class="chat_record_tip"> <div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" /> <div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" /> <div class="record_icon" />
@ -56,6 +56,7 @@ import ChatCreateGroup from './chatCreateGroup';
import ChatTooltip from './chatTooltip'; import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc'; import RecordRTC from 'recordrtc';
import {uploadAudioFileNew, quitCoversition} from '@/api/chat'; import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
import { getSessionStorage } from '@/utils/auth';
export default { export default {
name: 'ChatBox', name: 'ChatBox',
components:{ components:{
@ -92,7 +93,7 @@ export default {
language:'zh', language:'zh',
sex:'1' sex:'1'
}, },
headerTitle:'所有人' headerTitle:''
}; };
}, },
computed:{ computed:{
@ -101,13 +102,16 @@ export default {
}, },
isButtonShow() { isButtonShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition; return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
},
project() {
return getSessionStorage('project');
} }
}, },
watch:{ watch:{
'$store.state.map.mapViewLoadedCount':function(val) { '$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton'); const object = document.querySelector('.menuButton');
if (object) { if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0; const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom; this.bottom = this.bottom + object.offsetHeight + objectBottom;
} }
} }
@ -133,7 +137,7 @@ export default {
this.$refs.chatCoversitionList.initPage(false); this.$refs.chatCoversitionList.initPage(false);
}, },
setCurrentCoversition(coversition) { setCurrentCoversition(coversition) {
if (coversition.id) { if (coversition && coversition.id) {
this.currentCoversition = coversition; this.currentCoversition = coversition;
this.headerTitle = coversition.name; this.headerTitle = coversition.name;
} else { } else {

View File

@ -26,11 +26,16 @@
import {getSimulationContextListNew} from '@/api/chat'; import {getSimulationContextListNew} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
export default { export default {
props:{ props:{
currentCoversition:{ currentCoversition:{
type:Object, type:Object,
required:true required:true
},
project:{
type:String,
required:true
} }
}, },
data() { data() {
@ -61,7 +66,7 @@ export default {
} }
this.scrollTop(); this.scrollTop();
} else { } else {
debugger; // debugger;
if (!simulationText.all) { if (!simulationText.all) {
this.$emit('changeCoversition', simulationText); this.$emit('changeCoversition', simulationText);
// this.$emit('addCoversition', {data:simulationText, headerTitle:''}); // this.$emit('addCoversition', {data:simulationText, headerTitle:''});
@ -73,7 +78,12 @@ export default {
this.playAllAudio(); this.playAllAudio();
} }
} }
} else {
if (this.project == 'refereeJsxt') {
this.chatContentList.push(simulationText);
simulationText.name = '所有人';
this.$emit('changeCoversition', simulationText);
}
} }
} }
}, },
@ -81,7 +91,7 @@ export default {
this.inintData(); this.inintData();
}, },
currentCoversition:function (val, old) { currentCoversition:function (val, old) {
if (val) { if (val && this.project != 'refereeJsxt') {
this.chatContentList = []; this.chatContentList = [];
this.coversition = this.currentCoversition; this.coversition = this.currentCoversition;
this.inintData(); this.inintData();

View File

@ -7,7 +7,18 @@
<transition name="el-zoom-in-bottom"> <transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" /> <map-system-draft ref="mapCanvas" @back="back" />
</transition> </transition>
<menu-demon-joint ref="demonMenu" :group="group" :data-error="dataError" :user-role="userRole" :device-code="deviceCode" @getUserRole="getUserRole" @hidepanel="hidepanel" @showIbp="showIbp" /> <menu-demon-joint
ref="demonMenu"
:group="group"
:data-error="dataError"
:user-role="userRole"
:device-code="deviceCode"
:countdown-time="countdownTime"
@getUserRole="getUserRole"
@hidepanel="hidepanel"
@showIbp="showIbp"
@startCounting="startCounting"
/>
<menu-demon-schema <menu-demon-schema
ref="menuSchema" ref="menuSchema"
:group="group" :group="group"
@ -27,6 +38,7 @@
<join-run-plan-view ref="runPlanView" :group="group" /> <join-run-plan-view ref="runPlanView" :group="group" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" /> <menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
</div> </div>
</div> </div>
@ -36,6 +48,7 @@
import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuDemonJoint from './menuDemon'; import MenuDemonJoint from './menuDemon';
import MenuDemonSchema from './menuSchema'; import MenuDemonSchema from './menuSchema';
import JsQuestion from './jsQuestion';
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose'; import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad'; import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView'; import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
@ -48,7 +61,7 @@ import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining'; import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import {getRaceUserById} from '@/api/competition'; import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive'; import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer'; import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
@ -57,6 +70,7 @@ import ibpData from '@/ibp/constant/ibpData';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
import Vue from 'vue'; import Vue from 'vue';
import localStore from 'storejs';
export default { export default {
name: 'JointTrainingDraft', name: 'JointTrainingDraft',
@ -71,7 +85,8 @@ export default {
menuSystemTime, menuSystemTime,
Jl3dDrive, Jl3dDrive,
Jl3dMaintainer, Jl3dMaintainer,
IbpPlate IbpPlate,
JsQuestion
}, },
data() { data() {
return { return {
@ -98,7 +113,12 @@ export default {
stationList: [], stationList: [],
showSelectStation: false, showSelectStation: false,
mapViewLoadedOver: false, mapViewLoadedOver: false,
dataError: false dataError: false,
countdownTime: '00:00:00',
practicalTime: 0,
countdown: null,
questionList: [],
practicalExamTime: 0
}; };
}, },
computed: { computed: {
@ -209,6 +229,9 @@ export default {
await this.$store.dispatch('training/reset'); await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear'); await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', ''); await this.$store.dispatch('training/setGroup', '');
if (this.countdown) {
clearInterval(this.countdown);
}
Message.closeAll(); Message.closeAll();
}, },
methods: { methods: {
@ -367,6 +390,23 @@ export default {
if (this.project == 'jsxt' ) { if (this.project == 'jsxt' ) {
resp = await getRaceUserById(this.$route.query.raceId); resp = await getRaceUserById(this.$route.query.raceId);
resp.data.userRole = resp.data.role; resp.data.userRole = resp.data.role;
const paperResp = await getTestPaperDatail(this.$route.query.raceId);
if (paperResp.data && paperResp.data.practicalQuestions) {
this.questionList = [];
this.practicalExamTime = paperResp.data.practicalExamTime;
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
const startTime = localStore.get(storeKey);
if (startTime) {
const dt = new Date().getTime() - startTime;
this.practicalTime = paperResp.data.practicalExamTime * 60 - Math.floor(dt / 1000);
} else {
this.practicalTime = this.practicalExamTime * 60;
}
this.countdownTime = this.computationTime(this.practicalTime);
paperResp.data.practicalQuestions.forEach(elem => {
this.questionList.push({name: elem.question.name, description:elem.question.description});
});
}
} else if (this.project == 'refereeJsxt') { } else if (this.project == 'refereeJsxt') {
resp['code'] = 200; resp['code'] = 200;
resp.data['userRole'] = 'ADMIN'; resp.data['userRole'] = 'ADMIN';
@ -395,6 +435,24 @@ export default {
this.endViewLoading(); this.endViewLoading();
} }
}, },
startCounting() {
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
const startTime = localStore.get(storeKey);
if (!startTime) {
const storeValue = new Date().getTime();
localStore.set(storeKey, storeValue);
}
this.countdown = setInterval(() => {
if (this.practicalTime <= 0) {
if (this.countdown) {
clearInterval(this.countdown);
}
this.$refs.demonMenu.submit();
}
this.practicalTime--;
this.countdownTime = this.computationTime(this.practicalTime);
}, 1000);
},
async getTrainDetail() { async getTrainDetail() {
try { try {
await loadNewMapDataByGroup(this.group); await loadNewMapDataByGroup(this.group);
@ -419,6 +477,28 @@ export default {
faultChooseShow() { faultChooseShow() {
this.$refs.faultChoose.doShow(); this.$refs.faultChoose.doShow();
}, },
computationTime(time) {
let hours = Math.floor(time / 3600);
const newTime = time % 3600;
let minutes = Math.floor(newTime / 60) + '';
let seconds = newTime % 60;
if (hours < 0) {
hours = '00';
} else if (hours < 10) {
hours = '0' + hours;
}
if (minutes < 0) {
minutes = '00';
} else if (minutes < 10) {
minutes = '0' + minutes;
}
if (seconds < 0) {
seconds = '00';
} else if (seconds < 10) {
seconds = '0' + seconds;
}
return hours + ':' + minutes + ':' + seconds;
},
showdriving() { showdriving() {
this.panelShow = true; this.panelShow = true;
this.drivingShow = false; this.drivingShow = false;

View File

@ -0,0 +1,94 @@
<template>
<div class="menuTrainListOut" :style="{top: offset-5 +'px'}">
<div v-if="drawer" class="menuTrainListContent">
<div>
<div v-for="(item, index) in questionList" :key="index">
<div style="text-align: center;font-size: 16px;">{{ item.name }}</div>
<div style="text-align: left;font-size: 14px;margin-top: 5px;">{{ '描述:'+item.description }}</div>
</div>
</div>
<div class="menuTrainListBtn1In" style=";position: absolute; top: 98%;left:150px;z-index: 2;" @click="clickBtn">
<i class="el-icon-more" style="font-size: 20px;transform-origin: 50% 50%;" />
</div>
</div>
<div v-else class="menuTrainListBtn1" @click="clickBtn">
<div class="menuTrainListBtn1In">
<i class="el-icon-more" style="font-size: 20px;transform-origin: 50% 50%;" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'JsQuestion',
props: {
offset: {
type: Number,
required: true
},
questionList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
drawer: true
};
},
methods: {
clickBtn() {
this.drawer = !this.drawer;
}
}
};
</script>
<style lang="scss" scoped>
.menuTrainListBtn1In{
width: 40px;
height: 20px;
background: #fff;
text-align: center;
border-radius: 0 0 6px 6px;
cursor:pointer;
/*border: 1px #adadad solid;*/
}
.menuTrainListBtn1{
position: absolute;
}
.menuTrainListContent{
background: #fff;
text-align: center;
border-radius:0 0 6px 6px;
padding: 10px;
position: absolute;
width: 350px;
left: -150px;
z-index: 3;
cursor:pointer;
}
.menuTrainListOut{
position: absolute;
right: 30%;
height: 70%;
}
.menuTrainList{
width: 400px;
height:100%;
border-radius: 10px 0px 0px 10px;
// padding: 5px;
background: #fff;
}
.topTrainListInfo,.bottomTrainListInfo{
padding: 10px 10px;
background: #cde2ef;
font-size: 13px;
border-radius: 5px 0px 0px 0px;
}
</style>

View File

@ -12,6 +12,7 @@
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> --> <!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
</el-button-group> </el-button-group>
<template v-if="project==='jsxt'"> <template v-if="project==='jsxt'">
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:'+countdownTime }}</div>
<el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button> <el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button> <el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
</template> </template>
@ -34,8 +35,9 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice'; import RealDevice from './menuDraft/realDevice';
import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition'; import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
import { prefixIntrger } from '@/utils/date'; import { prefixIntrger } from '@/utils/date';
import localStore from 'storejs';
export default { export default {
name: 'MenuDemonJoint', name: 'MenuDemonJoint',
@ -56,6 +58,10 @@ export default {
type: String, type: String,
required: true required: true
}, },
countdownTime: {
type: String,
required: true
},
deviceCode: { deviceCode: {
type: String, type: String,
default() { default() {
@ -127,11 +133,6 @@ export default {
'$store.state.map.runPlanStatus': function (val) { '$store.state.map.runPlanStatus': function (val) {
this.isDisable = val; this.isDisable = val;
}, },
// '$store.state.socket.competitionStart':function(val) {
// if (val) {
// this.startCompetition();
// }
// },
'$store.state.socket.simulationOver':function(val) { '$store.state.socket.simulationOver':function(val) {
if (val && this.project === 'refereeJsxt') { if (val && this.project === 'refereeJsxt') {
this.$router.go(-1); this.$router.go(-1);
@ -315,6 +316,7 @@ export default {
}, },
startCompetition() { startCompetition() {
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => { startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
this.$emit('startCounting');
this.jsStart = false; this.jsStart = false;
}).catch(()=> { }).catch(()=> {
this.$message.error('开始竞赛失败'); this.$message.error('开始竞赛失败');
@ -326,12 +328,7 @@ export default {
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
// this.$router.go(-1);
this.submit(); this.submit();
}).catch(()=> {
this.$message.error('提交试卷失败!');
});
}); });
}, },
refeeEndCompetition() { refeeEndCompetition() {
@ -343,10 +340,13 @@ export default {
}); });
}, },
submit() { submit() {
// this.$store.dispatch('exam/over').then(() => { submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
// this.$store.dispatch('trainingList/clearTrainingList'); const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
localStore.remove(storeKey);
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } }); this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
// }); }).catch(()=> {
this.$message.error('提交试卷失败!');
});
} }
} }
}; };

View File

@ -3,7 +3,51 @@
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy"> <el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
<div style="height: calc(100% - 46px);"> <div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" /> <config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules">
<div v-if="editModel.type == 'StationTurnBack'" class="card-box">
<div class="card_title">站后折返数据</div>
<div>
<el-table :data="editModel.optionList" border style="width: 100%">
<el-table-column prop="id" label="编号" width="100px" />
<el-table-column prop="label" label="描述" width="250px" />
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="deleteOverlab(editModel.optionList, scope.$index)">移出</el-button>
<el-button type="text" size="small" @click.native.prevent="editOverlab(editModel.optionList, scope.$index)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">{{ cardTitle }}</span>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
</el-button-group>
</div>
<div>
<el-form ref="hostileForm" :model="addBackModel" :rules="addBackRules" label-width="135px" size="mini" style="margin-top: 15px;padding-right: 10px;">
<el-form-item label="类型:" prop="type">
<el-select v-model="addBackModel.type" clearable :filterable="true">
<el-option v-for="item in turnBackList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="描述:" prop="label">
<el-input v-model="addBackModel.label" type="text" maxlength="30" :show-word-limit="true" />
</el-form-item>
<el-form-item v-if="addBackModel.type != 'NONE'" label="折返轨:" prop="sectionList">
<el-select v-model="addBackModel.sectionList" clearable multiple :filterable="true">
<el-option v-for="item in sectionList" :key="item.value" :label="`${item.name}(${item.code})`" :value="item.value" />
</el-select>
<el-button :type="field === 'sectionCode1' ? 'danger' : 'primary'" @click="hover('sectionCode1')">激活</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</div>
</config-list>
</el-scrollbar> </el-scrollbar>
</div> </div>
<div class="button_box"> <div class="button_box">
@ -55,18 +99,36 @@ export default {
activeName: 'first', activeName: 'first',
lazy: true, lazy: true,
autoList: [], autoList: [],
field: '',
turnBackList: [
{ name: '按计划执行', value: 'NONE' },
{ name: '仅某个折返轨', value: 'ONLY' },
{ name: '等价折返', value: 'EQUAL' },
{ name: '优先/次之', value: 'FIRST' }
],
typeList: [ typeList: [
{ name: '自动折返', value: 'AutoTurnBack' }, { name: '自动折返', value: 'AutoTurnBack' },
{ name: '计轴复位', value: 'AxleReset' }, { name: '计轴复位', value: 'AxleReset' },
{ name: '自动进路', value: 'AutomaticRoute' }, { name: '自动进路', value: 'AutomaticRoute' },
{ name: '引导总锁', value: 'GuideLock' }, { name: '引导总锁', value: 'GuideLock' },
{ name: '全线临时限速', value: 'LimitControl' } { name: '全线临时限速', value: 'LimitControl' },
{ name: '站后折返', value: 'StationTurnBack' }
], ],
cardMode: 'generate',
addBackModel: {
id: '',
type: '',
label: '',
sectionList: [],
parentIndex: 0
},
editModel: { editModel: {
code: '', code: '',
type: '', type: '',
name: '', name: '',
show: true, //
subtitleName: '', subtitleName: '',
optionList: [], //
automaticRouteCode: '', // code automaticRouteCode: '', // code
cycleCode: '', // code cycleCode: '', // code
stationCode: '', // stationCode: '', //
@ -101,6 +163,17 @@ export default {
'position.y': [ 'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
] ]
},
addBackRules: {
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
label: [
{ required: true, message: '请填写描述', trigger: 'blur' }
],
sectionList: [
{ required: true, message: '请选择站台轨', trigger: 'change' }
]
} }
}; };
}, },
@ -111,8 +184,19 @@ export default {
'tempSpeedLimitList', 'tempSpeedLimitList',
'axleCounterResetButtonList', 'axleCounterResetButtonList',
'totalGuideLockButtonVOList', 'totalGuideLockButtonVOList',
'stationList' 'stationList',
'sectionList',
'tbStrategyList'
]), ]),
cardTitle() {
if (this.cardMode === 'generate') {
return '生成数据';
} else if (this.cardMode === 'edit') {
return '编辑数据';
} else {
return '';
}
},
form() { form() {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
@ -124,17 +208,18 @@ export default {
draw: { draw: {
name: this.$t('map.drawData'), name: this.$t('map.drawData'),
item: [ item: [
{ prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, disabled: true }, { prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, change: true, deviceChange: this.typeChange },
{ prop: 'code', label: `${this.$t('map.code')}`, type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.selectLists, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: `${this.$t('map.code')}`, type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.selectLists, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.buttonMainName'), type: 'input' }, { prop: 'name', label: this.$t('map.buttonMainName'), type: 'input' },
{ prop: 'subtitleName', label: this.$t('map.buttonViceName'), type: 'input' }, { prop: 'show', label: '是否显示:', type: 'checkbox', isHidden: !this.isTurnBackShow },
{ prop: 'subtitleName', label: this.$t('map.buttonViceName'), type: 'input', isHidden: !this.isHiddensubtitleNameVO },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '140px', children: [ { prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }, ] },
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.changeEditStation }, { prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.changeEditStation },
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.changeEditStation }, { prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.changeEditStation },
{ prop:'stationCode', label: this.$t('map.ownedCiStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation } { prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
] ]
} }
} }
@ -153,7 +238,7 @@ export default {
] }, ] },
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateAutomaticRoute, change: true, deviceChange: this.changeStation }, { prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateAutomaticRoute, change: true, deviceChange: this.changeStation },
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateMapCycleButtonVO, change: true, deviceChange: this.changeStation }, { prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateMapCycleButtonVO, change: true, deviceChange: this.changeStation },
{ prop:'stationCode', label: this.$t('map.ownedCiStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledCreateStation, isHidden: !this.isHiddenCreateStation } { prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledCreateStation, isHidden: !this.isHiddenCreateStation }
] ]
}; };
return form; return form;
@ -180,11 +265,17 @@ export default {
isHiddenMapCycleButtonVO() { isHiddenMapCycleButtonVO() {
return this.editModel.type == 'AutoTurnBack'; return this.editModel.type == 'AutoTurnBack';
}, },
isTurnBackShow() {
return this.editModel.type == 'StationTurnBack';
},
isHiddensubtitleNameVO() {
return this.editModel.type != 'StationTurnBack';
},
isDisabledStation() { isDisabledStation() {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute'; return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute';
}, },
isHiddenStation() { isHiddenStation() {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset'; return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset' || this.editModel.type == 'StationTurnBack';
}, },
isHiddenCreateAutomaticRoute() { isHiddenCreateAutomaticRoute() {
@ -197,17 +288,9 @@ export default {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute'; return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
}, },
isHiddenCreateStation() { isHiddenCreateStation() {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset'; return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset' || this.addModel.type == 'StationTurnBack';
} }
}, },
// watch: {
// selected(val, oldVal) {
// if (val && val._type) {
// this.handleTypes(val._type);
// this.deviceSelect(val);
// }
// }
// },
mounted() { mounted() {
}, },
methods: { methods: {
@ -219,13 +302,33 @@ export default {
this.changeEditStation(data.cycleCode); this.changeEditStation(data.cycleCode);
} }
}, },
typeChange(type) { // clearInfo() {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.automaticRouteCode = ''; this.addModel.automaticRouteCode = '';
this.addModel.cycleCode = ''; this.addModel.cycleCode = '';
this.addModel.concentrateStationList = ''; this.addModel.concentrateStationList = '';
this.addModel.type = type; // this.editModel = {
code: '',
type: '',
name: '',
show: true, //
subtitleName: '',
optionList: [], //
automaticRouteCode: '', // code
cycleCode: '', // code
stationCode: '', //
position: {
x: 0,
y: 0
}
};
},
typeChange(type) { //
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.clearInfo();
this.addModel.type = type;
this.editModel.type = type;
this.handleTypes(type); this.handleTypes(type);
}, },
handleTypes(type) { handleTypes(type) {
@ -247,6 +350,9 @@ export default {
case 'GuideLock': case 'GuideLock':
this.selectLists = this.totalGuideLockButtonVOList; this.selectLists = this.totalGuideLockButtonVOList;
break; break;
case 'StationTurnBack':
this.selectLists = this.tbStrategyList;
break;
} }
}, },
changeStation(code) { // changeStation(code) { //
@ -271,16 +377,20 @@ export default {
this.getAutoMaticList(); this.getAutoMaticList();
}, },
deviceSelect(selected) { deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase() || selected._type.toUpperCase() == 'StationTurnBack'.toUpperCase()) {
this.handleTypes(selected._type); this.handleTypes(selected._type);
this.$refs.dataform && this.$refs.dataform.resetFields(); this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields(); this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type; this.editModel.type = selected._type;
this.$nextTick(() => { this.$nextTick(() => {
this.setStation(selected); this.setStation(selected);
}); });
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionCode1'.toUpperCase()) {
if (!this.addBackModel.sectionList.includes(selected.code)) {
this.addBackModel.sectionList.push(selected.code);
}
} }
}, },
async getAutoMaticList() { // async getAutoMaticList() { //
@ -317,10 +427,12 @@ export default {
code: uid, code: uid,
name: this.addModel.name, name: this.addModel.name,
subtitleName: this.addModel.subtitleName, subtitleName: this.addModel.subtitleName,
show: true,
position: { position: {
x: this.addModel.position.x, x: this.addModel.position.x,
y: this.addModel.position.y y: this.addModel.position.y
}, },
optionList: [],
automaticRouteCode: this.addModel.automaticRouteCode, // code automaticRouteCode: this.addModel.automaticRouteCode, // code
cycleCode: this.addModel.cycleCode, // code cycleCode: this.addModel.cycleCode, // code
stationCode: this.addModel.stationCode // stationCode: this.addModel.stationCode //
@ -354,6 +466,62 @@ export default {
this.$message.info(this.$t('tip.cancelledDelete')); this.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
},
hover(field) {
this.field = field === this.field ? '' : field;
this.$emit('selectFiled', this.field);
},
deleteOverlab(list, index) {
list.splice(index, 1);
this.cardMode = 'generate';
},
editOverlab(list, index) {
this.addBackModel = deepAssign({}, list[index]);
this.addBackModel.parentIndex = index;
this.cardMode = 'edit';
},
updateOverlab() { //
this.$refs.hostileForm.validate((valid) => {
if (valid) {
const data = {
id: this.addBackModel.id,
type: this.addBackModel.type,
label: this.addBackModel.label,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
};
this.editModel.optionList.splice(this.addBackModel.parentIndex, 1, data);
this.$refs.hostileForm.resetFields();
this.cardMode = 'generate';
this.addBackModel.sectionList = [];
}
});
},
generateOverlab() { //
this.$refs.hostileForm.validate((valid) => {
if (valid) {
const id = this.createUid(this.editModel.optionList); // uid
this.editModel.optionList.push({
id: id,
type: this.addBackModel.type,
label: this.addBackModel.label,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
});
this.$refs.hostileForm.resetFields();
this.addBackModel.sectionList = [];
}
});
},
cancelOverlab() {
this.$refs.hostileForm.resetFields();
this.cardMode = 'generate';
},
createUid(list) {
if (list.length) {
let num = Number(list[list.length - 1].id);
return ++num;
} else {
return 1;
}
} }
} }
}; };
@ -389,4 +557,24 @@ export default {
.map-draft-group { .map-draft-group {
color: #3E44BE; color: #3E44BE;
} }
.card-box{
border: 1px solid #ccc;
padding: 10px;
padding-top: 18px;
box-sizing: border-box;
position: relative;
margin-bottom: 15px;
&:last-child{
margin-bottom: 0;
}
.card_title {
position: absolute;
left: 10px;
top: -8px;
background: #fff;
padding: 0px 5px;
}
}
</style> </style>

View File

@ -174,6 +174,7 @@
</el-form-item> </el-form-item>
</template> </template>
</template> </template>
<slot />
</el-form> </el-form>
</template> </template>

View File

@ -270,6 +270,7 @@
</template> </template>
</div> </div>
</template> </template>
<slot />
</el-form> </el-form>
</template> </template>

View File

@ -106,6 +106,7 @@
:selected="selected" :selected="selected"
@updateMapModel="updateMapModel" @updateMapModel="updateMapModel"
@setCenter="setCenter" @setCenter="setCenter"
@selectFiled="selectFiled"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('map.saidLamp')" class="tab_pane_box" name="ControlLamp" :lazy="lazy"> <el-tab-pane :label="$t('map.saidLamp')" class="tab_pane_box" name="ControlLamp" :lazy="lazy">
@ -285,6 +286,7 @@ export default {
switchType: '', switchType: '',
stationStandType:'', stationStandType:'',
psdType: '', psdType: '',
controlType: '',
ViewMode: ViewMode, ViewMode: ViewMode,
enabledTab: 'Section', enabledTab: 'Section',
autoSaveTask: null, autoSaveTask: null,
@ -351,7 +353,7 @@ export default {
this.enabledTab = 'Esp'; this.enabledTab = 'Esp';
} else if (this.feild) { } else if (this.feild) {
this.enabledTab = 'Section'; this.enabledTab = 'Section';
} else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock') { } else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock' || type == 'StationTurnBack' || this.controlType) {
this.enabledTab = 'ControlDraft'; this.enabledTab = 'ControlDraft';
} else if (controlLampTypeList.includes(type) || this.saidLampType) { } else if (controlLampTypeList.includes(type) || this.saidLampType) {
this.enabledTab = 'ControlLamp'; this.enabledTab = 'ControlLamp';
@ -359,6 +361,9 @@ export default {
this.enabledTab = type; this.enabledTab = type;
} }
}, },
selectFiled(type) {
this.controlType = type;
},
esqTab(type) { esqTab(type) {
this.esqType = type; this.esqType = type;
}, },

View File

@ -75,7 +75,7 @@ import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import CommandOperation from './command'; import CommandOperation from './command';
import {addScriptAction, addScriptActionNew, modifyScriptAction, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; import {addScriptAction, addScriptActionNew, modifyScriptAction, modifyScriptActionNew, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation';
export default { export default {
name: 'AddAction', name: 'AddAction',
components:{ components:{
@ -451,6 +451,23 @@ export default {
} else { } else {
const actionId = this.modalData.actionVO.id; const actionId = this.modalData.actionVO.id;
if (this.drawWay) {
data.id = actionId;
modifyScriptActionNew(group, data).then(response=>{
this.modifying = false;
this.isNotModify = true;
this.$emit('setDisabled', this.isNotModify);
this.buttonName = this.$t('scriptRecord.addConversitionButton');
this.operateType = 'add';
this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData();
}).catch(error => {
this.modifying = false;
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
});
} else {
modifyScriptAction(group, actionId, data).then(response=>{ modifyScriptAction(group, actionId, data).then(response=>{
this.modifying = false; this.modifying = false;
this.isNotModify = true; this.isNotModify = true;
@ -466,6 +483,8 @@ export default {
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
}); });
} }
}
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;

View File

@ -20,7 +20,7 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <div class="btnGroup">
<el-button v-if="actionInfo.visible && !drawWay" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button> <el-button v-if="actionInfo.visible" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card> </el-card>
@ -158,8 +158,8 @@ export default {
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label); // memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// }); // });
// memberVOList = JSON.parse(memberVOList); // memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data); const lastData = JSON.stringify(response.data.memberVOList);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
const actionList = response.data.actionVOList; const actionList = response.data.actionVOList;
@ -218,11 +218,9 @@ export default {
this.loadInitData(); this.loadInitData();
}, },
modifyAction(row) { modifyAction(row) {
if (!this.drawWay) {
this.$emit('setAction', row); this.$emit('setAction', row);
} }
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>