iscs调整
This commit is contained in:
parent
dc951d278e
commit
41f43f9d08
@ -208,5 +208,11 @@ deviceRender[deviceType.Staircase] = {
|
||||
zlevel:1,
|
||||
z: 4
|
||||
};
|
||||
/** 单向楼梯 */
|
||||
deviceRender[deviceType.SingleStaircase] = {
|
||||
_type: deviceType.SingleStaircase,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -31,7 +31,8 @@ const deviceType = {
|
||||
Escalator:'Escalator',
|
||||
StairControl:'StairControl',
|
||||
FasBrakeMachine:'FasBrakeMachine',
|
||||
Staircase:'Staircase'
|
||||
Staircase:'Staircase',
|
||||
SingleStaircase: 'SingleStaircase'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
File diff suppressed because one or more lines are too long
@ -55,6 +55,10 @@ const map = {
|
||||
Staircase:{
|
||||
width:133,
|
||||
path:'M12,131l25-11v8H97v6H37v8ZM3,186V155H132V108H3V77H17V47H10V41h7V24H3V4H136V186H3ZM132,8H7V20H132V8ZM28,41V24H21V41h7Zm-7,6V77h7V47H21Zm19-6V24H32V41h8Zm-8,6V77h8V47H32Zm19-6V24H44V41h7Zm-7,6V77h7V47H44Zm19-6V24H55V41h8Zm-8,6V77h8V47H55Zm15-6V33l4,1.76V24H67V41h3Zm-3,6V77h7V53.24L70,55V47H67Zm19-6.96V24H78V36.52ZM78,51.48V77h8V47.96ZM90,46.2V77h7V24H90V41.8L95,44ZM101,24V77h7V24h-7Zm11,0V77h8V24h-8Zm20,0h-8V77h8V24Zm0,57H7v6H132V81Zm0,10H7v4H132V91Zm0,8H7v5H132V99Zm0,60H7v6H132v-6Zm0,10H7v4H132v-4Zm0,8H7v5H132v-5Z'
|
||||
},
|
||||
SingleStaircase: {
|
||||
width: 58,
|
||||
path: 'M0,32V24H5V8H0V0H58V8H51V24h7v8H0Zm8-8h3V8H8V24ZM55,5V3H3V5H55ZM14,8V24h2V8H14Zm5,0V24h3V8H19Zm6,0V24h2V8H25Zm5,0V24h2V8H30Zm5,0V24h2V8H35Zm5,0V24h3V8H40Zm6,0V24h2V8H46Zm9,19H3v2H55V27Z'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,7 @@ import Escalator from './escalator';
|
||||
import StairControl from './stairControl';
|
||||
import FasBrakeMachine from './fasBrakeMachine';
|
||||
import Staircase from './staircase';
|
||||
import SingleStaircase from './singleStaircase'
|
||||
|
||||
const iscsShape = {};
|
||||
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
|
||||
@ -68,6 +69,7 @@ iscsShape[deviceType.Escalator] = Escalator;
|
||||
iscsShape[deviceType.StairControl] = StairControl;
|
||||
iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine;
|
||||
iscsShape[deviceType.Staircase] = Staircase;
|
||||
iscsShape[deviceType.SingleStaircase] = SingleStaircase;
|
||||
|
||||
function shapefactory(device, iscs) {
|
||||
const type = device.model._type;
|
||||
|
31
src/iscs/shape/singleStaircase.js
Normal file
31
src/iscs/shape/singleStaircase.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import createPathSvg from './components/pathsvg';
|
||||
|
||||
export default class SingleStaircase 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);
|
||||
this.add(this.grouper);
|
||||
if (this.model.isRight) {
|
||||
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
|
||||
this.grouper.scale = [-1, 1];
|
||||
}
|
||||
this.grouper.add(this.path);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
}
|
@ -142,7 +142,9 @@ export function parser(data) {
|
||||
zrUtil.each(data.staircaseList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.Staircase, elem);
|
||||
});
|
||||
|
||||
zrUtil.each(data.singleStaircaseList || [], elem=> {
|
||||
iscsDevice[elem.code] = deviceFactory(deviceType.SingleStaircase, elem);
|
||||
});
|
||||
}
|
||||
|
||||
return iscsDevice;
|
||||
@ -264,6 +266,9 @@ export function updateIscsData(state, device) {
|
||||
case deviceType.Staircase:
|
||||
updateIscsListByDevice(state, 'staircaseList', device);
|
||||
break;
|
||||
case deviceType.SingleStaircase:
|
||||
updateIscsListByDevice(state, 'singleStaircaseList', device);
|
||||
break;
|
||||
}
|
||||
// store.dispatch('iscs/setIscsData', state.iscs);
|
||||
}
|
||||
|
@ -42,6 +42,14 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="单向楼梯" name="SingleStaircase">
|
||||
<single-staircase
|
||||
ref="singleStaircase"
|
||||
style="width: 90%"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="文字" name="IscsText">
|
||||
<iscs-text
|
||||
ref="iscsText"
|
||||
@ -80,6 +88,7 @@
|
||||
import IscsRect from '../iscsCommonElem/rect';
|
||||
import BrakeMachine from '../iscsAfcOperate/brakeMachine';
|
||||
import Staircase from '../iscsOperate/staircase';
|
||||
import SingleStaircase from './singleStaircase';
|
||||
export default {
|
||||
name: 'IscsOperate',
|
||||
components: {
|
||||
@ -89,7 +98,8 @@
|
||||
IscsLine,
|
||||
IscsText,
|
||||
BrakeMachine,
|
||||
Staircase
|
||||
Staircase,
|
||||
SingleStaircase
|
||||
},
|
||||
mixins: [
|
||||
],
|
||||
|
118
src/views/iscs/iscsDraw/iscsCctvOperate/singleStaircase.vue
Normal file
118
src/views/iscs/iscsDraw/iscsCctvOperate/singleStaircase.vue
Normal file
@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
|
||||
<el-form-item label="宽度">
|
||||
<el-input-number v-model="addModel.width" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X轴坐标">
|
||||
<el-input-number v-model="addModel.x" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Y轴坐标">
|
||||
<el-input-number v-model="addModel.y" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit()">{{ 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>
|
||||
import { mapGetters } from 'vuex';
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
|
||||
export default {
|
||||
name: 'SingleStaircase',
|
||||
data() {
|
||||
return {
|
||||
addModel:{
|
||||
code: '',
|
||||
width: 50,
|
||||
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: '立即创建'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('iscs', [
|
||||
'iscs'
|
||||
])
|
||||
},
|
||||
watch:{
|
||||
'$store.state.iscs.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['iscs/updateDeviceData'];
|
||||
if (model._type === 'SingleStaircase' ) {
|
||||
this.buttonText = '修改';
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.addModel.code = model.code;
|
||||
this.addModel.width = model.width;
|
||||
this.addModel.height = model.height;
|
||||
this.addModel.x = model.point.x;
|
||||
this.addModel.y = model.point.y;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(form) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const Uid = getUID('SingleStaircase', this.iscs.vidiconList);
|
||||
const model = {
|
||||
_type: 'SingleStaircase',
|
||||
code: this.isUpdate ? this.addModel.code : Uid,
|
||||
width: this.addModel.width,
|
||||
point: {
|
||||
x: this.addModel.x,
|
||||
y: this.addModel.y
|
||||
},
|
||||
fill: '#F7F1F1'
|
||||
};
|
||||
this.$emit('createDataModel', model);
|
||||
this.initPage();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDevice() {
|
||||
const model = {
|
||||
_type: 'SingleStaircase',
|
||||
code: this.addModel.code,
|
||||
width: this.addModel.width,
|
||||
point: {
|
||||
x: this.addModel.x,
|
||||
y: this.addModel.y
|
||||
}
|
||||
};
|
||||
this.$emit('deleteDataModel', model);
|
||||
this.initPage();
|
||||
},
|
||||
initPage() {
|
||||
this.isUpdate = false;
|
||||
this.buttonText = '立即创建';
|
||||
this.showDeleteButton = false;
|
||||
this.addModel = {
|
||||
code: '',
|
||||
width: 50,
|
||||
x: 10,
|
||||
y: 10
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -43,9 +43,9 @@
|
||||
</div>
|
||||
<div class="cctv-box-content">
|
||||
<div style="position: relative;width: 75px;left: 10px;">
|
||||
<div class="cctv-box-content-btn" @click="changeCCTV('41')">站厅</div>
|
||||
<div class="cctv-box-content-btn" @click="changeCCTV('42')">站台</div>
|
||||
<div class="cctv-box-content-btn" @click="changeCCTV('43')">云台</div>
|
||||
<div id="cctv-41" class="cctv-box-content-btn" @click="changeCCTV('41')">站厅</div>
|
||||
<div id="cctv-42" class="cctv-box-content-btn" @click="changeCCTV('42')">站台</div>
|
||||
<div id="cctv-43" class="cctv-box-content-btn" @click="changeCCTV('43')">云台</div>
|
||||
</div>
|
||||
<div class="cctv-box-content-draw">
|
||||
<iscsSystem ref="iscsPlate" :widthCanvas="1490" />
|
||||
@ -73,14 +73,21 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mes: '1111'
|
||||
selectedCCTV: '41'
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.iscsPlate.show('42');
|
||||
this.$refs.iscsPlate.show('41');
|
||||
const cctvBtn = document.getElementById('cctv-41');
|
||||
cctvBtn.setAttribute('class', 'cctv-box-content-btn active');
|
||||
},
|
||||
methods: {
|
||||
changeCCTV(id) {
|
||||
const cctvBtnOld = document.getElementById('cctv-' + this.selectedCCTV);
|
||||
cctvBtnOld.setAttribute('class', 'cctv-box-content-btn');
|
||||
const cctvBtn = document.getElementById('cctv-' + id);
|
||||
cctvBtn.setAttribute('class', 'cctv-box-content-btn active');
|
||||
this.selectedCCTV = id;
|
||||
this.$refs.iscsPlate.show(id);
|
||||
}
|
||||
}
|
||||
@ -199,8 +206,6 @@ justify-content:center;text-align:center;
|
||||
position: relative;
|
||||
left: 90px;
|
||||
top: -255px;
|
||||
border-top: 2px solid #f9f9f9;
|
||||
border-left: 2px solid #f6f8f8;
|
||||
width: 1473px;
|
||||
height: 320px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user