cnhis-design-vue 3.4.0-beta.72 → 3.4.0-beta.73
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/README.md +87 -87
- package/es/components/iho-chat/index.d.ts +136 -98
- package/es/components/iho-chat/src/Index.vue.d.ts +136 -98
- package/es/components/iho-chat/src/Index.vue2.js +5 -3
- package/es/components/iho-chat/src/api/index.d.ts +89 -16
- package/es/components/iho-chat/src/api/index.js +8 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +4 -8
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +4 -8
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +21 -32
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -21
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +28 -29
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +4 -8
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +9 -8
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +48 -11
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/MessageMarkdown.vue.d.ts +74 -0
- package/es/components/iho-chat/src/components/MessageMarkdown.vue.js +6 -0
- package/es/components/iho-chat/src/components/MessageMarkdown.vue2.js +41 -0
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +4 -8
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +4 -8
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/Video.vue.d.ts +2 -4
- package/es/components/iho-chat/src/components/userItemRender.js +2 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +26 -10
- package/es/components/iho-chat/src/hooks/useData.js +30 -9
- package/es/components/iho-chat/src/hooks/useStreamOutput.d.ts +6 -0
- package/es/components/iho-chat/src/hooks/useStreamOutput.js +99 -0
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +2 -4
- package/es/components/iho-chat/src/hooks/useWebSocket.js +14 -4
- package/es/components/iho-chat/src/types/index.d.ts +2 -4
- package/es/components/iho-chat/src/utils/sseClient.d.ts +22 -0
- package/es/components/iho-chat/src/utils/sseClient.js +97 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
13
13
|
};
|
|
14
14
|
}>> & Readonly<{}> & {}>;
|
|
15
15
|
state: {
|
|
16
|
-
orgId: string
|
|
16
|
+
orgId: string;
|
|
17
17
|
currentSessionItem: AnyObject;
|
|
18
18
|
id: string;
|
|
19
19
|
userInfo: AnyObject;
|
|
@@ -41,11 +41,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
41
41
|
__time?: string | undefined;
|
|
42
42
|
__sendTime?: string | undefined;
|
|
43
43
|
}[];
|
|
44
|
-
currentMsg: AnyObject;
|
|
45
|
-
isAppendMsg: boolean;
|
|
46
44
|
sessionList: AnyObject[];
|
|
47
45
|
isChangeSession: boolean;
|
|
48
|
-
updateSessionItem: AnyObject;
|
|
49
46
|
isUpdateSession: boolean;
|
|
50
47
|
currentReferenceMsg: AnyObject | null;
|
|
51
48
|
currentReEditMsg: AnyObject | null;
|
|
@@ -63,6 +60,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
63
60
|
info: AnyObject | null;
|
|
64
61
|
};
|
|
65
62
|
isForward: boolean;
|
|
63
|
+
loading: boolean;
|
|
66
64
|
};
|
|
67
65
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
68
66
|
inviter: import("vue").Ref<any, any>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { AnyObject } from '../../../../shared/types';
|
|
3
|
+
import markdownIt from 'markdown-it';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
data: {
|
|
6
|
+
type: PropType<AnyObject>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
}>, {
|
|
10
|
+
mdhtml: markdownIt;
|
|
11
|
+
props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
data: {
|
|
13
|
+
type: PropType<AnyObject>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>> & Readonly<{}> & {}>;
|
|
17
|
+
state: {
|
|
18
|
+
orgId: string;
|
|
19
|
+
currentSessionItem: AnyObject;
|
|
20
|
+
id: string;
|
|
21
|
+
userInfo: AnyObject;
|
|
22
|
+
msgList: {
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
id: string;
|
|
25
|
+
sessionKey: string;
|
|
26
|
+
content: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
chatMessageType: string;
|
|
29
|
+
msg: string;
|
|
30
|
+
referenceContent?: any;
|
|
31
|
+
forwardMessageList?: AnyObject[] | undefined;
|
|
32
|
+
messageTemplate?: any;
|
|
33
|
+
messageTemplateData?: any;
|
|
34
|
+
fileUrl?: string | undefined;
|
|
35
|
+
avStatus?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
senderName: string;
|
|
38
|
+
sendTime: string;
|
|
39
|
+
sender: string;
|
|
40
|
+
status: string;
|
|
41
|
+
senderAvatar: string;
|
|
42
|
+
__content: string;
|
|
43
|
+
__time?: string | undefined;
|
|
44
|
+
__sendTime?: string | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
sessionList: AnyObject[];
|
|
47
|
+
isChangeSession: boolean;
|
|
48
|
+
isUpdateSession: boolean;
|
|
49
|
+
currentReferenceMsg: AnyObject | null;
|
|
50
|
+
currentReEditMsg: AnyObject | null;
|
|
51
|
+
showVideo: boolean;
|
|
52
|
+
currentAVMsg: AnyObject;
|
|
53
|
+
currentGroupUser: AnyObject[];
|
|
54
|
+
showMultipleVideo: boolean;
|
|
55
|
+
userDetail: {
|
|
56
|
+
show: boolean;
|
|
57
|
+
position: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
61
|
+
userId: string;
|
|
62
|
+
info: AnyObject | null;
|
|
63
|
+
};
|
|
64
|
+
isForward: boolean;
|
|
65
|
+
loading: boolean;
|
|
66
|
+
};
|
|
67
|
+
content: import("vue").ComputedRef<string>;
|
|
68
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
69
|
+
data: {
|
|
70
|
+
type: PropType<AnyObject>;
|
|
71
|
+
required: true;
|
|
72
|
+
};
|
|
73
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
74
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _sfc_main from './MessageMarkdown.vue2.js';
|
|
2
|
+
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
|
|
3
|
+
|
|
4
|
+
var MessageMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "MessageMarkdown.vue"]]);
|
|
5
|
+
|
|
6
|
+
export { MessageMarkdown as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode } from 'vue';
|
|
2
|
+
import { useData } from '../hooks/useData.js';
|
|
3
|
+
import 'stompjs';
|
|
4
|
+
import 'sockjs-client/dist/sockjs.min.js';
|
|
5
|
+
import '../api/index.js';
|
|
6
|
+
import '../utils/index.js';
|
|
7
|
+
import 'lodash-es';
|
|
8
|
+
import 'trtc-sdk-v5';
|
|
9
|
+
import markdownIt from 'markdown-it';
|
|
10
|
+
|
|
11
|
+
const _hoisted_1 = { class: "markdown-wrapper" };
|
|
12
|
+
const _hoisted_2 = ["data-time", "innerHTML"];
|
|
13
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "MessageMarkdown",
|
|
15
|
+
props: {
|
|
16
|
+
data: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const mdhtml = markdownIt({ html: true });
|
|
23
|
+
const props = __props;
|
|
24
|
+
useData();
|
|
25
|
+
const content = computed(() => {
|
|
26
|
+
var _a;
|
|
27
|
+
return mdhtml.render(((_a = props.data.content) == null ? void 0 : _a.msg) || "");
|
|
28
|
+
});
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
31
|
+
createElementVNode("div", {
|
|
32
|
+
class: "markdown-content",
|
|
33
|
+
"data-time": __props.data.__time,
|
|
34
|
+
innerHTML: content.value
|
|
35
|
+
}, null, 8, _hoisted_2)
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { _sfc_main as default };
|
|
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
13
13
|
};
|
|
14
14
|
}>> & Readonly<{}> & {}>;
|
|
15
15
|
state: {
|
|
16
|
-
orgId: string
|
|
16
|
+
orgId: string;
|
|
17
17
|
currentSessionItem: AnyObject;
|
|
18
18
|
id: string;
|
|
19
19
|
userInfo: AnyObject;
|
|
@@ -41,11 +41,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
41
41
|
__time?: string | undefined;
|
|
42
42
|
__sendTime?: string | undefined;
|
|
43
43
|
}[];
|
|
44
|
-
currentMsg: AnyObject;
|
|
45
|
-
isAppendMsg: boolean;
|
|
46
44
|
sessionList: AnyObject[];
|
|
47
45
|
isChangeSession: boolean;
|
|
48
|
-
updateSessionItem: AnyObject;
|
|
49
46
|
isUpdateSession: boolean;
|
|
50
47
|
currentReferenceMsg: AnyObject | null;
|
|
51
48
|
currentReEditMsg: AnyObject | null;
|
|
@@ -63,6 +60,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
63
60
|
info: AnyObject | null;
|
|
64
61
|
};
|
|
65
62
|
isForward: boolean;
|
|
63
|
+
loading: boolean;
|
|
66
64
|
};
|
|
67
65
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
68
66
|
msgItem: import("vue").ComputedRef<AnyObject | MsgListItem>;
|
|
@@ -101,7 +99,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
101
99
|
};
|
|
102
100
|
}>> & Readonly<{}> & {}>;
|
|
103
101
|
state: {
|
|
104
|
-
orgId: string
|
|
102
|
+
orgId: string;
|
|
105
103
|
currentSessionItem: AnyObject;
|
|
106
104
|
id: string;
|
|
107
105
|
userInfo: AnyObject;
|
|
@@ -129,11 +127,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
129
127
|
__time?: string | undefined;
|
|
130
128
|
__sendTime?: string | undefined;
|
|
131
129
|
}[];
|
|
132
|
-
currentMsg: AnyObject;
|
|
133
|
-
isAppendMsg: boolean;
|
|
134
130
|
sessionList: AnyObject[];
|
|
135
131
|
isChangeSession: boolean;
|
|
136
|
-
updateSessionItem: AnyObject;
|
|
137
132
|
isUpdateSession: boolean;
|
|
138
133
|
currentReferenceMsg: AnyObject | null;
|
|
139
134
|
currentReEditMsg: AnyObject | null;
|
|
@@ -151,6 +146,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
151
146
|
info: AnyObject | null;
|
|
152
147
|
};
|
|
153
148
|
isForward: boolean;
|
|
149
|
+
loading: boolean;
|
|
154
150
|
};
|
|
155
151
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
156
152
|
inviter: import("vue").Ref<any, any>;
|
|
@@ -4,7 +4,7 @@ import { AnyObject } from '../../../../shared/types';
|
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
selfVideoRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
6
6
|
state: {
|
|
7
|
-
orgId: string
|
|
7
|
+
orgId: string;
|
|
8
8
|
currentSessionItem: AnyObject;
|
|
9
9
|
id: string;
|
|
10
10
|
userInfo: AnyObject;
|
|
@@ -32,11 +32,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
32
32
|
__time?: string | undefined;
|
|
33
33
|
__sendTime?: string | undefined;
|
|
34
34
|
}[];
|
|
35
|
-
currentMsg: AnyObject;
|
|
36
|
-
isAppendMsg: boolean;
|
|
37
35
|
sessionList: AnyObject[];
|
|
38
36
|
isChangeSession: boolean;
|
|
39
|
-
updateSessionItem: AnyObject;
|
|
40
37
|
isUpdateSession: boolean;
|
|
41
38
|
currentReferenceMsg: AnyObject | null;
|
|
42
39
|
currentReEditMsg: AnyObject | null;
|
|
@@ -54,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
54
51
|
info: AnyObject | null;
|
|
55
52
|
};
|
|
56
53
|
isForward: boolean;
|
|
54
|
+
loading: boolean;
|
|
57
55
|
};
|
|
58
56
|
sendMessage: (message: {
|
|
59
57
|
chatType?: string | undefined;
|
|
@@ -200,7 +198,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
200
198
|
}> & {}>;
|
|
201
199
|
emit: (event: "comfirm", ...args: any[]) => void;
|
|
202
200
|
state: {
|
|
203
|
-
orgId: string
|
|
201
|
+
orgId: string;
|
|
204
202
|
currentSessionItem: AnyObject;
|
|
205
203
|
id: string;
|
|
206
204
|
userInfo: AnyObject;
|
|
@@ -228,11 +226,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
228
226
|
__time?: string | undefined;
|
|
229
227
|
__sendTime?: string | undefined;
|
|
230
228
|
}[];
|
|
231
|
-
currentMsg: AnyObject;
|
|
232
|
-
isAppendMsg: boolean;
|
|
233
229
|
sessionList: AnyObject[];
|
|
234
230
|
isChangeSession: boolean;
|
|
235
|
-
updateSessionItem: AnyObject;
|
|
236
231
|
isUpdateSession: boolean;
|
|
237
232
|
currentReferenceMsg: AnyObject | null;
|
|
238
233
|
currentReEditMsg: AnyObject | null;
|
|
@@ -250,6 +245,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
250
245
|
info: AnyObject | null;
|
|
251
246
|
};
|
|
252
247
|
isForward: boolean;
|
|
248
|
+
loading: boolean;
|
|
253
249
|
};
|
|
254
250
|
setCurrentSessionItem: (item: AnyObject) => void;
|
|
255
251
|
listRef: import("vue").Ref<any, any>;
|
|
@@ -3,7 +3,7 @@ import { AnyObject } from '../../../../shared/types';
|
|
|
3
3
|
import { isDoctorRole, getRoleName } from '../utils';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
state: {
|
|
6
|
-
orgId: string
|
|
6
|
+
orgId: string;
|
|
7
7
|
currentSessionItem: AnyObject;
|
|
8
8
|
id: string;
|
|
9
9
|
userInfo: AnyObject;
|
|
@@ -31,11 +31,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
31
31
|
__time?: string | undefined;
|
|
32
32
|
__sendTime?: string | undefined;
|
|
33
33
|
}[];
|
|
34
|
-
currentMsg: AnyObject;
|
|
35
|
-
isAppendMsg: boolean;
|
|
36
34
|
sessionList: AnyObject[];
|
|
37
35
|
isChangeSession: boolean;
|
|
38
|
-
updateSessionItem: AnyObject;
|
|
39
36
|
isUpdateSession: boolean;
|
|
40
37
|
currentReferenceMsg: AnyObject | null;
|
|
41
38
|
currentReEditMsg: AnyObject | null;
|
|
@@ -53,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
53
50
|
info: AnyObject | null;
|
|
54
51
|
};
|
|
55
52
|
isForward: boolean;
|
|
53
|
+
loading: boolean;
|
|
56
54
|
};
|
|
57
55
|
openSession: (session: string | AnyObject) => Promise<void>;
|
|
58
56
|
showLargeAvatar: import("vue").Ref<boolean, boolean>;
|
|
@@ -170,7 +170,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
170
170
|
round: "",
|
|
171
171
|
size: 100,
|
|
172
172
|
onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
|
|
173
|
-
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\n <n-upload-trigger #="{ handleClick }" abstract>\n <n-button\n circle\n secondary\n class="edit-avatar"\n v-show="userDetail.id === state.userInfo.id"\n @click="handleClick"\n >\n <template #icon>\n <n-icon size="16" color="#666666" :component="Camera" />\n </template>\n </n-button>\n </n-upload-trigger>\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
|
|
173
|
+
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\r\n <n-upload-trigger #="{ handleClick }" abstract>\r\n <n-button\r\n circle\r\n secondary\r\n class="edit-avatar"\r\n v-show="userDetail.id === state.userInfo.id"\r\n @click="handleClick"\r\n >\r\n <template #icon>\r\n <n-icon size="16" color="#666666" :component="Camera" />\r\n </template>\r\n </n-button>\r\n </n-upload-trigger>\r\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
|
|
174
174
|
class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
|
|
175
175
|
}, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
|
|
176
176
|
strong: "",
|
|
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
34
34
|
filterList: import("vue").Ref<AnyObject[], AnyObject[]>;
|
|
35
35
|
handleInput: () => void;
|
|
36
36
|
state: {
|
|
37
|
-
orgId: string
|
|
37
|
+
orgId: string;
|
|
38
38
|
currentSessionItem: AnyObject;
|
|
39
39
|
id: string;
|
|
40
40
|
userInfo: AnyObject;
|
|
@@ -62,11 +62,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
62
62
|
__time?: string | undefined;
|
|
63
63
|
__sendTime?: string | undefined;
|
|
64
64
|
}[];
|
|
65
|
-
currentMsg: AnyObject;
|
|
66
|
-
isAppendMsg: boolean;
|
|
67
65
|
sessionList: AnyObject[];
|
|
68
66
|
isChangeSession: boolean;
|
|
69
|
-
updateSessionItem: AnyObject;
|
|
70
67
|
isUpdateSession: boolean;
|
|
71
68
|
currentReferenceMsg: AnyObject | null;
|
|
72
69
|
currentReEditMsg: AnyObject | null;
|
|
@@ -84,6 +81,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
84
81
|
info: AnyObject | null;
|
|
85
82
|
};
|
|
86
83
|
isForward: boolean;
|
|
84
|
+
loading: boolean;
|
|
87
85
|
};
|
|
88
86
|
unreadTotal: import("vue").ComputedRef<number>;
|
|
89
87
|
filterable: import("vue").Ref<any, any>;
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
7
7
|
receiver?: string | undefined;
|
|
8
8
|
}) => Promise<void>;
|
|
9
9
|
state: {
|
|
10
|
-
orgId: string
|
|
10
|
+
orgId: string;
|
|
11
11
|
currentSessionItem: import("../../../../shared/types").AnyObject;
|
|
12
12
|
id: string;
|
|
13
13
|
userInfo: import("../../../../shared/types").AnyObject;
|
|
@@ -35,11 +35,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
35
35
|
__time?: string | undefined;
|
|
36
36
|
__sendTime?: string | undefined;
|
|
37
37
|
}[];
|
|
38
|
-
currentMsg: import("../../../../shared/types").AnyObject;
|
|
39
|
-
isAppendMsg: boolean;
|
|
40
38
|
sessionList: import("../../../../shared/types").AnyObject[];
|
|
41
39
|
isChangeSession: boolean;
|
|
42
|
-
updateSessionItem: import("../../../../shared/types").AnyObject;
|
|
43
40
|
isUpdateSession: boolean;
|
|
44
41
|
currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
|
|
45
42
|
currentReEditMsg: import("../../../../shared/types").AnyObject | null;
|
|
@@ -57,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
57
54
|
info: import("../../../../shared/types").AnyObject | null;
|
|
58
55
|
};
|
|
59
56
|
isForward: boolean;
|
|
57
|
+
loading: boolean;
|
|
60
58
|
};
|
|
61
59
|
trtc: import("trtc-sdk-v5").TRTC;
|
|
62
60
|
timing: import("vue").Ref<string, string>;
|
|
@@ -3,6 +3,7 @@ import { NAvatar } from 'naive-ui';
|
|
|
3
3
|
import { useData } from '../hooks/useData.js';
|
|
4
4
|
import 'stompjs';
|
|
5
5
|
import 'sockjs-client/dist/sockjs.min.js';
|
|
6
|
+
import { CHAT_TYPE } from '../constants/index.js';
|
|
6
7
|
import { openSessionApi } from '../api/index.js';
|
|
7
8
|
import '../utils/index.js';
|
|
8
9
|
import 'lodash-es';
|
|
@@ -33,7 +34,7 @@ var userItemRender = /* @__PURE__ */ defineComponent({
|
|
|
33
34
|
let data = session;
|
|
34
35
|
if (!session) {
|
|
35
36
|
const _data = await openSessionApi({
|
|
36
|
-
chatType:
|
|
37
|
+
chatType: CHAT_TYPE.SINGLE,
|
|
37
38
|
receiver: id,
|
|
38
39
|
sender: state.userInfo.id
|
|
39
40
|
});
|
|
@@ -15,6 +15,7 @@ var MESSAGE_TYPE = /* @__PURE__ */ ((MESSAGE_TYPE2) => {
|
|
|
15
15
|
MESSAGE_TYPE2["AUDIO"] = "AUDIO";
|
|
16
16
|
MESSAGE_TYPE2["VIDEO"] = "VIDEO";
|
|
17
17
|
MESSAGE_TYPE2["EVENT"] = "EVENT";
|
|
18
|
+
MESSAGE_TYPE2["AI_SUMMARY"] = "AI_SUMMARY";
|
|
18
19
|
return MESSAGE_TYPE2;
|
|
19
20
|
})(MESSAGE_TYPE || {});
|
|
20
21
|
var SUBSCRIBE_MESSAGE_TYPE = /* @__PURE__ */ ((SUBSCRIBE_MESSAGE_TYPE2) => {
|
|
@@ -6,10 +6,13 @@ export declare const InjectionIChatData: InjectionKey<ReturnType<typeof initData
|
|
|
6
6
|
export declare function initData(props: AnyObject, emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void): {
|
|
7
7
|
filterable: import("vue").Ref<any, any>;
|
|
8
8
|
trtcProxy: import("vue").Ref<any, any>;
|
|
9
|
+
token: import("vue").Ref<any, any>;
|
|
9
10
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
10
|
-
stompClient:
|
|
11
|
+
stompClient: {
|
|
12
|
+
value: ChatSock | null;
|
|
13
|
+
};
|
|
11
14
|
state: {
|
|
12
|
-
orgId: string
|
|
15
|
+
orgId: string;
|
|
13
16
|
currentSessionItem: AnyObject;
|
|
14
17
|
id: string;
|
|
15
18
|
userInfo: AnyObject;
|
|
@@ -37,11 +40,8 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
|
|
|
37
40
|
__time?: string | undefined;
|
|
38
41
|
__sendTime?: string | undefined;
|
|
39
42
|
}[];
|
|
40
|
-
currentMsg: AnyObject;
|
|
41
|
-
isAppendMsg: boolean;
|
|
42
43
|
sessionList: AnyObject[];
|
|
43
44
|
isChangeSession: boolean;
|
|
44
|
-
updateSessionItem: AnyObject;
|
|
45
45
|
isUpdateSession: boolean;
|
|
46
46
|
currentReferenceMsg: AnyObject | null;
|
|
47
47
|
currentReEditMsg: AnyObject | null;
|
|
@@ -59,6 +59,12 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
|
|
|
59
59
|
info: AnyObject | null;
|
|
60
60
|
};
|
|
61
61
|
isForward: boolean;
|
|
62
|
+
loading: boolean;
|
|
63
|
+
};
|
|
64
|
+
chatMainRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
65
|
+
tempState: {
|
|
66
|
+
currentMsg: AnyObject;
|
|
67
|
+
updateSessionItem: AnyObject;
|
|
62
68
|
};
|
|
63
69
|
unreadTotal: import("vue").ComputedRef<number>;
|
|
64
70
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
|
@@ -88,14 +94,19 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
|
|
|
88
94
|
setSessionList: (list: AnyObject[]) => void;
|
|
89
95
|
emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
|
|
90
96
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
97
|
+
appendMsg: () => void;
|
|
98
|
+
scrollToBottom: () => void;
|
|
91
99
|
};
|
|
92
100
|
export declare const useData: () => {
|
|
93
101
|
filterable: import("vue").Ref<any, any>;
|
|
94
102
|
trtcProxy: import("vue").Ref<any, any>;
|
|
103
|
+
token: import("vue").Ref<any, any>;
|
|
95
104
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
96
|
-
stompClient:
|
|
105
|
+
stompClient: {
|
|
106
|
+
value: ChatSock | null;
|
|
107
|
+
};
|
|
97
108
|
state: {
|
|
98
|
-
orgId: string
|
|
109
|
+
orgId: string;
|
|
99
110
|
currentSessionItem: AnyObject;
|
|
100
111
|
id: string;
|
|
101
112
|
userInfo: AnyObject;
|
|
@@ -123,11 +134,8 @@ export declare const useData: () => {
|
|
|
123
134
|
__time?: string | undefined;
|
|
124
135
|
__sendTime?: string | undefined;
|
|
125
136
|
}[];
|
|
126
|
-
currentMsg: AnyObject;
|
|
127
|
-
isAppendMsg: boolean;
|
|
128
137
|
sessionList: AnyObject[];
|
|
129
138
|
isChangeSession: boolean;
|
|
130
|
-
updateSessionItem: AnyObject;
|
|
131
139
|
isUpdateSession: boolean;
|
|
132
140
|
currentReferenceMsg: AnyObject | null;
|
|
133
141
|
currentReEditMsg: AnyObject | null;
|
|
@@ -145,6 +153,12 @@ export declare const useData: () => {
|
|
|
145
153
|
info: AnyObject | null;
|
|
146
154
|
};
|
|
147
155
|
isForward: boolean;
|
|
156
|
+
loading: boolean;
|
|
157
|
+
};
|
|
158
|
+
chatMainRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
159
|
+
tempState: {
|
|
160
|
+
currentMsg: AnyObject;
|
|
161
|
+
updateSessionItem: AnyObject;
|
|
148
162
|
};
|
|
149
163
|
unreadTotal: import("vue").ComputedRef<number>;
|
|
150
164
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
|
@@ -174,4 +188,6 @@ export declare const useData: () => {
|
|
|
174
188
|
setSessionList: (list: AnyObject[]) => void;
|
|
175
189
|
emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
|
|
176
190
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
191
|
+
appendMsg: () => void;
|
|
192
|
+
scrollToBottom: () => void;
|
|
177
193
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { reactive, ref, computed, watch, toRef, inject, toRaw } from 'vue';
|
|
2
2
|
import { openSessionApi, updateStatusApi, groupUserApi } from '../api/index.js';
|
|
3
3
|
import { promiseTimeout, useIntervalFn } from '@vueuse/core';
|
|
4
4
|
import { isGroup, listSort, formatTime, transformMessage, $message, simplifyMessage } from '../utils/index.js';
|
|
@@ -23,7 +23,13 @@ function getLastMessageContent(session) {
|
|
|
23
23
|
return content;
|
|
24
24
|
}
|
|
25
25
|
function initData(props, emit) {
|
|
26
|
-
const stompClient =
|
|
26
|
+
const stompClient = {
|
|
27
|
+
value: null
|
|
28
|
+
};
|
|
29
|
+
const tempState = {
|
|
30
|
+
currentMsg: {},
|
|
31
|
+
updateSessionItem: {}
|
|
32
|
+
};
|
|
27
33
|
const state = reactive({
|
|
28
34
|
orgId: props.orgId,
|
|
29
35
|
currentSessionItem: {},
|
|
@@ -32,11 +38,8 @@ function initData(props, emit) {
|
|
|
32
38
|
id: props.userId
|
|
33
39
|
},
|
|
34
40
|
msgList: [],
|
|
35
|
-
currentMsg: {},
|
|
36
|
-
isAppendMsg: false,
|
|
37
41
|
sessionList: [],
|
|
38
42
|
isChangeSession: false,
|
|
39
|
-
updateSessionItem: {},
|
|
40
43
|
isUpdateSession: false,
|
|
41
44
|
currentReferenceMsg: null,
|
|
42
45
|
currentReEditMsg: null,
|
|
@@ -50,8 +53,10 @@ function initData(props, emit) {
|
|
|
50
53
|
userId: "",
|
|
51
54
|
info: null
|
|
52
55
|
},
|
|
53
|
-
isForward: false
|
|
56
|
+
isForward: false,
|
|
57
|
+
loading: false
|
|
54
58
|
});
|
|
59
|
+
const chatMainRef = ref();
|
|
55
60
|
const cssVars = useTheme();
|
|
56
61
|
const unreadTotal = computed(() => {
|
|
57
62
|
return state.sessionList.reduce((num, item) => num + +item.unreadNum, 0);
|
|
@@ -96,7 +101,7 @@ function initData(props, emit) {
|
|
|
96
101
|
state.isChangeSession = false;
|
|
97
102
|
}
|
|
98
103
|
if (isUpdateSession) {
|
|
99
|
-
updateSessionList(
|
|
104
|
+
updateSessionList(tempState.updateSessionItem);
|
|
100
105
|
state.isUpdateSession = false;
|
|
101
106
|
}
|
|
102
107
|
},
|
|
@@ -145,6 +150,17 @@ function initData(props, emit) {
|
|
|
145
150
|
resume();
|
|
146
151
|
}
|
|
147
152
|
}
|
|
153
|
+
function appendMsg() {
|
|
154
|
+
setMsgList([tempState.currentMsg, ...state.msgList]);
|
|
155
|
+
scrollToBottom();
|
|
156
|
+
}
|
|
157
|
+
function scrollToBottom() {
|
|
158
|
+
var _a;
|
|
159
|
+
(_a = chatMainRef.value) == null ? void 0 : _a.scrollTo({
|
|
160
|
+
top: 0,
|
|
161
|
+
behavior: "auto"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
148
164
|
async function sendMessage(message) {
|
|
149
165
|
var _a;
|
|
150
166
|
try {
|
|
@@ -239,7 +255,7 @@ function initData(props, emit) {
|
|
|
239
255
|
...item,
|
|
240
256
|
lastMessageContent: getLastMessageContent({ ...item, chatType: item.chatType || (matchSessionItem == null ? void 0 : matchSessionItem.chatType) })
|
|
241
257
|
};
|
|
242
|
-
|
|
258
|
+
tempState.updateSessionItem = matchSessionItem ? {
|
|
243
259
|
...cloneDeep(matchSessionItem),
|
|
244
260
|
...commonItem
|
|
245
261
|
} : commonItem;
|
|
@@ -332,9 +348,12 @@ function initData(props, emit) {
|
|
|
332
348
|
return {
|
|
333
349
|
filterable: toRef(props, "filterable"),
|
|
334
350
|
trtcProxy: toRef(props, "trtcProxy"),
|
|
351
|
+
token: toRef(props, "token"),
|
|
335
352
|
cssVars,
|
|
336
353
|
stompClient,
|
|
337
354
|
state,
|
|
355
|
+
chatMainRef,
|
|
356
|
+
tempState,
|
|
338
357
|
unreadTotal,
|
|
339
358
|
isGroupChat,
|
|
340
359
|
isGroupLeader,
|
|
@@ -350,7 +369,9 @@ function initData(props, emit) {
|
|
|
350
369
|
setUpdateSessionItem,
|
|
351
370
|
setSessionList,
|
|
352
371
|
emit,
|
|
353
|
-
setUserDetail
|
|
372
|
+
setUserDetail,
|
|
373
|
+
appendMsg,
|
|
374
|
+
scrollToBottom
|
|
354
375
|
};
|
|
355
376
|
}
|
|
356
377
|
const useData = () => inject(InjectionIChatData);
|