|
|
@ -4,245 +4,563 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import Konva from "konva";
|
|
|
|
import Konva from "konva";
|
|
|
|
// import sliao from "@/views/sliao/draw";
|
|
|
|
import sliao from "@/views/sliao/draw";
|
|
|
|
|
|
|
|
|
|
|
|
// export default {
|
|
|
|
export default {
|
|
|
|
// name:'SLiao',
|
|
|
|
name:'SLiao',
|
|
|
|
// data(){
|
|
|
|
data(){
|
|
|
|
// return {
|
|
|
|
return {
|
|
|
|
// title:'上 料 作 业 区',
|
|
|
|
title:'上 料 作 业 区',
|
|
|
|
// stage:null,
|
|
|
|
stage:null,
|
|
|
|
// layer:null,
|
|
|
|
|
|
|
|
// width:'',
|
|
|
|
layer:null,
|
|
|
|
// height:'',
|
|
|
|
width:'',
|
|
|
|
// gbImage:require('@/assets/gb.png'),
|
|
|
|
height:'',
|
|
|
|
// sljhGroup:null,
|
|
|
|
gbImage:require('@/assets/gb.png'),
|
|
|
|
// sljhList:[],//上料计划
|
|
|
|
|
|
|
|
// slGroup:'',
|
|
|
|
mountGroup:null,
|
|
|
|
// slList:'',
|
|
|
|
sljhStage:null,
|
|
|
|
// dwGroup:'',
|
|
|
|
sljhLayer:null,
|
|
|
|
// qyList:[//区域,每个内部包含垛位信息
|
|
|
|
sljhGroup:null,
|
|
|
|
// {
|
|
|
|
sljhList:[],//上料计划
|
|
|
|
// name:'一区',
|
|
|
|
|
|
|
|
// dw:[
|
|
|
|
canSl:false,
|
|
|
|
// {
|
|
|
|
|
|
|
|
// name:'一剁',
|
|
|
|
slGroup:'',
|
|
|
|
// list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
slList:'',
|
|
|
|
// },
|
|
|
|
dwGroup:'',
|
|
|
|
// {
|
|
|
|
qyList:[//区域,每个内部包含垛位信息
|
|
|
|
// name:'二剁',
|
|
|
|
{
|
|
|
|
// list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
name:'一区',
|
|
|
|
// }
|
|
|
|
dw:[
|
|
|
|
// ]
|
|
|
|
{
|
|
|
|
// },
|
|
|
|
name:'一剁',
|
|
|
|
// {
|
|
|
|
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
// name:'二区',
|
|
|
|
},
|
|
|
|
// dw:[
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
name:'二剁',
|
|
|
|
// name:'一剁',
|
|
|
|
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
// list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
]
|
|
|
|
// ]
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
// ],
|
|
|
|
name:'二区',
|
|
|
|
// msg:'板材1放入一剁三层',
|
|
|
|
dw:[
|
|
|
|
// worker:'',
|
|
|
|
{
|
|
|
|
// }
|
|
|
|
name:'一剁',
|
|
|
|
// },
|
|
|
|
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
|
|
|
|
// created(){},
|
|
|
|
}
|
|
|
|
// mounted() {
|
|
|
|
]
|
|
|
|
// this.initKonvaStage();
|
|
|
|
},
|
|
|
|
// //fixme 调试用
|
|
|
|
],
|
|
|
|
// this.drawMsg()
|
|
|
|
sljhItemList:[
|
|
|
|
// this.drawSljhItem([
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// ])
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// },
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// methods: {
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// //料场垛位实际情况
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX096',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// drawSlItem(slList){
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// console.log(slList.length)
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// for (let i = 1; i <=slList.length; i++) {
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// const gb=slList[i-1]
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// const group=new Konva.Group({
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// x:0,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// y:this.height-260-i*40,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// })
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B706N4PX077',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// this.slGroup.add(group)
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX098',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// const indexRect=new Konva.Rect({
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX998',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// x:0,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// y:0,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// width:40,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// height:40,
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX098',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// stroke:'black',
|
|
|
|
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX099',perQy:'一区',perDw:'一剁',perCeng:'三层'},
|
|
|
|
// strokeWidth:1,
|
|
|
|
],
|
|
|
|
// })
|
|
|
|
msg:'板材1放入一剁三层',
|
|
|
|
// //group.add(indexRect)
|
|
|
|
worker:null,
|
|
|
|
// const indexText=new Konva.Text({
|
|
|
|
startMoveX:0,
|
|
|
|
// x:0,
|
|
|
|
startMoveTime:0,
|
|
|
|
// y:0,
|
|
|
|
isMoving:false,
|
|
|
|
// width:40,
|
|
|
|
currentQyIndex:-1,
|
|
|
|
// height:40,
|
|
|
|
currentDwIndex:-1,
|
|
|
|
// fill:'black',
|
|
|
|
removeSljhItemIndex:-1,
|
|
|
|
// text:i,
|
|
|
|
}
|
|
|
|
// align:'center',
|
|
|
|
},
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
created(){},
|
|
|
|
// })
|
|
|
|
mounted() {
|
|
|
|
// group.add(indexText)
|
|
|
|
this.initKonvaStage();
|
|
|
|
//
|
|
|
|
//fixme 调试用
|
|
|
|
// //层 规格,套料图 船号,上料日期,计划切割日期
|
|
|
|
this.drawMsg()
|
|
|
|
// const imageObj = new Image();
|
|
|
|
this.drawSljhItem(this.sljhItemList)
|
|
|
|
// const imgSize=300
|
|
|
|
},
|
|
|
|
// imageObj.src = this.gbImage;
|
|
|
|
methods: {
|
|
|
|
// imageObj.onload = function () {
|
|
|
|
//料场垛位实际情况
|
|
|
|
// const shape = new Konva.Image({
|
|
|
|
drawSlItem(slList={}){
|
|
|
|
// x: 60,
|
|
|
|
for (let i = 1; i <=slList.length; i++) {
|
|
|
|
// y: 0,
|
|
|
|
const gb=slList[i-1]
|
|
|
|
// width: imgSize,
|
|
|
|
const group=new Konva.Group({
|
|
|
|
// height:40,
|
|
|
|
x:0,
|
|
|
|
// image: imageObj,
|
|
|
|
y:this.height-260-i*40,
|
|
|
|
|
|
|
|
draggable:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group.setAttr('index',i)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const that=this
|
|
|
|
|
|
|
|
this.slGroup.add(group)
|
|
|
|
|
|
|
|
const {x}=group.absolutePosition()
|
|
|
|
|
|
|
|
group.dragBoundFunc(function (pos){
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
x:x,
|
|
|
|
|
|
|
|
y:pos.y
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let _index=0
|
|
|
|
|
|
|
|
group.on('dragmove',function (){
|
|
|
|
|
|
|
|
if(_index===0){
|
|
|
|
|
|
|
|
_index=this.getAttr('index')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.zIndex(999)
|
|
|
|
|
|
|
|
const {y:thisY}=this.absolutePosition()
|
|
|
|
|
|
|
|
const children=that.slGroup.children
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const child of children) {
|
|
|
|
|
|
|
|
if (child===this){
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {y:thatY}=child.absolutePosition()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const moveUpFlag=child.getAttr('moveUp')||false
|
|
|
|
|
|
|
|
if (thisY>=thatY&&thisY<=thatY+40&&!moveUpFlag){
|
|
|
|
|
|
|
|
child.setAttr('moveUp',true);
|
|
|
|
|
|
|
|
child.setAttr('moveDown',false);
|
|
|
|
|
|
|
|
--_index
|
|
|
|
|
|
|
|
child.move({
|
|
|
|
|
|
|
|
y:-40
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {y:_thatY}=child.absolutePosition()
|
|
|
|
|
|
|
|
const moveDownFlag=child.getAttr('moveDown')||false
|
|
|
|
|
|
|
|
if (thisY<=_thatY&&!moveDownFlag){
|
|
|
|
|
|
|
|
const moveUpFlag=child.getAttr('moveUp')||false
|
|
|
|
|
|
|
|
if (moveUpFlag){
|
|
|
|
|
|
|
|
child.setAttr('moveUp',false);
|
|
|
|
|
|
|
|
child.setAttr('moveDown',true);
|
|
|
|
|
|
|
|
++_index
|
|
|
|
|
|
|
|
child.move({
|
|
|
|
|
|
|
|
y:40
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group.on('dragend',function (){
|
|
|
|
|
|
|
|
const index=this.getAttr('index')
|
|
|
|
|
|
|
|
const element = slList.splice(index-1, 1)[0];
|
|
|
|
|
|
|
|
slList.splice(_index-1, 0, element);
|
|
|
|
|
|
|
|
this.setAttr('index',_index)
|
|
|
|
|
|
|
|
_index=0
|
|
|
|
|
|
|
|
that.slGroup.destroyChildren()
|
|
|
|
|
|
|
|
that.drawSlItem(slList)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexRect=new Konva.Rect({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width:40,
|
|
|
|
|
|
|
|
height:40,
|
|
|
|
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
//group.add(indexRect)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexText=new Konva.Text({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width:40,
|
|
|
|
|
|
|
|
height:40,
|
|
|
|
|
|
|
|
fill:'black',
|
|
|
|
|
|
|
|
text:i,
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(indexText)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//层 规格,套料图 船号,上料日期,计划切割日期
|
|
|
|
|
|
|
|
const imageObj = new Image();
|
|
|
|
|
|
|
|
const imgSize=300
|
|
|
|
|
|
|
|
imageObj.src = this.gbImage;
|
|
|
|
|
|
|
|
imageObj.onload = function () {
|
|
|
|
|
|
|
|
const shape = new Konva.Image({
|
|
|
|
|
|
|
|
x: 60,
|
|
|
|
|
|
|
|
y: 0,
|
|
|
|
|
|
|
|
width: imgSize,
|
|
|
|
|
|
|
|
height:40,
|
|
|
|
|
|
|
|
image: imageObj,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
group.add(shape)
|
|
|
|
|
|
|
|
const gbText=new Konva.Text({
|
|
|
|
|
|
|
|
x: 60,
|
|
|
|
|
|
|
|
y: 0,
|
|
|
|
|
|
|
|
width: imgSize,
|
|
|
|
|
|
|
|
height:40,
|
|
|
|
|
|
|
|
fill:'black',
|
|
|
|
|
|
|
|
text:gb+',12*2830*13090',
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(gbText)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const concent=new Konva.Text({
|
|
|
|
|
|
|
|
x: imgSize+40,
|
|
|
|
|
|
|
|
y: 0,
|
|
|
|
|
|
|
|
width: imgSize,
|
|
|
|
|
|
|
|
height:40,
|
|
|
|
|
|
|
|
fill:'black',
|
|
|
|
|
|
|
|
text:'G175K-4,上料:2024/07/01,切割:2024/07/04',
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(concent)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//绘制上料计划钢板信息
|
|
|
|
|
|
|
|
drawSljhItem(list){
|
|
|
|
|
|
|
|
const itemWith=80;
|
|
|
|
|
|
|
|
const itemHeight=108
|
|
|
|
|
|
|
|
this.sljhList=[]
|
|
|
|
|
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
|
|
|
|
|
const item=list[i];
|
|
|
|
|
|
|
|
const x=(i+1)*5+i*itemWith;
|
|
|
|
|
|
|
|
const qyGroup=new Konva.Group({
|
|
|
|
|
|
|
|
x:x,
|
|
|
|
|
|
|
|
y:10,
|
|
|
|
|
|
|
|
width:itemWith,
|
|
|
|
|
|
|
|
height:itemHeight,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
qyGroup.setAttr('index',i)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _layer=this.layer
|
|
|
|
|
|
|
|
const _sljhGroup=this.sljhGroup;
|
|
|
|
|
|
|
|
const _dwGroup=this.dwGroup
|
|
|
|
|
|
|
|
let touchingFlag=false;
|
|
|
|
|
|
|
|
const that=this
|
|
|
|
|
|
|
|
qyGroup.on('touchstart',function ({evt}){
|
|
|
|
|
|
|
|
if (!that.canSl){
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {clientX:x,clientY:y}=evt.touches[0]
|
|
|
|
|
|
|
|
touchingFlag=true;
|
|
|
|
|
|
|
|
const _that=this
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
|
|
const movingFlag=_sljhGroup.isDragging()
|
|
|
|
|
|
|
|
if (!movingFlag){
|
|
|
|
|
|
|
|
if (touchingFlag){
|
|
|
|
|
|
|
|
_sljhGroup.draggable(false)
|
|
|
|
|
|
|
|
const tmpGroup=_that.clone();
|
|
|
|
|
|
|
|
tmpGroup.x(x-10)
|
|
|
|
|
|
|
|
tmpGroup.y(y-10)
|
|
|
|
|
|
|
|
_layer.add(tmpGroup)
|
|
|
|
|
|
|
|
tmpGroup.draggable(true)
|
|
|
|
|
|
|
|
tmpGroup.dragBoundFunc(function (pos){
|
|
|
|
|
|
|
|
const {x,y}=that.slGroup.absolutePosition()
|
|
|
|
|
|
|
|
const maxX=x+that.width*0.4-20
|
|
|
|
|
|
|
|
const maxY=y+that.height*0.8-20
|
|
|
|
|
|
|
|
if(pos.x>=x&&pos.y>=y&&pos.x<=maxX&&pos.y<=maxY){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return{
|
|
|
|
|
|
|
|
x:pos.x,
|
|
|
|
|
|
|
|
y:pos.y
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
tmpGroup.on('dragend',function (){
|
|
|
|
|
|
|
|
const {x:thisX,y:thisY}=this.absolutePosition()
|
|
|
|
|
|
|
|
const {x,y}=that.slGroup.absolutePosition()
|
|
|
|
|
|
|
|
const maxX=x+that.width*0.4-20
|
|
|
|
|
|
|
|
const maxY=y+that.height*0.8-20
|
|
|
|
|
|
|
|
if(thisX>=x&&thisY>=y&&thisX<=maxX&&thisY<=maxY){
|
|
|
|
|
|
|
|
that.qyList[that.currentQyIndex].dw[that.currentDwIndex].list.push('12123')
|
|
|
|
|
|
|
|
that.slGroup.destroyChildren()
|
|
|
|
|
|
|
|
that.drawSlItem(that.qyList[that.currentQyIndex].dw[that.currentDwIndex].list)
|
|
|
|
|
|
|
|
this.remove()
|
|
|
|
|
|
|
|
that.sljhItemList.splice(this.getAttr('index'),1)
|
|
|
|
|
|
|
|
that.sljhGroup.destroyChildren()
|
|
|
|
|
|
|
|
that.drawSljhItem(that.sljhItemList)
|
|
|
|
|
|
|
|
_sljhGroup.draggable(true)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.remove()
|
|
|
|
|
|
|
|
_that.visible(true)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
tmpGroup.startDrag()
|
|
|
|
|
|
|
|
_that.visible(false)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (movingFlag){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},500)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qyGroup.on('touchend',function (){
|
|
|
|
|
|
|
|
touchingFlag=false;
|
|
|
|
|
|
|
|
this.draggable(false)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width:itemWith,
|
|
|
|
|
|
|
|
height:itemHeight,
|
|
|
|
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
qyGroup.add(rect)
|
|
|
|
|
|
|
|
const text=new Konva.Text({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width:itemWith,
|
|
|
|
|
|
|
|
height:itemHeight,
|
|
|
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
|
|
|
stroke:'blue',
|
|
|
|
|
|
|
|
strokeWidth:0.1,
|
|
|
|
|
|
|
|
text:item.czbh+'\n'+item.pl+'\n'+item.tzbh+'\n建议位置\n'+item.perQy+'\n'+item.perDw+'\n'+item.perCeng,
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
qyGroup.add(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.sljhList.push(qyGroup)
|
|
|
|
|
|
|
|
this.sljhGroup.add(qyGroup)
|
|
|
|
|
|
|
|
// this.mountGroup.add(qyGroup)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//绘制移垛记录区
|
|
|
|
|
|
|
|
drawYd(){
|
|
|
|
|
|
|
|
this.drawContainer({
|
|
|
|
|
|
|
|
x:15+this.width*0.6-15+5,
|
|
|
|
|
|
|
|
y:this.height-this.height*0.8+10,
|
|
|
|
|
|
|
|
width: this.width*0.4-20,
|
|
|
|
|
|
|
|
height: this.height*0.8-20,
|
|
|
|
|
|
|
|
stroke:'blue',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//绘制上料功能区
|
|
|
|
|
|
|
|
drawSl(){
|
|
|
|
|
|
|
|
const {qyGroup}=this.drawContainer({
|
|
|
|
|
|
|
|
x:15+this.width*0.2+5,
|
|
|
|
|
|
|
|
y:this.height-this.height*0.8+10,
|
|
|
|
|
|
|
|
width: this.width*0.4-20,
|
|
|
|
|
|
|
|
height: this.height*0.8-20,
|
|
|
|
|
|
|
|
stroke:'blue',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.slGroup=qyGroup
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
drawDw(qyGroup,qy,size){
|
|
|
|
|
|
|
|
if (this.dwGroup){
|
|
|
|
|
|
|
|
this.dwGroup.destroyChildren()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const _group=this.dwGroup=new Konva.Group({
|
|
|
|
|
|
|
|
x:54+size,
|
|
|
|
|
|
|
|
y:15,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
qyGroup.add(_group)
|
|
|
|
|
|
|
|
for (let i = 0; i < qy.dw.length; i++) {
|
|
|
|
|
|
|
|
const dw=qy.dw[i]
|
|
|
|
|
|
|
|
const group=new Konva.Group({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:i*5+i*size,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(rect)
|
|
|
|
|
|
|
|
const text=new Konva.Text({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
fill:'black',
|
|
|
|
|
|
|
|
text:qy.name+'\n'+dw.name,
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
fontSize:20
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(text)
|
|
|
|
|
|
|
|
group.on('click touchstart',(evt)=>{
|
|
|
|
|
|
|
|
this.slGroup.destroyChildren()
|
|
|
|
|
|
|
|
this.canSl=true
|
|
|
|
|
|
|
|
this.currentDwIndex=i
|
|
|
|
|
|
|
|
this.drawSlItem(dw.list)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
_group.add(group)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//绘制垛位选择区
|
|
|
|
|
|
|
|
drawQy(){
|
|
|
|
|
|
|
|
const {quRet,qyGroup}=this.drawContainer({
|
|
|
|
|
|
|
|
x:15,
|
|
|
|
|
|
|
|
y:this.height-this.height*0.8+10,
|
|
|
|
|
|
|
|
width: this.width*0.2,
|
|
|
|
|
|
|
|
height: this.height*0.8-20,
|
|
|
|
|
|
|
|
stroke:'blue',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const size=120;
|
|
|
|
|
|
|
|
for (let i = 0; i < this.qyList.length; i++) {
|
|
|
|
|
|
|
|
const qy=this.qyList[i]
|
|
|
|
|
|
|
|
const group=new Konva.Group({
|
|
|
|
|
|
|
|
x:23,
|
|
|
|
|
|
|
|
y:15+i*5+i*size,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(rect)
|
|
|
|
|
|
|
|
const text=new Konva.Text({
|
|
|
|
|
|
|
|
x:0,
|
|
|
|
|
|
|
|
y:0,
|
|
|
|
|
|
|
|
width: size,
|
|
|
|
|
|
|
|
height: size,
|
|
|
|
|
|
|
|
fill:'black',
|
|
|
|
|
|
|
|
text:qy.name,
|
|
|
|
|
|
|
|
align:'center',
|
|
|
|
|
|
|
|
verticalAlign:'middle',
|
|
|
|
|
|
|
|
fontSize:20
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
group.add(text)
|
|
|
|
|
|
|
|
group.on('click touchstart',(evt)=>{
|
|
|
|
|
|
|
|
this.currentQyIndex=i
|
|
|
|
|
|
|
|
this.drawDw(qyGroup,qy,size)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
qyGroup.add(group)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//上料计划选择区
|
|
|
|
|
|
|
|
drawSljh(){
|
|
|
|
|
|
|
|
// this.sljhStage = new Konva.Stage({
|
|
|
|
|
|
|
|
// container: "sliao",
|
|
|
|
|
|
|
|
// x:15,
|
|
|
|
|
|
|
|
// y:65,
|
|
|
|
|
|
|
|
// width: this.width-30,
|
|
|
|
|
|
|
|
// height: this.height*0.2-60,
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// group.add(shape)
|
|
|
|
// this.sljhStage.container().style.cursor = "drag";
|
|
|
|
// const gbText=new Konva.Text({
|
|
|
|
|
|
|
|
// x: 60,
|
|
|
|
this.sljhLayer = new Konva.Layer();
|
|
|
|
// y: 0,
|
|
|
|
this.stage.add(this.sljhLayer)
|
|
|
|
// width: imgSize,
|
|
|
|
this.sljhLayer.draw();
|
|
|
|
// height:40,
|
|
|
|
|
|
|
|
// fill:'black',
|
|
|
|
const qyGroup=new Konva.Group({
|
|
|
|
// text:gb+',12*2830*13090',
|
|
|
|
x:15,
|
|
|
|
// align:'center',
|
|
|
|
y:65,
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
width: this.width-30,
|
|
|
|
|
|
|
|
height: this.height*0.2-60,
|
|
|
|
|
|
|
|
stroke:'blue',
|
|
|
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
|
|
|
draggable: true,
|
|
|
|
|
|
|
|
dragBoundFunc:function (pos){
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
x:pos.x,
|
|
|
|
|
|
|
|
y:65
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qyGroup.on('dragmove',function (){
|
|
|
|
|
|
|
|
const itemWidth=80
|
|
|
|
|
|
|
|
const itemHeight=108;
|
|
|
|
|
|
|
|
// this.getChildren((node)=>{
|
|
|
|
|
|
|
|
// const {x,y}=node.absolutePosition();
|
|
|
|
|
|
|
|
// if(x+itemWidth<20){
|
|
|
|
|
|
|
|
// node.visible(false)
|
|
|
|
|
|
|
|
// }else if(x+15<20){
|
|
|
|
|
|
|
|
// node.clipFunc((ctx)=>{
|
|
|
|
|
|
|
|
// ctx.rect(itemWidth-20, 0, itemWidth, itemHeight)
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// group.add(gbText)
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// const concent=new Konva.Text({
|
|
|
|
// if (x+15>=this.width){
|
|
|
|
// x: imgSize+40,
|
|
|
|
// node.visible(false)
|
|
|
|
// y: 0,
|
|
|
|
|
|
|
|
// width: imgSize,
|
|
|
|
|
|
|
|
// height:40,
|
|
|
|
|
|
|
|
// fill:'black',
|
|
|
|
|
|
|
|
// text:'G175K-4,上料:2024/07/01,切割:2024/07/04',
|
|
|
|
|
|
|
|
// align:'center',
|
|
|
|
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// group.add(concent)
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
//
|
|
|
|
// //绘制上料计划钢板信息
|
|
|
|
// if (x+15<this.width&&x+15+itemWidth>this.width&&node.visible()){
|
|
|
|
// drawSljhItem(list){
|
|
|
|
// node.clipFunc((ctx)=>{
|
|
|
|
// const itemWith=80;
|
|
|
|
// ctx.rect(0, 0, this.width-30-x, itemHeight)
|
|
|
|
// const itemHeight=108
|
|
|
|
|
|
|
|
// for (let i = 0; i < list.length; i++) {
|
|
|
|
|
|
|
|
// const item=list[i];
|
|
|
|
|
|
|
|
// const qyGroup=new Konva.Group({
|
|
|
|
|
|
|
|
// x:(i+1)*5+i*itemWith,
|
|
|
|
|
|
|
|
// y:10,
|
|
|
|
|
|
|
|
// width:itemWith,
|
|
|
|
|
|
|
|
// height:itemHeight,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// const rect=new Konva.Rect({
|
|
|
|
|
|
|
|
// x:0,
|
|
|
|
|
|
|
|
// y:0,
|
|
|
|
|
|
|
|
// width:itemWith,
|
|
|
|
|
|
|
|
// height:itemHeight,
|
|
|
|
|
|
|
|
// stroke:'black',
|
|
|
|
|
|
|
|
// strokeWidth:1,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// qyGroup.add(rect)
|
|
|
|
|
|
|
|
// const text=new Konva.Text({
|
|
|
|
|
|
|
|
// x:0,
|
|
|
|
|
|
|
|
// y:0,
|
|
|
|
|
|
|
|
// width:itemWith,
|
|
|
|
|
|
|
|
// height:itemHeight,
|
|
|
|
|
|
|
|
// lineHeight:1,
|
|
|
|
|
|
|
|
// stroke:'blue',
|
|
|
|
|
|
|
|
// strokeWidth:0.1,
|
|
|
|
|
|
|
|
// text:item.czbh+'\n'+item.pl+'\n'+item.tzbh+'\n建议位置\n'+item.perQy+'\n'+item.perDw+'\n'+item.perCeng,
|
|
|
|
|
|
|
|
// align:'center',
|
|
|
|
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// qyGroup.add(text)
|
|
|
|
|
|
|
|
// this.sljhGroup.add(qyGroup)
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //绘制移垛记录区
|
|
|
|
|
|
|
|
// drawYd(){
|
|
|
|
|
|
|
|
// this.drawContainer({
|
|
|
|
|
|
|
|
// x:15+this.width*0.6-15+5,
|
|
|
|
|
|
|
|
// y:this.height-this.height*0.8+10,
|
|
|
|
|
|
|
|
// width: this.width*0.4-20,
|
|
|
|
|
|
|
|
// height: this.height*0.8-20,
|
|
|
|
|
|
|
|
// stroke:'blue',
|
|
|
|
|
|
|
|
// strokeWidth:1,
|
|
|
|
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
})
|
|
|
|
// //绘制上料功能区
|
|
|
|
|
|
|
|
// drawSl(){
|
|
|
|
this.sljhLayer.add(qyGroup)
|
|
|
|
// const {qyGroup}=this.drawContainer({
|
|
|
|
|
|
|
|
// x:15+this.width*0.2+5,
|
|
|
|
// const {quRet,qyGroup}=this.drawContainer({
|
|
|
|
// y:this.height-this.height*0.8+10,
|
|
|
|
// x:15,
|
|
|
|
// width: this.width*0.4-20,
|
|
|
|
// y:65,
|
|
|
|
// height: this.height*0.8-20,
|
|
|
|
// width: this.width-30,
|
|
|
|
|
|
|
|
// height: this.height*0.2-60,
|
|
|
|
// stroke:'blue',
|
|
|
|
// stroke:'blue',
|
|
|
|
// strokeWidth:1,
|
|
|
|
// strokeWidth:1,
|
|
|
|
|
|
|
|
// draggable: true,
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// this.slGroup=qyGroup
|
|
|
|
// quRet.on('touchmove',({evt})=>{
|
|
|
|
// },
|
|
|
|
// const speed=0.15
|
|
|
|
// drawDw(qyGroup,qy,size){
|
|
|
|
// const time=evt.timeStamp
|
|
|
|
// if (this.dwGroup){
|
|
|
|
// const x=evt.targetTouches[0].clientX
|
|
|
|
// this.dwGroup.destroyChildren()
|
|
|
|
// if (this.startMoveTime===0){
|
|
|
|
|
|
|
|
// this.startMoveTime=time
|
|
|
|
|
|
|
|
// this.startMoveX=x
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// const _group=this.dwGroup=new Konva.Group({
|
|
|
|
//
|
|
|
|
// x:54+size,
|
|
|
|
// const _time=time-this.startMoveTime
|
|
|
|
// y:15,
|
|
|
|
// const dirX=x-this.startMoveX
|
|
|
|
// width: size,
|
|
|
|
//
|
|
|
|
// height: size,
|
|
|
|
// if (!this.isMoving){
|
|
|
|
// })
|
|
|
|
// this.isMoving=true
|
|
|
|
// qyGroup.add(_group)
|
|
|
|
// this.sljhList.forEach(item=>{
|
|
|
|
// for (let i = 0; i < qy.dw.length; i++) {
|
|
|
|
// item.move({
|
|
|
|
// const dw=qy.dw[i]
|
|
|
|
// x:speed*_time*(dirX>0?1:-1)
|
|
|
|
// const group=new Konva.Group({
|
|
|
|
|
|
|
|
// x:0,
|
|
|
|
|
|
|
|
// y:i*5+i*size,
|
|
|
|
|
|
|
|
// width: size,
|
|
|
|
|
|
|
|
// height: size,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// const rect=new Konva.Rect({
|
|
|
|
|
|
|
|
// x:0,
|
|
|
|
|
|
|
|
// y:0,
|
|
|
|
|
|
|
|
// width: size,
|
|
|
|
|
|
|
|
// height: size,
|
|
|
|
|
|
|
|
// stroke:'black',
|
|
|
|
|
|
|
|
// strokeWidth:1,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// group.add(rect)
|
|
|
|
|
|
|
|
// const text=new Konva.Text({
|
|
|
|
|
|
|
|
// x:0,
|
|
|
|
|
|
|
|
// y:0,
|
|
|
|
|
|
|
|
// width: size,
|
|
|
|
|
|
|
|
// height: size,
|
|
|
|
|
|
|
|
// fill:'black',
|
|
|
|
|
|
|
|
// text:qy.name+'\n'+dw.name,
|
|
|
|
|
|
|
|
// align:'center',
|
|
|
|
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
|
|
|
|
// fontSize:20
|
|
|
|
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// group.add(text)
|
|
|
|
|
|
|
|
// group.on('click touchstart',(evt)=>{
|
|
|
|
|
|
|
|
// console.log(evt.target)
|
|
|
|
|
|
|
|
// this.slGroup.destroyChildren()
|
|
|
|
|
|
|
|
// this.drawSlItem(dw.list)
|
|
|
|
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// _group.add(group)
|
|
|
|
// this.startMoveTime=0
|
|
|
|
|
|
|
|
// this.startMoveX=0
|
|
|
|
|
|
|
|
// this.isMoving=false
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// this.startMoveTime=time
|
|
|
|
|
|
|
|
// this.startMoveX=x
|
|
|
|
|
|
|
|
// this.isMoving=false
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// })
|
|
|
|
// //绘制垛位选择区
|
|
|
|
|
|
|
|
// drawQy(){
|
|
|
|
this.sljhGroup=qyGroup
|
|
|
|
// const {quRet,qyGroup}=this.drawContainer({
|
|
|
|
// this.mountGroup=this.drawGroup({
|
|
|
|
// x:15,
|
|
|
|
// x:15,
|
|
|
|
// y:this.height-this.height*0.8+10,
|
|
|
|
// y:this.height-this.height*0.8+10,
|
|
|
|
// width: this.width*0.2,
|
|
|
|
// width: this.width*0.2,
|
|
|
@ -250,130 +568,81 @@ import Konva from "konva";
|
|
|
|
// stroke:'blue',
|
|
|
|
// stroke:'blue',
|
|
|
|
// strokeWidth:1,
|
|
|
|
// strokeWidth:1,
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// const size=120;
|
|
|
|
// this.layer.add(this.mountGroup)
|
|
|
|
// for (let i = 0; i < this.qyList.length; i++) {
|
|
|
|
},
|
|
|
|
// const qy=this.qyList[i]
|
|
|
|
drawMsg(){
|
|
|
|
// const group=new Konva.Group({
|
|
|
|
this.drawText({
|
|
|
|
// x:23,
|
|
|
|
x:15,
|
|
|
|
// y:15+i*5+i*size,
|
|
|
|
y:50,
|
|
|
|
// width: size,
|
|
|
|
width:this.width-30,
|
|
|
|
// height: size,
|
|
|
|
height:20,
|
|
|
|
// })
|
|
|
|
lineHeight:1,
|
|
|
|
// const rect=new Konva.Rect({
|
|
|
|
stroke:'black',
|
|
|
|
// x:0,
|
|
|
|
strokeWidth:0.1,
|
|
|
|
// y:0,
|
|
|
|
text:this.msg,
|
|
|
|
// width: size,
|
|
|
|
align:'center',
|
|
|
|
// height: size,
|
|
|
|
})
|
|
|
|
// stroke:'black',
|
|
|
|
},
|
|
|
|
// strokeWidth:1,
|
|
|
|
|
|
|
|
// })
|
|
|
|
drawText(option){
|
|
|
|
// group.add(rect)
|
|
|
|
const text=new Konva.Text(option)
|
|
|
|
// const text=new Konva.Text({
|
|
|
|
this.layer.add(text)
|
|
|
|
// x:0,
|
|
|
|
return text
|
|
|
|
// y:0,
|
|
|
|
},
|
|
|
|
// width: size,
|
|
|
|
|
|
|
|
// height: size,
|
|
|
|
initKonvaStage(){
|
|
|
|
// fill:'black',
|
|
|
|
this.width=this.$refs.sliao.clientWidth
|
|
|
|
// text:qy.name,
|
|
|
|
this.height=this.$refs.sliao.clientHeight
|
|
|
|
// align:'center',
|
|
|
|
const options={
|
|
|
|
// verticalAlign:'middle',
|
|
|
|
width:this.width,
|
|
|
|
// fontSize:20
|
|
|
|
height:this.height
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
// group.add(text)
|
|
|
|
const {drawTitle}=sliao(options)
|
|
|
|
// group.on('click touchstart',(evt)=>{
|
|
|
|
|
|
|
|
// console.log(evt.target)
|
|
|
|
this.stage = new Konva.Stage({
|
|
|
|
// this.drawDw(qyGroup,qy,size)
|
|
|
|
container: "sliao",
|
|
|
|
// })
|
|
|
|
width: this.width,
|
|
|
|
// qyGroup.add(group)
|
|
|
|
height: this.height,
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
// },
|
|
|
|
//this.stage.container().style.cursor = "sw-resize";
|
|
|
|
// //上料计划选择区
|
|
|
|
|
|
|
|
// drawSljh(){
|
|
|
|
this.layer = new Konva.Layer();
|
|
|
|
// const {quRet,qyGroup}=this.drawContainer({
|
|
|
|
this.stage.add(this.layer)
|
|
|
|
// x:15,
|
|
|
|
this.layer.draw();
|
|
|
|
// y:65,
|
|
|
|
|
|
|
|
// width: this.width-30,
|
|
|
|
const title=drawTitle(this.width,0,this.title)
|
|
|
|
// height: this.height*0.2-60,
|
|
|
|
this.layer.add(title)
|
|
|
|
// stroke:'blue',
|
|
|
|
|
|
|
|
// strokeWidth:1,
|
|
|
|
//构建布局区域
|
|
|
|
// })
|
|
|
|
//上料计划显示区
|
|
|
|
// qyGroup.on('click touchstart',(evt)=>{
|
|
|
|
this.drawSljh()
|
|
|
|
// console.log(evt)
|
|
|
|
//区域垛位选择区
|
|
|
|
// })
|
|
|
|
this.drawQy()
|
|
|
|
// this.sljhGroup=qyGroup
|
|
|
|
//上料功能区
|
|
|
|
// },
|
|
|
|
this.drawSl();
|
|
|
|
// drawMsg(){
|
|
|
|
//移垛记录区
|
|
|
|
// this.drawText({
|
|
|
|
this.drawYd();
|
|
|
|
// x:15,
|
|
|
|
},
|
|
|
|
// y:50,
|
|
|
|
//绘制区域
|
|
|
|
// width:this.width-30,
|
|
|
|
drawContainer(option){
|
|
|
|
// height:20,
|
|
|
|
const quRet=this.drawRect(option)
|
|
|
|
// lineHeight:1,
|
|
|
|
const qyGroup=this.drawGroup(option)
|
|
|
|
// stroke:'black',
|
|
|
|
return {
|
|
|
|
// strokeWidth:0.1,
|
|
|
|
quRet,qyGroup
|
|
|
|
// text:this.msg,
|
|
|
|
}
|
|
|
|
// align:'center',
|
|
|
|
},
|
|
|
|
// })
|
|
|
|
drawGroup(option){
|
|
|
|
// },
|
|
|
|
const qyGroup=new Konva.Group(option);
|
|
|
|
//
|
|
|
|
this.layer.add(qyGroup)
|
|
|
|
// drawText(option){
|
|
|
|
return qyGroup
|
|
|
|
// const text=new Konva.Text(option)
|
|
|
|
},
|
|
|
|
// this.layer.add(text)
|
|
|
|
drawRect(option){
|
|
|
|
// return text
|
|
|
|
const quRet=new Konva.Rect(option);
|
|
|
|
// },
|
|
|
|
this.layer.add(quRet)
|
|
|
|
//
|
|
|
|
return quRet
|
|
|
|
// initKonvaStage(){
|
|
|
|
}
|
|
|
|
// this.width=this.$refs.sliao.clientWidth
|
|
|
|
}
|
|
|
|
// this.height=this.$refs.sliao.clientHeight
|
|
|
|
}
|
|
|
|
// const options={
|
|
|
|
|
|
|
|
// width:this.width,
|
|
|
|
|
|
|
|
// height:this.height
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// const {drawTitle}=sliao(options)
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// this.stage = new Konva.Stage({
|
|
|
|
|
|
|
|
// container: "sliao",
|
|
|
|
|
|
|
|
// width: this.width,
|
|
|
|
|
|
|
|
// height: this.height,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// //this.stage.container().style.cursor = "sw-resize";
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// this.layer = new Konva.Layer();
|
|
|
|
|
|
|
|
// this.stage.add(this.layer)
|
|
|
|
|
|
|
|
// this.layer.draw();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// const title=drawTitle(this.width,0,this.title)
|
|
|
|
|
|
|
|
// this.layer.add(title)
|
|
|
|
|
|
|
|
// //构建布局区域
|
|
|
|
|
|
|
|
// //上料计划显示区
|
|
|
|
|
|
|
|
// this.drawSljh()
|
|
|
|
|
|
|
|
// //区域垛位选择区
|
|
|
|
|
|
|
|
// this.drawQy()
|
|
|
|
|
|
|
|
// //上料功能区
|
|
|
|
|
|
|
|
// this.drawSl();
|
|
|
|
|
|
|
|
// //移垛记录区
|
|
|
|
|
|
|
|
// this.drawYd();
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// //绘制区域
|
|
|
|
|
|
|
|
// drawContainer(option){
|
|
|
|
|
|
|
|
// const quRet=this.drawRect(option)
|
|
|
|
|
|
|
|
// const qyGroup=this.drawGroup(option)
|
|
|
|
|
|
|
|
// return {
|
|
|
|
|
|
|
|
// quRet,qyGroup
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// drawGroup(option){
|
|
|
|
|
|
|
|
// const qyGroup=new Konva.Group(option);
|
|
|
|
|
|
|
|
// this.layer.add(qyGroup)
|
|
|
|
|
|
|
|
// return qyGroup
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// drawRect(option){
|
|
|
|
|
|
|
|
// const quRet=new Konva.Rect(option);
|
|
|
|
|
|
|
|
// this.layer.add(quRet)
|
|
|
|
|
|
|
|
// return quRet
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|