<template>
  <div>
    <div class="unit" @click="showHunit(3)">
      <span class="unit-c" >管理主体</span>
      <div class="unit-num" v-for="(item,index) in glztList" :key="index" @click="showHunit" >
        <div >
          <LinearText
            style="display: inline-block"
            :text="item.sl"
            fontSize="28px"
          ></LinearText>
          <span>家</span>
        </div>
        <div>{{ item.sfzddw}}</div>
      </div>
      <!-- <div class="unit-num">
        <div>
          <LinearText
            style="display: inline-block"
            text="1223"
            fontSize="32px"
          ></LinearText>
          <span>家</span>
        </div>
        <div>重点单位</div>
      </div> -->
    </div>
    <div class="unit-echats" @click="showHunit(1)">
      <div class="unit-g">
        管理形式
        <unit3D :fierList="fierList" />
      </div>
    </div>
    <div class="unit maintenance" @click="showHunit(2)">
      <span class="unit-w">维保形式</span>
      <div class="unit-num" v-for="(item,index) in wbxsList" :key="index">
        <div>
          <LinearText
            style="display: inline-block"
            :text="item.sl"
            fontSize="28px"
          ></LinearText>
          <span>家</span>
        </div>
        <div>{{ item.wbxs }}</div>
      </div>
      <!-- <div class="unit-num">
        <div>
          <LinearText
            style="display: inline-block"
            text="323"
            fontSize="32px"
          ></LinearText>
          <span>家</span>
        </div>
        <div>自主维护</div>
      </div>
      <div class="unit-num">
        <div>
          <LinearText
            style="display: inline-block"
            text="323"
            fontSize="32px"
          ></LinearText>
          <span>家</span>
        </div>
        <div>无维保</div>
      </div> -->
    </div>
    
    <!-- 弹窗 -->
    <basic-modal top="120px" ref="higthModal" name="高层建筑管理">
      <higthList :flag="flag" :qx="qx" />
    </basic-modal>
  </div>
</template>

<script>
import unit3D from "@/components/unit3D.vue";
import { gettotalGlxx } from "@/api/management.js";
import higthList from "./higthList.vue";
export default {
  components: { unit3D,higthList },
  props: {
    qx: String,
    glztList:Array,
    wbxsList:Array,
  
  },
  data() {
    return {
      fierList: [],
      params: {
        pageSize: 100,
        pageNum: 1
      },
      flag:1
    };
  },
  watch: {
    qx() {
      this.manageList()
    }
  },
  methods:{
    manageList() {
      gettotalGlxx({...this.params, qx: this.qx === '重庆市' ? "" : this.qx}).then((res) => {
        this.fierList = res.data.rows.map((item) => {
          return {
            name: item.xfaqglxs,
            value: item.sl,
          };
        });
      });
    },
    
    // 弹窗
    showHunit(val){
      this.flag=val
      this.showModal("higthModal");

    }
  },
  created() {
    this.manageList();
  },
};
</script>

<style lang="less" scoped>
.unit {
  display: flex;
  margin: 5px 0 10px 10px;
  font-size: 18px;
  .unit-c {
    display: inline-block;
    margin: 25px 18px 0 0;
  }
  .unit-num {
    width: 146px;
    height: 72px;
    margin: 10px 10px;
    letter-spacing: 1px;
    padding: 5px 0 0 0;
    background-color: rgba(0, 163, 255, 0.3);
    color: #fff;
    text-align: center;
    font-size: 16px;
    line-height: 30px;
    padding-top: 10px;
    // 渐变
    // .num {
    //   font-size: 32px;
    //   font-weight: 600;
    //   color: rgb(105, 193, 208);
    // }
  }
}
.unit-echats {
  height: 150px;
}
.unit-w {
  width: 136px;

}
.unit-g {
  font-size: 18px;
  margin-left: 10px;
  padding-top: 10px;
}
.maintenance {
  margin-top: 30px;
  .unit-num{
    width: 180px !important;
  }
}
</style>
