cnhis-design-vue 3.2.6-release.2 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/src/utils/print.d.ts +4 -2
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +497 -19
- package/es/components/iho-chat/src/Index.vue.d.ts +502 -24
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/api/index.d.ts +5 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +89 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue.js +1 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -0
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +94 -4
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +129 -3
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +24 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +16 -1
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +133 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue.js +1 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +15 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +24 -13
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +10 -1
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/index.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useSession.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +5 -0
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +24 -0
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +3 -0
- package/es/components/iho-chat/src/utils/index.d.ts +2 -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/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as
|
1
|
+
import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as l,Fragment as p,createElementVNode as m,renderSlot as h,createCommentVNode as f}from"vue";import{NConfigProvider as g,NSpin as v,NLayout as S,NLayoutContent as y}from"naive-ui";import b from"./components/SiderList.vue.js";import I from"./components/ChatHeader.vue.js";import M from"./components/ChatMain.vue.js";import T from"./components/ChatFooter.vue.js";import k from"./components/ChatSearch.vue.js";import V from"./components/ChatAdd.vue.js";import j from"./components/Video.vue.js";import w from"./components/MultipleVideo.vue.js";import{ChatSock as N}from"./utils/chatSock.js";import{instanceAxios as L,listUserApi as U,readMessageApi as _}from"./api/index.js";import{useTheme as A}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as C,isNumber as O}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{CHAT_TYPE as R,SUBSCRIBE_MESSAGE_TYPE as x,AV_STATUS as G}from"./constants/index.js";import{InjectionIChatState as E,InjectionIChatStompClient as J,InjectionIChatEmits as K}from"./types/index.js";import{isAudioOrVideoMessage as P}from"./utils/index.js";import{useSession as $}from"./hooks/useSession.js";import"trtc-sdk-v5";const q={class:"iho-chat__header"},z={class:"toolbar"};var F=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"}},emits:["template-click","unread-message-update"],setup(e,{expose:F,emit:H}){const B=e;L.defaults.baseURL=B.baseURL,L.defaults.headers.Authorization="bearer "+B.token;const D=A(),W=s(!1),Y=s(),Q=o({orgId:B.orgId,currentSessionItem:{},id:"",userInfo:{id:B.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{},userList:[],currentGroupUser:[],showMultipleVideo:!1});t(E,Q),t(J,Y),t(K,H);const{openSession:X,closeSession:Z,getCurrentSession:ee,setSessionList:se,setUpdateSessionItem:oe,setCurrentSessionItem:te}=$(Q),re=[];function ne(){const e={headers:{AccessToken:B.token,UserId:B.userId},heartbeatFn(){try{Y.value.send("test")}catch(e){Y.value.disconnect(),ne()}},connectCb(){console.log("连接成功"),Y.value.subscribe("/user/topic/single",(({body:e})=>ae({body:e,chatType:R.SINGLE}))),Y.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:r}=s;if(console.log("body",s),Object.assign(Q.userInfo,t,o),!(null==r?void 0:r.length))return;se(r),re.splice(0,re.length),re.push(...r.filter((e=>e.chatType===R.GROUP))),re.forEach((e=>{Y.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>ae({body:e,chatType:R.GROUP})))}))}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};Y.value=new N("/fdp-chat/websocket",e)}async function ie(e,s){if(Q.currentMsg=e,e.sessionKey===Q.currentSessionItem.sessionKey)return Q.isAppendMsg=!0,e.sender!==Q.userInfo.id&&await _({chatType:s,messageIdSet:[e.id],receiver:Q.userInfo.id,sender:e.sender}),void te({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const o={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName};oe(o)}async function ae({body:e,chatType:s}){try{console.log(JSON.parse(e),"订阅新增消息");const o=JSON.parse(e),{messageVo:t,sessionVo:r,chatAvStatusVo:n}=o;switch(o.event){case x.MESSAGE:P(t.content)?!Q.showVideo&&!Q.showMultipleVideo||t.content.avStatus!==G.IN_CALL?(Q.currentMsg=t,Object.assign(Q.currentAVMsg,{strRoomId:t.sessionKey,chatMessageType:t.content.chatMessageType,callMode:t.sender===Q.userInfo.id?"call":"invite",currentMsg:t}),Q.showVideo||Q.showMultipleVideo?ie(t,s):Q.showVideo=!0):(Y.value.send("/app/chat/send",{},JSON.stringify({chatType:R.SINGLE,receiver:t.sender,content:{chatMessageType:t.content.chatMessageType,avStatus:G.CALL_BUSY}})),console.log("用户忙!")):ie(t,s);break;case x.AV_STATUS:Object.assign(Q.currentAVMsg,n,{callMode:n.sender===Q.userInfo.id?"call":"invite",checkedIds:[]}),Q.showVideo||Q.showMultipleVideo?console.log("用户忙!"):Q.showMultipleVideo=!0;break;case x.NEW_SESSION:if(s===R.GROUP)return;oe(r);break;case x.JOIN:if(s===R.GROUP)return;oe(r),Y.value.subscribe(`/topic/group/${r.receiver}`,(({body:e})=>ae({body:e,chatType:R.GROUP})))}}catch(e){console.log(e)}}return async function(){ne(),async function(){const e=await U({orgId:Q.orgId,keyword:"",page:1,pageSize:1e4});if(!C(e.records))return;Q.userList=e.records}()}(),r((()=>{var e;null==(e=Y.value)||e.disconnect()})),F({getUnreadData:function(){return Q.sessionList.filter((e=>O(e.unreadNum)&&e.unreadNum>0))},openSession:X,closeSession:Z,getCurrentSession:ee}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(D))},[d(c(g),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[W.value?(n(),l(c(v),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[m("div",q,[d(k),d(V,{title:"发起群聊",mode:"create","default-value":[Q.userInfo.id]},null,8,["default-value"]),m("div",z,[h(e.$slots,"toolbar")])]),d(c(S),{class:"iho-chat__body","has-sider":""},{default:u((()=>[d(b),d(c(y),{class:"chat-content"},{default:u((()=>[d(I),d(M),d(T)])),_:1}),h(e.$slots,"external")])),_:3}),Q.showVideo?(n(),l(j,{key:0})):f("v-if",!0),Q.showMultipleVideo?(n(),l(w,{key:1})):f("v-if",!0)],64))])),_:3})],4))}});export{F as default};
|
@@ -8,3 +8,8 @@ export declare function listUserApi(params: AnyObject): import("axios").AxiosPro
|
|
8
8
|
export declare function getUserDetailApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
9
9
|
export declare function readMessageApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
10
10
|
export declare function searchChatRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
11
|
+
export declare function groupCreateApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
12
|
+
export declare function groupUserApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
13
|
+
export declare function groupJoinApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
14
|
+
export declare function groupLeaveApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
15
|
+
export declare function avFinishApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
@@ -1 +1 @@
|
|
1
|
-
import t from"axios";function e(t){const e=[];for(const o in t){const
|
1
|
+
import t from"axios";function e(t){const e=[];for(const o in t){const r=t[o];Array.isArray(r)?r.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(r)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function r(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/openSession",data:e(t)})}function n(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/toppingSession",data:e(t)})}function u(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function s(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function i(t){return o({method:"post",url:"/chat/readMessage",data:t})}function p(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}function c(t){return o({method:"post",url:"/group/create",data:t})}function l(t){return o({method:"get",url:"/group/user",params:t})}function m(t){return o({method:"post",url:"/group/join",data:t})}function h(t){return o({method:"post",url:"/group/leave",data:t})}function f(t){return o({method:"post",url:"/av/finish",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{f as avFinishApi,n as getHistoryRecordApi,d as getUserDetailApi,c as groupCreateApi,m as groupJoinApi,h as groupLeaveApi,l as groupUserApi,o as instanceAxios,s as listUserApi,r as openSessionApi,i as readMessageApi,p as searchChatRecordApi,a as toppingSessionApi,u as uploadFileApi};
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { AnyObject } from '../../../../shared/types';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
title: {
|
5
|
+
type: StringConstructor;
|
6
|
+
default: string;
|
7
|
+
};
|
8
|
+
mode: {
|
9
|
+
type: StringConstructor;
|
10
|
+
default: string;
|
11
|
+
};
|
12
|
+
options: {
|
13
|
+
type: PropType<AnyObject[]>;
|
14
|
+
};
|
15
|
+
disabledIds: {
|
16
|
+
type: PropType<string[]>;
|
17
|
+
};
|
18
|
+
defaultValue: {
|
19
|
+
type: PropType<string[]>;
|
20
|
+
};
|
21
|
+
}, {
|
22
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
23
|
+
title: {
|
24
|
+
type: StringConstructor;
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
mode: {
|
28
|
+
type: StringConstructor;
|
29
|
+
default: string;
|
30
|
+
};
|
31
|
+
options: {
|
32
|
+
type: PropType<AnyObject[]>;
|
33
|
+
};
|
34
|
+
disabledIds: {
|
35
|
+
type: PropType<string[]>;
|
36
|
+
};
|
37
|
+
defaultValue: {
|
38
|
+
type: PropType<string[]>;
|
39
|
+
};
|
40
|
+
}>> & {
|
41
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
42
|
+
}>>;
|
43
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
44
|
+
state: import("../types").IState;
|
45
|
+
showModal: import("vue").Ref<boolean>;
|
46
|
+
checkedIds: import("vue").Ref<(string | number)[]>;
|
47
|
+
options: import("vue").Ref<AnyObject[]>;
|
48
|
+
groupName: import("vue").Ref<string>;
|
49
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
50
|
+
handlePositiveClick: () => Promise<void>;
|
51
|
+
renderSourceLabel: ({ option }: {
|
52
|
+
option: AnyObject;
|
53
|
+
}) => JSX.Element;
|
54
|
+
renderTargetList: (props: {
|
55
|
+
onCheck: (checkedValueList: Array<string | number>) => void;
|
56
|
+
checkedOptions: AnyObject[];
|
57
|
+
pattern: string;
|
58
|
+
}) => JSX.Element | null;
|
59
|
+
NModal: any;
|
60
|
+
NButton: any;
|
61
|
+
NTransfer: any;
|
62
|
+
NIcon: any;
|
63
|
+
NInput: any;
|
64
|
+
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<{}>>, {}>;
|
65
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
66
|
+
title: {
|
67
|
+
type: StringConstructor;
|
68
|
+
default: string;
|
69
|
+
};
|
70
|
+
mode: {
|
71
|
+
type: StringConstructor;
|
72
|
+
default: string;
|
73
|
+
};
|
74
|
+
options: {
|
75
|
+
type: PropType<AnyObject[]>;
|
76
|
+
};
|
77
|
+
disabledIds: {
|
78
|
+
type: PropType<string[]>;
|
79
|
+
};
|
80
|
+
defaultValue: {
|
81
|
+
type: PropType<string[]>;
|
82
|
+
};
|
83
|
+
}>> & {
|
84
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
85
|
+
}, {
|
86
|
+
mode: string;
|
87
|
+
title: string;
|
88
|
+
}>;
|
89
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./ChatAdd.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","ChatAdd.vue"]]);export{t as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as o,createElementBlock as r,Fragment as i,createVNode as s,unref as n,withCtx as u,createElementVNode as d,createCommentVNode as c,renderSlot as p}from"vue";import{NModal as v,NInput as f,NTransfer as m,NButton as h,NIcon as b,NAvatar as g,NTag as y}from"naive-ui";import{AddOutline as I}from"@vicons/ionicons5";import{useState as k}from"../hooks/useState.js";import"date-fns";import{isArray as w,uniqBy as x,xorBy as S}from"lodash-es";import"../utils/emoji.js";import{groupJoinApi as _,groupCreateApi as j}from"../api/index.js";import"trtc-sdk-v5";const C={class:"iho-chat-dialog__content iho-chat-add-wrapper"},A={key:0,class:"input-box"},U=d("span",null,"群名称:",-1),V={class:"transfer-box"};var z=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:z}){const D=e,{state:G}=k(),L=t(!1),M=t([]),O=t([]),P=t(""),$=a((()=>"create"===D.mode?M.value.length<3:M.value.length<1));async function q(){switch(D.mode){case"create":await j({creator:G.userInfo.id,memberIdSet:M.value,name:P.value,orgId:G.orgId});break;case"join":await _({groupId:G.currentSessionItem.receiver,operator:G.userInfo.id,memberIdSet:M.value}),G.currentGroupUser.push(O.value.filter((e=>M.value.includes(e.value))));break;default:z("comfirm",M.value)}L.value=!1}function B({option:e}){return s("div",{style:"display: flex;align-items: center"},[s(g,{src:e.avatar,round:!0,size:32},null),s("span",{style:"margin-left: 10px"},[e.name])])}function E(e){const{onCheck:t,checkedOptions:a,pattern:l}=e;return a.length>0?s("div",{class:"checked-tag-box"},[a.map((e=>s(y,{bordered:!1,closable:e.id!==G.userInfo.id,onClose:()=>t(S(a,[e],"id").map((e=>e.id)))},{avatar:()=>s(g,{round:!0,src:e.avatar},null),default:()=>e.name})))]):null}return l((()=>L.value),(e=>{if(!e)return;const t=w(D.options)&&D.options.length?D.options:G.userList;O.value=x(t,"id").map((e=>{var t;return{...e,label:e.name,value:e.id,disabled:e.id===G.userInfo.id||(null==(t=D.disabledIds)?void 0:t.includes(e.id))}})),w(D.defaultValue)&&D.defaultValue.length?M.value=D.defaultValue:M.value=[]})),(t,a)=>(o(),r(i,null,[s(n(v),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog",show:L.value,"onUpdate:show":a[2]||(a[2]=e=>L.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:n($)},onPositiveClick:q},{default:u((()=>[d("div",C,["create"===e.mode?(o(),r("div",A,[U,s(n(f),{clearable:"",placeholder:"取个群名称方便后续搜索",value:P.value,"onUpdate:value":a[0]||(a[0]=e=>P.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):c("v-if",!0),d("div",V,[s(n(m),{size:"large",value:M.value,"onUpdate:value":a[1]||(a[1]=e=>M.value=e),"virtual-scroll":"",options:O.value,"render-source-label":B,"render-target-list":E,"source-filterable":""},null,8,["value","options"])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:a[3]||(a[3]=e=>L.value=!0)},[p(t.$slots,"trigger",{},(()=>[s(n(h),{color:"#ffffff4D",class:"add-btn"},{icon:u((()=>[s(n(b),{component:n(I),color:"#fff"},null,8,["component"])])),_:1})]))])],64))}});export{z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as s,watch as o,openBlock as a,createBlock as i,unref as n,withCtx as
|
1
|
+
import{defineComponent as e,ref as t,computed as s,watch as o,openBlock as a,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as y,vShow as f,normalizeStyle as h}from"vue";import{NModal as v,NImageGroup as g,NImage as w,NInput as b,NIcon as k}from"naive-ui";import{SearchOutline as M,OpenOutline as T,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as S}from"../api/index.js";import{useScrollLoading as _}from"../hooks/useScrollLoading.js";import{format as x,isSameWeek as j,isSameMonth as A}from"date-fns";import{useState as H}from"../hooks/useState.js";import{getFileSize as D,downloadFile as C}from"../utils/index.js";import{last as z}from"lodash-es";import"trtc-sdk-v5";import{useDebounceFn as L}from"@vueuse/core";import{useTheme as U}from"../../../../shared/hooks/useTheme.js";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";const E={class:"label"},O={class:"image-box"},$={class:"file-type"},F={class:"text"},K={class:"name"},P={class:"detail"},R={class:"opt-box"};var B=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const B=e,G=U(),{state:N}=H(),q=t([]),J=t([]),Q=t(),V=t(),W=t(),X=L(ee,500),Y={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function Z(){var e;try{if(!Y.hasMore)return;Y.page++;const t=await S({orgId:N.orgId,keyword:W.value,endTime:"",startTime:"",lastSendTime:Y.lastSendTime,memberIdSet:[],page:Y.page,recordType:"image"===B.type?"IMAGE":"FILE",sessionKey:N.currentSessionItem.sessionKey,userId:N.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(Y.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let s=t||[];if(Array.isArray(t)&&t.length>0&&(s=t[0].recordList),Y.lastSendTime=null==(e=z(s))?void 0:e.sendTime,"image"===B.type){const e=function(e){const t={};e.forEach((e=>{const s=new Date(e.sendTime);let o=x(s,"yyyy年MM月");j(s,new Date)?o="本周":A(s,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(s);q.value=Y.page>1?q.value.concat(e):e}else{const e=s.map((e=>new Promise((async t=>{const s=await D(e.content.fileUrl);t({...e,size:s})})))),t=await Promise.all(e);J.value=Y.page>1?J.value.concat(t):t}}catch(e){console.log(e)}}function ee(){Object.assign(Y,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),Z()}_(Q,(()=>{Z()})),_(V,(()=>{Z()}));const te=s((()=>"image"===B.type?"聊天图片":"聊天文件"));function se(e){const{size:t,sendTime:s,senderName:o}=e;return`${t} · ${x(new Date(s),"yyyy/MM/dd HH:mm")} ${o}`}function oe(e){var t;const s=(null==(t=e.content)?void 0:t.msg)||"",o=s.lastIndexOf(".");if(-1!==o){return s.charAt(o+1).toUpperCase()}return"?"}return o((()=>B.visible),(e=>{e?ee():W.value=""})),(t,s)=>(a(),i(n(v),{preset:"dialog",title:n(te),"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{default:r((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:Q},[m(n(g),{"show-toolbar-tooltip":""},{default:r((()=>[(a(!0),p(d,null,u(q.value,(e=>(a(),p("div",{class:"image-item",key:e.label},[c("span",E,y(e.label),1),c("div",O,[(a(!0),p(d,null,u(e.list,(e=>(a(),i(n(w),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[f,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:h(n(G))},[m(n(b),{clearable:"",placeholder:"搜索文件",value:W.value,"onUpdate:value":s[0]||(s[0]=e=>W.value=e),valueModifiers:{trim:!0},onInput:n(X)},{prefix:r((()=>[m(n(k),{component:n(M)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:V},[(a(!0),p(d,null,u(J.value,((e,t)=>(a(),p("div",{class:"file-item",key:t},[c("span",$,y(oe(e)),1),c("div",F,[c("span",K,y(e.content.msg),1),c("span",P,y(se(e)),1)]),c("div",R,[m(n(k),{size:16,component:n(T)},null,8,["component"]),m(n(k),{size:16,component:n(I),onClick:()=>n(C)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])])))),128))],512)],4),[[f,"image"!==e.type]])])),_:1},8,["title"]))}});export{B as default};
|
@@ -10,23 +10,113 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
10
10
|
inputRef: import("vue").Ref<HTMLDivElement | undefined>;
|
11
11
|
content: import("vue").Ref<string>;
|
12
12
|
state: import("../types").IState;
|
13
|
-
|
14
|
-
|
13
|
+
sendMessage: (message: {
|
14
|
+
chatType?: string | undefined;
|
15
|
+
content: AnyObject;
|
16
|
+
receiver?: string | undefined;
|
17
|
+
}) => Promise<void>;
|
18
|
+
isGroupChat: import("vue").ComputedRef<boolean>;
|
15
19
|
showEmoji: import("vue").Ref<boolean>;
|
16
|
-
handleCall: (chatMessageType: string) => void;
|
20
|
+
handleCall: (chatMessageType: string, checkedIds?: never[]) => void;
|
17
21
|
handleKeyDown: (event: KeyboardEvent) => void;
|
18
22
|
isWrap: (event: KeyboardEvent) => boolean;
|
19
23
|
handleInput: () => void;
|
20
24
|
selectEmoji: (name: string) => void;
|
21
25
|
fileChange: (options: FileOptions, chatMessageType: MESSAGE_TYPE) => Promise<void>;
|
22
26
|
handleMsgSend: () => void;
|
23
|
-
|
27
|
+
doSendMessage: (contentInfo: AnyObject) => Promise<void>;
|
24
28
|
NButton: any;
|
25
29
|
NPopover: any;
|
26
30
|
NTooltip: any;
|
27
31
|
NUpload: any;
|
28
32
|
NUploadTrigger: any;
|
29
33
|
NIcon: any;
|
34
|
+
ChatAdd: import("vue").DefineComponent<{
|
35
|
+
title: {
|
36
|
+
type: StringConstructor;
|
37
|
+
default: string;
|
38
|
+
};
|
39
|
+
mode: {
|
40
|
+
type: StringConstructor;
|
41
|
+
default: string;
|
42
|
+
};
|
43
|
+
options: {
|
44
|
+
type: import("vue").PropType<AnyObject[]>;
|
45
|
+
};
|
46
|
+
disabledIds: {
|
47
|
+
type: import("vue").PropType<string[]>;
|
48
|
+
};
|
49
|
+
defaultValue: {
|
50
|
+
type: import("vue").PropType<string[]>;
|
51
|
+
};
|
52
|
+
}, {
|
53
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
54
|
+
title: {
|
55
|
+
type: StringConstructor;
|
56
|
+
default: string;
|
57
|
+
};
|
58
|
+
mode: {
|
59
|
+
type: StringConstructor;
|
60
|
+
default: string;
|
61
|
+
};
|
62
|
+
options: {
|
63
|
+
type: import("vue").PropType<AnyObject[]>;
|
64
|
+
};
|
65
|
+
disabledIds: {
|
66
|
+
type: import("vue").PropType<string[]>;
|
67
|
+
};
|
68
|
+
defaultValue: {
|
69
|
+
type: import("vue").PropType<string[]>;
|
70
|
+
};
|
71
|
+
}>> & {
|
72
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
73
|
+
}>>;
|
74
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
75
|
+
state: import("../types").IState;
|
76
|
+
showModal: import("vue").Ref<boolean>;
|
77
|
+
checkedIds: import("vue").Ref<(string | number)[]>;
|
78
|
+
options: import("vue").Ref<AnyObject[]>;
|
79
|
+
groupName: import("vue").Ref<string>;
|
80
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
81
|
+
handlePositiveClick: () => Promise<void>;
|
82
|
+
renderSourceLabel: ({ option }: {
|
83
|
+
option: AnyObject;
|
84
|
+
}) => JSX.Element;
|
85
|
+
renderTargetList: (props: {
|
86
|
+
onCheck: (checkedValueList: (string | number)[]) => void;
|
87
|
+
checkedOptions: AnyObject[];
|
88
|
+
pattern: string;
|
89
|
+
}) => JSX.Element | null;
|
90
|
+
NModal: any;
|
91
|
+
NButton: any;
|
92
|
+
NTransfer: any;
|
93
|
+
NIcon: any;
|
94
|
+
NInput: any;
|
95
|
+
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<{}>>, {}>;
|
96
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
97
|
+
title: {
|
98
|
+
type: StringConstructor;
|
99
|
+
default: string;
|
100
|
+
};
|
101
|
+
mode: {
|
102
|
+
type: StringConstructor;
|
103
|
+
default: string;
|
104
|
+
};
|
105
|
+
options: {
|
106
|
+
type: import("vue").PropType<AnyObject[]>;
|
107
|
+
};
|
108
|
+
disabledIds: {
|
109
|
+
type: import("vue").PropType<string[]>;
|
110
|
+
};
|
111
|
+
defaultValue: {
|
112
|
+
type: import("vue").PropType<string[]>;
|
113
|
+
};
|
114
|
+
}>> & {
|
115
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
116
|
+
}, {
|
117
|
+
mode: string;
|
118
|
+
title: string;
|
119
|
+
}>;
|
30
120
|
emojis: {
|
31
121
|
default: string[][];
|
32
122
|
findEmoji(name: string): any;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as t,watch as n,withDirectives as o,openBlock as i,createElementBlock as s,normalizeStyle as r,unref as a,createElementVNode as l,toDisplayString as c,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as y,vShow as h}from"vue";import{NIcon as v,NPopover as M,NButton as k,NTooltip as C,NUpload as _,NUploadTrigger as x}from"naive-ui";import I from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as T,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as E}from"../utils/index.js";import{emojis as j}from"../utils/emoji.js";import{uploadFileApi as R}from"../api/index.js";import{CloseCircleOutline as q,CallOutline as L,VideocamOutline as D}from"@vicons/ionicons5";import{xor as O,cloneDeep as A}from"lodash-es";import{uuidGenerator as U}from"../../../../shared/utils/index.js";const V={key:0,class:"reference-content-box"},F={class:"reference-content"},K=["innerHTML"],G={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),H={class:"emoji-box"},N=l("span",null,"默认表情",-1),J={class:"list-box"},X=["src"],B=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),P=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),W={class:"btn-box"},Y=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Z=e({__name:"ChatFooter",setup(e){const Z=t(),$=t(""),{state:ee,sendMessage:te}=b(),{isGroupChat:ne}=w(ee),oe=t(!1);function ie(e,t=[]){const n=U(),o=[],i=t.length>0;ee.showVideo||ee.showMultipleVideo||(i?(o.push(...O(t,[ee.userInfo.id])),Object.assign(ee.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ee.showMultipleVideo=!0):te({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function se(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),le()))}function re(){var e,t;$.value=(null==(t=null==(e=Z.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ae(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ee.userInfo.id),i.append("file",n);const s=await R(i);if(!s)return console.log("上传失败");ce({chatMessageType:t,msg:t===T.FILE?o:s,url:s})}function le(){if(!($.value.length>2e3))return $.value?void ce({msg:$.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function ce(e){const{chatMessageType:t=T.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===T.FILE&&(i.fileUrl=o),[T.TEXT,T.BLEND].includes(t)&&(Z.value.innerHTML="",$.value=""),ee.currentReferenceMsg&&(i.referenceContent=A(ee.currentReferenceMsg),ee.currentReferenceMsg=null),te({content:i})}return n((()=>ee.currentReferenceMsg),(e=>{var t;e&&(null==(t=Z.value)||t.focus())})),(e,t)=>o((i(),s("section",{class:"chat-footer",style:r({cursor:a(ee).id?"default":"not-allowed"})},[a(ee).currentReferenceMsg?(i(),s("div",V,[l("div",F,[l("span",null,c(a(ee).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:a(E)(a(ee).currentReferenceMsg.content)},null,8,K)]),u(a(v),{component:a(q),onClick:t[0]||(t[0]=()=>a(ee).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",G,[u(a(M),{show:oe.value,"onUpdate:show":t[1]||(t[1]=e=>oe.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[S])),_:1})])),default:f((()=>[l("div",H,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),N,l("div",J,[(i(!0),s(p,null,m(a(j).default,(([e,t])=>(i(),g(a(C),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny",onClick:()=>function(e){oe.value=!1,ce({chatMessageType:T.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,X)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+c(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),u(a(k),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>ce({chatMessageType:a(T).EMOJI,msg:0}))},{icon:f((()=>[B])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ae(e,a(T).IMAGE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[P])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(a(_),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ae(e,a(T).FILE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),_:1})])),_:1}),a(ne)?(i(),s(p,{key:0},[u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[5]||(t[5]=e=>ie(a(T).AUDIO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"]),u(I,{options:a(ee).currentGroupUser,"default-value":[a(ee).userInfo.id],onComfirm:t[6]||(t[6]=e=>ie(a(T).VIDEO,e))},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})])),_:1},8,["options","default-value"])],64)):(i(),s(p,{key:1},[u(a(k),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ie(a(T).AUDIO))},{icon:f((()=>[u(a(v),{size:"18",component:a(L)},null,8,["component"])])),_:1}),u(a(k),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ie(a(T).VIDEO))},{icon:f((()=>[u(a(v),{size:"20",component:a(D)},null,8,["component"])])),_:1})],64))]),o(l("div",{ref_key:"inputRef",ref:Z,class:"input-box",contenteditable:"",onKeydown:se,onInput:re},null,544),[[h,a(ee).id]]),l("div",W,[Y,u(a(k),{type:"primary",round:"",disabled:!$.value,onClick:le},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[h,a(ee).id]])}});export{Z as default};
|
@@ -1,24 +1,43 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, {
|
3
3
|
state: import("../types").IState;
|
4
|
+
isGroupChat: import("vue").ComputedRef<boolean>;
|
4
5
|
showChatSet: import("vue").Ref<boolean>;
|
5
6
|
showChatFile: import("vue").Ref<boolean>;
|
6
7
|
chatFileType: import("vue").Ref<string>;
|
7
8
|
showChatRecord: import("vue").Ref<boolean>;
|
9
|
+
chatAddProps: import("vue").ComputedRef<{
|
10
|
+
mode: string;
|
11
|
+
disabledIds: any[];
|
12
|
+
defaultValue?: undefined;
|
13
|
+
} | {
|
14
|
+
mode: string;
|
15
|
+
defaultValue: any[];
|
16
|
+
disabledIds?: undefined;
|
17
|
+
}>;
|
8
18
|
handleOpenChatFile: (type: string) => void;
|
9
19
|
NAvatar: any;
|
20
|
+
NIcon: any;
|
10
21
|
NButton: any;
|
11
22
|
PersonProfile: import("vue").DefineComponent<{
|
12
23
|
userId: {
|
13
24
|
type: StringConstructor;
|
14
25
|
required: true;
|
15
26
|
};
|
27
|
+
disabled: {
|
28
|
+
type: BooleanConstructor;
|
29
|
+
default: boolean;
|
30
|
+
};
|
16
31
|
}, {
|
17
32
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
18
33
|
userId: {
|
19
34
|
type: StringConstructor;
|
20
35
|
required: true;
|
21
36
|
};
|
37
|
+
disabled: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
default: boolean;
|
40
|
+
};
|
22
41
|
}>> & {
|
23
42
|
onClose?: ((...args: any[]) => any) | undefined;
|
24
43
|
}>>;
|
@@ -61,15 +80,22 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
61
80
|
type: StringConstructor;
|
62
81
|
required: true;
|
63
82
|
};
|
83
|
+
disabled: {
|
84
|
+
type: BooleanConstructor;
|
85
|
+
default: boolean;
|
86
|
+
};
|
64
87
|
}>> & {
|
65
88
|
onClose?: ((...args: any[]) => any) | undefined;
|
66
|
-
}, {
|
89
|
+
}, {
|
90
|
+
disabled: boolean;
|
91
|
+
}>;
|
67
92
|
ChatSet: import("vue").DefineComponent<{}, {
|
68
93
|
attrs: {
|
69
94
|
[x: string]: unknown;
|
70
95
|
};
|
71
96
|
state: import("../types").IState;
|
72
97
|
setCurrentSessionItem: (item: AnyObject) => void;
|
98
|
+
isGroupChat: import("vue").ComputedRef<boolean>;
|
73
99
|
handleTopping: (value: boolean) => Promise<void>;
|
74
100
|
closeUserDetail: () => void;
|
75
101
|
NDrawer: any;
|
@@ -83,12 +109,20 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
83
109
|
type: StringConstructor;
|
84
110
|
required: true;
|
85
111
|
};
|
112
|
+
disabled: {
|
113
|
+
type: BooleanConstructor;
|
114
|
+
default: boolean;
|
115
|
+
};
|
86
116
|
}, {
|
87
117
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
88
118
|
userId: {
|
89
119
|
type: StringConstructor;
|
90
120
|
required: true;
|
91
121
|
};
|
122
|
+
disabled: {
|
123
|
+
type: BooleanConstructor;
|
124
|
+
default: boolean;
|
125
|
+
};
|
92
126
|
}>> & {
|
93
127
|
onClose?: ((...args: any[]) => any) | undefined;
|
94
128
|
}>>;
|
@@ -131,9 +165,15 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
131
165
|
type: StringConstructor;
|
132
166
|
required: true;
|
133
167
|
};
|
168
|
+
disabled: {
|
169
|
+
type: BooleanConstructor;
|
170
|
+
default: boolean;
|
171
|
+
};
|
134
172
|
}>> & {
|
135
173
|
onClose?: ((...args: any[]) => any) | undefined;
|
136
|
-
}, {
|
174
|
+
}, {
|
175
|
+
disabled: boolean;
|
176
|
+
}>;
|
137
177
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
138
178
|
ChatFile: import("vue").DefineComponent<{
|
139
179
|
type: {
|
@@ -224,7 +264,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
224
264
|
lastSendTime: string;
|
225
265
|
};
|
226
266
|
handleSearch: () => Promise<void>;
|
227
|
-
options: import("vue").ComputedRef<AnyObject[]>;
|
228
267
|
resetAndSearch: () => void;
|
229
268
|
startDateDisabled: (ts: number) => boolean;
|
230
269
|
endDateDisabled: (ts: number) => boolean;
|
@@ -329,5 +368,92 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
329
368
|
}>>, {
|
330
369
|
visible: boolean;
|
331
370
|
}>;
|
371
|
+
ChatAdd: import("vue").DefineComponent<{
|
372
|
+
title: {
|
373
|
+
type: StringConstructor;
|
374
|
+
default: string;
|
375
|
+
};
|
376
|
+
mode: {
|
377
|
+
type: StringConstructor;
|
378
|
+
default: string;
|
379
|
+
};
|
380
|
+
options: {
|
381
|
+
type: import("vue").PropType<AnyObject[]>;
|
382
|
+
};
|
383
|
+
disabledIds: {
|
384
|
+
type: import("vue").PropType<string[]>;
|
385
|
+
};
|
386
|
+
defaultValue: {
|
387
|
+
type: import("vue").PropType<string[]>;
|
388
|
+
};
|
389
|
+
}, {
|
390
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
391
|
+
title: {
|
392
|
+
type: StringConstructor;
|
393
|
+
default: string;
|
394
|
+
};
|
395
|
+
mode: {
|
396
|
+
type: StringConstructor;
|
397
|
+
default: string;
|
398
|
+
};
|
399
|
+
options: {
|
400
|
+
type: import("vue").PropType<AnyObject[]>;
|
401
|
+
};
|
402
|
+
disabledIds: {
|
403
|
+
type: import("vue").PropType<string[]>;
|
404
|
+
};
|
405
|
+
defaultValue: {
|
406
|
+
type: import("vue").PropType<string[]>;
|
407
|
+
};
|
408
|
+
}>> & {
|
409
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
410
|
+
}>>;
|
411
|
+
emit: (event: "comfirm", ...args: any[]) => void;
|
412
|
+
state: import("../types").IState;
|
413
|
+
showModal: import("vue").Ref<boolean>;
|
414
|
+
checkedIds: import("vue").Ref<(string | number)[]>;
|
415
|
+
options: import("vue").Ref<AnyObject[]>;
|
416
|
+
groupName: import("vue").Ref<string>;
|
417
|
+
btnDisabled: import("vue").ComputedRef<boolean>;
|
418
|
+
handlePositiveClick: () => Promise<void>;
|
419
|
+
renderSourceLabel: ({ option }: {
|
420
|
+
option: AnyObject;
|
421
|
+
}) => JSX.Element;
|
422
|
+
renderTargetList: (props: {
|
423
|
+
onCheck: (checkedValueList: (string | number)[]) => void;
|
424
|
+
checkedOptions: AnyObject[];
|
425
|
+
pattern: string;
|
426
|
+
}) => JSX.Element | null;
|
427
|
+
NModal: any;
|
428
|
+
NButton: any;
|
429
|
+
NTransfer: any;
|
430
|
+
NIcon: any;
|
431
|
+
NInput: any;
|
432
|
+
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<{}>>, {}>;
|
433
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
434
|
+
title: {
|
435
|
+
type: StringConstructor;
|
436
|
+
default: string;
|
437
|
+
};
|
438
|
+
mode: {
|
439
|
+
type: StringConstructor;
|
440
|
+
default: string;
|
441
|
+
};
|
442
|
+
options: {
|
443
|
+
type: import("vue").PropType<AnyObject[]>;
|
444
|
+
};
|
445
|
+
disabledIds: {
|
446
|
+
type: import("vue").PropType<string[]>;
|
447
|
+
};
|
448
|
+
defaultValue: {
|
449
|
+
type: import("vue").PropType<string[]>;
|
450
|
+
};
|
451
|
+
}>> & {
|
452
|
+
onComfirm?: ((...args: any[]) => any) | undefined;
|
453
|
+
}, {
|
454
|
+
mode: string;
|
455
|
+
title: string;
|
456
|
+
}>;
|
457
|
+
PersonAddOutline: 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<{}>>, {}>;
|
332
458
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
333
459
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as s,Fragment as a,unref as n,createElementVNode as r,createVNode as l,withCtx as c,toDisplayString as u,normalizeProps as m,guardReactiveProps as h,createCommentVNode as d}from"vue";import{NAvatar as v,NButton as p,NIcon as f}from"naive-ui";import{useState as y}from"../hooks/useState.js";import{useSession as _}from"../hooks/useSession.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import j from"./PersonProfile.vue.js";import w from"./ChatSet.vue.js";import C from"./ChatFile.vue.js";import b from"./ChatRecord.vue.js";import g from"./ChatAdd.vue.js";import{PersonAddOutline as k}from"@vicons/ionicons5";const z={key:0,class:"chat-header box-shadow"},S={class:"chat-header__left"},q={class:"name"},I={class:"chat-header__right"},U=r("i",{class:"chat--iconfont chat--icon-image"},null,-1),x=r("i",{class:"chat--iconfont chat--icon-folder"},null,-1),G=r("i",{class:"chat--iconfont chat--icon-list-search"},null,-1),P=r("i",{class:"chat--iconfont chat--icon-set"},null,-1);var A=e({__name:"ChatHeader",setup(e){const{state:A}=y(),{isGroupChat:F}=_(A),H=o(!1),R=o(!1),V=o("image"),B=o(!1),D=i((()=>{const e=A.currentGroupUser.map((e=>e.id));return F.value?{mode:"join",disabledIds:e}:{mode:"create",defaultValue:e}}));function E(e){V.value=e,R.value=!0}return(e,o)=>(t(),s(a,null,[n(A).id?(t(),s("section",z,[r("div",S,[l(j,{"user-id":n(A).currentSessionItem.receiver,disabled:n(F)},{trigger:c((()=>[l(n(v),{round:"",size:30,src:n(A).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-id","disabled"]),r("span",q,u(n(A).currentSessionItem.name),1)]),r("div",I,[l(n(p),{quaternary:"",size:"tiny",onClick:o[0]||(o[0]=()=>E("image"))},{icon:c((()=>[U])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[1]||(o[1]=()=>E("file"))},{icon:c((()=>[x])),_:1}),l(g,m(h(n(D))),{trigger:c((()=>[l(n(p),{quaternary:"",size:"tiny"},{icon:c((()=>[l(n(f),{size:"18",component:n(k)},null,8,["component"])])),_:1})])),_:1},16),l(n(p),{quaternary:"",size:"tiny",onClick:o[2]||(o[2]=()=>B.value=!0)},{icon:c((()=>[G])),_:1}),l(n(p),{quaternary:"",size:"tiny",onClick:o[3]||(o[3]=()=>H.value=!0)},{icon:c((()=>[P])),_:1})])])):d("v-if",!0),l(w,{show:H.value,"onUpdate:show":o[4]||(o[4]=e=>H.value=e)},null,8,["show"]),l(C,{show:R.value,"onUpdate:show":o[5]||(o[5]=e=>R.value=e),type:V.value,visible:R.value},null,8,["show","type","visible"]),l(b,{show:B.value,"onUpdate:show":o[6]||(o[6]=e=>B.value=e),visible:B.value},null,8,["show","visible"])],64))}});export{A as default};
|