BatchMsgDrawer-D0ugEEwr.js 2.4 KB

1
  1. var D=Object.defineProperty;var f=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var d=(r,t,e)=>t in r?D(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,g=(r,t)=>{for(var e in t||(t={}))F.call(t,e)&&d(r,e,t[e]);if(f)for(var e of f(t))M.call(t,e)&&d(r,e,t[e]);return r};var l=(r,t,e)=>new Promise((c,n)=>{var p=s=>{try{a(e.next(s))}catch(i){n(i)}},m=s=>{try{a(e.throw(s))}catch(i){n(i)}},a=s=>s.done?c(s.value):Promise.resolve(s.value).then(p,m);a((e=e.apply(r,t)).next())});import{B as b,u as v}from"./useForm-CT3jbI8E.js";import{f as k,u as $,c as C}from"./batchMsg-BJvMn9hp.js";import{B as R,a as y}from"./index-4VYRrlov.js";import{v as I,_ as L}from"./entry/index-CmQmcgVX-1722947009025.js";import{d as P,f as S,c as N,u,a7 as h,_ as O,a8 as T,a9 as U,k as V,ac as j}from"./vue-BNCny8i2.js";import"./index-RuA9g7mG.js";import"./antd-Da-U8e33.js";import"./tree-r2zLM0s-.js";import"./copyTextToClipboard-W8PXYY-K.js";import"./index-CfBz3pOO.js";import"./index-Bs6oOfhC.js";import"./index-K4HGtjGs.js";import"./useWindowSizeFn-CDLb2t6U.js";import"./plugin-BJOvH3fv.js";import"./useSortable-ShHu8Y34.js";import"./index-CRD2KyxH.js";import"./index-DQp1zcaB.js";import"./index-DJeguOKX.js";import"./onMountedOrActivated-DUkWHYas.js";import"./label-Ck23qgyo.js";const A=P({name:"BatchMsgDrawer",components:{BasicDrawer:R,BasicForm:b},emits:["success","register"],setup(r,{emit:t}){const e=S(!0),{t:c}=I.useI18n(),[n,{resetFields:p,setFieldsValue:m,validate:a}]=v({labelWidth:160,baseColProps:{span:24},layout:"vertical",schemas:k,showActionButtonGroup:!1}),[s,{setDrawerProps:i,closeDrawer:w}]=y(o=>l(this,null,function*(){p(),i({confirmLoading:!1}),e.value=!!(o!=null&&o.isUpdate),u(e)&&m(g({},o.record))})),B=N(()=>u(e)?c("wechat.batchMsg.editBatchMsg"):c("wechat.batchMsg.addBatchMsg"));function _(){return l(this,null,function*(){const o=yield a();i({confirmLoading:!0}),o.id=u(e)?Number(o.id):0,(u(e)?yield $(o):yield C(o)).code===0&&(w(),t("success")),i({confirmLoading:!1})})}return{registerDrawer:s,registerForm:n,getTitle:B,handleSubmit:_}}});function G(r,t,e,c,n,p){const m=h("BasicForm"),a=h("BasicDrawer");return O(),T(a,j(r.$attrs,{onRegister:r.registerDrawer,showFooter:"",title:r.getTitle,width:"35%",onOk:r.handleSubmit}),{default:U(()=>[V(m,{onRegister:r.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}const pe=L(A,[["render",G]]);export{pe as default};