2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../../../constant.js"),o=require("../../../utils/env.js");Math||(i+t)();const t=()=>"../../common/Overlay/index.js",i=()=>"../../common/Dialog/index.js",s=e.defineComponent({__name:"index",props:{actionsMenuPosition:{},selectedConversation:{},selectedConversationDomRect:{}},emits:["closeConversationActionMenu"],setup(t,{emit:i}){var s,r;const a=i,c=t,l=(null==(s=e.getCurrentInstance())?void 0:s.proxy)||e.getCurrentInstance(),u=e.ref(),v=e.ref(!0),d=e.ref(!1),C=e.Jt.getConversationModel((null==(r=c.selectedConversation)?void 0:r.conversationID)||""),f=e.ref(c.actionsMenuPosition);e.onMounted((()=>{e.nextTick$1((()=>{var n,t;if(o.isUniFrameWork)(null==(n=e.i)?void 0:n.createSelectorQuery().in(l)).select("#conversation-actions-menu").boundingClientRect((n=>{var o,t;n&&(n.bottom>(null==(t=null==(o=e.i)?void 0:o.getWindowInfo)?void 0:t.call(o).windowHeight)&&(f.value={...c.actionsMenuPosition,top:c.actionsMenuPosition.top-(c.actionsMenuPosition.conversationHeight||0)-n.height}),f.value.left+n.width+5>e.i.getWindowInfo().windowWidth&&(f.value.left=e.i.getWindowInfo().windowWidth-n.width-5)),v.value=!1})).exec();else{const e=null==(t=u.value)?void 0:t.getBoundingClientRect();o.isPC&&void 0!==c.actionsMenuPosition.left&&(f.value.left=c.actionsMenuPosition.left),e&&e.bottom>window.innerHeight&&(f.value.top=c.actionsMenuPosition.top-(c.actionsMenuPosition.conversationHeight||0)-e.height),v.value=!1}}))}));const O=e.computed((()=>{var n,o;return(null==(n=c.selectedConversation)?void 0:n.type)===e.qt.TYPES.CONV_C2C?"TUIConversation.删除后,将清空该聊天的消息记录":(null==(o=c.selectedConversation)?void 0:o.type)===e.qt.TYPES.CONV_GROUP?"TUIConversation.删除后,将清空该群聊的消息记录":""}));const I=e=>{const{name:o}=e,t=C;if(o&&t&&t.conversationID){switch(o){case n.CONV_OPERATION.DELETE:null==t||t.deleteConversation();break;case n.CONV_OPERATION.ISPINNED:case n.CONV_OPERATION.DISPINNED:null==t||t.pinConversation();break;case n.CONV_OPERATION.MUTE:case n.CONV_OPERATION.NOTMUTE:null==t||t.muteConversation()}a("closeConversationActionMenu")}},P=e=>{e||a("closeConversationActionMenu"),d.value=e};return(t,i)=>e.e({a:e.t(e.unref(e.Wt).t("TUIConversation.删除会话")),b:e.o$1((e=>{d.value=!0})),c:!(c.selectedConversation&&c.selectedConversation.isPinned)},c.selectedConversation&&c.selectedConversation.isPinned?{}:{d:e.t(e.unref(e.Wt).t("TUIConversation.置顶会话")),e:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).ISPINNED})))},{f:c.selectedConversation&&c.selectedConversation.isPinned},c.selectedConversation&&c.selectedConversation.isPinned?{g:e.t(e.unref(e.Wt).t("TUIConversation.取消置顶")),h:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).DISPINNED})))}:{},{i:!(c.selectedConversation&&c.selectedConversation.isMuted)},c.selectedConversation&&c.selectedConversation.isMuted?{}:{j:e.t(e.unref(e.Wt).t("TUIConversation.消息免打扰")),k:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).MUTE})))},{l:c.selectedConversation&&c.selectedConversation.isMuted},c.selectedConversation&&c.selectedConversation.isMuted?{m:e.t(e.unref(e.Wt).t("TUIConversation.取消免打扰")),n:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).NOTMUTE})))}:{},{o:e.n(e.unref(o.isPC)&&"actions-menu-pc"),p:e.n(!e.unref(v)&&"cancel-hidden"),q:`${e.unref(f).top}px`,r:`${e.unref(f).left}px`,s:e.t(e.unref(e.Wt).t(e.unref(O))),t:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).DELETE}))),v:e.o$1(P),w:e.p({show:e.unref(d),center:!0,isHeaderShow:e.unref(o.isPC)}),x:e.o$1((()=>a("closeConversationActionMenu"))),y:e.p({maskColor:"transparent"})})}}),r=e._export_sfc(s,[["__scopeId","data-v-bded2c14"]]);wx.createComponent(r);
|