daShangDao_psiWebApp/dist/assets/location.83be51dc.js
97694731 1fa4f33695
Some checks failed
CI / build (18.x) (push) Failing after 37m26s
CI / build (20.x) (push) Failing after 15s
CI / deploy-preview (push) Has been skipped
CI / lint (push) Failing after 16m50s
CI / test (push) Successful in 40m41s
CI / security (push) Successful in 29m36s
多拍
2026-06-25 14:37:30 +08:00

2 lines
1.6 KiB
JavaScript

import{r as a}from"./request.431ecd42.js";const r="/location",c=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}},f=async({keyword:t,warehouseId:e,type:n,status:s,page:i,pageSize:o})=>{const d={code:t||void 0,warehouse_id:e||void 0,type:n,status:s,page:i,page_size:o},u=await a.get(`${r}/list`,{params:d});return c(u)},m=async t=>{const e=await a.get(`${r}/detail/${t}`);return(e==null?void 0:e.data)||null},h=async t=>a.post(`${r}/create`,t),l=async t=>a.put(`${r}/update`,t),A=async t=>{const e=new FormData;return Array.isArray(t.ids)&&t.ids.forEach((n,s)=>{e.append(`ids[${s}]`,n)}),a.post(`${r}/delete`,e)},$=async t=>{const e=new FormData;return Array.isArray(t.ids)&&t.ids.forEach((n,s)=>{e.append(`ids[${s}]`,n)}),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),t.warehouse_id!==void 0&&e.append("warehouse_id",t.warehouse_id),a.put(`${r}/update`,e)},w=async t=>a.post(`${r}/batch-generate`,t),y=async({user_id:t,warehouse_id:e,file:n})=>{const s=new FormData;return s.append("user_id",t),s.append("warehouse_id",e),s.append("file",n),a.post(`${r}/import-from-excel`,s)},L=async({page:t,pageSize:e,keyword:n}={})=>{const s={page:t,page_size:e,code:n||void 0},i=await a.get(`${r}/all-list`,{params:s});return c(i)};export{w as a,$ as b,h as c,A as d,f as e,m as f,L as g,y as i,l as u};