cnhis-design-vue 3.2.15-beta.11 → 3.2.15-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/src/utils/print.d.ts +3 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/iho-chat/index.d.ts +44 -22
- package/es/components/iho-chat/src/Index.vue.d.ts +44 -22
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +0 -2
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +0 -2
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +0 -9
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +0 -3
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +0 -3
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +13 -2
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -21,7 +21,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
21
|
}>> & {}>>;
|
22
22
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
23
23
|
state: {
|
24
|
-
filterable: boolean;
|
25
24
|
orgId: string | number;
|
26
25
|
currentSessionItem: AnyObject;
|
27
26
|
id: string;
|
@@ -129,7 +128,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
129
128
|
}>>;
|
130
129
|
emit: (event: "comfirm", ...args: any[]) => void;
|
131
130
|
state: {
|
132
|
-
filterable: boolean;
|
133
131
|
orgId: string | number;
|
134
132
|
currentSessionItem: AnyObject;
|
135
133
|
id: string;
|
@@ -6,7 +6,6 @@ import { FileOptions } from '../types';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
inputRef: Ref<HTMLDivElement | undefined>;
|
8
8
|
state: {
|
9
|
-
filterable: boolean;
|
10
9
|
orgId: string | number;
|
11
10
|
currentSessionItem: AnyObject;
|
12
11
|
id: string;
|
@@ -110,7 +109,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
110
109
|
}>>;
|
111
110
|
emit: (event: "comfirm", ...args: any[]) => void;
|
112
111
|
state: {
|
113
|
-
filterable: boolean;
|
114
112
|
orgId: string | number;
|
115
113
|
currentSessionItem: AnyObject;
|
116
114
|
id: string;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
3
|
state: {
|
4
|
-
filterable: boolean;
|
5
4
|
orgId: string | number;
|
6
5
|
currentSessionItem: AnyObject;
|
7
6
|
id: string;
|
@@ -71,7 +70,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
71
70
|
}>>;
|
72
71
|
emit: (event: "close", ...args: any[]) => void;
|
73
72
|
state: {
|
74
|
-
filterable: boolean;
|
75
73
|
orgId: string | number;
|
76
74
|
currentSessionItem: AnyObject;
|
77
75
|
id: string;
|
@@ -138,7 +136,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
138
136
|
[x: string]: unknown;
|
139
137
|
};
|
140
138
|
state: {
|
141
|
-
filterable: boolean;
|
142
139
|
orgId: string | number;
|
143
140
|
currentSessionItem: AnyObject;
|
144
141
|
id: string;
|
@@ -213,7 +210,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
213
210
|
}>>;
|
214
211
|
emit: (event: "close", ...args: any[]) => void;
|
215
212
|
state: {
|
216
|
-
filterable: boolean;
|
217
213
|
orgId: string | number;
|
218
214
|
currentSessionItem: AnyObject;
|
219
215
|
id: string;
|
@@ -329,7 +325,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
329
325
|
}>>;
|
330
326
|
emit: (event: "comfirm", ...args: any[]) => void;
|
331
327
|
state: {
|
332
|
-
filterable: boolean;
|
333
328
|
orgId: string | number;
|
334
329
|
currentSessionItem: AnyObject;
|
335
330
|
id: string;
|
@@ -441,7 +436,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
441
436
|
}>> & {}>>;
|
442
437
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
443
438
|
state: {
|
444
|
-
filterable: boolean;
|
445
439
|
orgId: string | number;
|
446
440
|
currentSessionItem: AnyObject;
|
447
441
|
id: string;
|
@@ -549,7 +543,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
549
543
|
}>>;
|
550
544
|
emit: (event: "comfirm", ...args: any[]) => void;
|
551
545
|
state: {
|
552
|
-
filterable: boolean;
|
553
546
|
orgId: string | number;
|
554
547
|
currentSessionItem: AnyObject;
|
555
548
|
id: string;
|
@@ -667,7 +660,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
667
660
|
};
|
668
661
|
}>> & {}>>;
|
669
662
|
state: {
|
670
|
-
filterable: boolean;
|
671
663
|
orgId: string | number;
|
672
664
|
currentSessionItem: AnyObject;
|
673
665
|
id: string;
|
@@ -900,7 +892,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
900
892
|
}>>;
|
901
893
|
emit: (event: "comfirm", ...args: any[]) => void;
|
902
894
|
state: {
|
903
|
-
filterable: boolean;
|
904
895
|
orgId: string | number;
|
905
896
|
currentSessionItem: AnyObject;
|
906
897
|
id: string;
|
@@ -6,7 +6,6 @@ import { MESSAGE_TYPE } from '../constants';
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
chatMainRef: import("vue").Ref<HTMLElement | undefined>;
|
8
8
|
state: {
|
9
|
-
filterable: boolean;
|
10
9
|
orgId: string | number;
|
11
10
|
currentSessionItem: AnyObject;
|
12
11
|
id: string;
|
@@ -97,7 +96,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
97
96
|
}>>;
|
98
97
|
emit: (event: "close", ...args: any[]) => void;
|
99
98
|
state: {
|
100
|
-
filterable: boolean;
|
101
99
|
orgId: string | number;
|
102
100
|
currentSessionItem: AnyObject;
|
103
101
|
id: string;
|
@@ -332,7 +330,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
332
330
|
}>>;
|
333
331
|
emit: (event: "comfirm", ...args: any[]) => void;
|
334
332
|
state: {
|
335
|
-
filterable: boolean;
|
336
333
|
orgId: string | number;
|
337
334
|
currentSessionItem: AnyObject;
|
338
335
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as n,watch as o,openBlock as s,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as l,createVNode as c,withCtx as u,Fragment as m,renderList as d,toDisplayString as p,createCommentVNode as g,createBlock as f,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as w,NAvatar as k,NImage as _,NIcon as C,NSpace as x,NButtonGroup as I,NTooltip as L}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import{isAudioOrVideoMessage as z,simplifyMessage as D,getAVTime as H,downloadFile as R}from"../utils/index.js";import{first as B,last as N,toString as O}from"lodash-es";import"trtc-sdk-v5";import P from"./PersonProfile.vue.js";import q from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},oe=["data-time"],se=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],le=["innerHTML"],ce=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:pe,setMsgList:ge,relayMessage:fe,setCurrentSessionItem:ve,isGroupChat:ye}=b(),he=t(),Te=t(!1),Me=t({left:0,top:0}),we=t(),ke=t(),_e={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function xe({nodes:e}){var t,n;const{_ctx:o}=null==(t=e.download)?void 0:t.children,s=o?null==(n=null==o?void 0:o.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,c(L,null,{trigger:()=>c(C,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>s&&R(s,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}async function Ie(){try{if(!_e.hasMore)return;_e.page++;const e=await E({sessionKey:pe.currentSessionItem.sessionKey,page:_e.page,lastSendTime:_e.lastSendTime});if(!Array.isArray(e)||0===e.length)return _e.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=B(e).id;_e.lastSendTime=N(e).sendTime,ge(_e.page>1?[...pe.msgList,...e]:e),1===_e.page&&pe.currentSessionItem.unreadNum&&(await S({chatType:pe.currentSessionItem.chatType,messageIdSet:[t],receiver:pe.userInfo.id,sender:pe.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Le(e,t){we.value=t,async function(e){var t,n,o,s,i,r;Te.value=!0,await T();const{clientX:a,clientY:l}=e,{width:c=0,height:u=0,left:m=0,top:d=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},p=null!=(s=null==(o=null==(n=he.value)?void 0:n.$el)?void 0:o.getBoundingClientRect().height)?s:220,g=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,f=5,v={};a<=m+c/2?v.left=a-m+f+"px":v.right=m+c-a-f+"px";l-d<p/2?v.top=g+f+"px":d+u-l<=p/2?v.bottom=Math.abs(g)+f+"px":v.top=g+l-d-p/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===pe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[A.TEXT,A.EMOJI].includes(t)}function Se(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===A.BLEND){const e=O(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[A.TEXT,A.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,o=O(n).match(/<img[^>]*>/gi);return t===A.BLEND&&o&&o.length}function Ae(e,t){var n,o;const{chatMessageType:s,messageTemplate:i}=e.content;if(s===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(o=null==i?void 0:i.setting)?void 0:o.style.id)}function ze(e){var t,n;const{chatMessageType:o,messageTemplate:s}=e;return o===A.TEMPLATE&&3==(null==(n=null==(t=null==s?void 0:s.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const o=new Date(e.sendTime).getTime(),s=null==(n=pe.msgList[t+1])?void 0:n.sendTime;if(s){return o-new Date(s).getTime()>3e5}return!0}function He(e){pe.currentReferenceMsg=e,pe.currentReferenceMsg.content.referenceContent=null,Object.assign(pe.currentReferenceMsg,{chatType:pe.currentSessionItem.chatType,receiver:pe.currentSessionItem.receiver,receiverAvatar:pe.currentSessionItem.avatar,receiverName:pe.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=ke.value)||n.click()):He(t)}function Be(e,t){const n=pe.msgList.find((e=>e.id===we.value));fe({checkedIds:e,remark:t,content:n.content})}return Q(de,(()=>{Ie()}),"top",(()=>{Te.value=!1})),o((()=>pe.id),(e=>{e&&(pe.currentReferenceMsg=null,Object.assign(_e,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Ie())}),{immediate:!0}),o((()=>pe.isAppendMsg),(e=>{e&&(ge([pe.currentMsg,...pe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),pe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>{var n;return s(),i("div",{class:r(["chat-main",{"home-bg":!a(pe).id}]),ref_key:"chatMainRef",ref:de,style:l(a(Ce))},[c(a(M),{"show-toolbar-tooltip":"","render-toolbar":xe},{default:u((()=>[(s(!0),i(m,null,d(a(pe).msgList,((e,t)=>{var n,o;return s(),i(m,{key:e.id},[je(e)?(s(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(pe).userInfo.id}])},[De(e,t)?(s(),i("p",V,p(e.__sendTime),1)):g("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(s(),i(m,{key:1},[Ae(e,"system")?(s(),f(q,{key:0,data:e},null,8,["data"])):g("v-if",!0),"WITHDRAWN"===e.status?(s(),i("p",Z,[v("span",null,p(e.sender==a(pe).userInfo.id?(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.67"))||"你":e.senderName)+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.68"))||"撤回了一条消息"),1),Ee(e)?(s(),f(a(w),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){pe.currentReEditMsg=e}(e)},{default:u((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):g("v-if",!0)])):g("v-if",!0)],64)):(s(),i("div",ee,[c(P,{"user-id":e.sender,placement:e.sender==a(pe).userInfo.id?"left":"right"},{trigger:u((()=>[c(a(k),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(s(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},p(a(ye)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(A).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(A).TEMPLATE,"template--3":ze(e.content),"audio-video":a(z)(e.content),file:e.content.chatMessageType===a(A).FILE}]),onContextmenu:h((t=>Le(t,e.id)),["prevent"])},[Se(e)?(s(),i(m,{key:0},[e.content.referenceContent?(s(),i("div",ie,[v("span",null,p(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):g("v-if",!0),e.content.chatMessageType===a(A).EMOJI?(s(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(s(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):g("v-if",!0),be(e)?(s(),i("pre",{key:1,innerHTML:e.__content},null,8,ce)):g("v-if",!0),Ae(e,"template")?(s(),f(q,{key:2,data:e},null,8,["data"])):g("v-if",!0),e.content.chatMessageType===a(A).IMAGE?(s(),f(a(_),{key:3,width:"240",src:e.__content},null,8,["src"])):g("v-if",!0),a(z)(e.content)?(s(),i(m,{key:4},[c(a(C),{class:r({"is-audio":e.content.chatMessageType===a(A).AUDIO}),component:e.content.chatMessageType===a(A).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,p(a(H)(e.__content)),1)],64)):g("v-if",!0),e.content.chatMessageType===a(A).FILE?(s(),f(a(x),{key:5,"wrap-item":!1},{default:u((()=>[c(a(C),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),c(a(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,p(e.__content),1),v("span",me,p(e.__size),1)])),_:2},1024)])),_:2},1024)):g("v-if",!0),c(a(I),{class:"quick-menu"},{default:u((()=>[a(z)(e.content)?g("v-if",!0):(s(),i(m,{key:0},[g(' <n-button quaternary size="tiny">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),c(a(w),{quaternary:"",size:"tiny",onClick:()=>He(e)},{icon:u((()=>[c(a(C),{size:"17",component:a(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),c(a(w),{quaternary:"",size:"tiny",onClick:t=>Le(t,e.id)},{icon:u((()=>[c(a(C),{size:"14",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,se)])):g("v-if",!0)]))],2)):g("v-if",!0)],64)})),128))])),_:1}),c(a(W),{ref_key:"contextmenuRef",ref:he,show:Te.value,"onUpdate:show":t[0]||(t[0]=e=>Te.value=e),position:Me.value,id:we.value,onSelect:Re},null,8,["show","position","id"]),c(U,{title:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:Be},{trigger:u((()=>{var e;return[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:ke},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1})],6)}}});export{de as default};
|
1
|
+
import{defineComponent as e,ref as t,computed as n,watch as o,openBlock as s,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as l,createVNode as c,withCtx as u,Fragment as m,renderList as d,toDisplayString as p,createCommentVNode as g,createBlock as f,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as w,NAvatar as k,NImage as _,NIcon as C,NSpace as x,NButtonGroup as I,NTooltip as L}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as A}from"../constants/index.js";import{isAudioOrVideoMessage as z,simplifyMessage as D,getAVTime as H,downloadFile as R}from"../utils/index.js";import{first as B,last as N,toString as O}from"lodash-es";import"trtc-sdk-v5";import P from"./PersonProfile.vue.js";import q from"./MessageTemplate.vue.js";import{emojis as J}from"../utils/emoji.js";import W from"./ContextMenu.js";import U from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as X,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as K,EllipsisHorizontal as Y,ArrowDownSharp as $}from"@vicons/ionicons5";import{useScrollLoading as Q}from"../../../../shared/hooks/useScrollLoading.js";const V={key:0,class:"tip-text"},Z={key:1,class:"tip-text"},ee={key:2,class:"message-box"},te={key:0,class:"content-box"},ne={class:"name-box"},oe=["data-time"],se=["onContextmenu"],ie={key:0,class:"reference-content"},re=["innerHTML"],ae=["src"],le=["innerHTML"],ce=["innerHTML"],ue={style:{"margin-left":"8px"}},me={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:pe,setMsgList:ge,relayMessage:fe,setCurrentSessionItem:ve,isGroupChat:ye}=b(),he=t(),Te=t(!1),Me=t({left:0,top:0}),we=t(),ke=t(),_e={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":ye.value?"1px":"-20px","--c-tip-gap":ye.value?"10px":"0px"})));function xe({nodes:e}){var t,n;const{_ctx:o}=null==(t=e.download)?void 0:t.children,s=o?null==(n=null==o?void 0:o.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,c(L,null,{trigger:()=>c(C,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:$,onClick:()=>s&&R(s,"img")},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载"}}),e.close]}async function Ie(){try{if(!_e.hasMore)return;_e.page++;const e=await E({sessionKey:pe.currentSessionItem.sessionKey,page:_e.page,lastSendTime:_e.lastSendTime});if(!Array.isArray(e)||0===e.length)return _e.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=B(e).id;_e.lastSendTime=N(e).sendTime,ge(_e.page>1?[...pe.msgList,...e]:e),1===_e.page&&pe.currentSessionItem.unreadNum&&(await S({chatType:pe.currentSessionItem.chatType,messageIdSet:[t],receiver:pe.userInfo.id,sender:pe.currentSessionItem.receiver}),ve({unreadNum:0}))}catch(e){console.log(e)}}async function Le(e,t){we.value=t,async function(e){var t,n,o,s,i,r;Te.value=!0,await T();const{clientX:a,clientY:l}=e,{width:c=0,height:u=0,left:m=0,top:d=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},p=null!=(s=null==(o=null==(n=he.value)?void 0:n.$el)?void 0:o.getBoundingClientRect().height)?s:220,g=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,f=5,v={};a<=m+c/2?v.left=a-m+f+"px":v.right=m+c-a-f+"px";l-d<p/2?v.top=g+f+"px":d+u-l<=p/2?v.bottom=Math.abs(g)+f+"px":v.top=g+l-d-p/2+"px";Me.value=v}(e)}function je(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==A.TEMPLATE||!!n}function Ee(e){const{chatMessageType:t}=e.content;return e.sender===pe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[A.TEXT,A.EMOJI].includes(t)}function Se(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===A.BLEND){const e=O(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[A.TEXT,A.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content,o=O(n).match(/<img[^>]*>/gi);return t===A.BLEND&&o&&o.length}function Ae(e,t){var n,o;const{chatMessageType:s,messageTemplate:i}=e.content;if(s===A.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(o=null==i?void 0:i.setting)?void 0:o.style.id)}function ze(e){var t,n;const{chatMessageType:o,messageTemplate:s}=e;return o===A.TEMPLATE&&3==(null==(n=null==(t=null==s?void 0:s.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const o=new Date(e.sendTime).getTime(),s=null==(n=pe.msgList[t+1])?void 0:n.sendTime;if(s){return o-new Date(s).getTime()>3e5}return!0}function He(e){pe.currentReferenceMsg=e,pe.currentReferenceMsg.content.referenceContent=null,Object.assign(pe.currentReferenceMsg,{chatType:pe.currentSessionItem.chatType,receiver:pe.currentSessionItem.receiver,receiverAvatar:pe.currentSessionItem.avatar,receiverName:pe.currentSessionItem.name})}function Re(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=ke.value)||n.click()):He(t)}function Be(e,t){const n=pe.msgList.find((e=>e.id===we.value));fe({checkedIds:e,remark:t,content:n.content})}return Q(de,(()=>{Ie()}),"top",(()=>{Te.value=!1})),o((()=>pe.id),(e=>{e&&(pe.currentReferenceMsg=null,Object.assign(_e,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Ie())}),{immediate:!0}),o((()=>pe.isAppendMsg),(e=>{e&&(ge([pe.currentMsg,...pe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),pe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>{var n;return s(),i("div",{class:r(["chat-main",{"home-bg":!a(pe).id}]),ref_key:"chatMainRef",ref:de,style:l(a(Ce))},[c(a(M),{"show-toolbar-tooltip":"","render-toolbar":xe},{default:u((()=>[(s(!0),i(m,null,d(a(pe).msgList,((e,t)=>{var n,o;return s(),i(m,{key:e.id},[je(e)?(s(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(pe).userInfo.id}])},[De(e,t)?(s(),i("p",V,p(e.__sendTime),1)):g("v-if",!0),Ae(e,"system")||"WITHDRAWN"===e.status?(s(),i(m,{key:1},[Ae(e,"system")?(s(),f(q,{key:0,data:e},null,8,["data"])):g("v-if",!0),"WITHDRAWN"===e.status?(s(),i("p",Z,[v("span",null,p(e.sender==a(pe).userInfo.id?(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.67"))||"你":e.senderName)+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.68"))||"撤回了一条消息"),1),Ee(e)?(s(),f(a(w),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){pe.currentReEditMsg=e}(e)},{default:u((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.69"))||"重新编辑")]})),_:2},1032,["onClick"])):g("v-if",!0)])):g("v-if",!0)],64)):(s(),i("div",ee,[c(P,{"user-id":e.sender,placement:e.sender==a(pe).userInfo.id?"left":"right"},{trigger:u((()=>[c(a(k),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(s(),i("div",te,[v("div",ne,[v("span",{class:"name","data-time":e.__time},p(a(ye)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(A).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(A).TEMPLATE,"template--3":ze(e.content),"audio-video":a(z)(e.content),file:e.content.chatMessageType===a(A).FILE}]),onContextmenu:h((t=>Le(t,e.id)),["prevent"])},[Se(e)?(s(),i(m,{key:0},[e.content.referenceContent?(s(),i("div",ie,[v("span",null,p(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,re)])):g("v-if",!0),e.content.chatMessageType===a(A).EMOJI?(s(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(J).findEmoji(e.__content)},null,10,ae)):(s(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):g("v-if",!0),be(e)?(s(),i("pre",{key:1,innerHTML:e.__content},null,8,ce)):g("v-if",!0),Ae(e,"template")?(s(),f(q,{key:2,data:e},null,8,["data"])):g("v-if",!0),e.content.chatMessageType===a(A).IMAGE?(s(),f(a(_),{key:3,width:"240",src:e.__content},null,8,["src"])):g("v-if",!0),a(z)(e.content)?(s(),i(m,{key:4},[c(a(C),{class:r({"is-audio":e.content.chatMessageType===a(A).AUDIO}),component:e.content.chatMessageType===a(A).AUDIO?a(X):a(F)},null,8,["class","component"]),v("span",ue,p(a(H)(e.__content)),1)],64)):g("v-if",!0),e.content.chatMessageType===a(A).FILE?(s(),f(a(x),{key:5,"wrap-item":!1},{default:u((()=>[c(a(C),{class:"icon-file",size:"40",component:a(G)},null,8,["component"]),c(a(x),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,p(e.__content),1),v("span",me,p(e.__size),1)])),_:2},1024)])),_:2},1024)):g("v-if",!0),c(a(I),{class:"quick-menu"},{default:u((()=>[a(z)(e.content)?g("v-if",!0):(s(),i(m,{key:0},[g(' <n-button quaternary size="tiny">\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),c(a(w),{quaternary:"",size:"tiny",onClick:()=>He(e)},{icon:u((()=>[c(a(C),{size:"17",component:a(K)},null,8,["component"])])),_:2},1032,["onClick"])],64)),c(a(w),{quaternary:"",size:"tiny",onClick:t=>Le(t,e.id)},{icon:u((()=>[c(a(C),{size:"14",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,se)])):g("v-if",!0)]))],2)):g("v-if",!0)],64)})),128))])),_:1}),c(a(W),{ref_key:"contextmenuRef",ref:he,show:Te.value,"onUpdate:show":t[0]||(t[0]=e=>Te.value=e),position:Me.value,id:we.value,onSelect:Re},null,8,["show","position","id"]),c(U,{title:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:Be},{trigger:u((()=>{var e;return[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:ke},(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发",512)]})),_:1})],6)}}});export{de as default};
|
@@ -5,7 +5,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
keyword: import("vue").Ref<string>;
|
6
6
|
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
7
7
|
state: {
|
8
|
-
filterable: boolean;
|
9
8
|
orgId: string | number;
|
10
9
|
currentSessionItem: import("../../../../shared/types").AnyObject;
|
11
10
|
id: string;
|
@@ -5,7 +5,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
[x: string]: unknown;
|
6
6
|
};
|
7
7
|
state: {
|
8
|
-
filterable: boolean;
|
9
8
|
orgId: string | number;
|
10
9
|
currentSessionItem: AnyObject;
|
11
10
|
id: string;
|
@@ -80,7 +79,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
80
79
|
}>>;
|
81
80
|
emit: (event: "close", ...args: any[]) => void;
|
82
81
|
state: {
|
83
|
-
filterable: boolean;
|
84
82
|
orgId: string | number;
|
85
83
|
currentSessionItem: AnyObject;
|
86
84
|
id: string;
|
@@ -196,7 +194,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
196
194
|
}>>;
|
197
195
|
emit: (event: "comfirm", ...args: any[]) => void;
|
198
196
|
state: {
|
199
|
-
filterable: boolean;
|
200
197
|
orgId: string | number;
|
201
198
|
currentSessionItem: AnyObject;
|
202
199
|
id: string;
|
@@ -7,7 +7,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
7
7
|
name: string;
|
8
8
|
}[]>;
|
9
9
|
state: {
|
10
|
-
filterable: boolean;
|
11
10
|
orgId: string | number;
|
12
11
|
currentSessionItem: AnyObject;
|
13
12
|
id: string;
|
@@ -32,6 +31,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
32
31
|
receiver?: string | undefined;
|
33
32
|
}) => Promise<void>;
|
34
33
|
trtc: TRTC;
|
34
|
+
trtcProxy: import("vue").Ref<any>;
|
35
35
|
voiceOpen: import("vue").Ref<boolean>;
|
36
36
|
isAudio: import("vue").ComputedRef<boolean>;
|
37
37
|
isCall: import("vue").ComputedRef<boolean>;
|
@@ -125,7 +125,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
125
125
|
}>>;
|
126
126
|
emit: (event: "comfirm", ...args: any[]) => void;
|
127
127
|
state: {
|
128
|
-
filterable: boolean;
|
129
128
|
orgId: string | number;
|
130
129
|
currentSessionItem: AnyObject;
|
131
130
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as o,ref as t,computed as n,onBeforeUnmount as l,openBlock as i,createElementBlock as a,withDirectives as s,toDisplayString as
|
1
|
+
import{createElementVNode as e,defineComponent as o,ref as t,computed as n,onBeforeUnmount as l,openBlock as i,createElementBlock as a,withDirectives as s,toDisplayString as d,unref as c,vShow as r,createVNode as u,withCtx as m,Fragment as p,renderList as v,createCommentVNode as g,createTextVNode as w,nextTick as f}from"vue";import{NButton as h,NIcon as y}from"naive-ui";import k from"./ChatAdd.vue.js";import{Close as I,Mic as b,MicOff as A,Videocam as C,VideocamOff as V,Call as M,PersonAdd as _}from"@vicons/ionicons5";import{getUserDetailApi as x}from"../api/index.js";import"@vueuse/core";import{$message as L}from"../utils/index.js";import{xorBy as R}from"lodash-es";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as T}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as B}from"../hooks/useVideo.js";import j from"trtc-sdk-v5";var S,$,H,U,z,N;const P={class:"video-wrapper video-wrapper--multiple"},D={class:"video-header"},O={key:0,class:"video-main"},Y={class:"video-main__left"},q=["data-name"],G={class:"video-bottom"},F={class:"btn-group"},J={class:"btn"},K=e("span",{class:"text"},(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.104"))||"静音",-1),Q={class:"btn"},W=e("span",{class:"text"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.105"))||"摄像头",-1),X=e("span",{class:"text"},(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.106"))||"结束会诊",-1),Z={class:"btn"},ee=e("span",{class:"text"},(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.107"))||"添加参会人",-1),oe={class:"video-main__right"},te=["id","data-name"],ne={class:"user"},le={class:"name"},ie={key:0,class:"tip"},ae={key:0,class:"calling-box"},se={key:1,class:"opt-btn"},de={class:"btn"},ce=e("span",null,(null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.113"))||"拒接",-1),re={class:"btn"},ue=e("span",null,(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.114"))||"接听",-1);var me=o({__name:"MultipleVideo",setup(o){const S=t(),$=t([]),{state:H,sendMessage:U,trtc:z,trtcProxy:N,voiceOpen:me,isAudio:pe,isCall:ve,startTimer:ge,resetTimer:we,toggleAudio:fe,messageTypeText:he,timing:ye,toggleVideo:ke,videocamOpen:Ie,installEventHandlers:be,uninstallEventHandlers:Ae}=B(),Ce=t(!1),Ve=n((()=>ve.value?H.userInfo.name:H.currentAVMsg.sendName)),Me=n((()=>{if(!Ce.value)return"";const e=ve.value?`(${$.value.length+1}/${H.currentAVMsg.checkedIds.length+1})`:"";return`${Ve.value}发起的${he.value}会诊${e} ${ye.value}`}));function _e(e){console.log("checkedIds :>> ",e),H.currentAVMsg.checkedIds.push(...e),xe()}function xe(){var e;(null==(e=H.currentAVMsg.checkedIds)?void 0:e.length)&&H.currentAVMsg.checkedIds.forEach((e=>{U({chatType:E.SINGLE,content:{msg:H.currentAVMsg.chatMessageType+","+H.currentAVMsg.strRoomId,chatMessageType:T.AV_STATUS},receiver:e})})),Ce.value||Le()}async function Le(){const e=await j.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(H.showMultipleVideo=!1);try{if(await z.enterRoom({strRoomId:H.currentAVMsg.strRoomId,sdkAppId:parseInt(H.userInfo.sdkAppID),userId:H.userInfo.id,userSig:H.userInfo.userSig,proxy:N.value}),Ce.value=!0,ge(),be({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.startLocalAudio(),pe.value)return;await z.startLocalVideo({view:S.value})}catch(e){console.log("error :>> ",e),L.error(e),H.showMultipleVideo=!1}}async function Re(){try{if(H.showMultipleVideo=!1,Ae({handleError:$e,handleRemoteUserEnter:Be,handleRemoteAudioAvailable:Te,handleRemoteUserExit:Se,handleRemoteVideoAvailable:Ee}),await z.exitRoom(),await z.stopLocalAudio(),pe.value)return;await z.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Ee(e){const{userId:o,streamType:t}=e;try{t===j.TYPE.STREAM_TYPE_MAIN&&(await f(),await z.startRemoteVideo({userId:o,streamType:t,view:o}))}catch(e){console.log("error :>> ",e)}}async function Te(e){var o;const{userId:t}=e;if(t&&!(null==(o=$.value.map((e=>e.id)))?void 0:o.includes(t))){const e=await je(t);$.value.push({id:t,name:e})}}async function Be(e){const{userId:o}=e,t=await je(o);$.value.push({id:o,name:t}),ge()}async function je(e){const o=await x({userId:e});return(null==o?void 0:o.name)||""}function Se(e){console.log("event :>> 退房",e);const{userId:o}=e;$.value=R($.value,[{id:o,name:""}],"id")}function $e(e){console.log("error :>> ",e),H.showMultipleVideo=!1}return l((()=>{Re()})),(o,t)=>{var n,l,f,x,L,R;return i(),a("div",P,[e("div",D,[s(e("span",{class:"title"},d(c(Me)),513),[[r,Ce.value]]),u(c(h),{quaternary:"",circle:"",color:"#ffffffcc",onClick:Re},{icon:m((()=>[u(c(y),{component:c(I)},null,8,["component"])])),_:1})]),Ce.value?(i(),a("div",O,[e("div",Y,[e("div",{ref_key:"selfVideoRef",ref:S,class:"video-view","data-name":c(H).userInfo.name},null,8,q),e("div",G,[e("div",F,[e("div",J,[u(c(h),{text:"",color:c(me)?"#fff":"#000",onClick:c(fe)},{icon:m((()=>[u(c(y),{component:c(me)?c(b):c(A)},null,8,["component"])])),_:1},8,["color","onClick"]),K]),e("div",Q,[u(c(h),{text:"",color:c(Ie)?"#fff":"#000",disabled:c(pe),onClick:c(ke)},{icon:m((()=>[u(c(y),{component:c(Ie)?c(C):c(V)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),W]),e("div",{class:"btn",onClick:Re},[u(c(h),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:m((()=>[u(c(y),{component:c(M)},null,8,["component"])])),_:1}),X]),u(k,{onComfirm:_e},{trigger:m((()=>[e("div",Z,[u(c(h),{text:"",color:"#fff"},{icon:m((()=>[u(c(y),{component:c(_)},null,8,["component"])])),_:1}),ee])])),_:1})])])]),e("div",oe,[(i(!0),a(p,null,v($.value,(e=>(i(),a("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,te)))),128))])])):(i(),a(p,{key:1},[e("div",ne,[e("span",le,d(c(Ve))+((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.108"))||"发起的")+d(c(he))+((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.109"))||"会议"),1),c(ve)?g("v-if",!0):(i(),a("span",ie,((null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.110"))||"邀请你加入")+d(c(he))+((null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.109"))||"会议"),1))]),c(ve)?(i(),a("div",ae,[u(k,{onComfirm:_e,disabledIds:c(H).currentAVMsg.checkedIds},{trigger:m((()=>[u(c(h),{size:"large",circle:"",color:"#000"},{icon:m((()=>[u(c(y),{component:c(_)},null,8,["component"])])),_:1})])),_:1},8,["disabledIds"]),e("p",null,((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.111"))||"已邀请共")+d(c(H).currentAVMsg.checkedIds.length)+((null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.40"))||"人"),1),u(c(h),{size:"large",strong:"",round:"",type:"primary",onClick:xe},{default:m((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.112"))||"开始会诊")]})),_:1}),g(' <div class="btn-box">\n\t\t\t\t\t\t<n-button color="#000" round>\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<n-icon :component="Mic" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t<n-button color="#000" round>\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<n-icon :component="Videocam" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</n-button>\n\t\t\t\t\t</div> ')])):(i(),a("div",se,[e("div",de,[u(c(h),{circle:"",color:"#f17568",class:"btn--rotate",onClick:t[0]||(t[0]=()=>c(H).showMultipleVideo=!1)},{icon:m((()=>[u(c(y),{size:"30",component:c(M)},null,8,["component"])])),_:1}),ce]),e("div",re,[u(c(h),{circle:"",color:"#2ac98b",onClick:Le},{icon:m((()=>[u(c(y),{size:"30",component:c(M)},null,8,["component"])])),_:1}),ue])]))],64))])}}});export{me as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as l,computed as n,openBlock as o,createBlock as a,unref as i,withCtx as
|
1
|
+
import{defineComponent as t,ref as e,reactive as l,computed as n,openBlock as o,createBlock as a,unref as i,withCtx as s,renderSlot as r,createElementBlock as d,Fragment as c,withDirectives as u,createElementVNode as p,createVNode as v,createCommentVNode as g,toDisplayString as m,createTextVNode as w,renderList as y,vShow as f}from"vue";import{NPopover as k,NAvatar as h,NButton as b,NIcon as C}from"naive-ui";import{ChatbubbleEllipses as j,EyeOffOutline as L,EyeOutline as B,Close as I}from"@vicons/ionicons5";import{useData as _}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as x}from"../constants/index.js";import{openSessionApi as z,getUserDetailApi as N}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";const D={class:"person-profile-main"},S={class:"left"},$={class:"profile"},E={class:"profile__text"},P={class:"right"},q={class:"right__content"},G={class:"label"},O={class:"content"};var T=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:T}){var U,A,F,H,J,K,M,Q;const R=t,{state:V,openSession:W}=_(),X=e(!1),Y=e(!1),Z=e(!1),tt=l({}),et=[{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.115"))||"机构",value:"",key:"orgName"},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.116"))||"姓名",value:"",key:"name"},{label:(null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.117"))||"归属科室",value:"",key:"deptName"},{label:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.118"))||"业务科室",value:"",key:"businessDeptNames"},{label:(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.119"))||"手机号",value:"",key:"phone"},{label:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.120"))||"岗位",value:"",key:"post"},{label:(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.121"))||"工号",value:"",key:"jobId"},{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.122"))||"性别",value:"",key:"orgName"}],lt=n((()=>(tt.id&&et.forEach((t=>{const{key:e}=t;t.value=tt[e]})),et)));async function nt(){X.value=!1;let t=V.sessionList.find((t=>t.receiver===R.userId));if(!t)try{t=await z({chatType:x.SINGLE,receiver:R.userId,sender:V.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&W(t),T("close")}async function ot(t){if(!t)return;const e=await N({userId:R.userId});(null==e?void 0:e.id)?Object.assign(tt,e):tt.id=""}function at(t){const{key:e,value:l}=t;return"phone"!==e||Z.value?l:(l||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,l)=>(o(),a(i(k),{raw:"",class:"person-profile-wrapper",show:X.value,"onUpdate:show":[l[3]||(l[3]=t=>X.value=t),ot],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[r(e.$slots,"trigger")])),default:s((()=>[tt.id?(o(),d(c,{key:0},[u(p("div",D,[p("div",S,[p("div",$,[v(i(h),{src:tt.avatar,bordered:"",round:"",size:100,onClickCapture:l[0]||(l[0]=t=>Y.value=!0)},null,8,["src"]),g(' <n-upload abstract accept="image/*" @change="onChange">\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\n\t\t\t\t\t\t\t\t<n-button\n\t\t\t\t\t\t\t\t\tcircle\n\t\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\n\t\t\t\t\t\t\t\t\t@click="handleClick"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t</n-button>\n\t\t\t\t\t\t\t</n-upload-trigger>\n\t\t\t\t\t\t</n-upload> '),p("div",E,[p("h4",null,m(tt.name),1),p("p",null,m(tt.orgName),1)]),v(i(b),{strong:"",secondary:"",onClick:nt},{default:s((()=>[v(i(C),{size:"13",color:"#666666",component:i(j),style:{"margin-right":"6px"}},null,8,["component"]),w(" 发消息 ")])),_:1})])]),p("div",P,[p("div",q,[(o(!0),d(c,null,y(i(lt),((t,e)=>(o(),d("div",{class:"info-item",key:e},[p("span",G,m(t.label),1),p("div",O,[p("span",null,m(at(t)),1),"phone"===t.key&&at(t)?(o(),a(i(C),{key:0,size:"16",color:"#666666",component:Z.value?i(L):i(B),style:{"margin-left":"10px"},onClick:l[1]||(l[1]=t=>Z.value=!Z.value)},null,8,["component"])):g("v-if",!0)])])))),128))])])],512),[[f,!Y.value]]),u(p("div",{class:"large-avatar",onClick:l[2]||(l[2]=t=>Y.value=!1)},[v(i(b),{circle:"",size:"small",secondary:""},{icon:s((()=>[v(i(C),{size:24,component:i(I),color:"#fff"},null,8,["component"])])),_:1}),v(i(h),{size:310,round:"",src:tt.avatar},null,8,["src"])],512),[[f,Y.value]])],64)):g("v-if",!0)])),_:3},8,["show","trigger"]))}});export{T as default};
|
@@ -28,7 +28,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
28
28
|
filterList: import("vue").Ref<AnyObject[]>;
|
29
29
|
handleInput: () => void;
|
30
30
|
state: {
|
31
|
-
filterable: boolean;
|
32
31
|
orgId: string | number;
|
33
32
|
currentSessionItem: AnyObject;
|
34
33
|
id: string;
|
@@ -48,6 +47,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
48
47
|
showMultipleVideo: boolean;
|
49
48
|
};
|
50
49
|
unreadTotal: import("vue").ComputedRef<number>;
|
50
|
+
filterable: import("vue").Ref<any>;
|
51
51
|
openSession: (session: string | AnyObject) => Promise<void>;
|
52
52
|
setUpdateSessionItem: (item: AnyObject) => void;
|
53
53
|
setCurrentSessionItem: (item: AnyObject) => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as l,withDirectives as n,openBlock as i,createElementBlock as a,normalizeStyle as o,unref as s,createVNode as u,withCtx as r,createElementVNode as d,Fragment as v,renderList as c,createBlock as p,vShow as m,createCommentVNode as f,createTextVNode as g,toDisplayString as w,withModifiers as y,normalizeClass as k,nextTick as h}from"vue";import{NPopover as _,NInput as x,NIcon as C,NTag as M,NAvatar as R,NBadge as b}from"naive-ui";import j from"./ContextMenu.js";import{useData as D}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as E}from"../constants/index.js";import{toppingSessionApi as L,updateStatusApi as B}from"../api/index.js";import{listSort as I,formatTime as T}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";import S from"../../../date-picker/index.js";import{SearchOutline as V}from"@vicons/ionicons5";import $ from"./userItemRender.js";import O from"../../../default-page/index.js";import{useDebounceFn as U}from"@vueuse/core";import{isBefore as H,isAfter as z}from"date-fns";const K={key:0,class:"sider-list__filter"},P={class:"user-list-wrapper"},W={class:"sider-list__tags box-shadow"},A=["onClick","onContextmenu"],X={class:"avatar-right"},Y={class:"name"},q={class:"msg-tip"},F={class:"msg-tip__content"},G={key:0},J=["innerHTML"];var Q=e({__name:"SiderList",setup(e){var Q,Z,ee;const te="all",le="unread",ne="ended";let ie=[];const ae=t(300),oe=t(),se=t([{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.123"))||"全部",key:te},{label:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.124"))||"未读",key:le},{label:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.77"))||"结束",key:ne}]),ue=t(),re=t(!1),de=t({left:0,top:0}),ve=t(),ce=t("all"),pe=t(),me=t(),fe=t(),ge=t(""),we=t(!1),ye=t([]),ke=U(
|
1
|
+
import{defineComponent as e,ref as t,computed as l,withDirectives as n,openBlock as i,createElementBlock as a,normalizeStyle as o,unref as s,createVNode as u,withCtx as r,createElementVNode as d,Fragment as v,renderList as c,createBlock as p,vShow as m,createCommentVNode as f,createTextVNode as g,toDisplayString as w,withModifiers as y,normalizeClass as k,nextTick as h}from"vue";import{NPopover as _,NInput as x,NIcon as C,NTag as M,NAvatar as R,NBadge as b}from"naive-ui";import j from"./ContextMenu.js";import{useData as D}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as E}from"../constants/index.js";import{toppingSessionApi as L,updateStatusApi as B}from"../api/index.js";import{listSort as I,formatTime as T}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";import S from"../../../date-picker/index.js";import{SearchOutline as V}from"@vicons/ionicons5";import $ from"./userItemRender.js";import O from"../../../default-page/index.js";import{useDebounceFn as U}from"@vueuse/core";import{isBefore as H,isAfter as z}from"date-fns";const K={key:0,class:"sider-list__filter"},P={class:"user-list-wrapper"},W={class:"sider-list__tags box-shadow"},A=["onClick","onContextmenu"],X={class:"avatar-right"},Y={class:"name"},q={class:"msg-tip"},F={class:"msg-tip__content"},G={key:0},J=["innerHTML"];var Q=e({__name:"SiderList",setup(e){var Q,Z,ee;const te="all",le="unread",ne="ended";let ie=[];const ae=t(300),oe=t(),se=t([{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.123"))||"全部",key:te},{label:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.124"))||"未读",key:le},{label:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.77"))||"结束",key:ne}]),ue=t(),re=t(!1),de=t({left:0,top:0}),ve=t(),ce=t("all"),pe=t(),me=t(),fe=t(),ge=t(""),we=t(!1),ye=t([]),ke=U(Ne,500),{state:he,unreadTotal:_e,filterable:xe,openSession:Ce,setUpdateSessionItem:Me,setCurrentSessionItem:Re}=D(),be=l((()=>Math.min(Math.max(ae.value,240),360))),je=l((()=>I(he.sessionList)));function De({distance:e}){ae.value=ae.value+e}function Ee(e,t=s(ce)){var l;return t===te||(t===le?ie.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:t===ne?e.status===E.ENDED:void 0)}async function Le(e,t){try{if("topping"===e)return await L({id:t.id,topping:!(null==t?void 0:t.topping)}),void(he.id===t.id?Re({topping:!(null==t?void 0:t.topping)}):Me({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await B({id:t.id,status:E.REMOVED}),he.id===t.id?Re({status:E.REMOVED}):Me({...t,status:E.REMOVED}))}catch(e){}}function Be(e){we.value=e,e||(ge.value="",fe.value=null,ye.value=[])}function Ie(e){var t,l,n,i,a;const o=null==(n=null==(l=null==(t=pe.value)?void 0:t.$datePicker)?void 0:l.panelInstRef)?void 0:n.$el;Be(!(!e.target||!(o&&o.contains(e.target)||(null==(i=me.value)?void 0:i.$el)&&(null==(a=me.value)?void 0:a.$el.contains(e.target)))))}function Te(e){fe.value=e,Ne()}function Ne(){ge.value||fe.value?ye.value=je.value.filter((e=>{const t=e.name.includes(ge.value);if(!fe.value)return t;const[l,n]=fe.value,i=new Date(e.createdTime);return t&&H(i,new Date(n+" 23:59:59"))&&z(i,new Date(l+" 00:00:00"))})):ye.value=[]}return(e,t)=>n((i(),a("section",{class:"sider-list",style:o({width:s(be)+"px"})},[s(xe)?(i(),a("div",K,[u(s(_),{raw:"","content-class":"search-content__sider",class:"search-wrapper",show:we.value,placement:"bottom-start","display-directive":"show","show-arrow":!1,onClickoutside:Ie},{trigger:r((()=>[u(s(x),{ref_key:"inputRef",ref:me,placeholder:"请输入名称模糊搜索",value:ge.value,"onUpdate:value":t[0]||(t[0]=e=>ge.value=e),onInput:s(ke),onClick:t[1]||(t[1]=()=>Be(!0))},{prefix:r((()=>[u(s(C),{component:s(V)},null,8,["component"])])),_:1},8,["value","onInput"])])),default:r((()=>{var e;return[u(s(S),{ref_key:"datePickerRef",ref:pe,"formatted-value":fe.value,type:"daterange",clearable:"","onUpdate:formattedValue":Te},null,8,["formatted-value"]),d("div",P,[(i(!0),a(v,null,c(ye.value,(e=>(i(),p(s($),{key:e.id,item:e,onItemClick:t[2]||(t[2]=()=>Be(!1))},null,8,["item"])))),128)),n(u(s(O),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[m,ye.value.length<1]])])]})),_:1},8,["show"])])):f("v-if",!0),d("div",W,[(i(!0),a(v,null,c(se.value,(e=>(i(),p(s(M),{type:ce.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,ce.value=t,void(t===le&&(ie=(je.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:r((()=>{return[g(w(e.label)+"("+w((t=e,t.key===ne?je.value.filter((e=>e.status===E.ENDED)).length:_e.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:oe},[(i(!0),a(v,null,c(s(je),(e=>{var t;return i(),a(v,{key:e.id},[e.status!==s(E).REMOVED?n((i(),a("div",{key:0,onClick:()=>s(Ce)(e),onContextmenu:y((t=>async function(e,t){var l,n,i,a,o;ve.value=t,re.value=!0,await h();const{clientX:s,clientY:u}=e,{width:r=0,height:d=0,left:v=0,top:c=0}=(null==(l=oe.value)?void 0:l.getBoundingClientRect())||{},{width:p=100,height:m=80}=(null==(i=null==(n=ue.value)?void 0:n.$el)?void 0:i.getBoundingClientRect())||{},f=null!=(o=null==(a=oe.value)?void 0:a.scrollTop)?o:0,g={};s<v+r-(p+2)-5?g.left=s-v+5+"px":g.right=v+r-s+5+"px",c+d-u<=m+5?g.bottom=5-f+"px":g.top=u-c+f+5+"px",de.value=g}(t,e.id)),["prevent"]),class:k(["sider-list__box__item",{active:e.id===s(he).id},e.topping?"sider-list__box__item--top":""])},[u(s(R),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",X,[d("div",Y,[d("h4",null,w(e.name),1),d("span",null,w(e.lastMessage?s(T)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",q,[d("div",F,["WITHDRAWN"===e.lastMessageStatus?(i(),a("div",G,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(i(),a("div",{key:1,innerHTML:e.lastMessageContent},null,8,J))]),u(s(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,A)),[[m,Ee(e)]]):f("v-if",!0)],64)})),128)),u(s(j),{ref_key:"contextmenuRef",ref:ue,show:re.value,"onUpdate:show":t[3]||(t[3]=e=>re.value=e),type:"session",position:de.value,id:ve.value,onSelect:Le},null,8,["show","position","id"])],512)],4)),[[s(N),{mode:"VR",onMove:De}]])}});export{Q as default};
|
@@ -7,7 +7,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
7
7
|
receiver?: string | undefined;
|
8
8
|
}) => Promise<void>;
|
9
9
|
state: {
|
10
|
-
filterable: boolean;
|
11
10
|
orgId: string | number;
|
12
11
|
currentSessionItem: import("../../../../shared/types").AnyObject;
|
13
12
|
id: string;
|
@@ -26,6 +25,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
26
25
|
currentGroupUser: import("../../../../shared/types").AnyObject[];
|
27
26
|
showMultipleVideo: boolean;
|
28
27
|
};
|
28
|
+
trtcProxy: import("vue").Ref<any>;
|
29
29
|
trtc: TRTC;
|
30
30
|
timing: import("vue").Ref<string>;
|
31
31
|
voiceOpen: import("vue").Ref<boolean>;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as r,openBlock as a,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as
|
1
|
+
import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as r,openBlock as a,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as y,MicOffCircle as I,Call as A}from"@vicons/ionicons5";import{avFinishApi as k}from"../api/index.js";import"@vueuse/core";import{$message as E}from"../utils/index.js";import"lodash-es";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as S}from"../hooks/useVideo.js";import C from"trtc-sdk-v5";var M,b,x,L;const T={class:"video-wrapper"},j={class:"user"},_={class:"name"},N={class:"tip"},H={class:"opt-btn"},D={class:"btn"},z=e("span",null,(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.104"))||"静音",-1),B=e("span",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.113"))||"拒接",-1),U={class:"btn"},F=e("span",null,(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.125"))||"挂断",-1),O=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.114"))||"接听",-1);var P=o({__name:"Video",setup(o){const{sendMessage:M,state:b,trtcProxy:x,trtc:L,timing:P,voiceOpen:G,isAudio:J,isCall:$,startTimer:q,resetTimer:K,toggleAudio:Q,messageTypeText:W,time:X,installEventHandlers:Y,uninstallEventHandlers:Z}=S(),ee=n(),oe=n(),ne=n(!1);let se=null;const te=s((()=>{var e,o,n;return $.value?{avatar:b.currentSessionItem.avatar,name:b.currentSessionItem.name,userId:b.currentSessionItem.receiver}:{avatar:null==(e=b.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=b.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=b.currentAVMsg.currentMsg)?void 0:n.sender}})),re=s((()=>ne.value?J.value?P.value:"":$.value?"正在呼叫...":`邀请你${W.value}问诊...`)),ae=s((()=>{var e,o;return null==(o=null==(e=b.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function le(e=V.FINISHED){M({chatType:R.SINGLE,content:{msg:e===V.FINISHED?""+X.seconds:"s",chatMessageType:b.currentAVMsg.chatMessageType,avStatus:e},receiver:te.value.userId}),await k({recordId:b.currentAVMsg.currentMsg.id,status:e,duration:e===V.FINISHED?X.seconds:0})}async function ie(){const e=await C.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(b.showVideo=!1);try{if(await L.enterRoom({strRoomId:b.currentAVMsg.strRoomId,sdkAppId:parseInt(b.userInfo.sdkAppID),userId:b.userInfo.id,userSig:b.userInfo.userSig,proxy:x.value}),$.value||(ne.value=!0,q()),Y({handleError:ge,handleRemoteUserEnter:me,handleRemoteAudioAvailable:ve,handleRemoteUserExit:pe,handleRemoteVideoAvailable:de}),await L.startLocalAudio(),J.value)return;await L.startLocalVideo({view:oe.value})}catch(e){console.log("error :>> ",e),E.error(e),b.showVideo=!1}}function ce(){$.value&&!ne.value?le(V.CANCELED):le()}async function ue(){try{if(b.showVideo=!1,Z({handleError:ge,handleRemoteUserEnter:me,handleRemoteAudioAvailable:ve,handleRemoteUserExit:pe,handleRemoteVideoAvailable:de}),await L.exitRoom(),await L.stopLocalAudio(),J.value)return;await L.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function de(e){const{userId:o,streamType:n}=e;try{await L.startRemoteVideo({userId:o,streamType:n,view:ee.value})}catch(e){console.log("error :>> ",e)}}function ve(e){}function me(){ne.value=!0,q()}function pe(e){console.log("event :>> 对方已挂断",e),ue()}function ge(e){console.log("error :>> ",e),b.showVideo=!1}return t((()=>ae.value),(e=>{b.showVideo&&(e===V.IN_CALL?async function(){$.value?ie():(se&&clearTimeout(se),se=setTimeout((async()=>{ne.value||le(V.NO_RESPONSE)}),6e4))}():ue())}),{immediate:!0}),r((()=>{ue()})),(o,n)=>(a(),l("div",T,[i(e("div",{class:"video-box",ref_key:"videoRef",ref:ee},null,512),[[c,ne.value]]),i(e("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:oe},null,512),[[c,ne.value]]),i(e("div",j,[u(d(f),{size:58,round:"",src:d(te).avatar},null,8,["src"]),e("span",_,v(d(te).name),1),e("span",N,v(d(re)),1)],512),[[c,d(J)||!ne.value]]),e("div",H,[e("div",D,[d($)&&!ne.value||ne.value?(a(),l(m,{key:0},[u(d(w),{circle:"",onClick:d(Q),class:p({bordered:d(G)})},{icon:g((()=>[u(d(h),{size:"30",color:d(G)?"#fff":"#626262",component:d(G)?d(y):d(I)},null,8,["color","component"])])),_:1},8,["onClick","class"]),z],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:n[0]||(n[0]=()=>le(d(V).REJECTED))},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),B],64))]),e("div",U,[d($)&&!ne.value||ne.value?(a(),l(m,{key:0},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:ce},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),F],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#2ac98b",onClick:ie},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),O],64))])])]))}});export{P as default};
|
@@ -3,10 +3,11 @@ import { ChatSock } from '../utils/chatSock';
|
|
3
3
|
import { AnyObject } from '../../../../shared/types';
|
4
4
|
export declare const InjectionIChatData: InjectionKey<ReturnType<typeof initData>>;
|
5
5
|
export declare function initData(props: AnyObject, emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void): {
|
6
|
+
filterable: import("vue").Ref<any>;
|
7
|
+
trtcProxy: import("vue").Ref<any>;
|
6
8
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
7
9
|
stompClient: import("vue").Ref<ChatSock | undefined>;
|
8
10
|
state: {
|
9
|
-
filterable: boolean;
|
10
11
|
orgId: string | number;
|
11
12
|
currentSessionItem: AnyObject;
|
12
13
|
id: string;
|
@@ -49,10 +50,11 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
|
|
49
50
|
emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
|
50
51
|
};
|
51
52
|
export declare const useData: () => {
|
53
|
+
filterable: import("vue").Ref<any>;
|
54
|
+
trtcProxy: import("vue").Ref<any>;
|
52
55
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
53
56
|
stompClient: import("vue").Ref<ChatSock | undefined>;
|
54
57
|
state: {
|
55
|
-
filterable: boolean;
|
56
58
|
orgId: string | number;
|
57
59
|
currentSessionItem: AnyObject;
|
58
60
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,reactive as s,
|
1
|
+
import{ref as e,reactive as s,computed as t,watch as n,toRef as i,inject as r,toRaw as o}from"vue";import{openSessionApi as a,updateStatusApi as c,groupUserApi as u}from"../api/index.js";import{promiseTimeout as m,useIntervalFn as d}from"@vueuse/core";import{isGroup as l,listSort as p,formatTime as g,transformMessage as f,getFileSize as h,simplifyMessage as S}from"../utils/index.js";import{cloneDeep as I,isArray as T,uniqBy as y}from"lodash-es";import{STATUS as v,MESSAGE_TYPE as L,CHAT_TYPE as M}from"../constants/index.js";import{useTheme as E}from"../../../../shared/hooks/useTheme.js";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";const C=Symbol("InjectionIChatData");function N(e){const{lastMessage:s,lastSenderName:t=""}=e,n=S(s)||"";return l(e)&&t?t+": "+n:n}function D(r,S){const C=e(),D=s({orgId:r.orgId,currentSessionItem:{},id:"",userInfo:{id:r.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),w=E(),j=t((()=>D.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),U=t((()=>l(D.currentSessionItem))),_=t((()=>{var e,s,t;return(null==(e=D.userInfo)?void 0:e.id)===(null==(t=null==(s=D.currentGroupUser)?void 0:s[0])?void 0:t.id)})),G=t((()=>{var e;return(null==(e=D.currentSessionItem)?void 0:e.status)===v.ENDED}));n((()=>j.value),(e=>{!async function s(t=0){if(t>2)return;const n=D.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?S("unread-message-update",e,p(n)):(await m(300),s(++t))}()})),n([()=>D.isChangeSession,()=>D.isUpdateSession],(([e,s])=>{e&&(P(D.currentSessionItem),D.currentSessionItem.status===v.REMOVED&&V(),D.isChangeSession=!1),s&&(P(D.updateSessionItem),D.isUpdateSession=!1)}),{immediate:!0});const{pause:R,resume:x,isActive:K}=d((()=>{const e=I(D.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=g(s).recordTime,!0)})),D.msgList=e,O()||R()}),6e4,{immediate:!1});function O(){return!!D.msgList.length&&D.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function b(e){var s;try{null==(s=C.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:D.currentSessionItem.chatType,receiver:D.currentSessionItem.receiver,...e}))}catch(e){}}function k(e){Object.assign(D.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?N({...e,chatType:e.chatType||D.currentSessionItem.chatType}):D.currentSessionItem.lastMessageContent}),D.isChangeSession=!0,D.id!==D.currentSessionItem.id&&(D.msgList=[],D.id=D.currentSessionItem.id)}function A(e){const s=D.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:N({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};D.updateSessionItem=s?{...I(s),...t}:t,D.isUpdateSession=!0}function V(){if(!D.id)return null;const{currentSessionItem:e}=D;return D.currentSessionItem={},D.msgList=[],D.id="",D.currentGroupUser=[],e}function B(e){D.sessionList=I(y(e,"id")),D.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:N(e)}),e.receiver===D.userInfo.id&&(e.unreadNum=0),e.chatType!==M.GROUP||e.name||u({id:e.receiver}).then((s=>{T(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function P(e){!e.id||D.sessionList.map((e=>e.id)).includes(e.id)?D.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==D.currentSessionItem.sessionKey&&s.sender&&s.sender!==D.userInfo.id&&(s.unreadNum=++t),!0}})):B([...D.sessionList,e])}return{filterable:i(r,"filterable"),trtcProxy:i(r,"trtcProxy"),cssVars:w,stompClient:C,state:D,unreadTotal:j,isGroupChat:U,isGroupLeader:_,isEnded:G,setMsgList:function(e=[]){R(),D.msgList=I(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),D.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:g(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[L.TEXT,L.TEXT,L.BLEND].includes(t)?f(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:g(e.sendTime).recordTime}),e.content.chatMessageType!==L.FILE||e.__size||h(e.content.fileUrl).then((s=>{e.__size=s}))})),O()&&x()},sendMessage:b,relayMessage:async function(e){const{checkedIds:s,remark:t,content:n}=e;for(let e=0;e<s.length;e++){const i=s[e],r=D.sessionList.find((e=>e.receiver===i));r||await a({chatType:M.SINGLE,receiver:i,sender:D.userInfo.id});const o=(null==r?void 0:r.chatType)||M.SINGLE;b({chatType:o,receiver:i,content:n}),await m(100),t&&b({chatType:o,receiver:i,content:{chatMessageType:L.TEXT,msg:t}}),await m(100)}},openSession:async function(e){try{const s="string"==typeof e?D.sessionList.find((s=>s.id===e)):e;if(!s)return;s.status===v.REMOVED&&(await c({id:s.id,status:v.ENABLED}),A({...s,status:v.ENABLED}),s.status=v.ENABLED);const t=D.currentSessionItem.sessionKey;if(k(s),t===D.currentSessionItem.sessionKey)return;if(U.value){const e=await u({id:s.receiver});D.currentGroupUser=T(e)?e:[]}else D.currentGroupUser=y([D.userInfo,{...I(s),id:s.receiver}],"id");S("session-change",{...o(D.currentSessionItem),userList:D.currentGroupUser.map((e=>o(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return D.id?D.currentSessionItem:null},setCurrentSessionItem:k,setUpdateSessionItem:A,setSessionList:B,emit:S}}const w=()=>r(C);export{C as InjectionIChatData,D as initData,w as useData};
|
@@ -9,7 +9,6 @@ type EventHandlers = {
|
|
9
9
|
};
|
10
10
|
export declare function useVideo(): {
|
11
11
|
state: {
|
12
|
-
filterable: boolean;
|
13
12
|
orgId: string | number;
|
14
13
|
currentSessionItem: import("../../../../shared/types").AnyObject;
|
15
14
|
id: string;
|
@@ -28,6 +27,7 @@ export declare function useVideo(): {
|
|
28
27
|
currentGroupUser: import("../../../../shared/types").AnyObject[];
|
29
28
|
showMultipleVideo: boolean;
|
30
29
|
};
|
30
|
+
trtcProxy: import("vue").Ref<any>;
|
31
31
|
sendMessage: (message: {
|
32
32
|
chatType?: string | undefined;
|
33
33
|
content: import("../../../../shared/types").AnyObject;
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import"lodash-es";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,sendMessage:
|
1
|
+
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import"lodash-es";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:r,trtcProxy:s,sendMessage:d}=n(),u=e(""),m=e(!0),c=e(!0),R=t((()=>r.currentAVMsg.chatMessageType===a.AUDIO)),T=t((()=>"call"===r.currentAVMsg.callMode)),v=t((()=>{var e,t;return R.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),A=l.create();function f(){u.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{f()})),{state:r,trtcProxy:s,sendMessage:d,trtc:A,timing:u,voiceOpen:m,videocamOpen:c,isAudio:R,isCall:T,startTimer:function(){f(),E.timer=setInterval((()=>{E.seconds++,u.value=i(E.seconds)}),1e3)},resetTimer:f,toggleAudio:async function(){await A.updateLocalAudio({mute:!m.value}),m.value=!m.value},toggleVideo:async function(){await A.updateLocalVideo({mute:!c.value}),c.value=!c.value},messageTypeText:v,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){A.on(l.EVENT.ERROR,e),A.on(l.EVENT.REMOTE_USER_ENTER,t),A.on(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),A.on(l.EVENT.REMOTE_USER_EXIT,n),R.value||A.on(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){A.off(l.EVENT.ERROR,e),A.off(l.EVENT.REMOTE_USER_ENTER,t),A.off(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),A.off(l.EVENT.REMOTE_USER_EXIT,n),R.value||A.off(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)}}}export{E as useVideo};
|
@@ -1,8 +1,6 @@
|
|
1
|
-
import { Ref } from 'vue';
|
2
1
|
import { AnyObject } from '../../../../shared/types';
|
3
2
|
import { UploadFileInfo } from 'naive-ui';
|
4
3
|
export type IState = {
|
5
|
-
filterable: Ref<boolean>;
|
6
4
|
orgId: number | string;
|
7
5
|
currentSessionItem: AnyObject;
|
8
6
|
id: string;
|
@@ -25,3 +23,16 @@ export type FileOptions = {
|
|
25
23
|
file: UploadFileInfo;
|
26
24
|
fileList: Array<UploadFileInfo>;
|
27
25
|
};
|
26
|
+
type TurnServer = {
|
27
|
+
url: string;
|
28
|
+
username?: string;
|
29
|
+
credential?: string;
|
30
|
+
credentialType?: string;
|
31
|
+
};
|
32
|
+
export type ProxyServer = Partial<{
|
33
|
+
websocketProxy: string;
|
34
|
+
loggerProxy: string;
|
35
|
+
turnServer: Array<TurnServer>;
|
36
|
+
iceTransportPolicy: 'all' | 'relay';
|
37
|
+
}>;
|
38
|
+
export {};
|