Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
41f70aadd8
@ -343,11 +343,12 @@ export function competitionPracticalSceneExit(group) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 退出场景 */
|
/** 结束场景 */
|
||||||
export function competitionPracticalSceneFinish(group) {
|
export function competitionPracticalSceneFinish(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/v1/competitionPractical/finish/${group}`,
|
url: `/api/v1/competitionPractical/finish/${group}`,
|
||||||
method: 'PUT'
|
method: 'PUT',
|
||||||
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,12 +360,3 @@ export function getEmptyOperationalStatistics(group) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交运营数据 */
|
|
||||||
export function submitOperationalStatistics(group, data) {
|
|
||||||
return request({
|
|
||||||
url: `/api/v1/competitionPractical/detail/os/${group}`,
|
|
||||||
method: 'PUT',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
67
src/api/rpTools.js
Normal file
67
src/api/rpTools.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运行图数据
|
||||||
|
*/
|
||||||
|
export function getRpTools() {
|
||||||
|
return request({
|
||||||
|
url: '/api/rpTools',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加车次
|
||||||
|
*/
|
||||||
|
export function addRpTrip(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/rpTools/trip',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改到站时间
|
||||||
|
*/
|
||||||
|
export function justTripNoArrival(tripNo, data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/rpTools/${tripNo}/arrival`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改发车时间
|
||||||
|
*/
|
||||||
|
export function justTripNoDeparture(tripNo, data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/rpTools/${tripNo}/departure`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平移车次
|
||||||
|
*/
|
||||||
|
export function translateTripNo(tripNo, data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/rpTools/${tripNo}/trip`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车次
|
||||||
|
*/
|
||||||
|
export function deleteTripNo(tripNo) {
|
||||||
|
return request({
|
||||||
|
url: `/api/rpTools/${tripNo}/trip`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
BIN
src/assets/yuyin.png
Normal file
BIN
src/assets/yuyin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -18,7 +18,7 @@ class Iscs {
|
|||||||
this.methods = opts.methods;
|
this.methods = opts.methods;
|
||||||
|
|
||||||
// 鼠标事件
|
// 鼠标事件
|
||||||
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu', Keyboard: 'keyboard'};
|
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu', Keyboard: 'keyboard', dblclick: 'dblclick'};
|
||||||
|
|
||||||
// 设备数据
|
// 设备数据
|
||||||
this.iscsDevice = {};
|
this.iscsDevice = {};
|
||||||
@ -275,6 +275,9 @@ class Iscs {
|
|||||||
case this.events.Selected:
|
case this.events.Selected:
|
||||||
this.$mouseController.on(this.events.Selected, cb, context);
|
this.$mouseController.on(this.events.Selected, cb, context);
|
||||||
break;
|
break;
|
||||||
|
case this.events.dblclick:
|
||||||
|
this.$mouseController.on(this.events.dblclick, cb, context);
|
||||||
|
break;
|
||||||
case this.events.Contextmenu:
|
case this.events.Contextmenu:
|
||||||
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
||||||
break;
|
break;
|
||||||
@ -295,6 +298,9 @@ class Iscs {
|
|||||||
case this.events.Selected:
|
case this.events.Selected:
|
||||||
this.$mouseController.off(this.events.Selected, cb);
|
this.$mouseController.off(this.events.Selected, cb);
|
||||||
break;
|
break;
|
||||||
|
case this.events.dblclick:
|
||||||
|
this.$mouseController.off(this.events.dblclick, cb);
|
||||||
|
break;
|
||||||
case this.events.Contextmenu:
|
case this.events.Contextmenu:
|
||||||
this.$mouseController.off(this.events.Contextmenu, cb);
|
this.$mouseController.off(this.events.Contextmenu, cb);
|
||||||
break;
|
break;
|
||||||
|
@ -7,20 +7,20 @@ class KeyboardController extends Eventful {
|
|||||||
this.$iscs = iscs;
|
this.$iscs = iscs;
|
||||||
this.$zr = iscs.getZr();
|
this.$zr = iscs.getZr();
|
||||||
this.events = iscs.getEvents();
|
this.events = iscs.getEvents();
|
||||||
this.initHandler(this.$zr);
|
this.initHandler(this.$zr);
|
||||||
}
|
}
|
||||||
|
|
||||||
initHandler(zr) {
|
initHandler(zr) {
|
||||||
if (zr) {
|
if (zr) {
|
||||||
var keydownHandle = this.keydown.bind(this);
|
var keydownHandle = this.keydown.bind(this);
|
||||||
var dom = this.$zr.dom;
|
var dom = this.$zr.dom;
|
||||||
|
|
||||||
this.enable = function (opts) {
|
this.enable = function (opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
this._keyOnDownUp = opts.keyOnDownUp || true;
|
this._keyOnDownUp = opts.keyOnDownUp || true;
|
||||||
|
|
||||||
dom.addEventListener('keyup', keydownHandle, false);
|
dom.addEventListener('keyup', keydownHandle, false);
|
||||||
dom.focus();
|
dom.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.disable = function () {
|
this.disable = function () {
|
||||||
@ -35,7 +35,7 @@ class KeyboardController extends Eventful {
|
|||||||
|
|
||||||
keydown(e) {
|
keydown(e) {
|
||||||
if (this._keyOnDownUp && !e.repeat) {
|
if (this._keyOnDownUp && !e.repeat) {
|
||||||
const currentEvent = keyboardEvents[e.key.toUpperCase()]||{event:""};
|
const currentEvent = keyboardEvents[e.key.toUpperCase()] || {event:''};
|
||||||
this.trigger(this.events.Keyboard, currentEvent.event);
|
this.trigger(this.events.Keyboard, currentEvent.event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ class MouseController extends Eventful {
|
|||||||
zr.on('mousedown', this.mousedown, this);
|
zr.on('mousedown', this.mousedown, this);
|
||||||
zr.on('mousemove', this.mousemove, this);
|
zr.on('mousemove', this.mousemove, this);
|
||||||
zr.on('mouseup', this.mouseup, this);
|
zr.on('mouseup', this.mouseup, this);
|
||||||
|
zr.on('dblclick', this.dblclick, this);
|
||||||
zr.on('touchstart', this.mousedown, this);
|
zr.on('touchstart', this.mousedown, this);
|
||||||
zr.on('touchmove', this.mousemove, this);
|
zr.on('touchmove', this.mousemove, this);
|
||||||
zr.on('touchend', this.mouseup, this);
|
zr.on('touchend', this.mouseup, this);
|
||||||
@ -66,6 +67,7 @@ class MouseController extends Eventful {
|
|||||||
zr.off('touchstart', this.mousedown);
|
zr.off('touchstart', this.mousedown);
|
||||||
zr.off('touchmove', this.mousemove);
|
zr.off('touchmove', this.mousemove);
|
||||||
zr.off('touchend', this.mouseup);
|
zr.off('touchend', this.mouseup);
|
||||||
|
zr.off('dblclick', this.dblclick);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.dispose = function () {
|
this.dispose = function () {
|
||||||
@ -83,11 +85,16 @@ class MouseController extends Eventful {
|
|||||||
this.isAllowDragging = data;
|
this.isAllowDragging = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dblclick(e) {
|
||||||
|
var em = this.checkEvent(e);
|
||||||
|
this.trigger(this.events.dblclick, em);
|
||||||
|
}
|
||||||
|
|
||||||
mousedown(e) {
|
mousedown(e) {
|
||||||
e.event.preventDefault();
|
e.event.preventDefault();
|
||||||
e.event.stopPropagation();
|
e.event.stopPropagation();
|
||||||
const em = new EventModel(e);
|
const em = new EventModel(e);
|
||||||
this.$zr.dom.focus();
|
this.$zr.dom.focus();
|
||||||
this.eventTarget = em.eventTarget;
|
this.eventTarget = em.eventTarget;
|
||||||
this._offsetX = e.offsetX;
|
this._offsetX = e.offsetX;
|
||||||
this._offsetY = e.offsetY;
|
this._offsetY = e.offsetY;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
export default class rect extends Group {
|
export default class rect extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
@ -10,24 +11,36 @@ export default class rect extends Group {
|
|||||||
this.zlevel = device.model.zlevel;
|
this.zlevel = device.model.zlevel;
|
||||||
this.z = device.model.z;
|
this.z = device.model.z;
|
||||||
this.create();
|
this.create();
|
||||||
|
this.createMouseEvent();
|
||||||
|
}
|
||||||
|
createMouseEvent() {
|
||||||
|
this.on('mouseout', (e) => {
|
||||||
|
this.hide();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
|
let rect = null;
|
||||||
|
for (const key in this.model.elemMap) {
|
||||||
|
if (!rect) {
|
||||||
|
rect = Vue.prototype.$iscs.iscsDevice[key].instance.getBoundingRect();
|
||||||
|
} else {
|
||||||
|
rect.union(Vue.prototype.$iscs.iscsDevice[key].instance.getBoundingRect());
|
||||||
|
}
|
||||||
|
}
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.grouper = new Group({
|
this.grouper = new Group({
|
||||||
id: model.code,
|
id: model.code,
|
||||||
position: [model.point.x, model.point.y]
|
position: [rect.x, rect.y]
|
||||||
});
|
});
|
||||||
console.log(model);
|
|
||||||
// 处理内部元素的包围框
|
// 处理内部元素的包围框
|
||||||
const rectWidth = 120;
|
const rectWidth = rect.width + 10;
|
||||||
const rectHeight = 60;
|
const rectHeight = rect.height + 10;
|
||||||
this.iscsRect = new Rect({
|
this.iscsRect = new Rect({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: 15, // 层级最高
|
||||||
z2: model.z2 || 0,
|
|
||||||
shape: {
|
shape: {
|
||||||
x: 0,
|
x: -5,
|
||||||
y: 0,
|
y: -5,
|
||||||
width: rectWidth,
|
width: rectWidth,
|
||||||
height: rectHeight
|
height: rectHeight
|
||||||
},
|
},
|
||||||
@ -39,9 +52,16 @@ export default class rect extends Group {
|
|||||||
});
|
});
|
||||||
this.grouper.add(this.iscsRect);
|
this.grouper.add(this.iscsRect);
|
||||||
this.add(this.grouper);
|
this.add(this.grouper);
|
||||||
|
this.grouper.hide();
|
||||||
}
|
}
|
||||||
setModel(dx, dy) {
|
setModel(dx, dy) {
|
||||||
this.model.point.x += dx;
|
this.model.point.x += dx;
|
||||||
this.model.point.y += dy;
|
this.model.point.y += dy;
|
||||||
}
|
}
|
||||||
|
show() {
|
||||||
|
this.grouper.show();
|
||||||
|
}
|
||||||
|
hide() {
|
||||||
|
this.grouper.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
export default class iscsCircle extends Group {
|
export default class iscsCircle extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
@ -8,8 +9,19 @@ export default class iscsCircle extends Group {
|
|||||||
this._type = device.model._type;
|
this._type = device.model._type;
|
||||||
this._code = device.model.code;
|
this._code = device.model.code;
|
||||||
this.zlevel = device.model.zlevel;
|
this.zlevel = device.model.zlevel;
|
||||||
this.z = device.model.z;
|
this.z = device.model.z;
|
||||||
this.create();
|
this.create();
|
||||||
|
if (this.model.groupId) {
|
||||||
|
this.createMouseEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createMouseEvent() {
|
||||||
|
// this.on('mouseout', (e) => {
|
||||||
|
// Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.hide();
|
||||||
|
// });
|
||||||
|
this.on('mouseover', (e) => {
|
||||||
|
Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
@ -19,8 +31,8 @@ export default class iscsCircle extends Group {
|
|||||||
});
|
});
|
||||||
this.iscsCircle = new Circle({
|
this.iscsCircle = new Circle({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
z2: model.z2||0,
|
z2: model.z2 || 0,
|
||||||
shape: {
|
shape: {
|
||||||
cx:this.model.radius,
|
cx:this.model.radius,
|
||||||
cy:this.model.radius,
|
cy:this.model.radius,
|
||||||
@ -35,8 +47,18 @@ export default class iscsCircle extends Group {
|
|||||||
this.grouper.add(this.iscsCircle);
|
this.grouper.add(this.iscsCircle);
|
||||||
this.add(this.grouper);
|
this.add(this.grouper);
|
||||||
}
|
}
|
||||||
|
setState(model) {
|
||||||
|
this.iscsCircle.setStyle('fill', model.fillColor);
|
||||||
|
this.iscsCircle.setStyle('stroke', model.strokeColor);
|
||||||
|
}
|
||||||
setModel(dx, dy) {
|
setModel(dx, dy) {
|
||||||
this.model.point.x += dx;
|
this.model.point.x += dx;
|
||||||
this.model.point.y += dy;
|
this.model.point.y += dy;
|
||||||
}
|
}
|
||||||
|
getBoundingRect() {
|
||||||
|
const rect = this.iscsCircle.getBoundingRect().clone();
|
||||||
|
rect.x = rect.x + this.model.point.x;
|
||||||
|
rect.y = rect.y + this.model.point.y;
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
export default class rect extends Group {
|
export default class rect extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
@ -10,6 +11,18 @@ export default class rect extends Group {
|
|||||||
this.zlevel = device.model.zlevel;
|
this.zlevel = device.model.zlevel;
|
||||||
this.z = device.model.z;
|
this.z = device.model.z;
|
||||||
this.create();
|
this.create();
|
||||||
|
if (this.model.groupId) {
|
||||||
|
this.createMouseEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
createMouseEvent() {
|
||||||
|
// this.on('mouseout', (e) => {
|
||||||
|
// Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.hide();
|
||||||
|
// });
|
||||||
|
this.on('mouseover', (e) => {
|
||||||
|
Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
@ -46,4 +59,10 @@ export default class rect extends Group {
|
|||||||
this.model.point.x += dx;
|
this.model.point.x += dx;
|
||||||
this.model.point.y += dy;
|
this.model.point.y += dy;
|
||||||
}
|
}
|
||||||
|
getBoundingRect() {
|
||||||
|
const rect = this.iscsRect.getBoundingRect().clone();
|
||||||
|
rect.x = rect.x + this.model.point.x;
|
||||||
|
rect.y = rect.y + this.model.point.y;
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Text from 'zrender/src/graphic/Text';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
export default class text extends Group {
|
export default class text extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
@ -10,6 +11,17 @@ export default class text extends Group {
|
|||||||
this.zlevel = device.model.zlevel;
|
this.zlevel = device.model.zlevel;
|
||||||
this.z = device.model.z;
|
this.z = device.model.z;
|
||||||
this.create();
|
this.create();
|
||||||
|
if (this.model.groupId) {
|
||||||
|
this.createMouseEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createMouseEvent() {
|
||||||
|
// this.on('mouseout', (e) => {
|
||||||
|
// Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.hide();
|
||||||
|
// });
|
||||||
|
this.on('mouseover', (e) => {
|
||||||
|
Vue.prototype.$iscs.iscsDevice[this.model.groupId].instance.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
@ -61,4 +73,10 @@ export default class text extends Group {
|
|||||||
this.model.width = width;
|
this.model.width = width;
|
||||||
this.model.height = height;
|
this.model.height = height;
|
||||||
}
|
}
|
||||||
|
getBoundingRect() {
|
||||||
|
const rect = this.textName.getBoundingRect().clone();
|
||||||
|
rect.x = rect.x + this.model.point.x;
|
||||||
|
rect.y = rect.y + this.model.point.y;
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
Fixed: { lab: 'Fixed', describe: '状态值不做处理,请选择该类型'}, // 固定值
|
Fixed: { lab: 'Fixed', describe: '状态值不做处理'}, // 固定值
|
||||||
A: { lab: 'a', describe: '文字 远/近 状态转换类型'}, // 远
|
A: { lab: 'a', describe: '文字远/近类型'}, // 远
|
||||||
B: { lab: 'b', describe: '开关阀门矩形 状态转换类型'}, // 红框 阀门
|
B: { lab: 'b', describe: '开关阀门类型'}, // 红框 阀门
|
||||||
C: { lab: 'c', describe: '电流电压文字转换类型'} // 数组
|
C: { lab: 'c', describe: '电流电压类型'} // 数组
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default {
|
||||||
A: { lab: 'a', describe: '自定义模板类型'} // 远 红框 阀门
|
A: { lab: 'a', describe: '自定义模板类型' } // 远 红框 阀门
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,10 @@ export default {
|
|||||||
{type: elType.A},
|
{type: elType.A},
|
||||||
{type: elType.B},
|
{type: elType.B},
|
||||||
{type: elType.C}
|
{type: elType.C}
|
||||||
|
],
|
||||||
|
statusList: [
|
||||||
|
{ key: 'valve', value: true, des: '某某开关分闸', childList: [{type: 'b', status: 'stateB'}] },
|
||||||
|
{ key: 'valve', value: false, des: '某某开关分闸', childList: [{type: 'b', status: 'stateA'}] }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -17,12 +17,13 @@ class TransformHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
revisibleView(view) {
|
revisibleView(view) {
|
||||||
if (this.checkVisible(view)) {
|
if (view._type != 'IscsGroup') {
|
||||||
view.show();
|
if (this.checkVisible(view)) {
|
||||||
} else {
|
view.show();
|
||||||
view.hide();
|
} else {
|
||||||
|
view.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
view.dirty();
|
view.dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ export function parser(data) {
|
|||||||
zrUtil.each(data.fuzhouPsdList || [], elem=> {
|
zrUtil.each(data.fuzhouPsdList || [], elem=> {
|
||||||
iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouPsd, elem);
|
iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouPsd, elem);
|
||||||
});
|
});
|
||||||
zrUtil.each(data.IscsGroupList || [], elem=> {
|
zrUtil.each(data.iscsGroupList || [], elem=> {
|
||||||
iscsDevice[elem.code] = deviceFactory(deviceType.IscsGroup, elem);
|
iscsDevice[elem.code] = deviceFactory(deviceType.IscsGroup, elem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -333,8 +333,13 @@ export function JLmap3dEdit(dom, data, mapid) {
|
|||||||
plane2.stopType = "right";
|
plane2.stopType = "right";
|
||||||
plane1.rotation.y = Math.PI/2;
|
plane1.rotation.y = Math.PI/2;
|
||||||
plane2.rotation.y = Math.PI/2;
|
plane2.rotation.y = Math.PI/2;
|
||||||
plane1.position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].leftStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
let leftpos = scope.mapdata.sectionlist.sections.datalist[k].leftStopPercent*(scope.mapdata.sectionlist.sections.datalist[k].railpoint[2].x -scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x)+scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x;
|
||||||
plane2.position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].rightStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
let rightpos = scope.mapdata.sectionlist.sections.datalist[k].rightStopPercent*(scope.mapdata.sectionlist.sections.datalist[k].railpoint[2].x -scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x)+scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x;
|
||||||
|
console.log("==========");
|
||||||
|
console.log(scope.mapdata.sectionlist.sections.datalist[k].leftStopPercent);
|
||||||
|
console.log(scope.mapdata.sectionlist.sections.datalist[k].rightStopPercent);
|
||||||
|
plane1.position.set(leftpos,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||||
|
plane2.position.set(rightpos,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
|
||||||
stationStopGroup.add(plane1);
|
stationStopGroup.add(plane1);
|
||||||
stationStopGroup.add(plane2);
|
stationStopGroup.add(plane2);
|
||||||
}
|
}
|
||||||
|
@ -989,7 +989,7 @@ export function SectionList() {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log(scope.sections.datalist);
|
|
||||||
for(let i=0;i<section2d.length;i++){
|
for(let i=0;i<section2d.length;i++){
|
||||||
if(section2d[i].type == "01" || section2d[i].type == "03"){
|
if(section2d[i].type == "01" || section2d[i].type == "03"){
|
||||||
if(scope.sections.datalist[section2d[i].code]){
|
if(scope.sections.datalist[section2d[i].code]){
|
||||||
@ -1003,9 +1003,11 @@ export function SectionList() {
|
|||||||
scope.sections.datalist[section2d[i].code].standLeftY = section2d[i].points[0].y;
|
scope.sections.datalist[section2d[i].code].standLeftY = section2d[i].points[0].y;
|
||||||
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
|
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
|
||||||
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
|
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
|
||||||
|
|
||||||
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
|
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
|
||||||
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+120;
|
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+120;
|
||||||
|
scope.sections.datalist[section2d[i].code].leftStopPercent = section2d[i].leftStopPointOffset/section2d[i].lengthFact;
|
||||||
|
scope.sections.datalist[section2d[i].code].rightStopPercent = section2d[i].rightStopPointOffset/section2d[i].lengthFact;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
|||||||
|
|
||||||
renderer.setClearColor(new THREE.Color(0x000000));
|
renderer.setClearColor(new THREE.Color(0x000000));
|
||||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||||
|
renderer.sortObjects = true;
|
||||||
windowWidth = dom.offsetWidth ;
|
windowWidth = dom.offsetWidth ;
|
||||||
windowHeight = dom.offsetHeight;
|
windowHeight = dom.offsetHeight;
|
||||||
|
|
||||||
@ -1307,6 +1307,13 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
|||||||
|
|
||||||
fclip = new THREE.AnimationClip("four",2,ntracks2);
|
fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||||
|
|
||||||
|
object.traverse( function ( child ) {
|
||||||
|
|
||||||
|
if ( child.isMesh ) {
|
||||||
|
child.renderOrder = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
toptrain = object.clone(true);
|
toptrain = object.clone(true);
|
||||||
@ -1452,6 +1459,13 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
station = object;
|
station = object;
|
||||||
|
object.traverse( function ( child ) {
|
||||||
|
|
||||||
|
if ( child.isMesh ) {
|
||||||
|
child.renderOrder = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
} );
|
||||||
// console.log(deviceaction);
|
// console.log(deviceaction);
|
||||||
scene.add(object);
|
scene.add(object);
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,3);
|
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,1.3);
|
||||||
// assetloader.setmodellistnew(netdata.assets);
|
// assetloader.setmodellistnew(netdata.assets);
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,34 +23,34 @@ export default class ELimitLines extends Group {
|
|||||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||||
if (x == Infinity) { x = 0; }
|
if (x == Infinity) { x = 0; }
|
||||||
if (y == Infinity) { y = 0; }
|
if (y == Infinity) { y = 0; }
|
||||||
if (model.switch) {
|
// if (model.switch) {
|
||||||
// 上侧临时限速线
|
// 上侧临时限速线
|
||||||
const speedLimitLeft = this.createLimit({
|
const speedLimitLeft = this.createLimit({
|
||||||
position: [x, -y],
|
position: [x, -y],
|
||||||
switch: model.switch,
|
switch: model.switch,
|
||||||
code: model.code,
|
code: model.code,
|
||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: model.points
|
||||||
});
|
});
|
||||||
// 下侧临时限速线
|
// 下侧临时限速线
|
||||||
const speedLimitRight = this.createLimit({
|
const speedLimitRight = this.createLimit({
|
||||||
position: [-x, y],
|
position: [-x, y],
|
||||||
switch: model.switch,
|
switch: model.switch,
|
||||||
code: model.code,
|
code: model.code,
|
||||||
isSwitchSection: model.switchSection,
|
isSwitchSection: model.switchSection,
|
||||||
relSwitchCode: model.relSwitchCode,
|
relSwitchCode: model.relSwitchCode,
|
||||||
isCurve: model.curve, // 是否曲线
|
isCurve: model.curve, // 是否曲线
|
||||||
points: model.points
|
points: model.points
|
||||||
});
|
});
|
||||||
speedLimitLeft.forEach(item => {
|
speedLimitLeft.forEach(item => {
|
||||||
this.add(item);
|
this.add(item);
|
||||||
});
|
});
|
||||||
speedLimitRight.forEach(item => {
|
speedLimitRight.forEach(item => {
|
||||||
this.add(item);
|
this.add(item);
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
129
src/jmapNew/theme/aus_00/planConvert.js
Normal file
129
src/jmapNew/theme/aus_00/planConvert.js
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
/** 边缘高度*/
|
||||||
|
EdgeHeight: 600,
|
||||||
|
|
||||||
|
/** 间隔高度*/
|
||||||
|
CoordMultiple: 1,
|
||||||
|
|
||||||
|
/** 偏移时间*/
|
||||||
|
TranslationTime: 0,
|
||||||
|
|
||||||
|
/** 将后台数据解析成图表*/
|
||||||
|
convertDataToModels(tripList, stations, kmRangeCoordMap, lineStyle) {
|
||||||
|
var models = [];
|
||||||
|
/** 按车次遍历数据*/
|
||||||
|
if (tripList && tripList.length) {
|
||||||
|
tripList.forEach(trip => {
|
||||||
|
const opt = { name: `run-${trip.tripNo}`, type: 'line', markPoint: { data: [] }, data: []};
|
||||||
|
|
||||||
|
if (trip.tripNo &&
|
||||||
|
trip.stationTimeList.length) {
|
||||||
|
opt.markPoint.data.push(createMartPointReverse({
|
||||||
|
name: `${trip.tripNo}`,
|
||||||
|
color: '#000' || lineStyle.color,
|
||||||
|
coord: [
|
||||||
|
trip.stationTimeList[0].arrivalTime,
|
||||||
|
this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 计算停站点坐标集合*/
|
||||||
|
trip.stationTimeList.forEach(elem => {
|
||||||
|
if (elem.arrivalTime) {
|
||||||
|
opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elem.departureTime) {
|
||||||
|
opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
models.push(opt);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(models);
|
||||||
|
|
||||||
|
return models;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 更新数据并解析成图表*/
|
||||||
|
updateDataToModels(tripList, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||||
|
if (tripList && tripList.length) {
|
||||||
|
}
|
||||||
|
return series;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 初始化Y轴*/
|
||||||
|
initializeYaxis(stations) {
|
||||||
|
return createMarkLineModels(stations, (elem) => {
|
||||||
|
return this.EdgeHeight + elem.kmRange * this.CoordMultiple;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 将后台数据转换为试图序列模型*/
|
||||||
|
convertStationsToMap(stations) {
|
||||||
|
var map = {};
|
||||||
|
if (stations && stations.length) {
|
||||||
|
stations.forEach((elem) => {
|
||||||
|
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 计算y轴最小值*/
|
||||||
|
computedYaxisMinValue(stations) {
|
||||||
|
return stations[0].kmRange * this.CoordMultiple;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 计算y轴最大值*/
|
||||||
|
computedYaxisMaxValue(stations) {
|
||||||
|
return stations[stations.length - 1].kmRange * this.CoordMultiple + this.EdgeHeight * 2;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 格式化y轴数据*/
|
||||||
|
computedFormatYAxis(stations, params) {
|
||||||
|
var yText = '0m';
|
||||||
|
|
||||||
|
stations.forEach(elem => {
|
||||||
|
if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) {
|
||||||
|
yText = Math.floor(elem.kmRange) + 'm';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return yText;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/
|
||||||
|
computedReentryNumber(code) {
|
||||||
|
// return parseInt(code || 1) % 2 ? 1 : 2;
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 根据方向计算y折返偏移量*/
|
||||||
|
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
|
||||||
|
if (directionCode === '1') {
|
||||||
|
defaultVlue += this.EdgeHeight / 2 * num;
|
||||||
|
} else if (directionCode === '2') {
|
||||||
|
defaultVlue -= this.EdgeHeight / 2 * num;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultVlue;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 根据elem计算y值*/
|
||||||
|
getCoordYByElem(stations, kmRangeCoordMap, elem) {
|
||||||
|
var defaultVlue = 0;
|
||||||
|
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||||
|
if (station) {
|
||||||
|
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultVlue;
|
||||||
|
}
|
||||||
|
};
|
@ -2,6 +2,7 @@ class Theme {
|
|||||||
constructor(code) {
|
constructor(code) {
|
||||||
this._code = '02';
|
this._code = '02';
|
||||||
this._mapMenu = {
|
this._mapMenu = {
|
||||||
|
'00': 'aus_00',
|
||||||
'01': 'chengdu_01',
|
'01': 'chengdu_01',
|
||||||
'02': 'fuzhou_01',
|
'02': 'fuzhou_01',
|
||||||
'03': 'beijing_01',
|
'03': 'beijing_01',
|
||||||
|
@ -86,6 +86,7 @@ const DemonstrationDetail = () => import('@/views/demonstration/detail/index');
|
|||||||
|
|
||||||
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
|
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
|
||||||
const PlanMonitorEditUserTool = () => import('@/views/planMonitor/editTool/userindex');
|
const PlanMonitorEditUserTool = () => import('@/views/planMonitor/editTool/userindex');
|
||||||
|
const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/index');
|
||||||
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
|
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
|
||||||
|
|
||||||
const DesignPlatformHome = () => import('@/views/designPlatform/home');
|
const DesignPlatformHome = () => import('@/views/designPlatform/home');
|
||||||
@ -369,12 +370,17 @@ export const publicAsyncRoute = [
|
|||||||
path: '/plan/usertool',
|
path: '/plan/usertool',
|
||||||
component: PlanMonitorEditUserTool,
|
component: PlanMonitorEditUserTool,
|
||||||
hidden: true
|
hidden: true
|
||||||
|
},
|
||||||
|
{ // 运行图编辑
|
||||||
|
path: '/plan/AUStool',
|
||||||
|
component: PlanMonitorEditAUSTool,
|
||||||
|
hidden: true
|
||||||
},
|
},
|
||||||
{ // 运行图编辑
|
{ // 运行图编辑
|
||||||
path: '/plan/tool',
|
path: '/plan/tool',
|
||||||
component: PlanMonitorEditTool,
|
component: PlanMonitorEditTool,
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/displayIscs/system',
|
path: '/displayIscs/system',
|
||||||
component: IscsSystem,
|
component: IscsSystem,
|
||||||
|
@ -128,7 +128,9 @@ export const DeviceMenu = {
|
|||||||
SetDriver: '106',
|
SetDriver: '106',
|
||||||
Script: '107',
|
Script: '107',
|
||||||
IscsSystem: '108',
|
IscsSystem: '108',
|
||||||
IscsInterface: '109'
|
IscsInterface: '109',
|
||||||
|
|
||||||
|
planAusContextMenu: '200'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,6 +16,7 @@ import scriptRecord from './modules/scriptRecord';
|
|||||||
import ibp from './modules/ibp';
|
import ibp from './modules/ibp';
|
||||||
import order from './modules/order';
|
import order from './modules/order';
|
||||||
import iscs from './modules/iscs';
|
import iscs from './modules/iscs';
|
||||||
|
import rpTools from './modules/rpTools';
|
||||||
|
|
||||||
import getters from './getters';
|
import getters from './getters';
|
||||||
|
|
||||||
@ -38,7 +39,8 @@ const store = new Vuex.Store({
|
|||||||
scriptRecord,
|
scriptRecord,
|
||||||
ibp,
|
ibp,
|
||||||
order,
|
order,
|
||||||
iscs
|
iscs,
|
||||||
|
rpTools
|
||||||
},
|
},
|
||||||
getters
|
getters
|
||||||
});
|
});
|
||||||
|
@ -33,6 +33,13 @@ const iscs = {
|
|||||||
updateDeviceData: (state) => {
|
updateDeviceData: (state) => {
|
||||||
return state.updateDeviceData;
|
return state.updateDeviceData;
|
||||||
},
|
},
|
||||||
|
iscsGroupList: (state) => {
|
||||||
|
if (state.iscs) {
|
||||||
|
return state.iscs.iscsGroupList || [];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
vidiconList: (state) => {
|
vidiconList: (state) => {
|
||||||
if (state.iscs) {
|
if (state.iscs) {
|
||||||
return state.iscs.vidiconList;
|
return state.iscs.vidiconList;
|
||||||
@ -129,6 +136,9 @@ const iscs = {
|
|||||||
},
|
},
|
||||||
selectedCount: (state) => {
|
selectedCount: (state) => {
|
||||||
return state.selectedCount;
|
return state.selectedCount;
|
||||||
|
},
|
||||||
|
getDeviceByCode: (state) => (code) => {
|
||||||
|
return state.iscsDevice[code];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
93
src/store/modules/rpTools.js
Normal file
93
src/store/modules/rpTools.js
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
const runPlan = {
|
||||||
|
namespaced: true,
|
||||||
|
|
||||||
|
state: {
|
||||||
|
stations: [], // 车站列表
|
||||||
|
planData: {}, // 运行图原始数据
|
||||||
|
editData: {}, // 运行图编辑数据
|
||||||
|
planSizeCount: 0, // 运行图canvas 大小变更标识
|
||||||
|
planLoadedCount: 0, // 运行图数据更新
|
||||||
|
planUpdateCount: 0, // 运行图更新标识
|
||||||
|
selected: {}, // 选择的对象
|
||||||
|
refreshCount: 0, // 刷新页面重新加载
|
||||||
|
width: 800, // 运行图canvas 容器 宽度
|
||||||
|
height: 600, // 运行图canvas 容器 高度
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
stations: (state) => {
|
||||||
|
return state.stations || [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
setWidth: (state, width) => {
|
||||||
|
state.width = width;
|
||||||
|
state.planSizeCount += 1;
|
||||||
|
},
|
||||||
|
setHeight: (state, height) => {
|
||||||
|
state.height = height;
|
||||||
|
state.planSizeCount += 1;
|
||||||
|
},
|
||||||
|
setStations: (state, stations) => {
|
||||||
|
state.stations = stations;
|
||||||
|
},
|
||||||
|
setPlanData: (state, data) => {
|
||||||
|
state.planData = data;
|
||||||
|
state.editData = {};
|
||||||
|
state.planLoadedCount++;
|
||||||
|
},
|
||||||
|
setSelected: (state, selected) => {
|
||||||
|
state.selected = selected;
|
||||||
|
},
|
||||||
|
clear: (state) => {
|
||||||
|
state.planData = {};
|
||||||
|
state.editData = {};
|
||||||
|
state.selected = {};
|
||||||
|
},
|
||||||
|
refresh: (state) => {
|
||||||
|
state.refreshCount++;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
/** 设置运行图大小*/
|
||||||
|
resize({ commit }, opt) {
|
||||||
|
if (opt.width) {
|
||||||
|
commit('setWidth', opt.width);
|
||||||
|
}
|
||||||
|
if (opt.height) {
|
||||||
|
commit('setHeight', opt.height);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 设置stations数据 */
|
||||||
|
setStations: ({ commit }, mapModel) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
commit('setStations', mapModel);
|
||||||
|
resolve(mapModel);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 设置运行图数据 */
|
||||||
|
setPlanData: ({ commit }, data) => {
|
||||||
|
commit('setPlanData', data);
|
||||||
|
},
|
||||||
|
/** 选择车次*/
|
||||||
|
setSelected: ({ commit }, selected) => {
|
||||||
|
commit('setSelected', selected);
|
||||||
|
},
|
||||||
|
/** 更新数据*/
|
||||||
|
updateRunPlanData: ({ commit }, data) => {
|
||||||
|
commit('updateRunPlanData', data);
|
||||||
|
},
|
||||||
|
/** 清空数据*/
|
||||||
|
clear: ({ commit }) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
commit('clear');
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 刷新页面*/
|
||||||
|
refresh: ({commit}) => {
|
||||||
|
commit('refresh');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default runPlan;
|
@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="map-control">
|
<div class="map-control">
|
||||||
<el-card type="border-card" class="heightClass">
|
<el-card type="border-card" class="heightClass">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<el-button type="text" style="float: right; padding: 3px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button></div>
|
<el-button type="text" style="float: right; padding: 3px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button></div>
|
||||||
<el-tabs class="mapEdit" type="border-card" v-model="active">
|
<el-tabs v-model="active" class="mapEdit" type="border-card">
|
||||||
<el-tab-pane name="first" label="自定用创建">
|
<el-tab-pane name="first" label="自定用创建">
|
||||||
<tab-custom style="width: 100%; height: 100%;" @createDataModel="createDataModel" @deleteDataModel="deleteDataModel"/>
|
<tab-custom style="width: 100%; height: 100%;" @createDataModel="createDataModel" @deleteDataModel="deleteDataModel" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane name="second" label="模板创建">
|
<el-tab-pane name="second" label="模板选择">
|
||||||
<tab-template style="width: 100%; height: 100%;" @createDataModel="createDataModel" @deleteDataModel="deleteDataModel"/>
|
<tab-template style="width: 100%; height: 100%;" @createDataModel="createDataModel" @deleteDataModel="deleteDataModel" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import TabCustom from './tab-custom.vue';
|
import TabCustom from './tab-custom.vue';
|
||||||
@ -20,21 +20,21 @@ import TabTemplate from './tab-template.vue';
|
|||||||
import {deviceFactory} from '@/iscs/utils/parser';
|
import {deviceFactory} from '@/iscs/utils/parser';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
TabCustom,
|
TabCustom,
|
||||||
TabTemplate
|
TabTemplate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 'first'
|
active: 'first'
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createDataModel(models) {
|
createDataModel(models) {
|
||||||
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
|
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
|
||||||
const device = deviceFactory(el._type, el);
|
const device = deviceFactory(el._type, el);
|
||||||
return device.model;
|
return device.model;
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
deleteDataModel(model) {
|
deleteDataModel(model) {
|
||||||
this.$store.dispatch('iscs/deleteIscsDevices', model);
|
this.$store.dispatch('iscs/deleteIscsDevices', model);
|
||||||
@ -42,9 +42,9 @@ export default {
|
|||||||
handleSave() {
|
handleSave() {
|
||||||
const data = JSON.stringify(this.$store.state.iscs.iscs);
|
const data = JSON.stringify(this.$store.state.iscs.iscs);
|
||||||
this.$emit('handleSave', data);
|
this.$emit('handleSave', data);
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.map-control {
|
.map-control {
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex-inline">
|
<div class="flex-inline">
|
||||||
<el-select size="mini" v-model="type" clearable placeholder="请选择元素类型">
|
<el-select v-model="type" size="mini" clearable placeholder="请选择元素类型">
|
||||||
<el-option v-for="item in options" :key="item.lab" :label="item.describe" :value="item.lab"></el-option>
|
<el-option v-for="item in options" :key="item.lab" :label="item.describe" :value="item.lab" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button size="mini" type="primary" @click="doCreate" >添加</el-button>
|
<el-button size="mini" type="primary" @click="doCreate">添加</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
options: {
|
options: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: ''
|
type: ''
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doCreate() {
|
doCreate() {
|
||||||
this.$emit('create', this.type);
|
this.$emit('create', this.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.flex-inline {
|
.flex-inline {
|
||||||
|
@ -1,148 +1,241 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="custom">
|
<div class="custom">
|
||||||
<el-form label-width="80px" size="small" :model="formModel" :rules="rules">
|
<el-form label-width="80px" size="small" :model="formModel" :rules="rules">
|
||||||
<el-form-item label="组名称" prop="name">
|
<el-form-item label="组名称" prop="name">
|
||||||
<el-input v-model="formModel.name" placeholder="请输入组名称" />
|
<el-input v-model="formModel.name" placeholder="请输入组名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="组类型" prop="name">
|
<el-form-item label="组类型" prop="name">
|
||||||
<el-select v-model="formModel.type" clearable placeholder="请选择组类型">
|
<el-select v-model="formModel.type" clearable placeholder="请选择组类型" @change="changeType">
|
||||||
<el-option v-for="item in grTypeList" :key="item.lab" :label="item.describe" :value="item.lab"></el-option>
|
<el-option v-for="item in grTypeList" :key="item.lab" :label="item.describe" :value="item.lab" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="元素列表" prop="elemList" />
|
<el-form-item label="元素列表" prop="elemList" />
|
||||||
<el-table stripe border :data="formModel.elemList" style="width: 100%" height="500px">
|
<el-table stripe border :data="formModel.elemList" style="width: 100%; margin-bottom: 20px;" height="300px">
|
||||||
<el-table-column align="center">
|
<el-table-column align="center">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<el-create :options="elTypeList" @create="handleCreate" />
|
<el-create :options="elTypeList" @create="handleCreate" />
|
||||||
</template>
|
</template>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="元素类型" prop="type" />
|
<el-table-column label="元素类型" prop="des" />
|
||||||
<el-table-column label="元素编码" prop="code" />
|
<el-table-column label="元素编码" prop="code" />
|
||||||
<el-table-column width="180" >
|
<el-table-column width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" :type="active == scope.$index? 'danger': ''" @click="handleActive(scope.$index, scope.row)">激活</el-button>
|
<el-button size="mini" :type="active == scope.$index? 'danger': ''" @click="handleActive(scope.$index, scope.row)">激活</el-button>
|
||||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="footer">
|
<el-form-item label="状态列表" />
|
||||||
<el-button style="margin-left:10px" type="primary" @click="doCreateGroup">创建</el-button>
|
<el-table stripe border :data="formModel.statusList" style="width: 100%; margin-bottom: 50px;" height="300px">
|
||||||
<!-- <el-button style="margin-left:10px" type="info" @click="doUpdeteGroup">修改</el-button>
|
<el-table-column align="center">
|
||||||
<el-button style="margin-left:10px" type="danger" @click="doDeleteGroup">删除</el-button> -->
|
<template slot="header">
|
||||||
</div>
|
<el-button size="mini" type="primary" style="float: right;" @click="createStatus">添加</el-button>
|
||||||
</el-form>
|
</template>
|
||||||
</div>
|
<el-table-column label="描述" prop="des" width="60">
|
||||||
|
<template slot-scope="scope" style="padding: 0;">
|
||||||
|
<el-input v-model="scope.row.des" style="position: absolute;left: 0;top: 6px;" class="no_padding_input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="字段" prop="key" width="62">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.key" style="position: absolute;left: 0;top: 6px;" class="no_padding_input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值" prop="value" width="52">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-checkbox v-model="scope.row.value" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="关联">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-for="(tag, index) in scope.row.childList" :key="index" closable @close="handleClose(tag, scope.row.childList)">
|
||||||
|
{{ tag.type }}--{{ tag.status }}
|
||||||
|
</el-tag>
|
||||||
|
<!-- {{ elemCode }} -->
|
||||||
|
<el-select v-model="elemStatusType" size="small" clearable placeholder="" @change="changeStatus">
|
||||||
|
<el-option v-for="item in elTypeList" :key="item.lab" :label="item.describe" :value="item.lab" />
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="elemStatus" size="small" clearable>
|
||||||
|
<el-option v-for="item in optionsList" :key="item" :label="item" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-button size="mini" :type="activeChild == scope.$index? 'danger': ''" @click="handleActiveChild(scope.$index, scope.row)">激活</el-button> -->
|
||||||
|
<el-button size="small" @click="addChildElement(scope.row)">添加</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="danger" @click="handleDeleteStatus(scope.$index, scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="footer">
|
||||||
|
<el-button style="margin-left:10px" size="small" type="primary" @click="doCreateGroup">创建</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import elType from '@/iscs/status/elType.js';
|
import elType from '@/iscs/status/elType.js';
|
||||||
import grType from '@/iscs/status/grType.js';
|
import grType from '@/iscs/status/grType.js';
|
||||||
|
import mapGroup from '@/iscs/status/mapGroup.js';
|
||||||
|
import mapElement from '@/iscs/status/mapElement.js';
|
||||||
import elCreate from './create';
|
import elCreate from './create';
|
||||||
import deviceType from '@/iscs/constant/deviceType.js';
|
import deviceType from '@/iscs/constant/deviceType.js';
|
||||||
import {getUID} from '@/iscs/utils/Uid';
|
import {getUID} from '@/iscs/utils/Uid';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
elCreate
|
elCreate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: -1,
|
active: -1,
|
||||||
formModel: {
|
activeChild: -1,
|
||||||
name: '',
|
elemCode: '',
|
||||||
type: '',
|
elemStatus: '',
|
||||||
elemList: []
|
elemStatusType: '',
|
||||||
},
|
optionsList: [],
|
||||||
grTypeList: [],
|
formModel: {
|
||||||
elTypeList: [],
|
name: '',
|
||||||
elTypeMap: {}
|
type: '',
|
||||||
}
|
elemList: [],
|
||||||
},
|
statusList: []
|
||||||
computed: {
|
},
|
||||||
rules() {
|
grTypeList: [],
|
||||||
return {
|
elTypeList: [],
|
||||||
name: [
|
elTypeMap: {}
|
||||||
{ required: true, message: '请输入组名称', trigger: 'blur' },
|
};
|
||||||
],
|
},
|
||||||
type: [
|
computed: {
|
||||||
{ required: true, message: '请选择组类型', trigger: 'change' },
|
rules() {
|
||||||
],
|
return {
|
||||||
elemList: [
|
name: [
|
||||||
{ type: 'array', required: true, message: '组元素不能为空', trigger: 'change' },
|
{ required: true, message: '请输入组名称', trigger: 'blur' }
|
||||||
]
|
],
|
||||||
}
|
type: [
|
||||||
}
|
{ required: true, message: '请选择组类型', trigger: 'change' }
|
||||||
},
|
],
|
||||||
watch: {
|
elemList: [
|
||||||
|
{ type: 'array', required: true, message: '组元素不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
...mapGetters('iscs', [
|
||||||
|
'iscs'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
'$store.state.iscs.rightClickCount': function (val) {
|
'$store.state.iscs.rightClickCount': function (val) {
|
||||||
const model = this.$store.getters['iscs/updateDeviceData'];
|
const model = this.$store.getters['iscs/updateDeviceData'];
|
||||||
this.handleSetSelect(model);
|
this.handleSetSelect(model);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.elTypeMap = {}
|
this.elTypeMap = {};
|
||||||
this.grTypeList = Object.values(grType);
|
this.grTypeList = Object.values(grType);
|
||||||
this.elTypeList = Object.values(elType);
|
this.elTypeList = Object.values(elType);
|
||||||
Object.values(grType).forEach(el => {
|
Object.values(grType).forEach(el => {
|
||||||
this.elTypeMap[el.lab] = el;
|
this.elTypeMap[el.lab] = el;
|
||||||
})
|
});
|
||||||
},
|
// this.optionsListObj = mapElement;
|
||||||
methods: {
|
},
|
||||||
handleActive(index, row) {
|
methods: {
|
||||||
this.active = this.active == index ? -1: index;
|
changeType(type) {
|
||||||
},
|
this.formModel.elemList = [];
|
||||||
handleDelete(index, row) {
|
type && mapGroup[type].elemList.forEach(item => {
|
||||||
this.formModel.elemList.splice(index, 1);
|
this.formModel.elemList.push({ type: item.type.lab, des: item.type.describe, code: '' });
|
||||||
this.active = -1;
|
});
|
||||||
},
|
this.formModel.statusList = [];
|
||||||
handleCreate(type) {
|
type && mapGroup[type].statusList.forEach(item => {
|
||||||
if (type) {
|
this.formModel.statusList.push({ childList: [], ...item});
|
||||||
console.log(type);
|
});
|
||||||
this.formModel.elemList.push({ type: type, code: '' })
|
},
|
||||||
} else {
|
handleActive(index, row) {
|
||||||
this.$message.info('请选择元素类型')
|
this.active = this.active == index ? -1 : index;
|
||||||
}
|
},
|
||||||
},
|
handleActiveChild(index, row) {
|
||||||
handleSetSelect(model) {
|
this.activeChild = this.activeChild == index ? -1 : index;
|
||||||
const elem = this.formModel.elemList[this.active];
|
},
|
||||||
if (this.active >= 0) {
|
handleDelete(index, row) {
|
||||||
if (elem) { elem.code = model.code; }
|
this.formModel.elemList.splice(index, 1);
|
||||||
this.active = -1;
|
this.active = -1;
|
||||||
} else {
|
},
|
||||||
this.formModel = {}
|
handleCreate(type, describe) {
|
||||||
this.isUpdate = true;
|
if (type) {
|
||||||
}
|
const opt = this.elTypeList.filter(ele => ele.lab == type);
|
||||||
},
|
this.formModel.elemList.push({ type: type, des: opt[0].describe, code: '' });
|
||||||
doCreateGroup() {
|
} else {
|
||||||
const modelList = [];
|
this.$message.info('请选择元素类型');
|
||||||
const model = {
|
}
|
||||||
code: getUID('group'),
|
},
|
||||||
_type: deviceType.IscsGroup,
|
handleSetSelect(model) {
|
||||||
name: this.formModel.name,
|
const elem = this.formModel.elemList[this.active];
|
||||||
type: this.formModel.type,
|
if (this.active >= 0) {
|
||||||
elemMap: {}
|
if (elem) { elem.code = model.code; }
|
||||||
}
|
this.active = -1;
|
||||||
|
}
|
||||||
|
if (this.activeChild >= 0) {
|
||||||
|
this.elemCode = model.code;
|
||||||
|
this.activeChild = -1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doCreateGroup() {
|
||||||
|
const modelList = [];
|
||||||
|
const model = {
|
||||||
|
code: getUID('group', this.iscs.iscsGroupList),
|
||||||
|
_type: deviceType.IscsGroup,
|
||||||
|
name: this.formModel.name,
|
||||||
|
type: this.formModel.type,
|
||||||
|
elemMap: {},
|
||||||
|
statusList: this.formModel.statusList
|
||||||
|
};
|
||||||
|
|
||||||
this.formModel.elemList.forEach(el => {
|
this.formModel.elemList.forEach(el => {
|
||||||
model.elemMap[el.code] = el;
|
model.elemMap[el.code] = el;
|
||||||
const device = this.$iscs.iscsDevice[el.code];
|
const device = this.$iscs.iscsDevice[el.code];
|
||||||
if (device &&
|
if (device && device.model) {
|
||||||
device.model) {
|
device.model['groupId'] = model.code;
|
||||||
device.groupId = model.code;
|
modelList.push(device.model);
|
||||||
modelList.push(device.model)
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
this.$emit('createDataModel', modelList.concat(model));
|
this.$emit('createDataModel', modelList.concat(model));
|
||||||
},
|
this.formModel = {
|
||||||
doUpdateGroup() {
|
name: '',
|
||||||
},
|
type: '',
|
||||||
doDeleteGroup() {
|
elemList: [],
|
||||||
}
|
statusList: []
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
|
changeStatus(type) {
|
||||||
|
if (mapElement[type]) {
|
||||||
|
this.optionsList = Object.keys(mapElement[type].stateMap);
|
||||||
|
} else {
|
||||||
|
this.optionsList = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createStatus() {
|
||||||
|
this.formModel.statusList.push({ childList: [], key: '', value: '', des: '' });
|
||||||
|
},
|
||||||
|
addChildElement(row) {
|
||||||
|
row.childList.push({ type: this.elemStatusType, status: this.elemStatus });
|
||||||
|
this.elemCode = '';
|
||||||
|
this.elemStatusType = '';
|
||||||
|
this.elemStatus = '';
|
||||||
|
},
|
||||||
|
handleDeleteStatus(index, row) {
|
||||||
|
this.formModel.statusList.splice(index, 1);
|
||||||
|
this.activeChild = -1;
|
||||||
|
},
|
||||||
|
handleClose(tag, row) {
|
||||||
|
row.splice(row.indexOf(tag), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
@ -161,4 +254,10 @@ export default {
|
|||||||
z-index: 9,
|
z-index: 9,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>>
|
</style>
|
||||||
|
<style>
|
||||||
|
.no_padding_input .el-input__inner{
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,17 +1,129 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="template" >
|
<div class="template">
|
||||||
开发中
|
<el-form ref="form" label-width="160" size="mini" :model="formModel" class="form_data">
|
||||||
</div>
|
<el-form-item label="编组code" prop="code">
|
||||||
|
<el-select
|
||||||
|
v-model="formModel.code"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
@change="deviceChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="option in iscsGroupList"
|
||||||
|
:key="option.code"
|
||||||
|
:label="option.name"
|
||||||
|
:value="option.code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编组名称:" prop="name">
|
||||||
|
<el-input v-model="formModel.name" placeholder="请输入内容" style="width: 220px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编组code:" prop="code">
|
||||||
|
<div>{{ formModel.code }}</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编组元素:">
|
||||||
|
<el-tag v-for="(item, index) in formModel.elemList" :key="index" style="margin-right: 10px; margin-bottom: 8px;">{{ item.code }}</el-tag>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="footer">
|
||||||
|
<el-button type="primary" size="small" style="margin-left:10px" @click="onSubmit">修改</el-button>
|
||||||
|
<el-button style="margin-left:10px" type="danger" size="small" @click="doDeleteGroup">删除</el-button>
|
||||||
|
<el-button style="margin-left:10px" type="primary" size="small" @click="groupAllShow">全部显示</el-button>
|
||||||
|
<el-button style="margin-left:10px" type="primary" size="small" @click="groupAllHide">全部隐藏</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
formModel: {
|
||||||
}
|
code: '',
|
||||||
}
|
name: '',
|
||||||
}
|
elemMap: {},
|
||||||
|
elemList: []
|
||||||
|
},
|
||||||
|
selectedModel: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('iscs', [
|
||||||
|
'iscsGroupList'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
deviceChange(code) {
|
||||||
|
this.groupAllHide();
|
||||||
|
if (code) {
|
||||||
|
this.deviceSelect(this.$iscs.iscsDevice[code]);
|
||||||
|
const device = this.$iscs.iscsDevice[code];
|
||||||
|
device.instance.show();
|
||||||
|
} else {
|
||||||
|
this.formModel = {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
elemMap: {},
|
||||||
|
elemList: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deviceSelect(selected) {
|
||||||
|
this.formModel.name = selected.model.name;
|
||||||
|
this.formModel.elemMap = selected.model.elemMap;
|
||||||
|
this.formModel.elemList = [];
|
||||||
|
for (const key in selected.model.elemMap) {
|
||||||
|
this.formModel.elemList.push(selected.model.elemMap[key]);
|
||||||
|
}
|
||||||
|
this.selectedModel = selected.model;
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.selectedModel.name = this.formModel.name;
|
||||||
|
this.$emit('createDataModel', this.selectedModel);
|
||||||
|
this.formModel = {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
elemMap: {},
|
||||||
|
elemList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
doDeleteGroup() {
|
||||||
|
const Model = {
|
||||||
|
code: this.formModel.code,
|
||||||
|
_type: 'IscsGroup'
|
||||||
|
};
|
||||||
|
this.$emit('deleteDataModel', Model);
|
||||||
|
const modelList = [];
|
||||||
|
for (const key in this.formModel.elemMap) {
|
||||||
|
const device = this.$iscs.iscsDevice[key];
|
||||||
|
if (device && device.model) {
|
||||||
|
device.model['groupId'] = '';
|
||||||
|
modelList.push(device.model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit('createDataModel', modelList);
|
||||||
|
this.formModel = {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
elemMap: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
groupAllShow() {
|
||||||
|
this.iscsGroupList.forEach(group => {
|
||||||
|
const device = this.$iscs.iscsDevice[group.code];
|
||||||
|
device.instance.show();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
groupAllHide() {
|
||||||
|
this.iscsGroupList.forEach(group => {
|
||||||
|
const device = this.$iscs.iscsDevice[group.code];
|
||||||
|
device.instance.hide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
|
||||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
|
||||||
<el-form-item label="图层:" prop="z2">
|
<el-form-item label="图层:" prop="z2">
|
||||||
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
|
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="半径:" prop="radius">
|
<el-form-item label="半径:" prop="radius">
|
||||||
@ -44,8 +44,8 @@ export default {
|
|||||||
buttonText: '立即创建',
|
buttonText: '立即创建',
|
||||||
showDeleteButton: false,
|
showDeleteButton: false,
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
z2: 1,
|
z2: 1,
|
||||||
fillColor: '',
|
fillColor: '',
|
||||||
borderWidth: '',
|
borderWidth: '',
|
||||||
strokeColor: '',
|
strokeColor: '',
|
||||||
@ -75,8 +75,8 @@ export default {
|
|||||||
this.buttonText = '修改';
|
this.buttonText = '修改';
|
||||||
this.showDeleteButton = true;
|
this.showDeleteButton = true;
|
||||||
this.isUpdate = true;
|
this.isUpdate = true;
|
||||||
this.form.code = model.code;
|
this.form.code = model.code;
|
||||||
this.form.z2 = model.z2||0;
|
this.form.z2 = model.z2 || 0;
|
||||||
this.form.fillColor = model.fillColor;
|
this.form.fillColor = model.fillColor;
|
||||||
this.form.borderWidth = model.borderWidth;
|
this.form.borderWidth = model.borderWidth;
|
||||||
this.form.strokeColor = model.strokeColor;
|
this.form.strokeColor = model.strokeColor;
|
||||||
@ -97,8 +97,8 @@ export default {
|
|||||||
y: this.form.y
|
y: this.form.y
|
||||||
},
|
},
|
||||||
code: this.isUpdate ? this.form.code : getUID('IscsCircle', this.iscs.iscsCircleList),
|
code: this.isUpdate ? this.form.code : getUID('IscsCircle', this.iscs.iscsCircleList),
|
||||||
_type: 'IscsCircle',
|
_type: 'IscsCircle',
|
||||||
z2: this.form.z2,
|
z2: this.form.z2,
|
||||||
fillColor: this.form.fillColor,
|
fillColor: this.form.fillColor,
|
||||||
borderWidth: this.form.borderWidth,
|
borderWidth: this.form.borderWidth,
|
||||||
strokeColor: this.form.strokeColor,
|
strokeColor: this.form.strokeColor,
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
<iscs-environment v-else-if="iscsMode=='environment02'" ref="" @iscsChange="iscsChange" @handleSave="handleSave" /> <!-- 环境与设备监控系统 -->
|
<iscs-environment v-else-if="iscsMode=='environment02'" ref="" @iscsChange="iscsChange" @handleSave="handleSave" /> <!-- 环境与设备监控系统 -->
|
||||||
<iscs-psd v-else-if="iscsMode=='psdSystem02'" ref="" @iscsChange="iscsChange" @handleSave="handleSave" /> <!-- 屏蔽门系统 -->
|
<iscs-psd v-else-if="iscsMode=='psdSystem02'" ref="" @iscsChange="iscsChange" @handleSave="handleSave" /> <!-- 屏蔽门系统 -->
|
||||||
</div>
|
</div>
|
||||||
<div class="right-card" :class="{'hide': tableShow}">
|
<div class="right-card" :class="{'hide': tableShow}">
|
||||||
<div class="btn_table_box" @click="clickTableBtn"><i :class="tableShow?'el-icon-arrow-right':'el-icon-arrow-left'" /></div>
|
<div class="btn_table_box" @click="clickTableBtn"><i :class="tableShow?'el-icon-arrow-right':'el-icon-arrow-left'" /></div>
|
||||||
<group-card @handleSave="handleSave" />
|
<group-card @handleSave="handleSave" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
@ -66,9 +66,9 @@ export default {
|
|||||||
IscsPowerMonitoring,
|
IscsPowerMonitoring,
|
||||||
IscsSignalSystem,
|
IscsSignalSystem,
|
||||||
IscsPsd,
|
IscsPsd,
|
||||||
IscsEnvironment,
|
IscsEnvironment,
|
||||||
|
|
||||||
GroupCard
|
GroupCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -77,8 +77,8 @@ export default {
|
|||||||
height: this.$store.state.app.height - 60
|
height: this.$store.state.app.height - 60
|
||||||
},
|
},
|
||||||
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
||||||
draftShow: false,
|
draftShow: false,
|
||||||
tableShow: false
|
tableShow: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
@ -105,10 +105,10 @@ export default {
|
|||||||
},
|
},
|
||||||
clickDraftBtn() {
|
clickDraftBtn() {
|
||||||
this.draftShow = !this.draftShow;
|
this.draftShow = !this.draftShow;
|
||||||
},
|
},
|
||||||
clickTableBtn() {
|
clickTableBtn() {
|
||||||
this.tableShow = !this.tableShow;
|
this.tableShow = !this.tableShow;
|
||||||
},
|
},
|
||||||
handleSave(data) {
|
handleSave(data) {
|
||||||
const param = {
|
const param = {
|
||||||
graphData: data,
|
graphData: data,
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="iscsCanvas">
|
<div class="iscsCanvas">
|
||||||
<div :id="iscsId" v-loading="loading" :style="{ width: widthCanvas +'px', height: canvasHeight +'px' }" class="iscs-canvas" />
|
<div :id="iscsId" v-loading="loading" :style="{ width: widthCanvas +'px', height: canvasHeight +'px' }" class="iscs-canvas" />
|
||||||
|
<valve-dialog ref="valve" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { parser } from '@/iscs/utils/parser';
|
import { parser } from '@/iscs/utils/parser';
|
||||||
import Iscs from '@/iscs/iscs';
|
import Iscs from '@/iscs/iscs';
|
||||||
|
import ValveDialog from '../dialog/valve';
|
||||||
export default {
|
export default {
|
||||||
name: 'IscsStation',
|
name: 'IscsStation',
|
||||||
|
components: {
|
||||||
|
ValveDialog
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
size: {
|
size: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -56,6 +61,16 @@ export default {
|
|||||||
Vue.prototype.$iscs = this.$iscs;
|
Vue.prototype.$iscs = this.$iscs;
|
||||||
this.setIscs(parserData, iscsData);
|
this.setIscs(parserData, iscsData);
|
||||||
this.$store.dispatch('iscs/setIscsData', iscsData);
|
this.$store.dispatch('iscs/setIscsData', iscsData);
|
||||||
|
if (this.$route.query.group) {
|
||||||
|
this.$iscs.on('dblclick', this.onDblclick, this);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onDblclick(em) {
|
||||||
|
// 父编组上元素内容
|
||||||
|
if (em.deviceType == 'IscsGroup') {
|
||||||
|
this.$iscs.iscsDevice[em.deviceModel.code].instance.hide();
|
||||||
|
this.$refs.valve.doShow(em.deviceModel);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleViewLoaded() {
|
handleViewLoaded() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -83,4 +98,73 @@ export default {
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog {
|
||||||
|
background: rgba(100, 100, 100, 0.3);
|
||||||
|
border: 2px solid rgb(144, 144, 144, 0.8);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: #000;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__header {
|
||||||
|
padding: 5px;
|
||||||
|
height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__footer {
|
||||||
|
background: #F0F0F0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
margin: 0px 5px 5px;
|
||||||
|
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||||
|
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||||
|
background: #F0F0F0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__title {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
color: #000;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0px 2px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__title::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
-webkit-filter: blur(10px);
|
||||||
|
filter: blur(10px);
|
||||||
|
height: 20px;
|
||||||
|
width: -webkit-fill-available;
|
||||||
|
background: rgba(128, 128, 128, 0.8);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn {
|
||||||
|
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
border: 1px solid #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
top: 4px;
|
||||||
|
right: 5px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
173
src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue
Normal file
173
src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="iscs_fuzhou-01__systerm route-detail"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="500px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-table border :data="elemList" style="width: 100%;" height="300px">
|
||||||
|
<el-table-column label="描述" prop="name" />
|
||||||
|
<el-table-column label="类型" prop="types" />
|
||||||
|
<el-table-column label="状态" prop="status" />
|
||||||
|
<el-table-column label="操作" width="120">
|
||||||
|
<template slot-scope="scope" style="padding: 0;">
|
||||||
|
<el-button size="mini" type="" style="width: 100%; height: 100%" @click="handleOption(scope.$index, scope.row)">{{ scope.row[scope.row.key] ? list[scope.row.key][0] : list[scope.row.key][1] }}选择</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="iscs_fuzhou-01__systerm route-detail"
|
||||||
|
title="请执行或取消操作"
|
||||||
|
:visible.sync="showSublayer"
|
||||||
|
width="400px"
|
||||||
|
:before-close="doCloseSublayer"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-form label-width="100px" size="small" label-position="left" :model="formModel">
|
||||||
|
<el-form-item label="控制点">
|
||||||
|
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.name }}</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="控制动作">
|
||||||
|
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.action }}</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="操作信息">
|
||||||
|
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.info }}</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row justify="center" class="button-group">
|
||||||
|
<el-col :span="10" :offset="2">
|
||||||
|
<el-button type="primary" @click="commit">执行</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="4">
|
||||||
|
<el-button @click="doCloseSublayer">取消</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mapElement from '@/iscs/status/mapElement.js';
|
||||||
|
import {deviceFactory} from '@/iscs/utils/parser';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogShow: false,
|
||||||
|
showSublayer: false,
|
||||||
|
activeIndex: -1,
|
||||||
|
title: '',
|
||||||
|
rowData: {},
|
||||||
|
elemList: [],
|
||||||
|
model: {},
|
||||||
|
formModel: {
|
||||||
|
name: '35KV高压开关室 35KV动力变馈线柜-CT5/1',
|
||||||
|
action: '短路器遥控开关分闸',
|
||||||
|
info: ''
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
valve: ['控合', '控分']
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
show() {
|
||||||
|
return this.dialogShow;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(models) {
|
||||||
|
this.model = models;
|
||||||
|
console.log(models);
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.title = models.name || '弹窗名称';
|
||||||
|
this.elemList = [];
|
||||||
|
models.statusList.forEach(item => {
|
||||||
|
if (!this.elemList.length) {
|
||||||
|
this.elemList = [
|
||||||
|
{
|
||||||
|
name: item.des,
|
||||||
|
types: 'DO',
|
||||||
|
key: item.key,
|
||||||
|
status: '',
|
||||||
|
[item.key]: models[item.key] || false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
const arr = this.elemList.filter(ele => ele.key == item.key);
|
||||||
|
if (!arr.length) {
|
||||||
|
this.elemList.push({
|
||||||
|
name: item.des,
|
||||||
|
types: 'DO',
|
||||||
|
key: item.key,
|
||||||
|
status: '',
|
||||||
|
[item.key]: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
commit() {
|
||||||
|
this.showSublayer = false;
|
||||||
|
this.rowData[this.rowData.key] = !this.rowData[this.rowData.key];
|
||||||
|
this.elemList.splice(this.activeIndex, 1, this.rowData);
|
||||||
|
this.model[this.rowData.key] = this.rowData[this.rowData.key];
|
||||||
|
const arr = [];
|
||||||
|
this.model.statusList.forEach(item => {
|
||||||
|
if (item.key == this.rowData.key && item.value === this.rowData[this.rowData.key]) {
|
||||||
|
item.childList.forEach(ele => {
|
||||||
|
Object.values(this.model.elemMap).forEach(elem => {
|
||||||
|
if (elem.type == ele.type) {
|
||||||
|
arr.push({
|
||||||
|
code: elem.code,
|
||||||
|
...mapElement[ele.type].stateMap[ele.status]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// const data = this.model.elemMap
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const models = [{...this.model, [this.rowData.key]: this.rowData[this.rowData.key]}];
|
||||||
|
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
|
||||||
|
const device = deviceFactory(el._type, el);
|
||||||
|
return device.model;
|
||||||
|
}));
|
||||||
|
// 改变元素状态
|
||||||
|
arr.forEach(el => {
|
||||||
|
const device = this.$iscs.iscsDevice[el.code];
|
||||||
|
if (device && device.instance) {
|
||||||
|
device.instance.setState(el);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.dialogShow = false;
|
||||||
|
},
|
||||||
|
handleOption(index, row) {
|
||||||
|
this.activeIndex = index;
|
||||||
|
this.formModel.info = row[row.key] ? this.list[row.key][0] : this.list[row.key][1];
|
||||||
|
this.rowData = JSON.parse(JSON.stringify(row));
|
||||||
|
this.showSublayer = true;
|
||||||
|
},
|
||||||
|
doCloseSublayer() {
|
||||||
|
this.showSublayer = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -147,6 +147,7 @@ export default {
|
|||||||
this.$iscs.on('contextmenu', this.onContextMenu, this);
|
this.$iscs.on('contextmenu', this.onContextMenu, this);
|
||||||
if (this.$route.query.group) {
|
if (this.$route.query.group) {
|
||||||
this.$iscs.on('selected', this.onSelected, this);
|
this.$iscs.on('selected', this.onSelected, this);
|
||||||
|
this.$iscs.on('dblclick', this.onDblclick, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$route.path.startsWith('/iscs/design')) {
|
if (this.$route.path.startsWith('/iscs/design')) {
|
||||||
@ -236,6 +237,10 @@ export default {
|
|||||||
},
|
},
|
||||||
// 点击选择事件
|
// 点击选择事件
|
||||||
onSelected(em) {
|
onSelected(em) {
|
||||||
|
console.log(em);
|
||||||
|
},
|
||||||
|
onDblclick(em) {
|
||||||
|
console.log(em);
|
||||||
},
|
},
|
||||||
// 右键点击事件
|
// 右键点击事件
|
||||||
onContextMenu(em) {
|
onContextMenu(em) {
|
||||||
|
@ -300,17 +300,6 @@ export default {
|
|||||||
this.filterNode();
|
this.filterNode();
|
||||||
if (activeTrainList.length <= 0) {
|
if (activeTrainList.length <= 0) {
|
||||||
this.resetCoversition();
|
this.resetCoversition();
|
||||||
this.treeData.forEach(item => {
|
|
||||||
if (item.children) {
|
|
||||||
const memberList = Object.values(item.children);
|
|
||||||
memberList.forEach(data =>{
|
|
||||||
data.active = false;
|
|
||||||
data.isConnect = false;
|
|
||||||
data.loading = false;
|
|
||||||
data.disabled = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// if (this.$refs.tree) {
|
// if (this.$refs.tree) {
|
||||||
// this.$refs.tree.filter(this.queryMember);
|
// this.$refs.tree.filter(this.queryMember);
|
||||||
@ -941,6 +930,18 @@ export default {
|
|||||||
this.commonMessageList = [];
|
this.commonMessageList = [];
|
||||||
this.conversitionStateMap = {};
|
this.conversitionStateMap = {};
|
||||||
this.messageList = this.commonMessageList;
|
this.messageList = this.commonMessageList;
|
||||||
|
this.treeData.forEach(item => {
|
||||||
|
if (item.children) {
|
||||||
|
const memberList = Object.values(item.children);
|
||||||
|
memberList.forEach(data =>{
|
||||||
|
data.active = false;
|
||||||
|
data.isConnect = false;
|
||||||
|
data.loading = false;
|
||||||
|
data.disabled = false;
|
||||||
|
data.isInviting = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
||||||
<div class="userMessage">
|
<div class="userMessage">
|
||||||
<span class="el-icon-video-play playicon" />
|
<!-- <span class="el-icon-video-play playicon" /> -->
|
||||||
<span class="messageText">{{ chatContent.content }}</span>
|
<img :src="yuyin" alt="playicon1">
|
||||||
|
<!-- <span class="messageText">{{ chatContent.content }}</span> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<audio id="audioPlay" style="display:none" />
|
<audio id="audioPlay" style="display:none" />
|
||||||
@ -20,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import yuyin from '@/assets/yuyin.png';
|
||||||
export default {
|
export default {
|
||||||
props:{
|
props:{
|
||||||
messageList:{
|
messageList:{
|
||||||
@ -68,6 +69,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
chatContentList:[],
|
chatContentList:[],
|
||||||
currentAudioList:[],
|
currentAudioList:[],
|
||||||
|
yuyin:yuyin,
|
||||||
currentAudioIndex:0,
|
currentAudioIndex:0,
|
||||||
isPlay:false,
|
isPlay:false,
|
||||||
baseUrl:process.env.VUE_APP_VOICE_API
|
baseUrl:process.env.VUE_APP_VOICE_API
|
||||||
@ -176,9 +178,11 @@ export default {
|
|||||||
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
|
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
|
||||||
.userChatTime{font-size: 12px;display:inline-block;}
|
.userChatTime{font-size: 12px;display:inline-block;}
|
||||||
.userBubble{
|
.userBubble{
|
||||||
max-width: 200px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 10px;
|
// max-width: 200px;
|
||||||
|
// padding: 10px;
|
||||||
|
padding: 5px 10px 6px 10px;
|
||||||
|
width: 140px;
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -188,6 +192,9 @@ export default {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
.playicon1{
|
||||||
|
width:17px;
|
||||||
|
}
|
||||||
.textRight{text-align: right;}
|
.textRight{text-align: right;}
|
||||||
.userMessage{}
|
.userMessage{}
|
||||||
.messageText{line-height: 20px;}
|
.messageText{line-height: 20px;}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
<throry-result ref="theoryResult" @restart="goTheoryQuiz" /> -->
|
<throry-result ref="theoryResult" @restart="goTheoryQuiz" /> -->
|
||||||
<select-role ref="selectRole" :member-list="currentPlayList" @selectRole="selectRole" />
|
<select-role ref="selectRole" :member-list="currentPlayList" @selectRole="selectRole" />
|
||||||
|
|
||||||
<operational-statistic ref="operationalStatistic" />
|
<operational-statistic ref="operationalStatistic" @finishTraining="finishTraining" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -395,6 +395,7 @@ export default {
|
|||||||
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {});
|
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {});
|
||||||
this.quitQuest();
|
this.quitQuest();
|
||||||
// this.initLoadPage();
|
// this.initLoadPage();
|
||||||
|
this.isScriptRun = false;
|
||||||
this.clearAllData();
|
this.clearAllData();
|
||||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
@ -462,8 +463,11 @@ export default {
|
|||||||
(this.$store.state.training.memberData[role.id] || {}).disabled = true;
|
(this.$store.state.training.memberData[role.id] || {}).disabled = true;
|
||||||
this.runScriptMode(memberId);
|
this.runScriptMode(memberId);
|
||||||
},
|
},
|
||||||
|
finishTraining() {
|
||||||
|
this.isScriptRun = false;
|
||||||
|
},
|
||||||
endTraining() {
|
endTraining() {
|
||||||
competitionPracticalSceneFinish(this.group).then(res=>{
|
competitionPracticalSceneFinish(this.group, {operationStatisticVO:{}}).then(res=>{
|
||||||
this.isScriptRun = false;
|
this.isScriptRun = false;
|
||||||
// if (this.scriptMode == ScriptMode.TEST) {
|
// if (this.scriptMode == ScriptMode.TEST) {
|
||||||
this.formatScore = res.data;
|
this.formatScore = res.data;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { submitOperationalStatistics} from '@/api/competition';
|
import { competitionPracticalSceneFinish} from '@/api/competition';
|
||||||
export default {
|
export default {
|
||||||
name:'OperationalStatistics',
|
name:'OperationalStatistics',
|
||||||
data() {
|
data() {
|
||||||
@ -76,8 +76,11 @@ export default {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
this.$messageBox('请填写表单');
|
this.$messageBox('请填写表单');
|
||||||
} else {
|
} else {
|
||||||
submitOperationalStatistics(this.$route.query.group, this.resultData).then(res=>{
|
competitionPracticalSceneFinish(this.$route.query.group, this.resultData).then(res=>{
|
||||||
this.$message.success('运营统计数据提交成功');
|
this.$message.success('运营统计数据提交成功');
|
||||||
|
this.formatScore = res.data;
|
||||||
|
this.$messageBox('得分:' + this.formatScore);
|
||||||
|
this.$emit('finishTraining');
|
||||||
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS);
|
this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS);
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
|
90
src/views/planMonitor/editToolAUS/contextMenu.vue
Normal file
90
src/views/planMonitor/editToolAUS/contextMenu.vue
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="popMenuClass" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import PopMenu from '@/components/PopMenu';
|
||||||
|
import { Notification } from 'element-ui';
|
||||||
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
|
import { deleteTripNo, justTripNoArrival, justTripNoDeparture} from '@/api/rpTools';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
tripNo: {
|
||||||
|
type: [String, Number]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
PopMenu
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
label: '调整起始时间',
|
||||||
|
handler: this.doJustBeginTime,
|
||||||
|
disabled: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '调整停站时间',
|
||||||
|
handler: this.doJustStopTime,
|
||||||
|
disabled: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
handler: this.doDeleteTrip,
|
||||||
|
disabled: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planAusContextMenu)) {
|
||||||
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
|
} else {
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickEvent() {
|
||||||
|
const self = this;
|
||||||
|
window.onclick = function (e) {
|
||||||
|
self.doClose();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
doShow(point) {
|
||||||
|
this.clickEvent();
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doDeleteTrip() {
|
||||||
|
if (this.tripNo) {
|
||||||
|
deleteTripNo(this.tripNo).then(resp => {
|
||||||
|
this.$emit('reload')
|
||||||
|
}).catch(error => {
|
||||||
|
this.$message.error('delete error');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doJustBeginTime() {
|
||||||
|
},
|
||||||
|
doJustStopTime() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.popMenuClass{
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
392
src/views/planMonitor/editToolAUS/index.vue
Normal file
392
src/views/planMonitor/editToolAUS/index.vue
Normal file
@ -0,0 +1,392 @@
|
|||||||
|
<template>
|
||||||
|
<div class="plan-tool">
|
||||||
|
<schedule
|
||||||
|
ref="schedule"
|
||||||
|
:line-code="lineCode"
|
||||||
|
:plan-convert="PlanConvert"
|
||||||
|
:max-height="height"
|
||||||
|
:max-width="width"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Schedule from './schedule';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Schedule
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
PlanConvert: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
lineCode() {
|
||||||
|
return '00';
|
||||||
|
},
|
||||||
|
width() {
|
||||||
|
return this.$store.state.app.width;
|
||||||
|
},
|
||||||
|
height() {
|
||||||
|
return this.$store.state.app.height - 60;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setPosition() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.schedule.setPosition();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dispatchDialog(dialogObj) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs[dialogObj.name]) {
|
||||||
|
this.$refs[dialogObj.name].doShow(dialogObj.params);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dispatchOperate(operateObj) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs[operateObj.dialogName]) {
|
||||||
|
this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.plan-tool {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plan-tool .pop-menu {
|
||||||
|
background: #F0F0F0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plan-tool .pop-menu span {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plan-tool .system-close {
|
||||||
|
cursor: pointer;
|
||||||
|
height: 25px;
|
||||||
|
width: 25px;
|
||||||
|
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plan-tool .system-close::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
font-size: x-large;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool {
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .planEdit__tool .el-dialog {
|
||||||
|
overflow: hidden !important;
|
||||||
|
background: rgba(202, 221, 253, 0.88);;
|
||||||
|
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||||
|
border: 2px solid #727375;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #000;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__header {
|
||||||
|
height: 30px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__footer {
|
||||||
|
background: #ECE9D8;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
margin: 0px 3px 3px 3px;
|
||||||
|
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||||
|
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||||
|
color: #000;
|
||||||
|
background: #ECE9D8;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__headerbtn {
|
||||||
|
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 4px;
|
||||||
|
top: 0px;
|
||||||
|
right: 3px;
|
||||||
|
line-height: 26px;
|
||||||
|
width: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tabs--top {
|
||||||
|
border: 2px outset #FEFEFD;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tabs__item {
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
text-align: center;
|
||||||
|
color: #000 !important;
|
||||||
|
border-right: 2px outset #fff;
|
||||||
|
padding-left: 10px !important;
|
||||||
|
padding-right: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tab-pane {
|
||||||
|
margin: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
||||||
|
border-bottom: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item:not(.is-active) {
|
||||||
|
border-bottom: 2px inset #fff
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-form {
|
||||||
|
background: #ECE9D8 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-card {
|
||||||
|
background: #ECE9D8 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-button {
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
padding: 0px;
|
||||||
|
width: 80px;
|
||||||
|
border: 2px outset #E2E2E2;
|
||||||
|
border-radius: 0px !important;
|
||||||
|
color: #000;
|
||||||
|
background: #ECE9D8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .expand {
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-button:focus span {
|
||||||
|
border: 1px dashed gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-button:active {
|
||||||
|
border: 2px inset #E2E2E2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-button:disabled {
|
||||||
|
border: 2px inset #E2E2E2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-button:disabled span {
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .button-group {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-input {
|
||||||
|
border: 2px inset #E9E9E9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-input .el-input__inner {
|
||||||
|
color: #000;
|
||||||
|
background: #fff !important;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-input.is-disabled .el-input__inner {
|
||||||
|
background: #F0F0F0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-textarea {
|
||||||
|
border: 2px inset #E9E9E9;
|
||||||
|
border-radius: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-textarea .el-textarea__inner {
|
||||||
|
color: #000;
|
||||||
|
background: #fff !important;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
background: #F0F0F0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-table {
|
||||||
|
border: 2px inset #E9E9E9;
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-table .cell {
|
||||||
|
line-height: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-table th.is-leaf {
|
||||||
|
background: #ECE9D8 !important;
|
||||||
|
border-right: 1px solid #BDBDBD !important;
|
||||||
|
border-bottom: 1px solid #BDBDBD !important;
|
||||||
|
color: #000 !important;
|
||||||
|
height: 20px !important;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-table tr td {
|
||||||
|
height: 20px !important;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-table .el-table__empty-text {
|
||||||
|
top: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .current-row>td {
|
||||||
|
background: #316AC5 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox__inner {
|
||||||
|
border: 1px inset #dcdfe6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox__label {
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
|
||||||
|
background: #E6E6E6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
|
||||||
|
color: #C5C9CC !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||||
|
background: #fff !important;
|
||||||
|
border: 1px inset #dcdfe6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
||||||
|
position: absolute;
|
||||||
|
-webkit-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
content: "";
|
||||||
|
border: 1px solid #000;
|
||||||
|
border-left: 0;
|
||||||
|
border-top: 0;
|
||||||
|
height: 7px;
|
||||||
|
left: 4px;
|
||||||
|
top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio__inner {
|
||||||
|
border: 1px inset #dcdfe6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio__label {
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner {
|
||||||
|
background: #fff !important;
|
||||||
|
border: 1px inset #dcdfe6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
|
||||||
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
|
border-radius: 100%;
|
||||||
|
background-color: #000 !important;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__inner {
|
||||||
|
background: #E6E6E6 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__label {
|
||||||
|
color: #C5C9CC !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .base-label {
|
||||||
|
background: rgba(0, 0, 0, x);
|
||||||
|
position: relative;
|
||||||
|
left: -15px;
|
||||||
|
top: -18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-form-item label {
|
||||||
|
font-weight: normal !important;
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .context {
|
||||||
|
height: 100px;
|
||||||
|
border: 2px inset #E2E2E2;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .table {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .notice {
|
||||||
|
margin-left: 62px;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .button-group {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.planEdit__tool .el-dialog .el-tree__empty-block {
|
||||||
|
background: #E9E9E9 !important;
|
||||||
|
color: #000 !important;
|
||||||
|
} */
|
||||||
|
</style>
|
160
src/views/planMonitor/editToolAUS/monitor.js
Normal file
160
src/views/planMonitor/editToolAUS/monitor.js
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
|
import { timeFormat } from '@/utils/date';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isDragging: false,
|
||||||
|
createModel: {
|
||||||
|
endStationCode: '',
|
||||||
|
startStationCode: '',
|
||||||
|
startTime: {
|
||||||
|
hour: '',
|
||||||
|
minute: '',
|
||||||
|
second: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
myChart: function() {
|
||||||
|
this.listenersBind();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.listenersOff();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getStationByCoord(stations, y) {
|
||||||
|
for(var i = stations.length-1; i >= 0; i--) {
|
||||||
|
const station = stations[i];
|
||||||
|
if (station.kmRange <= y) {
|
||||||
|
return station;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
pixelExecCb(e, cb) {
|
||||||
|
let myChart = this.myChart;
|
||||||
|
let pointInPixel= [e.offsetX, e.offsetY];
|
||||||
|
if (myChart.containPixel('grid', pointInPixel) && this.planConvert) {
|
||||||
|
let pointInGrid = myChart.convertFromPixel({seriesIndex:0},pointInPixel);
|
||||||
|
let xIndex = pointInGrid[0];
|
||||||
|
let yIndex = pointInGrid[1];
|
||||||
|
let op = myChart.getOption();
|
||||||
|
let minY = op.yAxis[0].min;
|
||||||
|
let xVal = op.xAxis[0].data[xIndex];
|
||||||
|
let edgeOffset = this.planConvert.EdgeHeight/6;
|
||||||
|
let yObj = this.getStationByCoord(this.stations, yIndex-minY-edgeOffset);
|
||||||
|
if (yObj && cb) {
|
||||||
|
cb(yObj, xVal, pointInPixel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
listenersBind() {
|
||||||
|
if (this.myChart) {
|
||||||
|
const zr = this.myChart.getZr();
|
||||||
|
zr.on('click', this.onClick, this)
|
||||||
|
zr.on('contextmenu', this.onContextMenu, this);
|
||||||
|
this.myChart.on('mousedown', this.onDragStart);
|
||||||
|
this.myChart.on('mouseup', this.onDragEnd);
|
||||||
|
this.myChart.on('click', 'series', this.onSelect);
|
||||||
|
this.myChart.on('datazoom', this.onClearMarks);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
listenersOff() {
|
||||||
|
if (this.myChart) {
|
||||||
|
const zr = this.myChart.getZr();
|
||||||
|
zr.off('click', this.onClick);
|
||||||
|
zr.off('contextmenu', this.onContextMenu);
|
||||||
|
this.myChart.off('mousedown', this.onDragStart);
|
||||||
|
this.myChart.off('mouseup', this.onDragEnd);
|
||||||
|
this.myChart.off('click', 'series', this.onSelect);
|
||||||
|
this.myChart.off('datazoom', this.onClearMarks);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick(e) {
|
||||||
|
this.pixelExecCb(e, this.handleMarkPoint)
|
||||||
|
},
|
||||||
|
onContextMenu(e) {
|
||||||
|
console.log(e, 'onContextMenu');
|
||||||
|
this.onClearMarks();
|
||||||
|
if(e.target) {
|
||||||
|
const event = e.event;
|
||||||
|
const point = {
|
||||||
|
x: event.clientX,
|
||||||
|
y: event.clientY
|
||||||
|
}
|
||||||
|
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planAusContextMenu });
|
||||||
|
} else {
|
||||||
|
this.$message.info('No train number selected')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClearMarks() {
|
||||||
|
if (this.myChart) {
|
||||||
|
let op = this.myChart.getOption();
|
||||||
|
op.graphic[0].elements = [];
|
||||||
|
this.myChart.setOption(op, {notMerge: true})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSelect(e) {
|
||||||
|
console.log(e, 'select')
|
||||||
|
},
|
||||||
|
onDragStart(e) {
|
||||||
|
console.log(e, 'dragStart');
|
||||||
|
},
|
||||||
|
onDragEnd(e) {
|
||||||
|
console.log(e, 'dragEnd');
|
||||||
|
},
|
||||||
|
createMarkPoint(point, text) {
|
||||||
|
return {
|
||||||
|
type: 'group',
|
||||||
|
z: 100,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: 'circle',
|
||||||
|
z: 100,
|
||||||
|
shape: {
|
||||||
|
cx: point[0],
|
||||||
|
cy: point[1],
|
||||||
|
r: 5
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
fill: 'rgba(0,0,0,0.3)'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'circle',
|
||||||
|
z: 100,
|
||||||
|
shape: {
|
||||||
|
cx: point[0],
|
||||||
|
cy: point[1],
|
||||||
|
r: 10
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
fill: 'rgba(0,0,0,0.3)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleMarkPoint(yObj, xVal, pointInPixel) {
|
||||||
|
let myChart = this.myChart;
|
||||||
|
if (myChart) {
|
||||||
|
let op = myChart.getOption();
|
||||||
|
let graphic = op.graphic[0];
|
||||||
|
if (graphic) {
|
||||||
|
graphic.elements.push(this.createMarkPoint(pointInPixel, 'hello world'))
|
||||||
|
myChart.setOption(op);
|
||||||
|
if (graphic.elements.length == 1) {
|
||||||
|
this.createModel.startStationCode = yObj.code;
|
||||||
|
this.createModel.startTime = timeFormat(xVal);
|
||||||
|
} else if (graphic.elements.length >= 2) {
|
||||||
|
this.createModel.endStationCode = yObj.code;
|
||||||
|
this.createRpTrip(this.createModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
599
src/views/planMonitor/editToolAUS/schedule.vue
Normal file
599
src/views/planMonitor/editToolAUS/schedule.vue
Normal file
@ -0,0 +1,599 @@
|
|||||||
|
<template>
|
||||||
|
<div id="PlanSchedule">
|
||||||
|
<div class="left">
|
||||||
|
<div :id="runPlanId" />
|
||||||
|
<context-menu :tripNo="tripNo" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Monitor from './monitor.js';
|
||||||
|
import ContextMenu from './contextMenu.vue';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import { timeFormat } from '@/utils/date';
|
||||||
|
import { getStationList } from '@/api/runplan';
|
||||||
|
import { getRpTools, addRpTrip } from '@/api/rpTools';
|
||||||
|
import { loadMapDataById } from '@/utils/loaddata';
|
||||||
|
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||||
|
import echarts from 'echarts';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
planConvert: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
maxWidth: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
maxHeight: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
loadRunPlanId: {
|
||||||
|
type: String,
|
||||||
|
default() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadRunPlanName: {
|
||||||
|
type: String,
|
||||||
|
default() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mixins: [Monitor],
|
||||||
|
components: {
|
||||||
|
ContextMenu
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
top: 0,
|
||||||
|
height: 0,
|
||||||
|
mapName: 'XXX',
|
||||||
|
runPlanId: 'plan-tool',
|
||||||
|
myChart: null,
|
||||||
|
showTrain: false,
|
||||||
|
tripNo: '',
|
||||||
|
serviceNumberConfig: {
|
||||||
|
data: [],
|
||||||
|
title: this.$t('planMonitor.serviceNumber'),
|
||||||
|
showHeader: false,
|
||||||
|
highlightCurrentRow: true,
|
||||||
|
handleChange: this.serviceNumberChange,
|
||||||
|
showClose: false,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
prop: 'serviceNumber',
|
||||||
|
label: this.$t('planMonitor.serviceNumber')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
tripNumberConfig: {
|
||||||
|
data: [],
|
||||||
|
title: this.$t('planMonitor.tripNumber'),
|
||||||
|
showHeader: false,
|
||||||
|
highlightCurrentRow: true,
|
||||||
|
handleChange: this.tripNumberChange,
|
||||||
|
showClose: false,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
prop: 'tripNumber',
|
||||||
|
label: this.$t('planMonitor.tripNumber')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
realData: {},
|
||||||
|
kmRangeCoordMap: {},
|
||||||
|
option: {
|
||||||
|
title: {
|
||||||
|
text: '',
|
||||||
|
left: 'center',
|
||||||
|
top: '10px'
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '60px',
|
||||||
|
left: '160px',
|
||||||
|
right: '100px',
|
||||||
|
bottom: '80px',
|
||||||
|
containLabel: true,
|
||||||
|
backgroundColor: 'floralwhite'
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'cross',
|
||||||
|
snap: true,
|
||||||
|
axis: 'x'
|
||||||
|
},
|
||||||
|
formatter: this.axisTooltip,
|
||||||
|
borderWidth: 1,
|
||||||
|
position: function (pt) {
|
||||||
|
const data = pt[0] + 10;
|
||||||
|
return [data, '20%'];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: 'category',
|
||||||
|
boundaryGap: false,
|
||||||
|
data: [],
|
||||||
|
axisLine: {
|
||||||
|
onZero: false,
|
||||||
|
lineStyle: {
|
||||||
|
width: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
formatter: this.xAxisLableFormat,
|
||||||
|
textStyle: {
|
||||||
|
color: '#333'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisPointer: {
|
||||||
|
snap: true,
|
||||||
|
label: {
|
||||||
|
formatter: this.xAxisPointFormat,
|
||||||
|
backgroundColor: 'rgb(255,0,0,0.5)',
|
||||||
|
color: 'white'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
splitLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
onZero: false,
|
||||||
|
lineStyle: {
|
||||||
|
width: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
interval: 'auto',
|
||||||
|
formatter: this.yAxisLableFormat
|
||||||
|
},
|
||||||
|
axisPointer: {
|
||||||
|
xAxisIndex: 'all',
|
||||||
|
label: {
|
||||||
|
formatter: this.yAxisPointFormat,
|
||||||
|
backgroundColor: 'rgb(0,100,0,0.5)',
|
||||||
|
color: 'white'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
min: 0,
|
||||||
|
max: 0
|
||||||
|
},
|
||||||
|
graphic: [{
|
||||||
|
id: 'static',
|
||||||
|
elements: []
|
||||||
|
}],
|
||||||
|
markPoint: [{
|
||||||
|
id: 'mark',
|
||||||
|
data: []
|
||||||
|
}],
|
||||||
|
series: [],
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
type: 'inside',
|
||||||
|
zoomOnMouseWheel : 'ctrl',
|
||||||
|
moveOnMouseMove : 'ctrl',
|
||||||
|
moveOnMouseWheel: 'ctrl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fiterMode: 'filter',
|
||||||
|
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
||||||
|
handleSize: '80%',
|
||||||
|
handleStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
shadowBlur: 3,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.6)',
|
||||||
|
shadowOffsetX: 2,
|
||||||
|
shadowOffsetY: 2
|
||||||
|
},
|
||||||
|
bottom: '20px'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
absoluteTime: 2 * 3600,
|
||||||
|
indexKmRangeMap: {},
|
||||||
|
stationsObj: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('rpTools', [
|
||||||
|
'stations'
|
||||||
|
]),
|
||||||
|
planId() {
|
||||||
|
return this.$route.query.planId;
|
||||||
|
},
|
||||||
|
mapId() {
|
||||||
|
return 9;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
maxWidth() {
|
||||||
|
this.setPosition();
|
||||||
|
},
|
||||||
|
maxHeight() {
|
||||||
|
this.setPosition();
|
||||||
|
},
|
||||||
|
'$store.state.rpTools.planSizeCount': function () {
|
||||||
|
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||||
|
},
|
||||||
|
'$store.state.rpTools.refreshCount': function() {
|
||||||
|
this.loadChartPage();
|
||||||
|
},
|
||||||
|
$route() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.loadChartPage();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadRunPlanId() {
|
||||||
|
this.loadChartPage();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.setPosition();
|
||||||
|
this.loadChartPage();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.destroy();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
displayTrain() {
|
||||||
|
this.showTrain = !this.showTrain;
|
||||||
|
},
|
||||||
|
serviceNumberChange(row) {
|
||||||
|
let serviceNumber = null;
|
||||||
|
let serviceObj = {};
|
||||||
|
if (row) {
|
||||||
|
serviceNumber = row.serviceNumber;
|
||||||
|
serviceObj = this.$store.state.rpTools.editData[row.serviceNumber] || {};
|
||||||
|
|
||||||
|
const op = this.myChart.getOption();
|
||||||
|
op.series.forEach((item, index) => {
|
||||||
|
item.lineStyle.color = '#000';
|
||||||
|
switch (item.name) {
|
||||||
|
case serviceNumber: {
|
||||||
|
item.lineStyle.color = 'red';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'trainLabel': {
|
||||||
|
op.series.pop();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.myChart.setOption(op, true);
|
||||||
|
}
|
||||||
|
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: null });
|
||||||
|
this.analyticalTripNumber(serviceObj.trainMap || {});
|
||||||
|
},
|
||||||
|
tripNumberChange(row) {
|
||||||
|
const serviceNumber = this.$store.state.rpTools.selected.serviceNumber;
|
||||||
|
let tripNumber = null;
|
||||||
|
if (row) {
|
||||||
|
const data = [];
|
||||||
|
tripNumber = row.tripNumber;
|
||||||
|
const op = this.myChart.getOption();
|
||||||
|
op.series.forEach((item, index) => {
|
||||||
|
switch (item.name) {
|
||||||
|
case serviceNumber: {
|
||||||
|
item.data.forEach(nor => {
|
||||||
|
if (nor[3] == tripNumber) {
|
||||||
|
data.push(nor);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'trainLabel': {
|
||||||
|
op.series.pop();
|
||||||
|
this.myChart && this.myChart.setOption(op, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
op.series.push({
|
||||||
|
name: 'trainLabel',
|
||||||
|
lineStyle: {
|
||||||
|
color: 'green'
|
||||||
|
},
|
||||||
|
type: 'line',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.myChart && this.myChart.setOption(op, true);
|
||||||
|
}, 50);
|
||||||
|
|
||||||
|
}
|
||||||
|
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
|
||||||
|
},
|
||||||
|
async analyticalServiceNumber(data) {
|
||||||
|
this.serviceNumberConfig.data = Object.keys(data || {})
|
||||||
|
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||||
|
.map(serviceNumber => { return { serviceNumber }; });
|
||||||
|
},
|
||||||
|
async analyticalTripNumber(data) {
|
||||||
|
this.tripNumberConfig.data = Object.keys(data || {})
|
||||||
|
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||||
|
.map(tripNumber => { return { tripNumber }; });
|
||||||
|
},
|
||||||
|
async setPosition() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let top = 3;
|
||||||
|
const width = this.maxWidth;
|
||||||
|
let height = this.maxHeight;
|
||||||
|
|
||||||
|
const titleBar = document.getElementById('PlanTitleBar');
|
||||||
|
const menuBar = document.getElementById('PlanMenuBar');
|
||||||
|
const menuTool = document.getElementById('PlanMenuTool');
|
||||||
|
const statusBar = document.getElementById('PlanStatusBar');
|
||||||
|
|
||||||
|
if (titleBar) {
|
||||||
|
top += (titleBar.offsetHeight || 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menuBar) {
|
||||||
|
top += (menuBar.offsetHeight || 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menuTool) {
|
||||||
|
top += (menuTool.offsetHeight || 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusBar) {
|
||||||
|
height -= (statusBar.offsetHeight || 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
height = height - top;
|
||||||
|
this.$store.dispatch('rpTools/resize', { width, height });
|
||||||
|
|
||||||
|
if (this.top != top) {
|
||||||
|
this.top = top;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.height != height) {
|
||||||
|
this.height = height - 20 * 2;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async loadChartPage() {
|
||||||
|
try {
|
||||||
|
this.$store.dispatch('rpTools/clear').then(() => {
|
||||||
|
this.loadInitChart().then(() => {
|
||||||
|
if (this.mapId) {
|
||||||
|
loadMapDataById(this.mapId);
|
||||||
|
getStationList(this.mapId).then(resp => {
|
||||||
|
const stations = resp.data.filter(el => {
|
||||||
|
return ['车辆段', '停车场'].findIndex(it => {
|
||||||
|
return el.name.includes(it)
|
||||||
|
}) < 0;
|
||||||
|
});
|
||||||
|
this.$store.dispatch('rpTools/setStations', stations).then(() => {
|
||||||
|
this.loadInitData();
|
||||||
|
this.myChart && this.myChart.showLoading();
|
||||||
|
getRpTools().then(rest => {
|
||||||
|
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||||
|
this.analyticalServiceNumber(this.$store.state.rpTools.editData);
|
||||||
|
this.loadChartData();
|
||||||
|
this.myChart && this.myChart.hideLoading();
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.myChart && this.myChart.hideLoading();
|
||||||
|
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.requestingStationDataFailed'));
|
||||||
|
this.$store.dispatch('rpTools/setStations', []);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async loadChartData() {
|
||||||
|
try {
|
||||||
|
const stations = this.$store.state.rpTools.stations;
|
||||||
|
const planData = this.$store.state.rpTools.planData;
|
||||||
|
this.stationsObj = {};
|
||||||
|
stations.forEach(item => {
|
||||||
|
this.stationsObj[Math.floor(item.kmRange)] = item;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.viewDisabled = true;
|
||||||
|
|
||||||
|
this.option.series = [];
|
||||||
|
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) {
|
||||||
|
this.viewDisabled = false;
|
||||||
|
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async loadInitData() {
|
||||||
|
await this.xAxisInit();
|
||||||
|
await this.yAxisInit();
|
||||||
|
await this.loadInitChart();
|
||||||
|
},
|
||||||
|
pushModels(series, models) {
|
||||||
|
if (models && models.length) {
|
||||||
|
models.forEach(elem => {
|
||||||
|
if (elem) {
|
||||||
|
series.push(elem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return series;
|
||||||
|
},
|
||||||
|
popModels(series, models) {
|
||||||
|
if (models && models.length) {
|
||||||
|
models.forEach(elem => {
|
||||||
|
const index = series.indexOf(elem);
|
||||||
|
if (index >= 0) {
|
||||||
|
series.split(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return series;
|
||||||
|
},
|
||||||
|
loadInitChart() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
if (this.myChart && this.myChart.isDisposed) {
|
||||||
|
this.myChart.clear();
|
||||||
|
}
|
||||||
|
if (this.$route.query.planName || this.$route.query.prdType === '05') {
|
||||||
|
this.option.title.text = this.mapName;
|
||||||
|
}
|
||||||
|
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||||
|
this.myChart.setOption(this.option, {notMerge: true});
|
||||||
|
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||||
|
resolve(true);
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
destroy() {
|
||||||
|
if (this.myChart && this.myChart.isDisposed) {
|
||||||
|
this.myChart.dispose();
|
||||||
|
this.myChart = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
xAxisLableFormat(value, index) {
|
||||||
|
if (value % 60 === 0) {
|
||||||
|
return timeFormat(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxisLableFormat(value, index) {
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
xAxisInit() {
|
||||||
|
const list = [];
|
||||||
|
for (var time = 0 + this.planConvert.TranslationTime; time < 3600 * 24 + this.planConvert.TranslationTime; time++) {
|
||||||
|
list.push(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
const startValue = 3600 * 6;
|
||||||
|
const offsetTime = 3600 * 1;
|
||||||
|
|
||||||
|
this.option.xAxis[0].data = list;
|
||||||
|
if (!this.option.dataZoom[0].startValue) {
|
||||||
|
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = startValue - offsetTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.option.dataZoom[0].endValue) {
|
||||||
|
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = startValue + offsetTime;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxisInit() {
|
||||||
|
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) {
|
||||||
|
let data = '';
|
||||||
|
const arr = [];
|
||||||
|
param.forEach(item => {
|
||||||
|
const station = this.stationsObj[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
|
||||||
|
if (!arr.includes(`${item.data[0]}${item.data[1]}`)) {
|
||||||
|
arr.push(`${item.data[0]}${item.data[1]}`);
|
||||||
|
const list = [
|
||||||
|
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
|
||||||
|
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m <br>`,
|
||||||
|
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
|
||||||
|
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}(${item.data[3][0] == '2' ? 'Up' : 'Down'})`,
|
||||||
|
`<hr size=1 style="margin: 3px 0">`
|
||||||
|
];
|
||||||
|
data += list.join('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
reSize(opt) {
|
||||||
|
if (this.myChart) {
|
||||||
|
this.myChart.resize({
|
||||||
|
width: opt.width,
|
||||||
|
height: opt.height,
|
||||||
|
silent: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createRpTrip(data) {
|
||||||
|
addRpTrip(data).then(resp => {
|
||||||
|
this.loadChartData();
|
||||||
|
}).catch(error => {
|
||||||
|
if (this.myChart) {
|
||||||
|
const op = this.myChart.getOption();
|
||||||
|
op.graphic[0].elements = [];
|
||||||
|
this.myChart.setOption(op, {notMerge: true});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped rel="stylesheet/scss" lang="scss">
|
||||||
|
@import "src/styles/mixin.scss";
|
||||||
|
|
||||||
|
#PlanSchedule {
|
||||||
|
z-index: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 45px);
|
||||||
|
position: relative;
|
||||||
|
margin-top: 45px;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.position {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: 50px;
|
||||||
|
width: 220px;
|
||||||
|
height: calc(100% - 45px);
|
||||||
|
}
|
||||||
|
.data_table_box{
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user