cnhis-design-vue 3.2.7-beta.2 → 3.2.7-beta.20
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/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/index.d.ts +60 -5
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +60 -5
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +60 -5
- package/es/components/classification/src/index.vue.d.ts +60 -5
- package/es/components/date-picker/index.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +11 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
- package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
- package/es/components/form-config/index.d.ts +6 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/form-render/src/utils/schema.d.ts +1 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/iho-chat/index.d.ts +236 -74
- package/es/components/iho-chat/src/Index.vue.d.ts +236 -74
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +34 -13
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +39 -14
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +48 -14
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +24 -4
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +3 -10
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +61 -24
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -2
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.d.ts +11 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -0
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +11 -0
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +0 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
- package/es/components/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +47 -5
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +37 -19
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +47 -5
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +47 -5
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +33 -18
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +69 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +69 -4
- package/es/components/table-filter/src/tool/transformData.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +1 -0
- package/es/components/time-line/index.d.ts +4 -4
- package/es/components/time-line/src/TimeLine.vue.d.ts +1 -1
- package/es/components/time-line/src/TimeLine.vue2.js +1 -1
- package/es/components/time-picker/index.d.ts +20 -2
- package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/business.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as
|
1
|
+
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as a,unref as r,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as v,createElementVNode as g,withModifiers as y,nextTick as h}from"vue";import{NImageGroup as T,NAvatar as M,NImage as _,NIcon as k,NFlex as x,NButtonGroup as I,NButton as S}from"naive-ui";import{format as L}from"date-fns";import{getHistoryRecordApi as j,readMessageApi as E}from"../api/index.js";import{useState as w}from"../hooks/useState.js";import{useSession as C}from"../hooks/useSession.js";import{MESSAGE_TYPE as b}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as A,simplifyMessage as z,getAVTime as H}from"../utils/index.js";import{first as D,last as R}from"lodash-es";import N from"./PersonProfile.vue.js";import O from"./MessageTemplate.vue.js";import{emojis as P}from"../utils/emoji.js";import q from"./ContextMenu.js";import{useScrollLoading as B}from"../hooks/useScrollLoading.js";import{CallOutline as U,VideocamOutline as F,DocumentSharp as G,ChatbubbleEllipsesOutline as J,EllipsisHorizontal as K}from"@vicons/ionicons5";const X={key:0,class:"time"},Y={key:2,class:"message-box"},$={key:0,class:"content-box"},Q={class:"name-box"},V=["data-time"],W=["onContextmenu"],Z={key:0,class:"reference-content"},ee=["innerHTML"],te=["innerHTML"],ne=["src"],se={style:{"margin-left":"8px"}},oe={class:"size"};var ie=e({__name:"ChatMain",setup(e){const ie=t(),{state:ae,setMsgList:re}=w(),{setCurrentSessionItem:ce,isGroupChat:le}=C(ae),ue=t(),me=t(!1),pe=t({left:0,top:0}),de=t(),fe={page:0,hasMore:!0,lastSendTime:L(new Date,"yyyy-MM-dd HH:mm:ss")},ve=n((()=>({"--c-tip-top":le.value?"1px":"-20px","--c-tip-gap":le.value?"10px":"0px"})));async function ge(){try{if(!fe.hasMore)return;fe.page++;const e=await j({sessionKey:ae.currentSessionItem.sessionKey,page:fe.page,lastSendTime:fe.lastSendTime});if(!Array.isArray(e)||0===e.length)return fe.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=D(e).id;fe.lastSendTime=R(e).sendTime,re(fe.page>1?[...e,...ae.msgList]:e),1===fe.page&&ae.currentSessionItem.unreadNum&&(await E({chatType:ae.currentSessionItem.chatType,messageIdSet:[t],receiver:ae.userInfo.id,sender:ae.currentSessionItem.receiver}),ce({unreadNum:0}))}catch(e){console.log(e)}}async function ye(e,t){de.value=t,async function(e){var t,n,s,o,i,a;me.value=!0,await h();const{clientX:r,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=ie.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=ue.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(a=null==(i=ie.value)?void 0:i.scrollTop)?a:0,v=5,g={};r<=m+l/2?g.left=r-m+v+"px":g.right=m+l-r-v+"px";c-p<d/2?g.top=f+v+"px":p+u-c<=d/2?g.bottom=Math.abs(f)+v+"px":g.top=f+c-p-d/2+"px";pe.value=g}(e)}function he(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==b.TEMPLATE||!!n}function Te(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===b.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function Me(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===b.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function _e(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=ae.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function ke(e){ae.currentReferenceMsg=e,Object.assign(ae.currentReferenceMsg,{chatType:ae.currentSessionItem.chatType,receiver:ae.currentSessionItem.receiver,receiverAvatar:ae.currentSessionItem.avatar,receiverName:ae.currentSessionItem.name})}function xe(e,t){"reply"===e&&ke(t)}return B(ie,(()=>{ge()}),"top",(()=>{me.value=!1})),s((()=>ae.id),(e=>{e&&(ae.currentReferenceMsg=null,Object.assign(fe,{page:0,hasMore:!0,lastSendTime:L(new Date,"yyyy-MM-dd HH:mm:ss")}),ge())}),{immediate:!0}),s((()=>ae.isAppendMsg),(e=>{e&&(re([...ae.msgList,ae.currentMsg]),ae.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=ie.value)?void 0:e.scrollHeight)?t:0;null==(n=ie.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(o(),i("div",{class:a(["chat-main",{"home-bg":!r(ae).id}]),ref_key:"chatMainRef",ref:ie,style:c(r(ve))},[l(r(T),{"show-toolbar-tooltip":""},{default:u((()=>[(o(!0),i(m,null,p(r(ae).msgList,((e,t)=>(o(),i(m,{key:e.id},[he(e)?(o(),i("div",{key:0,class:a(["message-item",{"message-item--mine":e.sender==r(ae).userInfo.id}])},[_e(e,t)?(o(),i("p",X,d(e.__sendTime),1)):f("v-if",!0),Te(e,"system")?(o(),v(O,{key:1,data:e},null,8,["data"])):(o(),i("div",Y,[l(N,{"user-id":e.sender},{trigger:u((()=>[l(r(M),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(o(),i("div",$,[g("div",Q,[g("span",{class:"name","data-time":e.__time},d(r(le)?e.senderName:""),9,V)]),g("div",{class:a(["content",{emoji:e.content.chatMessageType===r(b).EMOJI,template:e.content.chatMessageType===r(b).TEMPLATE,"template--3":Me(e.content),"audio-video":r(A)(e.content),file:e.content.chatMessageType===r(b).FILE}]),onContextmenu:y((t=>ye(t,e.id)),["prevent"])},[e.content.chatMessageType===r(b).TEXT?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",Z,[g("span",null,d(e.content.referenceContent.senderName)+":",1),g("pre",{innerHTML:r(z)(e.content.referenceContent.content)},null,8,ee)])):f("v-if",!0),g("pre",null,d(e.__content),1)],64)):f("v-if",!0),e.content.chatMessageType===r(b).BLEND?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,te)):f("v-if",!0),e.content.chatMessageType===r(b).EMOJI?(o(),i("img",{key:2,src:r(P).findEmoji(e.__content)},null,8,ne)):f("v-if",!0),Te(e,"template")?(o(),v(O,{key:3,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===r(b).IMAGE?(o(),v(r(_),{key:4,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),r(A)(e.content)?(o(),i(m,{key:5},[l(r(k),{class:a({"is-audio":e.content.chatMessageType===r(b).AUDIO}),component:e.content.chatMessageType===r(b).AUDIO?r(U):r(F)},null,8,["class","component"]),g("span",se,d(r(H)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===r(b).FILE?(o(),v(r(x),{key:6},{default:u((()=>[l(r(k),{class:"icon-file",size:"40",component:r(G)},null,8,["component"]),l(r(x),{vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[g("span",null,d(e.__content),1),g("span",oe,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(r(I),{class:"quick-menu"},{default:u((()=>[r(A)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <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> '),l(r(S),{quaternary:"",size:"tiny",onClick:()=>ke(e)},{icon:u((()=>[l(r(k),{size:"17",component:r(J)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(r(S),{quaternary:"",size:"tiny",onClick:t=>ye(t,e.id)},{icon:u((()=>[l(r(k),{size:"14",component:r(K)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,W)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(r(q),{ref_key:"contextmenuRef",ref:ue,show:me.value,"onUpdate:show":t[0]||(t[0]=e=>me.value=e),position:pe.value,"msg-id":de.value,onSelect:xe},null,8,["show","position","msg-id"])],6))}});export{ie as default};
|
@@ -60,6 +60,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
60
60
|
allowedInvalidValue: {
|
61
61
|
type: StringConstructor;
|
62
62
|
};
|
63
|
+
to: {
|
64
|
+
type: PropType<string | false | HTMLElement>;
|
65
|
+
default: string;
|
66
|
+
};
|
63
67
|
}, {
|
64
68
|
attrs: {
|
65
69
|
[x: string]: unknown;
|
@@ -80,6 +84,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
80
84
|
allowedInvalidValue: {
|
81
85
|
type: StringConstructor;
|
82
86
|
};
|
87
|
+
to: {
|
88
|
+
type: PropType<string | false | HTMLElement>;
|
89
|
+
default: string;
|
90
|
+
};
|
83
91
|
}>> & {
|
84
92
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
85
93
|
}>>;
|
@@ -116,10 +124,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
116
124
|
allowedInvalidValue: {
|
117
125
|
type: StringConstructor;
|
118
126
|
};
|
127
|
+
to: {
|
128
|
+
type: PropType<string | false | HTMLElement>;
|
129
|
+
default: string;
|
130
|
+
};
|
119
131
|
}>> & {
|
120
132
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
121
133
|
}, {
|
122
134
|
updateUnchangedValue: boolean;
|
135
|
+
to: string | false | HTMLElement;
|
123
136
|
}>>;
|
124
137
|
formatTime: typeof formatTime;
|
125
138
|
MESSAGE_TYPE: typeof MESSAGE_TYPE;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"no-data"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"no-data"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
|
1
|
+
import{defineComponent as e,ref as a,watch as l,openBlock as t,createBlock as s,unref as r,withCtx as o,createElementVNode as n,createVNode as i,toDisplayString as u,resolveDynamicComponent as c,createElementBlock as d,Fragment as v,renderList as m,withDirectives as p,createTextVNode as f,vShow as g}from"vue";import{NModal as h,NAvatar as y,NInputGroup as b,NInput as _,NSelect as T,NPopover as k,NTag as M,NIcon as x}from"naive-ui";import{SearchOutline as w}from"@vicons/ionicons5";import{useState as I}from"../hooks/useState.js";import{transformMessage as j,formatTime as S}from"../utils/index.js";import{last as A}from"lodash-es";import{MESSAGE_TYPE as L}from"../constants/index.js";import{searchChatRecordApi as C}from"../api/index.js";import"trtc-sdk-v5";import E from"../../../date-picker/index.js";import{useDebounceFn as H}from"@vueuse/core";import{format as U}from"date-fns";import{useScrollLoading as z}from"../hooks/useScrollLoading.js";import{emojis as D}from"../utils/emoji.js";const G={class:"iho-chat-dialog__header"},K=n("span",{class:"left"},"聊天记录",-1),O={class:"center"},R={class:"iho-chat-dialog__content iho-chat-record-wrapper"},B={class:"chat-record-box"},J={class:"msg-box"},N={class:"name-and-time"},P={class:"content"},X=["src"],$=["src"],q=["innerHTML"],F={key:1,class:"no-data"},Q={class:"chat-record-box__filter"},V=n("span",{class:"filter-title"},"添加筛选条件",-1),W={class:"filter-item"},Y=n("span",{class:"label"},"成员:",-1),Z={class:"filter-item"},ee=n("span",{class:"label"},"日期:",-1),ae={class:"time-target"},le={class:"time-target__item"},te=n("span",null,"开始:",-1),se={class:"no-data"},re={class:"time-target__item"},oe=n("span",null,"结束:",-1),ne={class:"no-data"};var ie=e({__name:"ChatRecord",props:{visible:{type:Boolean}},setup(e){const ie=e,ue={color:"#fff",textColor:"#666"},{state:ce}=I(),de=a(),ve=a([]),me=a(),pe=a([]),fe=a(),ge=a(),he=H(_e,500),ye={page:0,hasMore:!0,lastSendTime:U(new Date,"yyyy-MM-dd HH:mm:ss")};async function be(){var e;try{if(!ye.hasMore)return;ye.page++;const a=await C({orgId:ce.orgId,keyword:me.value,endTime:ge.value?ge.value+" 23:59:59":"",startTime:fe.value?fe.value+" 00:00:00":"",lastSendTime:ye.lastSendTime,memberIdSet:pe.value,page:ye.page,recordType:"ALL",sessionKey:ce.currentSessionItem.sessionKey,userId:ce.userInfo.id});Array.isArray(a)&&0!==a.length&&Array.isArray(a[0].recordList)||(ye.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let l=a||[];Array.isArray(a)&&a.length>0&&(l=a[0].recordList),ye.lastSendTime=null==(e=A(l))?void 0:e.sendTime,l.forEach((e=>{var a,l,t,s,r;let o="";switch(e.content.chatMessageType){case L.TEXT:o=j(null==(a=e.content)?void 0:a.msg);break;case L.TEMPLATE:o=null==(s=null==(t=null==(l=e.content)?void 0:l.messageTemplate)?void 0:t.setting)?void 0:s.title;break;default:o=null==(r=e.content)?void 0:r.msg}e.__content=o})),ve.value=ye.page>1?ve.value.concat(l):l}catch(e){console.log(e)}}function _e(){Object.assign(ye,{page:0,hasMore:!0,lastSendTime:ge.value||U(new Date,"yyyy-MM-dd HH:mm:ss")}),be()}function Te(e){return!!ge.value&&e>Date.parse(`${ge.value} 23:59:59`)}function ke(e){return!!fe.value&&e<Date.parse(fe.value)}function Me(e){switch(e){case"member":pe.value=[];break;case"start":fe.value=null;break;case"end":ge.value=null}}function xe(e){return i(v,null,[i("div",{style:"display: flex;align-items: center"},[i(y,{src:e.avatar,round:!0,size:"small"},null),i("span",{style:"margin-left: 10px"},[e.name])])])}return z(de,(()=>{be()})),l([()=>pe.value,()=>fe.value,()=>ge.value],(()=>{ie.visible&&_e()}),{deep:!0}),l((()=>ie.visible),(e=>{e?_e():(me.value="",ge.value=null,fe.value=null,pe.value=[],ve.value=[])})),(e,a)=>(t(),s(r(h),{preset:"dialog",title:"","show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{header:o((()=>[n("div",G,[K,n("div",O,[i(r(y),{round:"",size:30,src:r(ce).currentSessionItem.avatar},null,8,["src"]),n("span",null,u(r(ce).currentSessionItem.name),1)])])])),default:o((()=>[n("div",R,[i(r(b),null,{default:o((()=>[(t(),s(c((()=>[i(x,{component:w,size:18,color:"#6666"},null),pe.value.length>0?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("member")},{default:()=>{var e;return[f("成员:")," ",pe.value.length>1?pe.value.length+"人":null==(e=ce.currentGroupUser.find((e=>e.id===pe.value[0])))?void 0:e.name]}}):null,fe.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("start")},{default:()=>[f("起始时间: "),fe.value]}):null,ge.value?i(M,{closable:!0,bordered:!1,color:ue,onClose:()=>Me("end")},{default:()=>[f("结束时间: "),ge.value]}):null])))),i(r(_),{placeholder:"搜索",value:me.value,"onUpdate:value":a[0]||(a[0]=e=>me.value=e),valueModifiers:{trim:!0},onInput:r(he)},null,8,["value","onInput"])])),_:1}),n("div",B,[n("div",{class:"chat-record-box__content",ref_key:"recordRef",ref:de},[ve.value.length>0?(t(!0),d(v,{key:0},m(ve.value,(e=>(t(),d("div",{class:"content-item",key:e.id},[i(r(y),{round:"",size:38,src:e.senderAvatar},null,8,["src"]),n("div",J,[n("div",N,[n("span",null,u(e.senderName),1),n("span",null,u(r(S)(e.sendTime).recordTime),1)]),n("div",P,[e.content.chatMessageType===r(L).IMAGE?(t(),d("img",{key:0,class:"img",src:e.__content},null,8,X)):e.content.chatMessageType===r(L).EMOJI?(t(),d("img",{key:1,class:"emoji",src:r(D).findEmoji(e.__content)},null,8,$)):(t(),d("p",{key:2,innerHTML:e.__content},null,8,q))])])])))),128)):(t(),d("div",F,"没有找到相关记录"))],512),n("div",Q,[V,n("div",W,[Y,i(r(T),{value:pe.value,"onUpdate:value":a[1]||(a[1]=e=>pe.value=e),multiple:"","max-tag-count":1,"render-label":xe,options:r(ce).currentGroupUser,"value-field":"id"},null,8,["value","options"])]),n("div",Z,[ee,n("div",ae,[i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",le,[te,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[2]||(a[2]=()=>Me("start"))},{default:o((()=>[f(u(fe.value),1)])),_:1},512),[[g,fe.value]]),p(n("span",se,"点击选择",512),[[g,!fe.value]])])])),default:o((()=>[i(r(E),{"formatted-value":fe.value,"onUpdate:formatted-value":a[3]||(a[3]=e=>fe.value=e),type:"date",panel:"",clearable:"","is-date-disabled":Te},null,8,["formatted-value"])])),_:1}),i(r(k),{trigger:"click","show-arrow":!1},{trigger:o((()=>[n("div",re,[oe,p(i(r(M),{bordered:!1,color:ue,closable:"",onClose:a[4]||(a[4]=()=>Me("end"))},{default:o((()=>[f(u(ge.value),1)])),_:1},512),[[g,ge.value]]),p(n("span",ne,"点击选择",512),[[g,!ge.value]])])])),default:o((()=>[i(r(E),{"formatted-value":ge.value,"onUpdate:formatted-value":a[5]||(a[5]=e=>ge.value=e),type:"date",panel:"",clearable:"","is-date-disabled":ke},null,8,["formatted-value"])])),_:1})])])])])])])),_:1}))}});export{ie as default};
|
@@ -1,20 +1,13 @@
|
|
1
|
-
import { AnyObject } from '../../../../shared/types';
|
2
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
|
-
cssVars: import("vue").ComputedRef<AnyObject>;
|
2
|
+
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
4
3
|
listRef: import("vue").Ref<any>;
|
5
4
|
inputRef: import("vue").Ref<any>;
|
6
5
|
showSearch: import("vue").Ref<boolean>;
|
7
6
|
keyword: import("vue").Ref<any>;
|
8
|
-
userList: import("vue").Ref<any>;
|
9
7
|
state: import("../types").IState;
|
10
|
-
openSession: (item: AnyObject) => Promise<void>;
|
11
|
-
|
12
|
-
page: number;
|
13
|
-
hasMore: boolean;
|
14
|
-
};
|
8
|
+
openSession: (item: import("../../../../shared/types").AnyObject) => Promise<void>;
|
9
|
+
userList: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
|
15
10
|
handleInput: () => void;
|
16
|
-
handleSearch: () => Promise<void>;
|
17
|
-
resetAndSearch: () => void;
|
18
11
|
addSession: (userId: string) => Promise<void>;
|
19
12
|
NPopover: any;
|
20
13
|
NButton: any;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,watch as s,nextTick as r,openBlock as a,createBlock as t,unref as i,withCtx as
|
1
|
+
import{defineComponent as e,ref as o,watch as s,nextTick as r,openBlock as a,createBlock as t,unref as i,withCtx as l,createVNode as n,createTextVNode as u,createElementVNode as p,normalizeStyle as f,createElementBlock as c,Fragment as m,renderList as d,toDisplayString as v}from"vue";import{NPopover as h,NButton as k,NIcon as w,NInput as y,NAvatar as j}from"naive-ui";import{SearchOutline as S}from"@vicons/ionicons5";import{useState as _}from"../hooks/useState.js";import{useSession as g}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import{openSessionApi as x}from"../api/index.js";import{useTheme as C}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSearchUserList as R}from"../hooks/useSearchUserList.js";const U=["onClick"],I={class:"user-info"};var L=e({__name:"ChatSearch",setup(e){const L=C(),b=o(),z=o(),N=o(!1),T=o(),{state:D}=_(),{openSession:E}=g(D),{userList:G,handleInput:H}=R({wrapperRef:b,keywordRef:T});return s((()=>N.value),(async e=>{var o;e&&(await r(),null==(o=z.value)||o.focus())})),(e,o)=>(a(),t(i(h),{show:N.value,"onUpdate:show":o[1]||(o[1]=e=>N.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:l((()=>[n(i(k),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:l((()=>[n(i(w),{component:i(S),color:"#ffffff80"},null,8,["component"])])),default:l((()=>[u(" 搜索联系人 ")])),_:1})])),default:l((()=>[p("div",{class:"popover-search",style:f(i(L))},[n(i(y),{ref_key:"inputRef",ref:z,size:"small",clearable:"",autofocus:"",value:T.value,"onUpdate:value":[o[0]||(o[0]=e=>T.value=e),i(H)],valueModifiers:{trim:!0}},{prefix:l((()=>[n(i(w),{color:"#ffffff80",component:i(S)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),p("div",{class:"user-list-wrapper",ref_key:"listRef",ref:b},[(a(!0),c(m,null,d(i(G),(e=>(a(),c("div",{class:"user-item",key:e.id,onClick:()=>async function(e){N.value=!1;const o=await x({chatType:"SINGLE",receiver:e,sender:D.userInfo.id});E(o)}(e.id)},[n(i(j),{round:"",size:32,src:e.avatar},null,8,["src"]),p("div",I,[p("span",null,v(e.name),1),p("span",null,v(e.deptName),1),p("span",null,v(e.post),1)])],8,U)))),128))],512)],4)])),_:1},8,["show"]))}});export{L as default};
|
@@ -1,15 +1,28 @@
|
|
1
|
+
import { PropType, CSSProperties } from 'vue';
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
2
3
|
show: {
|
3
4
|
type: BooleanConstructor;
|
4
5
|
default: boolean;
|
5
6
|
};
|
6
|
-
|
7
|
+
position: {
|
8
|
+
type: PropType<CSSProperties>;
|
9
|
+
};
|
10
|
+
msgId: {
|
11
|
+
type: StringConstructor;
|
12
|
+
};
|
13
|
+
}, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
7
14
|
show: {
|
8
15
|
type: BooleanConstructor;
|
9
16
|
default: boolean;
|
10
17
|
};
|
18
|
+
position: {
|
19
|
+
type: PropType<CSSProperties>;
|
20
|
+
};
|
21
|
+
msgId: {
|
22
|
+
type: StringConstructor;
|
23
|
+
};
|
11
24
|
}>> & {
|
12
|
-
|
25
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
13
26
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
14
27
|
}, {
|
15
28
|
show: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,withDirectives as
|
1
|
+
import{defineComponent as e,ref as t,computed as o,withDirectives as s,createVNode as i,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as l,NIcon as p}from"naive-ui";import{CopyOutline as c,ChatbubbleEllipsesOutline as d,DownloadOutline as u}from"@vicons/ionicons5";import{onClickOutside as m}from"@vueuse/core";import{useState as f}from"../hooks/useState.js";import{isAudioOrVideoMessage as g,downloadFile as y}from"../utils/index.js";import"lodash-es";import{MESSAGE_TYPE as w}from"../constants/index.js";import"../api/index.js";import"trtc-sdk-v5";import{isSameMonth as h}from"date-fns";import{emojis as v}from"../utils/emoji.js";var E=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},position:{type:Object},msgId:{type:String}},emits:["update:show","select"],setup(e,{attrs:E,slots:b,emit:T}){const{state:I,setMsgList:j}=f(),M=[{icon:c,label:"复制",key:"copy"},{icon:d,label:"回复",key:"reply"},{icon:u,label:"下载",key:"download"}],x=t(null),k=o((()=>I.msgList.find((({id:t})=>t===e.msgId)))),O=o((()=>{if(!e.msgId)return[];if(!(null==k?void 0:k.value))return[];const{content:t={},sendTime:o,sender:s}=k.value,{chatMessageType:i}=t,n=[];return(s!==I.userInfo.id&&h(new Date(o),new Date)||i===w.TEMPLATE)&&n.push("withdraw"),[w.TEXT,w.EMOJI,w.BLEND].includes(i)?n.push("download"):g(t)?n.push("copy","relay","reply","download"):i===w.FILE?n.push("copy"):[w.FORWARD,w.TEMPLATE].includes(i)&&n.push("copy","download"),n.length?M.filter((e=>!n.includes(e.key))):M}));return m(x,(e=>{T("update:show",!1)})),()=>{let t;return e.msgId&&O.value?s(i("div",{class:"contextmenu-wrapper",ref:x,style:e.position},[i(a,{vertical:!0},(o=t=O.value.map((e=>i(l,{onClick:()=>async function(e){T("update:show",!1);const{content:t={},sendTime:o,sender:s}=k.value||{},{chatMessageType:i}=t;switch(e){case"copy":if(!t.msg)return console.log("复制内容为空!");if(!navigator||!("clipboard"in navigator))return console.log("当前浏览器版本不支持复制!");try{if(i===w.TEXT)await navigator.clipboard.writeText(t.msg);else{let e;if([w.EMOJI,w.IMAGE].includes(i)){const o=i===w.EMOJI?v.findEmoji(t.msg):t.msg;e=`<img data-msg=${t.msg} data-type=${i} ${i===w.EMOJI?'style="width: 24px;"':""} src=${o} />`}else e=t.msg;await navigator.clipboard.write([new window.ClipboardItem({"text/html":new Blob([e],{type:"text/html"})})])}}catch(e){console.log("复制失败!")}return;case"download":return void y(t.fileUrl,t.msg)}T("select",e,k.value)}(e.key),quaternary:!0},{default:()=>e.label,icon:()=>i(p,{component:e.icon},null)}))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!r(o)?t:{default:()=>[t]}))]),[[n,e.show]]):null;var o}}});export{E as default};
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import TRTC from 'trtc-sdk-v5';
|
2
|
+
import { AnyObject } from '../../../../shared/types';
|
2
3
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
4
|
selfVideoRef: import("vue").Ref<any>;
|
4
|
-
remoteUsers: import("vue").Ref<
|
5
|
+
remoteUsers: import("vue").Ref<{
|
6
|
+
id: string;
|
7
|
+
name: string;
|
8
|
+
}[]>;
|
5
9
|
state: import("../types").IState;
|
6
10
|
sendMessage: (message: {
|
7
11
|
chatType?: string | undefined;
|
8
|
-
content:
|
12
|
+
content: AnyObject;
|
9
13
|
receiver?: string | undefined;
|
10
14
|
}) => Promise<void>;
|
11
15
|
trtc: TRTC;
|
@@ -19,6 +23,20 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
19
23
|
timing: import("vue").Ref<string>;
|
20
24
|
toggleVideo: () => Promise<void>;
|
21
25
|
videocamOpen: import("vue").Ref<boolean>;
|
26
|
+
installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
|
27
|
+
handleError: import("../../../../shared/types").AnyFn;
|
28
|
+
handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
|
29
|
+
handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
|
30
|
+
handleRemoteUserExit: import("../../../../shared/types").AnyFn;
|
31
|
+
handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
|
32
|
+
}) => void;
|
33
|
+
uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
|
34
|
+
handleError: import("../../../../shared/types").AnyFn;
|
35
|
+
handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
|
36
|
+
handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
|
37
|
+
handleRemoteUserExit: import("../../../../shared/types").AnyFn;
|
38
|
+
handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
|
39
|
+
}) => void;
|
22
40
|
isConnect: import("vue").Ref<boolean>;
|
23
41
|
callUser: import("vue").ComputedRef<any>;
|
24
42
|
title: import("vue").ComputedRef<string>;
|
@@ -26,14 +44,12 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
26
44
|
handleCall: () => void;
|
27
45
|
handleEnter: () => Promise<void>;
|
28
46
|
handleExit: () => Promise<void>;
|
29
|
-
installEventHandlers: () => void;
|
30
|
-
uninstallEventHandlers: () => void;
|
31
47
|
handleRemoteVideoAvailable: (event: any) => Promise<void>;
|
32
|
-
handleRemoteAudioAvailable: (event: any) => void
|
33
|
-
handleRemoteUserEnter: (event: any) => void
|
48
|
+
handleRemoteAudioAvailable: (event: any) => Promise<void>;
|
49
|
+
handleRemoteUserEnter: (event: any) => Promise<void>;
|
50
|
+
getUserName: (userId: string) => Promise<any>;
|
34
51
|
handleRemoteUserExit: (event: any) => void;
|
35
52
|
handleError: (error: any) => void;
|
36
|
-
getName: (id: string) => any;
|
37
53
|
NButton: any;
|
38
54
|
NIcon: any;
|
39
55
|
ChatAdd: import("vue").DefineComponent<{
|
@@ -46,13 +62,14 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
46
62
|
default: string;
|
47
63
|
};
|
48
64
|
options: {
|
49
|
-
type: import("vue").PropType<
|
65
|
+
type: import("vue").PropType<AnyObject[]>;
|
50
66
|
};
|
51
67
|
disabledIds: {
|
52
68
|
type: import("vue").PropType<string[]>;
|
69
|
+
default: () => never[];
|
53
70
|
};
|
54
71
|
defaultValue: {
|
55
|
-
type: import("vue").PropType<
|
72
|
+
type: import("vue").PropType<AnyObject[]>;
|
56
73
|
};
|
57
74
|
}, {
|
58
75
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -65,38 +82,56 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
65
82
|
default: string;
|
66
83
|
};
|
67
84
|
options: {
|
68
|
-
type: import("vue").PropType<
|
85
|
+
type: import("vue").PropType<AnyObject[]>;
|
69
86
|
};
|
70
87
|
disabledIds: {
|
71
88
|
type: import("vue").PropType<string[]>;
|
89
|
+
default: () => never[];
|
72
90
|
};
|
73
91
|
defaultValue: {
|
74
|
-
type: import("vue").PropType<
|
92
|
+
type: import("vue").PropType<AnyObject[]>;
|
75
93
|
};
|
76
94
|
}>> & {
|
77
95
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
78
96
|
}>>;
|
79
97
|
emit: (event: "comfirm", ...args: any[]) => void;
|
80
98
|
state: import("../types").IState;
|
99
|
+
listRef: import("vue").Ref<any>;
|
100
|
+
keyword: import("vue").Ref<any>;
|
81
101
|
showModal: import("vue").Ref<boolean>;
|
82
|
-
|
83
|
-
options: import("vue").Ref<
|
102
|
+
checkedOptions: import("vue").Ref<AnyObject[]>;
|
103
|
+
options: import("vue").Ref<AnyObject[]>;
|
84
104
|
groupName: import("vue").Ref<string>;
|
105
|
+
checkedSourceIds: import("vue").Ref<(string | number)[]>;
|
106
|
+
userList: import("vue").Ref<AnyObject[]>;
|
107
|
+
handleInput: () => void;
|
108
|
+
_disabledIds: import("vue").ComputedRef<any[]>;
|
109
|
+
defaultOptions: import("vue").ComputedRef<{
|
110
|
+
id: any;
|
111
|
+
name: any;
|
112
|
+
avatar: any;
|
113
|
+
}[]>;
|
114
|
+
checkedIds: import("vue").ComputedRef<any[]>;
|
85
115
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
116
|
+
allChecked: import("vue").WritableComputedRef<boolean>;
|
86
117
|
handlePositiveClick: () => Promise<void>;
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}) => JSX.Element | null;
|
118
|
+
updateCheckedSourceIds: () => void;
|
119
|
+
handleSourceIdsUpdate: (value: (string | number)[], meta: {
|
120
|
+
actionType: "check" | "uncheck";
|
121
|
+
value: string | number;
|
122
|
+
}) => void;
|
123
|
+
closeTag: (id: string) => void;
|
124
|
+
renderTargetList: () => JSX.Element[] | null;
|
95
125
|
NModal: any;
|
96
126
|
NButton: any;
|
97
|
-
|
127
|
+
NSpace: any;
|
128
|
+
NAvatar: any;
|
98
129
|
NIcon: any;
|
130
|
+
NTag: any;
|
99
131
|
NInput: any;
|
132
|
+
NCheckbox: any;
|
133
|
+
NCheckboxGroup: any;
|
134
|
+
SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
100
135
|
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
101
136
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
102
137
|
title: {
|
@@ -108,19 +143,21 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
108
143
|
default: string;
|
109
144
|
};
|
110
145
|
options: {
|
111
|
-
type: import("vue").PropType<
|
146
|
+
type: import("vue").PropType<AnyObject[]>;
|
112
147
|
};
|
113
148
|
disabledIds: {
|
114
149
|
type: import("vue").PropType<string[]>;
|
150
|
+
default: () => never[];
|
115
151
|
};
|
116
152
|
defaultValue: {
|
117
|
-
type: import("vue").PropType<
|
153
|
+
type: import("vue").PropType<AnyObject[]>;
|
118
154
|
};
|
119
155
|
}>> & {
|
120
156
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
121
157
|
}, {
|
122
158
|
mode: string;
|
123
159
|
title: string;
|
160
|
+
disabledIds: string[];
|
124
161
|
}>;
|
125
162
|
Call: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
126
163
|
Videocam: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,computed as n,
|
1
|
+
import{defineComponent as e,ref as o,computed as n,onBeforeUnmount as t,openBlock as s,createElementBlock as l,createElementVNode as i,withDirectives as a,toDisplayString as c,unref as r,vShow as d,createVNode as u,withCtx as m,Fragment as p,renderList as v,createCommentVNode as f,createTextVNode as g,nextTick as h}from"vue";import{NButton as k,NIcon as A}from"naive-ui";import I from"./ChatAdd.vue.js";import{Close as y,Mic as V,MicOff as w,Videocam as _,VideocamOff as b,Call as M,PersonAdd as R}from"@vicons/ionicons5";import{xorBy as x}from"lodash-es";import"date-fns";import{CHAT_TYPE as E,SUBSCRIBE_MESSAGE_TYPE as T}from"../constants/index.js";import"../utils/emoji.js";import"@vueuse/core";import{getUserDetailApi as C}from"../api/index.js";import{useVideo as S}from"../hooks/useVideo.js";import j from"trtc-sdk-v5";const $={class:"video-wrapper video-wrapper--multiple"},L={class:"video-header"},U={key:0,class:"video-main"},z={class:"video-main__left"},H=["data-name"],N={class:"video-bottom"},D={class:"btn-group"},O={class:"btn"},P=i("span",{class:"text"},"静音",-1),Y={class:"btn"},q=i("span",{class:"text"},"摄像头",-1),G=i("span",{class:"text"},"结束会诊",-1),B={class:"btn"},F=i("span",{class:"text"},"添加参会人",-1),J={class:"video-main__right"},K=["id","data-name"],Q={class:"user"},W={class:"name"},X={key:0,class:"tip"},Z={key:0,class:"calling-box"},ee={class:"btn-box"},oe={key:1,class:"opt-btn"},ne={class:"btn"},te=i("span",null,"拒接",-1),se={class:"btn"},le=i("span",null,"接听",-1);var ie=e({__name:"MultipleVideo",setup(e){const ie=o(),ae=o([]),{state:ce,sendMessage:re,trtc:de,voiceOpen:ue,isAudio:me,isCall:pe,startTimer:ve,resetTimer:fe,toggleAudio:ge,messageTypeText:he,timing:ke,toggleVideo:Ae,videocamOpen:Ie,installEventHandlers:ye,uninstallEventHandlers:Ve}=S(),we=o(!1),_e=n((()=>pe.value?ce.userInfo.name:ce.currentAVMsg.sendName)),be=n((()=>{if(!we.value)return"";const e=pe.value?`(${ae.value.length+1}/${ce.currentAVMsg.checkedIds.length+1})`:"";return`${_e.value}发起的${he.value}会诊${e} ${ke.value}`}));function Me(e){console.log("checkedIds :>> ",e),ce.currentAVMsg.checkedIds.push(...e),Re()}function Re(){var e;(null==(e=ce.currentAVMsg.checkedIds)?void 0:e.length)&&ce.currentAVMsg.checkedIds.forEach((e=>{re({chatType:E.SINGLE,content:{msg:ce.currentAVMsg.chatMessageType+","+ce.currentAVMsg.strRoomId,chatMessageType:T.AV_STATUS},receiver:e})})),we.value||xe()}async function xe(){const e=await j.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(ce.showMultipleVideo=!1);try{if(await de.enterRoom({strRoomId:ce.currentAVMsg.strRoomId,sdkAppId:parseInt(ce.userInfo.sdkAppID),userId:ce.userInfo.id,userSig:ce.userInfo.userSig}),we.value=!0,ve(),ye({handleError:Le,handleRemoteUserEnter:Se,handleRemoteAudioAvailable:Ce,handleRemoteUserExit:$e,handleRemoteVideoAvailable:Te}),await de.startLocalAudio(),me.value)return;await de.startLocalVideo({view:ie.value})}catch(e){console.log("error :>> ",e),ce.showMultipleVideo=!1}}async function Ee(){try{if(ce.showMultipleVideo=!1,Ve({handleError:Le,handleRemoteUserEnter:Se,handleRemoteAudioAvailable:Ce,handleRemoteUserExit:$e,handleRemoteVideoAvailable:Te}),await de.exitRoom(),await de.stopLocalAudio(),me.value)return;await de.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function Te(e){const{userId:o,streamType:n}=e;try{n===j.TYPE.STREAM_TYPE_MAIN&&(await h(),await de.startRemoteVideo({userId:o,streamType:n,view:o}))}catch(e){console.log("error :>> ",e)}}async function Ce(e){var o;const{userId:n}=e;if(n&&!(null==(o=ae.value.map((e=>e.id)))?void 0:o.includes(n))){const e=await je(n);ae.value.push({id:n,name:e})}}async function Se(e){const{userId:o}=e,n=await je(o);ae.value.push({id:o,name:n}),ve()}async function je(e){const o=await C({userId:e});return(null==o?void 0:o.name)||""}function $e(e){console.log("event :>> 退房",e);const{userId:o}=e;ae.value=x(ae.value,[{id:o,name:""}],"id")}function Le(e){console.log("error :>> ",e),ce.showMultipleVideo=!1}return t((()=>{Ee()})),(e,o)=>(s(),l("div",$,[i("div",L,[a(i("span",{class:"title"},c(r(be)),513),[[d,we.value]]),u(r(k),{quaternary:"",circle:"",color:"#ffffffcc",onClick:Ee},{icon:m((()=>[u(r(A),{component:r(y)},null,8,["component"])])),_:1})]),we.value?(s(),l("div",U,[i("div",z,[i("div",{ref_key:"selfVideoRef",ref:ie,class:"video-view","data-name":r(ce).userInfo.name},null,8,H),i("div",N,[i("div",D,[i("div",O,[u(r(k),{text:"",color:r(ue)?"#fff":"#000",onClick:r(ge)},{icon:m((()=>[u(r(A),{component:r(ue)?r(V):r(w)},null,8,["component"])])),_:1},8,["color","onClick"]),P]),i("div",Y,[u(r(k),{text:"",color:r(Ie)?"#fff":"#000",disabled:r(me),onClick:r(Ae)},{icon:m((()=>[u(r(A),{component:r(Ie)?r(_):r(b)},null,8,["component"])])),_:1},8,["color","disabled","onClick"]),q]),i("div",{class:"btn",onClick:Ee},[u(r(k),{circle:"",color:"#f17568",class:"btn--rotate"},{icon:m((()=>[u(r(A),{component:r(M)},null,8,["component"])])),_:1}),G]),u(I,{onComfirm:Me},{trigger:m((()=>[i("div",B,[u(r(k),{text:"",color:"#fff"},{icon:m((()=>[u(r(A),{component:r(R)},null,8,["component"])])),_:1}),F])])),_:1})])])]),i("div",J,[(s(!0),l(p,null,v(ae.value,(e=>(s(),l("div",{key:e.id,id:e.id,class:"video-view","data-name":e.name},null,8,K)))),128))])])):(s(),l(p,{key:1},[i("div",Q,[i("span",W,c(r(_e))+"发起的"+c(r(he))+"会议",1),r(pe)?f("v-if",!0):(s(),l("span",X,"邀请你加入"+c(r(he))+"会议",1))]),r(pe)?(s(),l("div",Z,[u(I,{onComfirm:Me},{trigger:m((()=>[u(r(k),{size:"large",circle:"",color:"#000"},{icon:m((()=>[u(r(A),{component:r(R)},null,8,["component"])])),_:1})])),_:1}),i("p",null,"已邀请共"+c(r(ce).currentAVMsg.checkedIds.length)+"人",1),u(r(k),{size:"large",strong:"",round:"",type:"primary",onClick:Re},{default:m((()=>[g("开始会诊")])),_:1}),i("div",ee,[u(r(k),{color:"#000",round:""},{icon:m((()=>[u(r(A),{component:r(V)},null,8,["component"])])),_:1}),u(r(k),{color:"#000",round:""},{icon:m((()=>[u(r(A),{component:r(_)},null,8,["component"])])),_:1})])])):(s(),l("div",oe,[i("div",ne,[u(r(k),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>r(ce).showMultipleVideo=!1)},{icon:m((()=>[u(r(A),{size:"30",component:r(M)},null,8,["component"])])),_:1}),te]),i("div",se,[u(r(k),{circle:"",color:"#2ac98b",onClick:xe},{icon:m((()=>[u(r(A),{size:"30",component:r(M)},null,8,["component"])])),_:1}),le])]))],64))]))}});export{ie as default};
|
@@ -20,6 +20,20 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
20
20
|
timer: any;
|
21
21
|
seconds: number;
|
22
22
|
};
|
23
|
+
installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
|
24
|
+
handleError: import("../../../../shared/types").AnyFn;
|
25
|
+
handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
|
26
|
+
handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
|
27
|
+
handleRemoteUserExit: import("../../../../shared/types").AnyFn;
|
28
|
+
handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
|
29
|
+
}) => void;
|
30
|
+
uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
|
31
|
+
handleError: import("../../../../shared/types").AnyFn;
|
32
|
+
handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
|
33
|
+
handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
|
34
|
+
handleRemoteUserExit: import("../../../../shared/types").AnyFn;
|
35
|
+
handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
|
36
|
+
}) => void;
|
23
37
|
videoRef: import("vue").Ref<any>;
|
24
38
|
selfVideoRef: import("vue").Ref<any>;
|
25
39
|
isConnect: import("vue").Ref<boolean>;
|
@@ -36,8 +50,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
36
50
|
handleEnter: () => Promise<void>;
|
37
51
|
handleFinish: () => void;
|
38
52
|
handleExit: () => Promise<void>;
|
39
|
-
installEventHandlers: () => void;
|
40
|
-
uninstallEventHandlers: () => void;
|
41
53
|
handleRemoteVideoAvailable: (event: any) => Promise<void>;
|
42
54
|
handleRemoteAudioAvailable: (event: any) => void;
|
43
55
|
handleRemoteUserEnter: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,computed as n,watch as s,openBlock as
|
1
|
+
import{defineComponent as e,ref as o,computed as n,watch as t,onBeforeUnmount as s,openBlock as r,createElementBlock as a,withDirectives as l,createElementVNode as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as f}from"vue";import{NAvatar as g,NButton as I,NIcon as h}from"naive-ui";import{Mic as A,MicOffCircle as y,Call as E}from"@vicons/ionicons5";import"lodash-es";import"date-fns";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../utils/emoji.js";import"@vueuse/core";import{avFinishApi as w}from"../api/index.js";import{useVideo as k}from"../hooks/useVideo.js";import S from"trtc-sdk-v5";const M={class:"video-wrapper"},b={class:"user"},T={class:"name"},C={class:"tip"},_={class:"opt-btn"},x={class:"btn"},N=i("span",null,"静音",-1),L=i("span",null,"拒接",-1),D={class:"btn"},H=i("span",null,"挂断",-1),j=i("span",null,"接听",-1);var z=e({__name:"Video",setup(e){const{sendMessage:z,state:U,trtc:F,timing:O,voiceOpen:G,isAudio:J,isCall:P,startTimer:$,resetTimer:q,toggleAudio:B,messageTypeText:K,time:Q,installEventHandlers:W,uninstallEventHandlers:X}=k(),Y=o(),Z=o(),ee=o(!1);let oe=null;const ne=n((()=>{var e,o,n;return P.value?{avatar:U.currentSessionItem.avatar,name:U.currentSessionItem.name,userId:U.currentSessionItem.receiver}:{avatar:null==(e=U.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=U.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=U.currentAVMsg.currentMsg)?void 0:n.sender}})),te=n((()=>ee.value?J.value?O.value:"":P.value?"正在呼叫...":`邀请你${K.value}问诊...`)),se=n((()=>{var e,o;return null==(o=null==(e=U.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function re(e=V.FINISHED){z({chatType:R.SINGLE,content:{msg:e===V.FINISHED?""+Q.seconds:"s",chatMessageType:U.currentAVMsg.chatMessageType,avStatus:e},receiver:ne.value.userId}),await w({recordId:U.currentAVMsg.currentMsg.id,status:e,duration:e===V.FINISHED?Q.seconds:0})}async function ae(){const e=await S.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(U.showVideo=!1);try{if(await F.enterRoom({strRoomId:U.currentAVMsg.strRoomId,sdkAppId:parseInt(U.userInfo.sdkAppID),userId:U.userInfo.id,userSig:U.userInfo.userSig}),P.value||(ee.value=!0,$()),W({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await F.startLocalAudio(),J.value)return;await F.startLocalVideo({view:Z.value})}catch(e){console.log("error :>> ",e),U.showVideo=!1}}function le(){P.value&&!ee.value?re(V.CANCELED):re()}async function ie(){try{if(U.showVideo=!1,X({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await F.exitRoom(),await F.stopLocalAudio(),J.value)return;await F.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ce(e){const{userId:o,streamType:n}=e;try{await F.startRemoteVideo({userId:o,streamType:n,view:Y.value})}catch(e){console.log("error :>> ",e)}}function ue(e){}function de(){ee.value=!0,$()}function ve(e){console.log("event :>> 对方已挂断",e),ie()}function me(e){console.log("error :>> ",e),U.showVideo=!1}return t((()=>se.value),(e=>{U.showVideo&&(e===V.IN_CALL?async function(){P.value?ae():(oe&&clearTimeout(oe),oe=setTimeout((async()=>{ee.value||re(V.NO_RESPONSE)}),6e4))}():ie())}),{immediate:!0}),s((()=>{ie()})),(e,o)=>(r(),a("div",M,[l(i("div",{class:"video-box",ref_key:"videoRef",ref:Y},null,512),[[c,ee.value]]),l(i("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:Z},null,512),[[c,ee.value]]),l(i("div",b,[u(d(g),{size:58,round:"",src:d(ne).avatar},null,8,["src"]),i("span",T,v(d(ne).name),1),i("span",C,v(d(te)),1)],512),[[c,d(J)||!ee.value]]),i("div",_,[i("div",x,[d(P)&&!ee.value||ee.value?(r(),a(m,{key:0},[u(d(I),{circle:"",onClick:d(B),class:p({bordered:d(G)})},{icon:f((()=>[u(d(h),{size:"30",color:d(G)?"#fff":"#626262",component:d(G)?d(A):d(y)},null,8,["color","component"])])),_:1},8,["onClick","class"]),N],64)):(r(),a(m,{key:1},[u(d(I),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>re(d(V).REJECTED))},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),L],64))]),i("div",D,[d(P)&&!ee.value||ee.value?(r(),a(m,{key:0},[u(d(I),{circle:"",color:"#f17568",class:"btn--rotate",onClick:le},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),H],64)):(r(),a(m,{key:1},[u(d(I),{circle:"",color:"#2ac98b",onClick:ae},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),j],64))])])]))}});export{z as default};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Ref } from 'vue';
|
2
|
-
export declare function useScrollLoading(wrapperEl: Ref<HTMLElement | undefined | null>, callback: () => void, direction?: 'top' | 'bottom' | undefined): void;
|
2
|
+
export declare function useScrollLoading(wrapperEl: Ref<HTMLElement | undefined | null>, callback: () => void, direction?: 'top' | 'bottom' | undefined, afterScroll?: () => void): void;
|
@@ -1 +1 @@
|
|
1
|
-
import{useThrottleFn as o,useEventListener as t}from"@vueuse/core";const e=o((({target:o},t,e)=>{const{clientHeight:r,scrollTop:c,scrollHeight:
|
1
|
+
import{useThrottleFn as o,useEventListener as t}from"@vueuse/core";const e=o((({target:o},t,e,l)=>{null==l||l();const{clientHeight:r,scrollTop:c,scrollHeight:i}=o;if("top"===e){if(0===c)return;r-c>=i-5&&t()}else r+c>=i-10&&t()}),500);function l(o,l,r="bottom",c){t(o,"scroll",(o=>e(o,l,r,c)),!0)}export{l as useScrollLoading};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { AnyFn, AnyObject } from '../../../../shared/types';
|
3
|
+
export declare function useSearchUserList({ wrapperRef, keywordRef, before, after }: {
|
4
|
+
wrapperRef: Ref<HTMLElement>;
|
5
|
+
keywordRef: Ref<string>;
|
6
|
+
before?: AnyFn;
|
7
|
+
after?: AnyFn;
|
8
|
+
}): {
|
9
|
+
userList: Ref<AnyObject[]>;
|
10
|
+
handleInput: () => void;
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import{useScrollLoading as a}from"./useScrollLoading.js";import{useState as s}from"./useState.js";import"date-fns";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:u,after:p}){const l={page:0,hasMore:!0},{state:c}=s(),f=e([]),m=t((function(){Object.assign(l,{page:0,hasMore:!0}),g()}),300);async function g(){if(!n.value)return void(u?u():f.value=[]);if(!l.hasMore)return;l.page++,1==l.page&&(f.value=[]);const e=await r({orgId:c.orgId,keyword:n.value,page:l.page,pageSize:10});o(e.records)&&f.value.length<=+e.total&&(f.value=l.page>1?f.value.concat(e.records):e.records,null==p||p(),f.value.length>=+e.total&&(l.hasMore=!1,console.log("没有更多消息了")))}return a(i,(()=>{g()})),{userList:f,handleInput:m}}export{i as useSearchUserList};
|
@@ -1 +1 @@
|
|
1
|
-
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n}from"../utils/index.js";import{InjectionIChatState as
|
1
|
+
import{inject as e}from"vue";import{cloneDeep as t}from"lodash-es";import{formatTime as s,transformMessage as n,getFileSize as i}from"../utils/index.js";import{InjectionIChatState as m,InjectionIChatStompClient as o,InjectionIChatEmits as r}from"../types/index.js";import{MESSAGE_TYPE as c}from"../constants/index.js";import{useIntervalFn as a}from"@vueuse/core";function T(){const T=e(m),d=e(o),g=e(r),{pause:u,resume:p,isActive:l}=a((()=>{const e=t(T.msgList);e.some((e=>{const{sendTime:t}=e;return!(Date.now()-new Date(t).getTime()>=36e5)&&(e.__sendTime=s(t).recordTime,!0)})),T.msgList=e,f()||u()}),6e4,{immediate:!1});function f(){return!!T.msgList.length&&T.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}return{state:T,setMsgList:function(e=[]){u(),T.msgList=t(e).sort(((e,t)=>new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime())),T.msgList.forEach((e=>{var t,m,o;Object.assign(e,{__time:s(e.sendTime).msgTime,__content:(o=e.content.chatMessageType,[c.TEXT,c.TEXT].includes(o)?n(null==(t=e.content)?void 0:t.msg):null==(m=e.content)?void 0:m.msg),__sendTime:s(e.sendTime).recordTime}),e.content.chatMessageType!==c.FILE||e.__size||i(e.content.fileUrl).then((t=>{e.__size=t}))})),f()&&p()},stompClient:d,emit:g,sendMessage:async function(e){try{d.value.send("/app/chat/send",{},JSON.stringify({chatType:T.currentSessionItem.chatType,receiver:T.currentSessionItem.receiver,...e}))}catch(e){console.log("error :>> ",e)}}}}export{T as useState};
|
@@ -1,4 +1,12 @@
|
|
1
1
|
import TRTC from 'trtc-sdk-v5';
|
2
|
+
import { AnyFn } from '../../../../shared/types';
|
3
|
+
type EventHandlers = {
|
4
|
+
handleError: AnyFn;
|
5
|
+
handleRemoteUserEnter: AnyFn;
|
6
|
+
handleRemoteAudioAvailable: AnyFn;
|
7
|
+
handleRemoteUserExit: AnyFn;
|
8
|
+
handleRemoteVideoAvailable: AnyFn;
|
9
|
+
};
|
2
10
|
export declare function useVideo(): {
|
3
11
|
state: import("../types").IState;
|
4
12
|
sendMessage: (message: {
|
@@ -21,4 +29,7 @@ export declare function useVideo(): {
|
|
21
29
|
timer: any;
|
22
30
|
seconds: number;
|
23
31
|
};
|
32
|
+
installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: EventHandlers) => void;
|
33
|
+
uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: EventHandlers) => void;
|
24
34
|
};
|
35
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,computed as t,onBeforeUnmount as
|
1
|
+
import{ref as e,computed as t,onBeforeUnmount as E}from"vue";import{useState as a}from"./useState.js";import{MESSAGE_TYPE as n}from"../constants/index.js";import o from"trtc-sdk-v5";import{formatSeconds as l}from"../utils/index.js";function i(){const i={timer:null,seconds:0},{state:r,sendMessage:s}=a(),u=e(""),d=e(!0),m=e(!0),c=t((()=>r.currentAVMsg.chatMessageType===n.AUDIO)),R=t((()=>"call"===r.currentAVMsg.callMode)),T=t((()=>c.value?"语音":"视频")),A=o.create();function v(){u.value="00:00:00",i.timer&&clearInterval(i.timer),i.timer=null,i.seconds=0}return E((()=>{v()})),{state:r,sendMessage:s,trtc:A,timing:u,voiceOpen:d,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){v(),i.timer=setInterval((()=>{i.seconds++,u.value=l(i.seconds)}),1e3)},resetTimer:v,toggleAudio:async function(){await A.updateLocalAudio({mute:!d.value}),d.value=!d.value},toggleVideo:async function(){await A.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:i,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:E,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.on(o.EVENT.ERROR,e),A.on(o.EVENT.REMOTE_USER_ENTER,t),A.on(o.EVENT.REMOTE_AUDIO_AVAILABLE,E),A.on(o.EVENT.REMOTE_USER_EXIT,a),c.value||A.on(o.EVENT.REMOTE_VIDEO_AVAILABLE,n)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:E,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.off(o.EVENT.ERROR,e),A.off(o.EVENT.REMOTE_USER_ENTER,t),A.off(o.EVENT.REMOTE_AUDIO_AVAILABLE,E),A.off(o.EVENT.REMOTE_USER_EXIT,a),c.value||A.off(o.EVENT.REMOTE_VIDEO_AVAILABLE,n)}}}export{i as useVideo};
|