<template>
  <div class="agcDetailBox">
    <DataDetails
      ref="detailst"
      :allDate="allDate"
      :allChartDate="allChartDate"
      :station="station"
      @handleClick="handleClicks"
    ></DataDetails>
    <DetailsCharts
      v-model="detailsDisplay"
      :showData="showData"
      @closeds="closeds"
    ></DetailsCharts>
  </div>
</template>

<script>
import DataDetails from "./dataDetails";
import DetailsCharts from "./detailsCharts";
import api from "api/index";
import dayjs from "dayjs";
export default {
  components: {
    DataDetails,
    DetailsCharts,
  },
  data() {
    return {
      station: [
        {
          id: "fc01",
          showType: "测试",
          name: "风场_A01",
          createTime: "2025-05-21",
          schedulingName: "一期",
        },
        {
          id: "fc02",
          showType: "测试",
          name: "风场_A01",
          createTime: "2025-05-21",
          schedulingName: "",
        },
        {
          id: "fc03",
          showType: "测试",
          name: "风场_A02",
          createTime: "2025-05-21",
          schedulingName: "",
        },
        {
          id: "fc04",
          showType: "测试",
          name: "风场_A03",
          createTime: "2025-05-21",
          schedulingName: "",
        },
      ],
      allDate: {
        fc01: {
          Status: { value: 1 },
          InstalledCapacity: { value: 207 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          AgcIn: { name: "AGC投入", value: 1 },
          AgcFar: { name: "AGC远方", value: 0 },
          SumLock: { name: "有功增闭锁", value: 1 },
          SubLock: { name: "有功减闭锁", value: 0 },
        },
        fc02: {
          Status: { value: 0 },
          InstalledCapacity: { value: 7.43 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          InstalledCapacity: { value: 7.43 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          AgcIn: { name: "AGC投入", value: 1 },
          AgcFar: { name: "AGC远方", value: 0 },
          SumLock: { name: "有功增闭锁", value: 1 },
          SubLock: { name: "有功减闭锁", value: 0 },
        },
        fc03: {
          Status: { value: 1 },
          InstalledCapacity: { value: 233 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          AgcIn: { name: "AGC投入", value: 1 },
          AgcFar: { name: "AGC远方", value: 0 },
          SumLock: { name: "有功增闭锁", value: 1 },
          SubLock: { name: "有功减闭锁", value: 0 },
        },
        fc04: {
          Status: { value: 0 },
          InstalledCapacity: { value: 7.43 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          InstalledCapacity: { value: 7.43 },
          PowerSet: { value: 198 },
          ActualPower: { value: 89.04 },
          AgcUp: { value: 0.2 },
          TheoryPower: { value: 98.67 },
          AgcLower: { value: 0 },
          ForecastPower: { value: 45.21 },
          AgcIn: { name: "AGC投入", value: 1 },
          AgcFar: { name: "AGC远方", value: 0 },
          SumLock: { name: "有功增闭锁", value: 1 },
          SubLock: { name: "有功减闭锁", value: 0 },
        },
      },
      allChartDate: [],
      detailsDisplay: false,
      showData: {},
      intervals: "",
    };
  },

  mounted() {
    let allChartDate = [];
    for (let i = 0; i < 4; i++) {
      const item = {
        id: `fc0${i + 1}`,
        value: [
          {
            title: "实发有功",
            value: [
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
            ],
          },
          {
            title: "有功设定",
            value: [
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
              { text: "10:41", value: this.BASE.randomNum(50, 80) },
            ],
          },
        ],
      };
      allChartDate.push(item);
    }
    this.allChartDate = allChartDate;
  },
};
</script>

<style lang="less" scoped>
.agcDetailBox {
  // padding-left: 3%;
  // padding-top: 2%;
  color: #fff;
}
</style>