var z=Object.defineProperty;var g=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var D=(a,n,r)=>n in a?z(a,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[n]=r,M=(a,n)=>{for(var r in n||(n={}))B.call(n,r)&&D(a,r,n[r]);if(g)for(var r of g(n))F.call(n,r)&&D(a,r,n[r]);return a};var l=(a,n,r)=>new Promise((_,p)=>{var t=o=>{try{e(r.next(o))}catch(i){p(i)}},s=o=>{try{e(r.throw(o))}catch(i){p(i)}},e=o=>o.done?_(o.value):Promise.resolve(o.value).then(t,s);e((r=r.apply(a,n)).next())});import{B as W,__tla as x}from"./BasicForm-1f7b4828.js";import{__tla as L}from"./componentMap-44c327dc.js";import{u as k,__tla as v}from"./useForm-2e36096a.js";import{__tla as q}from"./RadioButtonGroup-3086b2b2.js";import{B as U,a as j,__tla as H}from"./index-49ac20fc.js";import{af as J,d,N as u,O,J as K,_ as V,__tla as Q}from"./index-f0df2f76.js";import{d as X,k as Y,u as R,e as $,a7 as y,_ as Z,a8 as tt,a9 as at,f as rt,ac as st}from"./vue-1631514e.js";let G,f,b,h,w,A,et=Promise.all([(()=>{try{return x}catch(a){}})(),(()=>{try{return L}catch(a){}})(),(()=>{try{return v}catch(a){}})(),(()=>{try{return q}catch(a){}})(),(()=>{try{return H}catch(a){}})(),(()=>{try{return Q}catch(a){}})()]).then(()=>l(void 0,null,function*(){let a;b=[{title:"\u50A8\u533A\u7F16\u7801",resizable:!0,sorter:!0,dataIndex:"REGION_CODE"},{title:"\u50A8\u533A\u540D\u79F0",resizable:!0,sorter:!0,dataIndex:"REGION_NAME"},{title:"\u4ED3\u5E93\u7F16\u53F7",resizable:!0,sorter:!0,dataIndex:"WH_CODE"},{title:"\u521B\u5EFA\u65F6\u95F4",resizable:!0,sorter:!0,dataIndex:"CREATE_TIME",width:180},{title:"\u5907\u6CE8",resizable:!0,sorter:!0,dataIndex:"REMARK"}],A=[{field:"REGION_CODE",label:"\u50A8\u533A\u7F16\u7801",component:"Input",colProps:{span:8}},{field:"REGION_NAME",label:"\u50A8\u533A\u540D\u79F0",component:"Input",colProps:{span:8}}],a=[{field:"REGION_CODE",label:"\u50A8\u533A\u7F16\u7801",required:!0,component:"Input",colProps:{span:8}},{field:"ID",label:"ID",component:"Input",show:!1},{field:"REGION_NAME",label:"\u50A8\u533A\u540D\u79F0",required:!0,component:"Input",colProps:{span:8}},{field:"WAREHOUESE_CODE",label:"\u4ED3\u5E93\u7F16\u53F7",required:!0,component:"Input",colProps:{span:8}},{field:"REMARK",label:"\u5907\u6CE8",component:"Input",colProps:{span:24}}],h=t=>l(void 0,null,function*(){let s="";(t==null?void 0:t.REGION_CODE)!=null&&(t==null?void 0:t.REGION_CODE)!=""&&(s+="And REGION_CODE like '%"+(t==null?void 0:t.REGION_CODE)+"%'"),(t==null?void 0:t.REGION_NAME)!=null&&(t==null?void 0:t.REGION_NAME)!=""&&(s+="And REGION_NAME = '"+(t==null?void 0:t.REGION_NAME)+"'");const e=J("WMS_REGION",s,t.page,t.pageSize);return n(e)});function n(t){return l(this,null,function*(){const s=yield d.post({url:u.EntityPageList,params:t},{isTransformResponse:!1});return{items:s.Data.data,total:s.Data.totals}})}let r,_;r=(t,s)=>l(void 0,null,function*(){let e;return s?e=yield d.post({url:u.UpdateEntity,params:O("WMS_REGION",t)},{errorMessageMode:"none",isTransformResponse:!1}):(t.ID=K(),e=yield d.post({url:u.AddEntity,params:O("WMS_REGION",t)},{errorMessageMode:"none",isTransformResponse:!1})),e}),G=t=>l(void 0,null,function*(){const s=O("WMS_REGION",[t]);return yield d.post({url:u.DeleteList,params:s},{errorMessageMode:"none",isTransformResponse:!1})}),_=X({name:"RegionDrawer",components:{BasicDrawer:U,BasicForm:W},emits:["success","register"],setup(t,{emit:s}){const e=Y(!0),[o,{resetFields:i,setFieldsValue:N,validate:m}]=k({labelWidth:120,schemas:a,actionColOptions:{span:24},showActionButtonGroup:!1}),[E,{setDrawerProps:I,closeDrawer:C}]=j(c=>l(this,null,function*(){i(),I({confirmLoading:!1}),e.value=!!(c!=null&&c.isUpdate),R(e)&&N(M({},c.record))})),S=$(()=>R(e)?"\u7F16\u8F91\u50A8\u533A":"\u65B0\u589E\u50A8\u533A");function P(){return l(this,null,function*(){try{const c=yield m();I({confirmLoading:!0}),r(c,R(e)).then(T=>{T.IsSuccessed&&(C(),s("success"))})}finally{I({confirmLoading:!1})}})}return{registerDrawer:E,registerForm:o,getTitle:S,handleSubmit:P}}});function p(t,s,e,o,i,N){const m=y("BasicForm"),E=y("BasicDrawer");return Z(),tt(E,st(t.$attrs,{onRegister:t.registerDrawer,showFooter:"",title:t.getTitle,width:"800px",onOk:t.handleSubmit}),{default:at(()=>[rt(m,{onRegister:t.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}f=V(_,[["render",p]]),w=Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"}))}));export{G as D,f as R,et as __tla,b as c,h as g,w as r,A as s};