<template>
  <VxeGrid v-bind="gridOptions" @cell-click="cellClick" />
</template>

<script>
import paoWanPgdConfig from './pgdTable'
import {getPgd} from "@/api/zyjh";
export default {
  name:'LLiaoPgd',
  props:{
    workers:{
      type:Array,
      default:[]
    }
  },
  data(){
    return{
      gridOptions:{},
      setExt:null,
    }
  },
  created(){
    const {options,columns,setExt}=paoWanPgdConfig()
    this.setExt=setExt
    this.gridOptions=options
    this.gridOptions.columns=columns
  },
  methods:{
    initData(worker,zt){
      getPgd({user:worker,zt:zt,field:'pwry'}).then(res=>{
        this.gridOptions.data=res.data
        this.setExt('workers',this.$props.workers)
      })
    },
    cellClick({row}){
      this.$emit('initPgd',row)
    }
  }
}
</script>
