D2DkqgtI.js
881 Bytes
import{a9 as o,aa as i}from"./BtEn9SvP.js";const n=()=>{const s=i(),r=t=>{const e=new URLSearchParams;t.start&&e.set("start",t.start),t.end&&e.set("end",t.end),t.line&&e.set("line",t.line),t.workOrderStatus&&e.set("workOrderStatus",t.workOrderStatus);const a=e.toString();return a.length>0?`?${a}`:""};return{getCustomers:()=>s.useApiFetch("/api/customers",{default:()=>[]}),getMails:()=>s.useApiFetch("/api/mails",{default:()=>[]}),getNotifications:()=>s.useApiFetch("/api/notifications",{default:()=>[]}),getDashboardOverview:async t=>{const e=r(t);return s.request(`/api/dashboard/overview${e}`,{method:"GET",auth:!0})},exportDashboardOverview:async t=>{const e=r(t);try{return await s.request(`/api/dashboard/overview/export${e}`,{method:"GET",auth:!0})}catch{return{success:!1,errorCode:"REQUEST_FAILED",message:"导出失败,请稍后重试。"}}}}},l=o(n);export{l as u};