This commit is contained in:
sunzhenyu 2020-09-23 16:21:07 +08:00
commit a3342d93ed
113 changed files with 2448 additions and 85 deletions

View File

@ -33,3 +33,11 @@ export function getPracticeList(params) {
params
});
}
/** 导入项目试题库 */
export function importQuestionBand(data, projectCode) {
return request({
url: `/api/questionBank/project/${projectCode}/questions`,
method: 'post',
data
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -149,7 +149,7 @@
<el-button v-if="exportFlag" type="primary" size="small" :disabled="!canQuery" @click="doExport">{{ $t('global.export') }}</el-button>
<template v-for="(button, index) in queryList.actions">
<el-button v-if="button.fileType==='file' && (button.hasOwnProperty('show') ? button.show: true)" :key="index" :type="button.type ? button.type: 'primary'" size="small" class="button_style uploadDemo" :disabled="button.disabled" :loading="button.disabled">
<input id="queryFormFilesInput" type="file" class="file_box" accept=".json, application/json" @change="button.handler">
<input id="queryFormFilesInput" type="file" class="file_box" accept=".json, application/json, .xls , .xlsx" @change="button.handler">
{{ button.text }}
</el-button>
<el-button

View File

@ -178,7 +178,7 @@ deviceRender[deviceType.VolumeControlDamper] = {
deviceRender[deviceType.IscsText] = {
_type: deviceType.IscsText,
zlevel: 1,
z: 4
z: 6
};
/** 线段渲染配置 */
deviceRender[deviceType.IscsLine] = {
@ -192,6 +192,36 @@ deviceRender[deviceType.IscsRect] = {
zlevel:1,
z: 3
};
/** 菱形渲染配置 */
deviceRender[deviceType.IscsRhombus] = {
_type: deviceType.IscsRhombus,
zlevel:1,
z: 5
};
/** 对勾渲染配置 */
deviceRender[deviceType.IscsTick] = {
_type: deviceType.IscsTick,
zlevel:1,
z: 5
};
/** 箭头渲染配置 */
deviceRender[deviceType.IscsArrow] = {
_type: deviceType.IscsArrow,
zlevel:1,
z: 5
};
/** 单选文字渲染配置 */
deviceRender[deviceType.IscsRadioText] = {
_type: deviceType.IscsRadioText,
zlevel:1,
z: 5
};
/** 图片渲染配置 */
deviceRender[deviceType.IscsPicture] = {
_type: deviceType.IscsPicture,
zlevel:1,
z: 5
};
/** 楼梯 */
deviceRender[deviceType.Escalator] = {
_type: deviceType.Escalator,
@ -240,7 +270,7 @@ deviceRender[deviceType.IscsButton] = {
deviceRender[deviceType.StateTable] = {
_type: deviceType.StateTable,
zlevel: 1,
z: 5
z: 2
};
/** 照明组 */
deviceRender[deviceType.LightingGroup] = {
@ -326,4 +356,26 @@ deviceRender[deviceType.RectText] = {
zlevel: 1,
z: 4
};
/** 福州 三角形 */
deviceRender[deviceType.IscsTriangle] = {
_type: deviceType.IscsTriangle,
zlevel:1,
z: 5
};
/** 福州 圆形 */
deviceRender[deviceType.IscsCircle] = {
_type: deviceType.IscsCircle,
zlevel:1,
z: 5
};
/** 福州 屏蔽门 */
deviceRender[deviceType.FuzhouPsd] = {
_type: deviceType.FuzhouPsd,
zlevel:1,
z: 5
};
export default deviceRender;

View File

@ -28,7 +28,12 @@ const deviceType = {
VolumeControlDamper: 'VolumeControlDamper',
IscsText: 'IscsText',
IscsLine: 'IscsLine',
IscsPicture: 'IscsPicture',
IscsRect: 'IscsRect',
IscsRhombus: 'IscsRhombus',
IscsTick: 'IscsTick',
IscsArrow: 'IscsArrow',
IscsRadioText: 'IscsRadioText',
Escalator:'Escalator',
StairControl:'StairControl',
FasBrakeMachine:'FasBrakeMachine',
@ -50,7 +55,10 @@ const deviceType = {
FuzhouDoor: 'FuzhouDoor',
CommunicationButcher: 'CommunicationButcher',
AfcDoorUnite: 'AfcDoorUnite',
RectText: 'RectText'
RectText: 'RectText',
IscsTriangle:'IscsTriangle',
IscsCircle:'IscsCircle',
FuzhouPsd:'FuzhouPsd'
};
export default deviceType;

View File

@ -58,6 +58,7 @@ class Iscs {
}
// 保存原始数据
this.data = config;
this.lineCode = lineCode;
this.style = this.loadStyle(lineCode);
// 保存需展现的画布大小
this.canvasSize = {

View File

@ -269,8 +269,16 @@ class MouseController extends Eventful {
}
/** 创建假包围盒对象 */
createFakeBoundingRect(instance, boundingRect) {
const x1 = instance.model.point.x;
const y1 = instance.model.point.y;
let x1 = '';
let y1 = '';
if (instance.model.point) {
x1 = instance.model.point.x;
y1 = instance.model.point.y;
}
if (instance.model.points) {
x1 = instance.model.points[0].x;
y1 = instance.model.points[0].y;
}
return {
// x: x1 + boundingRect.x,
// y: y1 + boundingRect.y,

62
src/iscs/shape/arrow.js Normal file
View File

@ -0,0 +1,62 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
export default class Tick extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
let points = [];
if (model.arrowType == 'all') {
points = [
[0, -model.height / 2],
[0, -model.fontSize * Math.tan(Math.PI / 6)],
[-model.fontSize, 0],
[0, model.fontSize * Math.tan(Math.PI / 6)],
[0, model.height / 2],
[model.width, model.height / 2],
[model.width, -model.height / 2]
];
} else {
points = [
[0, -model.height / 2],
[0, -model.fontSize * Math.tan(Math.PI / 6)],
[-model.fontSize, 0],
[0, 0],
[model.width, 0],
[model.width, -model.height / 2]
];
}
this.iscsRect = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points: points
},
style: {
stroke: this.model.borderColor,
lineWidth: this.model.borderWidth,
fill: this.model.fillColor
}
});
this.grouper.origin = [0, 0];
this.grouper.rotation = Math.PI / 180 * (model.rotate || 0);
this.grouper.add(this.iscsRect);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -1,8 +1,11 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import Image from 'zrender/src/graphic/Image';
import Rect from 'zrender/src/graphic/shape/Rect';
import Polyline from 'zrender/src/graphic/shape/Polyline';
import buttonImg from '@/assets/iscs_icon/button.png';
import buttonActive from '@/assets/iscs_icon/button_active.png';
import Vue from 'vue';
export default class Button extends Group {
constructor(device) {
@ -31,7 +34,7 @@ export default class Button extends Group {
fontSize: model.fontSize,
fontFamily: 'consolas',
text: model.context,
textFill: '#FFF',
textFill: model.textColor || '#FFF',
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'bottom'
@ -39,6 +42,7 @@ export default class Button extends Group {
});
const textRect = this.buttonText.getBoundingRect();
this.buttonText.setStyle('textLineHeight', textRect.height);
if (Vue.prototype.$iscs.lineCode == '07') {
this.imageButton = new Image({
zlevel: model.zlevel,
z: model.z,
@ -51,12 +55,97 @@ export default class Button extends Group {
}
});
this.grouper.add(this.imageButton);
this.grouper.add(this.buttonText);
this.add(this.grouper);
this.on('mouseout', (e) => { this.buttonText && this.buttonText.setStyle({textFill: '#FFF'}); });
this.on('mouseover', (e) => { this.buttonText && this.buttonText.setStyle({textFill: '#000'}); });
this.on('mousedown', (e) => { this.imageButton && this.imageButton.setStyle({image: buttonActive}); });
this.on('mouseup', (e) => { this.imageButton && this.imageButton.setStyle({image: buttonImg}); });
} else if (Vue.prototype.$iscs.lineCode == '02') {
this.textButtonRect = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: {
x: textRect.x - model.levelPadding,
y: textRect.y - model.verticalPadding,
width: textRect.width + 2 * model.levelPadding,
height: textRect.height + 2 * model.verticalPadding
},
style: {
lineWidth: 0,
fill: '#D1C2C2'
}
});
this.lineLeftTop = new Polyline({
zlevel: model.zlevel,
z: model.z,
draggable: false,
shape: {
points: [
[textRect.x - model.levelPadding, textRect.y - model.verticalPadding + (textRect.height + 2 * model.verticalPadding)],
[textRect.x - model.levelPadding, textRect.y - model.verticalPadding],
[textRect.x - model.levelPadding + (textRect.width + 2 * model.levelPadding), textRect.y - model.verticalPadding]
]
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.lineBottomRight = new Polyline({
zlevel: model.zlevel,
z: model.z,
draggable: false,
shape: {
points: [
[textRect.x - model.levelPadding, textRect.y - model.verticalPadding + (textRect.height + 2 * model.verticalPadding)],
[textRect.x - model.levelPadding + (textRect.width + 2 * model.levelPadding), textRect.y - model.verticalPadding + (textRect.height + 2 * model.verticalPadding)],
[textRect.x - model.levelPadding + (textRect.width + 2 * model.levelPadding), textRect.y - model.verticalPadding]
]
},
style: {
lineWidth: 2,
stroke: '#696969'
}
});
this.grouper.add(this.textButtonRect);
this.grouper.add(this.lineLeftTop);
this.grouper.add(this.lineBottomRight);
if (this.model.function == 'ElementShow') {
this.textButtonRectSmall = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: {
x: textRect.x - model.levelPadding + 6,
y: textRect.y - model.verticalPadding + 6,
width: textRect.width + 2 * model.levelPadding - 12,
height: textRect.height + 2 * model.verticalPadding - 12
},
style: {
lineWidth: 2,
fill: 'rgba(0,0,0,0)',
stroke: '#908A90'
}
});
this.grouper.add(this.textButtonRectSmall);
this.textButtonRect.setStyle({fill: '#00CC00'});
this.lineLeftTop.setStyle({stroke: '#ffffff'});
this.lineBottomRight.setStyle({stroke: '#948390'});
} else {
this.on('mousedown', (e) => {
this.textButtonRect.setStyle({fill: '#847b7b'});
this.lineLeftTop.setStyle({stroke: '#696969'});
this.lineBottomRight.setStyle({stroke: '#FFFFFF'});
});
this.on('mouseup', (e) => {
this.textButtonRect.setStyle({fill: '#D1C2C2'});
this.lineLeftTop.setStyle({stroke: '#FFFFFF'});
this.lineBottomRight.setStyle({stroke: '#696969'});
});
}
}
this.grouper.add(this.buttonText);
this.add(this.grouper);
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'}); });
}
setModel(dx, dy) {
this.model.point.x += dx;

View File

@ -29,6 +29,11 @@ import BalancedElectric from './bas/balancedElectric';
import IscsText from './text';
import IscsLine from './line';
import IscsRect from './rect';
import IscsPicture from './picture';
import IscsRhombus from './rhombus';
import IscsTick from './tick';
import IscsArrow from './arrow';
import IscsRadioText from './radioText';
import Escalator from './escalator';
import StairControl from './stairControl';
import FasBrakeMachine from './fasBrakeMachine';
@ -51,6 +56,9 @@ import FuzhouDoor from './fuzhouDoor';
import CommunicationButcher from './communicationButcher';
import AfcDoorUnite from './afcDoorUnite';
import RectText from './rectText';
import IscsTriangle from './iscsTriangle';
import IscsCircle from './iscsCircle';
import FuzhouPsd from './fuzhouPsd';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -84,6 +92,10 @@ iscsShape[deviceType.VolumeControlDamper] = VolumeControlDamper;
iscsShape[deviceType.IscsText] = IscsText;
iscsShape[deviceType.IscsLine] = IscsLine;
iscsShape[deviceType.IscsRect] = IscsRect;
iscsShape[deviceType.IscsRhombus] = IscsRhombus;
iscsShape[deviceType.IscsTick] = IscsTick;
iscsShape[deviceType.IscsArrow] = IscsArrow;
iscsShape[deviceType.IscsRadioText] = IscsRadioText;
iscsShape[deviceType.Escalator] = Escalator;
iscsShape[deviceType.StairControl] = StairControl;
iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine;
@ -96,6 +108,7 @@ iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
iscsShape[deviceType.Cistern] = Cistern;
iscsShape[deviceType.IscsPicture] = IscsPicture;
iscsShape[deviceType.Electrically] = Electrically;
iscsShape[deviceType.Stairs] = Stairs;
iscsShape[deviceType.Elevator] = Elevator;
@ -106,6 +119,9 @@ iscsShape[deviceType.FuzhouDoor] = FuzhouDoor;
iscsShape[deviceType.CommunicationButcher] = CommunicationButcher;
iscsShape[deviceType.AfcDoorUnite] = AfcDoorUnite;
iscsShape[deviceType.RectText] = RectText;
iscsShape[deviceType.IscsTriangle] = IscsTriangle;
iscsShape[deviceType.IscsCircle] = IscsCircle;
iscsShape[deviceType.FuzhouPsd] = FuzhouPsd;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -0,0 +1,87 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class fuzhouPsd extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this._code = device.model.code;
this.create();
this.setState(this.model);
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.fuzhouPsdBorder = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: this.model.height * 1.5,
height: this.model.height
},
style: {
fill: '#c48b19',
stroke: '#f00',
lineWidth: 0
}
});
this.fuzhouPsdLeft = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 2 + (this.model.height * 1.5 - 4) * 0.1,
y: 3,
width: (this.model.height * 1.5 - 4) * 0.4,
height: this.model.height - 6
},
style: {
fill: '#33CC00',
stroke: '#000',
lineWidth: 1
}
});
this.fuzhouPsdRight = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: (this.model.height * 1.5 - 4) * 0.5 + 2,
y: 3,
width: (this.model.height * 1.5 - 4) * 0.4,
height: this.model.height - 6
},
style: {
fill: '#33CC00',
stroke: '#000',
lineWidth: 1
}
});
this.grouper.add(this.fuzhouPsdBorder);
this.grouper.add(this.fuzhouPsdLeft);
this.grouper.add(this.fuzhouPsdRight);
this.add(this.grouper);
}
setState(model) {
if (model.alarm) {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
}
if (model.noStatus) {
this.fuzhouPsdLeft.attr({shape:{x: 2}});
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
}
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -0,0 +1,41 @@
import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
export default class iscsCircle extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.iscsCircle = new Circle({
zlevel: model.zlevel,
z: model.z,
shape: {
cx:this.model.radius,
cy:this.model.radius,
r:this.model.radius
},
style: {
fill: this.model.fillColor,
stroke: this.model.strokeColor,
lineWidth: this.model.borderWidth
}
});
this.grouper.add(this.iscsCircle);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -1,7 +1,7 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
export default class BrakeMachine extends Group {
export default class iscsImage extends Group {
constructor(device) {
super();
this.model = device.model;

View File

@ -0,0 +1,77 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
export default class iscsTriangle extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
const point1 = {x:0, y:0};
const point2 = {x:0, y:0};
const point3 = {x:0, y:0};
switch (this.model.direction) {
case 'left': {
point1.y = this.model.width / 2;
point2.x = point3.x = this.model.height;
point2.y = this.model.width;
point3.y = 0;
break;
}
case 'right': {
point2.x = this.model.height;
point2.y = this.model.width / 2;
point3.x = 0;
point3.y = this.model.width;
break;
}
case 'up': {
point1.x = this.model.width / 2;
point2.x = 0;
point2.y = this.model.height;
point3.x = this.model.width;
point3.y = this.model.height;
break;
}
case 'down': {
point2.x = this.model.width;
point2.y = 0;
point3.x = this.model.width / 2;
point3.y = this.model.height;
break;
}
}
this.iscsTriangle = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points:[
[point1.x, point1.y],
[point2.x, point2.y],
[point3.x, point3.y]
]
},
style: {
fill: this.model.fillColor,
stroke: this.model.strokeColor,
lineWidth: this.model.borderWidth
}
});
this.grouper.add(this.iscsTriangle);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

52
src/iscs/shape/picture.js Normal file
View File

@ -0,0 +1,52 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import psdLeft from '@/assets/iscs_picture/iscs-psd-left.png';
import psdSystem from '@/assets/iscs_picture/iscs-psd.png';
import psdRight from '@/assets/iscs_picture/iscs-psd-right.png';
import fireBlue from '@/assets/iscs_picture/iscs-fire-blue.png';
import fireRed from '@/assets/iscs_picture/iscs-fire-red.png';
const pictureObj = {
'psdLeft': psdLeft,
'psdSystem': psdSystem,
'psdRight': psdRight,
's': fireBlue,
'a': fireRed
};
export default class Picture extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this._function = device.model.function;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.imageButton = new Image({
zlevel: model.zlevel,
z: model.z,
style: {
x: 0,
y: 0,
image: pictureObj[model.type],
width: model.width,
height: model.height
}
});
this.grouper.add(this.imageButton);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -0,0 +1,74 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class text extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
for (let index = 0; index < model.num; index++) {
let pointx = 0;
let pointy = 0;
if (index) {
const textRect = this.grouper.getBoundingRect();
pointx = textRect.width;
pointy = 0;
}
this.grouper.add(new Text({
_subType: `radio_${index}`,
zlevel: model.zlevel,
z: model.z,
silent: model.silent || false,
style: {
x: pointx,
y: pointy,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: 'consolas',
text: model.tableData[index]['text'],
textStrokeWidth: model.textStrokeWidth,
textFill: model.textFill,
textAlign: model.textAlign || 'center',
textPosition: model.textPosition || 'inside',
textVerticalAlign: model.textVerticalAlign || 'middle',
textLineHeight: model.fontSize,
textBackgroundColor: model.gbColor || null,
textBorderColor: model.gbColorBorder || null,
textBorderWidth: model.gbWidth || null,
textPadding: [model.verticalPadding || 0, model.levelPadding || 0, model.verticalPadding - 2 || 0, model.levelPadding || 0]
}
}));
}
this.grouper._children[model.status].setStyle({textBackgroundColor: 'red'});
this.add(this.grouper);
}
onclick(e) {
if (e.target._subType) {
const num = e.target._subType.split('_')[1];
this.grouper._children.forEach(model => {
model.setStyle({textBackgroundColor: this.model.gbColor});
});
this.grouper._children[num].setStyle({textBackgroundColor: 'red'});
}
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
setSize(width, height) {
this.model.width = width;
this.model.height = height;
}
}

View File

@ -70,7 +70,6 @@ export default class RectText extends Group {
textVerticalAlign: 'middle'
}
});
console.log(this.model.distance, this.outsideText);
this.grouper.add(this.outsideText);
}
this.grouper.add(this.rectUnite);

47
src/iscs/shape/rhombus.js Normal file
View File

@ -0,0 +1,47 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
export default class Rhombus extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
const lineDash = model.type == 'dashed' ? [8, 5] : [0, 0];
this.iscsRect = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points: [
[-this.model.width / 2, 0],
[0, -this.model.height / 2],
[this.model.width / 2, 0],
[0, this.model.height / 2],
[-this.model.width / 2, 0]
]
},
style: {
fill: this.model.fillColor,
stroke: this.model.strokeColor,
lineDash: lineDash,
lineWidth: this.model.borderWidth
}
});
this.grouper.add(this.iscsRect);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -191,7 +191,7 @@ export default class StateTable extends Group {
y2: rowNum * model.rowHeight
},
style: {
stroke: '#FFF',
stroke: model.borderColor || '#FFF',
lineWidth: 2
}
});
@ -208,7 +208,7 @@ export default class StateTable extends Group {
height: rowNum * model.rowHeight
},
style: {
stroke: '#aFFF',
stroke: model.borderColor || '#aFFF',
fill: 'rgba(255, 255, 255, 0)',
lineWidth: 2
}
@ -225,7 +225,7 @@ export default class StateTable extends Group {
y2: i * model.rowHeight
},
style: {
stroke: '#FFF',
stroke: model.borderColor || '#FFF',
lineWidth: 2
}
});
@ -244,7 +244,7 @@ export default class StateTable extends Group {
fontSize: model.headerFontSize,
fontFamily: 'consolas',
text: model.headerContextList[0],
textFill: '#FFF',
textFill: model.textColor || '#FFF',
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'bottom',
@ -266,7 +266,7 @@ export default class StateTable extends Group {
fontSize: model.headerFontSize,
fontFamily: 'consolas',
text: model.headerContextList[i],
textFill: '#FFF',
textFill: model.textColor || '#FFF',
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'bottom',
@ -310,7 +310,7 @@ export default class StateTable extends Group {
fontSize: model.fontSize,
fontFamily: 'consolas',
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)],
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : '#4CCDE4',
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : this.model.textColor ? this.model.textColor : '#4CCDE4',
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'bottom',
@ -331,7 +331,7 @@ export default class StateTable extends Group {
fontSize: model.fontSize,
fontFamily: 'consolas',
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '',
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : '#4CCDE4',
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : this.model.textColor ? this.model.textColor : '#4CCDE4',
textAlign: 'right',
textPosition: 'inside',
textVerticalAlign: 'bottom',

View File

@ -38,7 +38,8 @@ export default class text extends Group {
textBackgroundColor: model.gbColor || null,
textBorderColor: model.gbColorBorder || null,
textBorderWidth: model.gbWidth || null,
textPadding: [model.verticalPadding || 0, model.levelPadding || 0]
textPadding: [model.verticalPadding || 0, model.levelPadding || 0, model.verticalPadding - 2 || 0, model.levelPadding || 0]
// textPadding: [5, 5, 3, 5]
}
});
this.grouper.add(this.textName);

42
src/iscs/shape/tick.js Normal file
View File

@ -0,0 +1,42 @@
import Group from 'zrender/src/container/Group';
import Polyline from 'zrender/src/graphic/shape/Polyline';
export default class Tick extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.iscsRect = new Polyline({
zlevel: model.zlevel,
z: model.z,
shape: {
points: [
[-Math.tan(Math.PI / 6) * model.fontSize, -model.fontSize],
[0, 0],
[Math.tan(Math.PI / 6) * model.fontSize * 2, -model.fontSize * 2]
]
},
style: {
stroke: this.model.fillColor,
lineWidth: this.model.borderWidth || 1
}
});
this.grouper.add(this.iscsRect);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -136,6 +136,21 @@ export function parser(data) {
zrUtil.each(data.iscsRectList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsRect, elem);
});
zrUtil.each(data.iscsRhombusList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsRhombus, elem);
});
zrUtil.each(data.iscsTickList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsTick, elem);
});
zrUtil.each(data.iscsArrowList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsArrow, elem);
});
zrUtil.each(data.iscsRadioTextList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsRadioText, elem);
});
zrUtil.each(data.iscsPictureList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsPicture, elem);
});
zrUtil.each(data.escalatorList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.Escalator, elem);
});
@ -199,6 +214,15 @@ export function parser(data) {
zrUtil.each(data.rectTextList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.RectText, elem);
});
zrUtil.each(data.iscsTriangleList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsTriangle, elem);
});
zrUtil.each(data.iscsCircleList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.IscsCircle, elem);
});
zrUtil.each(data.fuzhouPsdList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouPsd, elem);
});
}
return iscsDevice;

View File

@ -9,6 +9,9 @@
import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail';
import { convertSheetToList } from '@/utils/runPlan';
import XLSX from 'xlsx';
import { importQuestionBand } from '@/api/race';
export default {
components: {
@ -94,7 +97,8 @@ export default {
}
],
actions: [
{ text: '添 加', handler: this.doCreate }
{ text: '添 加', handler: this.doCreate },
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank }
]
}
};
@ -152,6 +156,100 @@ export default {
reloadTable() {
this.queryList.reload();
},
handleImport(file) {
const questionTypeMap = {
'单选': 'select',
'多选': 'multi',
'判断': 'judge'
};
if (file) {
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
const questionList = [];
if (wb && wb.Sheets) {
for (const index in wb.Sheets) {
const dataList = convertSheetToList(wb.Sheets[index], true);
let questionTypeIndex;
let topicIndex;
let option1Index;
let option2Index;
let option3Index;
let option4Index;
let answerIndex;
dataList.forEach((item, index) => {
if (item[0] === '题型') {
questionTypeIndex = index;
} else if (item[0] === '题目') {
topicIndex = index;
} else if ( item[0] === '选项' && item[1] === 'A') {
option1Index = index;
} else if (!item[0] && item[1] === 'B') {
option2Index = index;
} else if (!item[0] && item[1] === 'C') {
option3Index = index;
} else if (!item[0] && item[1] === 'D') {
option4Index = index;
} else if (item[0] === '答案') {
answerIndex = index;
}
});
if (questionTypeIndex || questionTypeIndex === 0) {
dataList[questionTypeIndex].forEach((item, index) => {
if (item && item !== '题型') {
const param = {
type: questionTypeMap[item],
topic: dataList[topicIndex][index],
optionList: []
};
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' });
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' });
if (dataList[option3Index][index]) {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')});
}
if (dataList[option4Index][index]) {
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')});
}
questionList.push(param);
}
});
}
}
importQuestionBand(questionList, 'DRTS').then(resp => {
this.$message.success('导入题库成功!');
}).catch(()=>{
this.$message.error('导入题库失败!');
});
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}
},
importQuestionBank() {
const obj = document.getElementById('queryFormFilesInput');
if (!obj.files) return;
const f = obj.files[0];
this.handleImport(f);
}
}
};

View File

@ -68,7 +68,7 @@ export default {
type: 'totalSystem',
children: [
{
name: '变电所接线图',
name: '黄山变电所接线图',
mode: 'powerMonitoring02',
id: 'substation',
type: 'interface'
@ -80,7 +80,7 @@ export default {
type: 'interface'
},
{
name: '混合变电所主接线图',
name: '控制中心图',
mode: 'powerMonitoring02',
id: 'hybrid',
type: 'interface'
@ -92,7 +92,7 @@ export default {
type: 'interface'
},
{
name: '接触网图',
name: '停车场接触网图',
mode: 'powerMonitoring02',
id: 'catenary',
type: 'interface'
@ -292,7 +292,7 @@ export default {
{
name: '屏蔽门系统',
mode: 'psdSystem02',
id: 'signalSystem',
id: 'psdSystem',
type: 'totalSystem',
children: [
{

View File

@ -107,7 +107,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -0,0 +1,177 @@
<template>
<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-item label="箭头大小:" prop="fontSize">
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="线长度:" prop="width">
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="线高度:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="填充颜色:" prop="fillColor">
<el-color-picker v-model="form.fillColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="箭头类型:" prop="arrowType">
<el-select v-model="form.arrowType" placeholder="请选择" size="small">
<el-option label="全部" value="all" />
<el-option label="一半" value="half" />
</el-select>
</el-form-item>
<el-form-item label="边框颜色:" prop="borderColor">
<el-color-picker v-model="form.borderColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="边框宽度:" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="0" size="small" />
</el-form-item>
<el-form-item label="旋转角度:" prop="rotate">
<el-input-number v-model="form.rotate" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsArrow',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
fillColor: '#fff',
borderWidth: 0,
fontSize: 10,
width: 10,
height: 5,
arrowType: 'all',
borderColor: '#fff',
rotate: 0,
x: 10,
y: 10
},
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsArrow' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.fontSize = model.fontSize;
this.form.width = model.width;
this.form.height = model.height;
this.form.arrowType = model.arrowType;
this.form.rotate = model.rotate;
this.form.borderColor = model.borderColor;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsArrow', this.iscs.iscsRectList),
_type: 'IscsArrow',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
fontSize: this.form.fontSize,
width: this.form.width,
height: this.form.height,
arrowType: this.form.arrowType,
rotate: this.form.rotate,
borderColor: this.form.borderColor
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsArrow',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
fontSize: this.form.fontSize
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
fillColor: '',
borderWidth: 1,
fontSize: 10,
arrowType: 'all',
borderColor: '#fff',
rotate: 0,
width: 10,
height: 5,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -13,6 +13,12 @@
<el-form-item label="按钮文字:" prop="context">
<el-input v-model="form.context" size="small" />
</el-form-item>
<el-form-item label="文字颜色:" prop="textColor">
<el-color-picker v-model="form.textColor" size="small" />
</el-form-item>
<el-form-item label="选中文字颜色:" prop="textColorActive">
<el-color-picker v-model="form.textColorActive" size="small" />
</el-form-item>
<el-form-item label="文字大小:" prop="fontSize">
<el-input-number v-model="form.fontSize" size="small" controls-position="right" :min="1" />
</el-form-item>
@ -72,7 +78,9 @@ export default {
x: 10,
y: 10,
context: '',
function: ''
function: '',
textColor: '',
textColorActive: '#000'
},
rules: {
context: [
@ -104,10 +112,32 @@ export default {
this.form.context = model.context;
this.form.function = model.function;
this.form.fontSize = model.fontSize;
this.form.textColor = model.textColor || '#fff';
this.form.textColorActive = model.textColorActive || '#000';
}
}
},
mounted() {},
mounted() {
if (this.$route.query.lineCode == '02') {
this.functionList = [
{label: '操作按钮', value: 'OperatingButton'},
{label: '元素显隐', value: 'ElementShow'},
{label: '返回', value: 'GoBack'}
];
} else if (this.$route.query.lineCode == '07') {
this.functionList = [
{label: '图元说明', value: 'GraphicEle'},
{label: '公共区域', value: 'PublicArea'},
{label: '操作按钮', value: 'OperatingButton'},
{label: '返回', value: 'GoBack'},
{label: '至EPS系统及导向照明', value: 'GoEPS'},
{label: '射流风机图', value: 'GoJetFan'},
{label: '至B端小系统', value: 'GoBMiniSystem'},
{label: '至A端小系统(一)', value: 'GoAMiniSystem1'},
{label: '至A端小系统(二)', value: 'GoAMiniSystem2'}
];
}
},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
@ -123,7 +153,9 @@ export default {
verticalPadding: this.form.verticalPadding,
context: this.form.context,
function: this.form.function,
fontSize: this.form.fontSize
fontSize: this.form.fontSize,
textColor: this.form.textColor,
textColorActive: this.form.textColorActive
};
this.$emit('createDataModel', rectModel);
this.initPage();
@ -160,7 +192,9 @@ export default {
x: 10,
y: 10,
context: '',
function: ''
function: '',
textColor: '',
textColorActive: '#000'
};
}
}

View File

@ -0,0 +1,147 @@
<template>
<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-item label="半径:" prop="radius">
<el-input-number v-model="form.radius" controls-position="right" :min="5" size="small" />
</el-form-item>
<el-form-item label="填充色:" prop="fillColor">
<el-color-picker v-model="form.fillColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="边框宽度:" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="0" size="small" />
</el-form-item>
<el-form-item label="边框色:" prop="strokeColor">
<el-color-picker v-model="form.strokeColor" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsCircle',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
fillColor: '',
borderWidth: '',
strokeColor: '',
radius: 10,
x: 10,
y: 10
},
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择圆填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsCircle' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.strokeColor = model.strokeColor;
this.form.radius = model.radius;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsCircle', this.iscs.iscsCircleList),
_type: 'IscsCircle',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
radius: this.form.radius
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsCircle',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
radius: this.form.radius
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
fillColor: '',
borderWidth: '',
strokeColor: '',
radius: 10,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -0,0 +1,152 @@
<template>
<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-item label="大小:" prop="size">
<el-input-number v-model="form.size" controls-position="right" :min="1" size="small" />
</el-form-item> -->
<el-form-item label="图片类型:" prop="type">
<el-select v-model="form.type" placeholder="请选择类型" size="small">
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="宽度:" prop="width">
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="高度:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsPicture',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
type: '',
size: 10,
width: 50,
height: 50,
x: 10,
y: 10
},
typeList: [
{ name: '车头', value: 'psdLeft' },
{ name: '车尾', value: 'psdSystem' },
{ name: '车厢', value: 'psdRight' }
],
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsPicture' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.type = model.type;
this.form.size = model.size;
this.form.width = model.width;
this.form.height = model.height;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsPicture', this.iscs.iscsPictureList),
_type: 'IscsPicture',
type: this.form.type,
size: this.form.size,
width: this.form.width,
height: this.form.height
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsPicture',
type: this.form.type,
size: this.form.size
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
type: '',
size: 10,
width: 50,
height: 50,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -0,0 +1,165 @@
<template>
<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-item label="宽度:" prop="width">
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="高度:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="填充色:" prop="fillColor">
<el-color-picker v-model="form.fillColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="边框宽度:" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="0" size="small" />
</el-form-item>
<el-form-item label="类型:" prop="type">
<el-select v-model="form.type" placeholder="请选择类型" size="small">
<el-option label="实线:" value="solid" />
<el-option label="虚线:" value="dashed" />
</el-select>
</el-form-item>
<el-form-item label="边框色:" prop="strokeColor">
<el-color-picker v-model="form.strokeColor" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsRhombus',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
fillColor: '',
borderWidth: '',
strokeColor: '',
type: 'solid',
width: 1,
height: 1,
x: 10,
y: 10
},
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsRhombus' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.strokeColor = model.strokeColor;
this.form.width = model.width;
this.form.type = model.type || 'solid';
this.form.height = model.height;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsRhombus', this.iscs.iscsRectList),
_type: 'IscsRhombus',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
width: this.form.width,
height: this.form.height,
type: this.form.type
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsRhombus',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
width: this.form.width,
height: this.form.height
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
fillColor: '',
borderWidth: '',
strokeColor: '',
type: 'solid',
width: 1,
height: 1,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -10,6 +10,12 @@
<el-form-item label="y坐标:" prop="y">
<el-input-number v-model="addModel.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="文字颜色:">
<el-color-picker v-model="addModel.textColor" size="small" />
</el-form-item>
<el-form-item label="表格颜色:">
<el-color-picker v-model="addModel.borderColor" size="small" />
</el-form-item>
<el-form-item label="列数:" prop="columnNum">
<el-input-number v-model="addModel.columnNum" controls-position="right" :min="1" size="small" @change="changeColumnNum" />
</el-form-item>
@ -55,15 +61,15 @@
<template v-for="(item, i) in addModel.columnWidthList">
<el-table-column :key="i" :label="'列'+(i + 1)" :prop="'column'+ (i + 1)">
<template slot-scope="scope">
<el-input v-if="i === 0" v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small" />
<el-select v-else v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" filterable size="small">
<el-input v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" size="small" />
<!-- <el-select v-else v-model="addModel.tableData[scope.$index]['column'+ (i + 1)]" filterable size="small">
<el-option
v-for="it in stateList"
:key="it.value"
:label="it.label"
:value="it.value"
/>
</el-select>
</el-select> -->
</template>
</el-table-column>
</template>
@ -94,6 +100,8 @@ export default {
columnNum: 2,
rowNum: 2,
columnWidthList: [50, 50],
textColor: '',
borderColor: '',
headerType: 'normal',
tableData: [{}],
headerContextList: [],
@ -105,7 +113,9 @@ export default {
{label: '多列表头', value: 'normal'},
{label: '无表头', value: 'none'}
],
stateList: [
stateList: [],
stateList02: [],
stateList07: [
{label: '火灾系统故障', value: 'fasSystemFailure'},
{label: 'FACP自动状态', value: 'facpAutoMode'},
{label: '气灭控制系统状态', value: 'gesControlStatus'},
@ -171,6 +181,8 @@ export default {
this.addModel.y = model.point.y;
this.addModel.columnNum = model.columnNum;
this.addModel.rowNum = model.rowNum;
this.addModel.textColor = model.textColor;
this.addModel.borderColor = model.borderColor;
this.addModel.columnWidthList = model.columnWidthList;
this.addModel.headerType = model.headerType;
this.addModel.tableData = model.tableData;
@ -180,6 +192,13 @@ export default {
}
}
},
mounted() {
if (this.$route.query.lineCode == '02') {
// this.stateList = this.stateList02;
} else if (this.$route.query.lineCode == '07') {
this.stateList = this.stateList07;
}
},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
@ -196,6 +215,8 @@ export default {
headerType: this.addModel.headerType,
tableData: this.addModel.tableData,
_type: 'StateTable',
textColor: this.addModel.textColor,
borderColor: this.addModel.borderColor,
headerFontSize: this.addModel.headerFontSize,
fontSize: this.addModel.fontSize,
headerContextList: this.addModel.headerContextList,
@ -238,6 +259,8 @@ export default {
rowHeight: 25,
x: 10,
y: 10,
textColor: '',
borderColor: '',
columnNum: 2,
rowNum: 2,
columnWidthList: [50, 50],

View File

@ -20,7 +20,7 @@
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="背景颜色:">
<el-color-picker v-model="form.gbColor" size="small" />
<el-color-picker v-model="form.gbColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="背景描边颜色:">
<el-color-picker v-model="form.gbColorBorder" size="small" />

View File

@ -0,0 +1,139 @@
<template>
<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-item label="大小:" prop="fontSize">
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="颜色:" prop="fillColor">
<el-color-picker v-model="form.fillColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="线宽度:" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsTick',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
fillColor: '',
borderWidth: 1,
fontSize: 10,
x: 10,
y: 10
},
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsTick' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.fontSize = model.fontSize;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsTick', this.iscs.iscsRectList),
_type: 'IscsTick',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
fontSize: this.form.fontSize
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsTick',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
fontSize: this.form.fontSize
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
fillColor: '',
borderWidth: 1,
fontSize: 10,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -0,0 +1,168 @@
<template>
<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-item label="底边:" prop="width">
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="高度:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="朝向:" prop="direction">
<el-select v-model="form.direction" placeholder="请选择类型" size="small">
<el-option label="朝左" value="left" />
<el-option label="朝右" value="right" />
<el-option label="朝上" value="up" />
<el-option label="朝下" value="down" />
</el-select>
</el-form-item>
<el-form-item label="填充色:" prop="fillColor">
<el-color-picker v-model="form.fillColor" show-alpha size="small" />
</el-form-item>
<el-form-item label="边框宽度:" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="0" size="small" />
</el-form-item>
<el-form-item label="边框色:" prop="strokeColor">
<el-color-picker v-model="form.strokeColor" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'IscsTriangle',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
fillColor: '',
borderWidth: '',
direction:'left',
strokeColor: '',
width: 1,
height: 1,
x: 10,
y: 10
},
rules: {
strokeColor: [
{ required: true, message: '请选择边框颜色', trigger: 'change' }
],
fillColor: [
{ required: true, message: '请选择三角形填充颜色', trigger: 'change'}
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'IscsTriangle' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.fillColor = model.fillColor;
this.form.borderWidth = model.borderWidth;
this.form.strokeColor = model.strokeColor;
this.form.direction = model.direction;
this.form.width = model.width;
this.form.height = model.height;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('IscsTriangle', this.iscs.iscsTriangleList),
_type: 'IscsTriangle',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
direction:this.form.direction,
width: this.form.width,
height: this.form.height
};
this.$emit('createDataModel', rectModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rectModel = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IscsTriangle',
fillColor: this.form.fillColor,
borderWidth: this.form.borderWidth,
strokeColor: this.form.strokeColor,
direction:this.form.direction,
width: this.form.width,
height: this.form.height
};
this.$emit('deleteDataModel', rectModel);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
fillColor: '',
borderWidth: '',
strokeColor: '',
direction:'left',
width: 1,
height: 1,
x: 10,
y: 10
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -147,7 +147,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -138,7 +138,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -42,7 +42,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="扇门" name="ordinaryDoor">
<el-tab-pane label="扇门" name="OrdinaryDoor">
<ordinary-door
ref="ordinaryDoor"
style="width: 100%;height: 100%;"
@ -50,7 +50,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="门禁" name="fuzhouDoor">
<el-tab-pane label="门禁" name="FuzhouDoor">
<fuzhou-door
ref="fuzhouDoor"
style="width: 100%;height: 100%;"
@ -58,7 +58,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="通讯图符" name="communicationButcher">
<el-tab-pane label="通讯图符" name="CommunicationButcher">
<communication-butcher
ref="communication"
style="width: 100%;height: 100%;"
@ -66,7 +66,7 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="门禁单元" name="afcDoorUnite">
<el-tab-pane label="门禁单元" name="AfcDoorUnite">
<afc-door-unite
ref="afcDoorUnite"
style="width: 100%; height: 100%;"
@ -106,7 +106,7 @@ export default {
],
data() {
return {
enabledTab: 'PlatformScreenDoor',
enabledTab: 'IscsButton',
data: '',
stationCode: ''
};
@ -138,7 +138,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -316,7 +316,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -146,7 +146,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

View File

@ -0,0 +1,110 @@
<template>
<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-item label="门高:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import {getUID} from '@/iscs/utils/Uid';
import { mapGetters } from 'vuex';
export default {
name: 'FuzhouPsd',
data() {
return {
form:{
code: '',
height:30,
x: 10,
y: 10
},
rules: {},
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'FuzhouPsd' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.height = model.height;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('FuzhouPsd', this.iscs.fuzhouPsdList),
_type: 'FuzhouPsd',
height:this.form.height
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'FuzhouPsd',
height:this.form.height
};
this.$emit('deleteDataModel', model);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
height:30,
x: 10,
y: 10
};
}
}
};
</script>
<style scoped>
</style>

View File

@ -98,7 +98,6 @@ export default {
},
handleSave() {
const data = JSON.stringify(this.$store.state.iscs.iscs);
console.log(data);
this.$emit('handleSave', data);
},
handleTabClick() {

Some files were not shown because too many files have changed in this diff Show More