From 978c45094f3f91adcb6ef0678aafd02cdd10da57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Fri, 6 Sep 2024 09:44:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=8C=E5=96=84=E6=8A=9B=E4=B8=B8=E6=B4=BE?= =?UTF-8?q?=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue | 2 +- src/views/zyjhzx/pwanpgong/comps/dw.js | 7 ++----- src/views/zyjhzx/pwanpgong/comps/person.js | 16 +++++++--------- src/views/zyjhzx/pwanpgong/comps/pgd.js | 13 +++++++------ src/views/zyjhzx/pwanpgong/index.vue | 5 ++++- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue b/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue index 56131f3..d2e4654 100644 --- a/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue +++ b/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue @@ -60,7 +60,7 @@ export default { for (const item of list) { const data={ id:item.id, - pwsgr:worker.userCode,//抛丸施工人员姓名 + pwry:worker.userCode,//抛丸施工人员姓名 } tmpArr.push(data) } diff --git a/src/views/zyjhzx/pwanpgong/comps/dw.js b/src/views/zyjhzx/pwanpgong/comps/dw.js index 45c30f9..8b9ab91 100644 --- a/src/views/zyjhzx/pwanpgong/comps/dw.js +++ b/src/views/zyjhzx/pwanpgong/comps/dw.js @@ -38,9 +38,6 @@ export default function (width,height){ width:width, height:height }) - group.on('click touchstart',function (){ - callback(index,dw[index].list) - }) const rect=new Konva.Rect({ x:0, @@ -59,10 +56,10 @@ export default function (width,height){ width: width, height: height, fill:'black', - text:item.name, + text:`${item.name}\n${item.list.length}张`, align:'center', verticalAlign:'middle', - fontSize:20 + fontSize:18 }) group.add(text) diff --git a/src/views/zyjhzx/pwanpgong/comps/person.js b/src/views/zyjhzx/pwanpgong/comps/person.js index 0198e0d..a36370b 100644 --- a/src/views/zyjhzx/pwanpgong/comps/person.js +++ b/src/views/zyjhzx/pwanpgong/comps/person.js @@ -9,8 +9,6 @@ export default function (width,height){ const layer=new Konva.Layer({ x:x, y:y, - width:_width, - height:_height }) const group=new Konva.Group({ @@ -32,7 +30,7 @@ export default function (width,height){ y:0, }) bgGroup.clipFunc(function(ctx) { - ctx.rect(0, 0, width-929, 182); + ctx.rect(6, 0, width*0.5+1, 182); }); const imageObj = new Image(); @@ -41,9 +39,9 @@ export default function (width,height){ const shape = new Konva.Image({ x: 0, y: 0, - offsetX:7, - width: 996*0.986, - height:182*0.986, + offsetX:6, + width: width*0.52-14, + height:182*0.8, image: this, }); bgGroup.add(shape) @@ -67,7 +65,7 @@ export default function (width,height){ const person=function (index,persons={}){ const width=120,height=110 - const x=index*120+(index+1)*5,y=5 + const x=index*125+(index+1)+14,y=5 const group=new Konva.Group({ x:x, y:y, @@ -100,7 +98,7 @@ export default function (width,height){ } group.on('click touchstart',function (){ - currentWork=item + currentWork=persons if (selectedShape){ selectedShape.hide() if (selectedShape===selectShape){ @@ -143,7 +141,7 @@ export default function (width,height){ } const text=new Konva.Text({ x:0, - y:0, + y:75, width:width, height:height, text: persons.userName, diff --git a/src/views/zyjhzx/pwanpgong/comps/pgd.js b/src/views/zyjhzx/pwanpgong/comps/pgd.js index efd3864..cd96c26 100644 --- a/src/views/zyjhzx/pwanpgong/comps/pgd.js +++ b/src/views/zyjhzx/pwanpgong/comps/pgd.js @@ -73,13 +73,13 @@ export default function (width,height){ group.add(sgdTitle) const dhTitle=new Konva.Text({ - x:0, + x:_width*0.7, y:50, width:_width-48, height:15, lineHeight:1, - text:'单号:PW_'+data.gdh, - align:'right', + text:`单号:${data.gdh?'PW_'+data.gdh:''}`, + align:'left', fontSize:12, }) group.add(dhTitle) @@ -230,7 +230,7 @@ export default function (width,height){ lineHeight:1, stroke:'black', strokeWidth:0.8, - text:data.jssj, + text:data.pwfkrq, fontSize:18, align:'center', verticalAlign:'middle' @@ -316,7 +316,7 @@ export default function (width,height){ lineHeight:1, stroke:'black', strokeWidth:0.8, - text:data.jssj, + text:data.pwpgrq, fontSize:18, align:'center', verticalAlign:'middle' @@ -475,7 +475,7 @@ export default function (width,height){ czbhGroup.add(czbhText) return czbhGroup } - const generateQRCode=function (text,group) { + const generateQRCode=function (text='',group) { const imgSize=118 const rect=new Konva.Rect({ x:385, @@ -485,6 +485,7 @@ export default function (width,height){ stroke:'black', strokeWidth:1, }) + console.log(text) group.add(rect) QRCode.toDataURL(text,{width:600,height:600,margin:1}) .then(url => { diff --git a/src/views/zyjhzx/pwanpgong/index.vue b/src/views/zyjhzx/pwanpgong/index.vue index de1cfce..e15fb43 100644 --- a/src/views/zyjhzx/pwanpgong/index.vue +++ b/src/views/zyjhzx/pwanpgong/index.vue @@ -33,6 +33,9 @@ export default { mounted() { this.initKonvaStage(); }, + created(){ + window.addEventListener('resize', this.initKonvaStage) + }, methods:{ initPgd(pgd={}){ const group=this.drawGd(pgd) @@ -98,7 +101,7 @@ export default { width:50%; height: auto; position: absolute; - top:230px; + top:200px; left:20px; border: none; margin: 0;