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 useRight() {
  const lineOption = chartsOptions<LineECOption>({
    legend: {
      show: false,
    },
    yAxis: {
      name: "(kw.h)",
    },
    xAxis: {
      data: [
        "星期一",
        "星期二",
        "星期三",
        "星期四",
        "星期五",
        "星期六",
        "星期天",
      ],
    },
    series: [
      {
        name: "发电量",
        data: [120, 200, 150, 80, 70, 110, 130],
      },
    ],
  });

  const item1 = ref([
    {
      name: "燃油",
      image: getImg("soc/item1.png"),
      value: 3845,
      unit: "MWH",
    },
    {
      name: "燃气",
      image: getImg("soc/item2.png"),
      value: 7945,
      unit: "kg",
    },
    {
      name: "自来水",
      image: getImg("soc/item3.png"),
      value: 8541,
      unit: "次",
    },
  ]);

  const Ranking = ref([
    {
      name: "空调",
      color: "#14c5f2",
      value: 100,
    },
    {
      name: "照明",
      color: "#14c5f2",
      value: 100,
    },
    {
      name: "电梯",
      color: "#14c5f2",
      value: 100,
    },
    {
      name: "电动车",
      color: "#14c5f2",
      value: 100,
    },
    {
      name: "其他",
      color: "#14c5f2",
      value: 100,
    },
  ]);
  return { lineOption, item1, Ranking };
}
