BatchMsgDrawer-NQ3Y9hu5.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((n,c)=>{var p=s=>{try{a(e.next(s))}catch(i){c(i)}},m=s=>{try{a(e.throw(s))}catch(i){c(i)}},a=s=>s.done?n(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-D8a_tSFM.js";import{f as k,u as $,c as C}from"./batchMsg-SjB3H_k3.js";import{B as R,a as y}from"./index-CKMlJskw.js";import{v as I,_ as L}from"./entry/index-zvKn-pdS-1723036128379.js";import{d as P,f as S,c as N,u,a5 as h,_ as O,a6 as T,a7 as U,k as V,aa as j}from"./vue-Ba_NIFIa.js";import"./index-DS6n8p4f.js";import"./antd-BpJVMJkC.js";import"./tree-DdC1qZyg.js";import"./copyTextToClipboard-B4RY9W25.js";import"./index-CGRglBZ4.js";import"./index-Bx5TlaPA.js";import"./index--nwGrTER.js";import"./useWindowSizeFn-DqPnFPyk.js";import"./plugin-CDKNJrX9.js";import"./useSortable-BU8vLfok.js";import"./index-D3r27tdG.js";import"./index-CyokevPp.js";import"./index-Du5qVIel.js";import"./onMountedOrActivated-BsbclbaU.js";import"./label-CdPzZZ2w.js";const A=P({name:"BatchMsgDrawer",components:{BasicDrawer:R,BasicForm:b},emits:["success","register"],setup(r,{emit:t}){const e=S(!0),{t:n}=I.useI18n(),[c,{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)?n("wechat.batchMsg.editBatchMsg"):n("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:c,getTitle:B,handleSubmit:_}}});function G(r,t,e,n,c,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};