<template>
  <div :class="$store.state.themeName == 'dark' ? 'dark-simp' : 'light-simp'">
    <ul>
      <li class="simp_title">
        <p>{{ data.wpname }}</p>
        <p>
          <!-- <img src="img/images/gridBac.png" /> -->
          <span>{{ data.jrts }}</span>
        </p>
      </li>
      <li class="simp_first">
        <div class="covers" v-if="data.qcjrzt && !data.fjjrzt"></div>
        <div>
          <p class="first_tit">待机</p>
          <p class="dj_val first_val">{{ data.djts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">并网</p>
          <p class="yx_val first_val">{{ data.yxts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">故障</p>
          <p class="gz_val first_val">{{ data.gzts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">检修</p>
          <p class="jx_val first_val">{{ data.jxts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">限电</p>
          <p class="xd_val first_val">{{ data.xdts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">受累</p>
          <p class="sl_val first_val">{{ data.slts || 0 }}</p>
        </div>
        <div>
          <p class="first_tit">离线</p>
          <p class="lx_val first_val">{{ data.lxts || 0 }}</p>
        </div>
      </li>
      <li>
        <p class="simp_form"></p>
        <ul class="simp_seconde">
          <li>
            <div class="covers" v-if="data.qcjrzt && !data.agcjrzt"></div>
            <p>AGC:</p>
            <p class="val_tit">设定</p>
            <p class="val_name sd_name">{{ data.agc002.toFixed(2) }}</p>
            <p class="unit_name">出线</p>
            <p class="unit_val sd_name">{{ data.agc001.toFixed(2) }}</p>
          </li>

          <li>
            <div class="covers" v-if="data.qcjrzt && !data.fggljrzt"></div>
            <div class="grd_fc">
              <p>{{ (data.type == -1 ? "风功" : "光功") + "率:" }}</p>
              <p>{{ "风功率:" }}</p>
              <p class="val_tit">未来15分钟</p>
              <p class="val_name grd_name">{{ data.ycgl.toFixed(2) }}</p>
            </div>
            <p class="unit_name"></p>
            <p class="unit_val"></p>
          </li>
          <li>
            <div class="covers" v-if="data.qcjrzt && !data.qxzjrzt"></div>
            <p>
              {{ data.type == -1 ? "测风塔:" : "气象站:" }}
            </p>
            <p class="val_tit">风速</p>
            <p class="val_name">
              {{ (data.qxzfs.toFixed(2) || 0) + "m/s" }}
            </p>
            <p class="unit_name">风向</p>
            <p class="unit_val">
              {{ (data.qxzfx.toFixed(2) || 0) + "°" }}
            </p>
          </li>
          <li>
            <div class="covers" v-if="data.qcjrzt && !data.djljrzt"></div>
            <p>电能量表:</p>
            <p class="val_tit"></p>
            <p class="val_name">
              {{ data.swdl ? data.swdl.toFixed(2) + "万kWh" : "0万kWh" }}
            </p>
            <p class="unit_name"></p>
            <p class="unit_val"></p>
          </li>
        </ul>
      </li>
    </ul>
    <div class="cover" v-if="!data.qcjrzt">中断</div>
  </div>
</template>

<script>
export default {
  // 名称
  name: "StatusPanel",
  // 使用组件
  components: {},
  props: {
    data: Object,
  },
  // 数据
  data() {
    return {};
  },
  // 函数
  methods: {
    jumpPage(wpId) {
      this.$router.push({
        path: `/monitor/windsite/homePage/${wpId}`,
      });
    },
  },
};
</script>

<style lang="less" scoped>
ul,
ul li,
p {
  margin: 0;
  padding: 0;
  list-style: none;
}
li {
  display: flex;
  margin: 0 auto;
}

.light-simp {
  width: 353px;
  height: 229px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 11px;
  padding: 0 12px;
  li {
    display: flex;
    margin: 0 auto;
  }
  .covers {
    position: absolute;
    width: 335px;
    height: 31px;
    margin-left: -2px;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0.5px);
  }

  .cover {
    width: 354px;
    height: 230px;
    background: rgba(96, 103, 105, 0.5);
    border-radius: 8px;
    font-size: 50px;
    font-weight: bold;
    //backdrop-filter: blur(1.5px);
    letter-spacing: 10px;
    font-family: Microsoft YaHei;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    //box-shadow: 0 0 22px rgba(255, 255, 255, .5) inset;
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.2) inset;
    position: relative;
    left: -12px;
    top: -217px;
    backdrop-filter: blur(0.5px);

    line-height: 230px;

    img {
      width: 50px;
      height: 50px;
      position: absolute;
      top: 94px;
      left: 150px;
    }
  }
  .simp_title {
    position: relative;
    padding: 10px 6px 5px;
    width: 325px;
    font-weight: 700;
    p {
      font-size: 14px;
      color: #36348e;
    }

    img {
      position: absolute;
      right: -38px;
      top: 0;
    }

    span {
      position: absolute;
      right: 12px;
      font-size: 16px;
      font-family: Arial;
      color: #05bb4c;
    }
  }
  .simp_first {
    // padding: 0 12px;
    justify-content: space-between;
    width: 329px;
    line-height: 25px;
    // padding-left: 20px;
    border-bottom: 1px solid rgba(72, 75, 83, 0.5);
    font-weight: 700;
    div {
      .first_tit {
        font-size: 12px;
        color: #606769;
      }

      .first_val {
        font-size: 12px;
        font-family: Arial;
      }
      .yx_val {
        color: rgba(5, 187, 76, 1);
      }

      .dj_val {
        color: rgba(28, 153, 255, 1);
      }

      .xd_val {
        color: rgba(197, 48, 200, 1);
      }

      .jx_val {
        color: #e17d24;
      }

      .gz_val {
        color: #ba3237;
      }

      .sl_val {
        color: #0d1e1c;
      }

      .lx_val {
        color: #606769;
      }

      p {
        &:last-of-type {
          font-size: 12px;
          font-family: Arial;
          text-align: center;
        }
      }
    }
  }
  .simp_form {
    width: 4px;
    height: 8px;
    background: @green;
    position: relative;
    top: 10px;
    left: 13px;
  }

  .simp_seconde {
    margin: 0;
    font-size: 12px;
    font-family: Adobe Heiti Std;
    font-weight: 700;
    color: #606769;
    line-height: 28px;

    .grd_fc {
      display: flex;

      .grd_name {
        margin-left: 20px;
      }
    }

    //border-bottom: 1px solid  red;
    li {
      width: 329px;
      display: flex;
      line-height: 32px;
      justify-content: space-between;
      border-bottom: 1px solid rgba(72, 75, 83, 0.5);

      .sd_name {
        color: #36348e;
        font-weight: 700;
      }
    }

    p {
      width: 55px;
      white-space: nowrap;
      text-align: right;
      line-height: 31px;

      &:first-of-type {
        width: 57px;
      }
    }

    .val_tit {
      margin-left: 20px;
    }

    .val_name {
      font-family: Arial;
      color: #36348e;
      text-align: left;
      //position: relative;
      //top: 1px;
      padding-top: 1px;
      margin-left: 8px;
      line-height: 30px;
    }

    .unit_name {
      //position: relative;
    }

    .unit_val {
      font-family: Arial;
      text-align: left;
      color: #36348e;
      margin-top: 1px;
      //position: relative;
      //top: 1px;
      //left: -5px
    }
  }
}
.dark-simp {
  width: 353px;
  height: 229px;
  background: rgba(96, 103, 105, 0.2);
  border-radius: 8px;
  margin-bottom: 11px;
  padding: 0 12px;
  li {
    display: flex;
    margin: 0 auto;
  }
  .covers {
    position: absolute;
    width: 335px;
    height: 31px;
    margin-left: -2px;
    background: rgba(96, 103, 105, 0.5);
    backdrop-filter: blur(0.5px);
  }

  .cover {
    width: 354px;
    height: 230px;
    background: rgba(96, 103, 105, 0.5);
    border-radius: 8px;
    font-size: 50px;
    font-weight: bold;
    //backdrop-filter: blur(1.5px);
    letter-spacing: 10px;
    font-family: Microsoft YaHei;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    //box-shadow: 0 0 22px rgba(255, 255, 255, .5) inset;
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.2) inset;
    position: relative;
    left: -12px;
    top: -217px;
    backdrop-filter: blur(0.5px);

    line-height: 230px;

    img {
      width: 50px;
      height: 50px;
      position: absolute;
      top: 94px;
      left: 150px;
    }
  }
  .simp_form {
    width: 4px;
    height: 8px;
    background: @green;
    position: relative;
    top: 10px;
    left: 13px;
  }

  .simp_first {
    justify-content: space-between;
    width: 329px;
    line-height: 25px;
    border-bottom: 1px solid rgba(72, 75, 83, 0.5);
    .covers {
      position: absolute;
      width: 335px;
      height: 48px;
      margin-left: -2px;
      background: rgba(96, 103, 105, 0.5);
      backdrop-filter: blur(3px);
    }
    .first_tit {
      font-size: 12px;
      color: #8b8c8e;
    }

    .first_val {
      font-size: 12px;
      font-family: Arial;
    }
    div {
      .yx_val {
        color: rgba(5, 187, 76, 1);
      }

      .dj_val {
        color: rgba(28, 153, 255, 1);
      }

      .xd_val {
        color: rgba(197, 48, 200, 1);
      }

      .jx_val {
        color: #e17d24;
      }

      .gz_val {
        color: #ba3237;
      }

      .sl_val {
        color: rgba(255, 255, 255, 1);
      }

      .lx_val {
        color: #606769;
      }

      p {
        &:last-of-type {
          font-size: 12px;
          font-family: Arial;
          text-align: center;
        }
      }
    }
  }

  .simp_seconde {
    margin: 0 auto;
    font-size: 12px;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #fff;
    line-height: 28px;

    .grd_fc {
      display: flex;

      .grd_name {
        margin-left: 20px;
      }
    }

    //border-bottom: 1px solid  red;
    li {
      width: 329px;
      display: flex;
      line-height: 32px;
      justify-content: space-between;
      border-bottom: 1px solid rgba(72, 75, 83, 0.5);

      .sd_name {
        color: #ffffff;
      }
    }

    p {
      width: 55px;
      white-space: nowrap;
      text-align: right;
      line-height: 31px;

      &:first-of-type {
        width: 57px;
      }
    }

    .val_tit {
      margin-left: 20px;
    }

    .val_name {
      font-family: Arial;
      color: @green;
      text-align: left;
      //position: relative;
      //top: 1px;
      padding-top: 1px;
      margin-left: 8px;
      line-height: 30px;
    }

    .unit_name {
      //position: relative;
    }

    .unit_val {
      font-family: Arial;
      text-align: left;
      color: @green;
      margin-top: 1px;
      //position: relative;
      //top: 1px;
      //left: -5px
    }
  }

  .simp_title {
    position: relative;
    padding: 10px 6px 5px;
    width: 325px;

    p {
      font-size: 14px;
      color: hsla(0, 0%, 100%, 0.75);
    }

    img {
      position: absolute;
      right: -38px;
      top: 0;
    }

    span {
      position: absolute;
      right: 12px;
      font-size: 16px;
      font-family: Arial;
      color: #05bb4c;
    }
  }
}
</style>
