cnhis-design-vue 3.2.15-beta.5 → 3.2.15-beta.9
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/classification/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/iho-chat/index.d.ts +256 -18
- package/es/components/iho-chat/src/Index.vue.d.ts +256 -18
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +34 -34
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +206 -3
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/userItemRender.d.ts +18 -0
- package/es/components/iho-chat/src/components/userItemRender.js +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +2 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +2 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1,52 +1,37 @@
|
|
1
|
-
import { PropType } from 'vue';
|
2
|
-
import { AnyObject } from '../../../../shared/types';
|
3
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
4
2
|
listRef: import("vue").Ref<any>;
|
5
3
|
inputRef: import("vue").Ref<any>;
|
6
4
|
showSearch: import("vue").Ref<boolean>;
|
7
5
|
keyword: import("vue").Ref<string>;
|
8
|
-
cssVars: import("vue").ComputedRef<AnyObject>;
|
6
|
+
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
9
7
|
state: {
|
8
|
+
filterable: boolean;
|
10
9
|
orgId: string | number;
|
11
|
-
currentSessionItem: AnyObject;
|
10
|
+
currentSessionItem: import("../../../../shared/types").AnyObject;
|
12
11
|
id: string;
|
13
|
-
userInfo: AnyObject;
|
14
|
-
msgList: AnyObject[];
|
15
|
-
currentMsg: AnyObject;
|
12
|
+
userInfo: import("../../../../shared/types").AnyObject;
|
13
|
+
msgList: import("../../../../shared/types").AnyObject[];
|
14
|
+
currentMsg: import("../../../../shared/types").AnyObject;
|
16
15
|
isAppendMsg: boolean;
|
17
|
-
sessionList: AnyObject[];
|
16
|
+
sessionList: import("../../../../shared/types").AnyObject[];
|
18
17
|
isChangeSession: boolean;
|
19
|
-
updateSessionItem: AnyObject;
|
18
|
+
updateSessionItem: import("../../../../shared/types").AnyObject;
|
20
19
|
isUpdateSession: boolean;
|
21
|
-
currentReferenceMsg: AnyObject | null;
|
22
|
-
currentReEditMsg: AnyObject | null;
|
20
|
+
currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
|
21
|
+
currentReEditMsg: import("../../../../shared/types").AnyObject | null;
|
23
22
|
showVideo: boolean;
|
24
|
-
currentAVMsg: AnyObject;
|
25
|
-
currentGroupUser: AnyObject[];
|
23
|
+
currentAVMsg: import("../../../../shared/types").AnyObject;
|
24
|
+
currentGroupUser: import("../../../../shared/types").AnyObject[];
|
26
25
|
showMultipleVideo: boolean;
|
27
26
|
};
|
28
|
-
|
29
|
-
userList: import("vue").Ref<AnyObject[]>;
|
27
|
+
userList: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
|
30
28
|
handleInput: () => void;
|
31
29
|
currentTabValue: import("vue").Ref<string>;
|
32
|
-
|
33
|
-
item: {
|
34
|
-
type: PropType<AnyObject>;
|
35
|
-
default: () => {};
|
36
|
-
};
|
37
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
38
|
-
item: {
|
39
|
-
type: PropType<AnyObject>;
|
40
|
-
default: () => {};
|
41
|
-
};
|
42
|
-
}>>, {
|
43
|
-
item: AnyObject;
|
44
|
-
}>;
|
45
|
-
groupList: import("vue").ComputedRef<AnyObject[]>;
|
30
|
+
groupList: import("vue").ComputedRef<import("../../../../shared/types").AnyObject[]>;
|
46
31
|
showNoData: import("vue").ComputedRef<boolean>;
|
47
32
|
showAllNoData: import("vue").ComputedRef<boolean>;
|
48
33
|
showGroupNoData: import("vue").ComputedRef<boolean>;
|
49
|
-
|
34
|
+
handleClose: () => void;
|
50
35
|
NPopover: any;
|
51
36
|
NButton: any;
|
52
37
|
NInput: any;
|
@@ -61,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
61
46
|
default: string;
|
62
47
|
};
|
63
48
|
config: {
|
64
|
-
type: PropType<AnyObject>;
|
49
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
65
50
|
default: () => {
|
66
51
|
title: string;
|
67
52
|
content: string;
|
@@ -74,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
74
59
|
default: string;
|
75
60
|
};
|
76
61
|
config: {
|
77
|
-
type: PropType<AnyObject>;
|
62
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
78
63
|
default: () => {
|
79
64
|
title: string;
|
80
65
|
content: string;
|
@@ -98,7 +83,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
98
83
|
default: string;
|
99
84
|
};
|
100
85
|
config: {
|
101
|
-
type: PropType<AnyObject>;
|
86
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
102
87
|
default: () => {
|
103
88
|
title: string;
|
104
89
|
content: string;
|
@@ -108,7 +93,22 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
108
93
|
onReloadPage?: ((...args: any[]) => any) | undefined;
|
109
94
|
}, {
|
110
95
|
type: string;
|
111
|
-
config: AnyObject;
|
96
|
+
config: import("../../../../shared/types").AnyObject;
|
112
97
|
}>>;
|
98
|
+
userItemRender: import("vue").DefineComponent<{
|
99
|
+
item: {
|
100
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
101
|
+
default: () => {};
|
102
|
+
};
|
103
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
104
|
+
item: {
|
105
|
+
type: import("vue").PropType<import("../../../../shared/types").AnyObject>;
|
106
|
+
default: () => {};
|
107
|
+
};
|
108
|
+
}>> & {
|
109
|
+
"onItem-click"?: ((...args: any[]) => any) | undefined;
|
110
|
+
}, {
|
111
|
+
item: import("../../../../shared/types").AnyObject;
|
112
|
+
}>;
|
113
113
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
114
114
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as t,computed as n,watch as a,nextTick as o,openBlock as i,createBlock as u,unref as r,normalizeStyle as s,withCtx as d,createVNode as c,createTextVNode as v,createElementBlock as p,Fragment as g,renderList as f,normalizeClass as w,createCommentVNode as m,withDirectives as y,vShow as h}from"vue";import{NPopover as k,NButton as C,NIcon as L,NInput as _,NTabs as B,NTabPane as j,NDivider as x}from"naive-ui";import{SearchOutline as I}from"@vicons/ionicons5";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import"../api/index.js";import{isGroup as R}from"../utils/index.js";import{trim as U}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as z}from"../hooks/useSearchUserList.js";import D from"../../../default-page/index.js";import S from"./userItemRender.js";var V,$;const q=e("div",{class:"title"},(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.510"))||"联系人",-1),A=e("div",{class:"title"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.575"))||"我的群组",-1),E={class:"user-list-wrapper"};var F=l({__name:"ChatSearch",setup(l){const V=t(),$=t(),F=t(!1),G=t(""),{cssVars:H,state:J}=b(),{userList:K,handleInput:M}=z({wrapperRef:V,keywordRef:G}),N=t("all"),O=n((()=>(G.value||"").replace(/^\s+|\s+$/g,"")?J.sessionList.filter((e=>R(e)&&(null==e?void 0:e.name.includes(G.value)))):[])),P=n((()=>!K.value.length&&!!U(G.value||""))),Q=n((()=>!K.value.length&&!O.value.length&&!!U(G.value||""))),T=n((()=>!O.value.length&&!!U(G.value||"")));function W(){F.value=!1}return a((()=>F.value),(async e=>{var l;e&&(await o(),null==(l=$.value)||l.focus())})),(l,t)=>(i(),u(r(k),{raw:"","content-class":"search-content",class:"search-wrapper",style:s(r(H)),show:F.value,"onUpdate:show":t[4]||(t[4]=e=>F.value=e),placement:"top",trigger:"click","display-directive":"show","show-arrow":!1,delay:0,overlap:""},{trigger:d((()=>[c(r(C),{color:"#ffffff4D",class:"search-trigger-btn"},{icon:d((()=>[c(r(L),{component:r(I),color:"#ffffff80"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.80"))||"搜索联系人")]})),_:1})])),default:d((()=>[c(r(_),{ref_key:"inputRef",ref:$,size:"small",clearable:"",autofocus:"",value:G.value,"onUpdate:value":[t[0]||(t[0]=e=>G.value=e),r(M)]},{prefix:d((()=>[c(r(L),{color:"#ffffff80",component:r(I)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),c(r(B),{type:"line",animated:"",value:N.value,"onUpdate:value":t[3]||(t[3]=e=>N.value=e)},{default:d((()=>{var l,n,a;return[c(r(j),{name:"all",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.571"))||"综合","display-directive":"show",style:{padding:"0 10px 10px"}},{default:d((()=>{var e;return[r(K).length>0?(i(),p(g,{key:0},[q,(i(!0),p(g,null,f(r(K),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(K).length<4?l===r(K).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(K).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[1]||(t[1]=()=>N.value="user")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.573"))||"查看更多联系人")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),r(K).length&&r(O).length?(i(),u(r(x),{key:1})):m("v-if",!0),r(O).length>0?(i(),p(g,{key:2},[A,(i(!0),p(g,null,f(r(O),((e,l)=>(i(),p(g,{key:e.id},[l<3?(i(),u(r(S),{key:0,item:e,class:w({last:r(O).length<4?l===r(O).length-1:2===l}),onItemClick:W},null,8,["item","class"])):m("v-if",!0)],64)))),128)),r(O).length>3?(i(),u(r(C),{key:0,text:"",type:"primary",onClick:t[2]||(t[2]=()=>N.value="group")},{icon:d((()=>[c(r(L),{component:r(I),size:"16"},null,8,["component"])])),default:d((()=>{var e;return[v((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.574"))||"查看更多群组")]})),_:1})):m("v-if",!0)],64)):m("v-if",!0),y(c(r(D),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(Q)]])]})),_:1}),c(r(j),{name:"user",tab:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.510"))||"联系人","display-directive":"show"},{default:d((()=>{var l;return[e("div",{class:"user-list-wrapper",ref_key:"listRef",ref:V},[(i(!0),p(g,null,f(r(K),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(P)]])],512)]})),_:1}),c(r(j),{name:"group",tab:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.572"))||"群组","display-directive":"show"},{default:d((()=>{var l;return[e("div",E,[(i(!0),p(g,null,f(r(O),(e=>(i(),u(r(S),{key:e.id,item:e,onItemClick:W},null,8,["item"])))),128)),y(c(r(D),{config:{title:" ",content:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[h,r(T)]])])]})),_:1})]})),_:1},8,["value"])])),_:1},8,["style","show"]))}});export{F as default};
|
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
[x: string]: unknown;
|
6
6
|
};
|
7
7
|
state: {
|
8
|
+
filterable: boolean;
|
8
9
|
orgId: string | number;
|
9
10
|
currentSessionItem: AnyObject;
|
10
11
|
id: string;
|
@@ -79,6 +80,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
79
80
|
}>>;
|
80
81
|
emit: (event: "close", ...args: any[]) => void;
|
81
82
|
state: {
|
83
|
+
filterable: boolean;
|
82
84
|
orgId: string | number;
|
83
85
|
currentSessionItem: AnyObject;
|
84
86
|
id: string;
|
@@ -194,6 +196,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
194
196
|
}>>;
|
195
197
|
emit: (event: "comfirm", ...args: any[]) => void;
|
196
198
|
state: {
|
199
|
+
filterable: boolean;
|
197
200
|
orgId: string | number;
|
198
201
|
currentSessionItem: AnyObject;
|
199
202
|
id: string;
|
@@ -7,6 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
7
7
|
name: string;
|
8
8
|
}[]>;
|
9
9
|
state: {
|
10
|
+
filterable: boolean;
|
10
11
|
orgId: string | number;
|
11
12
|
currentSessionItem: AnyObject;
|
12
13
|
id: string;
|
@@ -124,6 +125,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
124
125
|
}>>;
|
125
126
|
emit: (event: "comfirm", ...args: any[]) => void;
|
126
127
|
state: {
|
128
|
+
filterable: boolean;
|
127
129
|
orgId: string | number;
|
128
130
|
currentSessionItem: AnyObject;
|
129
131
|
id: string;
|
@@ -11,8 +11,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
11
11
|
unreadSessionKeys: string[];
|
12
12
|
flexWidth: import("vue").Ref<number>;
|
13
13
|
listBoxRef: import("vue").Ref<HTMLElement | undefined>;
|
14
|
-
|
15
|
-
filterList: import("vue").Ref<{
|
14
|
+
filterListByTag: import("vue").Ref<{
|
16
15
|
label: string;
|
17
16
|
key: string;
|
18
17
|
}[]>;
|
@@ -21,7 +20,15 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
21
20
|
menuPosition: any;
|
22
21
|
sessionId: import("vue").Ref<any>;
|
23
22
|
currentFilterKey: import("vue").Ref<string>;
|
23
|
+
datePickerRef: import("vue").Ref<any>;
|
24
|
+
inputRef: import("vue").Ref<any>;
|
25
|
+
dateRange: import("vue").Ref<any>;
|
26
|
+
keyword: import("vue").Ref<string>;
|
27
|
+
showSearch: import("vue").Ref<boolean>;
|
28
|
+
filterList: import("vue").Ref<AnyObject[]>;
|
29
|
+
handleInput: () => void;
|
24
30
|
state: {
|
31
|
+
filterable: boolean;
|
25
32
|
orgId: string | number;
|
26
33
|
currentSessionItem: AnyObject;
|
27
34
|
id: string;
|
@@ -52,10 +59,16 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
52
59
|
showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
|
53
60
|
handleContextmenu: (event: MouseEvent, id: string) => Promise<void>;
|
54
61
|
handleSelect: (key: string, session: AnyObject) => Promise<void>;
|
55
|
-
|
62
|
+
handleUpdateShow: (value: boolean) => void;
|
63
|
+
handleClickoutside: (e: Event) => void;
|
64
|
+
handleUpdateDate: (value: string[]) => void;
|
65
|
+
handleSearch: () => void;
|
56
66
|
NBadge: any;
|
57
67
|
NAvatar: any;
|
68
|
+
NInput: any;
|
58
69
|
NTag: any;
|
70
|
+
NIcon: any;
|
71
|
+
NPopover: any;
|
59
72
|
ContextMenu: import("vue").DefineComponent<{
|
60
73
|
type: {
|
61
74
|
type: StringConstructor;
|
@@ -99,5 +112,195 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
99
112
|
};
|
100
113
|
formatTime: typeof formatTime;
|
101
114
|
STATUS: typeof STATUS;
|
115
|
+
CDatePicker: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
116
|
+
updateUnchangedValue: {
|
117
|
+
type: BooleanConstructor;
|
118
|
+
};
|
119
|
+
onConfirm: {
|
120
|
+
type: FunctionConstructor;
|
121
|
+
};
|
122
|
+
formattedValue: {
|
123
|
+
type: import("vue").PropType<(string | [string, string]) | null | undefined>;
|
124
|
+
};
|
125
|
+
placeholder: {
|
126
|
+
type: StringConstructor;
|
127
|
+
};
|
128
|
+
allowedInvalidValue: {
|
129
|
+
type: StringConstructor;
|
130
|
+
};
|
131
|
+
to: {
|
132
|
+
type: import("vue").PropType<string | false | HTMLElement>;
|
133
|
+
default: string;
|
134
|
+
};
|
135
|
+
holidays: {
|
136
|
+
type: import("vue").PropType<Date[]>;
|
137
|
+
default: () => never[];
|
138
|
+
};
|
139
|
+
type: {
|
140
|
+
type: StringConstructor;
|
141
|
+
default: string;
|
142
|
+
};
|
143
|
+
}, {
|
144
|
+
attrs: {
|
145
|
+
[x: string]: unknown;
|
146
|
+
};
|
147
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
148
|
+
updateUnchangedValue: {
|
149
|
+
type: BooleanConstructor;
|
150
|
+
};
|
151
|
+
onConfirm: {
|
152
|
+
type: FunctionConstructor;
|
153
|
+
};
|
154
|
+
formattedValue: {
|
155
|
+
type: import("vue").PropType<(string | [string, string]) | null | undefined>;
|
156
|
+
};
|
157
|
+
placeholder: {
|
158
|
+
type: StringConstructor;
|
159
|
+
};
|
160
|
+
allowedInvalidValue: {
|
161
|
+
type: StringConstructor;
|
162
|
+
};
|
163
|
+
to: {
|
164
|
+
type: import("vue").PropType<string | false | HTMLElement>;
|
165
|
+
default: string;
|
166
|
+
};
|
167
|
+
holidays: {
|
168
|
+
type: import("vue").PropType<Date[]>;
|
169
|
+
default: () => never[];
|
170
|
+
};
|
171
|
+
type: {
|
172
|
+
type: StringConstructor;
|
173
|
+
default: string;
|
174
|
+
};
|
175
|
+
}>> & {
|
176
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
177
|
+
}>>;
|
178
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
179
|
+
datePickerRef: import("vue").Ref<AnyObject | null>;
|
180
|
+
panelInstRef: import("vue").Ref<null>;
|
181
|
+
placeholderRef: import("vue").Ref<any>;
|
182
|
+
oldValue: string;
|
183
|
+
currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
|
184
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
185
|
+
formatRef: import("vue").ComputedRef<string>;
|
186
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
187
|
+
focus: () => any;
|
188
|
+
blur: () => any;
|
189
|
+
handleConfirm: (target: HTMLInputElement) => void;
|
190
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
191
|
+
watchers: import("../../../../shared/types").AnyFn[];
|
192
|
+
stopWatcher: () => void;
|
193
|
+
setHoliday: (show: boolean) => Promise<void>;
|
194
|
+
onConfirm: (...args: any[]) => Promise<void>;
|
195
|
+
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
196
|
+
setShortcutValue: (type: "month" | "week") => Promise<void>;
|
197
|
+
NDatePicker: any;
|
198
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
199
|
+
updateUnchangedValue: {
|
200
|
+
type: BooleanConstructor;
|
201
|
+
};
|
202
|
+
onConfirm: {
|
203
|
+
type: FunctionConstructor;
|
204
|
+
};
|
205
|
+
formattedValue: {
|
206
|
+
type: import("vue").PropType<(string | [string, string]) | null | undefined>;
|
207
|
+
};
|
208
|
+
placeholder: {
|
209
|
+
type: StringConstructor;
|
210
|
+
};
|
211
|
+
allowedInvalidValue: {
|
212
|
+
type: StringConstructor;
|
213
|
+
};
|
214
|
+
to: {
|
215
|
+
type: import("vue").PropType<string | false | HTMLElement>;
|
216
|
+
default: string;
|
217
|
+
};
|
218
|
+
holidays: {
|
219
|
+
type: import("vue").PropType<Date[]>;
|
220
|
+
default: () => never[];
|
221
|
+
};
|
222
|
+
type: {
|
223
|
+
type: StringConstructor;
|
224
|
+
default: string;
|
225
|
+
};
|
226
|
+
}>> & {
|
227
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
228
|
+
}, {
|
229
|
+
type: string;
|
230
|
+
updateUnchangedValue: boolean;
|
231
|
+
to: string | false | HTMLElement;
|
232
|
+
holidays: Date[];
|
233
|
+
}>>;
|
234
|
+
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<{}>>, {}>;
|
235
|
+
userItemRender: import("vue").DefineComponent<{
|
236
|
+
item: {
|
237
|
+
type: import("vue").PropType<AnyObject>;
|
238
|
+
default: () => {};
|
239
|
+
};
|
240
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
241
|
+
item: {
|
242
|
+
type: import("vue").PropType<AnyObject>;
|
243
|
+
default: () => {};
|
244
|
+
};
|
245
|
+
}>> & {
|
246
|
+
"onItem-click"?: ((...args: any[]) => any) | undefined;
|
247
|
+
}, {
|
248
|
+
item: AnyObject;
|
249
|
+
}>;
|
250
|
+
DefaultPage: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
251
|
+
type: {
|
252
|
+
type: StringConstructor;
|
253
|
+
default: string;
|
254
|
+
};
|
255
|
+
config: {
|
256
|
+
type: import("vue").PropType<AnyObject>;
|
257
|
+
default: () => {
|
258
|
+
title: string;
|
259
|
+
content: string;
|
260
|
+
};
|
261
|
+
};
|
262
|
+
}, {
|
263
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
264
|
+
type: {
|
265
|
+
type: StringConstructor;
|
266
|
+
default: string;
|
267
|
+
};
|
268
|
+
config: {
|
269
|
+
type: import("vue").PropType<AnyObject>;
|
270
|
+
default: () => {
|
271
|
+
title: string;
|
272
|
+
content: string;
|
273
|
+
};
|
274
|
+
};
|
275
|
+
}>> & {
|
276
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
277
|
+
}>>;
|
278
|
+
emit: (event: "reloadPage", ...args: any[]) => void;
|
279
|
+
configResult: import("vue").ComputedRef<{
|
280
|
+
title: string;
|
281
|
+
content: string;
|
282
|
+
img: string;
|
283
|
+
}>;
|
284
|
+
reloadPage: () => void;
|
285
|
+
NIcon: any;
|
286
|
+
Refresh: 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<{}>>, {}>;
|
287
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
288
|
+
type: {
|
289
|
+
type: StringConstructor;
|
290
|
+
default: string;
|
291
|
+
};
|
292
|
+
config: {
|
293
|
+
type: import("vue").PropType<AnyObject>;
|
294
|
+
default: () => {
|
295
|
+
title: string;
|
296
|
+
content: string;
|
297
|
+
};
|
298
|
+
};
|
299
|
+
}>> & {
|
300
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
301
|
+
}, {
|
302
|
+
type: string;
|
303
|
+
config: AnyObject;
|
304
|
+
}>>;
|
102
305
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
103
306
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as
|
1
|
+
import{defineComponent as e,ref as t,computed as l,withDirectives as n,openBlock as i,createElementBlock as a,normalizeStyle as o,unref as s,createVNode as u,withCtx as r,createElementVNode as d,Fragment as v,renderList as c,createBlock as p,vShow as m,createCommentVNode as f,createTextVNode as g,toDisplayString as w,withModifiers as y,normalizeClass as k,nextTick as h}from"vue";import{NPopover as _,NInput as x,NIcon as C,NTag as M,NAvatar as R,NBadge as b}from"naive-ui";import j from"./ContextMenu.js";import{useData as D}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as E}from"../constants/index.js";import{toppingSessionApi as L,updateStatusApi as B}from"../api/index.js";import{listSort as I,formatTime as T}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";import S from"../../../date-picker/index.js";import{SearchOutline as V}from"@vicons/ionicons5";import $ from"./userItemRender.js";import O from"../../../default-page/index.js";import{useDebounceFn as U}from"@vueuse/core";import{isBefore as H,isAfter as z}from"date-fns";const K={key:0,class:"sider-list__filter"},P={class:"user-list-wrapper"},W={class:"sider-list__tags box-shadow"},A=["onClick","onContextmenu"],X={class:"avatar-right"},Y={class:"name"},q={class:"msg-tip"},F={class:"msg-tip__content"},G={key:0},J=["innerHTML"];var Q=e({__name:"SiderList",setup(e){var Q,Z,ee;const te="all",le="unread",ne="ended";let ie=[];const ae=t(300),oe=t(),se=t([{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.123"))||"全部",key:te},{label:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.124"))||"未读",key:le},{label:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.77"))||"结束",key:ne}]),ue=t(),re=t(!1),de=t({left:0,top:0}),ve=t(),ce=t("all"),pe=t(),me=t(),fe=t(),ge=t(""),we=t(!1),ye=t([]),ke=U(Te,500),{state:he,unreadTotal:_e,openSession:xe,setUpdateSessionItem:Ce,setCurrentSessionItem:Me}=D(),Re=l((()=>Math.min(Math.max(ae.value,240),360))),be=l((()=>I(he.sessionList)));function je({distance:e}){ae.value=ae.value+e}function De(e,t=s(ce)){var l;return t===te||(t===le?ie.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:t===ne?e.status===E.ENDED:void 0)}async function Ee(e,t){try{if("topping"===e)return await L({id:t.id,topping:!(null==t?void 0:t.topping)}),void(he.id===t.id?Me({topping:!(null==t?void 0:t.topping)}):Ce({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await B({id:t.id,status:E.REMOVED}),he.id===t.id?Me({status:E.REMOVED}):Ce({...t,status:E.REMOVED}))}catch(e){}}function Le(e){we.value=e,e||(ge.value="",fe.value=null,ye.value=[])}function Be(e){var t,l,n,i,a;const o=null==(n=null==(l=null==(t=pe.value)?void 0:t.$datePicker)?void 0:l.panelInstRef)?void 0:n.$el;Le(!(!e.target||!(o&&o.contains(e.target)||(null==(i=me.value)?void 0:i.$el)&&(null==(a=me.value)?void 0:a.$el.contains(e.target)))))}function Ie(e){fe.value=e,Te()}function Te(){ge.value||fe.value?ye.value=be.value.filter((e=>{const t=e.name.includes(ge.value);if(!fe.value)return t;const[l,n]=fe.value,i=new Date(e.createdTime);return t&&H(i,new Date(n+" 23:59:59"))&&z(i,new Date(l+" 00:00:00"))})):ye.value=[]}return(e,t)=>n((i(),a("section",{class:"sider-list",style:o({width:s(Re)+"px"})},[s(he).filterable?(i(),a("div",K,[u(s(_),{raw:"","content-class":"search-content__sider",class:"search-wrapper",show:we.value,placement:"bottom-start","display-directive":"show","show-arrow":!1,onClickoutside:Be},{trigger:r((()=>[u(s(x),{ref_key:"inputRef",ref:me,placeholder:"请输入名称模糊搜索",value:ge.value,"onUpdate:value":t[0]||(t[0]=e=>ge.value=e),onInput:s(ke),onClick:t[1]||(t[1]=()=>Le(!0))},{prefix:r((()=>[u(s(C),{component:s(V)},null,8,["component"])])),_:1},8,["value","onInput"])])),default:r((()=>{var e;return[u(s(S),{ref_key:"datePickerRef",ref:pe,"formatted-value":fe.value,type:"daterange",clearable:"","onUpdate:formattedValue":Ie},null,8,["formatted-value"]),d("div",P,[(i(!0),a(v,null,c(ye.value,(e=>(i(),p(s($),{key:e.id,item:e,onItemClick:t[2]||(t[2]=()=>Le(!1))},null,8,["item"])))),128)),n(u(s(O),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[m,ye.value.length<1]])])]})),_:1},8,["show"])])):f("v-if",!0),d("div",W,[(i(!0),a(v,null,c(se.value,(e=>(i(),p(s(M),{type:ce.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,ce.value=t,void(t===le&&(ie=(be.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:r((()=>{return[g(w(e.label)+"("+w((t=e,t.key===ne?be.value.filter((e=>e.status===E.ENDED)).length:_e.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:oe},[(i(!0),a(v,null,c(s(be),(e=>{var t;return i(),a(v,{key:e.id},[e.status!==s(E).REMOVED?n((i(),a("div",{key:0,onClick:()=>s(xe)(e),onContextmenu:y((t=>async function(e,t){var l,n,i,a,o;ve.value=t,re.value=!0,await h();const{clientX:s,clientY:u}=e,{width:r=0,height:d=0,left:v=0,top:c=0}=(null==(l=oe.value)?void 0:l.getBoundingClientRect())||{},{width:p=100,height:m=80}=(null==(i=null==(n=ue.value)?void 0:n.$el)?void 0:i.getBoundingClientRect())||{},f=null!=(o=null==(a=oe.value)?void 0:a.scrollTop)?o:0,g={};s<v+r-(p+2)-5?g.left=s-v+5+"px":g.right=v+r-s+5+"px",c+d-u<=m+5?g.bottom=5-f+"px":g.top=u-c+f+5+"px",de.value=g}(t,e.id)),["prevent"]),class:k(["sider-list__box__item",{active:e.id===s(he).id},e.topping?"sider-list__box__item--top":""])},[u(s(R),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",X,[d("div",Y,[d("h4",null,w(e.name),1),d("span",null,w(e.lastMessage?s(T)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",q,[d("div",F,["WITHDRAWN"===e.lastMessageStatus?(i(),a("div",G,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(i(),a("div",{key:1,innerHTML:e.lastMessageContent},null,8,J))]),u(s(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,A)),[[m,De(e)]]):f("v-if",!0)],64)})),128)),u(s(j),{ref_key:"contextmenuRef",ref:ue,show:re.value,"onUpdate:show":t[3]||(t[3]=e=>re.value=e),type:"session",position:de.value,id:ve.value,onSelect:Ee},null,8,["show","position","id"])],512)],4)),[[s(N),{mode:"VR",onMove:je}]])}});export{Q as default};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { AnyObject } from '../../../../shared/types';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
item: {
|
5
|
+
type: PropType<AnyObject>;
|
6
|
+
default: () => {};
|
7
|
+
};
|
8
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
9
|
+
item: {
|
10
|
+
type: PropType<AnyObject>;
|
11
|
+
default: () => {};
|
12
|
+
};
|
13
|
+
}>> & {
|
14
|
+
"onItem-click"?: ((...args: any[]) => any) | undefined;
|
15
|
+
}, {
|
16
|
+
item: AnyObject;
|
17
|
+
}>;
|
18
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,createVNode as s}from"vue";import{NAvatar as t}from"naive-ui";import{useData as i}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{openSessionApi as r}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";var o=e({name:"UserItemRender",props:{item:{type:Object,default:()=>({})}},emits:["item-click"],setup(e,{attrs:o,slots:m,emit:n}){const{state:a,openSession:c,cssVars:l}=i();return()=>s("div",{class:"user-item",onClick:()=>async function(e){n("item-click");const s=a.sessionList.find((s=>e&&[s.receiver,s.id].includes(e)));let t=s;s||(t=await r({chatType:"SINGLE",receiver:e,sender:a.userInfo.id}));c(t)}(e.item.id)},[s(t,{round:!0,size:32,src:e.item.avatar,color:l.value["--c-primary-color"]},null),s("div",{class:"user-info"},[s("span",null,[e.item.name]),s("span",null,[e.item.deptName]),s("span",null,[e.item.post])])])}});export{o as default};
|
@@ -6,6 +6,7 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
|
|
6
6
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
7
7
|
stompClient: import("vue").Ref<ChatSock | undefined>;
|
8
8
|
state: {
|
9
|
+
filterable: boolean;
|
9
10
|
orgId: string | number;
|
10
11
|
currentSessionItem: AnyObject;
|
11
12
|
id: string;
|
@@ -51,6 +52,7 @@ export declare const useData: () => {
|
|
51
52
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
52
53
|
stompClient: import("vue").Ref<ChatSock | undefined>;
|
53
54
|
state: {
|
55
|
+
filterable: boolean;
|
54
56
|
orgId: string | number;
|
55
57
|
currentSessionItem: AnyObject;
|
56
58
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,reactive as s,
|
1
|
+
import{ref as e,reactive as s,toRef as t,computed as n,watch as i,inject as r,toRaw as o}from"vue";import{openSessionApi as a,updateStatusApi as c,groupUserApi as u}from"../api/index.js";import{promiseTimeout as m,useIntervalFn as d}from"@vueuse/core";import{isGroup as l,listSort as p,formatTime as g,transformMessage as f,getFileSize as h,simplifyMessage as S}from"../utils/index.js";import{cloneDeep as I,isArray as T,uniqBy as y}from"lodash-es";import{STATUS as v,MESSAGE_TYPE as L,CHAT_TYPE as M}from"../constants/index.js";import{useTheme as E}from"../../../../shared/hooks/useTheme.js";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";const C=Symbol("InjectionIChatData");function N(e){const{lastMessage:s,lastSenderName:t=""}=e,n=S(s)||"";return l(e)&&t?t+": "+n:n}function D(r,S){const C=e(),D=s({filterable:t(r,"filterable"),orgId:r.orgId,currentSessionItem:{},id:"",userInfo:{id:r.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),w=E(),j=n((()=>D.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),U=n((()=>l(D.currentSessionItem))),_=n((()=>{var e,s,t;return(null==(e=D.userInfo)?void 0:e.id)===(null==(t=null==(s=D.currentGroupUser)?void 0:s[0])?void 0:t.id)})),G=n((()=>{var e;return(null==(e=D.currentSessionItem)?void 0:e.status)===v.ENDED}));i((()=>j.value),(e=>{!async function s(t=0){if(t>2)return;const n=D.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?S("unread-message-update",e,p(n)):(await m(300),s(++t))}()})),i([()=>D.isChangeSession,()=>D.isUpdateSession],(([e,s])=>{e&&(X(D.currentSessionItem),D.currentSessionItem.status===v.REMOVED&&V(),D.isChangeSession=!1),s&&(X(D.updateSessionItem),D.isUpdateSession=!1)}),{immediate:!0});const{pause:R,resume:K,isActive:O}=d((()=>{const e=I(D.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=g(s).recordTime,!0)})),D.msgList=e,b()||R()}),6e4,{immediate:!1});function b(){return!!D.msgList.length&&D.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function k(e){var s;try{null==(s=C.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:D.currentSessionItem.chatType,receiver:D.currentSessionItem.receiver,...e}))}catch(e){}}function x(e){Object.assign(D.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?N({...e,chatType:e.chatType||D.currentSessionItem.chatType}):D.currentSessionItem.lastMessageContent}),D.isChangeSession=!0,D.id!==D.currentSessionItem.id&&(D.msgList=[],D.id=D.currentSessionItem.id)}function A(e){const s=D.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:N({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};D.updateSessionItem=s?{...I(s),...t}:t,D.isUpdateSession=!0}function V(){if(!D.id)return null;const{currentSessionItem:e}=D;return D.currentSessionItem={},D.msgList=[],D.id="",D.currentGroupUser=[],e}function B(e){D.sessionList=I(y(e,"id")),D.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:N(e)}),e.receiver===D.userInfo.id&&(e.unreadNum=0),e.chatType!==M.GROUP||e.name||u({id:e.receiver}).then((s=>{T(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function X(e){!e.id||D.sessionList.map((e=>e.id)).includes(e.id)?D.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==D.currentSessionItem.sessionKey&&s.sender&&s.sender!==D.userInfo.id&&(s.unreadNum=++t),!0}})):B([...D.sessionList,e])}return{cssVars:w,stompClient:C,state:D,unreadTotal:j,isGroupChat:U,isGroupLeader:_,isEnded:G,setMsgList:function(e=[]){R(),D.msgList=I(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),D.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:g(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[L.TEXT,L.TEXT,L.BLEND].includes(t)?f(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:g(e.sendTime).recordTime}),e.content.chatMessageType!==L.FILE||e.__size||h(e.content.fileUrl).then((s=>{e.__size=s}))})),b()&&K()},sendMessage:k,relayMessage:async function(e){const{checkedIds:s,remark:t,content:n}=e;for(let e=0;e<s.length;e++){const i=s[e],r=D.sessionList.find((e=>e.receiver===i));r||await a({chatType:M.SINGLE,receiver:i,sender:D.userInfo.id});const o=(null==r?void 0:r.chatType)||M.SINGLE;k({chatType:o,receiver:i,content:n}),await m(100),t&&k({chatType:o,receiver:i,content:{chatMessageType:L.TEXT,msg:t}}),await m(100)}},openSession:async function(e){try{const s="string"==typeof e?D.sessionList.find((s=>s.id===e)):e;if(!s)return;s.status===v.REMOVED&&(await c({id:s.id,status:v.ENABLED}),A({...s,status:v.ENABLED}),s.status=v.ENABLED);const t=D.currentSessionItem.sessionKey;if(x(s),t===D.currentSessionItem.sessionKey)return;if(U.value){const e=await u({id:s.receiver});D.currentGroupUser=T(e)?e:[]}else D.currentGroupUser=y([D.userInfo,{...I(s),id:s.receiver}],"id");S("session-change",{...o(D.currentSessionItem),userList:D.currentGroupUser.map((e=>o(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return D.id?D.currentSessionItem:null},setCurrentSessionItem:x,setUpdateSessionItem:A,setSessionList:B,emit:S}}const w=()=>r(C);export{C as InjectionIChatData,D as initData,w as useData};
|