iscs bas 组件代码调整

This commit is contained in:
joylink_cuiweidong 2020-01-17 15:15:58 +08:00
parent 95e5c9f603
commit 22419fa6c9
14 changed files with 133 additions and 47 deletions

View File

@ -3,32 +3,32 @@ import Group from 'zrender/src/container/Group';
export default class elevatorBack extends Group {
constructor(device) {
super();
this.event = device.event;
this.model = device.model;
this.create();
}
constructor(device) {
super();
this.event = device.event;
this.model = device.model;
this.create();
}
create() {
const model = this.model;
const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+
' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+
model.width/6*5+' '+model.height/4+'L '+model.width/3+' '+model.height+' L'+model.width/6+
' '+model.height+' '+'A'+model.width/6+' '+model.width/6+' 0 0 1 '+model.width/6+' '+model.height/8*6;
this.elevatorBack = toolpath.createFromString(tempString, {
zlevel: model.zlevel,
z: model.z,
draggable: false,
style: {
x: model.point.x,
y: model.point.y,
brushType: 'fill',
fill: this.model.fillColor || '#313131',
lineWidth: 0
}
});
this.add(this.elevatorBack);
}
create() {
const model = this.model;
const tempString = 'M' + model.width / 6 + ' ' + model.height / 8 * 6 + ' L' + model.width / 6 * 4 +
' 0 L' + model.width / 6 * 5 + ' 0 A ' + model.width / 6 + ' ' + model.width / 6 + ' 0 0 1 ' +
model.width / 6 * 5 + ' ' + model.height / 4 + 'L ' + model.width / 3 + ' ' + model.height + ' L' + model.width / 6 +
' ' + model.height + ' ' + 'A' + model.width / 6 + ' ' + model.width / 6 + ' 0 0 1 ' + model.width / 6 + ' ' + model.height / 8 * 6;
this.elevatorBack = toolpath.createFromString(tempString, {
zlevel: model.zlevel,
z: model.z,
draggable: false,
style: {
x: model.point.x,
y: model.point.y,
brushType: 'fill',
fill: this.model.fillColor || '#313131',
lineWidth: 0
}
});
this.add(this.elevatorBack);
}
}

View File

@ -99,4 +99,41 @@ deviceRender[deviceType.BorderRadius] = {
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.AirConditioner] = {
_type: deviceType.AirConditioner,
zlevel: 1,
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.OrbitalVentilator] = {
_type: deviceType.OrbitalVentilator,
zlevel: 1,
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.JetFan] = {
_type: deviceType.JetFan,
zlevel: 1,
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.TunnelFan] = {
_type: deviceType.TunnelFan,
zlevel: 1,
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.FireDamper] = {
_type: deviceType.FireDamper,
zlevel: 1,
z: 4
};
/** 圆角边框渲染配置 */
deviceRender[deviceType.SmookProofFd] = {
_type: deviceType.SmookProofFd,
zlevel: 1,
z: 4
};
export default deviceRender;

View File

@ -13,7 +13,13 @@ const deviceType = {
Chiller:'Chiller',
CoolTower:'CoolTower',
BorderRadius: 'borderRadius',
EndDoor: 'endDoor'
EndDoor: 'endDoor',
AirConditioner:'AirConditioner',
OrbitalVentilator:'OrbitalVentilator',
JetFan:'JetFan',
TunnelFan:'TunnelFan',
FireDamper:'FireDamper',
SmookProofFd:'SmookProofFd'
};
export default deviceType;

View File

View File

View File

View File

View File

View File

View File

@ -14,6 +14,12 @@ import Chiller from './bas/chiller';
import CoolTower from './bas/coolTower';
import EndDoor from './endDoor';
import BorderRadius from './borderRadius';
import AirConditioner from './bas/airConditioner';
import OrbitalVentilator from './bas/orbitalVentilator';
import JetFan from './bas/jetFan';
import TunnelFan from './bas/tunnelFan';
import FireDamper from './bas/fireDamper';
import SmookProofFd from './bas/smookProofFd';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -31,6 +37,12 @@ iscsShape[deviceType.Chiller] = Chiller;
iscsShape[deviceType.CoolTower] = CoolTower;
iscsShape[deviceType.EndDoor] = EndDoor;
iscsShape[deviceType.BorderRadius] = BorderRadius;
iscsShape[deviceType.AirConditioner] = AirConditioner;
iscsShape[deviceType.OrbitalVentilator] = OrbitalVentilator;
iscsShape[deviceType.JetFan] = JetFan;
iscsShape[deviceType.TunnelFan] = TunnelFan;
iscsShape[deviceType.FireDamper] = FireDamper;
iscsShape[deviceType.SmookProofFd] = SmookProofFd;
function shapefactory(device, iscs) {
const type = device.model._type;

9
src/iscs/utils/Uid.js Normal file
View File

@ -0,0 +1,9 @@
export function getUID(type, list) {
if (list.length) {
const lastCode = list[list.length - 1].code;
const num = lastCode.split(type + '_')[1];
return type + `_${num + 1}`;
} else {
return type + `_1`;
}
}

View File

@ -86,6 +86,26 @@ export function parser(data) {
zrUtil.each(data.borderRadiusList || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.BorderRadius, elem);
} );
zrUtil.each(data.AirConditioner || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.AirConditioner, elem);
} );
zrUtil.each(data.OrbitalVentilator || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.OrbitalVentilator, elem);
} );
zrUtil.each(data.JetFan || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.JetFan, elem);
} );
zrUtil.each(data.TunnelFan || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.TunnelFan, elem);
} );
zrUtil.each(data.FireDamper || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.FireDamper, elem);
} );
zrUtil.each(data.SmookProofFd || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.SmookProofFd, elem);
} );
}
return iscsDevice;
@ -151,6 +171,24 @@ export function updateIscsData(device) {
case deviceType.BorderRadius:
updateIscsListByDevice(iscsData, 'borderRadius', device);
break;
case deviceType.AirConditioner:
updateIscsListByDevice(iscsData, 'airConditionerList', device);
break;
case deviceType.OrbitalVentilator:
updateIscsListByDevice(iscsData, 'orbitalVentilatorList', device);
break;
case deviceType.JetFan:
updateIscsListByDevice(iscsData, 'jetFanList', device);
break;
case deviceType.TunnelFan:
updateIscsListByDevice(iscsData, 'tunnelFanList', device);
break;
case deviceType.FireDamper:
updateIscsListByDevice(iscsData, 'fireDamperList', device);
break;
case deviceType.SmookProofFd:
updateIscsListByDevice(iscsData, 'smookProofFdList', device);
break;
}
store.dispatch('iscs/setIscsData', iscsData);

View File

@ -25,6 +25,7 @@
<script>
//
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'ManualAlarmButton',
@ -52,19 +53,10 @@ export default {
])
},
methods: {
getUid() {
if (this.vidiconList.length) {
const lastCode = this.vidiconList[this.vidiconList.length - 1].code;
const num = lastCode.split('vidicon_')[1];
return `vidicon_${num + 1}`;
} else {
return `vidicon_1`;
}
},
onSubmit(form) {
this.$refs.form.validate((valid) => {
if (valid) {
const Uid = this.getUid();
const Uid = getUID('Vidicon', this.vidiconList);
const model = {
_type: 'Vidicon',
code: Uid,

View File

@ -22,6 +22,7 @@
<script>
//
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'ManualAlarmButton',
@ -48,19 +49,10 @@ export default {
])
},
methods: {
getUid() {
if (this.vidiconCloudList.length) {
const lastCode = this.vidiconCloudList[this.vidiconCloudList.length - 1].code;
const num = lastCode.split('vidiconCloud_')[1];
return `vidiconCloud_${num + 1}`;
} else {
return `vidiconCloud_1`;
}
},
onSubmit(form) {
this.$refs.form.validate((valid) => {
if (valid) {
const Uid = this.getUid();
const Uid = getUID('VidiconCloud', this.vidiconCloudList);
const model = {
_type: 'VidiconCloud',
code: Uid,