| 1 |
- import{d as S,u as D,b as V,e as r,p as $,R,A as F,B as k,c as h,a as e,f as c,w as l,j as x,m as U,v as q,y as E,r as b,o as g,F as G,i as H,t as w,I as J,g as y}from"./index-B9UwUtN4.js";import{x as K}from"./vue3-datatable-33agO3sn.js";const O=e("li",{class:"before:content-['/'] ltr:before:mr-2 rtl:before:ml-2 text-primary"},[e("span",null,"库位管理")],-1),Q={class:"panel pb-0 mt-6"},W={class:"flex md:items-center md:flex-row flex-col mb-5 gap-5"},X={class:"flex items-center gap-5 ltr:ml-auto rtl:mr-auto"},Y={class:"dropdown"},Z={type:"button",class:"whitespace-nowrap flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark"},ee=e("span",{class:"ltr:mr-1 rtl:ml-1"},"选择",-1),te={class:"whitespace-nowrap"},oe={class:"flex items-center px-4 py-1"},se={class:"cursor-pointer mb-0"},ae=["id","value","onChange","checked"],re=["for"],ne={class:"datatable"},ce=S({__name:"locationList",setup(le){D({title:"Column Chooser Table"});const C=E(),L=V(),p=r(""),m=r([]);r([]);const i=r([]);r([]);const d=r([]),z=r([]),v=r([{field:"warehouse.sn",title:"仓库编号",hide:!0},{field:"warehouse_id",title:"仓库名称",hide:!1},{field:"code",title:"库位号",hide:!1},{field:"type",title:"库位区域",hide:!0},{field:"bind_num",title:"已绑定sku数",hide:!0}]),s=r([{page_no:1,page_size:10}]),_=r(0),A=()=>{C.replace({name:"home"})},j=t=>{console.log(`${t} items per page`)},M=t=>{s.page_no=t,f(),console.log(`current page: ${t}`)},B=t=>{if(t&&i.value&&i.value.data){const a=i.value.data.find(n=>n.id===t);return a?a.name:""}},I=t=>{if(t&&d.value&&d.value.data){const a=d.value.data.find(n=>n.code===t);return a?a.name:""}};$(()=>{f(),P()});const f=async()=>{console.log(s),R.queryList({page_no:s.page_no,page_size:s.page_size}).then(t=>{s.page_no=t.data.page_no,s.page_size=t.data.page_size,_.value=t.data.data_total,m.value=t.data.data})},P=async()=>{i.value=await F.warehouseList({}),d.value=await k.listAreaType(s),z.value=await k.getPage({dictType:"transfer_status"})};return(t,a)=>{const n=b("Popper"),T=b("el-pagination");return g(),h("div",null,[e("ul",{class:"flex space-x-2 rtl:space-x-reverse"},[e("li",null,[e("a",{href:"javascript:;",class:"hover:underline",onClick:A},"首页")]),O]),e("div",Q,[e("div",W,[e("div",X,[e("div",Y,[c(n,{placement:x(L).rtlClass==="rtl"?"bottom-end":"bottom-start",offsetDistance:"0",class:"align-middle"},{content:l(()=>[e("ul",te,[(g(!0),h(G,null,H(v.value,(o,u)=>(g(),h("li",{key:u},[e("div",oe,[e("label",se,[e("input",{type:"checkbox",class:"form-checkbox",id:`chk-${u}`,value:o.field,onChange:N=>o.hide=!N.target.checked,checked:!o.hide},null,40,ae),e("span",{for:`chk-${u}`,class:"ltr:ml-2 rtl:mr-2"},w(o.title),9,re)])])]))),128))])]),default:l(()=>[e("button",Z,[ee,c(J,{class:"w-5 h-5"})])]),_:1},8,["placement"])]),e("div",null,[U(e("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>p.value=o),type:"text",class:"form-input",placeholder:"Search..."},null,512),[[q,p.value]])])])]),e("div",ne,[c(x(K),{rows:m.value,columns:v.value,sortable:!0,search:p.value,style:{"min-height":"500px"},"show-pagination":!1,skin:"whitespace-nowrap bh-table-hover",firstArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>',lastArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> ',previousArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>',nextArrow:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'},{type:l(o=>[y(w(I(o.value.type)),1)]),warehouse_id:l(o=>[y(w(B(o.value.warehouse_id)),1)]),pagination:l(()=>[]),_:1},8,["rows","columns","search"]),c(T,{class:"p-2 flex justify-end dark:bg-[#0e1726]","current-page":s.value.page_no,"onUpdate:currentPage":a[1]||(a[1]=o=>s.value.page_no=o),"page-size":s.value.page_size,small:!0,layout:"total, prev, pager, next",total:_.value,onSizeChange:j,onCurrentChange:M},null,8,["current-page","page-size","total"])])])])}}});export{ce as default};
|