1.增加上料计划执行

master
董哲奇 11 months ago
parent 53da8f1218
commit d0e846a329

@ -53,6 +53,7 @@
"vue-print-nb": "^1.7.5", "vue-print-nb": "^1.7.5",
"vue-router": "3.0.2", "vue-router": "3.0.2",
"vue-splitpane": "1.0.4", "vue-splitpane": "1.0.4",
"vue-worker": "^1.2.1",
"vuedraggable": "2.20.0", "vuedraggable": "2.20.0",
"vuex": "3.1.0", "vuex": "3.1.0",
"vxe-table": "^3.7.5", "vxe-table": "^3.7.5",
@ -81,6 +82,7 @@
"less-loader": "5.0.0", "less-loader": "5.0.0",
"lint-staged": "8.1.5", "lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3", "mockjs": "1.0.1-beta3",
"npm": "^10.8.2",
"plop": "2.3.0", "plop": "2.3.0",
"runjs": "4.3.2", "runjs": "4.3.2",
"sass": "1.26.2", "sass": "1.26.2",

@ -110,6 +110,9 @@ dependencies:
vue-splitpane: vue-splitpane:
specifier: 1.0.4 specifier: 1.0.4
version: 1.0.4 version: 1.0.4
vue-worker:
specifier: ^1.2.1
version: 1.2.1
vuedraggable: vuedraggable:
specifier: 2.20.0 specifier: 2.20.0
version: 2.20.0 version: 2.20.0
@ -190,6 +193,9 @@ devDependencies:
mockjs: mockjs:
specifier: 1.0.1-beta3 specifier: 1.0.1-beta3
version: 1.0.1-beta3 version: 1.0.1-beta3
npm:
specifier: ^10.8.2
version: 10.8.2
plop: plop:
specifier: 2.3.0 specifier: 2.3.0
version: 2.3.0 version: 2.3.0
@ -9659,6 +9665,81 @@ packages:
which: 1.3.1 which: 1.3.1
dev: true dev: true
/npm@10.8.2:
resolution: {integrity: sha512-x/AIjFIKRllrhcb48dqUNAAZl0ig9+qMuN91RpZo3Cb2+zuibfh+KISl6+kVVyktDz230JKc208UkQwwMqyB+w==}
engines: {node: ^18.17.0 || >=20.5.0}
hasBin: true
dev: true
bundledDependencies:
- '@isaacs/string-locale-compare'
- '@npmcli/arborist'
- '@npmcli/config'
- '@npmcli/fs'
- '@npmcli/map-workspaces'
- '@npmcli/package-json'
- '@npmcli/promise-spawn'
- '@npmcli/redact'
- '@npmcli/run-script'
- '@sigstore/tuf'
- abbrev
- archy
- cacache
- chalk
- ci-info
- cli-columns
- fastest-levenshtein
- fs-minipass
- glob
- graceful-fs
- hosted-git-info
- ini
- init-package-json
- is-cidr
- json-parse-even-better-errors
- libnpmaccess
- libnpmdiff
- libnpmexec
- libnpmfund
- libnpmhook
- libnpmorg
- libnpmpack
- libnpmpublish
- libnpmsearch
- libnpmteam
- libnpmversion
- make-fetch-happen
- minimatch
- minipass
- minipass-pipeline
- ms
- node-gyp
- nopt
- normalize-package-data
- npm-audit-report
- npm-install-checks
- npm-package-arg
- npm-pick-manifest
- npm-profile
- npm-registry-fetch
- npm-user-validate
- p-map
- pacote
- parse-conflict-json
- proc-log
- qrcode-terminal
- read
- semver
- spdx-expression-parse
- ssri
- supports-color
- tar
- text-table
- tiny-relative-date
- treeverse
- validate-npm-package-name
- which
- write-file-atomic
/nprogress@0.2.0: /nprogress@0.2.0:
resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==}
dev: false dev: false
@ -11801,6 +11882,10 @@ packages:
is-arrayish: 0.3.2 is-arrayish: 0.3.2
dev: true dev: true
/simple-web-worker@1.2.0:
resolution: {integrity: sha512-+okbi2fpRokCZoCgdWqb+2kOykkdcSnLkdz54EivlqACst5TSqJRLXPiilAjlkwW9Z0SRwev74qKMc+3jIVL0g==}
dev: false
/sisteransi@1.0.5: /sisteransi@1.0.5:
resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
dev: true dev: true
@ -13298,6 +13383,12 @@ packages:
resolution: {integrity: sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==} resolution: {integrity: sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==}
dev: true dev: true
/vue-worker@1.2.1:
resolution: {integrity: sha512-feu5cWI0ztoSSIZxVvaCWLBEKUG1pCJqVkKmWvyrkUfOqMuOkklmY8iX5kaJTSsRuvVFPEkTExkMXM6+Nkec1Q==}
dependencies:
simple-web-worker: 1.2.0
dev: false
/vue@2.6.10: /vue@2.6.10:
resolution: {integrity: sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==} resolution: {integrity: sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -85,6 +85,9 @@ import dataV from '@jiaminghi/data-view'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(dataV) Vue.use(dataV)
import VueWorker from 'vue-worker' // Web worker插件
Vue.use(VueWorker)
// register global utility filters // register global utility filters
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]) Vue.filter(key, filters[key])

@ -15,7 +15,23 @@ export default {
{name:'张三01',imgSrc:require("@/assets/user.png"),yhdm:'张三01'}, {name:'张三01',imgSrc:require("@/assets/user.png"),yhdm:'张三01'},
{name:'张三02',imgSrc:require("@/assets/user.png"),yhdm:'张三02'}, {name:'张三02',imgSrc:require("@/assets/user.png"),yhdm:'张三02'},
{name:'张三03',imgSrc:require("@/assets/user.png"),yhdm:'张三03'}, {name:'张三03',imgSrc:require("@/assets/user.png"),yhdm:'张三03'},
{name:'张三04',imgSrc:require("@/assets/user.png"),yhdm:'张三04'} {name:'张三04',imgSrc:require("@/assets/user.png"),yhdm:'张三04'},
// {name:'01',imgSrc:require("@/assets/user.png"),yhdm:'01'},
// {name:'02',imgSrc:require("@/assets/user.png"),yhdm:'02'},
// {name:'03',imgSrc:require("@/assets/user.png"),yhdm:'03'},
// {name:'04',imgSrc:require("@/assets/user.png"),yhdm:'04'},
// {name:'01',imgSrc:require("@/assets/user.png"),yhdm:'01'},
// {name:'02',imgSrc:require("@/assets/user.png"),yhdm:'02'},
// {name:'03',imgSrc:require("@/assets/user.png"),yhdm:'03'},
// {name:'04',imgSrc:require("@/assets/user.png"),yhdm:'04'},
// {name:'01',imgSrc:require("@/assets/user.png"),yhdm:'01'},
// {name:'02',imgSrc:require("@/assets/user.png"),yhdm:'02'},
// {name:'03',imgSrc:require("@/assets/user.png"),yhdm:'03'},
// {name:'04',imgSrc:require("@/assets/user.png"),yhdm:'04'},
// {name:'01',imgSrc:require("@/assets/user.png"),yhdm:'01'},
// {name:'02',imgSrc:require("@/assets/user.png"),yhdm:'02'},
// {name:'03',imgSrc:require("@/assets/user.png"),yhdm:'03'},
// {name:'04',imgSrc:require("@/assets/user.png"),yhdm:'04'},
] ]
} }
}, },
@ -94,6 +110,5 @@ export default {
width: 100%; width: 100%;
height: 13vh; height: 13vh;
aspect-ratio: 16/9; aspect-ratio: 16/9;
margin-left: 4%;
} }
</style> </style>

@ -108,6 +108,5 @@ export default {
width: 90%; width: 90%;
height: 75.5vh; height: 75.5vh;
aspect-ratio: 16/9; aspect-ratio: 16/9;
margin-left: 4%;
} }
</style> </style>

@ -11,9 +11,7 @@ export default {
layer:'', layer:'',
width:'', width:'',
height:'', height:'',
msgList:[ msgList:[],
],
ljList:[ ljList:[
{name:'张三01',imgSrc:require("@/assets/user.png"),yhdm:'张三01'}, {name:'张三01',imgSrc:require("@/assets/user.png"),yhdm:'张三01'},
] ]
@ -150,6 +148,5 @@ export default {
width: 95%; width: 95%;
height: 13vh; height: 13vh;
aspect-ratio: 16/9; aspect-ratio: 16/9;
margin-left: 4%;
} }
</style> </style>

@ -11,24 +11,184 @@ export default {
title:'上 料 作 业 区', title:'上 料 作 业 区',
stage:null, stage:null,
layer:null, layer:null,
width:'',
height:'',
gbImage:require('@/assets/gb.png'),
sljhGroup:null, sljhGroup:null,
sljhList:[],// sljhList:[],//
qyList:[],//, slGroup:'',
msg:'123ada地方多少', slList:'',
dwGroup:'',
qyList:[//,
{
name:'一区',
dw:[
{
name:'一剁',
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
},
{
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',]
}
]
},
],
msg:'板材1放入一剁三层',
worker:'',
} }
}, },
created(){
const actions = [
{
message: "fn1", // messagefunc
func: (params1, params2) => {
console.log("params参数-->", params1, params2);
function fib(n) {
if ((n == 1) | (n == 2)) {
return 1;
} else {
return fib(n - 1) + fib(n - 2);
}
}
return fib(30);
},
},
{
message: "fn2",
func: () => {
function fib(n) {
if ((n == 1) | (n == 2)) {
return 1;
} else {
return fib(n - 1) + fib(n - 2);
}
}
return fib(30);
},
},
{
message: "fn3",
func: () => {
function fib(n) {
if ((n == 1) | (n == 2)) {
return 1;
} else {
return fib(n - 1) + fib(n - 2);
}
}
// throw ",,.catch"; // (Promise.all())
return fib(30);
},
},
];
// 2. createworkerdata便使
this.worker = this.$worker.create(actions);
},
mounted() { mounted() {
console.time("多个线程计算用时1")
this.worker
.postAll()
.then((res) => {
console.timeEnd("多个线程计算用时1");
console.log("res", res); // [267914296, 433494437, 701408733]
this.loadingOne = false;
})
.catch((err) => {
console.timeEnd("多个线程计算用时1");
console.log("err", err);
this.loadingOne = false;
});
this.initKonvaStage(); this.initKonvaStage();
//fixme //fixme
this.drawMsg() this.drawMsg()
this.drawSljhItem([ this.drawSljhItem([
{czbh:'123',pl:'001',tzbh:'123123121',perQy:'一区',perDw:'三层'}, {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'123',pl:'001',tzbh:'123123122',perQy:'一区',perDw:'三层'}, {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'123',pl:'001',tzbh:'123123123',perQy:'一区',perDw:'三层'}, {czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
]) ])
}, },
methods: { methods: {
//
drawSlItem(slList){
console.log(slList.length)
for (let i = 1; i <=slList.length; i++) {
const gb=slList[i-1]
const group=new Konva.Group({
x:0,
y:this.height-260-i*40,
})
this.slGroup.add(group)
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){ drawSljhItem(list){
const itemWith=80; const itemWith=80;
@ -58,89 +218,179 @@ export default {
lineHeight:1, lineHeight:1,
stroke:'blue', stroke:'blue',
strokeWidth:0.1, strokeWidth:0.1,
text:item.czbh+'\n'+item.pl+'\n'+item.tzbh+'\n建议位置\n'+item.perQy+'\n'+item.perDw, text:item.czbh+'\n'+item.pl+'\n'+item.tzbh+'\n建议位置\n'+item.perQy+'\n'+item.perDw+'\n'+item.perCeng,
align:'center', align:'center',
verticalAlign:'middle' verticalAlign:'middle',
}) })
qyGroup.add(text) qyGroup.add(text)
console.log(this.sljhGroup)
this.sljhGroup.add(qyGroup) this.sljhGroup.add(qyGroup)
} }
}, },
initKonvaStage(){ initKonvaStage(){
this.width=this.$refs.sliao.clientWidth
this.height=this.$refs.sliao.clientHeight
this.stage = new Konva.Stage({ this.stage = new Konva.Stage({
container: "sliao", container: "sliao",
width: this.$refs.sliao.clientWidth, width: this.width,
height: this.$refs.sliao.clientHeight, height: this.height,
}); });
//pointer
//this.stage.container().style.cursor = "sw-resize"; //this.stage.container().style.cursor = "sw-resize";
this.layer = new Konva.Layer(); this.layer = new Konva.Layer();
this.stage.add(this.layer) this.stage.add(this.layer)
this.layer.draw();
this.drawTitle() this.drawTitle()
// //
// //
this.drawSljh() this.drawSljh()
// //
this.drawDw() this.drawQy()
// //
this.drawSl(); this.drawSl();
// //
this.drawYd(); this.drawYd();
this.layer.draw();
}, },
// //
drawYd(){ drawYd(){
this.drawContainer({ this.drawContainer({
x:15+this.$refs.sliao.clientWidth*0.6+10, x:15+this.width*0.6-15+5,
y:this.$refs.sliao.clientHeight-this.$refs.sliao.clientHeight*0.8+10, y:this.height-this.height*0.8+10,
width: this.$refs.sliao.clientWidth*0.38-2, width: this.width*0.4-20,
height: this.$refs.sliao.clientHeight*0.8-20, height: this.height*0.8-20,
stroke:'blue', stroke:'blue',
strokeWidth:1, strokeWidth:1,
}) })
}, },
// //
drawSl(){ drawSl(){
this.drawContainer({ const {qyGroup}=this.drawContainer({
x:15+this.$refs.sliao.clientWidth*0.2+5, x:15+this.width*0.2+5,
y:this.$refs.sliao.clientHeight-this.$refs.sliao.clientHeight*0.8+10, y:this.height-this.height*0.8+10,
width: this.$refs.sliao.clientWidth*0.4, width: this.width*0.4-20,
height: this.$refs.sliao.clientHeight*0.8-20, height: this.height*0.8-20,
stroke:'blue', stroke:'blue',
strokeWidth:1, 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)=>{
console.log(evt.target)
this.slGroup.destroyChildren()
this.drawSlItem(dw.list)
})
_group.add(group)
}
}, },
// //
drawDw(){ drawQy(){
this.drawContainer({ const {quRet,qyGroup}=this.drawContainer({
x:15, x:15,
y:this.$refs.sliao.clientHeight-this.$refs.sliao.clientHeight*0.8+10, y:this.height-this.height*0.8+10,
width: this.$refs.sliao.clientWidth*0.2, width: this.width*0.2,
height: this.$refs.sliao.clientHeight*0.8-20, height: this.height*0.8-20,
stroke:'blue', stroke:'blue',
strokeWidth:1, strokeWidth:1,
}) })
console.log(111)
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)=>{
console.log(evt.target)
this.drawDw(qyGroup,qy,size)
})
qyGroup.add(group)
}
}, },
// //
drawSljh(){ drawSljh(){
const {quRet,qyGroup}=this.drawContainer({ const {quRet,qyGroup}=this.drawContainer({
x:15, x:15,
y:65, y:65,
width: this.$refs.sliao.clientWidth-30, width: this.width-30,
height: this.$refs.sliao.clientHeight*0.2-60, height: this.height*0.2-60,
stroke:'blue', stroke:'blue',
strokeWidth:1, strokeWidth:1,
}) })
qyGroup.on('click touchstart',(evt)=>{
console.log(evt)
})
this.sljhGroup=qyGroup this.sljhGroup=qyGroup
}, },
drawMsg(){ drawMsg(){
this.drawText({ this.drawText({
x:15, x:15,
y:50, y:50,
width:this.$refs.sliao.clientWidth-30, width:this.width-30,
height:20, height:20,
lineHeight:1, lineHeight:1,
stroke:'black', stroke:'black',
@ -153,7 +403,7 @@ export default {
this.drawText({ this.drawText({
x:15, x:15,
y:8, y:8,
width:this.$refs.sliao.clientWidth-30, width:this.width-30,
height:20, height:20,
lineHeight:1, lineHeight:1,
stroke:'blue', stroke:'blue',

Loading…
Cancel
Save