Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
fe93ecebe2
@ -270,7 +270,7 @@ deviceRender[deviceType.ArcStatus] = {
|
|||||||
deviceRender[deviceType.IscsButton] = {
|
deviceRender[deviceType.IscsButton] = {
|
||||||
_type: deviceType.IscsButton,
|
_type: deviceType.IscsButton,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 5
|
||||||
};
|
};
|
||||||
/** 状态表 */
|
/** 状态表 */
|
||||||
deviceRender[deviceType.StateTable] = {
|
deviceRender[deviceType.StateTable] = {
|
||||||
|
@ -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;
|
||||||
|
@ -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,6 +85,11 @@ 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();
|
||||||
|
@ -27,6 +27,7 @@ export default class Button extends Group {
|
|||||||
this.buttonText = new Text({
|
this.buttonText = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z + 1,
|
z: model.z + 1,
|
||||||
|
z2: model.z2 || 0,
|
||||||
style: {
|
style: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
@ -46,6 +47,7 @@ export default class Button extends Group {
|
|||||||
this.imageButton = new Image({
|
this.imageButton = new Image({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
|
z2: model.z2 || 0,
|
||||||
style: {
|
style: {
|
||||||
x: textRect.x - model.levelPadding,
|
x: textRect.x - model.levelPadding,
|
||||||
y: textRect.y - model.verticalPadding,
|
y: textRect.y - model.verticalPadding,
|
||||||
@ -61,6 +63,7 @@ export default class Button extends Group {
|
|||||||
this.textButtonRect = new Rect({
|
this.textButtonRect = new Rect({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
|
z2: model.z2 || 0,
|
||||||
shape: {
|
shape: {
|
||||||
x: textRect.x - model.levelPadding,
|
x: textRect.x - model.levelPadding,
|
||||||
y: textRect.y - model.verticalPadding,
|
y: textRect.y - model.verticalPadding,
|
||||||
@ -75,6 +78,7 @@ export default class Button extends Group {
|
|||||||
this.lineLeftTop = new Polyline({
|
this.lineLeftTop = new Polyline({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
|
z2: model.z2 || 0,
|
||||||
draggable: false,
|
draggable: false,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
@ -91,6 +95,7 @@ export default class Button extends Group {
|
|||||||
this.lineBottomRight = new Polyline({
|
this.lineBottomRight = new Polyline({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
|
z2: model.z2 || 0,
|
||||||
draggable: false,
|
draggable: false,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
@ -111,6 +116,7 @@ export default class Button extends Group {
|
|||||||
this.textButtonRectSmall = new Rect({
|
this.textButtonRectSmall = new Rect({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
|
z2: model.z2 || 0,
|
||||||
shape: {
|
shape: {
|
||||||
x: textRect.x - model.levelPadding + 6,
|
x: textRect.x - model.levelPadding + 6,
|
||||||
y: textRect.y - model.verticalPadding + 6,
|
y: textRect.y - model.verticalPadding + 6,
|
||||||
@ -145,7 +151,6 @@ export default class Button extends Group {
|
|||||||
this.add(this.grouper);
|
this.add(this.grouper);
|
||||||
this.on('mouseout', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColor || '#FFF'}); });
|
this.on('mouseout', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColor || '#FFF'}); });
|
||||||
this.on('mouseover', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColorActive || '#000'}); });
|
this.on('mouseover', (e) => { this.buttonText && this.buttonText.setStyle({textFill: model.textColorActive || '#000'}); });
|
||||||
|
|
||||||
}
|
}
|
||||||
setModel(dx, dy) {
|
setModel(dx, dy) {
|
||||||
this.model.point.x += dx;
|
this.model.point.x += dx;
|
||||||
|
@ -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) {
|
||||||
@ -10,6 +11,17 @@ export default class iscsCircle 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;
|
||||||
@ -20,7 +32,7 @@ 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 (view._type != 'IscsGroup') {
|
||||||
if (this.checkVisible(view)) {
|
if (this.checkVisible(view)) {
|
||||||
view.show();
|
view.show();
|
||||||
} else {
|
} else {
|
||||||
view.hide();
|
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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ class Jlmap {
|
|||||||
}
|
}
|
||||||
} else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) {
|
} else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) {
|
||||||
store.state.map.map.directionRodList.forEach(item => {
|
store.state.map.map.directionRodList.forEach(item => {
|
||||||
if (elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) {
|
if (elem.uniqueCode === item.uniqueCode) {
|
||||||
const updateRod = this.mapDevice[item.code];
|
const updateRod = this.mapDevice[item.code];
|
||||||
updateRod.reversed = elem.reversed;
|
updateRod.reversed = elem.reversed;
|
||||||
this.$painter.update(updateRod);
|
this.$painter.update(updateRod);
|
||||||
|
@ -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];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
<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>
|
||||||
@ -27,7 +27,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 'first'
|
active: 'first'
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createDataModel(models) {
|
createDataModel(models) {
|
||||||
@ -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,9 +1,9 @@
|
|||||||
<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>
|
||||||
@ -18,14 +18,14 @@ export default {
|
|||||||
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 {
|
||||||
|
@ -5,20 +5,20 @@
|
|||||||
<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>
|
||||||
@ -26,22 +26,66 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-form-item label="状态列表" />
|
||||||
|
<el-table stripe border :data="formModel.statusList" style="width: 100%; margin-bottom: 50px;" height="300px">
|
||||||
|
<el-table-column align="center">
|
||||||
|
<template slot="header">
|
||||||
|
<el-button size="mini" type="primary" style="float: right;" @click="createStatus">添加</el-button>
|
||||||
|
</template>
|
||||||
|
<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">
|
<div class="footer">
|
||||||
<el-button style="margin-left:10px" type="primary" @click="doCreateGroup">创建</el-button>
|
<el-button style="margin-left:10px" size="small" type="primary" @click="doCreateGroup">创建</el-button>
|
||||||
<!-- <el-button style="margin-left:10px" type="info" @click="doUpdeteGroup">修改</el-button>
|
|
||||||
<el-button style="margin-left:10px" type="danger" @click="doDeleteGroup">删除</el-button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</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: {
|
||||||
@ -50,30 +94,39 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: -1,
|
active: -1,
|
||||||
|
activeChild: -1,
|
||||||
|
elemCode: '',
|
||||||
|
elemStatus: '',
|
||||||
|
elemStatusType: '',
|
||||||
|
optionsList: [],
|
||||||
formModel: {
|
formModel: {
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
type: '',
|
||||||
elemList: []
|
elemList: [],
|
||||||
|
statusList: []
|
||||||
},
|
},
|
||||||
grTypeList: [],
|
grTypeList: [],
|
||||||
elTypeList: [],
|
elTypeList: [],
|
||||||
elTypeMap: {}
|
elTypeMap: {}
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rules() {
|
rules() {
|
||||||
return {
|
return {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: '请输入组名称', trigger: 'blur' },
|
{ required: true, message: '请输入组名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: '请选择组类型', trigger: 'change' },
|
{ required: true, message: '请选择组类型', trigger: 'change' }
|
||||||
],
|
],
|
||||||
elemList: [
|
elemList: [
|
||||||
{ type: 'array', required: true, message: '组元素不能为空', trigger: 'change' },
|
{ type: 'array', required: true, message: '组元素不能为空', trigger: 'change' }
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
|
...mapGetters('iscs', [
|
||||||
|
'iscs'
|
||||||
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.iscs.rightClickCount': function (val) {
|
'$store.state.iscs.rightClickCount': function (val) {
|
||||||
@ -82,27 +135,41 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
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: {
|
methods: {
|
||||||
|
changeType(type) {
|
||||||
|
this.formModel.elemList = [];
|
||||||
|
type && mapGroup[type].elemList.forEach(item => {
|
||||||
|
this.formModel.elemList.push({ type: item.type.lab, des: item.type.describe, code: '' });
|
||||||
|
});
|
||||||
|
this.formModel.statusList = [];
|
||||||
|
type && mapGroup[type].statusList.forEach(item => {
|
||||||
|
this.formModel.statusList.push({ childList: [], ...item});
|
||||||
|
});
|
||||||
|
},
|
||||||
handleActive(index, row) {
|
handleActive(index, row) {
|
||||||
this.active = this.active == index ? -1: index;
|
this.active = this.active == index ? -1 : index;
|
||||||
|
},
|
||||||
|
handleActiveChild(index, row) {
|
||||||
|
this.activeChild = this.activeChild == index ? -1 : index;
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.formModel.elemList.splice(index, 1);
|
this.formModel.elemList.splice(index, 1);
|
||||||
this.active = -1;
|
this.active = -1;
|
||||||
},
|
},
|
||||||
handleCreate(type) {
|
handleCreate(type, describe) {
|
||||||
if (type) {
|
if (type) {
|
||||||
console.log(type);
|
const opt = this.elTypeList.filter(ele => ele.lab == type);
|
||||||
this.formModel.elemList.push({ type: type, code: '' })
|
this.formModel.elemList.push({ type: type, des: opt[0].describe, code: '' });
|
||||||
} else {
|
} else {
|
||||||
this.$message.info('请选择元素类型')
|
this.$message.info('请选择元素类型');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSetSelect(model) {
|
handleSetSelect(model) {
|
||||||
@ -110,39 +177,65 @@ export default {
|
|||||||
if (this.active >= 0) {
|
if (this.active >= 0) {
|
||||||
if (elem) { elem.code = model.code; }
|
if (elem) { elem.code = model.code; }
|
||||||
this.active = -1;
|
this.active = -1;
|
||||||
} else {
|
}
|
||||||
this.formModel = {}
|
if (this.activeChild >= 0) {
|
||||||
this.isUpdate = true;
|
this.elemCode = model.code;
|
||||||
|
this.activeChild = -1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doCreateGroup() {
|
doCreateGroup() {
|
||||||
const modelList = [];
|
const modelList = [];
|
||||||
const model = {
|
const model = {
|
||||||
code: getUID('group'),
|
code: getUID('group', this.iscs.iscsGroupList),
|
||||||
_type: deviceType.IscsGroup,
|
_type: deviceType.IscsGroup,
|
||||||
name: this.formModel.name,
|
name: this.formModel.name,
|
||||||
type: this.formModel.type,
|
type: this.formModel.type,
|
||||||
elemMap: {}
|
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 = {
|
||||||
|
name: '',
|
||||||
|
type: '',
|
||||||
|
elemList: [],
|
||||||
|
statusList: []
|
||||||
|
};
|
||||||
},
|
},
|
||||||
doUpdateGroup() {
|
changeStatus(type) {
|
||||||
|
if (mapElement[type]) {
|
||||||
|
this.optionsList = Object.keys(mapElement[type].stateMap);
|
||||||
|
} else {
|
||||||
|
this.optionsList = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
doDeleteGroup() {
|
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">
|
||||||
|
<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>
|
</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,6 +1,9 @@
|
|||||||
<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="100px" style="width: 100%;padding: 10px 50px;">
|
<el-form ref="form" :rules="rules" :model="form" label-width="100px" style="width: 100%;padding: 10px 50px;">
|
||||||
|
<el-form-item label="图层:" prop="z2">
|
||||||
|
<el-input-number v-model="form.z2" controls-position="right" size="small" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="isUpdate" label="按钮编号:" prop="code">
|
<el-form-item v-if="isUpdate" label="按钮编号:" prop="code">
|
||||||
<el-input v-model="form.code" size="small" :disabled="true" />
|
<el-input v-model="form.code" size="small" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -19,6 +22,12 @@
|
|||||||
<el-form-item label="选中文字颜色:" prop="textColorActive">
|
<el-form-item label="选中文字颜色:" prop="textColorActive">
|
||||||
<el-color-picker v-model="form.textColorActive" size="small" />
|
<el-color-picker v-model="form.textColorActive" size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="背景颜色:" prop="textColor">
|
||||||
|
<el-color-picker v-model="form.fillColor" size="small" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选中背景颜色:" prop="textColor">
|
||||||
|
<el-color-picker v-model="form.fillColorActive" size="small" />
|
||||||
|
</el-form-item> -->
|
||||||
<el-form-item label="文字大小:" prop="fontSize">
|
<el-form-item label="文字大小:" prop="fontSize">
|
||||||
<el-input-number v-model="form.fontSize" size="small" controls-position="right" :min="1" />
|
<el-input-number v-model="form.fontSize" size="small" controls-position="right" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -72,6 +81,7 @@ export default {
|
|||||||
],
|
],
|
||||||
form: {
|
form: {
|
||||||
code: '',
|
code: '',
|
||||||
|
z2: 0,
|
||||||
levelPadding: 10,
|
levelPadding: 10,
|
||||||
verticalPadding: 5,
|
verticalPadding: 5,
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
@ -80,6 +90,8 @@ export default {
|
|||||||
context: '',
|
context: '',
|
||||||
function: '',
|
function: '',
|
||||||
textColor: '',
|
textColor: '',
|
||||||
|
// fillColor: '#D1C2C2',
|
||||||
|
// fillColorActive: '#847b7b',
|
||||||
textColorActive: '#000'
|
textColorActive: '#000'
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
@ -105,6 +117,7 @@ export default {
|
|||||||
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;
|
||||||
this.form.levelPadding = model.levelPadding;
|
this.form.levelPadding = model.levelPadding;
|
||||||
this.form.verticalPadding = model.verticalPadding;
|
this.form.verticalPadding = model.verticalPadding;
|
||||||
this.form.x = model.point.x;
|
this.form.x = model.point.x;
|
||||||
@ -149,6 +162,7 @@ export default {
|
|||||||
},
|
},
|
||||||
code: this.isUpdate ? this.form.code : getUID('IscsButton', this.iscs.iscsButtonList),
|
code: this.isUpdate ? this.form.code : getUID('IscsButton', this.iscs.iscsButtonList),
|
||||||
_type: 'IscsButton',
|
_type: 'IscsButton',
|
||||||
|
z2: this.form.z2,
|
||||||
levelPadding: this.form.levelPadding,
|
levelPadding: this.form.levelPadding,
|
||||||
verticalPadding: this.form.verticalPadding,
|
verticalPadding: this.form.verticalPadding,
|
||||||
context: this.form.context,
|
context: this.form.context,
|
||||||
@ -186,6 +200,7 @@ export default {
|
|||||||
this.showDeleteButton = false;
|
this.showDeleteButton = false;
|
||||||
this.form = {
|
this.form = {
|
||||||
code: '',
|
code: '',
|
||||||
|
z2: '',
|
||||||
levelPadding: 10,
|
levelPadding: 10,
|
||||||
verticalPadding: 2,
|
verticalPadding: 2,
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
|
@ -76,7 +76,7 @@ export default {
|
|||||||
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;
|
||||||
|
@ -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>
|
@ -19,6 +19,11 @@ export default {
|
|||||||
components:{
|
components:{
|
||||||
iscsSystem
|
iscsSystem
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
scaleRate:window.innerWidth / 1950
|
||||||
|
};
|
||||||
|
},
|
||||||
computed:{
|
computed:{
|
||||||
stationName() {
|
stationName() {
|
||||||
return this.$route.query.stationName;
|
return this.$route.query.stationName;
|
||||||
@ -37,10 +42,11 @@ export default {
|
|||||||
system: 'psdSystem',
|
system: 'psdSystem',
|
||||||
userInterface: 'psdOne'
|
userInterface: 'psdOne'
|
||||||
};
|
};
|
||||||
|
this.$refs.iscsPlate.show({}, this.width, this.height, this.scaleRate);
|
||||||
getIscsData(params).then(resp=>{
|
getIscsData(params).then(resp=>{
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
const data = JSON.parse(resp.data.graphData);
|
const data = JSON.parse(resp.data.graphData);
|
||||||
this.$refs.iscsPlate.show(data);
|
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
@ -191,9 +191,7 @@ export default {
|
|||||||
if (selected && selected._type.toUpperCase() === 'DirectionRod'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'DirectionRod'.toUpperCase()) {
|
||||||
this.activeName = 'first';
|
this.activeName = 'first';
|
||||||
this.resetEditData();
|
this.resetEditData();
|
||||||
console.log(this.editModel, '------------');
|
|
||||||
this.editModel = deepAssign(this.editModel, selected);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
console.log(this.editModel, '***********');
|
|
||||||
}
|
}
|
||||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'locationSectionCode'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'locationSectionCode'.toUpperCase()) {
|
||||||
this.addModel.sectionCode = selected.code;
|
this.addModel.sectionCode = selected.code;
|
||||||
@ -213,7 +211,6 @@ export default {
|
|||||||
create() {
|
create() {
|
||||||
const uid = getUID('DirectionRod', this.floodGateList || []);
|
const uid = getUID('DirectionRod', this.floodGateList || []);
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
||||||
console.log(section);
|
|
||||||
const model = {
|
const model = {
|
||||||
_type: 'DirectionRod',
|
_type: 'DirectionRod',
|
||||||
code: uid,
|
code: uid,
|
||||||
@ -231,6 +228,7 @@ export default {
|
|||||||
this.$refs.createForm.resetForm();
|
this.$refs.createForm.resetForm();
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
|
data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`;
|
||||||
this.$emit('updateMapModel', data);
|
this.$emit('updateMapModel', data);
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
|
Loading…
Reference in New Issue
Block a user