import{r as s}from"./request.3edc855e.js";const n="/location",d=t=>{const e=t==null?void 0:t.data;return e?Array.isArray(e)?{list:e,total:e.length}:{list:Array.isArray(e.list)?e.list:[],total:typeof e.total=="number"?e.total:Array.isArray(e.list)?e.list.length:0}:{list:[],total:0}},p=async({keyword:t,warehouseId:e,type:a,status:r,page:i,pageSize:c})=>{const o={code:t||void 0,warehouse_id:e||void 0,type:a,status:r,page:i,page_size:c},u=await s.get(`${n}/list`,{params:o});return d(u)},A=async t=>{const e=await s.get(`${n}/detail/${t}`);return(e==null?void 0:e.data)||null},y=async t=>s.post(`${n}/create`,t),h=async t=>s.put(`${n}/update`,t),$=async t=>{const e=new FormData;return Array.isArray(t.ids)&&t.ids.forEach((a,r)=>{e.append(`ids[${r}]`,a)}),s.post(`${n}/delete`,e)},l=async t=>{const e=new FormData;return Array.isArray(t.ids)&&t.ids.forEach((a,r)=>{e.append(`ids[${r}]`,a)}),t.code!==void 0&&e.append("code",t.code),t.type!==void 0&&e.append("type",t.type),t.capacity!==void 0&&e.append("capacity",t.capacity),t.status!==void 0&&e.append("status",t.status),s.put(`${n}/update`,e)},m=async t=>s.post(`${n}/batch-generate`,t);export{m as a,l as b,y as c,$ as d,p as e,A as f,h as u};