2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
import{L as o}from"./index-eVF4AHSu.js";import{n as s}from"./pagination-BgSlm-mj.js";const a=o();async function i(){try{const e=await a.get("/admin/case/category/list");return Array.isArray(e)?e:[]}catch(e){return console.warn("[admin/case/category/list] fallback:",e),[{id:1,nameZh:"全屋定制案例",nameEn:"Whole House Custom",code:"whole-house",type:"space",sortOrder:1,isShow:1},{id:2,nameZh:"客厅空间",nameEn:"Living Room",code:"living-room",type:"space",sortOrder:2,isShow:1},{id:3,nameZh:"卧室空间",nameEn:"Bedroom",code:"bedroom",type:"space",sortOrder:3,isShow:1},{id:4,nameZh:"酒店工程",nameEn:"Hotel Projects",code:"hotel",type:"space",sortOrder:4,isShow:1}]}}async function d(e){return a.postJson("/admin/case/category/create",e)}async function u(e,t){await a.putJson(`/admin/case/category/update/${e}`,t)}async function l(e){await a.delete(`/admin/case/category/delete/${e}`)}async function y(e){try{const t=await a.get("/admin/case/list",e);return s(t,n=>n,(e==null?void 0:e.size)??20)}catch(t){return console.warn("[admin/case/list] fallback:",t),{records:[],total:0,current:1,pages:0}}}async function m(e){return a.postJson("/admin/case/create",e)}async function f(e,t){await a.putJson(`/admin/case/update/${e}`,t)}async function g(e){await a.delete(`/admin/case/delete/${e}`)}export{y as a,g as b,d as c,l as d,f as e,i as f,m as g,u};
|