jiuyiUniapp/jiuyi2/unpackage/dist/build/web/assets/TUIKit-components-TUIGroup-...

2 lines
40 KiB
JavaScript
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.

import{aq as e,r as a,au as l,o as t,a as s,F as i,m as o,p as n,u as r,L as u,b as c,t as p,c as d,s as m,g as v,Q as g,w as f,e as h,E as I,I as k,d as y,N as T,K as C,ap as _,X as b,an as E,as as G,_ as w,y as R,a9 as U,aa as S}from"./index-CZsuXyof.js";import{K as M,I as D,J as P,i as O,R as A,E as x,Q as L,z as B,o as N,a as H,T as V,d as Y,e as F,c as K,X as q,g as j,W as $}from"./index.CiVoSkma.js";import"./adapter-vue.Dx-7uXvK.js";import{L as W,c as X}from"./documentLink.EyPR0R2v.js";import{s as Z,b as J,T as Q}from"./index.BHng9ndJ.js";import{r as z}from"./right-icon.-uAfiCH7.js";import{i as ee,R as ae}from"./index.BdsuejOh.js";import{_ as le}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{A as te,D as se}from"./index.BMUcGq1B.js";import{e as ie,_ as oe}from"./edit.D2CUf6G1.js";import{e as ne}from"./enableSampleTaskStatus.Brz40K5o.js";const re=[{icon:"https://web.sdk.qcloud.com/im/assets/images/Public.svg",label:"陌生人社交群Public",type:M.TYPES.GRP_PUBLIC,detail:"类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Meeting.svg",label:"临时会议群Meeting",type:M.TYPES.GRP_MEETING,detail:"创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Work.svg",label:"好友工作群Work",type:M.TYPES.GRP_WORK,detail:"类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主审批。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/AVChatroom.svg",label:"直播群AVChatroom",type:M.TYPES.GRP_AVCHATROOM,detail:"创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Community.png",label:"社群Community",type:M.TYPES.GRP_COMMUNITY,detail:"创建后可以随意进出最多支持100000人支持历史消息存储用户搜索群 ID 发起加群申请后,无需管理员审批即可进群。详见",src:"产品文档"}],ue=e=>re.filter((a=>a.type===e))[0],ce=le(e({__name:"index",props:{groupType:{type:String,default:""}},emits:["selectType"],setup(e,{emit:v}){const g=e,f=re,h=a(),I=v;l((()=>{h.value=g.groupType}));return(e,a)=>(t(),s("ul",{class:"group-introduction-list select"},[(t(!0),s(i,null,o(r(f),((e,l)=>(t(),s("li",{key:l,class:n(["select-item",[r(h)===e.type&&"selected"]]),onClick:a=>(e=>{h.value=e.type,I("selectType",e.type)})(e)},[u("main",{class:"select-item-type"},[u("div",{class:"select-item-header"},[u("aside",{class:"left"},[c(D,{class:"icon",file:e.icon},null,8,["file"]),u("span",{class:"select-item-label"},p(r(P).t(`TUIGroup.${e.label}`)),1)]),r(h)===e.type?(t(),d(D,{key:0,file:r(Z)},null,8,["file"])):m("",!0)]),u("span",{class:"select-item-detail"},p(r(P).t(`TUIGroup.${e.detail}`)),1),u("a",{class:"link",href:r(W).product.url,target:"_blank",onClick:a[0]||(a[0]=e=>{return a=r(W).product.url,void(O||null==(l=ee)||l.open(a));var a,l})},p(r(P).t(`TUIGroup.${e.src}`)),9,["href"])])],10,["onClick"])))),128))]))}}),[["__scopeId","data-v-df441dd8"]]);class pe{constructor(){A.registerService(x.TUIGroup.SERVICE.NAME,this),A.registerExtension(x.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID,this),this.onCallParamsMap=new Map,this.onCallCallbackMap=new Map,this.constants=x}static getInstance(){return pe.instance||(pe.instance=new pe),pe.instance}getOnCallParams(e){return this.onCallParamsMap.get(e)}getOnCallCallback(e){return this.onCallCallbackMap.get(e)}async onCall(e,a,l){var t,s,i;switch(this.onCallParamsMap.set(e,a),this.onCallCallbackMap.set(e,l),e){case x.TUIGroup.SERVICE.METHOD.CREATE_GROUP:B.update(N.GRP,"isShowCreateComponent",!0),O&&(null==(t=ee)||t.reLaunch({url:"/TUIKit/components/TUIGroup/index"}));break;case x.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT:L.switchGroup(a.groupID),B.update(N.GRP,"isShowManageComponent",!0),O&&(null==(s=ee)||s.navigateTo({url:"/TUIKit/components/TUIGroup/index"}));break;case x.TUIGroup.SERVICE.METHOD.SELECT_GROUP_MEMBER:L.switchGroup(a.groupID),B.update(N.GRP,"isShowSelectComponent",!0),O&&(null==(i=ee)||i.navigateTo({url:"/TUIKit/components/TUIGroup/index"}))}}onGetExtension(e){const a=[];if(e===x.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID)a.push({weight:100,icon:"data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%2014'%20opacity='0.802743'%3e%3cpath%20id='&%23229;&%23189;&%23162;&%23231;&%23138;&%23182;&%23231;&%23187;&%23147;&%23229;&%23144;&%23136;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6%2010.5C6%2011.3284%205.32843%2012%204.5%2012C3.67157%2012%203%2011.3284%203%2010.5C3%209.67157%203.67157%209%204.5%209C5.32843%209%206%209.67157%206%2010.5ZM12%2010.5C12%2011.3284%2011.3284%2012%2010.5%2012C9.67157%2012%209%2011.3284%209%2010.5C9%209.67157%209.67157%209%2010.5%209C11.3284%209%2012%209.67157%2012%2010.5ZM16.5%2012C17.3284%2012%2018%2011.3284%2018%2010.5C18%209.67157%2017.3284%209%2016.5%209C15.6716%209%2015%209.67157%2015%2010.5C15%2011.3284%2015.6716%2012%2016.5%2012Z'%20fill='%23232832'%20/%3e%3c/g%3e%3c/svg%3e",text:"更多",data:{},listener:{onClicked:this.groupManage.bind(this)}});return a}groupManage(e){A.callService({serviceName:x.TUIGroup.SERVICE.NAME,method:x.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT,params:e,callback:()=>{var e;O&&(null==(e=ee)||e.navigateBack())}})}}const de=le(e({__name:"index",setup(e){const a=pe.getInstance(),T=a.constants,C=v({profile:{groupID:"",name:"",type:re[0].type,avatar:re[0].icon,introduction:"",notification:"",memberList:[],isSupportTopic:!1},groupConfig:{title:"",value:"",key:"",type:"",placeholder:""},isEdit:!1});l((()=>{const e=a.getOnCallParams(T.TUIGroup.SERVICE.METHOD.CREATE_GROUP);C.profile.memberList=e.memberList,C.groupConfig.title=e.title}));const _=g((()=>ue(C.profile.type))),b=g((()=>{let e="添加群聊";return C.isEdit&&(e=C.groupConfig.title),P.t(`TUIGroup.${e}`)})),E=g((()=>{const e={name:P.t("TUIGroup.群名称"),key:"name",placeholder:P.t("TUIGroup.请输入群名称")},a={name:`${P.t("TUIGroup.群ID")}(${P.t("TUIGroup.选填")})`,key:"groupID",placeholder:P.t("TUIGroup.请输入群ID")};return C.profile.type===M.TYPES.GRP_COMMUNITY?[e]:[e,a]})),G=g((()=>""===C.profile.name&&!C.isEdit)),w=e=>{C.profile.type!==e&&(C.profile.type=e,C.profile.avatar=ue(e).icon,C.isEdit&&(C.groupConfig.value=e))},R=()=>{const{profile:e}=C;if(C.isEdit)return C.profile[C.groupConfig.key]=C.groupConfig.value,C.isEdit=!C.isEdit;(async e=>{try{e.memberList=e.memberList.map((e=>({userID:e.userID}))),e.type===M.TYPES.GRP_COMMUNITY&&delete e.groupID;const a=await L.createGroup(e),{type:l}=a.data.group;l===M.TYPES.GRP_AVCHATROOM&&await L.joinGroup({groupID:a.data.group.groupID,applyMessage:""}),O(a.data.group),V({message:P.t("TUIGroup.群组创建成功"),type:Y.SUCCESS})}catch(a){V({message:a.message,type:Y.ERROR})}})(e)},U=()=>{if(C.isEdit)return C.isEdit=!C.isEdit;O(null)},S=e=>{switch(C.isEdit=!C.isEdit,C.groupConfig.key=e,C.groupConfig.value=C.profile[e],e){case"name":C.groupConfig.title="设置群名称",C.groupConfig.placeholder="请输入群名称",C.groupConfig.type="input";break;case"groupID":C.groupConfig.title="设置群ID",C.groupConfig.placeholder="请输入群ID",C.groupConfig.type="input";break;case"type":C.groupConfig.title="选择群类型",C.groupConfig.type="select"}},O=e=>{B.update(N.GRP,"isShowCreateComponent",!1);const l=a.getOnCallCallback(T.TUIGroup.SERVICE.METHOD.CREATE_GROUP);l&&l(e)};return(e,a)=>{const l=I,v=k,g=y;return t(),d(se,{show:!0,isH5:!r(H),isHeaderShow:!1,isFooterShow:!1,background:!1,"onUpdate:show":U},{default:f((()=>[u("div",{class:n(["group",[r(H)?"":"group-h5"]])},[u("div",{class:"group-box"},[u("header",{class:"group-box-header"},[c(D,{file:r(H)?r(X):r(J),class:"icon-close",size:"16px",onOnClick:U},null,8,["file"]),u("h1",{class:"group-box-header-title"},p(r(b)),1)]),r(C).isEdit?(t(),s("div",{key:1,class:"group-list group-list-edit"},["input"===r(C).groupConfig.type?(t(),d(v,{key:0,modelValue:r(C).groupConfig.value,"onUpdate:modelValue":a[1]||(a[1]=e=>r(C).groupConfig.value=e),class:"group-name-input",type:"text",placeholder:r(P).t(`TUIGroup.${r(C).groupConfig.placeholder}`)},null,8,["modelValue","placeholder"])):(t(),d(ce,{key:1,class:"group-introduction-list",groupType:r(C).groupConfig.value,onSelectType:w},null,8,["groupType"]))])):(t(),s("ul",{key:0,class:"group-list"},[u("li",{class:"group-list-item"},[c(l,{class:"group-list-item-label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群头像")),1)])),_:1}),c(te,{url:r(C).profile.avatar},null,8,["url"])]),u("ul",null,[(t(!0),s(i,null,o(r(E),((e,a)=>(t(),s("li",{key:a,class:"group-list-item"},[c(l,{class:"group-list-item-label"},{default:f((()=>[h(p(e.name),1)])),_:2},1024),r(H)?(t(),d(v,{key:0,modelValue:r(C).profile[e.key],"onUpdate:modelValue":a=>r(C).profile[e.key]=a,type:"text",placeholder:e.placeholder},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(t(),s("span",{key:1,class:"group-h5-list-item-content",onClick:a=>S(e.key)},[u("p",{class:"content"},p(r(C).profile[e.key]),1),c(D,{file:r(z)},null,8,["file"])],8,["onClick"]))])))),128)),u("li",{class:"group-list-introduction"},[u("div",{class:"group-list-item"},[c(l,{class:"group-list-item-label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群类型")),1)])),_:1}),r(H)?(t(),d(ce,{key:0,groupType:r(C).profile.type,onSelectType:w},null,8,["groupType"])):(t(),s("span",{key:1,class:"group-h5-list-item-content",onClick:a[0]||(a[0]=e=>S("type"))},[u("p",{class:"content"},p(r(_).label),1),c(D,{file:r(z)},null,8,["file"])]))]),r(H)?m("",!0):(t(),s("article",{key:0,class:"group-h5-list-item-introduction"},[c(l,{class:"introduction-name"},{default:f((()=>[h(p(r(_).label)+"",1)])),_:1}),u("span",{class:"introduction-detail"},p(r(_).detail),1),u("a",{href:r(W).product.url,target:"view_window"},p(r(P).t(`TUIGroup.${r(_).src}`)),9,["href"])]))])])])),u("footer",{class:"group-profile-footer"},[r(H)&&!r(C).isEdit?(t(),d(g,{key:0,class:"btn-default",onClick:U},{default:f((()=>[h(p(r(P).t("TUIGroup.取消")),1)])),_:1})):m("",!0),c(g,{class:"btn-submit",disabled:r(G),onClick:R},{default:f((()=>[h(p(r(P).t("TUIGroup.确认")),1)])),_:1},8,["disabled"])])])],2)])),_:1},8,["isH5"])}}}),[["__scopeId","data-v-c9c12286"]]),me=le(e({__name:"index",props:{show:{type:Boolean,default:()=>!1}},emits:["update:show"],setup(e,{emit:i}){const o=e,n=a(!1);l((()=>{n.value=o.show}));const u=i,c=()=>{n.value=!n.value,u("update:show",n.value)};return(e,a)=>r(n)?(t(),s("div",{key:0,class:"mask",onClick:a[0]||(a[0]=C((e=>!r(F)&&c),["self"]))},[T(e.$slots,"default",{},void 0,!0)])):m("",!0)}}),[["__scopeId","data-v-b12cc795"]]),ve=le(e({__name:"manage-name",props:{data:{type:Object,default:()=>({})},isAuthor:{type:Boolean,default:!1}},emits:["update"],setup(e,{emit:i}){const o=e,v=a({}),g=a(""),T=a(!1),C=a(null);l((()=>{v.value=o.data}));const G=i,w=()=>{g.value?(g.value!==v.value.name&&(G("update",{key:"name",value:g.value}),v.value.name=g.value,g.value="",V({message:P.t("TUIGroup.群名称修改成功"),type:Y.SUCCESS})),R()):V({message:P.t("TUIGroup.群名称不能为空"),type:Y.ERROR})},R=()=>{o.isAuthor&&(T.value=!T.value),T.value&&(g.value=v.value.name)};return _((()=>T.value),(e=>{e&&b((()=>{var e;null==(e=C.value)||e.focus()}))})),(a,l)=>{const i=I,o=k,_=y;return t(),s("div",{class:"group-name"},[c(i,null,{default:f((()=>[h(p(r(P).t("TUIGroup.群名称")),1)])),_:1}),r(T)?(t(),s("div",{key:0,class:n({"edit-h5":r(K)})},[u("main",{class:"edit-h5-main"},[r(H)?m("",!0):(t(),s("header",{key:0,class:"edit-h5-header"},[u("aside",{class:"left"},[u("h1",null,p(r(P).t("TUIGroup.修改群聊名称")),1),u("span",null,p(r(P).t("TUIGroup.修改群聊名称后,将在群内通知其他成员")),1)]),u("span",{class:"close",onClick:R},p(r(P).t("关闭")),1)])),u("div",{class:"input-box"},[r(T)?(t(),d(o,{key:0,ref_key:"nameInputRef",ref:C,modelValue:r(g),"onUpdate:modelValue":l[0]||(l[0]=e=>E(g)?g.value=e:null),class:"input",type:"text",onBlur:w},null,8,["modelValue"])):m("",!0),r(H)?m("",!0):(t(),s("span",{key:1,class:"tip"},p(r(P).t("TUIGroup.仅限中文、字母、数字和下划线2-20个字")),1))]),r(H)?m("",!0):(t(),s("footer",{key:1,class:"edit-h5-footer"},[c(_,{class:"btn",onClick:w},{default:f((()=>[h(p(r(P).t("确认")),1)])),_:1})]))])],2)):m("",!0),r(T)&&r(H)?m("",!0):(t(),s("p",{key:1,class:"name",onClick:R},[u("span",null,p(r(v).name),1),e.isAuthor?(t(),d(D,{key:0,class:"icon",file:r(ie),width:"14px",height:"14px"},null,8,["file"])):m("",!0)]))])}}}),[["__scopeId","data-v-5f0c4190"]]),ge=le(e({__name:"manage-notification",props:{data:{type:Object,default:()=>({})},isAuthor:{type:Boolean,default:!1}},emits:["update","close"],setup(e,{emit:i}){const o=e,c=a({}),v=a(""),g=a(!1),I=a(!1);l((()=>{c.value=o.data,v.value=c.value.notification,g.value=o.isAuthor}));const k=i,T=()=>{v.value.length>150?V({message:P.t("TUIGroup.群公告字数超出限制最大长度为150"),type:Y.ERROR}):(v.value&&v.value!==c.value.notification&&(k("update",{key:"notification",value:v.value}),b((()=>{v.value=""}))),I.value=!I.value)};return(e,a)=>{const l=w,i=y;return r(O)?(t(),s("div",{key:1,class:"edit-h5"},[u("main",{class:"edit-h5-main"},[u("header",{class:"edit-h5-header"},[u("aside",{class:"left"},[u("h1",null,p(r(P).t("TUIGroup.群公告")),1)]),u("span",{class:"close",onClick:a[2]||(a[2]=e=>{k("close","notification")})},p(r(P).t("关闭")),1)]),u("div",{class:"notification"},[r(I)?(t(),d(l,{key:0,modelValue:r(v),"onUpdate:modelValue":a[3]||(a[3]=e=>E(v)?v.value=e:null),class:n([r(O)?"uni-height":"","textarea"]),onKeyup:G(T,["enter"])},null,8,["modelValue","class"])):(t(),s("section",{key:1,class:"row"},[r(c).notification?(t(),s("article",{key:1},p(r(c).notification),1)):(t(),s("p",{key:0,class:"row-p"},p(r(P).t("TUIGroup.暂无公告")),1))])),r(g)?(t(),s("footer",{key:2,class:"footer"},[r(I)?(t(),d(i,{key:0,class:"btn",onClick:T},{default:f((()=>[h(p(r(P).t("TUIGroup.发布")),1)])),_:1})):(t(),d(i,{key:1,class:"btn",onClick:a[4]||(a[4]=e=>I.value=!r(I))},{default:f((()=>[h(p(r(P).t("TUIGroup.编辑")),1)])),_:1}))])):m("",!0)])])])):(t(),s("main",{key:0,class:"notification"},[r(I)?(t(),d(l,{key:0,modelValue:r(v),"onUpdate:modelValue":a[0]||(a[0]=e=>E(v)?v.value=e:null),class:"textarea",onKeyup:G(T,["enter"])},null,8,["modelValue"])):(t(),s("section",{key:1},[r(c).notification?(t(),s("article",{key:1},p(r(c).notification),1)):(t(),s("p",{key:0},p(r(P).t("TUIGroup.暂无公告")),1))])),r(g)?(t(),s("footer",{key:2},[r(I)?(t(),d(i,{key:0,class:"btn",onClick:T},{default:f((()=>[h(p(r(P).t("TUIGroup.发布")),1)])),_:1})):(t(),d(i,{key:1,class:"btn",onClick:a[1]||(a[1]=e=>I.value=!r(I))},{default:f((()=>[h(p(r(P).t("TUIGroup.编辑")),1)])),_:1}))])):m("",!0)]))}}}),[["__scopeId","data-v-bd710001"]]),fe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;'%3e%3cpath%20id='&%23231;&%23155;&%23180;&%23231;&%23186;&%23191;'%20d='M2.15682%204.76268H14.0347'%20stroke='%23FF584C'%20style='stroke:%23FF584C;stroke:color(display-p3%201.0000%200.3451%200.2980);stroke-opacity:1;'%20stroke-linecap='round'%20/%3e%3cpath%20id='&%23231;&%23155;&%23180;&%23231;&%23186;&%23191;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;'%20d='M5.23978%202.15307H11.1684'%20stroke='%23FF584C'%20style='stroke:%23FF584C;stroke:color(display-p3%201.0000%200.3451%200.2980);stroke-opacity:1;'%20stroke-linecap='round'%20/%3e%3cpath%20id='&%23231;&%23155;&%23180;&%23231;&%23186;&%23191;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%202'%20d='M6.90014%207.32796V10.9714'%20stroke='%23FF584C'%20style='stroke:%23FF584C;stroke:color(display-p3%201.0000%200.3451%200.2980);stroke-opacity:1;'%20stroke-linecap='round'%20/%3e%3cpath%20id='&%23231;&%23155;&%23180;&%23231;&%23186;&%23191;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%203'%20d='M9.58605%207.32796V10.9714'%20stroke='%23FF584C'%20style='stroke:%23FF584C;stroke:color(display-p3%201.0000%200.3451%200.2980);stroke-opacity:1;'%20stroke-linecap='round'%20/%3e%3cpath%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20d='M4.14331%204.8316H12.1596V12.9091C12.1596%2013.5367%2011.6508%2014.0454%2011.0232%2014.0454H5.27968C4.65208%2014.0454%204.14331%2013.5367%204.14331%2012.9091V4.8316Z'%20stroke='%23FF584C'%20style='stroke:%23FF584C;stroke:color(display-p3%201.0000%200.3451%200.2980);stroke-opacity:1;'%20/%3e%3c/g%3e%3c/svg%3e",he=le(e({__name:"manage-member",props:{list:{type:Array,default:()=>[]},total:{type:Number,default:()=>0},isShowDel:{type:Boolean,default:()=>!1},self:{type:Object,default:()=>({})}},emits:["more","del","handleMemberProfileShow","close"],setup(e,{emit:n}){const c=e,v=a(0),g=a([]),f=a(!1),h=a({});l((()=>{v.value=c.total,f.value=c.isShowDel,g.value=c.list,h.value=c.self}));const I=n,k=e=>{let a="";switch(null==e?void 0:e.role){case M.TYPES.GRP_MBR_ROLE_ADMIN:a=P.t("TUIGroup.管理员");break;case M.TYPES.GRP_MBR_ROLE_OWNER:a=P.t("TUIGroup.群主")}return a&&(a=`(${a})`),e.userID===h.value.userID&&(a+=` (${P.t("TUIGroup.我")})`),a},y=()=>{I("more")},T=e=>{I("del",[e])},C=e=>{I("handleMemberProfileShow",e)};return(e,a)=>r(O)?(t(),s("div",{key:1,class:"edit-h5"},[u("main",{class:"main"},[u("header",{class:"edit-h5-header"},[u("aside",{class:"left"},[u("h1",null,p(r(P).t("TUIGroup.群成员")),1)]),u("span",{class:"close",onClick:a[0]||(a[0]=e=>{I("close","member")})},p(r(P).t("关闭")),1)]),u("div",{class:"member"},[u("ul",{class:"list list-uniapp"},[(t(!0),s(i,null,o(r(g),((e,a)=>(t(),s("li",{key:a,class:"list-item"},[u("aside",{class:"aside",onClick:a=>C(e)},[u("img",{class:"avatar",src:e.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"]),u("span",{class:"name"},p(e.nick||e.userID),1),u("span",null,p(k(e)),1)],8,["onClick"]),u("div",{onClick:a=>T(e)},["Owner"!==e.role&&r(f)?(t(),d(D,{key:0,file:r(fe),width:"16px",height:"16px"},null,8,["file"])):m("",!0)],8,["onClick"])])))),128)),r(g).length<r(v)?(t(),s("li",{key:0,class:"list-item",onClick:y},p(r(P).t("TUIGroup.查看更多")),1)):m("",!0)])])])])):(t(),s("main",{key:0,class:"member"},[u("ul",{class:"list"},[(t(!0),s(i,null,o(r(g),((e,a)=>(t(),s("li",{key:a,class:"list-item"},[u("aside",{class:"aside",onClick:a=>C(e)},[u("img",{class:"avatar",src:e.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"]),u("span",{class:"name"},p(e.nick||e.userID),1),u("span",null,p(k(e)),1)],8,["onClick"]),u("div",{onClick:a=>T(e)},["Owner"!==e.role&&r(f)?(t(),d(D,{key:0,file:r(fe),width:"16px",height:"16px"},null,8,["file"])):m("",!0)],8,["onClick"])])))),128)),r(g).length<r(v)?(t(),s("li",{key:0,class:"list-item",onClick:y},p(r(P).t("TUIGroup.查看更多")),1)):m("",!0)])]))}}),[["__scopeId","data-v-26f5f486"]]),Ie=le(e({__name:"manage-profile",props:{userInfo:{type:Object,default:()=>({})}},emits:["handleSwitchConversation","close","openConversation"],setup(e,{emit:i}){const o=e,n=a(!1),d=a({});l((()=>{d.value=o.userInfo}));const v=i;_((()=>o.userInfo),(async(e,a)=>{if(e===a)return;const l=await q.getUserProfile({userIDList:[o.userInfo.userID]});d.value=null==l?void 0:l.data[0],k()}),{deep:!0,immediate:!0});const g=async(e,a)=>{const l=`${a}${e}`;$.getConversationProfile(l).then((e=>{$.switchConversation(e.data.conversation.conversationID).then((()=>{var e;B.update(N.GRP,"isShowManageComponent",!1),O&&(null==(e=ee)||e.navigateBack())}))})).catch((e=>{console.warn("获取会话资料失败",e.code,e.msg)}))},k=async()=>{d.value.userID&&j.checkFriend({userIDList:[d.value.userID],type:M.TYPES.SNS_CHECK_TYPE_BOTH}).then((e=>{var a,l,t;const s=null==(t=null==(l=null==(a=null==e?void 0:e.data)?void 0:a.successUserIDList)?void 0:l[0])?void 0:t.relation;n.value=s===M.TYPES.SNS_TYPE_BOTH_WAY}))},y=()=>n.value||!B.getData(N.APP,"isOfficial");return(e,a)=>{const l=I;return r(O)?(t(),s("div",{key:1,class:"edit-h5"},[u("main",{class:"main"},[u("header",{class:"edit-h5-header"},[u("aside",{class:"left"},[u("h1",null,p(r(P).t("TUIGroup.群成员")),1)]),u("span",{class:"close",onClick:a[1]||(a[1]=e=>{v("close","profile")})},p(r(P).t("关闭")),1)]),u("div",{class:"edit-h5-profile"},[u("div",{class:"memeber-profile-main"},[c(te,{class:"avatar",url:r(d).avatar,size:"60px"},null,8,["url"]),u("ul",{class:"list"},[u("h1",null,p(r(d).nick||r(d).userID),1),u("li",null,[c(l,null,{default:f((()=>[h("ID")])),_:1}),u("span",null,p(r(d).userID),1)]),u("li",null,[c(l,null,{default:f((()=>[h(p(r(P).t("TUIContact.个性签名"))+"",1)])),_:1}),u("span",null,p(r(d).selfSignature),1)])])]),u("div",{class:"memeber-profile-footer"},[y()?(t(),s("div",{key:0,class:"button",onClick:a[2]||(a[2]=e=>g(r(d).userID,"C2C"))},p(r(P).t("TUIContact.发送消息")),1)):m("",!0)])])])])):(t(),s("div",{key:0,class:"memeber-profile"},[u("div",{class:"memeber-profile-main"},[u("img",{class:"avatar",src:r(d).avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"]),u("ul",{class:"list"},[u("h2",null,p(r(d).nick||r(d).userID),1),u("li",null,[c(l,null,{default:f((()=>[h("ID")])),_:1}),u("span",null,p(r(d).userID),1)]),u("li",null,[c(l,null,{default:f((()=>[h(p(r(P).t("TUIContact.个性签名"))+"",1)])),_:1}),u("span",null,p(r(d).selfSignature),1)])])]),u("div",{class:"memeber-profile-footer"},[y()?(t(),s("div",{key:0,class:"button",onClick:a[0]||(a[0]=e=>g(r(d).userID,"C2C"))},p(r(P).t("TUIContact.发送消息")),1)):m("",!0)])]))}}}),[["__scopeId","data-v-aae3e3b6"]]),ke=le(e({__name:"index",props:{open:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:i}){const o=e,c=a(!1),p=i;l((()=>{c.value=o.open}));const d=()=>{c.value=!c.value,p("change",c.value)};return(e,a)=>(t(),s("div",{class:n(["slider-box",[r(c)&&"slider-open"]]),onClick:d},[u("span",{class:"slider-block"})],2))}}),[["__scopeId","data-v-9f73c923"]]),ye="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.5%200L21.499%2018.5H40V21.5H21.499L21.5%2040H18.5L18.499%2021.5H0V18.5H18.499L18.5%200H21.5Z'%20fill='%23BBBBBB'%20style='fill:%23BBBBBB;fill:color(display-p3%200.7333%200.7333%200.7333);fill-opacity:1;'%20/%3e%3c/svg%3e",Te="data:image/svg+xml,%3csvg%20width='36'%20height='4'%20viewBox='0%200%2036%204'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.499%200.5L36%200.5V3.5H19.499H16.499H0V0.5L16.499%200.5H19.499Z'%20fill='%23BBBBBB'%20style='fill:%23BBBBBB;fill:color(display-p3%200.7333%200.7333%200.7333);fill-opacity:1;'%20/%3e%3c/svg%3e",Ce=le(e({__name:"manage-admin",props:{member:{type:Object,default:()=>{}},isSetMuteTime:{type:Boolean,default:()=>!1},currentGroup:{type:Object,default:()=>{}}},emits:["addAdmin","removeAdmin","setAllMuteTime","addMute","removeMute","close"],setup(e,{emit:n}){const d=e,v=a(!1),g=a({admin:[],member:[],muteMember:[]}),f=a();l((()=>{g.value=d.member,v.value=d.isSetMuteTime,f.value=d.currentGroup}));const h=n,I=()=>{h("addAdmin")},k=()=>{h("removeAdmin")},y=e=>{h("setAllMuteTime",e)},T=()=>{h("addMute")},C=()=>{h("removeMute")};return(e,a)=>(t(),s("div",{class:"admin-main"},[u("div",{class:"admin-manage"},[u("div",{class:"admin-manage-header"},p(r(P).t("TUIGroup.群管理员")),1),u("ul",{class:"admin-manage-list"},[(t(!0),s(i,null,o(r(g).admin,((e,a)=>(t(),s("li",{key:a,class:"admin-manage-list-item"},[u("div",{class:"item-main"},[u("img",{class:"item-main-avatar",src:e.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"])]),u("div",{class:"item-name"},p(e.nick||e.userID),1)])))),128)),u("li",{class:"admin-manage-list-item"},[u("div",{class:"item-main",onClick:I},[c(D,{file:r(ye),width:"16px",height:"16px"},null,8,["file"])])]),u("li",{class:"admin-manage-list-item"},[r(g).admin.length>0?(t(),s("div",{key:0,class:"item-main",onClick:k},[c(D,{file:r(Te),width:"16px",height:"16px"},null,8,["file"])])):m("",!0)])])]),r(v)?(t(),s("div",{key:0,class:"admin-mute-all"},[u("div",null,[u("div",{class:"admin-mute-all-title"},p(r(P).t("TUIGroup.全员禁言")),1),u("div",{class:"admin-mute-all-content"},p(r(P).t("TUIGroup.全员禁言开启后,只允许群主和管理员发言。")),1)]),c(ke,{open:r(f).muteAllMembers,onChange:y},null,8,["open"])])):m("",!0),r(v)?(t(),s("div",{key:1,class:"admin-mute"},[u("div",{class:"admin-mute-header"},p(r(P).t("TUIGroup.单独禁言人员")),1),u("ul",{class:"admin-mute-list"},[(t(!0),s(i,null,o(r(g).muteMember,((e,a)=>(t(),s("li",{key:a,class:"admin-mute-list-item"},[u("div",{class:"item-main"},[u("img",{class:"item-main-avatar",src:e.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"])]),u("div",{class:"item-name"},p(e.nick||e.userID),1)])))),128)),u("li",{class:"admin-mute-list-item"},[u("div",{class:"item-main",onClick:T},[c(D,{file:r(ye),width:"16px",height:"16px"},null,8,["file"])])]),u("li",{class:"admin-mute-list-item"},[r(g).muteMember.length>0?(t(),s("div",{key:0,class:"item-main",onClick:C},[c(D,{file:r(Te),width:"16px",height:"16px"},null,8,["file"])])):m("",!0)])])])):m("",!0)]))}}),[["__scopeId","data-v-2a5ca315"]]),_e=le(e({__name:"index",props:{groupID:{type:String,default:""},groupCurrentTab:{type:String,default:""}},setup(e){const n=pe.getInstance(),v=n.constants,k=e,y=a(void 0),T=a(""),_=a(""),E=a(""),G=a(!1),w=a(""),A=a({list:[]}),x=a({}),F=a({[M.TYPES.GRP_WORK]:"好友工作群",[M.TYPES.GRP_PUBLIC]:"陌生人社交群",[M.TYPES.GRP_MEETING]:"临时会议群",[M.TYPES.GRP_AVCHATROOM]:"直播群",[M.TYPES.GRP_COMMUNITY]:"社群",[M.TYPES.JOIN_OPTIONS_FREE_ACCESS]:"自由加入",[M.TYPES.JOIN_OPTIONS_NEED_PERMISSION]:"需要验证",[M.TYPES.JOIN_OPTIONS_DISABLE_APPLY]:"禁止加群"}),K=a({admin:[],member:[],muteMember:[]}),q=a([]),W=a(""),X=a(!1),Z=a(!1),le=a([]),te=a(!1),ie=a([]),oe=a([]),re=a(),ue=a(""),ce=a("");R((()=>{b((()=>{y.value&&ae.listen({domRefs:y.value,handler:Ke})}))})),B.watch(N.GRP,{currentGroup:e=>{var a,l;e&&(re.value=e,ue.value=null==(l=null==(a=re.value)?void 0:a.selfInfo)?void 0:l.role)},currentGroupMemberList:e=>{ie.value=e,K.value={admin:[],member:[],muteMember:[]},Array.from(e).map((e=>{switch(null==e?void 0:e.role){case M.TYPES.GRP_MBR_ROLE_ADMIN:K.value.admin.push(e);break;case M.TYPES.GRP_MBR_ROLE_MEMBER:K.value.member.push(e)}return e}));const a=(new Date).getTime();K.value.muteMember=Array.from(e).filter((e=>1e3*(null==e?void 0:e.muteUntil)-a>0))}}),B.watch(N.CONV,{currentConversation:e=>{var a;ce.value=null==(a=null==e?void 0:e.groupProfile)?void 0:a.groupID}}),l((()=>{const e=n.getOnCallParams(v.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT);w.value=e.groupID||ce.value,T.value=k.groupCurrentTab}));const de=g((()=>{let e="";switch(T.value){case"notification":e="群公告";break;case"member":case"profile":e="群成员";break;default:e="群管理"}return e})),fe=g((()=>{var e,a;return(null==(a=null==(e=re.value)?void 0:e.selfInfo)?void 0:a.role)===M.TYPES.GRP_MBR_ROLE_OWNER})),ke=g((()=>{var e,a;return(null==(a=null==(e=re.value)?void 0:e.selfInfo)?void 0:a.role)===M.TYPES.GRP_MBR_ROLE_OWNER})),ye=g((()=>{var e;return(null==(e=re.value)?void 0:e.type)===M.TYPES.GRP_WORK})),Te=g((()=>!(ye.value||!fe.value&&!ke.value))),_e=g((()=>{var e;return!((null==(e=null==re?void 0:re.value)?void 0:e.type)===M.TYPES.GRP_AVCHATROOM)})),be=async e=>{const{key:a,value:l}=e,t={groupID:re.value.groupID,[a]:l};L.updateGroupProfile(t).then((e=>{re.value=e.data.group,_.value=""})).catch((e=>{V({message:null==e?void 0:e.message,type:Y.ERROR})}))},Ee=e=>{T.value=e,_.value="","member"===T.value&&(E.value="remove"),T.value||(E.value="")},Ge=()=>{we()},we=async e=>{var a;le.value=[];let l=[];switch(e){case"add":Z.value=!1,l=[...K.value.admin,...K.value.member].map((e=>e.userID)),q.value=(await Re()).filter((e=>e.userID&&l.indexOf(e.userID)<0)),W.value="添加成员";break;case"remove":Z.value=!1,q.value=ie.value.filter((e=>{var a,l;return e.userID!==(null==(l=null==(a=null==re?void 0:re.value)?void 0:a.selfInfo)?void 0:l.userID)})),W.value="删除成员";break;case"addAdmin":Z.value=!0,q.value=K.value.member,W.value="新增管理员";break;case"removeAdmin":Z.value=!0,q.value=K.value.admin,W.value="移除管理员";break;case"changeOwner":Z.value=!0,q.value=[...K.value.admin,...K.value.member],W.value="转让群组";break;case"addMute":Z.value=!0,q.value=K.value.member,"Owner"===re.value.selfInfo.role&&(q.value=[...K.value.admin,...K.value.member]),q.value=null==(a=null==q?void 0:q.value)?void 0:a.filter((e=>{var a,l;return(null==(l=null==(a=null==K?void 0:K.value)?void 0:a.muteMember)?void 0:l.indexOf(e))<0})),W.value="新增禁言用户";break;case"removeMute":Z.value=!0,q.value=K.value.muteMember,W.value="移除禁言用户"}e&&(E.value=e),G.value=!G.value},Re=async()=>(await j.getFriendList()).data.map((e=>null==e?void 0:e.profile)).filter((e=>!A.value.list.some((a=>a.userID===e.userID)))),Ue=g((()=>{var e,a,l;const t=null==(a=null==(e=null==re?void 0:re.value)?void 0:e.selfInfo)?void 0:a.role,s=null==(l=null==re?void 0:re.value)?void 0:l.type;return t===M.TYPES.GRP_MBR_ROLE_OWNER&&s!==M.TYPES.GRP_WORK})),Se=g((()=>{var e;return(null==(e=null==re?void 0:re.value)?void 0:e.type)===M.TYPES.GRP_WORK})),Me=g((()=>{var e,a;let l=3;return Se.value||(l+=1),"Owner"!==(null==(a=null==(e=null==re?void 0:re.value)?void 0:e.selfInfo)?void 0:a.role)&&(l+=1),l})),De=e=>{x.value=e,Ee("profile")},Pe=e=>{"remove"===E.value?(oe.value=e,te.value=!te.value):Le(e,E.value),G.value=!1},Oe=()=>{var e;O?null==(e=ee)||e.switchTab({url:"/TUIKit/components/TUIConversation/index"}):(Ke(),$.switchConversation())},Ae=e=>{be({key:"muteAllMembers",value:e}),e?(ne("muteGroup"),V({message:P.t("TUIGroup.禁言设置成功"),type:Y.SUCCESS})):V({message:P.t("TUIGroup.取消禁言成功"),type:Y.SUCCESS})},xe=async e=>{var a,l;let t={},s={};const i={groupID:w.value,userIDList:[e]};switch(E.value){case"add":try{s=await L.getGroupMemberProfile(i),q.value=q.value.filter((e=>{var a;return e.userID!==(null==(a=t.data[0])?void 0:a.userID)})),q.value=[...q.value,...t.data],(null==(a=null==s?void 0:s.data)?void 0:a.memberList.length)>0&&(q.value=q.value.map((e=>{var a;return e.userID===(null==(a=null==s?void 0:s.data)?void 0:a.memberList[0].userID)&&(e.isDisabled=!0),e})))}catch(o){const e=P.t("TUIGroup.该用户不存在");V({message:e,type:Y.ERROR})}break;case"remove":try{if(t=await L.getGroupMemberProfile(i),0===t.data.memberList.length){const e=P.t("TUIGroup.该用户不在群组内");V({message:e,type:Y.ERROR})}q.value=q.value.filter((e=>{var a,l;return e.userID!==(null==(l=null==(a=null==t?void 0:t.data)?void 0:a.memberList[0])?void 0:l.userID)})),(null==(l=null==t?void 0:t.data)?void 0:l.memberList.length)&&(q.value=[...q.value,...t.data.memberList])}catch(o){const e=P.t("TUIGroup.该用户不存在");V({message:e,type:Y.ERROR})}}},Le=(e,a)=>{const l=[];switch(e.map((e=>(l.push(e.userID),e))),a){case"add":Be(l);break;case"remove":Ye(l);break;case"addAdmin":case"removeAdmin":Ve(e[0]);break;case"changeOwner":Ne(l[0]);break;case"addMute":He(l[0],"add");break;case"removeMute":He(l[0],"remove")}},Be=async e=>{const a={groupID:w.value,userIDList:e};await L.addGroupMember(a)},Ne=async e=>{const a={groupID:w.value,newOwnerID:e},l=await L.changeGroupOwner(a);re.value={},re.value=l.data.group},He=async(e,a)=>{const l={groupID:w.value,userID:e,muteTime:"add"===a?2592e3:0};await L.setGroupMemberMuteTime(l)},Ve=async e=>{let a="";switch(e.role){case M.TYPES.GRP_MBR_ROLE_ADMIN:a=M.TYPES.GRP_MBR_ROLE_MEMBER;break;case M.TYPES.GRP_MBR_ROLE_MEMBER:a=M.TYPES.GRP_MBR_ROLE_ADMIN}const l={groupID:w.value,userID:e.userID,role:a};await L.setGroupMemberRole(l)},Ye=async e=>{const a={groupID:w.value,userIDList:e,reason:""};await L.deleteGroupMember(a)},Fe=()=>{T.value?Ee(""):Ke()},Ke=()=>{B.update(N.GRP,"isShowManageComponent",!1);const e=n.getOnCallCallback(v.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT);e&&e()};return(e,a)=>{const l=I;return t(),s("div",{ref_key:"manageRef",ref:y,class:"manage"},[r(O)&&"admin"!==r(T)?m("",!0):(t(),s("header",{key:0,class:"manage-header"},[c(D,{file:r(J),onOnClick:Fe},null,8,["file"]),u("div",{class:"manage-header-content"},p(r(P).t(`TUIGroup.${r(de)}`)),1),u("div")])),!r(T)||r(O)&&"admin"!=r(T)?(t(),s("main",{key:1,class:"main"},[c(ve,{class:"space-top",isAuthor:r(fe)||r(ke)||r(ye),data:r(re),onUpdate:be},null,8,["isAuthor","data"]),u("div",{class:"user-info space-top"},[u("header",{class:"user-info-header",onClick:a[0]||(a[0]=e=>Ee("member"))},[c(l,{class:"user-info-header-left"},{default:f((()=>[h(p(r(P).t("TUIGroup.群成员")),1)])),_:1}),u("div",{class:"user-info-header-right"},[u("span",{class:"span"},p(r(re).memberCount||r(ie).length)+" "+p(r(P).t("TUIGroup.人")),1),c(D,{file:r(z)},null,8,["file"])])]),u("ol",{class:"user-info-list"},[(t(!0),s(i,null,o(r(ie).slice(0,r(Me)),((e,a)=>(t(),s("dl",{key:a,class:"user-info-list-item"},[u("dt",{class:"user-info-list-item-main",onClick:a=>De(e)},[u("img",{class:"avatar",src:e.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"])],8,["onClick"]),u("dd",{class:"user-info-list-item-info"},p(e.nick||e.userID),1)])))),128)),r(Se)?(t(),s("dl",{key:0,class:"user-info-list-item"},[u("dt",{class:"avatar",onClick:a[1]||(a[1]=e=>we("add"))}," + ")])):m("",!0),"Owner"===r(ue)?(t(),s("dl",{key:1,class:"user-info-list-item"},[u("dt",{class:"avatar",onClick:a[2]||(a[2]=e=>we("remove"))}," - ")])):m("",!0)])]),u("ul",{class:"content list space-top",onClick:a[5]||(a[5]=e=>_.value="")},[u("li",{class:"list-item",onClick:a[3]||(a[3]=e=>Ee("notification"))},[u("aside",{class:"aside"},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群公告")),1)])),_:1}),u("article",{class:"article"},p(r(re).notification),1)]),c(D,{file:r(z),class:"end"},null,8,["file"])]),(r(ke)||r(fe))&&r(Te)?(t(),s("li",{key:0,class:"list-item",onClick:a[4]||(a[4]=e=>Ee("admin"))},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群管理")),1)])),_:1}),c(D,{file:r(z)},null,8,["file"])])):m("",!0),u("li",{class:"list-item"},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群ID")),1)])),_:1}),u("div",{class:"groupID"},[u("span",{class:"span"},p(r(w)),1)])]),u("li",{class:"list-item"},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群头像")),1)])),_:1}),u("img",{class:"avatar",src:r(re).avatar||"https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.svg",onerror:"this.onerror=null;this.src='https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.svg'"},null,8,["src"])]),u("li",{class:"list-item"},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.群类型")),1)])),_:1}),u("span",{class:"span"},p(r(P).t(`TUIGroup.${r(F)[r(re).type]}`)),1)]),u("li",{class:"list-item"},[c(l,{class:"label"},{default:f((()=>[h(p(r(P).t("TUIGroup.加群方式")),1)])),_:1}),u("span",{class:"span"},p(r(P).t(`TUIGroup.${r(F)[r(re).joinOption]}`)),1)])]),u("ul",{class:"footer list space-top"},["Owner"===r(ue)&&r(ie).length>1?(t(),s("li",{key:0,class:"list-item",onClick:a[6]||(a[6]=C((e=>we("changeOwner")),["stop"]))},p(r(P).t("TUIGroup.转让群组")),1)):m("",!0),r(Ue)?(t(),s("li",{key:1,class:"list-item",onClick:a[7]||(a[7]=C((e=>(async e=>{await L.dismissGroup(e.groupID),ne("dismissGroup"),V({message:P.t("TUIGroup.群组解散成功"),type:Y.SUCCESS}),Oe()})(r(re))),["stop"]))},p(r(P).t("TUIGroup.解散群聊")),1)):(t(),s("li",{key:2,class:"list-item",onClick:a[8]||(a[8]=C((e=>(async e=>{await L.quitGroup(e.groupID),Oe()})(r(re))),["stop"]))},p(r(P).t("TUIGroup.退出群组")),1))])])):m("",!0),"member"===r(T)?(t(),d(he,{key:2,self:r(re).selfInfo,list:r(ie),total:~~r(re).memberCount,isShowDel:"Owner"===r(ue)&&r(_e),onMore:a[9]||(a[9]=e=>(async e=>{const a={groupID:w.value,count:100,offset:e&&"more"===e?A.value.list.length:0};await L.getGroupMemberList(a).then((a=>{A.value.list=e&&"more"===e?[...A.value.list,...a.data.memberList]:a.data.memberList}))})("more")),onDel:Pe,onHandleMemberProfileShow:De,onClose:a[10]||(a[10]=e=>Ee(""))},null,8,["self","list","total","isShowDel"])):m("",!0),"profile"===r(T)?(t(),d(Ie,{key:3,userInfo:r(x),onClose:a[11]||(a[11]=e=>Ee(""))},null,8,["userInfo"])):m("",!0),"notification"===r(T)?(t(),d(ge,{key:4,isAuthor:r(fe)||r(ke)||r(ye),data:r(re),onUpdate:be,onClose:a[12]||(a[12]=e=>Ee(""))},null,8,["isAuthor","data"])):m("",!0),"admin"===r(T)?U((t(),d(Ce,{key:5,isSetMuteTime:r(Te),member:r(K),currentGroup:r(re),onAddAdmin:a[13]||(a[13]=e=>we("addAdmin")),onRemoveAdmin:a[14]||(a[14]=e=>we("removeAdmin")),onSetAllMuteTime:Ae,onAddMute:a[15]||(a[15]=e=>we("addMute")),onRemoveMute:a[16]||(a[16]=e=>we("removeMute")),onClose:a[17]||(a[17]=e=>Ee(""))},null,8,["isSetMuteTime","member","currentGroup"])),[[S,r(ke)]]):m("",!0),c(me,{show:r(G),"onUpdate:show":a[18]||(a[18]=e=>G.value=e)},{default:f((()=>[c(Q,{title:r(P).t(`TUIGroup.${r(W)}`),list:r(q),isSearch:r(X),isRadio:r(Z),selectedList:r(le),isH5:!r(H),onSubmit:Pe,onCancel:Ge,onSearch:xe},null,8,["title","list","isSearch","isRadio","selectedList","isH5"])])),_:1},8,["show"]),c(se,{class:"deleted-dialog",title:r(P).t("TUIGroup.删除成员"),show:r(te),isH5:!r(H),center:!0,isHeaderShow:r(H),onSubmit:a[19]||(a[19]=e=>Le(r(oe),"remove")),"onUpdate:show":a[20]||(a[20]=e=>te.value=e)},{default:f((()=>[1===r(oe).length?(t(),s("p",{key:0,class:"del-dialog-title"},p(r(P).t("TUIGroup.确定从群聊中删除该成员?")),1)):m("",!0),r(oe).length>1?(t(),s("p",{key:1,class:"del-dialog-title"},p(r(P).t("TUIGroup.确定从群聊中删除所选成员?")),1)):m("",!0)])),_:1},8,["title","show","isH5","isHeaderShow"])],512)}}}),[["__scopeId","data-v-227e769d"]]),be=e({__name:"index",setup(e){const s=pe.getInstance(),i=s.constants,o=a(!1),n=a([]),u=a([]),c=a({}),p=a({groupID:"",isRadio:!1,isNeedSearch:!1,title:"",filterUserIDList:[]}),m=a(null);l((()=>{const e=s.getOnCallParams(i.TUIContact.SERVICE.METHOD.SELECT_FRIEND);var a;p.value.groupID=e.groupID,p.value.title=e.title,p.value.isRadio=e.isRadio,p.value.isNeedSearch=e.isNeedSearch,p.value.filterUserIDList=e.filterUserIDList,e.isNeedSearch&&(a=e.isNeedSearch,m.value=A.getService(i.TUISearch.SERVICE.NAME),m.value?o.value=a:console.warn("请添加 TUISearch 组件"))})),B.watch(N.GRP,{currentGroup:e=>{c.value=e},currentGroupMemberList:e=>{n.value=e.map((e=>{p.value.filterUserIDList.indexOf(e.userID)>-1&&(e.isDisabled=!0)})),u.value=n.value}});const v=async()=>{const e={groupID:c.value.groupID,count:100,offset:n.value.length};await L.getGroupMemberList(e)},g=e=>{B.update(N.GRP,"isShowSelectComponent",!1);const a=s.getOnCallCallback(i.TUIGroup.SERVICE.METHOD.SELECT_GROUP_MEMBER);a&&a(e)},f=()=>{V({message:P.t("TUIGroup.该用户不存在"),type:Y.ERROR}),u.value=[...n.value]},h=async e=>{if(!e)return u.value=n.value;try{const a=await m.value.searchGroupMember(e);if(!a.data[0])return f();u.value=a.data;const l=n.value.filter((e=>e.userID===a.data[0].userID));n.value=l.length?n.value:[...n.value,...u.value]}catch(a){return f()}};return(e,a)=>(t(),d(oe,{isRadio:r(p).isRadio,isNeedSearch:r(p).isNeedSearch,title:r(p).title,userList:r(u),total:r(c).memberCount,onGetMore:v,onSearch:h,onComplete:g},null,8,["isRadio","isNeedSearch","title","userList","total"]))}}),Ee=le(e({__name:"index",setup(e){const l=a(!1),i=a(!1),o=a(!1);return B.watch(N.GRP,{isShowCreateComponent:e=>{l.value=!!e},isShowManageComponent:e=>{i.value=!!e},isShowSelectComponent:e=>{o.value=!!e}}),(e,a)=>(t(),s("div",{class:n([(r(l)||r(i)||r(o))&&"tui-group"])},[r(l)?(t(),d(de,{key:0})):m("",!0),r(i)?(t(),d(_e,{key:1})):m("",!0),r(o)?(t(),d(be,{key:2})):m("",!0)],2))}}),[["__scopeId","data-v-3ff2cd9d"]]);export{Ee as default};