ibp删除钥匙孔

This commit is contained in:
fan 2019-09-10 10:26:18 +08:00
parent 0c9e367f3d
commit 8083656e16
7 changed files with 0 additions and 195 deletions

View File

@ -30,13 +30,6 @@ deviceRender[deviceType.Arrow] = {
z: 2 z: 2
}; };
/** RotatingButton渲染配置*/
deviceRender[deviceType.RotatingButton] = {
_type: deviceType.RotatingButton,
zlevel: 1,
z: 3
};
/** TipBox渲染配置*/ /** TipBox渲染配置*/
deviceRender[deviceType.TipBox] = { deviceRender[deviceType.TipBox] = {
_type: deviceType.TipBox, _type: deviceType.TipBox,

View File

@ -2,7 +2,6 @@ const deviceType = {
IbpText: 'IbpText', IbpText: 'IbpText',
SquareButton: 'SquareButton', SquareButton: 'SquareButton',
Arrow: 'Arrow', Arrow: 'Arrow',
RotatingButton: 'RotatingButton',
TipBox: 'TipBox', TipBox: 'TipBox',
Background: 'Background', Background: 'Background',
CircularLamp: 'CircularLamp', CircularLamp: 'CircularLamp',

View File

@ -8,7 +8,6 @@ import IbpLine from './ibpLine';
import Button from './button'; import Button from './button';
import TipBox from './ibpTipBox'; import TipBox from './ibpTipBox';
import AppendageBox from './appendageBox'; import AppendageBox from './appendageBox';
import RotatingButton from './rotatingButton';
import Elevator from './elevator'; import Elevator from './elevator';
import Key from './key'; import Key from './key';
import TeleTerminal from './teleTerminal'; import TeleTerminal from './teleTerminal';
@ -25,7 +24,6 @@ ibpShape[deviceType.IbpLine] = IbpLine;
ibpShape[deviceType.SquareButton] = Button; ibpShape[deviceType.SquareButton] = Button;
ibpShape[deviceType.TipBox] = TipBox; ibpShape[deviceType.TipBox] = TipBox;
ibpShape[deviceType.AppendageBox] = AppendageBox; ibpShape[deviceType.AppendageBox] = AppendageBox;
ibpShape[deviceType.RotatingButton] = RotatingButton;
ibpShape[deviceType.Elevator] = Elevator; ibpShape[deviceType.Elevator] = Elevator;
ibpShape[deviceType.Key] = Key; ibpShape[deviceType.Key] = Key;
ibpShape[deviceType.TeleTerminal] = TeleTerminal; ibpShape[deviceType.TeleTerminal] = TeleTerminal;

View File

@ -1,41 +0,0 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import Keyhole from '@/assets/ibp_images/keyhole.png';
export default class RotatingButton 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.rotatingButton = new Image({
zlevel: this.zlevel,
z: this.z,
draggable: false,
style: {
image: Keyhole,
x: 0,
y: 0,
width: model.width,
height: model.width/361*336
}
});
this.grouper.add(this.rotatingButton);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x+=dx;
this.model.point.y+=dy;
}
}

View File

@ -59,10 +59,6 @@ export function parser(data) {
ibpDevice[elem.code] = deviceFactory(deviceType.Arrow, elem); ibpDevice[elem.code] = deviceFactory(deviceType.Arrow, elem);
}, this); }, this);
zrUtil.each(data.rotatingButtonList || [], elem => {
ibpDevice[elem.code] = deviceFactory(deviceType.RotatingButton, elem);
}, this);
zrUtil.each(data.tipBoxList || [], elem => { zrUtil.each(data.tipBoxList || [], elem => {
ibpDevice[elem.code] = deviceFactory(deviceType.TipBox, elem); ibpDevice[elem.code] = deviceFactory(deviceType.TipBox, elem);
}, this); }, this);
@ -130,9 +126,6 @@ export function updateIbpData(device) {
case deviceType.Arrow : case deviceType.Arrow :
updateIbpListByDevice(ibpData, 'arrowList', device); updateIbpListByDevice(ibpData, 'arrowList', device);
break; break;
case deviceType.RotatingButton :
updateIbpListByDevice(ibpData, 'rotatingButtonList', device);
break;
case deviceType.TipBox : case deviceType.TipBox :
updateIbpListByDevice(ibpData, 'tipBoxList', device); updateIbpListByDevice(ibpData, 'tipBoxList', device);
break; break;

View File

@ -1,128 +0,0 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="钥匙孔编号" prop="code">
<el-input :disabled="true" v-model="form.code" >
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input>
</el-form-item>
<el-form-item label="钥匙孔宽度" prop="rotatingButtonWidth">
<el-input-number v-model="form.rotatingButtonWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'RotatingButtonDraft',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
rotatingButtonWidth: '',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message: '请输入钥匙孔编号', trigger: 'blur' },
],
rotatingButtonWidth: [
{ required: true, message: '请输入钥匙孔宽度', trigger: 'blur' },
]
}
};
},
computed: {
},
watch: {
'$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'RotatingButton' ){
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.rotatingButtonWidth = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rotatingButtonModel = {
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
};
this.$emit('createRotatingButton', rotatingButtonModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rotatingButtonModel = {
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
};
this.$emit('deleteDataModel',rotatingButtonModel );
this.initPage();
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
rotatingButtonWidth: '',
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.form.code = "rButton_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -71,12 +71,6 @@
> >
</ibp-alarm> </ibp-alarm>
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane label="钥匙孔" name="RotatingButton">
<ibp-rotating-button ref="rotatingbutton"
@createRotatingButton="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
>
</ibp-rotating-button>
</el-tab-pane> -->
<el-tab-pane label="电话端子" name="TeleTerminal"> <el-tab-pane label="电话端子" name="TeleTerminal">
<ibp-telephone-terminal ref="teleTerminal" <ibp-telephone-terminal ref="teleTerminal"
@createTeleTerminal="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%" @createTeleTerminal="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
@ -125,7 +119,6 @@
import IbpAppendageBox from './ibpAppendageBox'; import IbpAppendageBox from './ibpAppendageBox';
import IbpArrow from './ibpArrow'; import IbpArrow from './ibpArrow';
import IbpLamp from './ibpLamp'; import IbpLamp from './ibpLamp';
import IbpRotatingButton from './ibpRotatingButton';
import IbpLine from './ibpLine'; import IbpLine from './ibpLine';
import IbpTelephoneTerminal from './ibpTelephoneTerminal'; import IbpTelephoneTerminal from './ibpTelephoneTerminal';
import IbpElevator from './ibpElevator'; import IbpElevator from './ibpElevator';
@ -144,7 +137,6 @@
IbpAppendageBox, IbpAppendageBox,
IbpArrow, IbpArrow,
IbpLamp, IbpLamp,
IbpRotatingButton,
IbpLine, IbpLine,
IbpTelephoneTerminal, IbpTelephoneTerminal,
IbpElevator, IbpElevator,
@ -213,7 +205,6 @@
this.$refs.arrow.initPage(); this.$refs.arrow.initPage();
this.$refs.appendagebox.initPage(); this.$refs.appendagebox.initPage();
this.$refs.alarm.initPage(); this.$refs.alarm.initPage();
// this.$refs.rotatingbutton.initPage();
this.$refs.elevator.initPage(); this.$refs.elevator.initPage();
this.$refs.key.initPage(); this.$refs.key.initPage();
this.$refs.teleTerminal.initPage(); this.$refs.teleTerminal.initPage();