This commit is contained in:
fan 2020-01-17 11:32:11 +08:00
commit 22657aa935
7 changed files with 201 additions and 22 deletions

View File

@ -30,7 +30,7 @@ export default class chiller extends Group {
]
},
style: {
stroke:this.model.strokeColor,
stroke:this.model.color,
lineWidth:2
}
});
@ -43,7 +43,7 @@ export default class chiller extends Group {
r: this.model.width * 0.1
},
style: {
fill: this.model.strokeColor
fill: this.model.color
}
});
this.circle2 = new Circle({
@ -55,11 +55,11 @@ export default class chiller extends Group {
r: this.model.width * 0.1
},
style: {
fill: this.model.strokeColor
fill: this.model.color
}
});
this.polyline = new Polyline({
this.polyline1 = new Polyline({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
@ -68,19 +68,75 @@ export default class chiller extends Group {
[this.model.width * 0.21, this.model.width * 0.33],
[this.model.width * 0.29, this.model.width * 0.20],
[this.model.width * 0.37, this.model.width * 0.33],
[this.model.width * 0.59, this.model.width * 0.33],
[this.model.width * 0.80, this.model.width * 0.33]
[this.model.width * 0.60, this.model.width * 0.33],
[this.model.width * 0.68, this.model.width * 0.20],
[this.model.width * 0.76, this.model.width * 0.33],
[this.model.width * 0.60, this.model.width * 0.33],
[this.model.width * 0.97, this.model.width * 0.33],
[this.model.width * 0.97, this.model.width * 0.38],
[this.model.width * 0.01, this.model.width * 0.38],
[this.model.width * 0.01, this.model.width * 0.33],
[this.model.width * 0.21, this.model.width * 0.33]
]
},
style: {
stroke:this.model.strokeColor,
stroke:this.model.color,
lineWidth:2
}
});
this.polyline2 = new Polyline({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.07, this.model.width * 0.43],
[this.model.width * 0.33, this.model.width * 0.43],
[this.model.width * 0.33, this.model.width * 0.41],
[this.model.width * 0.64, this.model.width * 0.41],
[this.model.width * 0.64, this.model.width * 0.43],
[this.model.width * 0.90, this.model.width * 0.43],
[this.model.width * 0.64, this.model.width * 0.43],
[this.model.width * 0.64, this.model.width * 0.45],
[this.model.width * 0.33, this.model.width * 0.45],
[this.model.width * 0.33, this.model.width * 0.43]
]
},
style: {
stroke:this.model.color,
lineWidth:2
}
});
this.polyline3 = new Polyline({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.07, this.model.width * 0.52],
[this.model.width * 0.33, this.model.width * 0.52],
[this.model.width * 0.33, this.model.width * 0.50],
[this.model.width * 0.64, this.model.width * 0.50],
[this.model.width * 0.64, this.model.width * 0.52],
[this.model.width * 0.90, this.model.width * 0.52],
[this.model.width * 0.64, this.model.width * 0.52],
[this.model.width * 0.64, this.model.width * 0.54],
[this.model.width * 0.33, this.model.width * 0.54],
[this.model.width * 0.33, this.model.width * 0.52]
]
},
style: {
stroke:this.model.color,
lineWidth:2
}
});
this.grouper.add(this.rect);
this.grouper.add(this.circle2);
this.grouper.add(this.circle1);
this.grouper.add(this.polyline);
this.grouper.add(this.polyline1);
this.grouper.add(this.polyline2);
this.grouper.add(this.polyline3);
this.add(this.grouper);
}
setModel(dx, dy) {

View File

@ -25,7 +25,7 @@ export default class frozenPump extends Group {
r: this.model.width / 2
},
style: {
stroke: this.model.strokeColor,
stroke: this.model.color,
lineWidth:2
}
});
@ -41,8 +41,8 @@ export default class frozenPump extends Group {
]
},
style: {
fill: this.model.strokeColor,
stroke:this.model.strokeColor
fill: this.model.color,
stroke:this.model.color
}
});
this.grouper.add(this.circleOutside);

View File

@ -0,0 +1,123 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Polyline from 'zrender/src/graphic/shape/Polyline';
export default class ventilator 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.zlevel;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.polyline1 = new Polyline({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[0, 0],
[this.model.width * 0.086, this.model.width * 0.10],
[this.model.width * 0.586, this.model.width * 0.10],
[this.model.width * 0.606, this.model.width * 0.10],
[this.model.width * 0.706, 0],
[this.model.width * 0.706, this.model.width * 0.758],
[this.model.width * 0.606, this.model.width * 0.638],
[this.model.width * 0.606, this.model.width * 0.10],
[this.model.width * 0.606, this.model.width * 0.638],
[this.model.width * 0.086, this.model.width * 0.638],
[0, this.model.width * 0.758],
[0, 0],
[this.model.width * 0.086, this.model.width * 0.10],
[this.model.width * 0.086, this.model.width * 0.638]
]
},
style: {
stroke:this.model.color,
lineWidth:2
}
});
this.rhombus1 = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.336, this.model.width * 0.10],
[this.model.width * 0.456, this.model.width * 0.2345],
[this.model.width * 0.336, this.model.width * 0.369],
[this.model.width * 0.216, this.model.width * 0.2345],
[this.model.width * 0.336, this.model.width * 0.10]
]
},
style: {
fill:this.model.color
}
});
this.rhombus2 = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.336, this.model.width * 0.369],
[this.model.width * 0.456, this.model.width * 0.5035],
[this.model.width * 0.336, this.model.width * 0.638],
[this.model.width * 0.216, this.model.width * 0.5035],
[this.model.width * 0.336, this.model.width * 0.369]
]
},
style: {
fill:this.model.color
}
});
this.triangle = new Polygon({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.728, this.model.width * 0.08],
[this.model.width * 1, this.model.width * 0.369],
[this.model.width * 0.728, this.model.width * 0.640],
[this.model.width * 0.728, this.model.width * 0.08]
]
},
style: {
fill: this.model.color
}
});
this.line = new Polyline({
zlevel: this.model.zlevel,
z: this.model.z,
shape:{
points:[
[this.model.width * 0.126, this.model.width * 0.369],
[this.model.width * 0.546, this.model.width * 0.369]
]
},
style: {
stroke:this.model.color,
lineWidth:2
}
});
this.grouper.add(this.polyline1);
this.grouper.add(this.rhombus1);
this.grouper.add(this.rhombus2);
this.grouper.add(this.triangle);
this.grouper.add(this.line);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -83,7 +83,7 @@ export default {
_type: 'Chiller',
code: this.isUpdate ? this.form.code : this.generateCode(),
width: this.form.width,
strokeColor:'#00ff00'
color:'#00ff00'
};
this.$emit('createChiller', chillerModel);
this.initPage();
@ -114,7 +114,7 @@ export default {
_type: 'Chiller',
code: this.form.code,
width: this.form.width,
fillColor:'#00ff00'
color:'#00ff00'
};
this.$emit('deleteDataModel', chillerModel );
this.initPage();

View File

@ -83,7 +83,7 @@ export default {
_type: 'CoolTower',
code: this.isUpdate ? this.form.code : this.generateCode(),
width: this.form.width,
strokeColor:'#00ff00'
color:'#00ff00'
};
this.$emit('createCoolTower', chillerModel);
this.initPage();
@ -114,7 +114,7 @@ export default {
_type: 'CoolTower',
code: this.form.code,
width: this.form.width,
fillColor:'#00ff00'
color:'#00ff00'
};
this.$emit('deleteDataModel', chillerModel );
this.initPage();

View File

@ -94,7 +94,7 @@ export default {
_type: 'FrozenPump',
code: this.isUpdate ? this.form.code : this.generateCode(),
width: this.form.width,
strokeColor:'#00ff00',
color:'#00ff00',
pumpType:this.form.type
};
this.$emit('createFrozenPump', frozenPumpModel);
@ -127,7 +127,7 @@ export default {
_type: 'FrozenPump',
code: this.form.code,
width: this.form.width,
fillColor:'#00ff00',
color:'#00ff00',
pumpType:this.form.type
};
this.$emit('deleteDataModel', frozenPumpModel );

View File

@ -5,7 +5,7 @@
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="20" />
<el-input-number v-model="form.width" :min="60" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
@ -31,7 +31,7 @@ export default {
buttonText: '立即创建',
form:{
code:'',
width: 25,
width: 60,
x: 10,
y: 10
},
@ -83,7 +83,7 @@ export default {
_type: 'Ventilator',
code: this.isUpdate ? this.form.code : this.generateCode(),
width: this.form.width,
strokeColor:'#00ff00'
color:'#00ff00'
};
this.$emit('createVentilator', chillerModel);
this.initPage();
@ -99,7 +99,7 @@ export default {
this.showDeleteButton = false;
this.form = {
code:'',
width: 25,
width: 60,
x: 10,
y: 10
};
@ -114,7 +114,7 @@ export default {
_type: 'Ventilator',
code: this.form.code,
width: this.form.width,
fillColor:'#00ff00'
color:'#00ff00'
};
this.$emit('deleteDataModel', chillerModel );
this.initPage();