var s=(e,i,c)=>new Promise((p,m)=>{var b=o=>{try{n(c.next(o))}catch(u){m(u)}},g=o=>{try{n(c.throw(o))}catch(u){m(u)}},n=o=>o.done?p(o.value):Promise.resolve(o.value).then(b,g);n((c=c.apply(e,i)).next())});import{i as z}from"./index-CWIMkCyU.js";import{B as K,u as W}from"./useTable-yjRWbRcT.js";import{T as q}from"./index-Ctq9WGad.js";import{ao as H,v as J,_ as P}from"./entry/index-BR4aaozk-1722999832476.js";import{g as Q}from"./label-BbAcQGAQ.js";import{u as _}from"./index-C2pYGHuD.js";import X from"./GroupLabelDrawer-Hy1gac-N.js";import Y from"./ContactDrawer-tAureMs2.js";import Z from"./SendMsgDrawer-CdhvIcSz.js";import{c as x,s as ee}from"./contact.data-iY2QMmHz.js";import{g as oe,d as M}from"./contact-BPcRW3zW.js";import{M as T,am as te,aa as ae,bp as ne}from"./antd-BQ3qV6bI.js";import{d as le,f as h,r as F,o as se,k as a,a7 as t,_ as v,$ as re,a9 as r,a8 as E,G as L,a1 as ie,ab as I}from"./vue-BNCny8i2.js";import"./ExclamationCircleOutlined-OYz2z3Y1.js";import"./useForm-BPs-bGop.js";import"./index-bMIGtX2N.js";import"./tree-Bzlcl2-1.js";import"./copyTextToClipboard-ohAWhynX.js";import"./index-CCbSIA2Z.js";import"./index-D0xvMl_A.js";import"./index-94nmOQ7g.js";import"./index-CotF8ozl.js";import"./index-Bm3tDEoh.js";import"./useWindowSizeFn-BpJljGvW.js";import"./plugin-DCXEoXS2.js";import"./onMountedOrActivated-DUkWHYas.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-DWA54z3F.js";import"./labelRelationship-Bw7DU17M.js";const ce=le({name:"ContactManagement",components:{BasicTable:K,SendMsgDrawer:Z,ContactDrawer:Y,GroupLabelDrawer:X,TableAction:q,Button:H,Modal:T,Select:te,Form:ae,FormItem:ne},setup(){const{t:e}=J.useI18n(),i=h(),c=h(!1),p=h(!1),m=h("新增标签"),b=F({lableName:[]}),g=F({lableName:[]}),n=h([]),[o,{openGroupLabelDrawer:u}]=_(),[D,{openDrawer:w}]=_(),[y,{openDrawerMsg:S}]=_(),[k,{reload:f}]=W({title:e("wechat.contact.contactList"),api:oe,columns:x,formConfig:{labelWidth:120,schemas:ee},useSearchForm:!0,showTableSetting:!0,bordered:!1,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:60,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id"});se(()=>s(this,null,function*(){let l=yield Q({page:1,pageSize:1e3,type:1});n.value=l.data}));function B(){w(!0,{isUpdate:!1})}function d(){p.value=!0,m.value="增加标签"}function C(){p.value=!0,m.value="移除标签"}function R(l){l.type==1?w(!0,{record:l,isUpdate:!0}):u(!0,{record:l,isUpdate:!0})}function N(l){S(!0,{record:l})}function G(l){return s(this,null,function*(){(yield M({ids:[l.id]})).code===0&&(yield f())})}function O(){return s(this,null,function*(){T.confirm({title:e("common.deleteConfirm"),icon:a(z.ExclamationCircleOutlined),onOk(){return s(this,null,function*(){(yield M({ids:i.value})).code===0&&(c.value=!1,yield f())})},onCancel(){}})})}function A(){return s(this,null,function*(){yield f()})}function V(){return s(this,null,function*(){yield f()})}function U(){return s(this,null,function*(){})}function $(){return s(this,null,function*(){Object.assign(b,g)})}return{t:e,registerTable:k,registerGroupLabelDrawer:o,registerDrawer:D,registerDrawerMsg:y,handleCreate:B,handleMsg:N,handleEdit:R,handleDelete:G,handleSuccess:A,handleSuccess1:V,handleBatchDelete:O,showDeleteButton:c,handleDeleteLabel:C,handleAddLabel:d,handleOk:U,handleCancel:$,form:b,modalVisible:p,modal_title:m,actionLabel:n}}});function me(e,i,c,p,m,b){const g=t("Button"),n=t("a-button"),o=t("TableAction"),u=t("BasicTable"),D=t("Select"),w=t("FormItem"),y=t("Form"),S=t("Modal"),k=t("GroupLabelDrawer"),f=t("ContactDrawer"),B=t("SendMsgDrawer");return v(),re("div",null,[a(u,{onRegister:e.registerTable},{tableTitle:r(()=>[e.showDeleteButton?(v(),E(g,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:r(()=>[L(ie(e.t("common.delete")),1)]),_:1},8,["onClick"])):I("",!0)]),toolbar:r(()=>[a(n,{onClick:e.handleAddLabel,style:{position:"absolute",left:"0px"}},{default:r(()=>[L(" + 增加标签 ")]),_:1},8,["onClick"]),a(n,{onClick:e.handleDeleteLabel,style:{position:"absolute",left:"110px"}},{default:r(()=>[L(" - 移除标签 ")]),_:1},8,["onClick"])]),bodyCell:r(({column:d,record:C})=>[d.key==="action"?(v(),E(o,{key:0,actions:[{icon:"ant-design:comment-outlined",onClick:e.handleMsg.bind(null,C)},{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,C)}]},null,8,["actions"])):I("",!0)]),_:1},8,["onRegister"]),a(S,{width:"700px",height:"500px",open:e.modalVisible,"onUpdate:open":i[1]||(i[1]=d=>e.modalVisible=d),title:e.modal_title,onOk:e.handleOk,onCancel:e.handleCancel,class:"custom-modal"},{default:r(()=>[a(y,{model:e.form,layout:"inline",style:{height:"300px"}},{default:r(()=>[a(w,{name:"lableName",label:"选择标签",style:{"margin-left":"30px"}},{default:r(()=>[a(D,{value:e.form.lableName,"onUpdate:value":i[0]||(i[0]=d=>e.form.lableName=d),options:e.actionLabel,allowClear:"",mode:"multiple",size:"middle",placeholder:"请选择",style:{width:"560px",margin:"0 5px"}},null,8,["value","options"])]),_:1})]),_:1},8,["model"])]),_:1},8,["open","title","onOk","onCancel"]),a(k,{onRegister:e.registerGroupLabelDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"]),a(f,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"]),a(B,{onRegister:e.registerDrawerMsg,onSuccess:e.handleSuccess1},null,8,["onRegister","onSuccess"])])}const je=P(ce,[["render",me],["__scopeId","data-v-cbf77d41"]]);export{je as default};