cnhis-design-vue 3.2.14-beta.14 → 3.2.14-beta.19
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/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/constants/filter.d.ts +21 -12
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/iho-chat/index.d.ts +437 -49
- package/es/components/iho-chat/src/Index.vue.d.ts +440 -56
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +39 -3
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +38 -2
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +172 -10
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +58 -4
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +20 -2
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +57 -3
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +38 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
- package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +0 -6
- package/es/components/iho-chat/src/types/index.js +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -14
- package/es/components/iho-chat/src/hooks/useSession.js +0 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
- package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as n,unref as a,createVNode as i,withCtx as u,createBlock as l,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import k from"./components/ChatHeader.vue.js";import _ from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import g from"./components/ChatSearch.vue.js";import b from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import C from"./components/MultipleVideo.vue.js";import{instanceAxios as x}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as H}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const U={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},defaultSessionKey:{type:String},show:{type:Boolean,default:!0}},emits:["template-click","unread-message-update","session-change"],setup(e,{expose:q,emit:M}){const N=e;x.defaults.baseURL=N.baseURL,x.defaults.headers.Authorization="bearer "+N.token;const R=t(!1),A=L(N,M);o(V,A),H(N,A);const{cssVars:B,state:D,openSession:F,closeSession:z,getCurrentSession:E,isEnded:K}=A;return q({getUnreadData:function(){return D.sessionList.filter((e=>I(e.unreadNum)&&e.unreadNum>0))},openSession:F,closeSession:z,getCurrentSession:E}),(t,o)=>e.show?(s(),r("div",{key:0,class:"iho-chat",style:n(a(B))},[i(a(f),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[R.value?(s(),l(a(h),{key:0,stroke:"#5585f5"})):(s(),r(d,{key:1},[e.showHeader?(s(),r("div",U,[i(g),i(b,{title:"发起群聊",mode:"create","default-value":[a(D).userInfo]},null,8,["default-value"]),m("div",$,[p(t.$slots,"toolbar")])])):c("v-if",!0),i(a(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[i(S),i(a(y),{class:"chat-content",style:n({"--c-pointer-events":a(K)?"none":"unset","--c-cursor":a(K)?"not-allowed":"unset"})},{default:u((()=>[i(k,null,{header:u((()=>[p(t.$slots,"chatHeader",{session:a(D).currentSessionItem})])),_:3}),i(_),i(j,null,{footer:u((()=>[p(t.$slots,"chatFooter",{session:a(D).currentSessionItem})])),_:3})])),_:3},8,["style"]),p(t.$slots,"external")])),_:3}),a(D).showVideo?(s(),l(w,{key:1})):c("v-if",!0),a(D).showMultipleVideo?(s(),l(C,{key:2})):c("v-if",!0)],64))])),_:3})],4)):c("v-if",!0)}});export{q as default};
|
@@ -53,7 +53,25 @@ declare const _default: import("vue").DefineComponent<{
|
|
53
53
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
54
54
|
}>>;
|
55
55
|
emit: (event: "comfirm", ...args: any[]) => void;
|
56
|
-
state:
|
56
|
+
state: {
|
57
|
+
orgId: string | number;
|
58
|
+
currentSessionItem: AnyObject;
|
59
|
+
id: string;
|
60
|
+
userInfo: AnyObject;
|
61
|
+
msgList: AnyObject[];
|
62
|
+
currentMsg: AnyObject;
|
63
|
+
isAppendMsg: boolean;
|
64
|
+
sessionList: AnyObject[];
|
65
|
+
isChangeSession: boolean;
|
66
|
+
updateSessionItem: AnyObject;
|
67
|
+
isUpdateSession: boolean;
|
68
|
+
currentReferenceMsg: AnyObject | null;
|
69
|
+
currentReEditMsg: AnyObject | null;
|
70
|
+
showVideo: boolean;
|
71
|
+
currentAVMsg: AnyObject;
|
72
|
+
currentGroupUser: AnyObject[];
|
73
|
+
showMultipleVideo: boolean;
|
74
|
+
};
|
57
75
|
setCurrentSessionItem: (item: AnyObject) => void;
|
58
76
|
listRef: import("vue").Ref<any>;
|
59
77
|
keyword: import("vue").Ref<string>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as r,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,normalizeClass as b,renderSlot as g}from"vue";import{NModal as y,NInput as
|
1
|
+
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as r,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,normalizeClass as b,renderSlot as g}from"vue";import{NModal as y,NInput as k,NIcon as I,NCheckbox as w,NCheckboxGroup as _,NSpace as x,NAvatar as S,NTag as j,NTooltip as U,NButton as C}from"naive-ui";import{SearchOutline as R,AddOutline as L}from"@vicons/ionicons5";import{useData as V}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as A}from"../constants/index.js";import{groupLeaveApi as E,groupJoinApi as G,groupCreateApi as N}from"../api/index.js";import{listSort as $}from"../utils/index.js";import"trtc-sdk-v5";import{cloneDeep as z,union as D,intersection as M,unionBy as T,remove as B,isArray as P,uniqBy as q,trim as F}from"lodash-es";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";const J={class:"iho-chat-dialog__content iho-chat-add-wrapper"},K={key:0,class:"input-box"},O=d("span",null,"群名称:",-1),Q={class:"transfer-box"},W={class:"transfer-box__left"},X={class:"user-list-box"},Y={key:1,class:"no-data"},Z={class:"transfer-box__right"},ee={class:"checked-tag-box"},ae={key:0,class:"input-wrapper"};var le=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(e,{emit:le}){const te=e,{state:ie,setCurrentSessionItem:ue}=V(),oe=a(),re=a(""),se=a(!1),ne=a([]),de=a([]),ve=a(""),ce=a([]),pe=a(""),{userList:me,handleInput:fe}=H({wrapperRef:oe,keywordRef:re,before:()=>{me.value=z(de.value),we()},after:()=>{he.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=he.value)?void 0:a.includes(e.id)})),we()}}),he=l((()=>"relay"===te.mode?[]:D(te.disabledIds,[ie.userInfo.id]))),be=l((()=>{var e,a;if(!(null==(e=ie.sessionList)?void 0:e.length))return[];const l=$(ie.sessionList);return null==(a="relay"===te.mode?l:l.filter((e=>e.chatType===A.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),ge=l((()=>ne.value.length?ne.value.map((e=>e.id)):[])),ye=l((()=>"create"===te.mode?ge.value.length<3:ge.value.length<1)),ke=l({get:()=>ce.value.filter((e=>!he.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=te.defaultValue.map((e=>e.id)),l=M(a,he.value,me.value.map((e=>e.id))),t=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?t.map((e=>e.id)):[]),e?ne.value=T(ne.value,t,"id"):B(ne.value,(e=>t.map((e=>e.id)).includes(e.id)))}});async function Ie(){switch(te.mode){case"create":await N({creator:ie.userInfo.id,memberIdSet:ge.value,name:F(ve.value),orgId:ie.orgId});break;case"join":if(await G({groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(",");ue({name:`${ie.currentSessionItem.name},${e}`})}ie.currentGroupUser.push(...me.value.filter((e=>ge.value.includes(e.id))));break;case"remove":if(await E({dissolution:!1,groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ue({name:ie.currentSessionItem.name.replace(a,"")})}B(ie.currentGroupUser,(e=>ge.value.includes(e.id)));break;default:le("comfirm",ge.value,pe.value)}se.value=!1}function we(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>ge.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function _e(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));ne.value.push(e)}else B(ne.value,(e=>e.id===a.value))}return t((()=>se.value),(e=>{if(!e)return;re.value="",ve.value="";const a=P(te.options)&&te.options.length?te.options:be.value;de.value=q(a,"id").map((e=>{var a;return{...e,disabled:null==(a=he.value)?void 0:a.includes(e.id)}})),me.value=z(de.value),P(te.defaultValue)&&te.defaultValue.length?(ne.value=z(te.defaultValue),we()):(ne.value=[],ce.value=[])})),(a,l)=>(i(),u(o,null,[r(s(y),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:se.value,"onUpdate:show":l[5]||(l[5]=e=>se.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:s(ye)},onPositiveClick:Ie},{default:n((()=>[d("div",J,["create"===e.mode?(i(),u("div",K,[O,r(s(k),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ve.value,"onUpdate:value":l[0]||(l[0]=e=>ve.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",Q,[d("div",W,[r(s(k),{placeholder:"搜索",clearable:"",value:re.value,"onUpdate:value":[l[1]||(l[1]=e=>re.value=e),s(fe)],valueModifiers:{trim:!0}},{prefix:n((()=>[r(s(I),{component:s(R)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",X,[s(me).length>0?(i(),u(o,{key:0},[r(s(w),{label:"全选",checked:s(ke),"onUpdate:checked":l[2]||(l[2]=e=>c(ke)?ke.value=e:null)},null,8,["checked"]),r(s(_),{ref_key:"listRef",ref:oe,value:ce.value,"onUpdate:value":[l[3]||(l[3]=e=>ce.value=e),_e]},{default:n((()=>[(i(!0),u(o,null,p(s(me),(e=>(i(),m(s(w),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[r(s(x),{align:"center","wrap-item":!1},{default:n((()=>[r(s(S),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),u("div",Y,"找不到相关结果"))])]),d("div",Z,[d("span",null,"已选择 "+f(s(ge).length)+" 人",1),d("div",ee,[(i(!0),u(o,null,p(ne.value,(a=>(i(),m(s(j),{key:a.id,bordered:!1,closable:"relay"===e.mode||a.id!==s(ie).userInfo.id,disabled:s(he).includes(a.id),onClose:()=>{return e=a.id,B(ne.value,(a=>a.id===e)),void B(ce.value,(a=>a===e));var e}},{avatar:n((()=>[r(s(S),{round:"",src:a.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(a.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===e.mode?(i(),u("div",ae,[r(s(k),{clearable:"",value:pe.value,"onUpdate:value":l[4]||(l[4]=e=>pe.value=e),type:"textarea",placeholder:"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):v("v-if",!0)])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:b(["btn-wrapper",{disabled:e.disabled}]),onClick:l[6]||(l[6]=e=>se.value=!0)},[g(a.$slots,"trigger",{},(()=>[r(s(U),{"show-arrow":!1,placement:"bottom"},{trigger:n((()=>[r(s(C),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[r(s(I),{component:s(L),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))],2)],64))}});export{le as default};
|
@@ -10,7 +10,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
10
10
|
type: BooleanConstructor;
|
11
11
|
};
|
12
12
|
}, {
|
13
|
-
cssVars: import("vue").ComputedRef<AnyObject>;
|
14
13
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
15
14
|
type: {
|
16
15
|
type: StringConstructor;
|
@@ -20,7 +19,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
20
19
|
type: BooleanConstructor;
|
21
20
|
};
|
22
21
|
}>> & {}>>;
|
23
|
-
|
22
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
23
|
+
state: {
|
24
|
+
orgId: string | number;
|
25
|
+
currentSessionItem: AnyObject;
|
26
|
+
id: string;
|
27
|
+
userInfo: AnyObject;
|
28
|
+
msgList: AnyObject[];
|
29
|
+
currentMsg: AnyObject;
|
30
|
+
isAppendMsg: boolean;
|
31
|
+
sessionList: AnyObject[];
|
32
|
+
isChangeSession: boolean;
|
33
|
+
updateSessionItem: AnyObject;
|
34
|
+
isUpdateSession: boolean;
|
35
|
+
currentReferenceMsg: AnyObject | null;
|
36
|
+
currentReEditMsg: AnyObject | null;
|
37
|
+
showVideo: boolean;
|
38
|
+
currentAVMsg: AnyObject;
|
39
|
+
currentGroupUser: AnyObject[];
|
40
|
+
showMultipleVideo: boolean;
|
41
|
+
};
|
24
42
|
relayMessage: (param: {
|
25
43
|
checkedIds: string[];
|
26
44
|
remark: string;
|
@@ -109,7 +127,25 @@ declare const _default: import("vue").DefineComponent<{
|
|
109
127
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
110
128
|
}>>;
|
111
129
|
emit: (event: "comfirm", ...args: any[]) => void;
|
112
|
-
state:
|
130
|
+
state: {
|
131
|
+
orgId: string | number;
|
132
|
+
currentSessionItem: AnyObject;
|
133
|
+
id: string;
|
134
|
+
userInfo: AnyObject;
|
135
|
+
msgList: AnyObject[];
|
136
|
+
currentMsg: AnyObject;
|
137
|
+
isAppendMsg: boolean;
|
138
|
+
sessionList: AnyObject[];
|
139
|
+
isChangeSession: boolean;
|
140
|
+
updateSessionItem: AnyObject;
|
141
|
+
isUpdateSession: boolean;
|
142
|
+
currentReferenceMsg: AnyObject | null;
|
143
|
+
currentReEditMsg: AnyObject | null;
|
144
|
+
showVideo: boolean;
|
145
|
+
currentAVMsg: AnyObject;
|
146
|
+
currentGroupUser: AnyObject[];
|
147
|
+
showMultipleVideo: boolean;
|
148
|
+
};
|
113
149
|
setCurrentSessionItem: (item: AnyObject) => void;
|
114
150
|
listRef: import("vue").Ref<any>;
|
115
151
|
keyword: import("vue").Ref<string>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as
|
1
|
+
import{defineComponent as e,ref as t,computed as s,watch as a,openBlock as o,createBlock as i,unref as r,withCtx as n,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as d,Fragment as p,renderList as u,toDisplayString as f,vShow as y,normalizeStyle as h,createTextVNode as g}from"vue";import{NModal as v,NImageGroup as w,NImage as k,NInput as M,NIcon as b,NTooltip as _}from"naive-ui";import{SearchOutline as j,OpenOutline as I,DownloadOutline as T}from"@vicons/ionicons5";import{searchChatRecordApi as x}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as S}from"@vueuse/core";import{format as A,isSameWeek as C,isSameMonth as D}from"date-fns";import{last as H}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as z}from"../../../../shared/hooks/useScrollLoading.js";import{useData as L}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as U,downloadFile as E}from"../utils/index.js";import"trtc-sdk-v5";import O from"./ChatAdd.vue.js";const $={class:"label"},F={class:"image-box"},P={class:"file-type"},R={class:"text"},B={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=L(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=S(ae,500),te={page:0,hasMore:!0,lastSendTime:A(new Date,"yyyy-MM-dd HH:mm:ss")};async function se(){var e;try{if(!te.hasMore)return;te.page++;const t=await x({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let s=t||[];if(Array.isArray(t)&&t.length>0&&(s=t[0].recordList),te.lastSendTime=null==(e=H(s))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{const s=new Date(e.sendTime);let a=A(s,"yyyy年MM月");C(s,new Date)?a="本周":D(s,new Date)&&(a="本月"),t[a]||(t[a]=[]),t[a].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(s);Q.value=te.page>1?Q.value.concat(e):e}else{const e=s.map((e=>new Promise((async t=>{const s=await U(e.content.fileUrl);t({...e,size:s})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:A(new Date,"yyyy-MM-dd HH:mm:ss")}),se()}z(X,(()=>{se()})),z(Y,(()=>{se()}));const oe=s((()=>"image"===V.type?"聊天图片":"聊天文件"));function ie(e){const{size:t,sendTime:s,senderName:a}=e;return`${t} · ${A(new Date(s),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const s=(null==(t=e.content)?void 0:t.msg)||"",a=s.lastIndexOf(".");if(-1!==a){return s.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,s)=>(o(),i(r(v),{preset:"dialog",title:r(oe),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:n((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[m(r(w),{"show-toolbar-tooltip":""},{default:n((()=>[(o(!0),d(p,null,u(Q.value,(e=>(o(),d("div",{class:"image-item",key:e.label},[c("span",$,f(e.label),1),c("div",F,[(o(!0),d(p,null,u(e.list,(e=>(o(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[y,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:h(r(q))},[m(r(M),{clearable:"",placeholder:"搜索文件",value:Z.value,"onUpdate:value":s[0]||(s[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:n((()=>[m(r(b),{component:r(j)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(o(!0),d(p,null,u(W.value,((e,t)=>(o(),d("div",{class:"file-item",key:t},[c("span",P,f(re(e)),1),c("div",R,[c("span",B,f(e.content.msg),1),c("span",G,f(ie(e)),1)]),c("div",N,[m(O,{title:"转发消息",mode:"relay",onComfirm:(t,s)=>r(K)({content:e.content,checkedIds:t,remark:s})},{trigger:n((()=>[m(r(_),{"show-arrow":!1},{trigger:n((()=>[m(r(b),{size:16,component:r(I)},null,8,["component"])])),default:n((()=>[g(" 转发 ")])),_:1})])),_:2},1032,["onComfirm"]),m(r(_),{"show-arrow":!1},{trigger:n((()=>[m(r(b),{size:16,component:r(T),onClick:()=>r(E)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:n((()=>[g(" 下载 ")])),_:2},1024)])])))),128))],512)],4),[[y,"image"!==e.type]])])),_:1},8,["title"]))}});export{V as default};
|
@@ -5,7 +5,25 @@ import { simplifyMessage } from '../utils';
|
|
5
5
|
import { FileOptions } from '../types';
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
7
7
|
inputRef: Ref<HTMLDivElement | undefined>;
|
8
|
-
state:
|
8
|
+
state: {
|
9
|
+
orgId: string | number;
|
10
|
+
currentSessionItem: AnyObject;
|
11
|
+
id: string;
|
12
|
+
userInfo: AnyObject;
|
13
|
+
msgList: AnyObject[];
|
14
|
+
currentMsg: AnyObject;
|
15
|
+
isAppendMsg: boolean;
|
16
|
+
sessionList: AnyObject[];
|
17
|
+
isChangeSession: boolean;
|
18
|
+
updateSessionItem: AnyObject;
|
19
|
+
isUpdateSession: boolean;
|
20
|
+
currentReferenceMsg: AnyObject | null;
|
21
|
+
currentReEditMsg: AnyObject | null;
|
22
|
+
showVideo: boolean;
|
23
|
+
currentAVMsg: AnyObject;
|
24
|
+
currentGroupUser: AnyObject[];
|
25
|
+
showMultipleVideo: boolean;
|
26
|
+
};
|
9
27
|
sendMessage: (message: {
|
10
28
|
chatType?: string | undefined;
|
11
29
|
content: AnyObject;
|
@@ -90,7 +108,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
90
108
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
91
109
|
}>>;
|
92
110
|
emit: (event: "comfirm", ...args: any[]) => void;
|
93
|
-
state:
|
111
|
+
state: {
|
112
|
+
orgId: string | number;
|
113
|
+
currentSessionItem: AnyObject;
|
114
|
+
id: string;
|
115
|
+
userInfo: AnyObject;
|
116
|
+
msgList: AnyObject[];
|
117
|
+
currentMsg: AnyObject;
|
118
|
+
isAppendMsg: boolean;
|
119
|
+
sessionList: AnyObject[];
|
120
|
+
isChangeSession: boolean;
|
121
|
+
updateSessionItem: AnyObject;
|
122
|
+
isUpdateSession: boolean;
|
123
|
+
currentReferenceMsg: AnyObject | null;
|
124
|
+
currentReEditMsg: AnyObject | null;
|
125
|
+
showVideo: boolean;
|
126
|
+
currentAVMsg: AnyObject;
|
127
|
+
currentGroupUser: AnyObject[];
|
128
|
+
showMultipleVideo: boolean;
|
129
|
+
};
|
94
130
|
setCurrentSessionItem: (item: AnyObject) => void;
|
95
131
|
listRef: Ref<any>;
|
96
132
|
keyword: Ref<string>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as
|
1
|
+
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as s,openBlock as i,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as d,createCommentVNode as f,withCtx as m,Fragment as g,renderList as p,createBlock as h,createTextVNode as y,mergeProps as v,renderSlot as w,vShow as M}from"vue";import{NIcon as k,NTooltip as _,NPopover as E,NButton as C,NUpload as I,NUploadTrigger as T}from"naive-ui";import b from"./ChatAdd.vue.js";import{useData as x}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as j,AV_STATUS as z}from"../constants/index.js";import{uploadFileApi as L}from"../api/index.js";import{simplifyMessage as O,base64ToFile as R}from"../utils/index.js";import"trtc-sdk-v5";import{emojis as D}from"../utils/emoji.js";import{CloseCircleOutline as q,CallOutline as $,VideocamOutline as A}from"@vicons/ionicons5";import{xor as H,uniq as J,trim as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";import{useStorage as U}from"@vueuse/core";const G={key:0,class:"reference-content-box"},N={class:"reference-content"},X=["innerHTML"],B={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),P=l("span",null,"最近使用",-1),Q={class:"list-box",style:{"margin-bottom":"8px"}},W=["src"],Y=l("span",null,"默认表情",-1),Z={class:"list-box"},ee=["src"],ne=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),te=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),oe=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),se=["contenteditable"],ie={class:"btn-box"},re=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ae=e({__name:"ChatFooter",setup(e){const ae=n(),{state:ce,sendMessage:le,isGroupChat:ue,isEnded:de}=x(),fe=n(!1),me=n(""),ge=U("commonEmoticons",[]),pe=t((()=>({options:ce.currentGroupUser,defaultValue:[ce.userInfo]}))),he=t((()=>!me.value.replace(/( |\s|<br>)+/g,"")));function ye(e,n=[]){const t=F(),o=[],s=n.length>0;ce.showVideo||ce.showMultipleVideo||(s?(o.push(...H(n,[ce.userInfo.id])),Object.assign(ce.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),ce.showMultipleVideo=!0):le({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function ve(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),Ee()))}function we(){var e;me.value=(null==(e=ae.value)?void 0:e.innerHTML)||""}function Me(e){var n;ge.value.unshift(e),ge.value=J(ge.value).slice(0,26),null==(n=ae.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${j.EMOJI} class="emoji--min" src=${D.findEmoji(e)} />`)}async function ke(e){const n=new FormData;return n.append("sender",ce.userInfo.id),n.append("file",e),await L(n)}async function _e(e,n){const{file:t,name:o}=e.file,s=await ke(t);if(!s)return console.log("上传失败");Ce({chatMessageType:n,msg:n===j.FILE?o:s,url:s})}async function Ee(){const{innerHTML:e="",innerText:n="",outerText:t=""}=ae.value||{};if(he.value)return console.log("请输入内容");let o=j.TEXT,s="";if(e){const t=e.match(/<img[^>]*>/gi),i=(t||[]).length;if(n&&0===i)s=n;else if(n||1!==i){if(o=j.BLEND,s=e,null==t?void 0:t.length)for(let e=0;e<i;e++)if(t[e].includes(`data-type="${j.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(s=s.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await R(n[1]);if(e){const t=await ke(e);s=s.replace(n[1],t||"")}}}}else if(e.includes(j.EMOJI)){o=j.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(s=n[1])}else{o=j.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await R(n[1]);if(e){const n=await ke(e);n&&(s=n)}}}}else s=V(n);s&&Ce({msg:s,chatMessageType:o,origin:"btn"})}async function Ce(e){const{chatMessageType:n=j.TEXT,msg:t,url:o,origin:s=""}=e,i={msg:t,chatMessageType:n};n===j.FILE&&(i.fileUrl=o),"btn"===s&&Ie(),ce.currentReferenceMsg&&([j.TEXT,j.EMOJI,j.BLEND].includes(n)&&(i.referenceContent=K(ce.currentReferenceMsg)),ce.currentReferenceMsg=null),le({content:i})}function Ie(){ae.value.innerHTML="",me.value=""}return o((()=>[ce.currentReferenceMsg,ce.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=ae.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===j.TEXT?t:`<img data-msg=${t} data-type=${j.EMOJI} class="emoji--min" src=${D.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),ce.currentReEditMsg=null}})),o((()=>ce.id),(e=>{e&&Ie()})),(e,n)=>s((i(),r("section",{class:"chat-footer",style:a({cursor:c(ce).id?"default":"not-allowed"})},[c(ce).currentReferenceMsg?(i(),r("div",G,[l("div",N,[l("span",null,u(c(ce).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(O)(c(ce).currentReferenceMsg.content)},null,8,X)]),d(c(k),{component:c(q),onClick:n[0]||(n[0]=()=>c(ce).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),l("div",B,[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(E),{"content-class":"emoji-content",class:"emoji-wrapper",show:fe.value,"onUpdate:show":n[1]||(n[1]=e=>fe.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[S])),_:1})])),default:m((()=>[c(ge).length>0?(i(),r(g,{key:0},[P,l("div",Q,[(i(!0),r(g,null,p(c(ge),(e=>(i(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:()=>Me(e)},{icon:m((()=>[l("img",{src:c(D).findEmoji(e)},null,8,W)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])],64)):f("v-if",!0),Y,l("div",Z,[(i(!0),r(g,null,p(c(D).default,(([e,n])=>(i(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:()=>Me(e)},{icon:m((()=>[l("img",{src:n},null,8,ee)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:m((()=>[y(" 表情 ")])),_:1}),d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>Ce({chatMessageType:c(j).EMOJI,msg:0}))},{icon:m((()=>[ne])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>_e(e,c(j).IMAGE))},{default:m((()=>[d(c(T),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[te])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>_e(e,c(j).FILE))},{default:m((()=>[d(c(T),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[oe])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(ce).userInfo.sdkAppID?(i(),r(g,{key:0},[c(ue)?(i(),r(g,{key:0},[d(b,v(c(pe),{onComfirm:n[5]||(n[5]=e=>ye(c(j).AUDIO,e))}),{trigger:m((()=>[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"18",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),d(b,v(c(pe),{onComfirm:n[6]||(n[6]=e=>ye(c(j).VIDEO,e))}),{trigger:m((()=>[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(i(),r(g,{key:1},[d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>ye(c(j).AUDIO))},{icon:m((()=>[d(c(k),{size:"18",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),d(c(_),{"show-arrow":!1},{trigger:m((()=>[d(c(C),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>ye(c(j).VIDEO))},{icon:m((()=>[d(c(k),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))],64)):f("v-if",!0),w(e.$slots,"footer")]),s(l("div",{ref_key:"inputRef",ref:ae,class:"input-box",contenteditable:!c(de),onKeydown:ve,onInput:we},null,40,se),[[M,c(ce).id]]),l("div",ie,[re,d(c(C),{type:"primary",round:"",disabled:c(he),onClick:Ee},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[M,c(ce).id]])}});export{ae as default};
|
@@ -1,6 +1,24 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
|
-
state:
|
3
|
+
state: {
|
4
|
+
orgId: string | number;
|
5
|
+
currentSessionItem: AnyObject;
|
6
|
+
id: string;
|
7
|
+
userInfo: AnyObject;
|
8
|
+
msgList: AnyObject[];
|
9
|
+
currentMsg: AnyObject;
|
10
|
+
isAppendMsg: boolean;
|
11
|
+
sessionList: AnyObject[];
|
12
|
+
isChangeSession: boolean;
|
13
|
+
updateSessionItem: AnyObject;
|
14
|
+
isUpdateSession: boolean;
|
15
|
+
currentReferenceMsg: AnyObject | null;
|
16
|
+
currentReEditMsg: AnyObject | null;
|
17
|
+
showVideo: boolean;
|
18
|
+
currentAVMsg: AnyObject;
|
19
|
+
currentGroupUser: AnyObject[];
|
20
|
+
showMultipleVideo: boolean;
|
21
|
+
};
|
4
22
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
5
23
|
isGroupLeader: import("vue").ComputedRef<boolean>;
|
6
24
|
isEnded: import("vue").ComputedRef<boolean>;
|
@@ -50,7 +68,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
50
68
|
onClose?: ((...args: any[]) => any) | undefined;
|
51
69
|
}>>;
|
52
70
|
emit: (event: "close", ...args: any[]) => void;
|
53
|
-
state:
|
71
|
+
state: {
|
72
|
+
orgId: string | number;
|
73
|
+
currentSessionItem: AnyObject;
|
74
|
+
id: string;
|
75
|
+
userInfo: AnyObject;
|
76
|
+
msgList: AnyObject[];
|
77
|
+
currentMsg: AnyObject;
|
78
|
+
isAppendMsg: boolean;
|
79
|
+
sessionList: AnyObject[];
|
80
|
+
isChangeSession: boolean;
|
81
|
+
updateSessionItem: AnyObject;
|
82
|
+
isUpdateSession: boolean;
|
83
|
+
currentReferenceMsg: AnyObject | null;
|
84
|
+
currentReEditMsg: AnyObject | null;
|
85
|
+
showVideo: boolean;
|
86
|
+
currentAVMsg: AnyObject;
|
87
|
+
currentGroupUser: AnyObject[];
|
88
|
+
showMultipleVideo: boolean;
|
89
|
+
};
|
54
90
|
openSession: (item: AnyObject) => Promise<void>;
|
55
91
|
showUserDetail: import("vue").Ref<boolean>;
|
56
92
|
showLargeAvatar: import("vue").Ref<boolean>;
|
@@ -98,7 +134,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
98
134
|
attrs: {
|
99
135
|
[x: string]: unknown;
|
100
136
|
};
|
101
|
-
state:
|
137
|
+
state: {
|
138
|
+
orgId: string | number;
|
139
|
+
currentSessionItem: AnyObject;
|
140
|
+
id: string;
|
141
|
+
userInfo: AnyObject;
|
142
|
+
msgList: AnyObject[];
|
143
|
+
currentMsg: AnyObject;
|
144
|
+
isAppendMsg: boolean;
|
145
|
+
sessionList: AnyObject[];
|
146
|
+
isChangeSession: boolean;
|
147
|
+
updateSessionItem: AnyObject;
|
148
|
+
isUpdateSession: boolean;
|
149
|
+
currentReferenceMsg: AnyObject | null;
|
150
|
+
currentReEditMsg: AnyObject | null;
|
151
|
+
showVideo: boolean;
|
152
|
+
currentAVMsg: AnyObject;
|
153
|
+
currentGroupUser: AnyObject[];
|
154
|
+
showMultipleVideo: boolean;
|
155
|
+
};
|
102
156
|
setCurrentSessionItem: (item: AnyObject) => void;
|
103
157
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
104
158
|
isGroupLeader: import("vue").ComputedRef<boolean>;
|
@@ -154,7 +208,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
154
208
|
onClose?: ((...args: any[]) => any) | undefined;
|
155
209
|
}>>;
|
156
210
|
emit: (event: "close", ...args: any[]) => void;
|
157
|
-
state:
|
211
|
+
state: {
|
212
|
+
orgId: string | number;
|
213
|
+
currentSessionItem: AnyObject;
|
214
|
+
id: string;
|
215
|
+
userInfo: AnyObject;
|
216
|
+
msgList: AnyObject[];
|
217
|
+
currentMsg: AnyObject;
|
218
|
+
isAppendMsg: boolean;
|
219
|
+
sessionList: AnyObject[];
|
220
|
+
isChangeSession: boolean;
|
221
|
+
updateSessionItem: AnyObject;
|
222
|
+
isUpdateSession: boolean;
|
223
|
+
currentReferenceMsg: AnyObject | null;
|
224
|
+
currentReEditMsg: AnyObject | null;
|
225
|
+
showVideo: boolean;
|
226
|
+
currentAVMsg: AnyObject;
|
227
|
+
currentGroupUser: AnyObject[];
|
228
|
+
showMultipleVideo: boolean;
|
229
|
+
};
|
158
230
|
openSession: (item: AnyObject) => Promise<void>;
|
159
231
|
showUserDetail: import("vue").Ref<boolean>;
|
160
232
|
showLargeAvatar: import("vue").Ref<boolean>;
|
@@ -251,7 +323,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
251
323
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
252
324
|
}>>;
|
253
325
|
emit: (event: "comfirm", ...args: any[]) => void;
|
254
|
-
state:
|
326
|
+
state: {
|
327
|
+
orgId: string | number;
|
328
|
+
currentSessionItem: AnyObject;
|
329
|
+
id: string;
|
330
|
+
userInfo: AnyObject;
|
331
|
+
msgList: AnyObject[];
|
332
|
+
currentMsg: AnyObject;
|
333
|
+
isAppendMsg: boolean;
|
334
|
+
sessionList: AnyObject[];
|
335
|
+
isChangeSession: boolean;
|
336
|
+
updateSessionItem: AnyObject;
|
337
|
+
isUpdateSession: boolean;
|
338
|
+
currentReferenceMsg: AnyObject | null;
|
339
|
+
currentReEditMsg: AnyObject | null;
|
340
|
+
showVideo: boolean;
|
341
|
+
currentAVMsg: AnyObject;
|
342
|
+
currentGroupUser: AnyObject[];
|
343
|
+
showMultipleVideo: boolean;
|
344
|
+
};
|
255
345
|
setCurrentSessionItem: (item: AnyObject) => void;
|
256
346
|
listRef: import("vue").Ref<any>;
|
257
347
|
keyword: import("vue").Ref<string>;
|
@@ -334,7 +424,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
334
424
|
type: BooleanConstructor;
|
335
425
|
};
|
336
426
|
}, {
|
337
|
-
cssVars: import("vue").ComputedRef<AnyObject>;
|
338
427
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
339
428
|
type: {
|
340
429
|
type: StringConstructor;
|
@@ -344,7 +433,26 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
344
433
|
type: BooleanConstructor;
|
345
434
|
};
|
346
435
|
}>> & {}>>;
|
347
|
-
|
436
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
437
|
+
state: {
|
438
|
+
orgId: string | number;
|
439
|
+
currentSessionItem: AnyObject;
|
440
|
+
id: string;
|
441
|
+
userInfo: AnyObject;
|
442
|
+
msgList: AnyObject[];
|
443
|
+
currentMsg: AnyObject;
|
444
|
+
isAppendMsg: boolean;
|
445
|
+
sessionList: AnyObject[];
|
446
|
+
isChangeSession: boolean;
|
447
|
+
updateSessionItem: AnyObject;
|
448
|
+
isUpdateSession: boolean;
|
449
|
+
currentReferenceMsg: AnyObject | null;
|
450
|
+
currentReEditMsg: AnyObject | null;
|
451
|
+
showVideo: boolean;
|
452
|
+
currentAVMsg: AnyObject;
|
453
|
+
currentGroupUser: AnyObject[];
|
454
|
+
showMultipleVideo: boolean;
|
455
|
+
};
|
348
456
|
relayMessage: (param: {
|
349
457
|
checkedIds: string[];
|
350
458
|
remark: string;
|
@@ -433,7 +541,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
433
541
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
434
542
|
}>>;
|
435
543
|
emit: (event: "comfirm", ...args: any[]) => void;
|
436
|
-
state:
|
544
|
+
state: {
|
545
|
+
orgId: string | number;
|
546
|
+
currentSessionItem: AnyObject;
|
547
|
+
id: string;
|
548
|
+
userInfo: AnyObject;
|
549
|
+
msgList: AnyObject[];
|
550
|
+
currentMsg: AnyObject;
|
551
|
+
isAppendMsg: boolean;
|
552
|
+
sessionList: AnyObject[];
|
553
|
+
isChangeSession: boolean;
|
554
|
+
updateSessionItem: AnyObject;
|
555
|
+
isUpdateSession: boolean;
|
556
|
+
currentReferenceMsg: AnyObject | null;
|
557
|
+
currentReEditMsg: AnyObject | null;
|
558
|
+
showVideo: boolean;
|
559
|
+
currentAVMsg: AnyObject;
|
560
|
+
currentGroupUser: AnyObject[];
|
561
|
+
showMultipleVideo: boolean;
|
562
|
+
};
|
437
563
|
setCurrentSessionItem: (item: AnyObject) => void;
|
438
564
|
listRef: import("vue").Ref<any>;
|
439
565
|
keyword: import("vue").Ref<string>;
|
@@ -532,7 +658,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
532
658
|
type: BooleanConstructor;
|
533
659
|
};
|
534
660
|
}>> & {}>>;
|
535
|
-
state:
|
661
|
+
state: {
|
662
|
+
orgId: string | number;
|
663
|
+
currentSessionItem: AnyObject;
|
664
|
+
id: string;
|
665
|
+
userInfo: AnyObject;
|
666
|
+
msgList: AnyObject[];
|
667
|
+
currentMsg: AnyObject;
|
668
|
+
isAppendMsg: boolean;
|
669
|
+
sessionList: AnyObject[];
|
670
|
+
isChangeSession: boolean;
|
671
|
+
updateSessionItem: AnyObject;
|
672
|
+
isUpdateSession: boolean;
|
673
|
+
currentReferenceMsg: AnyObject | null;
|
674
|
+
currentReEditMsg: AnyObject | null;
|
675
|
+
showVideo: boolean;
|
676
|
+
currentAVMsg: AnyObject;
|
677
|
+
currentGroupUser: AnyObject[];
|
678
|
+
showMultipleVideo: boolean;
|
679
|
+
};
|
536
680
|
recordRef: import("vue").Ref<any>;
|
537
681
|
recordList: import("vue").Ref<AnyObject[]>;
|
538
682
|
keyword: import("vue").Ref<any>;
|
@@ -746,7 +890,25 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
746
890
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
747
891
|
}>>;
|
748
892
|
emit: (event: "comfirm", ...args: any[]) => void;
|
749
|
-
state:
|
893
|
+
state: {
|
894
|
+
orgId: string | number;
|
895
|
+
currentSessionItem: AnyObject;
|
896
|
+
id: string;
|
897
|
+
userInfo: AnyObject;
|
898
|
+
msgList: AnyObject[];
|
899
|
+
currentMsg: AnyObject;
|
900
|
+
isAppendMsg: boolean;
|
901
|
+
sessionList: AnyObject[];
|
902
|
+
isChangeSession: boolean;
|
903
|
+
updateSessionItem: AnyObject;
|
904
|
+
isUpdateSession: boolean;
|
905
|
+
currentReferenceMsg: AnyObject | null;
|
906
|
+
currentReEditMsg: AnyObject | null;
|
907
|
+
showVideo: boolean;
|
908
|
+
currentAVMsg: AnyObject;
|
909
|
+
currentGroupUser: AnyObject[];
|
910
|
+
showMultipleVideo: boolean;
|
911
|
+
};
|
750
912
|
setCurrentSessionItem: (item: AnyObject) => void;
|
751
913
|
listRef: import("vue").Ref<any>;
|
752
914
|
keyword: import("vue").Ref<string>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as o,openBlock as i,createElementBlock as
|
1
|
+
import{defineComponent as e,ref as t,computed as o,openBlock as i,createElementBlock as s,Fragment as r,unref as a,createElementVNode as n,createVNode as l,withCtx as c,toDisplayString as u,renderSlot as m,createTextVNode as d,normalizeProps as h,guardReactiveProps as p,createBlock as v,createCommentVNode as f}from"vue";import{NAvatar as g,NTooltip as w,NButton as _,NIcon as y,NPopconfirm as b}from"naive-ui";import{useData as j}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as C}from"../constants/index.js";import{updateStatusApi as k}from"../api/index.js";import{$message as z}from"../utils/index.js";import"trtc-sdk-v5";import q from"./PersonProfile.vue.js";import I from"./ChatSet.vue.js";import S from"./ChatFile.vue.js";import x from"./ChatRecord.vue.js";import D from"./ChatAdd.vue.js";import{PersonAddOutline as E,CloseOutline as U}from"@vicons/ionicons5";const G={key:0,class:"chat-header box-shadow"},P={class:"chat-header__left"},N={class:"name"},A={class:"chat-header__right"},F=n("i",{class:"chat--iconfont chat--icon-image"},null,-1),H=n("i",{class:"chat--iconfont chat--icon-folder"},null,-1),L=n("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),R=n("i",{class:"chat--iconfont chat--icon-set"},null,-1);var V=e({__name:"ChatHeader",setup(e){const{state:V,isGroupChat:$,isGroupLeader:B,isEnded:J,setCurrentSessionItem:K}=j(),M=t(!1),O=t(!1),Q=t("image"),T=t(!1),W=o((()=>{const e=V.currentGroupUser.map((e=>e.id));return $.value?{mode:"join",disabledIds:e,disabled:J.value}:{mode:"create",defaultValue:V.currentGroupUser}}));function X(e){Q.value=e,O.value=!0}async function Y(){try{await k({id:V.currentSessionItem.id,status:C.ENDED}),K({status:C.ENDED}),z.success("当前会话已结束")}catch(e){console.log(e)}}return(e,t)=>(i(),s(r,null,[a(V).id?(i(),s("section",G,[n("div",P,[l(q,{"user-id":a(V).currentSessionItem.receiver,disabled:a($),placement:"bottom"},{trigger:c((()=>[l(a(g),{round:"",size:30,src:a(V).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),n("span",N,u(a(V).currentSessionItem.name),1)]),n("div",A,[m(e.$slots,"header"),l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny",onClick:t[0]||(t[0]=()=>X("image"))},{icon:c((()=>[F])),_:1})])),default:c((()=>[d(" 图片 ")])),_:1}),l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny",onClick:t[1]||(t[1]=()=>X("file"))},{icon:c((()=>[H])),_:1})])),default:c((()=>[d(" 文件 ")])),_:1}),l(D,h(p(a(W))),{trigger:c((()=>[l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny"},{icon:c((()=>[l(a(y),{size:"18",component:a(E)},null,8,["component"])])),_:1})])),default:c((()=>[d(" 添加成员 ")])),_:1})])),_:1},16),l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>T.value=!0)},{icon:c((()=>[L])),_:1})])),default:c((()=>[d(" 聊天记录 ")])),_:1}),l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny",onClick:t[3]||(t[3]=()=>M.value=!0)},{icon:c((()=>[R])),_:1})])),default:c((()=>[d(" 聊天设置 ")])),_:1}),a($)&&a(B)?(i(),v(a(b),{key:0,onPositiveClick:Y},{trigger:c((()=>[l(a(w),{"show-arrow":!1,placement:"bottom"},{trigger:c((()=>[l(a(_),{quaternary:"",size:"tiny"},{icon:c((()=>[l(a(y),{size:"18",component:a(U)},null,8,["component"])])),_:1})])),default:c((()=>[d(" 结束聊天 ")])),_:1})])),default:c((()=>[d(" 是否确认结束群聊? ")])),_:1})):f("v-if",!0)])])):f("v-if",!0),l(I,{show:M.value,"onUpdate:show":t[4]||(t[4]=e=>M.value=e)},null,8,["show"]),l(S,{show:O.value,"onUpdate:show":t[5]||(t[5]=e=>O.value=e),type:Q.value,visible:O.value},null,8,["show","type","visible"]),l(x,{show:T.value,"onUpdate:show":t[6]||(t[6]=e=>T.value=e),visible:T.value},null,8,["show","visible"])],64))}});export{V as default};
|