import { defineStore } from "pinia";
import { store } from "@/store";
import { request } from "@/utils";

export const useLargeScreenStore = defineStore({
  id: "pure-large-screen",
  state: () => ({
    largeScreenGlobalData: {}
  }),
  getters: {
    getLargeScreenGlobalData(state) {
      return state.largeScreenGlobalData;
    }
  },
  actions: {
    requestLargeScreenGlobalData(isRefresh: any = undefined) {
      request
        .get(`/idcService/agency/archivesReport/summary/charts`, {
          params: {
            isRefresh: isRefresh
          }
        })
        .then(resp => {
          this.largeScreenGlobalData = resp.data.charts;
        });
    }
  }
});

export function useLargeScreenStoreHook() {
  return useLargeScreenStore(store);
}
