<template>
  <div class="board">
    <div class="topNav"></div>


    <div class="rightImg">
    </div>
    <div class="right">
                <span>
                    光伏系统
                </span>
    </div>
    <div class="rightImg" style="left:38%;">
    </div>
    <div class="right" style="left:38%;">
                <span>
                    风力风电
                </span>
    </div>
    <div class="rightImg" style="left:45%;">
    </div>
    <div class="right" style="left:45%;">
                <span>
                   储能系统
                </span>
    </div>

    <div class="title">
      微电网能源管理系统
    </div>
    <div class="rightTop">
      <span>今日告警:</span>
      <span style="color: #ff0000">2234</span>
      <br>
      <span>累计告警:</span>
      <span style="color: #4F98B8">3392</span>
    </div>
    <div class="bottomLeftTop">
      <div class="title3">收益</div>
      <div class="card11">
        <div class="a1">
          当日收益
        </div>
        <div class="a2" style="white-space: nowrap;text-align: center">
          <span style="padding: 0 1vw;font-size: 1.1vw">1111</span>
          <span>元</span>
        </div>
        <div class="a3">
          <img src="@/assets/demo/2收益.png" alt="" width="100%">
        </div>
      </div>
      <div class="card12">
        <div class="a1">
          总收益
        </div>
        <div class="a2" style="white-space: nowrap;text-align: center">
          <span style="padding: 0 1vw;font-size: 1.1vw">43212</span>
          <span>元</span>
        </div>
        <div class="a3">
          <img src="@/assets/demo/2收益.png" alt="" width="100%">
        </div>
      </div>
    </div>
    <div class="bottomLeftMid">
      <div class="title3">发电量</div>
      <div class="card11">
        <div class="a1">
          当日发电量
        </div>
        <div class="a2" style="white-space: nowrap;text-align: center">
          <span style="padding: 0 1vw;font-size: 1.1vw">1111</span>
          <span>元</span>
        </div>
        <div class="a3">
          <img src="@/assets/demo/2日.png" alt="" width="100%">
        </div>
      </div>
      <div class="card12">
        <div class="a1">
          总发电量
        </div>
        <div class="a2" style="white-space: nowrap;text-align: center">
          <span style="padding: 0 1vw;font-size: 1.1vw">43212</span>
          <span>元</span>
        </div>
        <div class="a3">
          <img src="@/assets/demo/2年.png" alt="" width="100%">
        </div>
      </div>
    </div>
    <div class="bottomLeftBottom">
      <div class="title3">气象信息</div>
      <div class="card2">
        <div class="icon2">
          <img src="@/assets/demo/2光照.png" alt="" width="100%">
        </div>
        <div class="card2Title">光照</div>
        <div class="card2Span">
          <span>
            0.00
          </span>
          <span style="position:absolute;right: 0">
            lx
          </span></div>
      </div>
      <div class="card2">
        <div class="icon2">
          <img src="@/assets/demo/2风机.png" alt="" width="100%">
        </div>
        <div class="card2Title">风速</div>
        <div class="card2Span">
          <span>
            0.00
          </span>
          <span style="position:absolute;right: 0">
            m/s
          </span></div>
      </div>
      <div class="card2">
        <div class="icon2">
          <img src="@/assets/demo/2湿度.png" alt="" width="100%">
        </div>
        <div class="card2Title">湿度</div>
        <div class="card2Span">
          <span>
            0.00
          </span>
          <span style="position:absolute;right: 0">
            %
          </span></div>
      </div>
      <div class="card2">
        <div class="icon2">
          <img src="@/assets/demo/2温度.png" alt="" width="100%">
        </div>
        <div class="card2Title">温度</div>
        <div class="card2Span">
          <span>
            0.00
          </span>
          <span style="position:absolute;right: 0">
            °C
          </span></div>
      </div>
    </div>
    <div class="cards">
      <div class="card" style="left: 0%;background-color: #061043">
        <div class="cardTitle">上网电量</div>
        <div class="cardInfo">
          111
        </div>
        <div class="cardInfo1">
          kw
        </div>
        <div class="cardIcon icont1"></div>
      </div>
      <div class="card" style="left: 25%;background-color: #061043">
        <div class="cardTitle">上网电量</div>
        <div class="cardInfo">
          111
        </div>
        <div class="cardInfo1">
          kw
        </div>
        <div class="cardIcon icont1"></div>
      </div>
      <div class="card" style="left: 50%;background-color: #061043">
        <div class="cardTitle">上网电量</div>
        <div class="cardInfo">
          111
        </div>
        <div class="cardInfo1">
          kw
        </div>
        <div class="cardIcon icont1"></div>
      </div>
      <div class="card" style="left: 75%;background-color: #061043">
        <div class="cardTitle">上网电量</div>
        <div class="cardInfo">
          111
        </div>
        <div class="cardInfo1">
          kw
        </div>
        <div class="cardIcon icont1"></div>
      </div>
    </div>
    <div class="bottomRight">
      <div class="title3">逆变器参数</div>
      <div class="box">
        <div class="boxLeft"></div>
        <div class="boxTable1">
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 50%">输出功率（kw）</div>
            <div class="boxTableTd" style="width: 50%">0.1</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 50%">日发电量（kwh）</div>
            <div class="boxTableTd" style="width: 50%">30</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 50%">总发电量（kwh）</div>
            <div class="boxTableTd" style="width: 50%">2222</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 50%">逆变器状态</div>
            <div class="boxTableTd" style="width: 50%">
              <el-text class="mx-1" type="success">运行</el-text>
            </div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 50%">工作状态</div>
            <div class="boxTableTd" style="width: 50%">
              <el-text class="mx-1" type="success">并网</el-text>
            </div>
          </div>
        </div>
      </div>
      <div class="box">
        <div class="boxTitle">功率曲线</div>
        <div class="boxTitle1">2022年2月2日</div>

        <Chart ref="chartRef" />
      </div>
      <div class="box">
        <div class="boxTitle">直流测</div>
        <div class="boxTable">
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">输入线路</div>
            <div class="boxTableTd" style="width: 30%">电压（V）</div>
            <div class="boxTableTd" style="width: 30%">电流（A）</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">pv1</div>
            <div class="boxTableTd" style="width: 30%">220</div>
            <div class="boxTableTd" style="width: 30%">36</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">pv2</div>
            <div class="boxTableTd" style="width: 30%">220</div>
            <div class="boxTableTd" style="width: 30%">36</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">pv3</div>
            <div class="boxTableTd" style="width: 30%">220</div>
            <div class="boxTableTd" style="width: 30%">36</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">pv4</div>
            <div class="boxTableTd" style="width: 30%">220</div>
            <div class="boxTableTd" style="width: 30%">36</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 40%">pv5</div>
            <div class="boxTableTd" style="width: 30%">220</div>
            <div class="boxTableTd" style="width: 30%">36</div>
          </div>
        </div>
      </div>
      <div class="box">
        <div class="boxTitle">交流测</div>
        <div class="boxTable">
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">参数</div>
            <div class="boxTableTd" style="width: 25%">a相</div>
            <div class="boxTableTd" style="width: 25%">b相</div>
            <div class="boxTableTd" style="width: 25%">c相</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">电压（V）</div>
            <div class="boxTableTd" style="width: 25%">220</div>
            <div class="boxTableTd" style="width: 25%">222</div>
            <div class="boxTableTd" style="width: 25%">222</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">电流</div>
            <div class="boxTableTd" style="width: 25%">0.4</div>
            <div class="boxTableTd" style="width: 25%">0.4</div>
            <div class="boxTableTd" style="width: 25%">0.4</div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">总有功功率</div>
            <div class="boxTableTd" style="width: 25%"></div>
            <div class="boxTableTd" style="width: 25%">0.1</div>
            <div class="boxTableTd" style="width: 25%"></div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">功率因数</div>
            <div class="boxTableTd" style="width: 25%"></div>
            <div class="boxTableTd" style="width: 25%">1</div>
            <div class="boxTableTd" style="width: 25%"></div>
          </div>
          <div class="boxTableTh">
            <div class="boxTableTd" style="width: 25%">频率</div>
            <div class="boxTableTd" style="width: 25%"></div>
            <div class="boxTableTd" style="width: 25%">50</div>
            <div class="boxTableTd" style="width: 25%"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import Chart from '@/components/chart.vue';
import * as echarts from 'echarts';

const chartRef = ref();
onMounted(() => {
  const colorList = ['#9E87FF', '#73DDFF', '#fe9a8b', '#F56948', '#9E87FF'];
  let option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        label: {
          show: true,
          backgroundColor: '#fff',
          color: '#fff',
          borderColor: 'rgba(0,0,0,0)',
          shadowColor: 'rgba(0,0,0,0)',
          shadowOffsetY: 0
        },
        lineStyle: {
          width: 0
        }
      },
      backgroundColor: '#fff',
      textStyle: {
        color: '#fff'
      },
      padding: [10, 10],
      extraCssText: 'box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)'
    },
    grid: {
      top: '30%',
      bottom: '10%'
    },
    xAxis: [
      {
        type: 'category',
        data: ['1', '2', '3', '4', '5', '6', '7'],
        axisLine: {
          lineStyle: {
            color: '#DCE2E8'
          }
        },
        axisTick: {
          show: false
        },
        axisLabel: {
          interval: 0,
          textStyle: {
            color: '#fff'
          },
          // 默认x轴字体大小
          fontSize: 0,
          // margin:文字到x轴的距离
          margin: -10
        },
        axisPointer: {
          label: {
            padding: [0, 0, 0, 0],
            /*
      除了padding[0]建议必须是0之外，其他三项可随意设置

      和CSSpadding相同，[上，右，下，左]

      如果需要下边线超出文字，设左右padding即可，注：左右padding最好相同

      padding[2]的10:

      10 = 文字距下边线的距离 + 下边线的宽度

      如：UI图中文字距下边线距离为7 下边线宽度为2

      则padding: [0, 0, 9, 0]

                  */
            // 这里的margin和axisLabel的margin要一致!
            margin: 0,
            // 移入时的字体大小
            fontSize: 12
          }
        },
        boundaryGap: false
      }
    ],
    yAxis: [
      {
        type: 'value',
        axisTick: {
          show: false
        },
        axisLine: {
          show: true,
          lineStyle: {
            color: '#fff'
          }
        },
        axisLabel: {
          textStyle: {
            color: '#fff'
          }
        },
        splitLine: {
          show: false
        }
      }
    ],
    series: [
      {
        name: '充电桩+负载回路',
        type: 'line',
        data: [0, 0, 0, 0, 0, 0, 0],
        symbolSize: 1,
        symbol: 'circle',
        smooth: true,
        yAxisIndex: 0,
        showSymbol: false,
        lineStyle: {
          width: 1,
          color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
            {
              offset: 0,
              color: '#9effff'
            },
            {
              offset: 1,
              color: '#9E87FF'
            }
          ]),
          shadowColor: 'rgba(158,135,255, 0.3)',
          shadowBlur: 10,
          shadowOffsetY: 20
        },
        itemStyle: {
          normal: {
            color: colorList[0],
            borderColor: colorList[0]
          }
        }
      },
      {
        name: '光伏+风电',
        type: 'line',
        data: [0, 3, 3, 6, 7, 6, 4],
        symbolSize: 1,
        symbol: 'circle',
        smooth: true,
        yAxisIndex: 0,
        showSymbol: false,
        lineStyle: {
          width: 1,
          color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [
            {
              offset: 0,
              color: '#73DD39'
            },
            {
              offset: 1,
              color: '#73DDFF'
            }
          ]),
          shadowColor: 'rgba(115,221,255, 0.3)',
          shadowBlur: 10,
          shadowOffsetY: 20
        },
        itemStyle: {
          normal: {
            color: colorList[1],
            borderColor: colorList[1]
          }
        }
      },
      {
        name: '储能',
        type: 'line',
        data: [0, 0, 0, 0, 0, 0, 0],
        symbolSize: 1,
        symbol: 'circle',
        smooth: true,
        showSymbol: false,
        lineStyle: {
          width: 1,
          color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
            {
              offset: 0,
              color: '#fe9a'
            },
            {
              offset: 1,
              color: '#fe9a8b'
            }
          ]),
          shadowColor: 'rgba(254,154,139, 0.3)',
          shadowBlur: 10,
          shadowOffsetY: 20
        },
        itemStyle: {
          normal: {
            color: colorList[2],
            borderColor: colorList[2]
          }
        }
      }
    ]
  };
  chartRef.value.setData(option);
});
</script>
<style scoped lang="less">
.topNav {
  background-image: url("@/assets/demo/top.jpg");
  position: absolute;
  width: 100%;
  height: 7%;
  top: 0;
  left: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.board {
  background-color: #030A35;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.title {
  position: absolute;
  top: 3%;
  left: 3%;
  font-size: 1vw;
  color: white;
}

.rightImg {
  transform: rotateX(180deg);
  background-image: url('@/assets/demo/subheadClick.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  position: absolute;
  width: 8vw;
  height: 1.66vw;
  top: 3.8%;
  left: 31%;
}

.right {
  position: absolute;
  width: 8vw;
  height: 1.66vw;
  top: 3.8%;
  left: 31%;
  line-height: 1.66vw;
  font-size: 0.8vw;
  color: #fff;
  text-align: center;
}

.rightTop {
  position: absolute;
  top: 2%;
  right: 2%;
  font-size: 0.8vw;
  color: white;
}

.cards {
  position: absolute;
  top: 8%;
  left: 25.6%;
  width: 74%;
  height: 15%;
}

.card {
  border: 1px solid #fff3;
  position: absolute;
  top: 0%;
  width: 24.5%;
  height: 100%;
  color: white;
  font-size: 0.8vw;
  border-radius: 10px;
  line-height: 5vh;
}

.cardTitle {
  position: absolute;
  top: 70%;
  left: 50%;
  font-size: 1vw;
  transform: translateX(-50%);
}

.cardInfo {
  position: absolute;
  top: 20%;
  left: 30%;
  font-size: 2vw;
}

.cardInfo1 {
  position: absolute;
  top: 20%;
  left: 70%;
  font-size: 1.4vw;
}

.cardItem {
  vertical-align: top;
  display: inline-block;
}

.bottomLeftTop {
  position: absolute;
  top: 8%;
  left: 0.3%;
  width: 25%;
  height: 30%;
  background-color: #141B4C;
}

.bottomLeftMid {
  position: absolute;
  top: 38.6%;
  left: 0.3%;
  width: 25%;
  height: 30%;
  background-color: #141B4C;
}

.bottomLeftBottom {
  position: absolute;
  top: 69.2%;
  left: 0.3%;
  width: 25%;
  height: 30%;
  background-color: #141B4C;
}

.bottomRight {
  border: 1px solid #fff3;
  position: absolute;
  top: 25.5%;
  left: 25.6%;
  width: 73.5%;
  height: 74%;
}

.card11 {
  width: 40%;
  height: 80%;
  top: 10%;
  left: 10%;
  position: absolute;
}

.card12 {
  width: 40%;
  height: 80%;
  top: 10%;
  left: 50%;
  position: absolute;
}

.a1 {
  position: absolute;
  color: white;
  text-align: center;
  //background-color: #C28E4766;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 1vw;
}

.a2 {
  position: absolute;
  color: #69FF7B;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 20%;
  font-size: 0.8vw;
}

.a3 {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.6vw;
  height: 4vw;
}

.icont1 {
  background-image: url('@/assets/demo/2电机.png');
}

.cardIcon {
  position: absolute;
  top: 50%;
  left: 1%;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 4vw;
  height: 3vw;
}

.title1 {
  position: absolute;
  top: 10%;
  left: 10%;
}

.icon1 {
  position: absolute;
  width: 10%;
  top: 10%;
  right: 10%;
}

.num1 {
  position: absolute;
  bottom: 10%;
  left: 10%;
}

.span1 {
  position: absolute;
  bottom: 10%;
  right: 10%;
}

.title2 {
  position: absolute;
  top: 10%;
  left: 5%;
  font-size: 0.8vw;
  color: white;
}

.num2 {
  position: absolute;
  top: 60%;
  left: 30%;
  font-size: 1.2vw;
  color: white;
}

.span2 {
  position: absolute;
  top: 60%;
  left: 45%;
  font-size: 1.2vw;
  color: white;
}


.num3 {
  position: absolute;
  top: 60%;
  left: 75%;
  font-size: 1.2vw;
  color: white;
}

.span3 {
  position: absolute;
  top: 60%;
  left: 90%;
  font-size: 1.2vw;
  color: white;
}

.title3 {
  width: 100%;
  line-height: 2.4vh;
  font-size: 0.8vw;
  text-align: center;
  color: white;
}

.card2 {
  width: 46%;
  height: 45%;
  margin: 0 2%;
  display: inline-block;
  position: relative;
}

.icon2 {
  position: absolute;
  transform: translateY(-50%);
  top: 50%;
  left: 10%;
  width: 3vw;
  height: 3vw;
}

.card2Title {
  position: absolute;
  width: calc(100% - 10% - 3vw);
  height: 1.5vw;
  line-height: 1.5vw;
  top: 50%;
  left: calc(10% + 3vw);
  transform: translateY(-100%);
  text-align: center;
  color: white;
  font-size: 0.8vw;
}

.card2Span {
  position: absolute;
  width: calc(100% - 10% - 3vw - 20px);
  height: 1.5vw;
  top: 50%;
  left: calc(10% + 3vw + 10px);
  line-height: 1.5vw;
  color: white;
  font-size: 0.8vw;
}

.box {
  display: inline-block;
  width: 48%;
  height: 46%;
  margin: 0 1% 1% 1%;
  background-color: #131C39;
  position: relative;
}

.boxTitle {
  position: absolute;
  top: 3%;
  left: 3%;
  color: white;
  font-size: 1vw;
}

.boxTitle1 {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1vw;
}

.boxTable {
  position: absolute;
  top: 20%;
  width: 96%;
  left: 2%;
  height: 75%;
}

.boxTableTh {
  border-bottom: 1px solid #fff2;
}

.boxTableTd {
  text-align: center;
  display: inline-block;
  line-height: 2vw;
  color: #fff;
}

.boxLeft {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  width: 5vw;
  height: 5vw;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("@/assets/demo/2光伏.png");
}

.boxTable1 {
  position: absolute;
  top: 10%;
  width: 60%;
  left: 30%;
  height: 80%;
}

.boxTableTh {
  border-bottom: 1px solid #fff2;
}

.boxTableTd {
  text-align: center;
  display: inline-block;
  line-height: 2vw;
  color: #fff;
}
</style>



