Files
qhmes/web-dist/js/ImCreateGroupModal-Co9b_zTb.js
2026-06-16 18:19:57 +08:00

2 lines
3.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var f=(w,b,i)=>new Promise((h,u)=>{var c=o=>{try{r(i.next(o))}catch(m){u(m)}},l=o=>{try{r(i.throw(o))}catch(m){u(m)}},r=o=>o.done?h(o.value):Promise.resolve(o.value).then(c,l);r((i=i.apply(w,b)).next())});import{B as O}from"./index-BDvqZ5j4.js";import{u as V,s as z,F as H,aB as R,aG as $,aH as q,bL as K,v as Y,cZ as Q,eP as W,eh as Z,eD as j,au as J}from"./index-X7Y8jykP.js";import{a as X}from"./useModal-DaJ3Bflg.js";import"./index-DSsDi_fL.js";import{v as ee,C as ae}from"./Group-UHkub2tu.js";import{A as te}from"./index-B4gPlWQt.js";import{e as oe,y as x,z as g,A as n,B as re,u as U,f as s,r as _,Q as M,H as se,C as B,F as ne,D as le,c as me,E as ie,G as N}from"./vue-vendor-DNhG1Cve.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useTimeout-D5AmIBZw.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./index-BzChaRPg.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./useAppInject-DPZGPcR3.js";import"./index-CuWaQdlK.js";import"./index-DO7ZhK45.js";import"./Checkbox-Dbxs4we4.js";import"./index-BuONesFs.js";import"./eagerComputed-BTlOruLW.js";const ue={class:"member-list"},ce={class:"member-info"},pe={class:"member-name"},de=oe({name:"ImCreateGroupModal",__name:"ImCreateGroupModal",emits:["success"],setup(w,{emit:b}){const i=V(),h=b,{createMessage:u}=z(),c=_(""),l=_(""),r=_([]),o=_([]),m=_(!1),C=me(()=>{const e=l.value.trim().toLowerCase();return e?o.value.filter(a=>`${a.realname||""}${a.username||""}`.toLowerCase().includes(e)):o.value});function k(e){var d;const a=((d=i.getUserInfo)==null?void 0:d.id)||"";return(e!=null&&e.length?e:Z()||[]).filter(p=>p.id&&p.id!==a&&p.contactType!==j&&p.username!=="im_work_notify")}const[L,{setModalProps:y,closeModal:S}]=X(e=>f(null,null,function*(){c.value="",l.value="",r.value=[],y({confirmLoading:!1}),o.value=k(e==null?void 0:e.members),yield I()}));function A(e){return e?Y(e):""}function I(){return f(this,null,function*(){m.value=!0;try{const e=(yield Q(l.value||void 0))||[];o.value=k(e)}catch(e){u.error("加载同事列表失败请稍后重试")}finally{m.value=!1}})}function F(){return f(this,null,function*(){const e=c.value.trim();if(!e){u.warning("请输入群名称");return}if(!r.value.length){u.warning("请至少选择1名同事");return}y({confirmLoading:!0});try{const a=yield W({groupName:e,memberUserIds:r.value});h("success",a),S()}finally{y({confirmLoading:!1})}})}return(e,a)=>{const v=$,d=R,p=te,G=ae,T=ee,P=K,D=q,E=H;return g(),x(U(O),re(e.$attrs,{title:"发起群聊",width:520,onRegister:U(L),onOk:F}),{default:n(()=>[s(E,{layout:"vertical"},{default:n(()=>[s(d,{label:"群名称",required:""},{default:n(()=>[s(v,{value:c.value,"onUpdate:value":a[0]||(a[0]=t=>c.value=t),placeholder:"请输入群名称",maxlength:30,"show-count":""},null,8,["value"])]),_:1}),s(d,{label:"选择成员",required:""},{default:n(()=>[s(v,{value:l.value,"onUpdate:value":a[1]||(a[1]=t=>l.value=t),placeholder:"搜索同事","allow-clear":"",size:"small",class:"member-search",onPressEnter:I},null,8,["value"]),s(D,{spinning:m.value},{default:n(()=>[M("div",ue,[s(T,{value:r.value,"onUpdate:value":a[2]||(a[2]=t=>r.value=t),class:"member-checkbox-group"},{default:n(()=>[(g(!0),B(ne,null,le(C.value,t=>(g(),B("div",{key:t.id,class:"member-row"},[s(G,{value:t.id},{default:n(()=>[M("div",ce,[s(p,{size:28,src:A(t.avatar)},{default:n(()=>[ie(N((t.realname||t.username||"?").slice(0,1)),1)]),_:2},1032,["src"]),M("span",pe,N(t.realname||t.username),1)])]),_:2},1032,["value"])]))),128))]),_:1},8,["value"]),C.value.length?se("",!0):(g(),x(P,{key:0,description:"暂无可选同事"}))])]),_:1},8,["spinning"])]),_:1})]),_:1})]),_:1},16,["onRegister"])}}}),ze=J(de,[["__scopeId","data-v-48b27a2a"]]);export{ze as default};