Rodney Chen
2024-05-09 a340c8f451865656db12fa50fe9cad888f65dd5b
1
var P=Object.defineProperty;var E=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var F=(e,o,a)=>o in e?P(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,g=(e,o)=>{for(var a in o||(o={}))x.call(o,a)&&F(e,a,o[a]);if(E)for(var a of E(o))B.call(o,a)&&F(e,a,o[a]);return e};var l=(e,o,a)=>new Promise((d,_)=>{var t=n=>{try{s(a.next(n))}catch(i){_(i)}},r=n=>{try{s(a.throw(n))}catch(i){_(i)}},s=n=>n.done?d(n.value):Promise.resolve(n.value).then(t,r);s((a=a.apply(e,o)).next())});import{B as k,__tla as z}from"./BasicForm-1f7b4828.js";import{__tla as v}from"./componentMap-44c327dc.js";import{u as L,__tla as U}from"./useForm-2e36096a.js";import{__tla as q}from"./RadioButtonGroup-3086b2b2.js";import{n as V,d as j,k as W,u as f,e as G,a7 as D,_ as H,a8 as J,a9 as Q,f as X,ac as Z}from"./vue-1631514e.js";import{a2 as $}from"./antd-057b41b1.js";import{B as K,a as tt,__tla as et}from"./index-49ac20fc.js";import{af as at,d as p,N as u,O,J as rt,_ as st,__tla as ot}from"./index-f0df2f76.js";let I,C,y,Y,h,w,nt=Promise.all([(()=>{try{return z}catch(e){}})(),(()=>{try{return v}catch(e){}})(),(()=>{try{return U}catch(e){}})(),(()=>{try{return q}catch(e){}})(),(()=>{try{return et}catch(e){}})(),(()=>{try{return ot}catch(e){}})()]).then(()=>l(void 0,null,function*(){let e;y=[{title:"\u5DE5\u5382\u4EE3\u7801",dataIndex:"FACTORY_CODE",resizable:!0,sorter:!0,width:200},{title:"\u5DE5\u5382\u540D\u79F0",dataIndex:"FACTORY_NAME",resizable:!0,sorter:!0,width:180},{title:"\u72B6\u6001",dataIndex:"ACTIVESTATUS",customRender:({record:t})=>{const r=t.ACTIVESTATUS==="Y",s=r?"green":"red",n=r?"\u542F\u7528":"\u505C\u7528";return V($,{color:s},()=>n)}},{title:"\u63CF\u8FF0",dataIndex:"DESCRIPTION",resizable:!0,sorter:!0,width:180},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"CREATETIME",resizable:!0,sorter:!0,width:180}],w=[{field:"FACTORY_NAME",label:"\u5DE5\u5382\u540D\u79F0",component:"Input",colProps:{span:8}},{field:"FACTORY_CODE",label:"\u5DE5\u5382\u4EE3\u7801",component:"Input",colProps:{span:8}}],e=[{field:"FACTORY_NAME",label:"\u5DE5\u5382\u540D\u79F0",required:!0,component:"Input"},{field:"FACTORY_CODE",label:"\u5DE5\u5382\u4EE3\u7801",required:!0,component:"Input"},{field:"DESCRIPTION",label:"\u5DE5\u5382\u63CF\u8FF0",required:!0,component:"Input"},{field:"ACTIVESTATUS",label:"\u72B6\u6001",required:!0,component:"Select",componentProps:{options:[{label:"\u542F\u7528",value:"Y",key:"Y"},{label:"\u505C\u7528",value:"N",key:"N"}]}},{field:"ID",label:"\u5DE5\u5382ID",component:"Input",show:!1}],h=t=>l(void 0,null,function*(){let r="";(t==null?void 0:t.FACTORY_CODE)!=null&&(t==null?void 0:t.FACTORY_CODE)!=""&&(r+=" And FACTORY_CODE = '"+(t==null?void 0:t.FACTORY_CODE)+"'"),(t==null?void 0:t.FACTORY_NAME)!=null&&(t==null?void 0:t.FACTORY_NAME)!=""&&(r+="And FACTORY_NAME like '%"+(t==null?void 0:t.FACTORY_NAME)+"%'");const s=at("FACTORY",r,t.page,t.pageSize);return o(s)});function o(t){return l(this,null,function*(){const r=yield p.post({url:u.EntityPageList,params:t},{isTransformResponse:!1});return{items:r.Data.data,total:r.Data.totals}})}let a,d;a=(t,r)=>l(void 0,null,function*(){let s;return r?s=yield p.post({url:u.UpdateEntity,params:O("FACTORY",t)},{errorMessageMode:"none",isTransformResponse:!1}):(t.ID=rt(),s=yield p.post({url:u.AddEntity,params:O("FACTORY",t)},{errorMessageMode:"none",isTransformResponse:!1})),s}),I=t=>l(void 0,null,function*(){const r=O("FACTORY",[t]);return yield p.post({url:u.DeleteList,params:r},{errorMessageMode:"none",isTransformResponse:!1})}),d=j({name:"WHDrawer",components:{BasicDrawer:K,BasicForm:k},emits:["success","register"],setup(t,{emit:r}){const s=W(!0),[n,{resetFields:i,setFieldsValue:R,validate:m}]=L({labelWidth:90,schemas:e,showActionButtonGroup:!1}),[T,{setDrawerProps:A,closeDrawer:b}]=tt(c=>l(this,null,function*(){i(),A({confirmLoading:!1}),s.value=!!(c!=null&&c.isUpdate),f(s)&&R(g({},c.record))})),M=G(()=>f(s)?"\u7F16\u8F91\u5DE5\u5382":"\u65B0\u589E\u5DE5\u5382");function S(){return l(this,null,function*(){try{const c=yield m();A({confirmLoading:!0}),a(c,f(s)).then(N=>{N.IsSuccessed&&(b(),r("success"))})}finally{A({confirmLoading:!1})}})}return{registerDrawer:T,registerForm:n,getTitle:M,handleSubmit:S}}});function _(t,r,s,n,i,R){const m=D("BasicForm"),T=D("BasicDrawer");return H(),J(T,Z(t.$attrs,{onRegister:t.registerDrawer,showFooter:"",title:t.getTitle,width:"500px",onOk:t.handleSubmit}),{default:Q(()=>[X(m,{onRegister:t.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}C=st(d,[["render",_]]),Y=Object.freeze(Object.defineProperty({__proto__:null,default:C},Symbol.toStringTag,{value:"Module"}))}));export{I as D,C as F,nt as __tla,y as c,Y as f,h as g,w as s};