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

export function useLeft() {
  const lineOption = chartsOptions<LineECOption>({
    legend: {
      show: false,
    },
    yAxis: {
      name: "(kw.h)",
    },
    xAxis: {
      data: [
        "星期一",
        "星期二",
        "星期三",
        "星期四",
        "星期五",
        "星期六",
        "星期天",
      ],
    },
    series: [
      {
        name: "发电量",
        data: [120, 200, 150, 80, 70, 110, 130],
      },
    ],
  });
  const l1ItemList = ref([
    {
      name: "本月发电量",
      value: 345,
      unit: "kw.h",
      image: getImg("source/l1-item1.png"),
    },
    {
      name: "本年发电",
      value: 345,
      unit: "kw.h",
      image: getImg("source/l1-item2.png"),
    },
    {
      name: "累计发电量",
      value: 345,
      unit: "MJ/㎡",
      image: getImg("source/l1-item3.png"),
    },
  ]);

  const l2ItemList = ref([
    {
      name: "逆变器输入电量",
      value: 78.09,
      unit: "kw.h",
      image: getImg("source/item_bg1.png"),
    },
    {
      name: "逆变器转换效率",
      value: 86.3,
      unit: "%",
      image: getImg("source/item_bg1.png"),
    },
    {
      name: "光电转化效率",
      value: 82.1,
      unit: "%",
      image: getImg("source/item_bg3.png"),
    },
    {
      name: "电站性能比",
      value: 78.09,
      unit: "",
      image: getImg("source/item_bg4.png"),
    },
  ]);
  return { l1ItemList, l2ItemList, lineOption };
}
