Merge remote-tracking branch 'remotes/origin/dev' into test
# Conflicts: # src/utils/baseUrl.js
This commit is contained in:
commit
4e7db47748
@ -72,9 +72,24 @@ export function queryRunPlan(planId) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运行图
|
||||
*/
|
||||
// 根据skinCode查询发布运行图列表
|
||||
export function queryRunPlanList(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/template/skin/${skinCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 从发布运行图创建新运行图
|
||||
export function postCreatePlan(data) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/createFrom/${data.templateId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除运行图
|
||||
export function deleteRunPlan(planId) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${planId}`,
|
||||
@ -82,6 +97,15 @@ export function deleteRunPlan(planId) {
|
||||
});
|
||||
}
|
||||
|
||||
// 修改运行图内容
|
||||
export function putRunPlanDetail(data) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${data.planId}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布运行图
|
||||
*/
|
||||
@ -204,15 +228,6 @@ export function duplicateService(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改计划*/
|
||||
// export function updatePlanService(data) {
|
||||
// return request({
|
||||
// url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}`,
|
||||
// method: 'put',
|
||||
// data: data
|
||||
// })
|
||||
// }
|
||||
|
||||
/** 增加任务*/
|
||||
export function addPlanTrip(data) {
|
||||
return request({
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 13 MiB After Width: | Height: | Size: 7.6 KiB |
@ -56,5 +56,6 @@ export default {
|
||||
userTrainingManage: 'User training management',
|
||||
userExamManage: 'User examination management',
|
||||
userSimulationManage: 'User simulation management',
|
||||
existingSimulation: 'Existence simulation management'
|
||||
existingSimulation: 'Existence simulation management',
|
||||
ibpDraw: 'ibp Draw'
|
||||
};
|
||||
|
@ -1,22 +1,26 @@
|
||||
export default {
|
||||
scriptTitle: '任务录制',
|
||||
saveMaplocation: '更新定位',
|
||||
scriptTitle: '剧本录制',
|
||||
// saveMaplocation: '更新定位',
|
||||
saveBackground: '保存背景',
|
||||
saveData: '保存数据',
|
||||
roleManage: '角色管理',
|
||||
targetCondition: '任务目标',
|
||||
taskScript: '任务剧本',
|
||||
roleName: '角色名称',
|
||||
roleType: '角色类型',
|
||||
deviceCode: '设备编码',
|
||||
roleList: '角色列表',
|
||||
operation: '操作',
|
||||
roleAdd: '添加',
|
||||
delete: '删除',
|
||||
behaviorOperate: '行为操作',
|
||||
conditionTitle: '目标条件',
|
||||
deviceType: '设备类型',
|
||||
deviceCondition: '设备条件',
|
||||
paramDeviceType: '参数设备类型',
|
||||
paramDeviceCode: '参数设备编号'
|
||||
mapList: '地图列表',
|
||||
createScript: '创建剧本',
|
||||
scriptName: '剧本名称',
|
||||
|
||||
// roleManage: '角色管理',
|
||||
// targetCondition: '任务目标',
|
||||
// taskScript: '任务剧本',
|
||||
// roleName: '角色名称',
|
||||
// roleType: '角色类型',
|
||||
// deviceCode: '设备编码',
|
||||
// roleList: '角色列表',
|
||||
// operation: '操作',
|
||||
// roleAdd: '添加',
|
||||
// delete: '删除',
|
||||
// behaviorOperate: '行为操作',
|
||||
// conditionTitle: '目标条件',
|
||||
// deviceType: '设备类型',
|
||||
// deviceCondition: '设备条件',
|
||||
// paramDeviceType: '参数设备类型',
|
||||
// paramDeviceCode: '参数设备编号'
|
||||
};
|
||||
|
@ -68,7 +68,8 @@ deviceRender[deviceType.AppendageBox] = {
|
||||
/** IbpLine渲染配置 */
|
||||
deviceRender[deviceType.IbpLine] = {
|
||||
_type: deviceType.IbpLine,
|
||||
zlevel: 3
|
||||
zlevel: 1,
|
||||
z: 3
|
||||
};
|
||||
|
||||
/** Elevator 渲染配置 */
|
||||
|
@ -36,9 +36,11 @@ class IbpPan {
|
||||
initIbpPage(opts) {
|
||||
const width = opts.config.width;
|
||||
const height = opts.config.height;
|
||||
this.isAllowDragging=false;
|
||||
this.$ibpZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config));
|
||||
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
|
||||
this.$mouseController = new MouseController(this);
|
||||
|
||||
this.$mouseController.enable();
|
||||
|
||||
this.$painter = new Painter(this);
|
||||
@ -195,6 +197,7 @@ class IbpPan {
|
||||
(Object.keys(this.ibpDevice) || []).forEach(elem => {
|
||||
this.$painter.drawIbp(this.ibpDevice[elem]);
|
||||
});
|
||||
this.$mouseController.setAllowDragging(true);
|
||||
}
|
||||
|
||||
pullBack(payload) {
|
||||
|
@ -2,6 +2,7 @@ import deviceType from './constant/deviceType';
|
||||
import Eventful from 'zrender/src/mixin/Eventful';
|
||||
import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
|
||||
class EventModel {
|
||||
constructor(e) {
|
||||
@ -33,7 +34,10 @@ class MouseController extends Eventful {
|
||||
super();
|
||||
this.$ibp = ibp;
|
||||
this.$zr = ibp.getZr();
|
||||
this.isAllowDragging=ibp.isAllowDragging||false;
|
||||
this.events = ibp.getEvents();
|
||||
this._draggingTarget=null;
|
||||
this._dragging = false;
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
|
||||
@ -54,6 +58,9 @@ class MouseController extends Eventful {
|
||||
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);
|
||||
zr.on('mousewheel', this.mousewheel, this);
|
||||
};
|
||||
|
||||
@ -61,6 +68,11 @@ class MouseController extends Eventful {
|
||||
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);
|
||||
|
||||
zr.off('mousewheel', this.mousewheel);
|
||||
};
|
||||
|
||||
@ -68,6 +80,11 @@ class MouseController extends Eventful {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
|
||||
zr.off('touchstart', this.mousedown);
|
||||
zr.off('touchmove', this.mousemove);
|
||||
zr.off('touchend', this.mouseup);
|
||||
|
||||
this.disable();
|
||||
};
|
||||
|
||||
@ -75,17 +92,41 @@ class MouseController extends Eventful {
|
||||
}
|
||||
}
|
||||
|
||||
setAllowDragging(data) {
|
||||
this.isAllowDragging=data;
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (eventTool.notLeftMouse(e)) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
const draggingTarget = e.target;
|
||||
// draggingTarget.draggable
|
||||
if (draggingTarget) {
|
||||
if (e.target.parent.getName()=='background') {
|
||||
this._draggingName='background';
|
||||
} else if (this.isAllowDragging&&e.target.parent.getName()=='simple') {
|
||||
this._draggingName='simple';
|
||||
} else if (this.isAllowDragging&&e.target.parent.getName()=='group') {
|
||||
this._draggingName='group';
|
||||
} else if (this.isAllowDragging&&e.target.parent.getName()=='group_child') {
|
||||
this._draggingName='group_child';
|
||||
}
|
||||
this._draggingTarget = draggingTarget;
|
||||
// draggingTarget.dragging = true;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
this._dragging = true;
|
||||
// this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event);
|
||||
}
|
||||
|
||||
var x = e.offsetX;
|
||||
var y = e.offsetY;
|
||||
// var x = e.offsetX;
|
||||
// var y = e.offsetY;
|
||||
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this._dragging = true;
|
||||
// this._x = x;
|
||||
// this._y = y;
|
||||
// this._dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -105,14 +146,38 @@ class MouseController extends Eventful {
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
if (this._dragging) {
|
||||
if (this._draggingTarget&&this._draggingName=='background') {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
return true;
|
||||
} else if (this.isAllowDragging&&this._draggingTarget&&this._draggingName=='simple') {
|
||||
this._draggingTarget.drift(dx, dy, e);
|
||||
return true;
|
||||
} else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group'||this._draggingName=='group_child')) {
|
||||
// debugger;
|
||||
if (this._draggingName=='group') {
|
||||
this._draggingTarget.parent.drift(dx, dy, e);
|
||||
return true;
|
||||
} else {
|
||||
this._draggingTarget.parent.parent.drift(dx, dy, e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// debugger;
|
||||
return true;
|
||||
}
|
||||
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
if (!eventTool.notLeftMouse(e)) {
|
||||
// debugger;
|
||||
const draggingTarget = this._draggingTarget;
|
||||
if (!eventTool.notLeftMouse(e)&&draggingTarget) {
|
||||
this._dragging = false;
|
||||
this._draggingTarget = null;
|
||||
this._draggingName=='';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,11 @@ export default class alarm extends Group {
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.zlevel;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,6 +22,7 @@ export default class alarm extends Group {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: alarmpic,
|
||||
@ -72,4 +75,7 @@ export default class alarm extends Group {
|
||||
}
|
||||
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ export default class AppendageBox extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -62,4 +63,7 @@ export default class AppendageBox extends Group {
|
||||
}
|
||||
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class Arrow extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -78,7 +79,7 @@ class Arrow extends Group {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
@ -91,9 +92,12 @@ class Arrow extends Group {
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
this.dragging = false;
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
export default Arrow;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import ibpBg from '@/assets/ibp_images/ibp_bg.png';
|
||||
import Pattern from 'zrender/src/graphic/Pattern';
|
||||
|
||||
export default class background extends Group {
|
||||
constructor(device) {
|
||||
@ -9,49 +9,49 @@ export default class background extends Group {
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = 1;
|
||||
this.imageBgArray = [];
|
||||
// this.model.width = 4100;
|
||||
// this.model.height = 900;
|
||||
this.name='background';
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
}
|
||||
create() {
|
||||
const widthNum = Math.ceil(parseInt(this.model.width)/2048);
|
||||
const heightNum = Math.ceil(parseInt(this.model.height)/1024);
|
||||
for (let i = 0; i<widthNum; i++) {
|
||||
for (let j = 0; j<heightNum; j++) {
|
||||
const imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: i*2048,
|
||||
y: j*1024,
|
||||
image: ibpBg,
|
||||
width: 2048,
|
||||
height: 1024
|
||||
}
|
||||
});
|
||||
this.imageBgArray.push(imageBg);
|
||||
}
|
||||
}
|
||||
this.tailorRect = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
}
|
||||
});
|
||||
this.tailorBgImage();
|
||||
const image = new Image(25, 25);
|
||||
image.src = ibpBg;
|
||||
image.onload = (e) => {
|
||||
const pattern = new Pattern(image, 'repeat');
|
||||
this.imageBg = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
cursor: 'default',
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: pattern
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
};
|
||||
|
||||
}
|
||||
tailorBgImage() {
|
||||
const _this = this;
|
||||
this.imageBgArray.forEach( function(elem) {
|
||||
elem.setClipPath(_this.tailorRect);
|
||||
_this.add(elem);
|
||||
});
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
if (e.which == 3) {
|
||||
return;
|
||||
}
|
||||
this.imageBg.attr('cursor', 'pointer');
|
||||
}
|
||||
mouseup() {
|
||||
this.imageBg.attr('cursor', 'default');
|
||||
}
|
||||
setDraggable() {
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -30,16 +30,19 @@ export default class button extends Group {
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getImagePic(),
|
||||
@ -141,5 +144,7 @@ export default class button extends Group {
|
||||
const color = button.colors.get(`${this.model.color}_on`);
|
||||
this.imageBg.setStyle({image: color[0]});
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class CircularLamp extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
this.setStatus(this.model);
|
||||
}
|
||||
@ -72,4 +73,7 @@ export default class CircularLamp extends Group {
|
||||
this.lamp.setStyle('fill', '#332C22');
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import clock8 from '@/assets/ibp_images/clock/clock_8.png';
|
||||
import clock9 from '@/assets/ibp_images/clock/clock_9.png';
|
||||
import clockBg from '@/assets/ibp_images/clock/clock_bg.png';
|
||||
import clockColon from '@/assets/ibp_images/clock/clock_colon.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class clock extends Group {
|
||||
constructor(device) {
|
||||
@ -25,6 +26,7 @@ export default class clock extends Group {
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.initTime = 0;
|
||||
this.name='group';
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -247,5 +249,18 @@ export default class clock extends Group {
|
||||
this.setNumPic(1, hours.charAt(0));
|
||||
}
|
||||
setDraggable() {
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
return;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ export default class elevator extends Group {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.name='group';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -16,11 +17,11 @@ export default class elevator extends Group {
|
||||
const model = this.model;
|
||||
|
||||
this.grouper=new Group({
|
||||
id: '111',
|
||||
id: model.code,
|
||||
// width: model.width,
|
||||
// height: model.height,
|
||||
position: [model.point.x, model.point.y],
|
||||
draggable: false
|
||||
position: [model.point.x, model.point.y]
|
||||
// draggable: model.draggable || false
|
||||
});
|
||||
|
||||
this.elevatorBack = new ElevatorBack({model: {
|
||||
@ -80,6 +81,10 @@ export default class elevator extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
setStatus(model) {
|
||||
if (model.direction=='none') {
|
||||
this.elevatorArrowBottom.setStatus('off');
|
||||
@ -94,36 +99,7 @@ export default class elevator extends Group {
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.grouper.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
return;
|
||||
}
|
||||
this.draggroup =this.grouper;
|
||||
this.deltPostion =[e.event.zrX-this.draggroup.position[0], e.event.zrY-this.draggroup.position[1]];
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (this.draggroup !=null) {
|
||||
var new_pos =[e.event.zrX, e.event.zrY];
|
||||
this.draggroup.position=[new_pos[0]-this.deltPostion[0], new_pos[1]-this.deltPostion[1]];
|
||||
this.draggroup.dirty();
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.draggroup=null;
|
||||
// this.grouper.attr('draggable', true);
|
||||
// this.createMouseEvent();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ export default class elevatorArrow extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.name='group_child';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -26,7 +27,6 @@ export default class elevatorArrow extends Group {
|
||||
height: 60
|
||||
}
|
||||
});
|
||||
// debugger;
|
||||
this.add(this.imageBg);
|
||||
this.getOrientate();
|
||||
this.transformScale();
|
||||
@ -89,26 +89,7 @@ export default class elevatorArrow extends Group {
|
||||
this.imageBg.setStyle({image: imageBack});
|
||||
}
|
||||
|
||||
// setDraggable() {
|
||||
// this.arrow.attr('draggable', true);
|
||||
// this.createMouseEvent();
|
||||
// }
|
||||
// createMouseEvent() {
|
||||
// this.on('mousedown', this.mousedown, this);
|
||||
// this.on('mousemove', this.mousemove, this);
|
||||
// this.on('mouseup', this.mouseup, this);
|
||||
// }
|
||||
|
||||
// mousedown(e) {
|
||||
// this.event.disable();
|
||||
// }
|
||||
|
||||
// mousemove(e) {
|
||||
// }
|
||||
|
||||
// mouseup(e) {
|
||||
// this.event.enable();
|
||||
// this.model.point.x = this.model.point.x + e.offsetX;
|
||||
// this.model.point.y = this.model.point.y + e.offsetY;
|
||||
// }
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,11 @@ export default class elevatorBack extends Group {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.name='group_child';
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
// debugger;
|
||||
const model = this.model;
|
||||
const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+
|
||||
' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+
|
||||
@ -31,4 +31,8 @@ export default class elevatorBack extends Group {
|
||||
});
|
||||
this.add(this.elevatorBack);
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class ibpLine extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -46,7 +47,7 @@ export default class ibpLine extends Group {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
@ -64,4 +65,7 @@ export default class ibpLine extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class ibpText extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -67,4 +68,7 @@ export default class ibpText extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export default class ibpTipBox extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -61,4 +62,7 @@ export default class ibpTipBox extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ export default class key extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -121,4 +122,7 @@ export default class key extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,12 @@ export default class rotateTip extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -21,6 +23,7 @@ export default class rotateTip extends Group {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getRotateColor(),
|
||||
@ -88,4 +91,7 @@ export default class rotateTip extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ export default class RotatingButton extends Group {
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -61,4 +62,7 @@ export default class RotatingButton extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,11 @@ export default class alarm extends Group {
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.name='simple';
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,6 +22,7 @@ export default class alarm extends Group {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: teleTerminalPic,
|
||||
@ -72,4 +75,7 @@ export default class alarm extends Group {
|
||||
this.dragging = false;
|
||||
}
|
||||
}
|
||||
getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export function calculateDCenter(viewRect, zrbound) {
|
||||
}
|
||||
|
||||
export function deviceFactory(type, elem) {
|
||||
return Object.assign({instance: null, event: null, model: Object(elem, deviceRender[type])});
|
||||
return Object.assign({instance: null, event: null, model: Object.assign(elem, deviceRender[type])});
|
||||
}
|
||||
|
||||
export function parser(data) {
|
||||
@ -38,6 +38,7 @@ export function parser(data) {
|
||||
if (data) {
|
||||
Object.assign(data.background);
|
||||
ibpDevice[data.background.code] = deviceFactory(deviceType.Background, data.background);
|
||||
store.dispatch('ibp/setIbpBgDevice', ibpDevice[data.background.code]);
|
||||
zrUtil.each(data.textList || [], elem => {
|
||||
ibpDevice[elem.code] = deviceFactory(deviceType.IbpText, elem);
|
||||
}, this);
|
||||
|
@ -1,13 +0,0 @@
|
||||
export const requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function (callback) { callback.timter = window.setTimeout(callback, 1000 / 60); };
|
||||
|
||||
export const cancelRequestAnimFrame = window.cancelAnimationFrame ||
|
||||
window.webkitCancelRequestAnimationFrame ||
|
||||
window.mozCancelRequestAnimationFrame ||
|
||||
window.oCancelRequestAnimationFrame ||
|
||||
window.msCancelRequestAnimationFrame ||
|
||||
function (callback) { window.clearTimeout(callback); };
|
@ -12,7 +12,8 @@ const ibp = {
|
||||
ibpList: {}, // 数据列表
|
||||
ibpIdList: {}, // 数据列表(以id为标识)
|
||||
updateDeviceData: {}, // 修改的数据
|
||||
rightClickCount: 0 // 右键点击设备
|
||||
rightClickCount: 0, // 右键点击设备
|
||||
ibpBgDevice: {} // ibp背景设备
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -31,6 +32,9 @@ const ibp = {
|
||||
},
|
||||
updateDeviceData: (state) => {
|
||||
return state.updateDeviceData;
|
||||
},
|
||||
ibpBgDevice: (state) => {
|
||||
return state.ibpBgDevice;
|
||||
}
|
||||
},
|
||||
|
||||
@ -47,6 +51,9 @@ const ibp = {
|
||||
},
|
||||
deleteIbpDevices: (state, devices) => {
|
||||
Vue.prototype.$ibp && Vue.prototype.$ibp.render(devices);
|
||||
},
|
||||
setIbpBgDevice: (state, ibpBgDevice) => {
|
||||
state.ibpBgDevice = ibpBgDevice;
|
||||
}
|
||||
},
|
||||
|
||||
@ -72,6 +79,9 @@ const ibp = {
|
||||
models = [models];
|
||||
}
|
||||
commit('deleteIbpDevices', models);
|
||||
},
|
||||
setIbpBgDevice: ( { commit }, device) => {
|
||||
commit('setIbpBgDevice', device);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { requestAnimationFrame, cancelRequestAnimFrame } from '@/jmap/utils/animation';
|
||||
import { requestAnimationFrame, cancelRequestAnimFrame } from '@/utils/animation';
|
||||
|
||||
export default {
|
||||
name: 'ProgressBar',
|
||||
|
@ -122,6 +122,10 @@ export default {
|
||||
min: 0,
|
||||
max: 0
|
||||
},
|
||||
// graphic: {
|
||||
// type: 'line',
|
||||
// progressive: true
|
||||
// },
|
||||
series: [],
|
||||
dataZoom: [
|
||||
{
|
||||
|
@ -51,7 +51,6 @@
|
||||
x: 0,
|
||||
y: 0,
|
||||
_type: 'Background',
|
||||
code: this.generateCode(),
|
||||
width: this.form .bgWidth,
|
||||
height: this.form.bgHeight
|
||||
};
|
||||
@ -59,10 +58,6 @@
|
||||
},
|
||||
initPage(){
|
||||
}
|
||||
},
|
||||
generateCode() {
|
||||
const mydate = new Date();
|
||||
this.form.code = "bg"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -13,16 +13,16 @@
|
||||
<el-input v-model="form.fillColor"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始X轴坐标">
|
||||
<el-input-number v-model="form.x1" controls-position="right" :min="1"></el-input-number>
|
||||
<el-input-number v-model="form.x1" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始Y轴坐标">
|
||||
<el-input-number v-model="form.y1" controls-position="right" :min="1"></el-input-number>
|
||||
<el-input-number v-model="form.y1" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="终止X轴坐标">
|
||||
<el-input-number v-model="form.x2" controls-position="right" :min="1"></el-input-number>
|
||||
<el-input-number v-model="form.x2" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="终止Y轴坐标">
|
||||
<el-input-number v-model="form.y2" controls-position="right" :min="1"></el-input-number>
|
||||
<el-input-number v-model="form.y2" controls-position="right" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<el-input v-model="form.textFill"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字大小" prop="fontSize">
|
||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="50"></el-input-number>
|
||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字粗细" prop="fontWeight">
|
||||
<el-input-number v-model="form.fontWeight" controls-position="right" :min="1" ></el-input-number>
|
||||
|
@ -110,7 +110,8 @@
|
||||
<script>
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import {modelFactory} from '@/ibp/utils/parser'
|
||||
import {deviceFactory} from '@/ibp/utils/parser';
|
||||
import deviceType from '@/ibp/constant/deviceType';
|
||||
import IbpText from './ibpText';
|
||||
import IbpTipBox from './ibpTipBox';
|
||||
import IbpButton from './ibpButton';
|
||||
@ -169,8 +170,13 @@
|
||||
},
|
||||
methods: {
|
||||
createDataModel(model) {
|
||||
const newModel = modelFactory(model._type, model);
|
||||
this.$store.dispatch('ibp/updateIbpDevices', newModel);
|
||||
if(model._type === deviceType.Background) {
|
||||
const bgDevice = this.$store.getters['ibp/ibpBgDevice'];
|
||||
model.code = bgDevice.model.code;
|
||||
}
|
||||
const newModel = deviceFactory(model._type, model);
|
||||
|
||||
this.$store.dispatch('ibp/updateIbpDevices', newModel.model);
|
||||
},
|
||||
deleteDataModel(model) {
|
||||
this.$store.dispatch('ibp/deleteIbpDevices', model);
|
||||
|
@ -164,4 +164,6 @@ export default {
|
||||
right: 20px;
|
||||
bottom: 15px;
|
||||
}
|
||||
.ibp-canvas{
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button v-if="isAdmin || isIBP" type="warning" @click="jumpIbp">IBP盘</el-button>
|
||||
<el-button v-if="isIBP" type="warning" @click="jumpIbp">IBP盘</el-button>
|
||||
<el-button v-if="isDriver" type="jumpjlmap3d" @click="jumpjlmap3d">司机视角</el-button>
|
||||
<template v-if="isAdmin">
|
||||
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="'订阅地图'" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center>
|
||||
<el-dialog :title="'订阅地图'" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
|
||||
<el-form ref="form" v-model="formModel" label-width="120px">
|
||||
<el-form-item label="订阅地图列表:" prop="mapIdList">
|
||||
<el-select v-model="formModel.mapIdList" clearable multiple placeholder="请输入关键词" style="width: 80%">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="$t('system.editUserPermission')" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="$t('system.editUserPermission')" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisibles" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisibles" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: '280px', width:'100%' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
|
@ -158,16 +158,8 @@ export default {
|
||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||
});
|
||||
},
|
||||
isNormal() {
|
||||
return this.activeTab === 'first';
|
||||
},
|
||||
isThird() {
|
||||
return this.activeTab === 'third';
|
||||
},
|
||||
create() {
|
||||
if (this.isThird()) {
|
||||
this.close();
|
||||
} else if (this.isNormal()) {
|
||||
if (this.activeTab === 'first') {
|
||||
this.$refs['newForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<el-dialog :title="this.$t('map.operationGraphPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
|
||||
<div>
|
||||
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" size="mini">
|
||||
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" size="mini" :rules="rules">
|
||||
<el-form-item :label="this.$t('map.operationGraphName')" prop="name">
|
||||
<el-input v-model="editModel.name" :disabled="true" />
|
||||
<el-input v-model="editModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -34,6 +34,11 @@ export default {
|
||||
editModel: {
|
||||
planId: '',
|
||||
name: ''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -64,7 +64,7 @@ export default {
|
||||
prop: 'permissionName'
|
||||
},
|
||||
{
|
||||
title: this.$t('orderAuthor.price'),
|
||||
title: `${this.$t('orderAuthor.price')}(元)`,
|
||||
prop: 'price'
|
||||
},
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="this.$t('orderAuthor.trainingList')"
|
||||
title="订单选择商品"
|
||||
:visible.sync="show"
|
||||
top="20px"
|
||||
width="90%"
|
||||
|
@ -48,7 +48,7 @@ export default {
|
||||
// },
|
||||
'status': {
|
||||
type: 'select',
|
||||
label: this.$t('orderAuthor.authorityStatus'),
|
||||
label: '状态',
|
||||
value: '1',
|
||||
config: {
|
||||
data: []
|
||||
@ -142,7 +142,7 @@ export default {
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
{
|
||||
title: this.$t('orderAuthor.authorityStatus'),
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
|
||||
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
||||
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
|
||||
{ prop: 'amount', label: this.$t('permission.permissionTotal'), type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
|
||||
{ prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
|
@ -26,9 +26,9 @@
|
||||
{{ computedName(PublishMapList, scope.row.mapId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="80">
|
||||
<el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.mapProductCode }}
|
||||
{{ computedName(mapProductList, scope.row.mapProductCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lessonId" :label="$t('permission.lessonName')">
|
||||
@ -38,8 +38,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" :label="$t('permission.startTime')" width="80" />
|
||||
<el-table-column prop="endTime" :label="$t('permission.endTime')" width="80" />
|
||||
<el-table-column prop="amount" :label="$t('permission.permissionTotal')" width="110" />
|
||||
<el-table-column l:abel="$t('global.operate')" width="90">
|
||||
<el-table-column prop="amount" label="权限个数" width="90" />
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="dialogEdit(scope.row)">{{ $t('global.edit') }}</el-button>
|
||||
<el-button type="text" size="small" @click="deleteForm(scope.row)">{{ $t('global.delete') }}</el-button>
|
||||
@ -92,6 +92,7 @@ export default {
|
||||
PermissionTypeList: [],
|
||||
PublisLessonList: [],
|
||||
PublishMapList: [],
|
||||
mapProductList: [],
|
||||
ruleList: []
|
||||
};
|
||||
},
|
||||
@ -205,7 +206,14 @@ export default {
|
||||
item.mapProductCode == elem.mapProductCode &&
|
||||
item.permissionType == elem.permissionType;
|
||||
});
|
||||
|
||||
getPublishMapInfo(item.mapId).then(resp => {
|
||||
getCommodityMapProduct(resp.data.skinCode).then(rest => {
|
||||
const list = rest.data || [];
|
||||
this.mapProductList = list.map(elem => {
|
||||
return { value: elem.code, label: elem.name };
|
||||
});
|
||||
});
|
||||
});
|
||||
if (index < 0) {
|
||||
this.ruleList.push(item);
|
||||
} else {
|
||||
@ -271,7 +279,7 @@ export default {
|
||||
}
|
||||
|
||||
.forms {
|
||||
width: 800px;
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
padding: 40px;
|
||||
|
@ -119,7 +119,7 @@ export default {
|
||||
{
|
||||
title: this.$t('permission.belonger'),
|
||||
prop: 'ownerName',
|
||||
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1 || this.$store.state.user.roles.indexOf(admin) < 0; }
|
||||
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0 || this.$store.state.user.roles.indexOf(admin) > 0; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="plan-tool" style="width: 100%; height: 100%;">
|
||||
<menu-bar ref="menuBar" :skin-style="skinCode" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" />
|
||||
<menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" />
|
||||
<schedule
|
||||
ref="schedule"
|
||||
:skin-code="skinCode"
|
||||
|
@ -123,10 +123,10 @@ import { EventBus } from '@/scripts/event-bus';
|
||||
export default {
|
||||
name: 'PlanMenuBar',
|
||||
props: {
|
||||
skinCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// skinCode: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// },
|
||||
planConvert: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
@ -141,6 +141,7 @@ export default {
|
||||
tempClassA: -1,
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
menuBase: [
|
||||
{
|
||||
title: '文件',
|
||||
@ -149,19 +150,27 @@ export default {
|
||||
title: '打开运行图',
|
||||
click: this.handleOpenRunPlan
|
||||
},
|
||||
{
|
||||
type: 'file',
|
||||
title: '导入运行图',
|
||||
click: this.handleImportRunPlan
|
||||
},
|
||||
// {
|
||||
// type: 'file',
|
||||
// title: '导入运行图',
|
||||
// click: this.handleImportRunPlan
|
||||
// },
|
||||
{
|
||||
title: '新建运行图',
|
||||
click: this.handleCreateEmptyPlan
|
||||
},
|
||||
{
|
||||
title: '修改运行图名称',
|
||||
click: this.handleEditPlan
|
||||
},
|
||||
{
|
||||
title: '修改站间运行时间',
|
||||
click: this.handleModifyingStationIntervalTime
|
||||
// disabledCallback: () => { return !this.$route.query.planId },
|
||||
},
|
||||
{
|
||||
title: '删除运行图',
|
||||
click: this.handledeleteRunPlan
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -388,65 +397,74 @@ export default {
|
||||
},
|
||||
// 打开运行图列表
|
||||
handleOpenRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
},
|
||||
handledeleteRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'delete'} });
|
||||
},
|
||||
// 修改运行图名称
|
||||
handleEditPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'edit'} });
|
||||
},
|
||||
loadingScreen() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 导入运行图
|
||||
handleImportRunPlan(file) {
|
||||
if (file) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
const that = this;
|
||||
const reader = new FileReader();
|
||||
if (reader) {
|
||||
reader.onload = function (e) {
|
||||
let wb;
|
||||
const data = e.target.result;
|
||||
if (that.rABS) {
|
||||
wb = XLSX.read(btoa(that.fixdata(data)), { // 手动转化
|
||||
type: 'base64'
|
||||
});
|
||||
} else {
|
||||
wb = XLSX.read(data, {
|
||||
type: 'binary'
|
||||
});
|
||||
}
|
||||
|
||||
if (wb) {
|
||||
try {
|
||||
let jsonData = [];
|
||||
for (const index in wb.Sheets) {
|
||||
jsonData = that.PlanConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
|
||||
importRunPlan({ skinCode: that.skinCode, runPlanList: jsonData }).then(response => {
|
||||
loading.close();
|
||||
that.refresh();
|
||||
that.$message.success('导入运行图成功!');
|
||||
}).catch(() => {
|
||||
loading.close();
|
||||
that.refresh();
|
||||
that.$message.warning('导入运行图失败!');
|
||||
this.loadingScreen();
|
||||
setTimeout(() => {
|
||||
const that = this;
|
||||
const reader = new FileReader();
|
||||
if (reader) {
|
||||
reader.onload = function (e) {
|
||||
let wb;
|
||||
const data = e.target.result;
|
||||
if (that.rABS) {
|
||||
wb = XLSX.read(btoa(that.fixdata(data)), { // 手动转化
|
||||
type: 'base64'
|
||||
});
|
||||
} else {
|
||||
wb = XLSX.read(data, {
|
||||
type: 'binary'
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
loading.close();
|
||||
that.refresh();
|
||||
that.$message.warning('解析运行图失败!');
|
||||
}
|
||||
}
|
||||
};
|
||||
if (wb) {
|
||||
try {
|
||||
let jsonData = [];
|
||||
for (const index in wb.Sheets) {
|
||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
|
||||
if (that.rABS) {
|
||||
reader.readAsArrayBuffer(file);
|
||||
} else {
|
||||
reader.readAsBinaryString(file);
|
||||
importRunPlan({ skinCode: that.$route.query.skinCode || '02', runPlanList: jsonData }).then(response => {
|
||||
that.loading.close();
|
||||
that.refresh();
|
||||
that.handleOpenRunPlan();
|
||||
}).catch(error => {
|
||||
that.loading.close();
|
||||
that.refresh();
|
||||
that.$message.warning(`导入运行图失败: ${error.message}`);
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
that.loading.close();
|
||||
that.refresh();
|
||||
that.$message.warning(`解析运行图失败: ${error.message}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (that.rABS) {
|
||||
reader.readAsArrayBuffer(file);
|
||||
} else {
|
||||
reader.readAsBinaryString(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
this.closeMenu();
|
||||
},
|
||||
|
@ -4,28 +4,54 @@
|
||||
class="planEdit__tool create-empty-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="420px"
|
||||
width="30%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="addModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||
<el-form-item label="运行图名称:" prop="name">
|
||||
<el-input v-model="addModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<div>
|
||||
<el-tabs v-model="activeTab" type="card">
|
||||
<el-tab-pane label="正常新建" name="first">
|
||||
<el-row>
|
||||
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||
<el-form-item label="运行图名称:" prop="name">
|
||||
<el-input v-model="newModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="从发布运行图创建" name="second">
|
||||
<el-row>
|
||||
<el-form ref="pullForm" :model="pullModel" label-width="140px" size="mini" :rules="pullRules" @submit.native.prevent>
|
||||
<el-form-item label="发布运行图" prop="templateId">
|
||||
<el-select v-model="pullModel.templateId" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in publishMapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="运行图名称:" prop="name">
|
||||
<el-input v-model="pullModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" :loading="loading" @click="handleCommit">{{ $t('map.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('map.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createEmptyPlan } from '@/api/runplan';
|
||||
import { createEmptyPlan, queryRunPlanList, postCreatePlan } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'CreateEmptyPlan',
|
||||
@ -33,9 +59,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'first',
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
addModel: {
|
||||
publishMapList: [],
|
||||
newModel: {
|
||||
name: '',
|
||||
skinCode: this.$route.query.skinCode
|
||||
},
|
||||
pullModel: {
|
||||
templateId: '',
|
||||
name: '',
|
||||
skinCode: this.$route.query.skinCode
|
||||
}
|
||||
@ -43,7 +76,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建空运行图数据';
|
||||
return '新建运行图';
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
@ -51,36 +84,88 @@ export default {
|
||||
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
},
|
||||
pullRules() {
|
||||
return {
|
||||
templateId: [
|
||||
{ required: true, message: '请选择发布运行图', trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
async initLoad() {
|
||||
const res = await queryRunPlanList(this.$route.query.skinCode);
|
||||
if (res.code == 200 && res.data.length) {
|
||||
this.publishMapList = res.data;
|
||||
}
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.initLoad();
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.newModel.name = '';
|
||||
this.pullModel.templateId = '';
|
||||
this.pullModel.name = '';
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
if (this.$refs.pullForm) {
|
||||
this.$refs.pullForm.resetFields();
|
||||
}
|
||||
},
|
||||
handleCommit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createEmptyPlan(this.addModel).then(resp => {
|
||||
const params = {
|
||||
dialogName: 'openRunPlan',
|
||||
operate: 'loadRunPlanData',
|
||||
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.addModel.name, refresh: true }
|
||||
};
|
||||
if (this.activeTab === 'first') {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
createEmptyPlan(this.newModel).then(resp => {
|
||||
const params = {
|
||||
dialogName: 'openRunPlan',
|
||||
operate: 'loadRunPlanData',
|
||||
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true }
|
||||
};
|
||||
|
||||
this.$emit('dispatchOperate', params);
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
|
||||
this.$message.success('创建空运行图成功!');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建空运行图失败');
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.$emit('dispatchOperate', params);
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
this.$message.success('创建空运行图成功!');
|
||||
this.jump(resp.data, this.newModel.name);
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建空运行图失败');
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs['pullForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
postCreatePlan(this.pullModel).then(resp => {
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
this.$message.success('创建运行图成功!');
|
||||
this.jump(resp.data, this.pullModel.name);
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建运行图失败');
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
jump(planId, planName) {
|
||||
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
|
||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
116
src/views/planMonitor/editTool/menus/editPlanName.vue
Normal file
116
src/views/planMonitor/editTool/menus/editPlanName.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool create-empty-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="30%"
|
||||
:before-close="doClose"
|
||||
:z-index="3000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="editModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||
<el-form-item label="运行图名称:" prop="name">
|
||||
<el-input v-model="editModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" :loading="loading" @click="handleEdit">修改</el-button>
|
||||
<el-button @click="doClose">{{ $t('map.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { putRunPlanDetail } from '@/api/runplan';
|
||||
|
||||
export default {
|
||||
name: 'CreateEmptyPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'first',
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
publishMapList: [],
|
||||
editModel: {
|
||||
planId: '',
|
||||
name: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '新建运行图';
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.dialogShow = true;
|
||||
if (data && data.name) {
|
||||
this.editModel.name = data.name;
|
||||
this.editModel.planId = data.id;
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.editModel.name = '';
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
},
|
||||
handleEdit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
putRunPlanDetail(this.editModel).then(resp => {
|
||||
const params = {
|
||||
dialogName: 'openRunPlan',
|
||||
operate: 'loadRunPlanData',
|
||||
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.editModel.name, refresh: true }
|
||||
};
|
||||
|
||||
this.$emit('dispatchOperate', params);
|
||||
this.$message.success('修改运行图名称成功!');
|
||||
this.$emit('renewal');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('修改运行图名称失败');
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
/deep/ {
|
||||
.el-input {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,42 +1,49 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool open-runplan"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
class="filter-tree"
|
||||
:data="runPlanList"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
:style="{height: height-20+'px'}"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<el-radio v-model="planId" :label="data.id"><span>{{ data.name }}</span></el-radio>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm">选择运行图</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool open-runplan"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="true"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
class="filter-tree"
|
||||
:data="runPlanList"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
:style="{height: height-20+'px'}"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button v-if="type == 'add'" type="primary" @click="handleConfirm">选择运行图</el-button>
|
||||
<el-button v-if="type == 'delete'" type="primary" @click="handleDelete">删除</el-button>
|
||||
<el-button v-if="type == 'edit'" type="primary" @click="handleEdit">修改</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRpListByMapId } from '@/api/runplan';
|
||||
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import EditPlanName from './editPlanName';
|
||||
|
||||
export default {
|
||||
name: 'OpenRunPlan',
|
||||
components: {
|
||||
EditPlanName
|
||||
},
|
||||
props: {
|
||||
skinCode: {
|
||||
type: String,
|
||||
@ -49,6 +56,9 @@ export default {
|
||||
loading: false,
|
||||
height: 260,
|
||||
planId: '',
|
||||
planName: '',
|
||||
type: 'add',
|
||||
// defaultShowKeys: [],
|
||||
runPlanList: [],
|
||||
runPlanDict: {},
|
||||
defaultProps: {
|
||||
@ -72,35 +82,68 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handleNodeClick(data) {
|
||||
this.planId = data.id;
|
||||
this.planName = data.name;
|
||||
},
|
||||
loadRunPlanData({ refresh, planId, skinCode, planName }) {
|
||||
if (refresh) {
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
} else {
|
||||
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName, try: this.$route.query.try, goodsId: this.$route.query.goodsId };
|
||||
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
|
||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||
}
|
||||
},
|
||||
doShow() {
|
||||
getRunPlanList() {
|
||||
getRpListByMapId(this.$route.query.mapId).then((resp) => {
|
||||
this.runPlanList = resp.data;
|
||||
this.runPlanList.forEach(elem => {
|
||||
this.runPlanDict[elem.id] = elem.name;
|
||||
});
|
||||
// this.defaultShowKeys = [this.planId];
|
||||
this.dialogShow = true;
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取运行图列表失败');
|
||||
});
|
||||
},
|
||||
doShow(data) {
|
||||
this.type = data.type || 'add';
|
||||
this.getRunPlanList();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.planId = '';
|
||||
this.planName = '';
|
||||
},
|
||||
// 跳转到对应运行图
|
||||
handleConfirm() {
|
||||
this.loadRunPlanData({
|
||||
planId: this.planId,
|
||||
skinCode: this.$route.query.skinCode,
|
||||
planName: this.runPlanDict[this.planId]
|
||||
planName: this.planName
|
||||
});
|
||||
this.doClose();
|
||||
},
|
||||
// 删除运行图
|
||||
handleDelete() {
|
||||
deleteRunPlan(this.planId).then(Response => {
|
||||
this.$message.success(`删除成功!`);
|
||||
if (this.planId === this.$route.query.planId) {
|
||||
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
|
||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||
}
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
||||
});
|
||||
},
|
||||
// 修改运行图名称
|
||||
handleEdit() {
|
||||
if (this.planId && this.planName) {
|
||||
this.$refs.editPlan.doShow({id: this.planId, name: this.planName});
|
||||
} else {
|
||||
this.$message.info('请选择运行图');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -40,10 +40,10 @@ export default {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
planConvert: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
// planConvert: {
|
||||
// type: Object,
|
||||
// required: true
|
||||
// },
|
||||
maxWidth: {
|
||||
type: Number,
|
||||
required: true
|
||||
@ -55,6 +55,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
planConvert: null,
|
||||
top: 0,
|
||||
height: 0,
|
||||
mapName: '',
|
||||
@ -350,29 +351,33 @@ export default {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
|
||||
});
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.skinCode);
|
||||
this.$store.dispatch('runPlan/clear').then(resp => {
|
||||
this.planConvert = this.$theme.loadPlanConvert(this.skinCode);
|
||||
this.$store.dispatch('runPlan/clear').then(() => {
|
||||
this.loadInitChart().then(() => {
|
||||
if (this.skinCode && this.planId) {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
if (this.skinCode) {
|
||||
loadMapData(this.skinCode);
|
||||
getStationListBySkinCode(this.skinCode).then(resp => {
|
||||
getStationListBySkinCode(this.$route.query.skinCode).then(resp => {
|
||||
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||
queryRunPlan(this.planId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
this.loadChartData();
|
||||
this.loadInitData();
|
||||
if (this.planId) {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
queryRunPlan(this.planId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
this.loadChartData();
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
this.$messageBox('获取运行图数据失败');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
this.$messageBox('获取运行图数据失败');
|
||||
});
|
||||
} else {
|
||||
this.clearCanvas();
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('请求车站数据失败');
|
||||
this.$store.dispatch('runPlan/setStations', []);
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -389,10 +394,10 @@ export default {
|
||||
this.viewDisabled = true;
|
||||
|
||||
this.option.series = [];
|
||||
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.option.series, [this.PlanConvert.initializeYaxis(stations)]);
|
||||
this.pushModels(this.option.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5 }));
|
||||
await this.loadInitData();
|
||||
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
|
||||
await this.loadInitChart();
|
||||
|
||||
this.viewDisabled = false;
|
||||
} catch (error) {
|
||||
@ -465,11 +470,19 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
clearCanvas() {
|
||||
this.option.series = [];
|
||||
this.option.title.text = '';
|
||||
if (this.myChart) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
xAxisPointFormat(params) {
|
||||
return timeFormat(params.value);
|
||||
},
|
||||
yAxisPointFormat(params) {
|
||||
return this.PlanConvert.computedFormatYAxis(this.stations, params);
|
||||
return this.planConvert.computedFormatYAxis(this.stations, params);
|
||||
},
|
||||
xAxisLableFormat(value, index) {
|
||||
if (value % 60 === 0) {
|
||||
@ -481,7 +494,7 @@ export default {
|
||||
},
|
||||
xAxisInit() {
|
||||
const list = [];
|
||||
for (var time = 0 + this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
|
||||
for (var time = 0 + this.planConvert.TranslationTime; time < 3600 * 24 + this.planConvert.TranslationTime; time++) {
|
||||
list.push(time);
|
||||
}
|
||||
|
||||
@ -498,18 +511,19 @@ export default {
|
||||
}
|
||||
},
|
||||
yAxisInit() {
|
||||
if (Object.keys(this.PlanConvert).length) {
|
||||
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
|
||||
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
|
||||
if (Object.keys(this.planConvert).length) {
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.stations);
|
||||
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.stations);
|
||||
}
|
||||
},
|
||||
axisTooltip(param) {
|
||||
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
|
||||
const station = this.stations[Math.floor((param.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
|
||||
return [
|
||||
`Point Data <hr size=1 style="margin: 3px 0">`,
|
||||
`车站名称: ${station.name}<br>`,
|
||||
`车站公里标: ${station.kmRange} km <br>`,
|
||||
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
|
||||
`到站时间: ${timeFormat(param.data[0] + this.planConvert.TranslationTime)} (${param.data[0]})<br>`
|
||||
].join('');
|
||||
},
|
||||
mouseClick(params) {
|
||||
@ -559,7 +573,7 @@ export default {
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
#PlanSchedule {
|
||||
z-index: 5;
|
||||
z-index: 0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
|
@ -147,7 +147,7 @@ export default {
|
||||
type: 'warning',
|
||||
handleClick: this.handleEfficacy,
|
||||
showControl: (row) => {
|
||||
return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status == 1;
|
||||
return !this.$route.query.lessonId && row.status == 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -155,7 +155,7 @@ export default {
|
||||
type: 'warning',
|
||||
handleClick: this.handleDelete,
|
||||
showControl: (row) => {
|
||||
return this.$route.query.lessonId && row.status == 1;
|
||||
return this.$route.query.lessonId && row.status == 1 && row.creatorId == this.userId;
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -221,6 +221,7 @@ export default {
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.lessonId) {
|
||||
params.lessonId = this.$route.query.lessonId;
|
||||
params.status = '1';
|
||||
}
|
||||
return getExamList(params);
|
||||
},
|
||||
|
@ -6,8 +6,7 @@
|
||||
<p style="margin-top: 2px;font-size: 15px;">综合实训管理者: {{ roomInfo.creator }}</p>
|
||||
<p class="roomName">综合演练室</p>
|
||||
<div style="padding-right: 30px;">
|
||||
<p class="num">可分配角色数量: {{ roomInfo.permissionNum - 1 }}</p>
|
||||
<!-- <p class="num">剩余可分配角色数量: {{roomInfo.permissionNum - num}}</p> -->
|
||||
<p class="num">可分配角色数量: {{ permissionRest }} / {{ roomInfo.permissionNum - 1 }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 聊天窗口 -->
|
||||
@ -16,7 +15,7 @@
|
||||
</div>
|
||||
<!-- 参与人员 -->
|
||||
<div class="personnel">
|
||||
<div style="height: calc(100% - 20px); overflow-y: scroll;">
|
||||
<div style="height: calc(100% - 20px); overflow-y: scroll; padding: 0px 30px;">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div class="Scheduling">
|
||||
<p class="title">调度员</p>
|
||||
@ -34,7 +33,7 @@
|
||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('dispatch', '增加调度人员')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="Scheduling bottomNone">
|
||||
<div class="Scheduling">
|
||||
<p class="title">车站值班员</p>
|
||||
<ul>
|
||||
<li v-for="(nor, index) in equipmentList" :key="index" class="selectPerson">
|
||||
@ -42,7 +41,7 @@
|
||||
<i
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
class="el-icon-close delPerson"
|
||||
@click="handleDelEquipment(nor, index)"
|
||||
@click="handleDelUserForStation(nor, index, stationListForEquipment, equipmentList)"
|
||||
/>
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-select
|
||||
@ -50,10 +49,10 @@
|
||||
placeholder="请选择"
|
||||
size="mini"
|
||||
:disabled="userId != roomInfo.creatorId"
|
||||
@change="changeEquipment(nor)"
|
||||
@change="handleChangeUser(nor, 'Attendant', stationListForEquipment, equipmentList)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stationList"
|
||||
v-for="item in stationListForEquipment"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
@ -108,7 +107,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div class="Scheduling bottomNone">
|
||||
<div class="Scheduling">
|
||||
<p class="title">司机</p>
|
||||
<ul>
|
||||
<li v-for="(nor, index) in driverList" :key="index" class="selectPerson">
|
||||
@ -124,7 +123,7 @@
|
||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('driver', '增加司机')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="Scheduling bottomNone">
|
||||
<div class="Scheduling">
|
||||
<p class="title">IBP</p>
|
||||
<ul>
|
||||
<li v-for="(nor, index) in ibpList" :key="index" class="selectPerson">
|
||||
@ -132,62 +131,102 @@
|
||||
<i
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
class="el-icon-close delPerson"
|
||||
@click="handleDelUser(ibpList, nor, index)"
|
||||
@click="handleDelUserForStation(nor, index, stationListForIBP, ibpList)"
|
||||
/>
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-select
|
||||
v-model="nor.deviceCode"
|
||||
placeholder="请选择"
|
||||
size="mini"
|
||||
:disabled="userId != roomInfo.creatorId"
|
||||
@change="handleChangeUser(nor, 'IBP', stationListForIBP, ibpList)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stationListForIBP"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="userId == roomInfo.creatorId" class="add-box">
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
circle
|
||||
plain
|
||||
@click="addingRoles('ibp', '增加IBP')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div class="Scheduling">
|
||||
<p class="title">大屏</p>
|
||||
<ul>
|
||||
<li v-for="(nor, index) in bigScreenList" :key="index" class="selectPerson">
|
||||
<span>{{ nor.nickName }}</span>
|
||||
<i
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
class="el-icon-close delPerson"
|
||||
@click="handleDelUser(bigScreenList, nor, index)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="userId == roomInfo.creatorId" class="add-box">
|
||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('ibp', '增加IBP')" />
|
||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="start-box">
|
||||
<div v-if="!starting" style="float: right; margin-left: 10px;">
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
type="primary"
|
||||
style="float: right;"
|
||||
:loading="loading"
|
||||
@click="start"
|
||||
>
|
||||
开始仿真</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="float: right; margin-right: 10px;"
|
||||
:loading="loading"
|
||||
@click="joinJointTrain"
|
||||
>
|
||||
进入仿真</el-button>
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
type=""
|
||||
style="float: right; margin-right: 10px;"
|
||||
:loading="loading"
|
||||
@click="stop"
|
||||
>
|
||||
结束仿真</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="start-box">
|
||||
<template v-if="!starting">
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
type=""
|
||||
style="float: right; margin-right: 0px;"
|
||||
style="margin-left: 10px"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="postCode"
|
||||
>生成二维码
|
||||
</el-button>
|
||||
<el-button type="" style="float: right; margin-right: 10px;" @click="backRoom">返回
|
||||
</el-button>
|
||||
@click="start"
|
||||
>
|
||||
开始仿真</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
:loading="loading"
|
||||
@click="joinJointTrain"
|
||||
>
|
||||
进入仿真</el-button>
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
type="danger"
|
||||
style="float: right; margin-right: 0px;"
|
||||
style="margin-left: 10px"
|
||||
type="warning"
|
||||
:loading="loading"
|
||||
@click="exit"
|
||||
>销毁房间
|
||||
</el-button>
|
||||
</div>
|
||||
@click="stop"
|
||||
>
|
||||
结束仿真</el-button>
|
||||
</template>
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
style="margin-left: 10px"
|
||||
type="success"
|
||||
:loading="loading"
|
||||
@click="postCode"
|
||||
>生成二维码
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
style="margin-left: 10px"
|
||||
type="danger"
|
||||
:loading="loading"
|
||||
@click="exit"
|
||||
>销毁房间
|
||||
</el-button>
|
||||
<el-button type="" @click="backRoom">返回
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -244,13 +283,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
userId: '',
|
||||
permissionRest: 0,
|
||||
roomInfo: {
|
||||
creator: '',
|
||||
totalNum: '',
|
||||
creatorId: '',
|
||||
group: '',
|
||||
audienceNum: '',
|
||||
permissionNum: ''
|
||||
audienceNum: 0,
|
||||
permissionNum: 0
|
||||
},
|
||||
filterText: '',
|
||||
isShow: false,
|
||||
@ -264,7 +304,8 @@ export default {
|
||||
adminList: [],
|
||||
driverList: [],
|
||||
signalList: [],
|
||||
stationList: [], // 车站列表
|
||||
bigScreenList: [],
|
||||
stationList: [],
|
||||
ibpList: [],
|
||||
point: {
|
||||
x: 0,
|
||||
@ -274,51 +315,72 @@ export default {
|
||||
timeDemon: null,
|
||||
starting: false,
|
||||
mapId: '',
|
||||
num: 0,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 95;
|
||||
},
|
||||
stationListForEquipment() {
|
||||
return this.stationList.filter(elem => { return elem.centralized; }).map(item => {
|
||||
const elem = { code: item.code, name: item.name, disabled: false };
|
||||
this.equipmentList.forEach(nor => {
|
||||
if (elem.code == nor.deviceCode) {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
return elem;
|
||||
});
|
||||
},
|
||||
stationListForIBP() {
|
||||
return this.stationList.map(item => {
|
||||
const elem = { code: item.code, name: item.name, disabled: false };
|
||||
this.ibpList.forEach(nor => {
|
||||
if (elem.code == nor.deviceCode) {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
return elem;
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.trainingTree.filter(val);
|
||||
},
|
||||
'$store.state.socket.roleInfo': function (val) {
|
||||
if (val.length) { // 分配角色信息
|
||||
this.addrolesList(val);
|
||||
'$store.state.socket.roleInfo': async function (val) {
|
||||
if (val.length) { // 分配角色信息
|
||||
await this.addrolesList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.jointRoomInfo': function (val) {
|
||||
if (val.creatorId) { // 房间消息
|
||||
this.handleRoomInfo(val);
|
||||
'$store.state.socket.jointRoomInfo': async function (val) {
|
||||
if (val.creatorId) { // 房间消息
|
||||
await this.handleRoomInfo(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.userRoomKickOut': function (val) {
|
||||
if (val.id) { // 用户被踢出信息
|
||||
val.state = '03';
|
||||
this.addPeopleList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.userPermit': function (val) {
|
||||
if (val.id) { // 用户扫码信息
|
||||
'$store.state.socket.userPermit': async function (val) {
|
||||
if (val.id) { // 用户扫码信息
|
||||
val.state = '01';
|
||||
this.addPeopleList(val);
|
||||
await this.addPeopleList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.userInRoom': function (val) {
|
||||
if (val.id) { // 用户从外部进入房间消息
|
||||
val.state = '02';
|
||||
this.addPeopleList(val);
|
||||
'$store.state.socket.userRoomKickOut': async function (val) {
|
||||
if (val.id) { // 用户被踢出信息
|
||||
val.state = '03';
|
||||
await this.addPeopleList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.userOutRoom': function (val) {
|
||||
if (val.id) { // 用户退出房间消息
|
||||
'$store.state.socket.userInRoom': async function (val) {
|
||||
if (val.id) { // 用户从外部进入房间消息
|
||||
val.state = '02';
|
||||
this.addPeopleList(val);
|
||||
await this.addPeopleList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.userOutRoom': async function (val) {
|
||||
if (val.id) { // 用户退出房间消息
|
||||
val.state = '02';
|
||||
await this.addPeopleList(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -336,6 +398,18 @@ export default {
|
||||
}, 5000 * 60);
|
||||
},
|
||||
methods: {
|
||||
computePermissionRest() {
|
||||
this.permissionRest = this.roomInfo.permissionNum > 0
|
||||
?this.roomInfo.permissionNum - [
|
||||
...this.adminList,
|
||||
...this.dispatchList,
|
||||
...this.equipmentList,
|
||||
...this.driverList,
|
||||
...this.signalList,
|
||||
...this.ibpList,
|
||||
...this.bigScreenList
|
||||
].length - 1: 0;
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
@ -349,6 +423,7 @@ export default {
|
||||
roomName: data.roomName,
|
||||
state: data.state
|
||||
};
|
||||
|
||||
if (data.state == '03') { // 房间销毁
|
||||
this.$router.push({ path: `/demonstration/detail/${param.mapId}` });
|
||||
} else if (data.state == '01') { // 进入准备中
|
||||
@ -414,6 +489,7 @@ export default {
|
||||
this.addrolesList(arr); // 删除角色信息
|
||||
}
|
||||
}
|
||||
this.computePermissionRest();
|
||||
},
|
||||
// 分配角色
|
||||
addrolesList(list) {
|
||||
@ -421,74 +497,75 @@ export default {
|
||||
switch (item.userRole) {
|
||||
case 'Instructor':
|
||||
this.adminList.push(item);
|
||||
this.num++;
|
||||
break;
|
||||
case 'Dispatcher':
|
||||
this.dispatchList.push(item);
|
||||
this.num++;
|
||||
break;
|
||||
case 'Attendant':
|
||||
this.equipmentList.forEach((nor, index) => {
|
||||
if (nor.id == item.id) { // 修改状态
|
||||
if (nor.id == item.id) {
|
||||
this.equipmentList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.equipmentList.push(item); // 新增
|
||||
this.num++;
|
||||
this.equipmentList.push(item);
|
||||
break;
|
||||
case 'Driver':
|
||||
this.driverList.push(item);
|
||||
this.num++;
|
||||
break;
|
||||
case 'Repair':
|
||||
this.signalList.push(item);
|
||||
this.num++;
|
||||
break;
|
||||
case 'IBP':
|
||||
this.ibpList.forEach((nor, index) => {
|
||||
if (nor.id == item.id) {
|
||||
this.ibpList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
this.ibpList.push(item);
|
||||
this.num++;
|
||||
break;
|
||||
case 'BigScreen':
|
||||
this.bigScreenList.push(item);
|
||||
break;
|
||||
default:
|
||||
this.dispatchList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.dispatchList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.equipmentList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.equipmentList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.adminList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.adminList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.driverList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.driverList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.signalList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.signalList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.ibpList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.ibpList.splice(index, 1);
|
||||
this.num--;
|
||||
}
|
||||
});
|
||||
this.bigScreenList.forEach((nor, index) => {
|
||||
if (item.id == nor.id) {
|
||||
this.bigScreenList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.computePermissionRest();
|
||||
},
|
||||
async getRoomInfo() {
|
||||
// 获取房间信息 创建人和权限总数
|
||||
@ -507,23 +584,11 @@ export default {
|
||||
|
||||
// 获取设备集中站
|
||||
const resp = await getStationList(res.data.mapId);
|
||||
resp.data.forEach(item => {
|
||||
if (item.centralized) {
|
||||
this.stationList.push(item);
|
||||
}
|
||||
});
|
||||
this.stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
this.equipmentList.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
this.stationList = resp.data;
|
||||
this.computePermissionRest();
|
||||
},
|
||||
// 获取观众席list 分配角色 Admin 管理员 Instructor 教员 Dispatcher 行调 Attendant 车站 Audience 观众 Driver 司机 Repair 通号 IBP IBP盘
|
||||
async getUserList() {
|
||||
this.num = 0;
|
||||
this.dispatchList = [];
|
||||
this.equipmentList = [];
|
||||
this.adminList = [];
|
||||
@ -535,7 +600,6 @@ export default {
|
||||
if (item.id == this.userId) {
|
||||
item.disabled = true;
|
||||
}
|
||||
if (item.userRole != 'Audience' && item.userRole != '') this.num++;
|
||||
switch (item.userRole) {
|
||||
case 'Instructor':
|
||||
item.select = true;
|
||||
@ -561,9 +625,14 @@ export default {
|
||||
item.select = true;
|
||||
this.ibpList.push(item);
|
||||
break;
|
||||
case 'BigScreen':
|
||||
item.select = true;
|
||||
this.bigScreenList.push(item);
|
||||
break;
|
||||
}
|
||||
this.treeData.push(item);
|
||||
});
|
||||
this.computePermissionRest();
|
||||
},
|
||||
async postCode() {
|
||||
this.loading = true;
|
||||
@ -636,24 +705,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置所属集中站信息
|
||||
changeEquipment(val) {
|
||||
const params = [{
|
||||
id: val.id,
|
||||
nickName: val.nickName,
|
||||
userRole: 'Attendant',
|
||||
deviceCode: val.deviceCode
|
||||
}];
|
||||
putUserRoles(params, this.$route.query.group);
|
||||
this.stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
this.equipmentList.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 打开弹窗
|
||||
addingRoles(name, title) {
|
||||
this.listName = name;
|
||||
@ -676,24 +727,27 @@ export default {
|
||||
userRole: ''
|
||||
};
|
||||
switch (this.listName) {
|
||||
case 'admin': // 教员
|
||||
case 'admin': // 教员
|
||||
params.userRole = 'Instructor';
|
||||
break;
|
||||
case 'dispatch': // 调度员
|
||||
case 'dispatch': // 调度员
|
||||
params.userRole = 'Dispatcher';
|
||||
break;
|
||||
case 'equipment': // 车站值班员
|
||||
case 'equipment': // 车站值班员
|
||||
params.userRole = 'Attendant';
|
||||
break;
|
||||
case 'driver': // 司机
|
||||
case 'driver': // 司机
|
||||
params.userRole = 'Driver';
|
||||
break;
|
||||
case 'signal': // 通号
|
||||
case 'signal': // 通号
|
||||
params.userRole = 'Repair';
|
||||
break;
|
||||
case 'ibp': // IBP
|
||||
case 'ibp': // IBP
|
||||
params.userRole = 'IBP';
|
||||
break;
|
||||
case 'bigScreen': // 大屏
|
||||
params.userRole = 'BigScreen';
|
||||
break;
|
||||
}
|
||||
arr.push(params);
|
||||
});
|
||||
@ -712,7 +766,7 @@ export default {
|
||||
this.messageInfo('分配角色数量已超过可分配角色总数!', 'error');
|
||||
}
|
||||
this.treeData.forEach(item => {
|
||||
if (item.userRole == '' || item.userRole == 'Audience') {
|
||||
if (item.userRole == '' || item.userRole == 'Audience' || item.userRole == 'IBP') {
|
||||
item.select = false;
|
||||
}
|
||||
});
|
||||
@ -728,15 +782,32 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleChangeUser(val, role, stationList, list) {
|
||||
const params = [{
|
||||
id: val.id,
|
||||
nickName: val.nickName,
|
||||
userRole: role,
|
||||
deviceCode: val.deviceCode
|
||||
}];
|
||||
putUserRoles(params, this.$route.query.group);
|
||||
stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
list.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDelUser(list, item, index) {
|
||||
list.splice(index, 1);
|
||||
this.handleProperty(item);
|
||||
},
|
||||
handleDelEquipment(item, index) {
|
||||
this.equipmentList.splice(index, 1);
|
||||
this.stationList.forEach(item => {
|
||||
handleDelUserForStation(item, index, stationList, list) {
|
||||
list.splice(index, 1);
|
||||
stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
this.equipmentList.forEach(nor => {
|
||||
list.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
@ -744,10 +815,9 @@ export default {
|
||||
});
|
||||
this.handleProperty(item);
|
||||
},
|
||||
handleProperty(item) {
|
||||
handleProperty(item, role) {
|
||||
const treeIndex = this.treeData.findIndex(nor => nor.id == item.id);
|
||||
if (treeIndex > -1) {
|
||||
this.num--;
|
||||
this.treeData[treeIndex]['select'] = false;
|
||||
this.treeData[treeIndex].userRole = 'Audience';
|
||||
}
|
||||
@ -851,15 +921,14 @@ export default {
|
||||
}
|
||||
|
||||
.personnel {
|
||||
padding: 0px 20px;
|
||||
width: calc(100% - 500px);
|
||||
height: calc(100% - 60px);
|
||||
height: calc(100% - 120px);
|
||||
float: left;
|
||||
|
||||
.Scheduling {
|
||||
width: calc(50% - 10px);
|
||||
float: left;
|
||||
height: 250px;
|
||||
height: 240px;
|
||||
border: 1px solid #ccc;
|
||||
margin-bottom: 20px;
|
||||
overflow-y: scroll;
|
||||
@ -880,10 +949,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.bottomNone {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.selectPerson {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
@ -905,9 +970,11 @@ export default {
|
||||
}
|
||||
|
||||
.start-box {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background: #f1f1f1;
|
||||
padding: 20px 0px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1325px) {
|
||||
|
Loading…
Reference in New Issue
Block a user