parent
afc8812e19
commit
448842af7d
@ -0,0 +1,280 @@
|
|||||||
|
import Konva from "konva";
|
||||||
|
|
||||||
|
export const sljh=function (width,height){
|
||||||
|
|
||||||
|
const layer=new Konva.Layer({
|
||||||
|
id:'2',
|
||||||
|
x:20,
|
||||||
|
y:75,
|
||||||
|
})
|
||||||
|
|
||||||
|
const group=new Konva.Group({
|
||||||
|
x:0,
|
||||||
|
y:0,
|
||||||
|
width: width*0.6,
|
||||||
|
height: height*0.2-60,
|
||||||
|
draggable: true,
|
||||||
|
dragBoundFunc:function (pos){
|
||||||
|
return {
|
||||||
|
x:pos.x,
|
||||||
|
y:75
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const bgGroup=new Konva.Group({
|
||||||
|
x:34,
|
||||||
|
y:0,
|
||||||
|
})
|
||||||
|
bgGroup.clipFunc(function(ctx) {
|
||||||
|
ctx.rect(4, 0, width*0.6, height*0.2-10);
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(bgGroup)
|
||||||
|
bgGroup.zIndex(0)
|
||||||
|
bgGroup.add(group)
|
||||||
|
|
||||||
|
const left2ImageObj=new Image()
|
||||||
|
left2ImageObj.src = require('@/assets/sliao/left2.png');
|
||||||
|
left2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:-116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const right2ImageObj=new Image()
|
||||||
|
right2ImageObj.src = require('@/assets/sliao/right2.png');
|
||||||
|
right2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: width*0.65,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhbg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 8,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.66,
|
||||||
|
height:181,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawItem(i,item){
|
||||||
|
const itemWith=111;
|
||||||
|
const itemHeight=108
|
||||||
|
|
||||||
|
const x=(i+1)*5+i*itemWith;
|
||||||
|
const qyGroup=new Konva.Group({
|
||||||
|
x:x,
|
||||||
|
y:10,
|
||||||
|
width:itemWith,
|
||||||
|
height:itemHeight,
|
||||||
|
})
|
||||||
|
qyGroup.setAttr('index',i)
|
||||||
|
qyGroup.setAttr('item',item)
|
||||||
|
group.add(qyGroup)
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhItemBg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:163,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
qyGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tlth=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:34,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.tzbh
|
||||||
|
})
|
||||||
|
qyGroup.add(tlth)
|
||||||
|
|
||||||
|
const nameGroup=new Konva.Group({
|
||||||
|
x: 5,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
|
||||||
|
const nameImageObj1 = new Image();
|
||||||
|
nameImageObj1.src = require('@/assets/sliao/nameBg1.png');
|
||||||
|
nameImageObj1.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
nameGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
qyGroup.add(nameGroup)
|
||||||
|
|
||||||
|
const name1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'船号'
|
||||||
|
})
|
||||||
|
nameGroup.add(name1)
|
||||||
|
|
||||||
|
const name2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'批量'
|
||||||
|
})
|
||||||
|
nameGroup.add(name2)
|
||||||
|
|
||||||
|
const name3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'规格'
|
||||||
|
})
|
||||||
|
nameGroup.add(name3)
|
||||||
|
|
||||||
|
const name4=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 64.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'垛位'
|
||||||
|
})
|
||||||
|
nameGroup.add(name4)
|
||||||
|
|
||||||
|
const name5=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 86.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'层数'
|
||||||
|
})
|
||||||
|
nameGroup.add(name5)
|
||||||
|
|
||||||
|
const infoGroup=new Konva.Group({
|
||||||
|
x: 43,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
qyGroup.add(infoGroup)
|
||||||
|
|
||||||
|
const info1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcCh
|
||||||
|
})
|
||||||
|
infoGroup.add(info1)
|
||||||
|
|
||||||
|
const info2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcPl
|
||||||
|
})
|
||||||
|
infoGroup.add(info2)
|
||||||
|
|
||||||
|
const info3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:9,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.wpgg
|
||||||
|
})
|
||||||
|
infoGroup.add(info3)
|
||||||
|
|
||||||
|
return qyGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
layer,group,drawItem
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
<template>
|
|
||||||
<VxeGrid v-bind="gridOptions" @cell-click="cellClick" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import paoWanPgdConfig from './pgdTable'
|
|
||||||
export default {
|
|
||||||
name:'LliaoPgd',
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
gridOptions:{},
|
|
||||||
list:{},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
const {options,columns}=paoWanPgdConfig()
|
|
||||||
this.gridOptions=options
|
|
||||||
this.gridOptions.columns=columns
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
cellClick({row}){
|
|
||||||
this.$emit('initPgd',row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<VxeGrid v-bind="gridOptions" @cell-click="cellClick" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import paoWanPgdConfig from './pgdTable'
|
||||||
|
import {getPgd} from "@/api/zyjh";
|
||||||
|
export default {
|
||||||
|
name:'LLiaoPgd',
|
||||||
|
props:{
|
||||||
|
workers:{
|
||||||
|
type:Array,
|
||||||
|
default:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
gridOptions:{},
|
||||||
|
setExt:null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created(){
|
||||||
|
const {options,columns,setExt}=paoWanPgdConfig()
|
||||||
|
this.setExt=setExt
|
||||||
|
this.gridOptions=options
|
||||||
|
this.gridOptions.columns=columns
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
initData(worker,zt){
|
||||||
|
getPgd({user:worker,zt:zt,field:'pwry'}).then(res=>{
|
||||||
|
this.gridOptions.data=res.data
|
||||||
|
this.setExt('workers',this.$props.workers)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cellClick({row}){
|
||||||
|
this.$emit('initPgd',row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,38 +0,0 @@
|
|||||||
import Konva from "konva";
|
|
||||||
|
|
||||||
//传送带
|
|
||||||
export default function (width,height){
|
|
||||||
const x=width*0.55+40,y=45,_width=width*0.1,_height=height*0.945
|
|
||||||
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
|
|
||||||
}
|
|
@ -0,0 +1,281 @@
|
|||||||
|
import Konva from "konva";
|
||||||
|
import {shangLiao} from "@/api/zyjh";
|
||||||
|
|
||||||
|
export const sljh=function (width,height){
|
||||||
|
|
||||||
|
const layer=new Konva.Layer({
|
||||||
|
id:'2',
|
||||||
|
x:20,
|
||||||
|
y:75,
|
||||||
|
})
|
||||||
|
|
||||||
|
const group=new Konva.Group({
|
||||||
|
x:0,
|
||||||
|
y:0,
|
||||||
|
width: width*0.6,
|
||||||
|
height: height*0.2-60,
|
||||||
|
draggable: true,
|
||||||
|
dragBoundFunc:function (pos){
|
||||||
|
return {
|
||||||
|
x:pos.x,
|
||||||
|
y:75
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const bgGroup=new Konva.Group({
|
||||||
|
x:34,
|
||||||
|
y:0,
|
||||||
|
})
|
||||||
|
bgGroup.clipFunc(function(ctx) {
|
||||||
|
ctx.rect(4, 0, width*0.6, height*0.2-10);
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(bgGroup)
|
||||||
|
bgGroup.zIndex(0)
|
||||||
|
bgGroup.add(group)
|
||||||
|
|
||||||
|
const left2ImageObj=new Image()
|
||||||
|
left2ImageObj.src = require('@/assets/sliao/left2.png');
|
||||||
|
left2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:-116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const right2ImageObj=new Image()
|
||||||
|
right2ImageObj.src = require('@/assets/sliao/right2.png');
|
||||||
|
right2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: width*0.65,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhbg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 8,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.66,
|
||||||
|
height:181,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawItem(i,item){
|
||||||
|
const itemWith=111;
|
||||||
|
const itemHeight=108
|
||||||
|
|
||||||
|
const x=(i+1)*5+i*itemWith;
|
||||||
|
const qyGroup=new Konva.Group({
|
||||||
|
x:x,
|
||||||
|
y:10,
|
||||||
|
width:itemWith,
|
||||||
|
height:itemHeight,
|
||||||
|
})
|
||||||
|
qyGroup.setAttr('index',i)
|
||||||
|
qyGroup.setAttr('item',item)
|
||||||
|
group.add(qyGroup)
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhItemBg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:163,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
qyGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tlth=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:34,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.tzbh
|
||||||
|
})
|
||||||
|
qyGroup.add(tlth)
|
||||||
|
|
||||||
|
const nameGroup=new Konva.Group({
|
||||||
|
x: 5,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
|
||||||
|
const nameImageObj1 = new Image();
|
||||||
|
nameImageObj1.src = require('@/assets/sliao/nameBg1.png');
|
||||||
|
nameImageObj1.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
nameGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
qyGroup.add(nameGroup)
|
||||||
|
|
||||||
|
const name1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'船号'
|
||||||
|
})
|
||||||
|
nameGroup.add(name1)
|
||||||
|
|
||||||
|
const name2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'批量'
|
||||||
|
})
|
||||||
|
nameGroup.add(name2)
|
||||||
|
|
||||||
|
const name3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'规格'
|
||||||
|
})
|
||||||
|
nameGroup.add(name3)
|
||||||
|
|
||||||
|
const name4=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 64.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'垛位'
|
||||||
|
})
|
||||||
|
nameGroup.add(name4)
|
||||||
|
|
||||||
|
const name5=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 86.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'层数'
|
||||||
|
})
|
||||||
|
nameGroup.add(name5)
|
||||||
|
|
||||||
|
const infoGroup=new Konva.Group({
|
||||||
|
x: 43,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
qyGroup.add(infoGroup)
|
||||||
|
|
||||||
|
const info1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcCh
|
||||||
|
})
|
||||||
|
infoGroup.add(info1)
|
||||||
|
|
||||||
|
const info2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcPl
|
||||||
|
})
|
||||||
|
infoGroup.add(info2)
|
||||||
|
|
||||||
|
const info3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:9,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.wpgg
|
||||||
|
})
|
||||||
|
infoGroup.add(info3)
|
||||||
|
|
||||||
|
return qyGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
layer,group,drawItem
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
@ -0,0 +1,280 @@
|
|||||||
|
import Konva from "konva";
|
||||||
|
|
||||||
|
export const sljh=function (width,height){
|
||||||
|
|
||||||
|
const layer=new Konva.Layer({
|
||||||
|
id:'2',
|
||||||
|
x:20,
|
||||||
|
y:75,
|
||||||
|
})
|
||||||
|
|
||||||
|
const group=new Konva.Group({
|
||||||
|
x:0,
|
||||||
|
y:0,
|
||||||
|
width: width*0.6,
|
||||||
|
height: height*0.2-60,
|
||||||
|
draggable: true,
|
||||||
|
dragBoundFunc:function (pos){
|
||||||
|
return {
|
||||||
|
x:pos.x,
|
||||||
|
y:75
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const bgGroup=new Konva.Group({
|
||||||
|
x:34,
|
||||||
|
y:0,
|
||||||
|
})
|
||||||
|
bgGroup.clipFunc(function(ctx) {
|
||||||
|
ctx.rect(4, 0, width*0.6, height*0.2-10);
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(bgGroup)
|
||||||
|
bgGroup.zIndex(0)
|
||||||
|
bgGroup.add(group)
|
||||||
|
|
||||||
|
const left2ImageObj=new Image()
|
||||||
|
left2ImageObj.src = require('@/assets/sliao/left2.png');
|
||||||
|
left2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:-116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const right2ImageObj=new Image()
|
||||||
|
right2ImageObj.src = require('@/assets/sliao/right2.png');
|
||||||
|
right2ImageObj.onload = function () {
|
||||||
|
const shape1 = new Konva.Image({
|
||||||
|
x: width*0.65,
|
||||||
|
y: 35,
|
||||||
|
width: 32,
|
||||||
|
height:120,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape1)
|
||||||
|
shape1.zIndex(1)
|
||||||
|
shape1.on('click touchstart',function (){
|
||||||
|
group.move({
|
||||||
|
x:116
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhbg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 8,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.66,
|
||||||
|
height:181,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
layer.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawItem(i,item){
|
||||||
|
const itemWith=111;
|
||||||
|
const itemHeight=108
|
||||||
|
|
||||||
|
const x=(i+1)*5+i*itemWith;
|
||||||
|
const qyGroup=new Konva.Group({
|
||||||
|
x:x,
|
||||||
|
y:10,
|
||||||
|
width:itemWith,
|
||||||
|
height:itemHeight,
|
||||||
|
})
|
||||||
|
qyGroup.setAttr('index',i)
|
||||||
|
qyGroup.setAttr('item',item)
|
||||||
|
group.add(qyGroup)
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/sliao/sljhItemBg.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:163,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
qyGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tlth=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 111,
|
||||||
|
height:34,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.tzbh
|
||||||
|
})
|
||||||
|
qyGroup.add(tlth)
|
||||||
|
|
||||||
|
const nameGroup=new Konva.Group({
|
||||||
|
x: 5,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
|
||||||
|
const nameImageObj1 = new Image();
|
||||||
|
nameImageObj1.src = require('@/assets/sliao/nameBg1.png');
|
||||||
|
nameImageObj1.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:105,
|
||||||
|
image: this,
|
||||||
|
});
|
||||||
|
nameGroup.add(shape)
|
||||||
|
shape.zIndex(0)
|
||||||
|
}
|
||||||
|
qyGroup.add(nameGroup)
|
||||||
|
|
||||||
|
const name1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'船号'
|
||||||
|
})
|
||||||
|
nameGroup.add(name1)
|
||||||
|
|
||||||
|
const name2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'批量'
|
||||||
|
})
|
||||||
|
nameGroup.add(name2)
|
||||||
|
|
||||||
|
const name3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'规格'
|
||||||
|
})
|
||||||
|
nameGroup.add(name3)
|
||||||
|
|
||||||
|
const name4=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 64.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'垛位'
|
||||||
|
})
|
||||||
|
nameGroup.add(name4)
|
||||||
|
|
||||||
|
const name5=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 86.5,
|
||||||
|
width: 38,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:'层数'
|
||||||
|
})
|
||||||
|
nameGroup.add(name5)
|
||||||
|
|
||||||
|
const infoGroup=new Konva.Group({
|
||||||
|
x: 43,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:105,
|
||||||
|
})
|
||||||
|
qyGroup.add(infoGroup)
|
||||||
|
|
||||||
|
const info1=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcCh
|
||||||
|
})
|
||||||
|
infoGroup.add(info1)
|
||||||
|
|
||||||
|
const info2=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 21,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:12,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.dcPl
|
||||||
|
})
|
||||||
|
infoGroup.add(info2)
|
||||||
|
|
||||||
|
const info3=new Konva.Text({
|
||||||
|
x: 0,
|
||||||
|
y: 43,
|
||||||
|
width: 65,
|
||||||
|
height:20,
|
||||||
|
fontSize:9,
|
||||||
|
fontStyle:'bold',
|
||||||
|
fill:'#fff',
|
||||||
|
align:'center',
|
||||||
|
verticalAlign:'middle',
|
||||||
|
text:item.wpgg
|
||||||
|
})
|
||||||
|
infoGroup.add(info3)
|
||||||
|
|
||||||
|
return qyGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
layer,group,drawItem
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
@ -1,18 +1,40 @@
|
|||||||
import Konva from "konva";
|
import Konva from "konva";
|
||||||
|
|
||||||
const title=function (width,height,title) {
|
const title=function (width,height,title) {
|
||||||
return new Konva.Text({
|
const group=new Konva.Group({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width,
|
||||||
|
height: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageObj = new Image();
|
||||||
|
imageObj.src = require('@/assets/kban/logo.png');
|
||||||
|
imageObj.onload = function () {
|
||||||
|
const shape = new Konva.Image({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width*0.86,
|
||||||
|
height:41,
|
||||||
|
image: imageObj,
|
||||||
|
});
|
||||||
|
group.add(shape)
|
||||||
|
}
|
||||||
|
|
||||||
|
const text=new Konva.Text({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 8,
|
y: 8,
|
||||||
width: width,
|
width: width,
|
||||||
height: 20,
|
height: 20,
|
||||||
lineHeight: 1,
|
|
||||||
stroke: 'blue',
|
|
||||||
strokeWidth: 2,
|
|
||||||
text: title,
|
text: title,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
fill:'#fff',
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
|
fontStyle:'bold'
|
||||||
})
|
})
|
||||||
|
group.add(text)
|
||||||
|
|
||||||
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
export default title
|
export default title
|
||||||
|
Loading…
Reference in new issue