1 |
- var D=Object.defineProperty;var h=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var f=(e,a,t)=>a in e?D(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))S.call(a,t)&&f(e,t,a[t]);if(h)for(var t of h(a))B.call(a,t)&&f(e,t,a[t]);return e};var m=(e,a,t)=>new Promise((l,c)=>{var d=s=>{try{i(t.next(s))}catch(r){c(r)}},u=s=>{try{i(t.throw(s))}catch(r){c(r)}},i=s=>s.done?l(s.value):Promise.resolve(s.value).then(d,u);i((t=t.apply(e,a)).next())});import{B as L,u as v}from"./useForm-DYTnyn58.js";import{b as F,aq as k,v as C,_ as x}from"./entry/index-CP6zkLsN-1726190694502.js";import{a as R,c as y}from"./labelRelationship-DjDE7Gp4.js";import{l as T,d as $,f as q,c as P,u as p,a6 as w,_ as N,a7 as O,a8 as j,k as A,aa as V}from"./vue-CmlY4eyV.js";import{a9 as G}from"./antd-Bp5u6ujY.js";import{B as U,a as z}from"./index-Bh1SitHa.js";const{t:o}=F(),ae=[{title:o("wechat.labelRelationship.labelId"),dataIndex:"labelId",width:100},{title:o("wechat.labelRelationship.contactId"),dataIndex:"contactId",width:100},{title:o("wechat.labelRelationship.contact"),dataIndex:"contact",width:100},{title:o("wechat.labelRelationship.label"),dataIndex:"label",width:100},{title:o("common.status"),dataIndex:"status",width:50,customRender:({record:e})=>(Reflect.has(e,"pendingStatus")||(e.pendingStatus=!1),T(G,{checked:e.status===1,checkedChildren:o("common.on"),unCheckedChildren:o("common.off"),loading:e.pendingStatus,onChange(a,t){e.pendingStatus=!0;const l=a?1:2;R({id:e.id,status:l}).then(()=>{e.status=l}).finally(()=>{e.pendingStatus=!1})}}))},{title:o("common.createTime"),dataIndex:"createdAt",width:70,customRender:({record:e})=>k(e.createdAt)}],oe=[],M=[{field:"id",label:"ID",component:"Input",show:!1},{field:"labelId",label:o("wechat.labelRelationship.labelId"),component:"InputNumber",required:!0},{field:"contactId",label:o("wechat.labelRelationship.contactId"),component:"InputNumber",required:!0},{field:"contact",label:o("wechat.labelRelationship.contact"),component:"Input",required:!0},{field:"label",label:o("wechat.labelRelationship.label"),component:"Input",required:!0},{field:"status",label:o("wechat.labelRelationship.status"),component:"RadioButtonGroup",defaultValue:1,componentProps:{options:[{label:o("common.on"),value:1},{label:o("common.off"),value:2}]}}],W=$({name:"LabelRelationshipDrawer",components:{BasicDrawer:U,BasicForm:L},emits:["success","register"],setup(e,{emit:a}){const t=q(!0),{t:l}=C.useI18n(),[c,{resetFields:d,setFieldsValue:u,validate:i}]=v({labelWidth:160,baseColProps:{span:24},layout:"vertical",schemas:M,showActionButtonGroup:!1}),[s,{setDrawerProps:r,closeDrawer:g}]=z(n=>m(this,null,function*(){d(),r({confirmLoading:!1}),t.value=!!(n!=null&&n.isUpdate),p(t)&&u(b({},n.record))})),I=P(()=>p(t)?l("wechat.labelRelationship.editLabelRelationship"):l("wechat.labelRelationship.addLabelRelationship"));function _(){return m(this,null,function*(){const n=yield i();r({confirmLoading:!0}),n.id=p(t)?Number(n.id):0,(p(t)?yield R(n):yield y(n)).code===0&&(g(),a("success")),r({confirmLoading:!1})})}return{registerDrawer:s,registerForm:c,getTitle:I,handleSubmit:_}}});function E(e,a,t,l,c,d){const u=w("BasicForm"),i=w("BasicDrawer");return N(),O(i,V(e.$attrs,{onRegister:e.registerDrawer,showFooter:"",title:e.getTitle,width:"500px",onOk:e.handleSubmit}),{default:j(()=>[A(u,{onRegister:e.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}const H=x(W,[["render",E]]),se=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"}));export{H as L,se as a,ae as c,oe as s};
|