import { defineStore } from 'pinia' import { AxiosWrapper } from '@/utils/axios-wrapper' const url = '/statistics' const axios = new AxiosWrapper() export const StatisticsStore = defineStore('statistics', () => { const work = async ({ skip = 0, limit = undefined, ...info } = {}) => { let cond = {} if (skip) cond.skip = skip if (limit) cond.limit = limit cond = { ...cond, ...info } const res = await axios.$get(`${url}`, cond) return res } const user = async ({ skip = 0, limit = undefined, ...info } = {}) => { let cond = {} if (skip) cond.skip = skip if (limit) cond.limit = limit cond = { ...cond, ...info } const res = await axios.$get(`${url}`, cond) return res } const resource = async ({ skip = 0, limit = undefined, ...info } = {}) => { let cond = {} if (skip) cond.skip = skip if (limit) cond.limit = limit cond = { ...cond, ...info } const res = await axios.$get(`${url}`, cond) return res } return { work, user, resource } })