<template>
  <div>
    <div class="num-box">
      <!-- 物联网建筑数量 -->
      <div class="build-num">
        <div class="build-all">
          <span
            ><img src="@/assets/images/Vector (3).png" alt="" />
            <span>已接入物联网建筑数</span>
          </span>
          <span class="num">{{ iotList?.wlwlds }}</span>
          <span class="build-line">栋</span>
        </div>
      </div>
      <!-- 设备数 -->

      <div class="point-num">
        <div class="build-num" style="background: none; margin-bottom: 10px">
          <div class="build">
            <span
              >点位总数 <span class="num">{{ iotList?.jrsbzs }}</span> 个
            </span>
            <span
              >在线 <span class="online">{{ iotList?.jrsbzxs }}</span
              >个
            </span>
            <span
              >告警
              <span class="warning">{{
                iotList?.jrsbgjgs ? iotList?.jrsbgjgs : 0
              }}</span
              >个
            </span>
          </div>
        </div>
        <div>
          <span class="onlines on-line" style="margin: 0px 20px"> 在线</span>
          <span class="offlines on-line gj-bnt">告警</span>
        </div>
        <div class="pressure">
          <!-- 水压 -->
          <div class="pressure-num">
            <div
              class="pressure-bg"
              @click="
                toIot({
                  name: '水压监测',
                  zt: '',
                  isShowAlarm: null,
                  onLineOrder: 1,
                  isShowOnLineAndAlarm: '',
                })
              "
            >
              {{ frieList.syzs ? frieList.syzs : 0
              }}<span style="margin-right: 1px"
                ><span style="margin-right: 1px">/</span></span
              >
              <span>{{ frieList.syds ? frieList.syds : 0 }}</span>
              <div style="font-size: 12px; margin-top: 5px">（个/栋）</div>
            </div>

            <ul class="pressure-list">
              <li style="font-size: 12px; margin: 6px 0 0 10px">
                {{ listNum[0] }}
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '水压监测',
                    zt: '在线',
                    onLineOrder: '',
                    isShowAlarm: '',
                    isShowOnLineAndAlarm: '',
                  })
                "
              >
                <!-- 在线 -->
                <span class="onlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275.png"
                  alt=""
                /> -->
                <span class="bumer" style="font-size: 16px; margin-left: 2px">
                  {{ frieList.syzxs ? frieList.syzxs : 0
                  }}<span style="margin-right: 1px">/</span>
                  <span>{{ frieList.syzxlds ? frieList.syzxlds : 0 }}</span>
                  <span class="unit" style="font-size: 12px">(个/栋)</span>
                </span>
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '水压监测',
                    zt: '',
                    isShowAlarm: '是',
                    onLineOrder: 1,
                    isShowOnLineAndAlarm: 1,
                  })
                "
              >
                <!-- 离线 -->
                <span class="offlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275 (1).png"
                  alt=""
                /> -->
                <span class="bumer" style="margin-left: 2px">
                  {{ frieList.sygjs ? frieList.sygjs : 0
                  }}<span style="margin-right: 1px">/</span>
                  <span>{{ frieList.sygjlds ? frieList.sygjlds : 0 }}</span>
                  <span style="font-size: 12px">(个/栋)</span>
                </span>
                <!-- <span class="unit">(个/栋)</span> -->
              </li>
            </ul>
          </div>
          <!--点气火灾  -->
          <div
            class="pressure-num"
          >
            <div class="pressure-bg" @click="
              toIot({
                name: '电气火灾监测',
                zt: '',
                isShowAlarm: null,
                onLineOrder: 1,
                isShowOnLineAndAlarm: '',
              })
            ">
              {{ frieList.dqhzzs ? frieList.dqhzzs : 0
              }}<span style="margin-right: 1px">/</span>
              <span>{{ frieList.dqhzds ? frieList.dqhzds : 0 }}</span>
              <div style="font-size: 12px; margin-top: 5px">（个/栋）</div>
            </div>

            <ul class="pressure-list">
              <li style="font-size: 12px; margin: 6px 0 0 10px">
                {{ listNum[1] }}
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '电气火灾监测',
                    zt: '在线',
                    isShowAlarm: '',
                    onLineOrder: '',
                    isShowOnLineAndAlarm: '',
                  })
                "
              >
                <!-- 在线 -->
                <span class="onlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275.png"
                  alt=""
                /> -->
                <span class="bumer" style="font-size: 16px; margin-left: 2px"
                  >{{ frieList.dqhzzxs ? frieList.dqhzzxs : 0
                  }}<span style="margin-right: 1px">/</span>
                  <span>{{ frieList.dqhzzxlds ? frieList.dqhzzxlds : 0 }}</span>
                  <span class="unit" style="font-size: 12px">(个/栋)</span>
                </span>
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '电气火灾监测',
                    zt: '',
                    isShowAlarm: '是',
                    onLineOrder: 1,
                    isShowOnLineAndAlarm: 1,
                  })
                "
              >
                <!-- 离线 -->
                <span class="offlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275 (1).png"
                  alt=""
                /> -->
                <span class="bumer" style="margin-left: 2px"
                  >{{ frieList.dqhzgjs ? frieList.dqhzgjs : 0
                  }}<span style="margin-right: 1px">/</span>
                  <span>{{ frieList.dqhzgjlds ? frieList.dqhzgjlds : 0 }}</span>
                  <span style="font-size: 12px">(个/栋)</span>
                </span>
                <!-- <span class="unit">(个/栋)</span> -->
              </li>
            </ul>
          </div>
          <!-- 生命通道 -->
          <div
            class="pressure-num"
          >
            <div class="pressure-bg" 
            @click="
              toIot({
                name: '生命通道监测',
                zt: '',
                isShowAlarm: null,
                onLineOrder: 1,
                isShowOnLineAndAlarm: '',
              })
            ">
              {{ frieList.smtdzs ? frieList.smtdzs : 0
              }}<span style="margin-right: 1px"></span>
              <!-- <span>{{ frieList.smtdlds ? frieList.smtdlds : 0 }}</span> -->
              <div style="font-size: 12px; margin-top: 5px">（个）</div>
            </div>

            <ul class="pressure-list">
              <li style="font-size: 12px; margin: 6px 0 0 10px">
                {{ listNum[2] }}
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '生命通道监测',
                    zt: '在线',
                    onLineOrder: '',
                    isShowAlarm: '',
                    isShowOnLineAndAlarm: '',
                  })
                "
              >
                <!-- 在线 -->
                <span class="onlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275.png"
                  alt=""
                /> -->
              <span class="bumer" style="font-size: 16px; margin-left: 2px" 
                  >{{ frieList.smtdzxs ? frieList.smtdzxs : 0 }} 
                  <span style="margin-right: 1px">/</span>
                  <span>{{ frieList.smtdzxlds ? frieList.smtdzxlds : 0 }}</span>
                  <span class="unit" style="font-size: 12px">(个)</span>
                </span>
              </li>
              <li
                class="pressure-line"
                @click="
                  toIot({
                    name: '生命通道监测',
                    zt: '',
                    isShowAlarm: '是',
                    onLineOrder: 1,
                    isShowOnLineAndAlarm: 1,
                  })
                "
              >
                <!-- 离线 -->
                <span class="offlines on-line"></span>
                <!-- <img
                  class="pressure-img"
                  src="../../assets/images/Ellipse 275 (1).png"
                  alt=""
                /> -->
                <span class="bumer" style="margin-left: 2px"
                  >{{ frieList.smtdgjs ? frieList.smtdgjs : 0 }}
                  <!-- <span style="margin-right: 1px">/</span> -->
                  <!-- <span>{{ frieList.smtdgjlds ? frieList.smtdgjlds : 0 }}</span> -->
                  <span style="font-size: 12px">(个)</span>
                </span>
                <!-- <span class="unit">(个/栋)</span> -->
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <basic-modal top="120px" ref="feirModal1">
      <fxfbCont :qy="qy" :sbType="sbType" />
      <ZhxfModalHeader slot="title" />
    </basic-modal>
  </div>
</template>

<script>
import fxfbCont from "../../Iot/components/fxfbCont.vue";
export default {
  props: {
    frieList: Object,
    iotList: Object,
    qy: String,
  },
  components: { fxfbCont },
  data() {
    return {
      listNum: ["水压监测点位", "电气火灾监测点位", "生命通道监测点位"],
      sbType: {},
    };
  },
  mounted() {},
  methods: {
    openFrieModal1() {
      this.showModal("feirModal1");
    },
    toIot(val) {
      this.sbType = val;
      this.showModal("feirModal1");
    },
  },
};
</script>

<style scoped>
.num-box {
  width: 414px;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
}
.build-num {
  width: 100%;
  height: 42px;
  background: linear-gradient(
    180deg,
    rgba(5, 134, 253, 0.18) 0%,
    rgba(0, 224, 255, 0.5) 100%
  );
  border-radius: 5px;
}
.build {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #fff;
  margin-left: 12px;
}
.build-all{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 12px;
  margin-top: 3px;
}
.point-num {
  flex: 1;
  /* margin-top: 10px; */
}
.num {
  font-size: 30px;
  color: #ffd74b;
  margin-left: 5px;
}
img {
  width: 20px;
  height: 19px;
}
.online {
  font-size: 30px;
  color: #00ff66;
  margin-left: 5px;
}
.warning {
  font-size: 30px;
  color: #ff4b23;
  margin-left: 5px;
}
.pressure {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}
.gj-bnt{
  margin-left: 12px;
}
.pressure-num {
  /* width: 30%; */
  height: 150px;
  /* letter-spacing: 1px; */
  font-size: 12px;
  text-align: center;
}
.pressure-img {
  display: inline-block !important;
  width: 8px;
  height: 8px;
  margin-left: 5px;
}
.pressure-list {
  font-size: 12px;
  color: #fff;
  text-align: left;
  font-family: "Abel";
}
.onlines::after {
  background-color: #2fde60;
}
.offlines::after {
  background-color: #ff4f4f;
}
.on-line::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 10px;
  
}
.on-line {
  letter-spacing: 2px;
  
}
.pressure-bg {
  width: 66px;
  height: 77px;
  background: url("@/assets/images/water.png") no-repeat;
  font-size: 20px;
  text-align: center;
  padding-left: 3px;
  padding-top: 10px;
  box-sizing: border-box;
  margin: auto;
}
/* .pressure-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
} */
.bumer {
  display: inline-block;
  font-size: 16px;
  margin-top: 5px;
}
.unit {
  margin-right: 12px;
}
.build-line {
  display: inline-block;
  margin-top: 6px;
}
</style>
