Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
6a25abd809
@ -29,13 +29,6 @@ export function participantCreatTrainingRoom(id, data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 参赛者完成竞赛 */
|
||||
export function participantCompleteCompetition(id, group) {
|
||||
return request({
|
||||
url: `/api/v1/competition/${id}/room/${group}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页获取地图下的实操列表 */
|
||||
export function getQuestionListByMapId(params) {
|
||||
@ -184,3 +177,66 @@ export function getPracticalCompetitionResult(competitionId) {
|
||||
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'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
return request({
|
||||
@ -604,6 +613,15 @@ export function getNewMapDataByGroup(group) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 新版地图根据仿真mapId获取仿真地图数据 */
|
||||
export function getNewMapDataByMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/map/${mapId}/mapData`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 新版地图指令操作定义 */
|
||||
export function newMapOperate(group, operationId, data) {
|
||||
return request({
|
||||
@ -700,3 +718,4 @@ export function getMemberInfo(group, memberId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -265,5 +265,29 @@ deviceRender[deviceType.Cistern] = {
|
||||
_type: deviceType.Cistern,
|
||||
zlevel: 1,
|
||||
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;
|
||||
|
@ -40,7 +40,11 @@ const deviceType = {
|
||||
LightingGroup: 'LightingGroup',
|
||||
BalancedElectric: 'BalancedElectric',
|
||||
ElectricButterflyValve: 'ElectricButterflyValve',
|
||||
Cistern: 'Cistern'
|
||||
Cistern: 'Cistern',
|
||||
Electrically: 'Electrically',
|
||||
Stairs: 'Stairs',
|
||||
Elevator: 'Elevator',
|
||||
Draught: 'Draught'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
File diff suppressed because one or more lines are too long
275
src/iscs/mouseController copy.js
Normal file
275
src/iscs/mouseController copy.js
Normal 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;
|
27
src/iscs/shape/bas/draught.js
Normal file
27
src/iscs/shape/bas/draught.js
Normal 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;
|
||||
}
|
||||
}
|
85
src/iscs/shape/bas/electrically.js
Normal file
85
src/iscs/shape/bas/electrically.js
Normal 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;
|
||||
}
|
||||
}
|
30
src/iscs/shape/bas/elevator.js
Normal file
30
src/iscs/shape/bas/elevator.js
Normal 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;
|
||||
}
|
||||
}
|
30
src/iscs/shape/bas/stairs.js
Normal file
30
src/iscs/shape/bas/stairs.js
Normal 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;
|
||||
}
|
||||
}
|
@ -75,6 +75,22 @@ const map = {
|
||||
StaircaseOneWay: {
|
||||
width: 51,
|
||||
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'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -41,6 +41,10 @@ import StateTable from './stateTable';
|
||||
import LightingGroup from './lighting';
|
||||
import ElectricButterflyValve from './bas/electricButterflyValve';
|
||||
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 = {};
|
||||
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
|
||||
@ -86,6 +90,10 @@ iscsShape[deviceType.LightingGroup] = LightingGroup;
|
||||
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
|
||||
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
|
||||
iscsShape[deviceType.Cistern] = Cistern;
|
||||
iscsShape[deviceType.Electrically] = Electrically;
|
||||
iscsShape[deviceType.Stairs] = Stairs;
|
||||
iscsShape[deviceType.Elevator] = Elevator;
|
||||
iscsShape[deviceType.Draught] = Draught;
|
||||
|
||||
function shapefactory(device, iscs) {
|
||||
const type = device.model._type;
|
||||
|
@ -46,7 +46,17 @@ const stateMap = {
|
||||
decoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 解码器状态
|
||||
quadDecoderState: { default: true, type: 'Circle', color: '#4CCDE4'}, // 四路解码器状态
|
||||
quadDecoderModeState: { default: '监视器', color: '#4CCDE4'}, // 四路解码器模式状态
|
||||
controlKeyboardState: { default: true, type: 'Circle', color: '#4CCDE4'} // 控制键盘状态
|
||||
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 {
|
||||
@ -211,6 +221,28 @@ export default class StateTable extends Group {
|
||||
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.tabelContent.push(text);
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as matrix from 'zrender/src/core/matrix';
|
||||
import deviceType from '../constant/deviceType';
|
||||
import deviceRender from '../constant/deviceRender';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import { deepClone } from '@/utils/index';
|
||||
// import store from '@/store/index_APP_TARGET';
|
||||
// import { deepClone } from '@/utils/index';
|
||||
|
||||
export function createTransform(opts) {
|
||||
let transform = matrix.create();
|
||||
@ -168,7 +168,19 @@ export function parser(data) {
|
||||
});
|
||||
zrUtil.each(data.cisternList || [], 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;
|
||||
@ -194,129 +206,50 @@ function updateIscsListByDevice(state, name, device) {
|
||||
export function updateIscsData(state, device) {
|
||||
// const state = store.state;
|
||||
switch (device._type) {
|
||||
case deviceType.Vidicon :
|
||||
updateIscsListByDevice(state, 'vidiconList', device);
|
||||
break;
|
||||
case deviceType.VidiconCloud :
|
||||
updateIscsListByDevice(state, 'vidiconCloudList', device);
|
||||
break;
|
||||
case deviceType.ManualAlarmButton :
|
||||
updateIscsListByDevice(state, 'manualAlarmButtonList', device);
|
||||
break;
|
||||
case deviceType.FireHydranAlarmButton:
|
||||
updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device);
|
||||
break;
|
||||
case deviceType.GasFireControl:
|
||||
updateIscsListByDevice(state, 'gasFireControlList', device);
|
||||
break;
|
||||
case deviceType.SmokeDetector:
|
||||
updateIscsListByDevice(state, 'smokeDetectorList', device);
|
||||
break;
|
||||
case deviceType.TemperatureDetector:
|
||||
updateIscsListByDevice(state, 'temperatureDetectorList', device);
|
||||
break;
|
||||
case deviceType.PlatformScreenDoor:
|
||||
updateIscsListByDevice(state, 'platformScreenDoorList', device);
|
||||
break;
|
||||
case deviceType.FrozenPump :
|
||||
updateIscsListByDevice(state, 'frozenPumpList', device);
|
||||
break;
|
||||
case deviceType.Ventilator :
|
||||
updateIscsListByDevice(state, 'ventilatorList', device);
|
||||
break;
|
||||
case deviceType.Chiller :
|
||||
updateIscsListByDevice(state, 'chillerList', device);
|
||||
break;
|
||||
case deviceType.CoolTower :
|
||||
updateIscsListByDevice(state, 'coolTowerList', device);
|
||||
break;
|
||||
case deviceType.EndDoor:
|
||||
updateIscsListByDevice(state, 'endDoorList', device);
|
||||
break;
|
||||
case deviceType.BorderRadius:
|
||||
updateIscsListByDevice(state, 'borderRadiusList', device);
|
||||
break;
|
||||
case deviceType.BrakeMachine:
|
||||
updateIscsListByDevice(state, 'brakeMachineList', 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;
|
||||
case deviceType.Vidicon : updateIscsListByDevice(state, 'vidiconList', device); break;
|
||||
case deviceType.VidiconCloud : updateIscsListByDevice(state, 'vidiconCloudList', device); break;
|
||||
case deviceType.ManualAlarmButton : updateIscsListByDevice(state, 'manualAlarmButtonList', device); break;
|
||||
case deviceType.FireHydranAlarmButton: updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); break;
|
||||
case deviceType.GasFireControl: updateIscsListByDevice(state, 'gasFireControlList', device); break;
|
||||
case deviceType.SmokeDetector: updateIscsListByDevice(state, 'smokeDetectorList', device); break;
|
||||
case deviceType.TemperatureDetector: updateIscsListByDevice(state, 'temperatureDetectorList', device); break;
|
||||
case deviceType.PlatformScreenDoor: updateIscsListByDevice(state, 'platformScreenDoorList', device); break;
|
||||
case deviceType.FrozenPump : updateIscsListByDevice(state, 'frozenPumpList', device); break;
|
||||
case deviceType.Ventilator : updateIscsListByDevice(state, 'ventilatorList', device); break;
|
||||
case deviceType.Chiller : updateIscsListByDevice(state, 'chillerList', device); break;
|
||||
case deviceType.CoolTower : updateIscsListByDevice(state, 'coolTowerList', device); break;
|
||||
case deviceType.EndDoor: updateIscsListByDevice(state, 'endDoorList', device); break;
|
||||
case deviceType.BorderRadius: updateIscsListByDevice(state, 'borderRadiusList', device); break;
|
||||
case deviceType.BrakeMachine: updateIscsListByDevice(state, 'brakeMachineList', 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;
|
||||
case deviceType.Electrically: updateIscsListByDevice(state, 'electricallyList', device); break;
|
||||
case deviceType.Stairs: updateIscsListByDevice(state, 'stairsList', device); break;
|
||||
case deviceType.Elevator: updateIscsListByDevice(state, 'elevatorList', device); break;
|
||||
case deviceType.Draught: updateIscsListByDevice(state, 'draughtList', device); break;
|
||||
}
|
||||
// store.dispatch('iscs/setIscsData', state.iscs);
|
||||
}
|
||||
|
@ -608,14 +608,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: { x: -4, y: 4 }// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 7, y: 1 }, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 13, y: 10 }, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
trainConntWidth: 3, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 6, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -544,14 +544,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
|
||||
trainConntWidth: 4, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -729,14 +729,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
|
||||
trainConntWidth: 3, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 6, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 5 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -582,14 +582,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 5, y: 9}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 18, // 列车车头矩形高度
|
||||
trainConntWidth: 5, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 3 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
useSelfFormat: true,
|
||||
|
@ -570,14 +570,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||
trainConntWidth: 4, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 17, // 列车高度
|
||||
|
@ -630,14 +630,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: { x: 5, y: 25 }// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 0, y: 0 }, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 4, y: 7.5 }, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||
trainConntWidth: 0, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
hasTravelSigns: true, // 是否有行进标志
|
||||
|
@ -581,14 +581,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 4, y: 0}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 9, y: 10}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量
|
||||
trainConntWidth: 2, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -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] = {
|
||||
text: {
|
||||
fontSize: 10, // 字体大小
|
||||
@ -618,14 +635,13 @@ class SkinCode extends defaultStyle {
|
||||
headTypeColor: '#FF0' // 头码车
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||
trainConntWidth: 4, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
|
||||
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'text', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 4, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 17, // 列车高度
|
||||
|
@ -716,14 +716,13 @@ class SkinCode extends defaultStyle {
|
||||
trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量
|
||||
},
|
||||
trainHead: {
|
||||
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||
trainHeadTriangleFirst: { x: -1, y: -1}, // 列车车头三角坐标1偏移量
|
||||
trainHeadTriangleSecond: { x: 15, y: 10}, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量
|
||||
trainConntWidth: 0, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色
|
||||
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||
directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
directionStopType:'special', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 16, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: -0.5 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -250,4 +250,9 @@ deviceRender[deviceType.Power] = {
|
||||
_type: deviceType.Power,
|
||||
zlevel: 1
|
||||
};
|
||||
// 站后折返
|
||||
deviceRender[deviceType.StationTurnBack] = {
|
||||
_type: deviceType.StationTurnBack,
|
||||
zlevel: 1
|
||||
};
|
||||
export default deviceRender;
|
||||
|
@ -43,7 +43,8 @@ const deviceType = {
|
||||
SplitStation:'SplitStation',
|
||||
SwitchFault: 'SwitchFault',
|
||||
Arrow: 'Arrow',
|
||||
Power: 'Power'
|
||||
Power: 'Power',
|
||||
StationTurnBack: 'StationTurnBack'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -110,6 +110,9 @@ class Status {
|
||||
handleLimitControl(device) {
|
||||
this.statusObj = { };
|
||||
}
|
||||
handleStationTurnBack(device) {
|
||||
this.statusObj = { };
|
||||
}
|
||||
getStatus() {
|
||||
return this.statusObj;
|
||||
}
|
||||
|
@ -224,7 +224,16 @@ export default class SaidLamp extends Group {
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
setControlColor(color) {
|
||||
setControlColor(color, flag) {
|
||||
this.control && this.control.getControl().stopAnimation(false);
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
// import {isShowThePrdType} from '../../utils/handlePath';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import Vue from 'vue';
|
||||
|
||||
export default class Station extends Group {
|
||||
constructor(model, style) {
|
||||
@ -319,6 +321,15 @@ export default class Station extends Group {
|
||||
if (!this.isShowShape) return;
|
||||
this.recover();
|
||||
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) {
|
||||
|
136
src/jmapNew/shape/StationTurnBack/index.js
Normal file
136
src/jmapNew/shape/StationTurnBack/index.js
Normal 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;
|
||||
// }
|
||||
}
|
||||
}
|
@ -349,10 +349,10 @@ export default class Switch extends Group {
|
||||
setSwitchFault(split) {
|
||||
if (this.model.switchFaultCode && split) {
|
||||
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
|
||||
switchFault.instance.setControlColor('#F00');
|
||||
switchFault.instance.setControlColor('#F00', true);
|
||||
} else if (this.model.switchFaultCode && !split) {
|
||||
const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode);
|
||||
switchFault.instance.setControlColor(this.style.backgroundColor);
|
||||
switchFault.instance.setControlColor(this.style.backgroundColor, false);
|
||||
}
|
||||
}
|
||||
/** 挤叉*/
|
||||
|
@ -12,16 +12,16 @@ export default class TrainHead extends Group {
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
const baseMargin = (model.drect === -1 ? 1 : 0);
|
||||
const baseMargin = (model.drect === -1 ? -1 : 0);
|
||||
if (style.Train.trainHead.trainConntWidth) {
|
||||
this.line = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
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,
|
||||
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: {
|
||||
lineWidth: 0.1,
|
||||
@ -31,12 +31,12 @@ export default class TrainHead extends Group {
|
||||
});
|
||||
this.add(this.line);
|
||||
}
|
||||
const height = model.height / 2;
|
||||
const startX = model.point.x + model.drect * (style.Train.trainHead.trainConntWidth * model.scale);
|
||||
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.trainHeadArrowOffsetX * model.scale);
|
||||
const points = [
|
||||
[startX + model.drect * 2 * model.scale, (model.point.y + height)],
|
||||
[startX + model.drect * -2 * model.scale, (model.point.y + height) + height],
|
||||
[startX + model.drect * -2 * model.scale, (model.point.y + height) - height]
|
||||
[startX + model.drect * style.Train.trainHead.trainHeadArrowWidth * model.scale, (model.point.y + height)],
|
||||
[startX, (model.point.y + height) + height],
|
||||
[startX, (model.point.y + height) - height]
|
||||
];
|
||||
this.arrow = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
|
@ -112,4 +112,5 @@ export default class EControl extends Group {
|
||||
this.text.setStyle('textFill', color);
|
||||
}
|
||||
}
|
||||
getControl() { return this.control; }
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import SaidLamp from './SaidLamp/index.js';
|
||||
import SplitStation from './SplitStation/index';
|
||||
import Arrow from './Arrow/index';
|
||||
import Power from './Power/index';
|
||||
import StationTurnBack from './StationTurnBack/index';
|
||||
|
||||
/** 图库*/
|
||||
const mapShape = {};
|
||||
@ -71,6 +72,7 @@ mapShape[deviceType.SwitchFault] = SaidLamp;
|
||||
mapShape[deviceType.SplitStation] = SplitStation;
|
||||
mapShape[deviceType.Arrow] = Arrow;
|
||||
mapShape[deviceType.Power] = Power;
|
||||
mapShape[deviceType.StationTurnBack] = StationTurnBack;
|
||||
|
||||
function shapefactory(device, jmap) {
|
||||
const type = device._type;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="foshan-01__systerm two-confirmation"
|
||||
title="二次确认"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
v-dialogDrag
|
||||
:before-close="doClose"
|
||||
:show-close="false"
|
||||
:z-index="2000"
|
||||
@ -32,6 +32,7 @@
|
||||
<script>
|
||||
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'TwoConfirmation',
|
||||
@ -90,11 +91,9 @@ export default {
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
@ -104,20 +103,21 @@ export default {
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
val: this.operate.val
|
||||
operation: this.operation,
|
||||
over: true
|
||||
};
|
||||
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.emergencyStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.emergencyStationControl.confirm.operation;
|
||||
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
|
||||
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL;
|
||||
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
|
||||
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
|
||||
} else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.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.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
|
@ -12,24 +12,31 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row> 集中站 </el-row>
|
||||
<el-form ref="form" :model="formModel" :rules="rules">
|
||||
|
||||
<el-row style="margin-bottom: 20px">
|
||||
<el-form-item prop="stationCode">
|
||||
<el-select
|
||||
:id="domIdChooseStation"
|
||||
v-model="stationCode"
|
||||
v-model="formModel.stationCode"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100%;"
|
||||
@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-form-item>
|
||||
</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-radio :label="item" @change="handleChooseChangeControl">
|
||||
<el-radio :label="item" :disabled="!controlModeList.includes(item)" @change="handleChooseChangeControl">
|
||||
{{ controlProps[item] }}</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button :id="domIdCommit" :disabled="disabledCommit" @click="handleCommit">设置</el-button>
|
||||
<el-button :id="domIdCancel" :disabled="disabledClose" style="margin-left: 200px" @click="cancel">退出
|
||||
@ -41,7 +48,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import TwoConfirmation from './childDialog/twoConfirmation';
|
||||
|
||||
export default {
|
||||
@ -50,18 +57,39 @@ export default {
|
||||
TwoConfirmation
|
||||
},
|
||||
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 {
|
||||
operate: null,
|
||||
dialogShow: false,
|
||||
disabledClose: false,
|
||||
disabledCommit: false,
|
||||
stationType: '01',
|
||||
controlModeList: [],
|
||||
formModel: {
|
||||
stationCode: '',
|
||||
stationType: ''
|
||||
},
|
||||
controlProps: {
|
||||
'03': '紧急站控',
|
||||
'02': '站控',
|
||||
'01': '遥控'
|
||||
}
|
||||
'Emergency': '紧急站控',
|
||||
'Local': '站控',
|
||||
'Center': '遥控'
|
||||
},
|
||||
rules: {
|
||||
stationCode: [
|
||||
{ required: true, message: '请选择集中站', trigger: 'change' },
|
||||
{ validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
stationType: [
|
||||
{required: true, message: '请选择控制模式', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
centralizedStationList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -83,30 +111,53 @@ export default {
|
||||
},
|
||||
domIdCommit() {
|
||||
if (this.dialogShow) {
|
||||
if (this.stationType == '01') {
|
||||
if (this.formModel.stationType === 'Center') {
|
||||
return OperationEvent.StationControl.requestCentralControl.menu.domId;
|
||||
} else if (this.stationType == '02') {
|
||||
} else if (this.formModel.stationType === 'Local') {
|
||||
return OperationEvent.StationControl.requestStationControl.menu.domId;
|
||||
} else if (this.stationType == '03') {
|
||||
} else if (this.formModel.stationType === 'Emergency') {
|
||||
return OperationEvent.StationControl.emergencyStationControl.menu.domId;
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.prdType': function (val) {
|
||||
this.initControlModeList(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initControlModeList(val) {
|
||||
if (val === '01') {
|
||||
this.controlModeList = ['Emergency', 'Local'];
|
||||
} else if (val === '02') {
|
||||
this.controlModeList = ['Center'];
|
||||
} else {
|
||||
this.controlModeList = [];
|
||||
}
|
||||
},
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
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.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
@ -128,20 +179,21 @@ export default {
|
||||
},
|
||||
handleChooseChangeStation() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.Command.order.choose1.operation,
|
||||
val: this.stationCode
|
||||
param: {
|
||||
stationCodes: [this.formModel.stationCode]
|
||||
}
|
||||
};
|
||||
|
||||
// if (this.stationType == '01') {
|
||||
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation
|
||||
// } else if (this.stationType == '02') {
|
||||
// operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation
|
||||
// } else if (this.stationType == '03') {
|
||||
// operate.operation = OperationEvent.StationControl.emergencyStationControl.choose1.operation
|
||||
// if (this.stationType === 'Center') {
|
||||
// operate.operation = OperationEvent.StationControl.requestCentralControl.choose1.operation;
|
||||
// } else if (this.stationType === 'Local') {
|
||||
// operate.operation = OperationEvent.StationControl.requestStationControl.choose1.operation;
|
||||
// } else if (this.stationType === 'Emergency') {
|
||||
// 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) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
@ -149,20 +201,9 @@ export default {
|
||||
},
|
||||
handleChooseChangeControl() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.Command.order.choose.operation,
|
||||
val: this.stationCode
|
||||
operation: OperationEvent.Command.order.choose.operation
|
||||
};
|
||||
|
||||
// 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 }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
@ -170,30 +211,33 @@ export default {
|
||||
},
|
||||
// 路由指令
|
||||
handleCommit() {
|
||||
if (this.stationType == '01') {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.formModel.stationType === 'Center') {
|
||||
// 请求遥控
|
||||
this.conterCommit();
|
||||
} else if (this.stationType == '02') {
|
||||
} else if (this.formModel.stationType === 'Local') {
|
||||
// 请求站控
|
||||
this.requestCommit();
|
||||
} else if (this.stationType == '03') {
|
||||
} else if (this.formModel.stationType === 'Emergency') {
|
||||
// 紧急站控
|
||||
this.emergencyCommit();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 请求遥控
|
||||
conterCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||
messages: ['确认将如下操作区域的控制模式由站控转为中控:'],
|
||||
val: `${this.stationCode}::`
|
||||
messages: ['确认将如下操作区域的控制模式由站控转为中控:']
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
@ -202,16 +246,15 @@ export default {
|
||||
// 请求站控
|
||||
requestCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
|
||||
val: `${this.stationCode}::`
|
||||
messages: ['确认将如下操作区域的控制模式由中控转为站控:']
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
@ -220,16 +263,15 @@ export default {
|
||||
// 紧急站控
|
||||
emergencyCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
|
||||
messages: ['确认将如下操作区域的控制模式由中控转为站控:'],
|
||||
val: `${this.stationCode}::`
|
||||
messages: ['确认将如下操作区域的控制模式由中控转为站控:']
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
|
@ -125,19 +125,19 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.hasOwnProperty('success')) {
|
||||
if (elem.success) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name
|
||||
};
|
||||
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
// if (elem && elem.hasOwnProperty('success')) {
|
||||
// if (elem.success) {
|
||||
// const operate = this.$store.state.training.operate;
|
||||
// const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
// const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
// const newOperate = {
|
||||
// type: operate.type,
|
||||
// name: station.name
|
||||
// };
|
||||
//
|
||||
// this.doShow(newOperate);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="foshan-01__systerm passive-control"
|
||||
title="控制模式请求"
|
||||
:title="$t('menu.passiveDialog.controlModeRequest')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
@ -11,7 +11,7 @@
|
||||
: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
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
@ -23,35 +23,35 @@
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" label="操作区域">
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</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-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-col>
|
||||
<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-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
@ -59,8 +59,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {getMemberInfo} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
@ -72,26 +74,28 @@ export default {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: '调度员1工作站',
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'01': '中控',
|
||||
'02': '站控'
|
||||
'Center': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'Local': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0
|
||||
timeout: 55,
|
||||
count: 0,
|
||||
sourceMemberId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
return 'Center';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02';
|
||||
return 'Local';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -114,9 +118,10 @@ export default {
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) {
|
||||
if (elem.stationControlCode) {
|
||||
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
|
||||
if (elem.params.stationCodes && elem.params.stationCodes.length) {
|
||||
this.doShow(elem);
|
||||
this.sourceMemberId = elem.sourceMemberId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -160,9 +165,9 @@ export default {
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
updateTableData(codes) {
|
||||
this.tableData = [];
|
||||
|
||||
(codes || []).forEach(code=> {
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
@ -174,29 +179,29 @@ export default {
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).state;
|
||||
const control = (device || {}).controlMode;
|
||||
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] };
|
||||
}
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
model.operate = device.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
});
|
||||
},
|
||||
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.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
this.updateTableData(msgHead.params.stationCodes);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
@ -213,29 +218,19 @@ export default {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
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) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const codeList = selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::')
|
||||
val: codeList.join('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -244,48 +239,67 @@ export default {
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox('请选择一条数据');
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
val: this.selection[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
send: true,
|
||||
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.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
val: this.tableData[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
send: true,
|
||||
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.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ export default {
|
||||
signalParamList: [
|
||||
{ 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_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_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_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_UNBLOCK, operate: OperationEvent.Signal.unlock.menu, show: false },
|
||||
@ -125,7 +125,8 @@ export default {
|
||||
],
|
||||
stationParamList: [
|
||||
{ name: '关站信号', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu, show: false } // 流程未处理
|
||||
]
|
||||
],
|
||||
ciStationParamList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -566,13 +566,13 @@ export default {
|
||||
minDuration: 8,
|
||||
operateType: 'Signal_Open_Auto_Setting',
|
||||
skinCode: '07',
|
||||
trainingName: '自排全开({5})',
|
||||
trainingRemark: '自排全开',
|
||||
trainingName: '自排单开({5})',
|
||||
trainingRemark: '自排单开',
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01'],
|
||||
stepVOList: [
|
||||
{ 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: '鼠标左键点击【执行】按钮' }
|
||||
]
|
||||
},
|
||||
|
@ -55,6 +55,7 @@ export default {
|
||||
doShow(messages) {
|
||||
this.dialogShow = true;
|
||||
this.messages = [this.$t('tip.commandFailed')];
|
||||
console.log(this.messages);
|
||||
if (messages && messages != 'null') {
|
||||
this.messages.push(messages);
|
||||
}
|
||||
|
@ -61,13 +61,12 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<!-- <confirm-control ref="confirmControl" /> -->
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
@ -76,7 +75,6 @@ import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'StandBackStrategy',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
@ -141,7 +139,23 @@ export default {
|
||||
const station = this.stationList.find(n => n.code == selected.stationCode);
|
||||
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) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standStatus = '';
|
||||
this.stationName = '';
|
||||
@ -160,6 +174,18 @@ export default {
|
||||
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) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
@ -175,21 +201,6 @@ export default {
|
||||
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() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
@ -197,6 +208,7 @@ export default {
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
this.loading = true;
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
|
179
src/jmapNew/theme/xian_01/menus/dialog/stationBackStrategy.vue
Normal file
179
src/jmapNew/theme/xian_01/menus/dialog/stationBackStrategy.vue
Normal 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>
|
@ -9,6 +9,7 @@
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
@ -26,6 +27,7 @@ import MenuSection from './menuSection';
|
||||
import MenuTrain from './menuTrain';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import MenuStationTurnBack from './menuStationTurnBack';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
@ -42,6 +44,7 @@ export default {
|
||||
MenuStation,
|
||||
MenuTrain,
|
||||
PassiveAlarm,
|
||||
MenuStationTurnBack,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
},
|
||||
|
112
src/jmapNew/theme/xian_01/menus/menuStationTurnBack.vue
Normal file
112
src/jmapNew/theme/xian_01/menus/menuStationTurnBack.vue
Normal 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>
|
@ -256,6 +256,7 @@ export const menuOperate = {
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
//
|
||||
},
|
||||
StationControl:{
|
||||
requestCentralControl:{
|
||||
@ -272,7 +273,12 @@ export const menuOperate = {
|
||||
// 紧急站控
|
||||
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
|
||||
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: {
|
||||
editTrainId: {
|
||||
|
@ -144,6 +144,10 @@ export function parser(data, skinCode, showConfig) {
|
||||
zrUtil.each(data.splitStationList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.SplitStation, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.tbStrategyList || [], elem => { // 站后折返按钮
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationTurnBack, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
zrUtil.each(data.arrowList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
@ -330,6 +334,7 @@ export function updateMapData(state, model) {
|
||||
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
|
||||
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
|
||||
case deviceType.StationTurnBack : updateForList(model, state, 'tbStrategyList'); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,6 +139,7 @@ const JsxtExamResult = () => import('@/views/jsxt/competition/result');
|
||||
const JsxtApply = () => import('@/views/jsxt/apply/index');
|
||||
// const theoryManage = () => import('@/views/jsxt/competition/theory/index');
|
||||
const RefereeList = () => import('@/views/jsxt/refereeList/index');
|
||||
const RefereeDisplay = () => import('@/views/jsxt/refereeList/display');
|
||||
|
||||
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
@ -304,6 +305,11 @@ export const publicAsyncRoute = [
|
||||
component: JointTraining,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/refereeJsxtDisplay',
|
||||
component: RefereeDisplay,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/jointTrainingNew',
|
||||
component: JointTrainingNew,
|
||||
|
@ -90,11 +90,13 @@ export default {
|
||||
roleTypeNew:[
|
||||
{label: '管理员', value: 'ADMIN', enLabel: 'Admin '},
|
||||
{label: '教员', value: 'Instructor', enLabel: 'Instructor '},
|
||||
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
|
||||
{label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '},
|
||||
{label: '观众', value: 'AUDIENCE', enLabel: 'Audience '},
|
||||
{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: [
|
||||
{ label: '实训', value: 'Training'},
|
||||
|
@ -107,6 +107,7 @@ export const DeviceMenu = {
|
||||
AutoTurnBack: '11',
|
||||
AxleReset: '12',
|
||||
Enabled: '13',
|
||||
StationTurnBack: '14',
|
||||
|
||||
Map: '100',
|
||||
PrdCategory: '101',
|
||||
|
@ -204,7 +204,9 @@ export default {
|
||||
/** 上电解锁 */
|
||||
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: '设置折返策略'}
|
||||
},
|
||||
|
||||
// 列车
|
||||
|
@ -1711,8 +1711,23 @@ export const OperationEvent = {
|
||||
operation: '609',
|
||||
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: {
|
||||
|
@ -364,6 +364,13 @@ const map = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
tbStrategyList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.tbStrategyList || [];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
axleCounterResetButtonList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.axleCounterResetButtonList || [];
|
||||
|
@ -38,8 +38,8 @@ function handle(state, data) {
|
||||
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
|
||||
state.quitCoversition = msg;
|
||||
break;
|
||||
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
|
||||
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
|
||||
case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
|
||||
state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
|
||||
break;
|
||||
case 'Simulation_Over': // 用户退出仿真推送消息
|
||||
state.simulationOver++; // 用户退出仿真推送消息
|
||||
@ -212,7 +212,7 @@ const socket = {
|
||||
simulationRoleList:[], // 设置仿真的聊天角色信息
|
||||
simulationScriptTip:{}, // 剧本推送提示信息
|
||||
scriptFinish:0, // 剧本执行完成提示信息
|
||||
competitionStart:0, // 竞赛裁判系统裁判开始考试推送消息
|
||||
playBackFinish:0, // 竞赛裁判系统裁判回放结束推送
|
||||
jointRoomPrepare: false, // 演练房间准备状态
|
||||
equipmentStatus: [], // 仿真-设备状态消息
|
||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||
|
@ -1,6 +1,6 @@
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
|
||||
import { getNewMapDataByGroup } from '@/api/simulation';
|
||||
import { getNewMapDataByGroup, getNewMapDataByMapId } from '@/api/simulation';
|
||||
|
||||
// 获取地图版本数据,和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) {
|
||||
return new Promise((resolve, reject) => {
|
||||
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 => {
|
||||
item.code = item.groupNumber;
|
||||
});
|
||||
@ -58,8 +77,5 @@ export function loadNewMapDataByGroup(group) {
|
||||
const mapConfig = resp.data.configVO;
|
||||
store.dispatch('map/setMapConfig', mapConfig);
|
||||
store.dispatch('map/setMapVersion', resp.data.version);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -145,6 +145,24 @@ export default {
|
||||
mode: 'bas',
|
||||
id: '25',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '电扶梯',
|
||||
mode: 'bas',
|
||||
id: '26',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '机电排水',
|
||||
mode: 'bas',
|
||||
id: '27',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '隧道通风',
|
||||
mode: 'bas',
|
||||
id: '28',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
133
src/views/iscs/iscsDraw/iscsBasOperate/draught.vue
Normal file
133
src/views/iscs/iscsDraw/iscsBasOperate/draught.vue
Normal 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>
|
132
src/views/iscs/iscsDraw/iscsBasOperate/electrically.vue
Normal file
132
src/views/iscs/iscsDraw/iscsBasOperate/electrically.vue
Normal 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>
|
132
src/views/iscs/iscsDraw/iscsBasOperate/elevator.vue
Normal file
132
src/views/iscs/iscsDraw/iscsBasOperate/elevator.vue
Normal 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>
|
@ -123,6 +123,14 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</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">
|
||||
<cistern
|
||||
ref="cistern"
|
||||
@ -131,6 +139,46 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</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">
|
||||
<lighting-group
|
||||
ref="lightingGroup"
|
||||
@ -139,6 +187,14 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="状态表" name="StateTable">
|
||||
<state-table
|
||||
ref="stateTable"
|
||||
style="width: 100%;height: 100%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="按钮" name="IscsButton">
|
||||
<iscs-button
|
||||
ref="iscsButton"
|
||||
@ -198,6 +254,13 @@ import LightingGroup from './lightingGroup';
|
||||
import BalancedElectric from './balancedElectric';
|
||||
import ElectricButterflyValve from './electricButterflyValve';
|
||||
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 {
|
||||
name: 'IscsOperate',
|
||||
@ -221,7 +284,14 @@ export default {
|
||||
LightingGroup,
|
||||
BalancedElectric,
|
||||
ElectricButterflyValve,
|
||||
Cistern
|
||||
Cistern,
|
||||
Escalator,
|
||||
Electrically,
|
||||
FasBrakeMachine,
|
||||
StateTable,
|
||||
Stairs,
|
||||
Elevator,
|
||||
Draught
|
||||
},
|
||||
mixins: [
|
||||
],
|
||||
|
132
src/views/iscs/iscsDraw/iscsBasOperate/stairs.vue
Normal file
132
src/views/iscs/iscsDraw/iscsBasOperate/stairs.vue
Normal 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>
|
@ -97,7 +97,7 @@ import IscsRect from '../iscsCommonElem/rect';
|
||||
import BrakeMachine from '../iscsAfcOperate/brakeMachine';
|
||||
import Staircase from '../iscsOperate/staircase';
|
||||
import SingleStaircase from './singleStaircase';
|
||||
import StateTable from '../iscsOperate/stateTable';
|
||||
import StateTable from '../iscsCommonElem/stateTable';
|
||||
export default {
|
||||
name: 'IscsOperate',
|
||||
components: {
|
||||
|
@ -56,7 +56,7 @@
|
||||
<el-table-column :key="i" :label="'列'+(i + 1)" :prop="'column'+ (i + 1)">
|
||||
<template slot-scope="scope">
|
||||
<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
|
||||
v-for="it in stateList"
|
||||
:key="it.value"
|
||||
@ -131,7 +131,17 @@ export default {
|
||||
{label: '解码器状态', value: 'decoderState'},
|
||||
{label: '四路解码器状态', value: 'quadDecoderState'},
|
||||
{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: {
|
||||
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],
|
@ -142,7 +142,7 @@ import IscsLine from '../iscsCommonElem/line';
|
||||
import IscsText from '../iscsCommonElem/text';
|
||||
import IscsRect from '../iscsCommonElem/rect';
|
||||
import IscsButton from '../iscsCommonElem/button';
|
||||
import StateTable from './stateTable';
|
||||
import StateTable from '../iscsCommonElem/stateTable';
|
||||
|
||||
export default {
|
||||
name: 'IscsOperate',
|
||||
|
37
src/views/iscs/iscsSystem/config/bas/electricEscalator.vue
Normal file
37
src/views/iscs/iscsSystem/config/bas/electricEscalator.vue
Normal 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>
|
@ -18,6 +18,18 @@ export default {
|
||||
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() {
|
||||
this.$refs.iscsPlate.show('24');
|
||||
},
|
||||
|
36
src/views/iscs/iscsSystem/config/bas/waterSupply.vue
Normal file
36
src/views/iscs/iscsSystem/config/bas/waterSupply.vue
Normal 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>
|
@ -74,6 +74,9 @@ export default {
|
||||
'$store.state.config.canvasSizeCount': function (val) {
|
||||
this.reSize();
|
||||
},
|
||||
widthCanvas() {
|
||||
this.reSize();
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length) {
|
||||
this.statusMessage(val);
|
||||
@ -95,12 +98,12 @@ export default {
|
||||
};
|
||||
this.iscsDestroy();
|
||||
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({
|
||||
dom: document.getElementById(this.iscsId),
|
||||
config: {
|
||||
renderer: 'canvas',
|
||||
width: this.canvasWidth,
|
||||
width: this.widthCanvas,
|
||||
height: this.canvasHeight
|
||||
},
|
||||
options: {
|
||||
@ -150,7 +153,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
// this.width = this.$store.state.config.width;
|
||||
// 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() {
|
||||
|
@ -14,8 +14,9 @@
|
||||
<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 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="8"><div style="width: 100%; background: #FFF;">{{ deviceType }}</div></el-col>
|
||||
<el-col :span="6"><div style="width: 100%; background: #FFF;">{{ stationName }}</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|| ' ' }}</div></el-col>
|
||||
</el-row>
|
||||
<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>
|
||||
@ -92,11 +93,20 @@ export default {
|
||||
modeName: '',
|
||||
status: '',
|
||||
operation: 'home',
|
||||
deviceCode: '',
|
||||
deviceMap: {
|
||||
ManualAlarmButton:'手动报警按钮',
|
||||
SmokeDetector: '消火栓按钮',
|
||||
FireHydranAlarmButton: '点型火灾探测器',
|
||||
GasFireControl:'气体灭火控制器'
|
||||
GasFireControl:'气体灭火控制器',
|
||||
LightingGroup: '照明',
|
||||
Electrically: '',
|
||||
VolumeControlDamper: '电动风阀',
|
||||
SmookExhaustFd: '排烟防火阀',
|
||||
Ventilator: '普通风机',
|
||||
AirConditioner: '组合式空调机组',
|
||||
FireDamper: '防火阀',
|
||||
SmookProofFd: '防烟防火阀'
|
||||
},
|
||||
modeMap: {
|
||||
standFAS: '火灾报警',
|
||||
@ -142,10 +152,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(device) {
|
||||
this.deviceCode = '';
|
||||
this.deviceType = this.deviceMap[device._type];
|
||||
this.modeName = this.modeMap[this.$route.params.mode];
|
||||
this.stationName = this.$route.query.stationName;
|
||||
this.dialogShow = true;
|
||||
if (device._type === 'LightingGroup') {
|
||||
this.deviceCode = device.topContext.split(/[(\r\n)\r\n]+/)[0];
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
|
@ -23,10 +23,15 @@ export default {
|
||||
const device = this.$store.state.iscs.selected;
|
||||
if (device && device._type === 'IscsButton' && device.function === 'PublicArea') {
|
||||
this.width = 1520;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.iscsPlate.show('12');
|
||||
});
|
||||
console.log(this.width);
|
||||
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
|
||||
this.width = 1100;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.iscsPlate.show('14');
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -45,6 +45,21 @@ export default {
|
||||
{graphicEle: 'smokeDetector', 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: {
|
||||
manualAlarm: ManualAlarm,
|
||||
fireHydrant: FireHydrant,
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div style="height: 100%; width: 100%;overflow-y: auto;">
|
||||
<standFAS v-if="mode == 'standFAS'" />
|
||||
<stationHallFAS v-else-if="mode == 'stationHallFAS'" />
|
||||
<systemFAS v-else-if="mode == 'systemFAS'" />
|
||||
<standFAS v-if="mode === 'standFAS'" />
|
||||
<stationHallFAS v-else-if="mode === 'stationHallFAS'" />
|
||||
<systemFAS v-else-if="mode === 'systemFAS'" />
|
||||
<home-screen v-else-if="mode === 'mainScreenPA'" />
|
||||
<main-screen v-else-if="mode === 'MainScreen'" />
|
||||
<lcd-control v-else-if="mode === 'LCDcontrol'" />
|
||||
@ -28,6 +28,8 @@
|
||||
<small-system v-else-if="mode==='smallSystem'" />
|
||||
<water-system v-else-if="mode==='waterSystem'" />
|
||||
<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" />
|
||||
<device-control ref="deviceControl" />
|
||||
</div>
|
||||
@ -64,6 +66,8 @@ import waterSystem from './bas/waterSystem';
|
||||
import LightingSystem from './bas/lightingSystem';
|
||||
import GraphicEle from './graphicEle';
|
||||
import DeviceControl from './deviceControl';
|
||||
import ElectricEscalator from './bas/electricEscalator';
|
||||
import WaterSupply from './bas/waterSupply';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -96,12 +100,27 @@ export default {
|
||||
SmallSystem,
|
||||
BigSystem,
|
||||
waterSystem,
|
||||
LightingSystem
|
||||
LightingSystem,
|
||||
ElectricEscalator,
|
||||
WaterSupply
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mode: 'standFAS',
|
||||
deviceList: ['ManualAlarmButton', 'SmokeDetector', 'FireHydranAlarmButton', 'GasFireControl']
|
||||
deviceList: [
|
||||
'ManualAlarmButton',
|
||||
'SmokeDetector',
|
||||
'FireHydranAlarmButton',
|
||||
'GasFireControl',
|
||||
'LightingGroup',
|
||||
'Electrically',
|
||||
'VolumeControlDamper',
|
||||
'SmookExhaustFd',
|
||||
'Ventilator',
|
||||
'AirConditioner',
|
||||
'FireDamper',
|
||||
'SmookProofFd'
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -110,9 +129,10 @@ export default {
|
||||
},
|
||||
'$store.state.iscs.selectedCount': function() {
|
||||
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();
|
||||
} else if (this.deviceList.includes(device._type)) {
|
||||
} else if (device && this.deviceList.includes(device._type)) {
|
||||
this.$refs.deviceControl.doShow(device);
|
||||
}
|
||||
}
|
||||
|
@ -139,6 +139,7 @@ export default {
|
||||
if (this.selected && this.selected.code) {
|
||||
switch (hook) {
|
||||
case 'Ctrl_C': {
|
||||
if (this.selected._type != "CheckBox") {
|
||||
this.copyModel = deepAssign({}, this.selected);
|
||||
this.copyModel.point = {
|
||||
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()
|
||||
this.copyModel.code = getUID(this.selected._type, this.iscs[type1 + 'List'] || []);
|
||||
} else {
|
||||
this.copyModel = {}
|
||||
}
|
||||
} break;
|
||||
case 'Ctrl_V':
|
||||
this.copyModel.code && this.createDataModel(this.copyModel);
|
||||
|
@ -58,7 +58,7 @@
|
||||
<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%;margin-top: 25px;">
|
||||
<div class="apply_box_title">报名成功!:<br> 您的赛事信息如下:
|
||||
<div class="apply_box_title">报名成功!<br> 您的赛事信息如下:
|
||||
<br>竞赛名称:{{ compition.name }}
|
||||
<br>竞赛时间:{{ compition.startDate }}
|
||||
<br>姓名:{{ formModel.name }}
|
||||
@ -85,7 +85,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template></div></template>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
|
||||
</div>
|
||||
<div class="context">
|
||||
<div>{{ `得分:${operateScore}分` }}</div>
|
||||
<!--<div>{{ `得分:${operateScoreData}分` }}</div>-->
|
||||
<!-- <el-form ref="form" :model="resultModel" size="mini">
|
||||
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
|
||||
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
|
||||
@ -13,14 +13,11 @@
|
||||
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
<!--<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">-->
|
||||
<!--<el-table-column prop="title" label="题目">-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<div v-html="scope.row.title" />-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>>-->
|
||||
<!--<el-table-column prop="score" label="分值" />-->
|
||||
<!--<el-table-column prop="goal" label="得分" />-->
|
||||
<el-table :data="operateScoreData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
|
||||
<el-table-column prop="name" label="题目" />
|
||||
<el-table-column prop="description" label="描述" />
|
||||
<el-table-column prop="totalScore" label="分值" />
|
||||
<el-table-column prop="score" 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 ==='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="scoringPointGoal" label="得分点得分" />-->
|
||||
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
|
||||
<!--</el-table>-->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="draf_box">
|
||||
<el-button type="primary " @click="back">返回首页</el-button>
|
||||
@ -71,7 +68,7 @@ export default {
|
||||
],
|
||||
loading: true,
|
||||
tableData: [],
|
||||
operateScore: 0
|
||||
operateScoreData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -91,7 +88,7 @@ export default {
|
||||
sums[index] = this.$t('exam.totalScore');
|
||||
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]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
@ -128,7 +125,7 @@ export default {
|
||||
} else if (this.$route.query.type == 'operate') {
|
||||
this.tableData = [];
|
||||
getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
|
||||
this.operateScore = res.data;
|
||||
this.operateScoreData = res.data;
|
||||
});
|
||||
// this.operateData.forEach(item => {
|
||||
// if (item.scoringPoints && item.scoringPoints.length) {
|
||||
|
@ -115,18 +115,18 @@ export default {
|
||||
el.answer = this.theoryAnswersMap[el.id];
|
||||
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 startTime = localStore.get(storeKey);
|
||||
|
||||
if (startTime) {
|
||||
const dt = new Date().getTime() - startTime;
|
||||
this.theoryExamTime = resp.data.theoryExamTime * 60 - Math.floor(dt / 1000);
|
||||
} else {
|
||||
this.theoryExamTime = resp.data.theoryExamTime * 60;
|
||||
const storeValue = new Date().getTime();
|
||||
localStore.set(storeKey, storeValue);
|
||||
}
|
||||
this.countdownTime = this.computationTime(this.theoryExamTime);
|
||||
|
||||
this.countdown = setInterval(() => {
|
||||
if (this.theoryExamTime <= 0) {
|
||||
if (this.countdown) {
|
||||
@ -184,6 +184,8 @@ export default {
|
||||
theoryAnswers: theoryAnswers
|
||||
};
|
||||
postCompetitionTheory(params).then(()=>{
|
||||
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
|
||||
localStore.remove(storeKey);
|
||||
this.$router.push({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
|
||||
});
|
||||
},
|
||||
@ -203,13 +205,19 @@ export default {
|
||||
const newTime = time % 3600;
|
||||
let minutes = Math.floor(newTime / 60) + '';
|
||||
let seconds = newTime % 60;
|
||||
if (hours < 10) {
|
||||
if (hours < 0) {
|
||||
hours = '00';
|
||||
} else if (hours < 10) {
|
||||
hours = '0' + hours;
|
||||
}
|
||||
if (minutes < 10) {
|
||||
if (minutes < 0) {
|
||||
minutes = '00';
|
||||
} else if (minutes < 10) {
|
||||
minutes = '0' + minutes;
|
||||
}
|
||||
if (seconds < 10) {
|
||||
if (seconds < 0) {
|
||||
seconds = '00';
|
||||
} else if (seconds < 10) {
|
||||
seconds = '0' + seconds;
|
||||
}
|
||||
return hours + ':' + minutes + ':' + seconds;
|
||||
|
285
src/views/jsxt/refereeList/display.vue
Normal file
285
src/views/jsxt/refereeList/display.vue
Normal 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>
|
@ -1,18 +1,23 @@
|
||||
<template>
|
||||
<div class="refereeList">
|
||||
<div class="raceName">{{ raceName }}竞赛</div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit-score ref="editScore" />
|
||||
<theory-result ref="theoryResult" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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 TheoryResult from './theoryResult';
|
||||
|
||||
export default {
|
||||
name: 'RefereeList',
|
||||
components:{
|
||||
editScore
|
||||
editScore,
|
||||
TheoryResult
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -42,15 +47,18 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: '名字',
|
||||
prop: 'name'
|
||||
prop: 'name',
|
||||
width:200
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
prop: 'mobile'
|
||||
prop: 'mobile',
|
||||
width:140
|
||||
},
|
||||
{
|
||||
title: '公司',
|
||||
prop: 'organization'
|
||||
prop: 'organization',
|
||||
width:180
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
@ -58,11 +66,13 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '报名时间',
|
||||
prop: 'time'
|
||||
prop: 'time',
|
||||
width:180
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
width:100,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.covertStatus(row.status); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
@ -70,20 +80,23 @@ export default {
|
||||
{
|
||||
title: '理论分数',
|
||||
prop: 'theoryScore',
|
||||
width:100,
|
||||
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'; }
|
||||
},
|
||||
{
|
||||
title: '实操分数',
|
||||
prop: 'practiceScore',
|
||||
width:100,
|
||||
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'; }
|
||||
},
|
||||
{
|
||||
title: '总分',
|
||||
prop: 'totalScore'
|
||||
prop: 'totalScore',
|
||||
width:100
|
||||
},
|
||||
// {
|
||||
// title: '竞赛名称',
|
||||
@ -106,13 +119,13 @@ export default {
|
||||
name: '理论结果',
|
||||
handleClick: this.handleTheoryResult,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '5'; }
|
||||
showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; }
|
||||
},
|
||||
{
|
||||
name: '实操回放',
|
||||
handleClick: this.playBack,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '4'; }
|
||||
showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; }
|
||||
},
|
||||
{
|
||||
name: '修改',
|
||||
@ -128,7 +141,9 @@ export default {
|
||||
]
|
||||
},
|
||||
isLeaving:false,
|
||||
inter:null
|
||||
inter:null,
|
||||
mapId:'',
|
||||
raceName:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -137,6 +152,10 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
getRaceById(this.$route.query.raceId).then(res=>{
|
||||
this.mapId = res.data.mapId;
|
||||
this.raceName = res.data.name;
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.isLeaving = true;
|
||||
@ -160,8 +179,20 @@ export default {
|
||||
}, 2000);
|
||||
});
|
||||
},
|
||||
handleTheoryResult() {
|
||||
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
|
||||
handleTheoryResult(index, row) {
|
||||
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() {
|
||||
const loading = this.$loading({
|
||||
@ -201,12 +232,26 @@ export default {
|
||||
},
|
||||
handleClick(index, row) {
|
||||
const group = row.group;
|
||||
getPublishMapInfo(this.mapId).then(resp=>{
|
||||
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});
|
||||
});
|
||||
});
|
||||
},
|
||||
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) { // 裁判打分
|
||||
this.$refs.editScore.doShow(row);
|
||||
@ -221,4 +266,11 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.raceName{
|
||||
padding: 15px 0px;
|
||||
font-size: 18px;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
color: #409eff;
|
||||
}
|
||||
</style>
|
||||
|
204
src/views/jsxt/refereeList/menuReplay.vue
Normal file
204
src/views/jsxt/refereeList/menuReplay.vue
Normal 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>
|
81
src/views/jsxt/refereeList/theoryResult.vue
Normal file
81
src/views/jsxt/refereeList/theoryResult.vue
Normal 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>
|
@ -176,7 +176,7 @@ export default {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
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() {
|
||||
this.$nextTick(() => {
|
||||
|
@ -125,7 +125,7 @@ export default {
|
||||
'$store.state.map.mapViewLoadedCount':function(val) {
|
||||
const object = document.querySelector('.menuButton');
|
||||
if (object) {
|
||||
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
|
||||
const objectBottom = parseInt(object.style.bottom) || 0;
|
||||
this.bottom = this.bottom + object.offsetHeight + objectBottom;
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,6 @@ export default {
|
||||
drivingShow: false,
|
||||
deviceShow: false,
|
||||
questId: 0, // 加载任务的Id
|
||||
group: '',
|
||||
showStation: '',
|
||||
stationList: [],
|
||||
showSelectStation: false, // 是否展示现地选择设备集中站select
|
||||
@ -256,6 +255,9 @@ export default {
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userRole() {
|
||||
if (this.$route.query.prdType == '02') {
|
||||
return 'DISPATCHER';
|
||||
@ -327,7 +329,6 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
this.mode = this.$route.params.mode;
|
||||
this.group = this.$route.query.group || '';
|
||||
},
|
||||
async mounted() {
|
||||
EventBus.$on('clearCheckLogin', () => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!-- v-quickMenuDrag -->
|
||||
<div class="chatBox" :style="{'bottom':bottom+'px'}">
|
||||
<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">
|
||||
<chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
|
||||
<div class="chat-window">
|
||||
@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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 id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
||||
<div class="record_icon" />
|
||||
@ -56,6 +56,7 @@ import ChatCreateGroup from './chatCreateGroup';
|
||||
import ChatTooltip from './chatTooltip';
|
||||
import RecordRTC from 'recordrtc';
|
||||
import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
export default {
|
||||
name: 'ChatBox',
|
||||
components:{
|
||||
@ -92,7 +93,7 @@ export default {
|
||||
language:'zh',
|
||||
sex:'1'
|
||||
},
|
||||
headerTitle:'所有人'
|
||||
headerTitle:''
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -101,13 +102,16 @@ export default {
|
||||
},
|
||||
isButtonShow() {
|
||||
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.mapViewLoadedCount':function(val) {
|
||||
const object = document.querySelector('.menuButton');
|
||||
if (object) {
|
||||
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
|
||||
const objectBottom = parseInt(object.style.bottom) || 0;
|
||||
this.bottom = this.bottom + object.offsetHeight + objectBottom;
|
||||
}
|
||||
}
|
||||
@ -133,7 +137,7 @@ export default {
|
||||
this.$refs.chatCoversitionList.initPage(false);
|
||||
},
|
||||
setCurrentCoversition(coversition) {
|
||||
if (coversition.id) {
|
||||
if (coversition && coversition.id) {
|
||||
this.currentCoversition = coversition;
|
||||
this.headerTitle = coversition.name;
|
||||
} else {
|
||||
|
@ -26,11 +26,16 @@
|
||||
import {getSimulationContextListNew} from '@/api/chat';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export default {
|
||||
props:{
|
||||
currentCoversition:{
|
||||
type:Object,
|
||||
required:true
|
||||
},
|
||||
project:{
|
||||
type:String,
|
||||
required:true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -61,7 +66,7 @@ export default {
|
||||
}
|
||||
this.scrollTop();
|
||||
} else {
|
||||
debugger;
|
||||
// debugger;
|
||||
if (!simulationText.all) {
|
||||
this.$emit('changeCoversition', simulationText);
|
||||
// this.$emit('addCoversition', {data:simulationText, headerTitle:''});
|
||||
@ -73,7 +78,12 @@ export default {
|
||||
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();
|
||||
},
|
||||
currentCoversition:function (val, old) {
|
||||
if (val) {
|
||||
if (val && this.project != 'refereeJsxt') {
|
||||
this.chatContentList = [];
|
||||
this.coversition = this.currentCoversition;
|
||||
this.inintData();
|
||||
|
@ -7,7 +7,18 @@
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<map-system-draft ref="mapCanvas" @back="back" />
|
||||
</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
|
||||
ref="menuSchema"
|
||||
:group="group"
|
||||
@ -27,6 +38,7 @@
|
||||
<join-run-plan-view ref="runPlanView" :group="group" />
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
||||
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
||||
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -36,6 +48,7 @@
|
||||
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||
import MenuDemonJoint from './menuDemon';
|
||||
import MenuDemonSchema from './menuSchema';
|
||||
import JsQuestion from './jsQuestion';
|
||||
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
|
||||
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
|
||||
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
|
||||
@ -48,7 +61,7 @@ import { checkLoginLine } from '@/api/login';
|
||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
|
||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
import {getRaceUserById} from '@/api/competition';
|
||||
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
|
||||
@ -57,6 +70,7 @@ import ibpData from '@/ibp/constant/ibpData';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { Message } from 'element-ui';
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'JointTrainingDraft',
|
||||
@ -71,7 +85,8 @@ export default {
|
||||
menuSystemTime,
|
||||
Jl3dDrive,
|
||||
Jl3dMaintainer,
|
||||
IbpPlate
|
||||
IbpPlate,
|
||||
JsQuestion
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -98,7 +113,12 @@ export default {
|
||||
stationList: [],
|
||||
showSelectStation: false,
|
||||
mapViewLoadedOver: false,
|
||||
dataError: false
|
||||
dataError: false,
|
||||
countdownTime: '00:00:00',
|
||||
practicalTime: 0,
|
||||
countdown: null,
|
||||
questionList: [],
|
||||
practicalExamTime: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -209,6 +229,9 @@ export default {
|
||||
await this.$store.dispatch('training/reset');
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
await this.$store.dispatch('training/setGroup', '');
|
||||
if (this.countdown) {
|
||||
clearInterval(this.countdown);
|
||||
}
|
||||
Message.closeAll();
|
||||
},
|
||||
methods: {
|
||||
@ -367,6 +390,23 @@ export default {
|
||||
if (this.project == 'jsxt' ) {
|
||||
resp = await getRaceUserById(this.$route.query.raceId);
|
||||
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') {
|
||||
resp['code'] = 200;
|
||||
resp.data['userRole'] = 'ADMIN';
|
||||
@ -395,6 +435,24 @@ export default {
|
||||
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() {
|
||||
try {
|
||||
await loadNewMapDataByGroup(this.group);
|
||||
@ -419,6 +477,28 @@ export default {
|
||||
faultChooseShow() {
|
||||
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() {
|
||||
this.panelShow = true;
|
||||
this.drivingShow = false;
|
||||
|
94
src/views/newMap/jointTrainingNew/jsQuestion.vue
Normal file
94
src/views/newMap/jointTrainingNew/jsQuestion.vue
Normal 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>
|
||||
|
@ -12,6 +12,7 @@
|
||||
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
|
||||
</el-button-group>
|
||||
<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="danger" @click="endCompetition">提交</el-button>
|
||||
</template>
|
||||
@ -34,8 +35,9 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
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 localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'MenuDemonJoint',
|
||||
@ -56,6 +58,10 @@ export default {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
countdownTime: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
deviceCode: {
|
||||
type: String,
|
||||
default() {
|
||||
@ -127,11 +133,6 @@ export default {
|
||||
'$store.state.map.runPlanStatus': function (val) {
|
||||
this.isDisable = val;
|
||||
},
|
||||
// '$store.state.socket.competitionStart':function(val) {
|
||||
// if (val) {
|
||||
// this.startCompetition();
|
||||
// }
|
||||
// },
|
||||
'$store.state.socket.simulationOver':function(val) {
|
||||
if (val && this.project === 'refereeJsxt') {
|
||||
this.$router.go(-1);
|
||||
@ -315,6 +316,7 @@ export default {
|
||||
},
|
||||
startCompetition() {
|
||||
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
||||
this.$emit('startCounting');
|
||||
this.jsStart = false;
|
||||
}).catch(()=> {
|
||||
this.$message.error('开始竞赛失败');
|
||||
@ -326,12 +328,7 @@ export default {
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
||||
// this.$router.go(-1);
|
||||
this.submit();
|
||||
}).catch(()=> {
|
||||
this.$message.error('提交试卷失败!');
|
||||
});
|
||||
});
|
||||
},
|
||||
refeeEndCompetition() {
|
||||
@ -343,10 +340,13 @@ export default {
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
// this.$store.dispatch('exam/over').then(() => {
|
||||
// this.$store.dispatch('trainingList/clearTrainingList');
|
||||
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
||||
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 } });
|
||||
// });
|
||||
}).catch(()=> {
|
||||
this.$message.error('提交试卷失败!');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,7 +3,51 @@
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<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>
|
||||
</div>
|
||||
<div class="button_box">
|
||||
@ -55,18 +99,36 @@ export default {
|
||||
activeName: 'first',
|
||||
lazy: true,
|
||||
autoList: [],
|
||||
field: '',
|
||||
turnBackList: [
|
||||
{ name: '按计划执行', value: 'NONE' },
|
||||
{ name: '仅某个折返轨', value: 'ONLY' },
|
||||
{ name: '等价折返', value: 'EQUAL' },
|
||||
{ name: '优先/次之', value: 'FIRST' }
|
||||
],
|
||||
typeList: [
|
||||
{ name: '自动折返', value: 'AutoTurnBack' },
|
||||
{ name: '计轴复位', value: 'AxleReset' },
|
||||
{ name: '自动进路', value: 'AutomaticRoute' },
|
||||
{ name: '引导总锁', value: 'GuideLock' },
|
||||
{ name: '全线临时限速', value: 'LimitControl' }
|
||||
{ name: '全线临时限速', value: 'LimitControl' },
|
||||
{ name: '站后折返', value: 'StationTurnBack' }
|
||||
],
|
||||
cardMode: 'generate',
|
||||
addBackModel: {
|
||||
id: '',
|
||||
type: '',
|
||||
label: '',
|
||||
sectionList: [],
|
||||
parentIndex: 0
|
||||
},
|
||||
editModel: {
|
||||
code: '',
|
||||
type: '',
|
||||
name: '',
|
||||
show: true, // 站后折返显示
|
||||
subtitleName: '',
|
||||
optionList: [], // 战后折返列表
|
||||
automaticRouteCode: '', // 关联自动进路code
|
||||
cycleCode: '', // 自动折返关联code
|
||||
stationCode: '', // 所属设备集中站
|
||||
@ -101,6 +163,17 @@ export default {
|
||||
'position.y': [
|
||||
{ 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',
|
||||
'axleCounterResetButtonList',
|
||||
'totalGuideLockButtonVOList',
|
||||
'stationList'
|
||||
'stationList',
|
||||
'sectionList',
|
||||
'tbStrategyList'
|
||||
]),
|
||||
cardTitle() {
|
||||
if (this.cardMode === 'generate') {
|
||||
return '生成数据';
|
||||
} else if (this.cardMode === 'edit') {
|
||||
return '编辑数据';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
@ -124,17 +208,18 @@ export default {
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
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: '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.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:'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:'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:'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;
|
||||
@ -180,11 +265,17 @@ export default {
|
||||
isHiddenMapCycleButtonVO() {
|
||||
return this.editModel.type == 'AutoTurnBack';
|
||||
},
|
||||
isTurnBackShow() {
|
||||
return this.editModel.type == 'StationTurnBack';
|
||||
},
|
||||
isHiddensubtitleNameVO() {
|
||||
return this.editModel.type != 'StationTurnBack';
|
||||
},
|
||||
isDisabledStation() {
|
||||
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute';
|
||||
},
|
||||
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() {
|
||||
@ -197,17 +288,9 @@ export default {
|
||||
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
|
||||
},
|
||||
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() {
|
||||
},
|
||||
methods: {
|
||||
@ -219,13 +302,33 @@ export default {
|
||||
this.changeEditStation(data.cycleCode);
|
||||
}
|
||||
},
|
||||
typeChange(type) { // 根据类型来选择功能按钮列表
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
this.$refs.make && this.$refs.make.resetFields();
|
||||
clearInfo() {
|
||||
this.addModel.automaticRouteCode = '';
|
||||
this.addModel.cycleCode = '';
|
||||
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);
|
||||
},
|
||||
handleTypes(type) {
|
||||
@ -247,6 +350,9 @@ export default {
|
||||
case 'GuideLock':
|
||||
this.selectLists = this.totalGuideLockButtonVOList;
|
||||
break;
|
||||
case 'StationTurnBack':
|
||||
this.selectLists = this.tbStrategyList;
|
||||
break;
|
||||
}
|
||||
},
|
||||
changeStation(code) { // 选择对应的所属设备集中站
|
||||
@ -271,16 +377,20 @@ export default {
|
||||
this.getAutoMaticList();
|
||||
},
|
||||
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.$refs.dataform && this.$refs.dataform.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.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.type = selected._type;
|
||||
this.$nextTick(() => {
|
||||
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() { // 获取自动信号列表
|
||||
@ -317,10 +427,12 @@ export default {
|
||||
code: uid,
|
||||
name: this.addModel.name,
|
||||
subtitleName: this.addModel.subtitleName,
|
||||
show: true,
|
||||
position: {
|
||||
x: this.addModel.position.x,
|
||||
y: this.addModel.position.y
|
||||
},
|
||||
optionList: [],
|
||||
automaticRouteCode: this.addModel.automaticRouteCode, // 关联自动进路code
|
||||
cycleCode: this.addModel.cycleCode, // 自动折返关联code
|
||||
stationCode: this.addModel.stationCode // 所属设备集中站
|
||||
@ -354,6 +466,62 @@ export default {
|
||||
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 {
|
||||
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>
|
||||
|
@ -174,6 +174,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</template>
|
||||
<slot />
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
|
@ -270,6 +270,7 @@
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<slot />
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
|
@ -106,6 +106,7 @@
|
||||
:selected="selected"
|
||||
@updateMapModel="updateMapModel"
|
||||
@setCenter="setCenter"
|
||||
@selectFiled="selectFiled"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.saidLamp')" class="tab_pane_box" name="ControlLamp" :lazy="lazy">
|
||||
@ -285,6 +286,7 @@ export default {
|
||||
switchType: '',
|
||||
stationStandType:'',
|
||||
psdType: '',
|
||||
controlType: '',
|
||||
ViewMode: ViewMode,
|
||||
enabledTab: 'Section',
|
||||
autoSaveTask: null,
|
||||
@ -351,7 +353,7 @@ export default {
|
||||
this.enabledTab = 'Esp';
|
||||
} else if (this.feild) {
|
||||
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';
|
||||
} else if (controlLampTypeList.includes(type) || this.saidLampType) {
|
||||
this.enabledTab = 'ControlLamp';
|
||||
@ -359,6 +361,9 @@ export default {
|
||||
this.enabledTab = type;
|
||||
}
|
||||
},
|
||||
selectFiled(type) {
|
||||
this.controlType = type;
|
||||
},
|
||||
esqTab(type) {
|
||||
this.esqType = type;
|
||||
},
|
||||
|
@ -75,7 +75,7 @@ import Vue from 'vue';
|
||||
import Cookies from 'js-cookie';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
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 {
|
||||
name: 'AddAction',
|
||||
components:{
|
||||
@ -451,6 +451,23 @@ export default {
|
||||
|
||||
} else {
|
||||
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=>{
|
||||
this.modifying = false;
|
||||
this.isNotModify = true;
|
||||
@ -466,6 +483,8 @@ export default {
|
||||
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
|
@ -20,7 +20,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<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> -->
|
||||
</div>
|
||||
</el-card>
|
||||
@ -158,8 +158,8 @@ export default {
|
||||
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
|
||||
// });
|
||||
// memberVOList = JSON.parse(memberVOList);
|
||||
const lastData = JSON.stringify(response.data);
|
||||
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
const lastData = JSON.stringify(response.data.memberVOList);
|
||||
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
|
||||
|
||||
const actionList = response.data.actionVOList;
|
||||
|
||||
@ -218,11 +218,9 @@ export default {
|
||||
this.loadInitData();
|
||||
},
|
||||
modifyAction(row) {
|
||||
if (!this.drawWay) {
|
||||
this.$emit('setAction', row);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user