|
|
|
<template>
|
|
|
|
<div class="container">
|
|
|
|
<div id="pwpg" class="pwpg" ref="pwpg"></div>
|
|
|
|
<LliaoPgd id="pwpgd" ref="llpgd" @initPgd="initPgd" :worker="getWorker" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import container from "./comps/container";
|
|
|
|
import drawTitle from './comps/title'
|
|
|
|
import workers from "./comps/person";
|
|
|
|
import drawDw from './comps/dw'
|
|
|
|
import drawPgd from './comps/pgd'
|
|
|
|
import {getBzryList} from "@/api/sjzx/bzzGL";
|
|
|
|
import {getPgd, getYcldw} from "@/api/zyjh";
|
|
|
|
import LliaoPgd from "@/views/zyjhzx/lliaopgong/comps/LliaoPgd.vue";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name:'PWanPGong',
|
|
|
|
components: {LliaoPgd},
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
title:'理 料 作 业 派 工',
|
|
|
|
width:0,
|
|
|
|
height:0,
|
|
|
|
stage:null,
|
|
|
|
layer:null,
|
|
|
|
pgdGroup:null,
|
|
|
|
drawGd:null,
|
|
|
|
getCurrentWorker:null,
|
|
|
|
workers:[],
|
|
|
|
setWorkers:null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.initKonvaStage();
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
initPgd(pgd={}){
|
|
|
|
const group=this.drawGd(pgd)
|
|
|
|
this.pgdGroup.add(group)
|
|
|
|
},
|
|
|
|
initDw(){
|
|
|
|
getYcldw({type:'llj'}).then(res=>{
|
|
|
|
const {container,dw}=drawDw(this.width,this.height)
|
|
|
|
const {bgGroup,group}=container()
|
|
|
|
this.layer.add(bgGroup)
|
|
|
|
|
|
|
|
for (let i=0;i<res.data.length;i++){
|
|
|
|
const item=res.data[i]
|
|
|
|
const dwGroup=dw(i,item)
|
|
|
|
group.add(dwGroup)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getWorker(){
|
|
|
|
return this.getCurrentWorker()
|
|
|
|
},
|
|
|
|
initWorkers(){
|
|
|
|
const that=this
|
|
|
|
getBzryList({resourcesCode:'4KB002'}).then(res=>{
|
|
|
|
const {container,person,getCurrentWorker}=workers(this.width,this.height)
|
|
|
|
this.getCurrentWorker=getCurrentWorker
|
|
|
|
const {layer,group}=container()
|
|
|
|
this.stage.add(layer)
|
|
|
|
this.workers=res.data
|
|
|
|
|
|
|
|
that.setWorkers(res.data)
|
|
|
|
for (let i=0;i<res.data.length;i++){
|
|
|
|
const item=res.data[i]
|
|
|
|
const worker=person(i,item)
|
|
|
|
worker.on('click touchstart',function (){
|
|
|
|
that.currentWorker=item
|
|
|
|
that.$refs.llpgd.initData(that.currentWorker.userCode,'41')
|
|
|
|
})
|
|
|
|
group.add(worker)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
initKonvaStage(){
|
|
|
|
this.width=this.$refs.pwpg.clientWidth
|
|
|
|
this.height=this.$refs.pwpg.clientHeight
|
|
|
|
const {stage,layer}=container(this.width,this.height,'pwpg')
|
|
|
|
this.stage=stage
|
|
|
|
this.layer=layer
|
|
|
|
|
|
|
|
const titel=drawTitle(this.width,this.height,this.title)
|
|
|
|
this.layer.add(titel)
|
|
|
|
|
|
|
|
this.initWorkers()
|
|
|
|
|
|
|
|
this.initDw()
|
|
|
|
|
|
|
|
const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
|
|
|
|
this.setWorkers=setWorkers
|
|
|
|
this.drawGd=drawGd
|
|
|
|
this.pgdGroup=pgdContainer()
|
|
|
|
this.layer.add(this.pgdGroup)
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#pwpgd {
|
|
|
|
width:50%;
|
|
|
|
height: auto;
|
|
|
|
position: absolute;
|
|
|
|
top:195px;
|
|
|
|
left:20px;
|
|
|
|
border: none;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#pwpg {
|
|
|
|
overflow: hidden;
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
aspect-ratio: 16/9;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container{
|
|
|
|
background: #ddd;
|
|
|
|
}
|
|
|
|
</style>
|