From 98a34bb01448e2b90053f1203d68a5b0f7f83e82 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, 9 Aug 2024 16:48:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=8C=E5=96=84=E4=B8=8A=E6=96=99=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/openapi.js | 3 + src/components/ProjectSelect/index.vue | 17 +- src/views/jhzx/components/ydjhzxgl/Tabs.vue | 162 +++++ src/views/jhzx/components/ydjhzxgl/Ydjh.vue | 174 ++++++ src/views/jhzx/components/ydjhzxgl/ydjh.js | 0 src/views/sliao/comps/SelectDemo.vue | 54 ++ src/views/sliao/comps/SliaoSearch.vue | 37 ++ src/views/sliao/comps/baifang.js | 180 ++++++ src/views/sliao/comps/container.js | 19 + src/views/sliao/comps/liliao.js | 82 +++ src/views/sliao/comps/person.js | 79 +++ src/views/sliao/comps/search.js | 56 ++ src/views/sliao/comps/sljh.js | 31 + src/views/sliao/comps/title.js | 18 + src/views/sliao/index.vue | 615 ++++-------------- src/views/sliao/index_sliao.vue | 658 ++++++++++++++++++++ 16 files changed, 1691 insertions(+), 494 deletions(-) create mode 100644 src/api/openapi.js create mode 100644 src/views/jhzx/components/ydjhzxgl/Tabs.vue create mode 100644 src/views/jhzx/components/ydjhzxgl/Ydjh.vue create mode 100644 src/views/jhzx/components/ydjhzxgl/ydjh.js create mode 100644 src/views/sliao/comps/SelectDemo.vue create mode 100644 src/views/sliao/comps/SliaoSearch.vue create mode 100644 src/views/sliao/comps/baifang.js create mode 100644 src/views/sliao/comps/container.js create mode 100644 src/views/sliao/comps/liliao.js create mode 100644 src/views/sliao/comps/person.js create mode 100644 src/views/sliao/comps/search.js create mode 100644 src/views/sliao/comps/sljh.js create mode 100644 src/views/sliao/comps/title.js create mode 100644 src/views/sliao/index_sliao.vue diff --git a/src/api/openapi.js b/src/api/openapi.js new file mode 100644 index 0000000..3cbceec --- /dev/null +++ b/src/api/openapi.js @@ -0,0 +1,3 @@ +import request from "@/utils/request"; + +export function openCzplBase(data) {return request({url: '/dmCzplpNew/openCzplBase', method: 'post', data})} diff --git a/src/components/ProjectSelect/index.vue b/src/components/ProjectSelect/index.vue index 8df683a..5e68f7f 100644 --- a/src/components/ProjectSelect/index.vue +++ b/src/components/ProjectSelect/index.vue @@ -4,8 +4,7 @@ diff --git a/src/views/jhzx/components/ydjhzxgl/Ydjh.vue b/src/views/jhzx/components/ydjhzxgl/Ydjh.vue new file mode 100644 index 0000000..0ddf11b --- /dev/null +++ b/src/views/jhzx/components/ydjhzxgl/Ydjh.vue @@ -0,0 +1,174 @@ + + diff --git a/src/views/jhzx/components/ydjhzxgl/ydjh.js b/src/views/jhzx/components/ydjhzxgl/ydjh.js new file mode 100644 index 0000000..e69de29 diff --git a/src/views/sliao/comps/SelectDemo.vue b/src/views/sliao/comps/SelectDemo.vue new file mode 100644 index 0000000..9984cba --- /dev/null +++ b/src/views/sliao/comps/SelectDemo.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/views/sliao/comps/SliaoSearch.vue b/src/views/sliao/comps/SliaoSearch.vue new file mode 100644 index 0000000..edf904f --- /dev/null +++ b/src/views/sliao/comps/SliaoSearch.vue @@ -0,0 +1,37 @@ + + + + diff --git a/src/views/sliao/comps/baifang.js b/src/views/sliao/comps/baifang.js new file mode 100644 index 0000000..6baa563 --- /dev/null +++ b/src/views/sliao/comps/baifang.js @@ -0,0 +1,180 @@ +import Konva from "konva"; + +const baifang=function (option={}) { + const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png') + const _width=width*0.4-50,_height=height*0.81 + const container=function (){ + const x=width*0.6+40,y=190 + + const group=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, + }) + + group.add(rect) + + return group + } + + const slGroup=container() + + const thatHeight=height + const gangban=function (index,str){ + const group=new Konva.Group({ + x:0, + y:thatHeight-260-index*40, + draggable:true + }) + + group.setAttr('index',index) + + slGroup.add(group) + const {x}=group.absolutePosition() + group.dragBoundFunc(function (pos){ + return { + x:x, + y:pos.y + } + }) + let _index=0 + + group.on('dragstart',function (){ + const {x,y}=this.absolutePosition() + this.startPos={ + x:x, + y:y + } + }) + group.on('dragmove',function (){ + if(_index===0){ + _index=this.getAttr('index') + } + this.zIndex(999) + const {y:thisY}=this.absolutePosition() + + const dir=thisY-this.startPos.y>0?-40:40 + + const children=slGroup.children + + for (const child of children) { + if (child===this){ + return + } + + const {y:thatY}=child.absolutePosition() + const moveDir=child.getAttr('moveDir')||0 + if (thisY>=thatY&&thisY<=thatY+40&&moveDir!==dir){ + child.setAttr('moveDir',dir); + _index+=dir>0?1:-1 + child.move({ + y:dir + }) + this.startPos={ + x:x, + y:thisY + } + } + + } + }) + + 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 + slGroup.destroyChildren() + handler(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:index, + align:'center', + verticalAlign:'middle', + }) + group.add(indexText) + + //层 规格,套料图 船号,上料日期,计划切割日期 + const imageObj = new Image(); + const imgSize=200 + imageObj.src = image; + 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:str+',12*2830*13090', + align:'center', + verticalAlign:'middle', + }) + group.add(gbText) + } + + const concent=new Konva.Text({ + x: imgSize+60, + y: 0, + width: imgSize+40, + height:40, + fill:'black', + text:'G175K-4,001,2302\n上料:2024/07/01,切割:2024/07/04', + align:'center', + verticalAlign:'middle', + }) + group.add(concent) + + return group + } + + function handler(slList){ + for (let i = 1; i <= slList.length; i++) { + const item=slList[i-1] + const _group=gangban(i,item,item.length) + slGroup.add(_group) + } + } + + handler(slList) + + return { + container,slGroup,handler + } +} + +export default baifang diff --git a/src/views/sliao/comps/container.js b/src/views/sliao/comps/container.js new file mode 100644 index 0000000..6df3bde --- /dev/null +++ b/src/views/sliao/comps/container.js @@ -0,0 +1,19 @@ +import Konva from "konva"; + +const container=function (width=0,height=0,container){ + const stage = new Konva.Stage({ + container: container, + width: width, + height: height, + }); + + const layer = new Konva.Layer(); + stage.add(layer) + layer.draw(); + + return { + stage,layer + } +} + +export default container diff --git a/src/views/sliao/comps/liliao.js b/src/views/sliao/comps/liliao.js new file mode 100644 index 0000000..b633ff1 --- /dev/null +++ b/src/views/sliao/comps/liliao.js @@ -0,0 +1,82 @@ +import Konva from "konva"; + +const liliao=function (width,height,dw,callback) { + + const _width=width*0.4,_height=height*0.81 + const container=function (){ + const x=width*0.2+30,y=190 + + const group=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, + }) + + group.add(rect) + + for (let i = 0; i < dw.length; i++) { + const item=dw[i] + const _group=duowei(i,item.name) + group.add(_group) + } + + return group + } + + const duowei=function (index,str){ + const alignSize=3 + const width=((_width-60)/alignSize),height=208 + const x=index%alignSize*width+index%alignSize*10+20,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10 + const group=new Konva.Group({ + x:x, + y:y, + width:width, + height:height + }) + group.on('click touchstart',function (){ + callback(index,dw[index].list) + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:width, + height:height, + stroke:'black', + strokeWidth:1, + }) + + group.add(rect) + + const text=new Konva.Text({ + x:0, + y:0, + width: width, + height: height, + fill:'black', + text:str, + align:'center', + verticalAlign:'middle', + fontSize:20 + }) + group.add(text) + + return group + } + + return { + container,duowei + } +} + +export default liliao diff --git a/src/views/sliao/comps/person.js b/src/views/sliao/comps/person.js new file mode 100644 index 0000000..036bedf --- /dev/null +++ b/src/views/sliao/comps/person.js @@ -0,0 +1,79 @@ +import Konva from "konva"; + +const workers=function (width,height,persons) { + + const _width=width*0.2,_height=height*0.81 + const container=function (){ + const x=20,y=190 + + const group=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, + }) + + group.add(rect) + + for (let i = 0; i < persons.length; i++) { + const item=persons[i] + const _group=person(i,item.name,persons.length) + group.add(_group) + } + + return group + } + + const person=function (index,str,img,size){ + const alignSize=2 + const width=((_width-30)/alignSize),height=108 + const x=index%alignSize*width+(index%alignSize+1)*10,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10 + const group=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, + }) + + group.add(rect) + + const text=new Konva.Text({ + x:0, + y:0, + width: width, + height: height, + fill:'black', + text:str, + align:'center', + verticalAlign:'middle', + fontSize:20 + }) + group.add(text) + + return group + } + + return { + container + } +} + +export default workers diff --git a/src/views/sliao/comps/search.js b/src/views/sliao/comps/search.js new file mode 100644 index 0000000..90dc4aa --- /dev/null +++ b/src/views/sliao/comps/search.js @@ -0,0 +1,56 @@ +import Konva from "konva"; + +const search=function (){ + const group=new Konva.Group({ + x:20, + y:50 + }) + const selectRect=new Konva.Rect({ + x: 0, + y: 0, + fill:'#ffffff', + width: 110, + height:20, + stroke:'black', + strokeWidth:1, + }) + group.add(selectRect) + const plRect=new Konva.Rect({ + x: 115, + y: 0, + fill:'#ffffff', + width: 110, + height:20, + stroke:'black', + strokeWidth:1, + }) + group.add(plRect) + + const fdRect=new Konva.Rect({ + x: 230, + y: 0, + fill:'#ffffff', + width: 110, + height:20, + stroke:'black', + strokeWidth:1, + }) + group.add(fdRect) + + const sljhrqRect=new Konva.Rect({ + x: 345, + y: 0, + fill:'#ffffff', + width: 115, + height:20, + stroke:'black', + strokeWidth:1, + }) + group.add(sljhrqRect) + + return { + group + } +} + +export default search diff --git a/src/views/sliao/comps/sljh.js b/src/views/sliao/comps/sljh.js new file mode 100644 index 0000000..e17f571 --- /dev/null +++ b/src/views/sliao/comps/sljh.js @@ -0,0 +1,31 @@ +import Konva from "konva"; + +let _width=0,_height=0 +export const sljh=function (width,height){ + + _width=width + _height=height + const layer=new Konva.Layer() + layer.draw() + + const group=new Konva.Group({ + x:15, + y:65, + width: width-30, + height: height*0.2-60, + stroke:'blue', + strokeWidth:1, + draggable: true, + dragBoundFunc:function (pos){ + return { + x:pos.x, + y:65 + } + }, + }); + layer.add(group) + + return { + layer,group + } +} diff --git a/src/views/sliao/comps/title.js b/src/views/sliao/comps/title.js new file mode 100644 index 0000000..711a4ae --- /dev/null +++ b/src/views/sliao/comps/title.js @@ -0,0 +1,18 @@ +import Konva from "konva"; + +const title=function (width,height,title) { + return new Konva.Text({ + x: 0, + y: 8, + width: width, + height: 20, + lineHeight: 1, + stroke: 'blue', + strokeWidth: 2, + text: title, + align: 'center', + fontSize: 32, + }) +} + +export default title diff --git a/src/views/sliao/index.vue b/src/views/sliao/index.vue index 9152ffb..d6dcf73 100644 --- a/src/views/sliao/index.vue +++ b/src/views/sliao/index.vue @@ -1,58 +1,35 @@ + +