1 |
- var D=Object.defineProperty;var d=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var f=(t,o,e)=>o in t?D(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,w=(t,o)=>{for(var e in o||(o={}))F.call(o,e)&&f(t,e,o[e]);if(d)for(var e of d(o))v.call(o,e)&&f(t,e,o[e]);return t};var u=(t,o,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(t,o)).next())});import{a as C,b as L}from"./useForm-S2-4SPyv.js";import{g as R}from"./contact.data-Bc2BHBKH.js";import{B as I,a as k}from"./index-D8-pH9_c.js";import{v as $,_ as y}from"./entry/index-BFpON5wd-1719886843165.js";import{c as G}from"./contact-TVqas2rB.js";import{u as P}from"./labelRelationship-Bbugm4Q9.js";import{d as S,f as N,c as O,u as l,a7 as g,_ as T,a8 as U,a9 as V,k as j,ac as A}from"./vue-B3Yl1XMW.js";import"./index-D--g-WIs.js";import"./antd-V2f1Ijkg.js";import"./tree-Dcz2GpQj.js";import"./copyTextToClipboard-TytJuPBe.js";import"./index-Cx3rMS0Q.js";import"./index-eZbZN8hc.js";import"./useWindowSizeFn-IiF7s4QS.js";import"./plugin-DHZ68pLH.js";import"./useSortable-Dipa7Xkv.js";import"./index-BN89L_L8.js";import"./index-DBtUZ0LU.js";import"./onMountedOrActivated-Cz7FEpZo.js";import"./label-Lo-UVTVj.js";const W=S({name:"GroupLabelDrawer",components:{BasicDrawer:I,BasicForm:C},emits:["success","register"],setup(t,{emit:o}){const e=N(!0),{t:n}=$.useI18n(),[c,{resetFields:p,setFieldsValue:m,validate:a}]=L({labelWidth:160,baseColProps:{span:24},layout:"vertical",schemas:R,showActionButtonGroup:!1}),[s,{setDrawerProps:i,closeDrawer:h}]=k(r=>u(this,null,function*(){p(),i({confirmLoading:!1}),e.value=!!(r!=null&&r.isUpdate),l(e)&&m(w({},r.record))})),b=O(()=>l(e)?n("wechat.contact.editContact"):n("wechat.contact.addContact"));function _(){return u(this,null,function*(){const r=yield a();i({confirmLoading:!0}),r.id=l(e)?Number(r.id):0;const B={status:1,labelIds:r.labelRelationships,contactId:r.id};(l(e)?yield P(B):yield G(r)).code===0&&(h(),o("success")),i({confirmLoading:!1})})}return{registerDrawer:s,registerForm:c,getTitle:b,handleSubmit:_}}});function q(t,o,e,n,c,p){const m=g("BasicForm"),a=g("BasicDrawer");return T(),U(a,A(t.$attrs,{onRegister:t.registerDrawer,showFooter:"",title:t.getTitle,width:"500px",onOk:t.handleSubmit}),{default:V(()=>[j(m,{onRegister:t.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}const le=y(W,[["render",q]]);export{le as default};
|