You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
622 B
39 lines
622 B
9 months ago
|
import Konva from "konva";
|
||
|
|
||
|
//传送带
|
||
|
export default function (width,height){
|
||
|
const x=width*0.45+37,y=300,_width=width*0.2,_height=height*0.67
|
||
|
const container=new Konva.Group({
|
||
|
x:x,
|
||
|
y:y,
|
||
|
width:_width,
|
||
|
height:_height
|
||
|
})
|
||
|
|
||
|
const rect=new Konva.Rect({
|
||
|
x:0,
|
||
|
y:0,
|
||
|
width:_width,
|
||
|
height:_height,
|
||
|
stroke:'black',
|
||
|
strokeWidth:1,
|
||
|
})
|
||
|
|
||
|
container.add(rect)
|
||
|
|
||
|
const text=new Konva.Text({
|
||
|
x: 0,
|
||
|
y: 0,
|
||
|
width: _width,
|
||
|
height:_height,
|
||
|
fill:'black',
|
||
|
text:'设备',
|
||
|
align:'center',
|
||
|
verticalAlign:'middle',
|
||
|
})
|
||
|
|
||
|
container.add(text)
|
||
|
|
||
|
return container
|
||
|
}
|