|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div id="pwpg" class="pwpg" ref="pwpg"></div>
|
|
|
|
|
<PWanPgd id="pwpgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" />
|
|
|
|
|
<PWanPgd id="pwpgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -14,8 +14,7 @@ import drawDw from './comps/dw'
|
|
|
|
|
import drawPgd from './comps/pgd'
|
|
|
|
|
import baifang from "./comps/baifang";
|
|
|
|
|
import drawCsd from './comps/csd'
|
|
|
|
|
import {getPgd, getYcldw} from "@/api/zyjh";
|
|
|
|
|
import liliao from "@/views/zyjhzx/sliao/comps/liliao";
|
|
|
|
|
import { getYcldw} from "@/api/zyjh";
|
|
|
|
|
import {getBzryList} from "@/api/sjzx/bzzGL";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -32,27 +31,56 @@ export default {
|
|
|
|
|
drawGd:null,
|
|
|
|
|
dw:[],
|
|
|
|
|
pgd:[],
|
|
|
|
|
currentDw:'',
|
|
|
|
|
currentDwIndex:'',
|
|
|
|
|
currentWorker:null,
|
|
|
|
|
setWorkers:null,
|
|
|
|
|
workers:null,
|
|
|
|
|
slGroup:null,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$socket.open()
|
|
|
|
|
this.wsSubscribe()
|
|
|
|
|
this.initKonvaStage();
|
|
|
|
|
},
|
|
|
|
|
sockets:{},
|
|
|
|
|
created(){
|
|
|
|
|
window.addEventListener('resize', this.initKonvaStage)
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
wsSubscribe(){
|
|
|
|
|
this.sockets.subscribe('pwComplete', data => {
|
|
|
|
|
if (this.currentDw&&this.currentDw.id===data.dwId) {
|
|
|
|
|
if (this.slGroup){
|
|
|
|
|
this.slGroup.destroyChildren()
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.dw[this.currentDwIndex].list.length; i++) {
|
|
|
|
|
const item=this.dw[this.currentDwIndex].list[i]
|
|
|
|
|
console.log(123)
|
|
|
|
|
console.log(item.czbh===data.czbh&&item.pl===data.pl&&item.tlth===data.tlth)
|
|
|
|
|
if (item.czbh===data.czbh&&item.pl===data.pl&&item.tlth===data.tlth){
|
|
|
|
|
this.dw[this.currentDwIndex].list.splice(i,1)
|
|
|
|
|
console.log(this.dw[this.currentDwIndex].list)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.drawBaiFang(this.dw[this.currentDwIndex].list)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
initPgd(pgd={}){
|
|
|
|
|
const group=this.drawGd(pgd)
|
|
|
|
|
this.pgdGroup.add(group)
|
|
|
|
|
},
|
|
|
|
|
initBaiFang(index,list){
|
|
|
|
|
initBaiFang(index,dw){
|
|
|
|
|
if (this.slGroup){
|
|
|
|
|
this.slGroup.destroyChildren()
|
|
|
|
|
}
|
|
|
|
|
this.canSl=true
|
|
|
|
|
this.currentDw=dw
|
|
|
|
|
this.currentDwIndex=index
|
|
|
|
|
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:list})
|
|
|
|
|
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:dw.list})
|
|
|
|
|
this.slGroup=slGroup
|
|
|
|
|
this.drawBaiFang=handler
|
|
|
|
|
this.layer.add(slGroup)
|
|
|
|
@ -65,6 +93,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.layer.add(group)
|
|
|
|
|
|
|
|
|
|
this.dw=res.data
|
|
|
|
|
for (let i=0;i<res.data.length;i++){
|
|
|
|
|
const item=res.data[i]
|
|
|
|
|
const dwGroup=dw(i,item)
|
|
|
|
@ -78,7 +107,9 @@ export default {
|
|
|
|
|
const {container,person}=workers(this.width,this.height)
|
|
|
|
|
const group=container()
|
|
|
|
|
this.layer.add(group)
|
|
|
|
|
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)
|
|
|
|
@ -101,17 +132,18 @@ export default {
|
|
|
|
|
const titel=drawTitle(this.width,this.height,this.title)
|
|
|
|
|
this.layer.add(titel)
|
|
|
|
|
|
|
|
|
|
this.initWorkers()
|
|
|
|
|
|
|
|
|
|
this.initDw()
|
|
|
|
|
|
|
|
|
|
const {container:pgdContainer,drawGd}=drawPgd(this.width,this.height)
|
|
|
|
|
const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
|
|
|
|
|
this.setWorkers=setWorkers
|
|
|
|
|
this.drawGd=drawGd
|
|
|
|
|
this.pgdGroup=pgdContainer()
|
|
|
|
|
this.layer.add(this.pgdGroup)
|
|
|
|
|
|
|
|
|
|
const csdGroup=drawCsd(this.width,this.height)
|
|
|
|
|
this.layer.add(csdGroup)
|
|
|
|
|
|
|
|
|
|
this.initWorkers()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|