<template>
  <div class="hidden-danger-detection">
    <div class="hidden-danger-detection_bottom">
      <div class="item">
        <pcNum
          :ScheduletList="ScheduletList"
          :list="list"
          :allNum="allNum"
          :pcdsNum="pcdsNum"
          :wzgsNum="wzgsNum"
          :yzgsNum="yzgsNum"
          :qy="qy"
        />
      </div>
      <div class="item">
        <HiddenDangerType :yhType="yhType" :qy='qy' />
      </div>
    </div>
  </div>
</template>

<script>
import HiddenDangerType from "./HiddenDangerType.vue";
import pcNum from './pcNum.vue'
import { getPcjd,getYhlx,getYhzt } from "@/api/index.js";
export default {
  name: "HiddenDangerDetection",
  components: {
    HiddenDangerType,
    pcNum
  },
  props:{
    qy:String
  },
  data(){
    return{
      yhds:'',
      yhgs:'',
     yhType:[],
      ypclds:'',
      pcdsNum:'',
      yzgsNum:'',
      allNum:'',
      wzgsNum:'',
      list:{},
      ScheduletList:{},
           // 传参
           params:{
        pageSize:100,
        pageNum:1,
      },

    }
  },
  watch:{
    qy(){
      this.getNum()
    this.getType()
    this.getSchedulet()
    }
  },
  methods:{
    // .map(item=>{
    //       this.yhds=item.yhds+'/'+item.yhgs
    //       this.yhgs=item.ypclds+'/'+item.ypcldcs
    //     })
    getNum(){
      getPcjd({...this.params,qy:this.qy==='重庆市'?'':this.qy}).then(res=>{
        this.list=res.data.rows[0]
        this.allNum=this.list.yhds+'/'+this.list.yhgs
        this.pcdsNum=this.list.ypclds+'/'+this.list.ypcldcs
        this.yzgsNum=this.list.yzgyhlds+'/'+this.list.yzgyhs
        this.wzgsNum=this.list.wzgyhlds+'/'+this.list.wzgyhs
        console.log('------list66666',this.list);
      })
    },
    // 隐患类型
    getType(){
      getYhlx({...this.params,qy:this.qy==='重庆市'?'':this.qy}).then(res=>{
        const data = res.data.rows[0];

        if (data) {
          this.yhType= [
             {
                value: data.xfss,
                name: "消防设施",
              },
              {
                value: data.smtd,
                name: "生命通道",
              },
              {
                value: data.ydyq,
                name: "用电用气",
              },
              {
                value: data.xfgl,
                name: "消防管理",
              },
          ]
        }
      })
    },
    // 整改进度
    getSchedulet(){
      getYhzt({...this.params,qy:this.qy==='重庆市'?'':this.qy}).then(res=>{
        const data = res.data.rows[0];
        if (data) {
         this.ScheduletList.noUnm=data.djh+data.dzg
         this.ScheduletList=data
        }
    })
    }
  },
  created(){
    this.getNum()
    this.getType()
    this.getSchedulet()
  }
};
</script>

<style scoped lang="less">
.hidden-danger-detection_top {
  margin: 5px 4px;
  background-color: rgba(0, 213, 255, 0.12);
  padding: 8px;
  display: flex;
  align-items: center;
  .hidden-danger-detection_top_inner {
    display: flex;
  }
}

.hidden-danger-detection_bottom {
  display: flex;
  margin: 0px 4px;
  gap: 4px;
  .item {
    background-color: rgba(0, 213, 255, 0.12);
    height: 291px;
    &:nth-child(1) {
      width: 200px;
    }
    &:nth-child(2) {
      width: 234px;
    }
  }
}
</style>
