import { chartsOptions } from "@/components/globals/v-charts";
import { BaseOption } from "@/components/globals/v-charts/type";
import { ref } from "vue";

export function useLeft() {
  const barLineOption = chartsOptions<BaseOption>({
    yAxis: {
      name: "(kw.h)",
    },
    xAxis: {
      data: ["1", "2", "3", "4", "5", "6", "7"],
    },
    series: [
      {
        name: "风电上网量",
        data: [120, 200, 150, 80, 70, 110, 130],
      },
      {
        name: "环比增长",
        data: [10, 20, 15, 8, 40, 11, 13],
      },
    ],
  });
  const barLine2Option = chartsOptions<BaseOption>({
    yAxis: {
      name: "(kw.h)",
    },
    xAxis: {
      data: ["1", "2", "3", "4", "5", "6", "7"],
    },
    series: [
      {
        name: "光伏上网电量",
        data: [120, 200, 150, 80, 70, 110, 130],
      },
      {
        name: "环比增长",
        data: [10, 20, 15, 8, 40, 11, 13],
      },
    ],
  });

  const item1 = ref([
    {
      name: "今日上网电量",
      value: 24.5,
      unit: "kw.h",
    },
    {
      name: "本月上网电量",
      value: 145,
      unit: "kw.h",
    },
    {
      name: "今年上网电量",
      value: 8741,
      unit: "kw.h",
    },
  ]);

  return {
    item1,
    barLineOption,
    barLine2Option,
  };
}
