This commit is contained in:
zyy 2020-02-06 19:43:55 +08:00
commit 4a9b866cc4
9 changed files with 66 additions and 16 deletions

View File

@ -195,5 +195,11 @@ deviceRender[deviceType.StairControl] = {
zlevel:1,
z: 4
};
/** fas 闸机 */
deviceRender[deviceType.FasBrakeMachine] = {
_type: deviceType.FasBrakeMachine,
zlevel:1,
z: 4
};
export default deviceRender;

View File

@ -29,7 +29,8 @@ const deviceType = {
IscsLine: 'IscsLine',
IscsRect: 'IscsRect',
Escalator:'Escalator',
StairControl:'StairControl'
StairControl:'StairControl',
FasBrakeMachine:'FasBrakeMachine'
};
export default deviceType;

View File

@ -47,6 +47,10 @@ const map = {
StairControl:{
width:103,
path:'M48,86V85h53V81H45V80h56V55H31V54h70V52H29V51h72V49H27V48h74V46H24V45h6V27H25V44H24V27H19v6H18V6H13V23H12V6H7v6H6V6H3V5h98V2H0V0H103V86H48ZM24,6H19V26h5V6Zm6,0H25V26h5V6Zm6,0H31V26h5V6Zm0,21H31V45h5V27ZM42,6H37V26h5V6Zm0,21H37V45h5V27ZM48,6H43V26h5V6Zm0,21H43V45h5V27ZM54,6H49V26h5V6Zm0,21H49V45h5V27ZM60,6H55V26h5V6Zm0,21H55V45h5V27ZM66,6H61V26h5V6Zm0,21H61V45h5V27ZM72,6H67V26h5V6Zm0,21H67V45h5V27ZM78,6H73V26h5V6Zm0,21H73V45h5V27ZM84,6H79V26h2V23l3,1.333V6Zm0,23-3,1V27H79V45h5V29ZM90,6H85V24.778L90,27l-5,1.667V45h5V6Zm6,0H91V45h5V6Zm5,0H97V45h4V6Z'
},
FasBrakeMachine:{
width:65,
path:'M0,29V21H1.474L9,14.732v-0.7L1.474,7.869H0V0H65V7.869H31.669L22,14.339v0.083L31.669,21H65v8H0ZM62,5.9V1.967H3V5.9H62ZM28.113,7.869H4.53l6,4.918H20.764ZM20.764,16H10.533l-6,5H28.113ZM62,23H3v4H62V23Z'
}
};

View File

@ -30,6 +30,7 @@ import IscsLine from './line';
import IscsRect from './rect';
import Escalator from './escalator';
import StairControl from './stairControl';
import FasBrakeMachine from './fasBrakeMachine';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -64,6 +65,7 @@ iscsShape[deviceType.IscsLine] = IscsLine;
iscsShape[deviceType.IscsRect] = IscsRect;
iscsShape[deviceType.Escalator] = Escalator;
iscsShape[deviceType.StairControl] = StairControl;
iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -0,0 +1,31 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from './components/pathsvg';
export default class FasBrakeMachine 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.path = createPathSvg(this.model);
if (!this.model.isRight) {
this.grouper.origin = [this.model.width / 2, this.model.width * 0.446 / 2];
this.grouper.rotation = Math.PI;
}
this.add(this.grouper);
this.grouper.add(this.path);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -136,6 +136,9 @@ export function parser(data) {
zrUtil.each(data.stairControlList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.StairControl, elem);
});
zrUtil.each(data.fasBrakeMachineList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.FasBrakeMachine, elem);
});
}
@ -252,6 +255,9 @@ export function updateIscsData(state, device) {
case deviceType.StairControl:
updateIscsListByDevice(state, 'stairControlList', device);
break;
case deviceType.FasBrakeMachine:
updateIscsListByDevice(state, 'fasBrakeMachineList', device);
break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -29,7 +29,7 @@
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name: 'BrakeMachine',
name: 'FasBrakeMachine',
data() {
return {
addModel:{
@ -57,7 +57,7 @@ export default {
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'BrakeMachine' ) {
if (model._type === 'FasBrakeMachine' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
@ -73,18 +73,18 @@ export default {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
const fasBrakeMachineModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
fill:'#fff',
isRight: this.addModel.isRight,
code: this.isUpdate ? this.form.code : getUID('BrakeMachine', this.iscs.brakeMachineList),
_type: 'BrakeMachine',
code: this.isUpdate ? this.addModel.code : getUID('FasBrakeMachine', this.iscs.fasBrakeMachineList),
_type: 'FasBrakeMachine',
width: this.addModel.width
};
this.$emit('createDataModel', maButtonModel);
this.$emit('createDataModel', fasBrakeMachineModel);
this.initPage();
} else {
return false;
@ -92,17 +92,17 @@ export default {
});
},
deleteDevice() {
const maButtonModel = {
const fasBrakeMachineModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
isRight: this.addModel.isRight,
_type: 'BrakeMachine',
_type: 'FasBrakeMachine',
width: this.addModel.width
};
this.$emit('deleteDataModel', maButtonModel);
this.$emit('deleteDataModel', fasBrakeMachineModel);
this.initPage();
},
initPage() {

View File

@ -50,9 +50,9 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="闸机" name="BrakeMachine">
<brake-machine
ref="brakeMachine"
<el-tab-pane label="闸机" name="FasBrakeMachine">
<fas-brake-machine
ref="fasBrakeMachine"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
@ -105,7 +105,7 @@
</template>
<script>
import {deviceFactory} from '@/iscs/utils/parser';
import BrakeMachine from './brakeMachine';
import FasBrakeMachine from './brakeMachine';
import Escalator from './escalator';
import StairControl from './stairControl';
import ManualAlarmButton from './manualAlarmButton';
@ -125,7 +125,7 @@ export default {
GasFireControl,
SmokeDetector,
TemperatureDetector,
BrakeMachine,
FasBrakeMachine,
Escalator,
StairControl,
IscsText,

View File

@ -80,7 +80,7 @@ export default {
},
fill:'#fff',
isRight: this.addModel.isRight,
code: this.isUpdate ? this.form.code : getUID('StairControl', this.iscs.stairControlList),
code: this.isUpdate ? this.addModel.code : getUID('StairControl', this.iscs.stairControlList),
_type: 'StairControl',
width: this.addModel.width
};