ibp调整

This commit is contained in:
fan 2019-08-30 15:01:37 +08:00
parent e865e6de3b
commit 755754ebd3
16 changed files with 535 additions and 396 deletions

View File

@ -59,6 +59,6 @@ deviceRender[deviceType.Elevator] = {
/** Key 渲染配置 */
deviceRender[deviceType.Key] = {
zlevel: 2
zlevel: 3
};
export default deviceRender;

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@ export default class alarm extends Group {
x: model.point.x,
y: model.point.y,
width: model.width,
height: model.height
height: model.width/71*74
}
});
this.add(this.imageBg);

View File

@ -26,7 +26,6 @@ class Arrow extends Group {
},
style: {
stroke: model.stroke,
lineWidth: model.lineWidth,
fill: model.fill
}
});

View File

@ -26,7 +26,7 @@ export default class RotatingButton extends Group {
x: this.model.point.x,
y: this.model.point.y,
width: this.model.width,
height: this.model.height
height: this.model.width/434*381
}
});
this.add(this.rotatingButton);

View File

@ -1,20 +1,24 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="报警器编号">
<el-input :disabled="true" v-model="form.code" >
<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="报警器宽度">
<el-form-item label="报警器宽度" prop="alarmWidth">
<el-input-number v-model="form.alarmWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="报警器长度">
<el-input-number v-model="form.alarmHeight" controls-position="right" :min="1"></el-input-number>
<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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -30,14 +34,11 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 4000,
y: 10
},
form: {
code: '',
alarmWidth: '',
alarmHeight: ''
x: 10,
y: 10
},
rules: {
code: [
@ -45,9 +46,6 @@
],
alarmWidth: [
{ required: true, message: '请输入报警器宽度', trigger: 'blur' },
],
alarmHeight: [
{ required: true, message: '请输入报警器高度', trigger: 'blur' },
]
}
};
@ -64,36 +62,46 @@
this.isUpdate = true;
this.form.code = model.code;
this.form.alarmWidth = model.width;
this.form.alarmHeight = model.height;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid){
const alarmModel = {
zlevel: 2,
z: 1,
point: this.point,
point:{
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'Alarm',
width: this.form .alarmWidth,
height: this.form.alarmHeight
};
this.$emit('createAlarm', alarmModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const alarmModel = {
zlevel: 2,
z: 1,
point: this.point,
point:{
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'Alarm',
width: this.form .alarmWidth,
height: this.form.alarmHeight
};
this.$emit('deleteDataModel',alarmModel );
this.initPage();
@ -105,10 +113,7 @@
this.form = {
code: '',
alarmWidth: '',
alarmHeight: ''
};
this.point = {
x: 4000,
x: 10,
y: 10
};
},

View File

@ -1,20 +1,27 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="扶梯框编号">
<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="扶梯框宽度">
<el-form-item label="扶梯框宽度" prop="appendageBoxWidth">
<el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="扶梯框高度">
<el-form-item label="扶梯框高度" prop="appendageBoxHeight">
<el-input-number v-model="form.appendageBoxHeight" 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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -30,14 +37,13 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
form: {
code: '',
appendageBoxWidth: '',
appendageBoxHeight: '',
x: 10,
y: 10
},
form: {
appendageBoxWidth: '',
appendageBoxHeight: ''
},
rules: {
code: [
{ required: true, message: '请输入扶梯框编号', trigger: 'blur' },
@ -64,18 +70,24 @@
this.form.code = model.code;
this.form.appendageBoxWidth = model.width;
this.form.appendageBoxHeight = model.height;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid){
const appendageBoxModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'AppendageBox',
code: this.form.code,
width: this.form .appendageBoxWidth,
@ -83,12 +95,19 @@
};
this.$emit('createAppendageBox', appendageBoxModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const appendageBoxModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'AppendageBox',
code: this.form.code,
width: this.form .appendageBoxWidth,
@ -104,9 +123,7 @@
this.form = {
code: '',
appendageBoxWidth: '',
appendageBoxHeight: ''
};
this.point = {
appendageBoxHeight: '',
x: 10,
y: 10
};

View File

@ -1,12 +1,12 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<el-form-item label="箭头编号">
<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="箭头方向">
<el-form-item label="箭头方向" prop="orientation">
<el-select v-model="form.orientation" placeholder="请选择箭头方向">
<el-option label="向上" value="top"></el-option>
<el-option label="向下" value="bottom"></el-option>
@ -14,18 +14,19 @@
<el-option label="向右" value="right"></el-option>
</el-select>
</el-form-item>
<el-form-item label="箭头长度">
<el-form-item label="箭头长度" prop="arrowLength">
<el-input-number v-model="form.arrowLength" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="箭头宽度">
<el-form-item label="箭头宽度" prop="arrowLength">
<el-input-number v-model="form.arrowWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="箭头颜色">
<el-form-item label="箭头颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -33,7 +34,7 @@
<script>
export default {
name: 'ButtonDraft',
name: 'ArrowDraft',
components: {
},
data() {
@ -93,7 +94,9 @@
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid){
const arrowModel = {
zlevel: 2,
z: 1,
@ -104,10 +107,14 @@
fill: this.form.fillColor,
width: this.form .arrowWidth,
length: this.form.arrowLength,
lineWidth: 1
};
this.$emit('createArrow', arrowModel);
this.initPage();
}else {
return false;
}
});
},
deleteDevice() {
const arrowModel = {
@ -120,7 +127,6 @@
fill: this.form.fillColor,
width: this.form .arrowWidth,
length: this.form.arrowLength,
lineWidth: 1
};
this.$emit('deleteDataModel',arrowModel);
this.initPage();

View File

@ -1,12 +1,12 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<el-form-item label="按钮编号">
<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="按钮颜色">
<el-form-item label="按钮颜色" prop="buttonColor">
<el-select v-model="form.buttonColor" placeholder="请选择按钮颜色">
<el-option label="红色按钮" value="red"></el-option>
<el-option label="黄色按钮" value="yellow"></el-option>
@ -15,15 +15,19 @@
<el-option label="灰色按钮" value="gray"></el-option>
</el-select>
</el-form-item>
<el-form-item label="按钮宽度">
<el-form-item label="按钮宽度" prop="buttonWidth">
<el-input-number v-model="form.buttonWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="按钮高度">
<el-input-number v-model="form.buttonHeight" controls-position="right" :min="1"></el-input-number>
<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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -39,15 +43,12 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 3000,
y: 10
},
form: {
code: '',
buttonColor: '',
buttonWidth: '',
buttonHeight: ''
x: 10,
y: 10
},
rules: {
code: [
@ -58,9 +59,6 @@
],
buttonWidth: [
{ required: true, message: '请输入按钮宽度', trigger: 'blur' },
],
buttonHeight: [
{ required: true, message: '请输入按钮高度', trigger: 'blur' },
]
}
};
@ -78,40 +76,50 @@
this.form.code = model.code;
this.form.buttonColor = model.color;
this.form.buttonWidth = model.width;
this.form.buttonHeight = model.height;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const buttonModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'SquareButton',
code: this.form.code,
color: this.form.buttonColor,
status: 'off',
width: this.form.buttonWidth,
height: this.form.buttonHeight
};
this.$emit('createButton', buttonModel);
this.initPage();
}else {
return false;
}
});
},
deleteDevice() {
const buttonModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'SquareButton',
code: this.form.code,
color: this.form.buttonColor,
status: 'off',
width: this.form.buttonWidth,
height: this.form.buttonHeight
};
this.$emit('deleteDataModel',buttonModel );
this.initPage();
@ -124,10 +132,7 @@
code: '',
buttonColor: '',
buttonWidth: '',
buttonHeight: ''
};
this.point = {
x: 3000,
x: 10,
y: 10
};
},
@ -139,10 +144,5 @@
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -1,28 +1,37 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="电梯编号">
<el-input :disabled="isUpdate" v-model="form.code" style="width:300px"></el-input>
<el-form-item label="电梯编号" prop="code">
<el-input :disabled="isUpdate" 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="电梯宽度">
<el-form-item label="电梯宽度" prop="elevatorWidth">
<el-input-number v-model="form.elevatorWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="电梯高度">
<el-form-item label="电梯高度" prop="elevatorHeight">
<el-input-number v-model="form.elevatorHeight" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="电梯颜色">
<el-form-item label="电梯颜色" prop="elevatorColor">
<el-color-picker v-model="form.elevatorColor"></el-color-picker>
</el-form-item>
<el-form-item label="启动方向">
<el-form-item label="启动方向" prop="direction">
<el-select v-model="form.direction" placeholder="请选择启动方向">
<el-option label="不启动" value="none"></el-option>
<el-option label="向上启动" value="top"></el-option>
<el-option label="向下启动" value="bottom"></el-option>
</el-select>
</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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -37,16 +46,14 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 70,
y: 70
},
form: {
code: '',
elevatorWidth: '',
elevatorHeight: '',
elevatorColor:'',
direction:'',
direction:'none',
x: 10,
y: 10
},
rules: {
code: [
@ -72,7 +79,6 @@
},
watch: {
'$store.state.ibp.rightClickCount': function (val) {
//
const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'Elevator' ){
this.buttonText = '修改';
@ -83,19 +89,24 @@
this.form.elevatorHeight = model.height;
this.form.elevatorColor = model.fillColor;
this.form.direction = model.direction;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid){
const elevatorModel = {
zlevel: 2,
z: 2,
point: this.point,
draggable: true,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Elevator',
code: this.form.code,
width: this.form.elevatorWidth,
@ -105,14 +116,20 @@
};
this.$emit('createElevator', elevatorModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
//
const elevatorModel = {
zlevel: 2,
z: 1,
point: this.point,
draggable: true,
z: 2,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Elevator',
code: this.form.code,
width: this.form.elevatorWidth,
@ -133,11 +150,13 @@
elevatorHeight: '',
elevatorColor:'',
direction:'none',
x: 10,
y: 10
};
this.point = {
x: 80,
y: 80
};
},
generateCode() {
const mydate = new Date();
this.form.code = "elevator_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
}
}
};

View File

@ -1,24 +1,33 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="钥匙编号">
<el-input :disabled="isUpdate" v-model="form.code" style="width:200px;"></el-input>
<el-form-item label="钥匙编号" prop="code">
<el-input :disabled="isUpdate" 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="钥匙宽度">
<el-form-item label="钥匙宽度" prop="keyWidth">
<el-input-number v-model="form.keyWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="钥匙高度">
<el-form-item label="钥匙高度" prop="keyHeight">
<el-input-number v-model="form.keyHeight" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="钥匙朝向">
<el-form-item label="钥匙朝向" prop="status">
<el-select v-model="form.status" placeholder="请选择钥匙朝向">
<el-option label="水平" value="on"></el-option>
<el-option label="竖直" value="off"></el-option>
</el-select>
</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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -34,15 +43,13 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 10,
y: 10
},
form: {
code: '',
keyWidth: '',
keyHeight: '',
status:''
status:'',
x: 10,
y: 10
},
rules: {
code: [
@ -74,18 +81,24 @@
this.form.keyWidth = model.width;
this.form.keyHeight = model.height;
this.form.status = model.status;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if(valid) {
const keyModel = {
zlevel: 2,
zlevel: 3,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'Key',
code: this.form.code,
@ -95,12 +108,20 @@
};
this.$emit('createKey', keyModel);
this.initPage();
}else {
return false;
}
});
},
deleteDevice() {
const keyModel = {
zlevel: 2,
zlevel: 3,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'Key',
code: this.form.code,
@ -119,12 +140,14 @@
code: '',
keyWidth: '',
keyHeight: '',
status:''
};
this.point = {
x: 70,
y: 70
status:'',
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.form.code = "key_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
}
}
};

View File

@ -1,17 +1,24 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="圆形指示灯编号">
<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="圆形指示灯半径">
<el-form-item label="圆形指示灯半径" prop="r">
<el-input-number v-model="form.r" 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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -19,7 +26,7 @@
<script>
export default {
name: 'ButtonDraft',
name: 'LampDraft',
components: {
},
data() {
@ -27,20 +34,18 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 3000,
y: 10
},
form: {
code: '',
r: ''
r: '',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message: '请输入按钮编号', trigger: 'blur' },
],
r: [
{ required: true, message: '请输入圆形指示灯半径', trigger: 'change'}
{ required: true, message: '请输入圆形指示灯半径', trigger: 'blur'}
],
}
};
@ -57,18 +62,24 @@
this.isUpdate = true;
this.form.code = model.code;
this.form.r = model.r;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if(valid){
const lampModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'CircularLamp',
code: this.form.code,
r: this.form.r,
@ -76,12 +87,20 @@
};
this.$emit('createLamp', lampModel);
this.initPage();
}else {
return false;
}
});
},
deleteDevice() {
const lampModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
_type: 'CircularLamp',
code: this.form.code,
r: this.form.r,
@ -96,10 +115,8 @@
this.showDeleteButton = false;
this.form = {
code: '',
r: ''
};
this.point = {
x: 3000,
r: '',
x: 10,
y: 10
};
},
@ -111,10 +128,4 @@
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -1,29 +1,33 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<el-form-item label="线段编号">
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<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="线段方向">
<el-select v-model="form.direction" placeholder="请选择线段方向">
<el-option label="横向" value="transverse"></el-option>
<el-option label="竖向" value="vertical"></el-option>
</el-select>
</el-form-item>
<el-form-item label="线段长度">
<el-input-number controls-position="right" :min="1" v-model="form.length"></el-input-number>
</el-form-item>
<el-form-item label="线段宽度">
<el-form-item label="线段宽度" prop="lineWidth">
<el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50"></el-input-number>
</el-form-item>
<el-form-item label="线段颜色">
<el-form-item label="线段颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input>
</el-form-item>
<el-form-item label="起始X轴坐标">
<el-input-number v-model="form.x1" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="起始Y轴坐标">
<el-input-number v-model="form.y1" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="终止X轴坐标">
<el-input-number v-model="form.x2" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="终止Y轴坐标">
<el-input-number v-model="form.y2" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -39,27 +43,19 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point1: {
x: 2000,
y: 10
},
form: {
code: '',
direction: '',
length: '',
lineWidth: '',
fillColor: ''
fillColor: '',
x1: 10,
y1: 10,
x2: 20,
y2: 10
},
rules: {
code: [
{ required: true, message: '请输入线段编号', trigger: 'blur' },
],
direction: [
{ required: true, message: '请选择线段方向', trigger: 'change'}
],
length: [
{ required: true, message: '请输入线段长度', trigger: 'blur' },
],
lineWidth: [
{ required: true, message: '请输入线段宽度', trigger: 'blur' },
],
@ -80,27 +76,32 @@
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.direction = model.direction;
this.form.length = (model.direction == 'transverse'? Math.abs(model.point1.x -model.point2.x) : Math.abs(model.point1.y - model.point2.y));
this.form.lineWidth = model.lineWidth;
this.form.fillColor = model.fillColor;
this.point1 = model.point1;
this.form.x1 = model.point1.x;
this.form.y1 = model.point1.y;
this.form.x2 = model.point2.x;
this.form.y2 = model.point2.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) =>{
if (valid){
const lineModel = {
zlevel: 1,
zlevel: 2,
z: 1,
point1: this.point1,
point2: {
x: this.form.direction == 'transverse'? this.point1.x + parseInt(this.form.length):2000,
y: this.form.direction == 'vertical'? this.point1.y + parseInt(this.form.length):10
point1: {
x: this.form.x1,
y: this.form.y1
},
point2: {
x: this.form.x2,
y: this.form.y2
},
direction: this.form.direction,
code: this.form.code,
_type: 'IbpLine',
lineWidth: this.form.lineWidth,
@ -108,17 +109,24 @@
};
this.$emit('createLine', lineModel);
this.initPage();
}else {
return false;
}
});
},
deleteDevice() {
const lineModel = {
zlevel: 1,
zlevel: 2,
z: 1,
point1: this.point1,
point2: {
x: this.form.direction == 'transverse'? this.point1.x + parseInt(this.form.length):2000,
y: this.form.direction == 'vertical'? this.point1.y + parseInt(this.form.length):10
point1: {
x: this.form.x1,
y: this.form.y1
},
point2: {
x: this.form.x2,
y: this.form.y2
},
direction: this.form.direction,
code: this.form.code,
_type: 'IbpLine',
lineWidth: this.form.lineWidth,
@ -133,14 +141,12 @@
this.showDeleteButton = false;
this.form = {
code: '',
direction: '',
length: '',
lineWidth: '',
fillColor: ''
};
this.point1 = {
x: 2000,
y: 10
fillColor: '',
x1: 10,
y1: 10,
x2: 20,
y2: 10
};
},
generateCode() {
@ -151,10 +157,5 @@
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.button_box{
width: 100%;
background: #f0f0f0;
overflow: hidden;
}
</style>

View File

@ -1,20 +1,24 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="钥匙孔编号">
<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="钥匙孔宽度">
<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="钥匙孔高度">
<el-input-number v-model="form.rotatingButtonHeight" controls-position="right" :min="1"></el-input-number>
<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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -30,14 +34,11 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 3000,
y: 10
},
form: {
code: '',
rotatingButtonWidth: '',
rotatingButtonHeight: ''
x: 10,
y: 10
},
rules: {
code: [
@ -45,9 +46,6 @@
],
rotatingButtonWidth: [
{ required: true, message: '请输入钥匙孔宽度', trigger: 'blur' },
],
rotatingButtonHeight: [
{ required: true, message: '请输入钥匙孔高度', trigger: 'blur' },
]
}
};
@ -64,38 +62,49 @@
this.isUpdate = true;
this.form.code = model.code;
this.form.rotatingButtonWidth = model.width;
this.form.rotatingButtonHeight = model.height;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rotatingButtonModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
height: this.form.rotatingButtonHeight
};
this.$emit('createRotatingButton', rotatingButtonModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rotatingButtonModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
height: this.form.rotatingButtonHeight
};
this.$emit('deleteDataModel',rotatingButtonModel );
this.initPage();
@ -107,10 +116,7 @@
this.form = {
code: '',
rotatingButtonWidth: '',
rotatingButtonHeight: ''
};
this.point = {
x: 3000,
x: 10,
y: 10
};
},

View File

@ -1,26 +1,33 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<el-form-item label="文字编号">
<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="文字内容">
<el-form-item label="文字内容" prop="context">
<el-input type="textarea" v-model="form.context"></el-input>
</el-form-item>
<el-form-item label="文字颜色">
<el-form-item label="文字颜色" prop="textFill">
<el-input v-model="form.textFill"></el-input>
</el-form-item>
<el-form-item label="文字大小">
<el-form-item label="文字大小" prop="fontSize">
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="50"></el-input-number>
</el-form-item>
<el-form-item label="文字粗细">
<el-form-item label="文字粗细" prop="fontWeight">
<el-input-number v-model="form.fontWeight" 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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -36,16 +43,14 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 3000,
y: 10
},
form: {
code: '',
context: '',
textFill: '',
fontSize: '',
fontWeight: ''
fontWeight: '',
x: 10,
y: 10
},
rules: {
code: [
@ -81,18 +86,45 @@
this.form.textFill = model.textFill;
this.form.fontSize = model.fontSize;
this.form.fontWeight = model.fontWeight;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const textModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IbpText',
context: this.form.context,
textFill: this.form.textFill,
fontSize: this.form.fontSize ,
fontWeight: this.form.fontWeight,
fontFamily: 'consolas'
};
this.$emit('createText', textModel);
this.initPage();
} else {
return false;
}
});
const textModel = {
zlevel: 2,
z: 1,
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IbpText',
context: this.form.context,
@ -108,7 +140,10 @@
const textModel = {
zlevel: 2,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'IbpText',
context: this.form.context,
@ -129,10 +164,8 @@
context: '',
textFill: '',
fontSize: '',
fontWeight: ''
};
this.point = {
x: 3000,
fontWeight: '',
x: 10,
y: 10
};
},

View File

@ -1,23 +1,30 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="提示框编号">
<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="提示框宽度">
<el-form-item label="提示框宽度" prop="tipBoxWidth">
<el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" ></el-input-number>
</el-form-item>
<el-form-item label="提示框高度">
<el-form-item label="提示框高度" prop="tipBoxHeight">
<el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" ></el-input-number>
</el-form-item>
<el-form-item label="提示框颜色">
<el-form-item label="提示框颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input>
</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">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice">删除</el-button>
<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>
@ -34,15 +41,13 @@
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
point: {
x: 3000,
y: 10
},
form: {
code: '',
tipBoxWidth: '',
tipBoxHeight: '',
fillColor: ''
fillColor: '',
x: 10,
y: 10
},
rules: {
code: [
@ -74,18 +79,24 @@
this.form.tipBoxWidth = model.width;
this.form.tipBoxHeight = model.height;
this.form.fillColor = model.fillColor;
this.point = model.point;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit() {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const tipBoxModel = {
zlevel: 1,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'TipBox',
width: this.form.tipBoxWidth,
@ -94,12 +105,20 @@
};
this.$emit('createTipBox', tipBoxModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const tipBoxModel = {
zlevel: 1,
z: 1,
point: this.point,
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'TipBox',
width: this.form.tipBoxWidth,
@ -117,10 +136,8 @@
code: '',
tipBoxWidth: '',
tipBoxHeight: '',
fillColor: ''
};
this.point = {
x: 3000,
fillColor: '',
x: 10,
y: 10
};
},