psd子系统

This commit is contained in:
fan 2020-01-16 18:06:00 +08:00
parent dba419a524
commit 027518132a
8 changed files with 237 additions and 2 deletions

View File

@ -59,4 +59,11 @@ deviceRender[deviceType.Vidicon] = {
z: 4 z: 4
}; };
/** 端头门渲染配置*/
deviceRender[deviceType.EndDoor] = {
_type: deviceType.EndDoor,
zlevel: 1,
z: 4
};
export default deviceRender; export default deviceRender;

View File

@ -7,7 +7,8 @@ const deviceType = {
GasFireControl: 'gasFireControl', GasFireControl: 'gasFireControl',
SmokeDetector: 'smokeDetector', SmokeDetector: 'smokeDetector',
TemperatureDetector: 'temperatureDetector', TemperatureDetector: 'temperatureDetector',
PlatformScreenDoor: 'platformScreenDoor' PlatformScreenDoor: 'platformScreenDoor',
EndDoor: 'endDoor'
}; };
export default deviceType; export default deviceType;

67
src/iscs/shape/endDoor.js Normal file
View File

@ -0,0 +1,67 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Circle from 'zrender/src/graphic/shape/Circle';
export default class EndDoor 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();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.add(this.grouper);
this.door = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: this.model.width,
height: this.model.width * 29 / 17
},
style: {
fill: '#33CC00'
}
});
this.doorWindow = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: this.model.width * 2 / 17,
y: this.model.width * 6 / 17,
width: this.model.width * 13 / 17,
height: this.model.width * 4 / 17
},
style: {
fill: '#000'
}
});
this.doorknob = new Circle({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.width * 13 / 17,
cy: this.model.width * 21 / 17,
r: this.model.width / 17
},
style: {
fill: '#000'
}
});
this.grouper.add(this.door);
this.grouper.add(this.doorWindow);
this.grouper.add(this.doorknob);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -8,6 +8,7 @@ import GasFireControl from './gasFireControl';
import SmokeDetector from './smokeDetector'; import SmokeDetector from './smokeDetector';
import TemperatureDetector from './temperatureDetector'; import TemperatureDetector from './temperatureDetector';
import PlatformScreenDoor from './psd/platformScreenDoor'; import PlatformScreenDoor from './psd/platformScreenDoor';
import EndDoor from './endDoor';
const iscsShape = {}; const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -19,6 +20,7 @@ iscsShape[deviceType.GasFireControl] = GasFireControl;
iscsShape[deviceType.SmokeDetector] = SmokeDetector; iscsShape[deviceType.SmokeDetector] = SmokeDetector;
iscsShape[deviceType.TemperatureDetector] = TemperatureDetector; iscsShape[deviceType.TemperatureDetector] = TemperatureDetector;
iscsShape[deviceType.PlatformScreenDoor] = PlatformScreenDoor; iscsShape[deviceType.PlatformScreenDoor] = PlatformScreenDoor;
iscsShape[deviceType.EndDoor] = EndDoor;
function shapefactory(device, iscs) { function shapefactory(device, iscs) {
const type = device.model._type; const type = device.model._type;

View File

@ -0,0 +1,38 @@
import Group from 'zrender/src/container/Group';
const mean = {
slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障',
slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障',
slidingDoorsInterlockAllClear: '滑动门互锁解除报警',
emergencyControlPanelOperation: '紧急控制盘操作',
emergencyControlPanelOperationOpenCommand: '紧急控制盘操作开门命令',
emergencyControlPanelOperationCloseCommand: '紧急控制盘操作关门命令',
localControlPanelOperation: '就地控制盘操作',
localControlPanelOperationOpenCommand: '就地控制盘操作开门命令',
localControlPanelOperationCloseCommand: '就地控制盘操作关门命令',
automaticOpenOrder: '自动开门命令',
automaticCloseOrder: '自动开门命令',
allDoorsOpenInPlace: '所有门开到位',
allDoorsCloseInPlace: '所有门关到位',
systemDrivePowerFailure: '系统驱动电源故障',
systemControlPowerFailure: '系统控制电源故障',
monitorPowerFailure: '监视电源故障'
};
export default class StateTable 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();
}
cerate() {
// this.header =
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -64,6 +64,10 @@ export function parser(data) {
zrUtil.each(data.platformScreenDoorList || [], elem =>{ zrUtil.each(data.platformScreenDoorList || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.PlatformScreenDoor, elem); iscsDevice[elem.code] = deviceFactory(deviceType.PlatformScreenDoor, elem);
}); });
zrUtil.each(data.endDoorList || [], elem =>{
iscsDevice[elem.code] = deviceFactory(deviceType.EndDoor, elem);
});
} }
return iscsDevice; return iscsDevice;
@ -108,6 +112,9 @@ export function updateIscsData(device) {
case deviceType.FrozenPump : case deviceType.FrozenPump :
updateIscsListByDevice(iscsData, 'frozenPumpList', device); updateIscsListByDevice(iscsData, 'frozenPumpList', device);
break; break;
case deviceType.EndDoor:
updateIscsListByDevice(iscsData, 'endDoorList', device);
break;
} }
store.dispatch('iscs/setIscsData', iscsData); store.dispatch('iscs/setIscsData', iscsData);

View File

@ -0,0 +1,103 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="addModel.x" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="addModel.y" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'PlatformScreenDoor',
data() {
return {
addModel:{
code: '',
width: 25,
x: 10,
y: 10
},
rules: {
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],
x: [{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }]
},
showDeleteButton: false,
buttonText: '立即创建'
};
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'endDoor',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const maButtonModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'endDoor',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
this.initPage();
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.addModel = {
code: '',
width: 25,
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'endDoor_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}
};
</script>
<style scoped>
</style>

View File

@ -18,6 +18,14 @@
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="端头门" name="endDoor">
<end-door
ref="endDoor"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
</div> </div>
@ -26,11 +34,13 @@
<script> <script>
import {deviceFactory} from '@/iscs/utils/parser'; import {deviceFactory} from '@/iscs/utils/parser';
import PlatformScreenDoor from './platformScreenDoor'; import PlatformScreenDoor from './platformScreenDoor';
import EndDoor from './endDoor';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',
components: { components: {
PlatformScreenDoor PlatformScreenDoor,
EndDoor
}, },
mixins: [ mixins: [
], ],