| 1 |
- import{d as S,u as D,b as V,e as s,p as $,R,A as F,B as k,c as h,a as e,f as d,w as l,j as x,m as U,v as E,y as q,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"},ae={class:"cursor-pointer mb-0"},se=["id","value","onChange","checked"],re=["for"],ne={class:"datatable"},de=S({__name:"locationArea",setup(le){D({title:"Column Chooser Table"});const C=q(),L=V(),p=s(""),m=s([]);s([]);const i=s([]);s([]);const c=s([]),A=s([]),v=s([{field:"code",title:"区域编号",hide:!0},{field:"name",title:"名称",hide:!1},{field:"remark",title:"备注",hide:!1}]),r=s([{page_no:1,page_size:10}]),_=s(0),z=()=>{C.replace({name:"home"})},j=t=>{console.log(`${t} items per page`)},M=t=>{r.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:""}},T=t=>{if(t&&c.value&&c.value.data){const a=c.value.data.find(n=>n.code===t);return a?a.name:""}};$(()=>{f(),I()});const f=async()=>{R.listAreaType({page_no:r.page_no,page_size:r.page_size}).then(t=>{r.page_no=t.data.page_no,r.page_size=t.data.page_size,_.value=t.data.data_total,m.value=t.data})},I=async()=>{i.value=await F.warehouseList({}),c.value=await k.listAreaType(r),A.value=await k.getPage({dictType:"transfer_status"})};return(t,a)=>{const n=b("Popper"),P=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:z},"首页")]),O]),e("div",Q,[e("div",W,[e("div",X,[e("div",Y,[d(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",ae,[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,se),e("span",{for:`chk-${u}`,class:"ltr:ml-2 rtl:mr-2"},w(o.title),9,re)])])]))),128))])]),default:l(()=>[e("button",Z,[ee,d(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),[[E,p.value]])])])]),e("div",ne,[d(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(T(o.value.type)),1)]),warehouse_id:l(o=>[y(w(B(o.value.warehouse_id)),1)]),pagination:l(()=>[]),_:1},8,["rows","columns","search"]),d(P,{class:"p-2 flex justify-end dark:bg-[#0e1726]","current-page":r.value.page_no,"onUpdate:currentPage":a[1]||(a[1]=o=>r.value.page_no=o),"page-size":r.value.page_size,small:!0,layout:"total, prev, pager, next",total:_.value,onSizeChange:j,onCurrentChange:M},null,8,["current-page","page-size","total"])])])])}}});export{de as default};
|