var k=Object.defineProperty;var O=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var F=(r,s,o)=>s in r?k(r,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[s]=o,P=(r,s)=>{for(var o in s||(s={}))v.call(s,o)&&F(r,o,s[o]);if(O)for(var o of O(s))x.call(s,o)&&F(r,o,s[o]);return r};var n=(r,s,o)=>new Promise((c,d)=>{var e=l=>{try{a(o.next(l))}catch(i){d(i)}},t=l=>{try{a(o.throw(l))}catch(i){d(i)}},a=l=>l.done?c(l.value):Promise.resolve(l.value).then(e,t);a((o=o.apply(r,s)).next())});import{B as z,__tla as Y}from"./BasicForm-1f7b4828.js";import{__tla as B}from"./componentMap-44c327dc.js";import{u as q,__tla as G}from"./useForm-2e36096a.js";import{__tla as W}from"./RadioButtonGroup-3086b2b2.js";import{o as V,__tla as K}from"./house-5457514e.js";import{n as R,d as U,k as j,u as S,e as J,a7 as A,_ as Z,a8 as $,a9 as Q,f as X,ac as ee}from"./vue-1631514e.js";import{a2 as D}from"./antd-057b41b1.js";import{B as te,a as ae,__tla as re}from"./index-49ac20fc.js";import{af as oe,d as _,N as u,O as b,J as le,_ as se,__tla as ne}from"./index-f0df2f76.js";let y,f,C,H,g,h,ie=Promise.all([(()=>{try{return Y}catch(r){}})(),(()=>{try{return B}catch(r){}})(),(()=>{try{return G}catch(r){}})(),(()=>{try{return W}catch(r){}})(),(()=>{try{return K}catch(r){}})(),(()=>{try{return re}catch(r){}})(),(()=>{try{return ne}catch(r){}})()]).then(()=>n(void 0,null,function*(){let r;H=[{title:"\u50A8\u533A\u7F16\u53F7",resizable:!0,sorter:!0,dataIndex:"REGION_CODE"},{title:"\u8D27\u67B6\u540D\u79F0",resizable:!0,sorter:!0,dataIndex:"SHELF_NAME"},{title:"\u8D27\u67B6\u503C",resizable:!0,sorter:!0,dataIndex:"SHELF_CODE"},{title:"\u8D27\u67B6\u5C42\u6570",resizable:!0,sorter:!0,dataIndex:"FLOORS"},{title:"\u8D27\u67B6\u7C7B\u578B",resizable:!0,sorter:!0,dataIndex:"SHELF_TYPE",customRender:({record:e})=>{const t=e.SHELF_TYPE;let a="",l="";switch(t){case 0:a="\u666E\u901A",l="#C2C247";break;case 1:a="\u4E8C\u7EF4\u7801\u5F0F",l="#C2C247";break;case 2:a="\u611F\u5E94\u5F0F",l="blue";break;case 3:a="\u865A\u62DF\u8D27\u67B6",l="green";break}return R(D,{color:l},()=>a)}},{title:"\u662F\u5426\u53EF\u7528",resizable:!0,sorter:!0,dataIndex:"IS_AVAILABLE",customRender:({record:e})=>{const t=e.IS_AVAILABLE==="Y",a=t?"green":"red",l=t?"\u542F\u7528":"\u505C\u7528";return R(D,{color:a},()=>l)}},{title:"IP\u5730\u5740",resizable:!0,sorter:!0,dataIndex:"IP",width:180},{title:"\u7AEF\u53E3",resizable:!0,sorter:!0,dataIndex:"PORT",width:80},{title:"\u521B\u5EFA\u65F6\u95F4",resizable:!0,sorter:!0,dataIndex:"CREATE_TIME",width:180},{title:"\u5907\u6CE8",resizable:!0,sorter:!0,dataIndex:"REMARK"}],h=[{field:"REGION_CODE",label:"\u50A8\u533A\u7F16\u53F7",component:"Input",colProps:{span:8}},{field:"SHELF_NAME",label:"\u8D27\u67B6\u540D\u79F0",component:"Input",colProps:{span:8}},{field:"SHELF_CODE",label:"\u8D27\u67B6\u7F16\u7801",component:"Input",colProps:{span:8}},{field:"SHELF_TYPE",component:"ApiSelect",label:"\u8D27\u67B6\u7C7B\u578B",colProps:{span:6},componentProps:{api:V,resultField:"Data",labelField:"Desc",valueField:"Value"},required:!1}],r=[{field:"REGION_CODE",label:"\u50A8\u533A\u7F16\u53F7",required:!0,component:"Input",colProps:{span:8}},{field:"SHELF_NAME",label:"\u8D27\u67B6\u540D\u79F0",required:!0,component:"Input",colProps:{span:8}},{field:"SHELF_CODE",label:"\u8D27\u67B6\u503C",required:!0,component:"Input",colProps:{span:8}},{field:"ID",label:"ID",component:"Input",show:!1},{field:"FLOORS",label:"\u8D27\u67B6\u5C42\u6570",required:!0,component:"Input",colProps:{span:8}},{field:"FLOOR_COUNT",label:"\u6BCF\u5C42\u50A8\u4F4D\u6570",required:!0,component:"Input",colProps:{span:8}},{field:"DIRECTION",label:"\u50A8\u4F4D\u65B9\u5411",required:!0,component:"Input",colProps:{span:8}},{field:"RACKID",label:"\u8D27\u67B6ID",component:"Input",colProps:{span:8}},{field:"WEBHOOK_URL",label:"\u6599\u8F66\u4E0A\u62A5",component:"Input",colProps:{span:16}},{field:"SHELF_TYPE",label:"\u8D27\u67B6/\u6599\u8F66\u7C7B\u578B",required:!0,component:"Select",colProps:{span:8},componentProps:{options:[{label:"\u4F20\u7EDF\u5F0F",value:0,key:0},{label:"\u4E8C\u7EF4\u7801\u5F0F",value:1,key:1},{label:"\u611F\u5E94\u5F0F",value:2,key:2},{label:"\u5361\u677F\u6808\u677F",value:3,key:3},{label:"\u865A\u62DF\u8D27\u67B6",value:4,key:4}]}},{field:"IS_CAR",label:"\u662F\u5426\u6599\u8F66",required:!0,component:"Select",colProps:{span:8},componentProps:{options:[{label:"\u662F",value:"Y",key:"Y"},{label:"\u5426",value:"N",key:"N"}]}},{field:"IS_AVAILABLE",label:"\u662F\u5426\u53EF\u7528",required:!0,component:"Select",colProps:{span:8},componentProps:{options:[{label:"\u662F",value:"Y",key:"Y"},{label:"\u5426",value:"N",key:"N"}]}},{field:"IP",label:"IP\u5730\u5740",component:"Input",colProps:{span:16}},{field:"PORT",label:"\u7AEF\u53E3",component:"Input",colProps:{span:8}},{field:"REMARK",label:"\u5907\u6CE8",component:"Input",colProps:{span:24}}],g=e=>n(void 0,null,function*(){let t="";(e==null?void 0:e.REGION_CODE)!=null&&(e==null?void 0:e.REGION_CODE)!=""&&(t+=" And REGION_CODE like '%"+(e==null?void 0:e.REGION_CODE)+"%'"),(e==null?void 0:e.SHELF_CODE)!=null&&(e==null?void 0:e.SHELF_CODE)!=""&&(t+=" And SHELF_CODE = '"+(e==null?void 0:e.SHELF_CODE)+"'"),(e==null?void 0:e.SHELF_NAME)!=null&&(e==null?void 0:e.SHELF_NAME)!=""&&(t+="And SHELF_NAME like '%"+(e==null?void 0:e.SHELF_NAME)+"%'"),(e==null?void 0:e.IS_CAR)!=null&&(e==null?void 0:e.IS_CAR)!=""&&(t+="And IS_CAR = '"+(e==null?void 0:e.IS_CAR)+"'"),(e==null?void 0:e.SHELF_TYPE)!=null&&(t+="And SHELF_TYPE = '"+(e==null?void 0:e.SHELF_TYPE)+"'");const a=oe("WMS_SHELF",t,e.page,e.pageSize);return s(a)});function s(e){return n(this,null,function*(){const t=yield _.post({url:u.EntityPageList,params:e},{isTransformResponse:!1});return{items:t.Data.data,total:t.Data.totals}})}let o,c;o=(e,t)=>n(void 0,null,function*(){let a;return t?a=yield _.post({url:u.UpdateEntity,params:b("WMS_SHELF",e)},{errorMessageMode:"none",isTransformResponse:!1}):(e.ID=le(),a=yield _.post({url:u.AddEntity,params:b("WMS_SHELF",e)},{errorMessageMode:"none",isTransformResponse:!1})),a}),y=e=>n(void 0,null,function*(){const t=b("WMS_SHELF",[e]);return yield _.post({url:u.DeleteList,params:t},{errorMessageMode:"none",isTransformResponse:!1})}),c=U({name:"ShelfDrawer",components:{BasicDrawer:te,BasicForm:z},emits:["success","register"],setup(e,{emit:t}){const a=j(!0),[l,{resetFields:i,setFieldsValue:L,validate:E}]=q({labelWidth:120,schemas:r,actionColOptions:{span:24},showActionButtonGroup:!1}),[m,{setDrawerProps:I,closeDrawer:M}]=ae(p=>n(this,null,function*(){i(),I({confirmLoading:!1}),a.value=!!(p!=null&&p.isUpdate),S(a)&&L(P({},p.record))})),N=J(()=>S(a)?"\u7F16\u8F91\u8D27\u67B6":"\u65B0\u589E\u8D27\u67B6");function w(){return n(this,null,function*(){try{const p=yield E();I({confirmLoading:!0}),o(p,S(a)).then(T=>{T.IsSuccessed&&(M(),t("success"))})}finally{I({confirmLoading:!1})}})}return{registerDrawer:m,registerForm:l,getTitle:N,handleSubmit:w}}});function d(e,t,a,l,i,L){const E=A("BasicForm"),m=A("BasicDrawer");return Z(),$(m,ee(e.$attrs,{onRegister:e.registerDrawer,showFooter:"",title:e.getTitle,width:"800px",onOk:e.handleSubmit}),{default:Q(()=>[X(E,{onRegister:e.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}f=se(c,[["render",d]]),C=Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"}))}));export{y as D,f as S,ie as __tla,C as a,H as c,g,h as s};