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
|
@@ -6,7 +6,7 @@ import { ImageItem } from '../types';
|
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
7
7
|
chatMainRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
8
8
|
state: {
|
|
9
|
-
orgId: string
|
|
9
|
+
orgId: string;
|
|
10
10
|
currentSessionItem: AnyObject;
|
|
11
11
|
id: string;
|
|
12
12
|
userInfo: AnyObject;
|
|
@@ -34,11 +34,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
34
34
|
__time?: string | undefined;
|
|
35
35
|
__sendTime?: string | undefined;
|
|
36
36
|
}[];
|
|
37
|
-
currentMsg: AnyObject;
|
|
38
|
-
isAppendMsg: boolean;
|
|
39
37
|
sessionList: AnyObject[];
|
|
40
38
|
isChangeSession: boolean;
|
|
41
|
-
updateSessionItem: AnyObject;
|
|
42
39
|
isUpdateSession: boolean;
|
|
43
40
|
currentReferenceMsg: AnyObject | null;
|
|
44
41
|
currentReEditMsg: AnyObject | null;
|
|
@@ -56,6 +53,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
56
53
|
info: AnyObject | null;
|
|
57
54
|
};
|
|
58
55
|
isForward: boolean;
|
|
56
|
+
loading: boolean;
|
|
59
57
|
};
|
|
60
58
|
setMsgList: (list?: AnyObject[] | import("../types").MsgListItem) => void;
|
|
61
59
|
relayMessage: (param: {
|
|
@@ -107,7 +105,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
107
105
|
showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
|
|
108
106
|
isTemplate3: (content: AnyObject) => boolean;
|
|
109
107
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
|
110
|
-
setScrollToButtom: () => Promise<void>;
|
|
111
108
|
resetInfo: () => void;
|
|
112
109
|
setReferenceMsg: (msgItem: AnyObject) => void;
|
|
113
110
|
handleSelect: (key: string, msgItem: AnyObject) => void;
|
|
@@ -123,6 +120,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
123
120
|
readonly NButton: any;
|
|
124
121
|
readonly NSpace: any;
|
|
125
122
|
readonly NCheckbox: any;
|
|
123
|
+
readonly NFlex: any;
|
|
124
|
+
readonly NSpin: any;
|
|
126
125
|
readonly isArray: {
|
|
127
126
|
(value?: any): value is any[];
|
|
128
127
|
<T>(value?: any): value is any[];
|
|
@@ -214,7 +213,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
214
213
|
};
|
|
215
214
|
}>> & Readonly<{}> & {}>;
|
|
216
215
|
state: {
|
|
217
|
-
orgId: string
|
|
216
|
+
orgId: string;
|
|
218
217
|
currentSessionItem: AnyObject;
|
|
219
218
|
id: string;
|
|
220
219
|
userInfo: AnyObject;
|
|
@@ -242,11 +241,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
242
241
|
__time?: string | undefined;
|
|
243
242
|
__sendTime?: string | undefined;
|
|
244
243
|
}[];
|
|
245
|
-
currentMsg: AnyObject;
|
|
246
|
-
isAppendMsg: boolean;
|
|
247
244
|
sessionList: AnyObject[];
|
|
248
245
|
isChangeSession: boolean;
|
|
249
|
-
updateSessionItem: AnyObject;
|
|
250
246
|
isUpdateSession: boolean;
|
|
251
247
|
currentReferenceMsg: AnyObject | null;
|
|
252
248
|
currentReEditMsg: AnyObject | null;
|
|
@@ -264,6 +260,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
264
260
|
info: AnyObject | null;
|
|
265
261
|
};
|
|
266
262
|
isForward: boolean;
|
|
263
|
+
loading: boolean;
|
|
267
264
|
};
|
|
268
265
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
269
266
|
inviter: import("vue").Ref<any, any>;
|
|
@@ -289,7 +286,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
289
286
|
};
|
|
290
287
|
}>> & Readonly<{}> & {}>;
|
|
291
288
|
state: {
|
|
292
|
-
orgId: string
|
|
289
|
+
orgId: string;
|
|
293
290
|
currentSessionItem: AnyObject;
|
|
294
291
|
id: string;
|
|
295
292
|
userInfo: AnyObject;
|
|
@@ -317,11 +314,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
317
314
|
__time?: string | undefined;
|
|
318
315
|
__sendTime?: string | undefined;
|
|
319
316
|
}[];
|
|
320
|
-
currentMsg: AnyObject;
|
|
321
|
-
isAppendMsg: boolean;
|
|
322
317
|
sessionList: AnyObject[];
|
|
323
318
|
isChangeSession: boolean;
|
|
324
|
-
updateSessionItem: AnyObject;
|
|
325
319
|
isUpdateSession: boolean;
|
|
326
320
|
currentReferenceMsg: AnyObject | null;
|
|
327
321
|
currentReEditMsg: AnyObject | null;
|
|
@@ -339,6 +333,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
339
333
|
info: AnyObject | null;
|
|
340
334
|
};
|
|
341
335
|
isForward: boolean;
|
|
336
|
+
loading: boolean;
|
|
342
337
|
};
|
|
343
338
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
344
339
|
msgItem: import("vue").ComputedRef<AnyObject | import("../types").MsgListItem>;
|
|
@@ -377,7 +372,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
377
372
|
};
|
|
378
373
|
}>> & Readonly<{}> & {}>;
|
|
379
374
|
state: {
|
|
380
|
-
orgId: string
|
|
375
|
+
orgId: string;
|
|
381
376
|
currentSessionItem: AnyObject;
|
|
382
377
|
id: string;
|
|
383
378
|
userInfo: AnyObject;
|
|
@@ -405,11 +400,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
405
400
|
__time?: string | undefined;
|
|
406
401
|
__sendTime?: string | undefined;
|
|
407
402
|
}[];
|
|
408
|
-
currentMsg: AnyObject;
|
|
409
|
-
isAppendMsg: boolean;
|
|
410
403
|
sessionList: AnyObject[];
|
|
411
404
|
isChangeSession: boolean;
|
|
412
|
-
updateSessionItem: AnyObject;
|
|
413
405
|
isUpdateSession: boolean;
|
|
414
406
|
currentReferenceMsg: AnyObject | null;
|
|
415
407
|
currentReEditMsg: AnyObject | null;
|
|
@@ -427,6 +419,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
427
419
|
info: AnyObject | null;
|
|
428
420
|
};
|
|
429
421
|
isForward: boolean;
|
|
422
|
+
loading: boolean;
|
|
430
423
|
};
|
|
431
424
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
432
425
|
inviter: import("vue").Ref<any, any>;
|
|
@@ -602,7 +595,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
602
595
|
}> & {}>;
|
|
603
596
|
emit: (event: "comfirm", ...args: any[]) => void;
|
|
604
597
|
state: {
|
|
605
|
-
orgId: string
|
|
598
|
+
orgId: string;
|
|
606
599
|
currentSessionItem: AnyObject;
|
|
607
600
|
id: string;
|
|
608
601
|
userInfo: AnyObject;
|
|
@@ -630,11 +623,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
630
623
|
__time?: string | undefined;
|
|
631
624
|
__sendTime?: string | undefined;
|
|
632
625
|
}[];
|
|
633
|
-
currentMsg: AnyObject;
|
|
634
|
-
isAppendMsg: boolean;
|
|
635
626
|
sessionList: AnyObject[];
|
|
636
627
|
isChangeSession: boolean;
|
|
637
|
-
updateSessionItem: AnyObject;
|
|
638
628
|
isUpdateSession: boolean;
|
|
639
629
|
currentReferenceMsg: AnyObject | null;
|
|
640
630
|
currentReEditMsg: AnyObject | null;
|
|
@@ -652,6 +642,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
652
642
|
info: AnyObject | null;
|
|
653
643
|
};
|
|
654
644
|
isForward: boolean;
|
|
645
|
+
loading: boolean;
|
|
655
646
|
};
|
|
656
647
|
setCurrentSessionItem: (item: AnyObject) => void;
|
|
657
648
|
listRef: import("vue").Ref<any, any>;
|
|
@@ -759,6 +750,76 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
759
750
|
mode: string;
|
|
760
751
|
disabledIds: string[];
|
|
761
752
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
753
|
+
MessageMarkdown: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
754
|
+
data: {
|
|
755
|
+
type: import("vue").PropType<AnyObject>;
|
|
756
|
+
required: true;
|
|
757
|
+
};
|
|
758
|
+
}>, {
|
|
759
|
+
mdhtml: import("markdown-it");
|
|
760
|
+
props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
761
|
+
data: {
|
|
762
|
+
type: import("vue").PropType<AnyObject>;
|
|
763
|
+
required: true;
|
|
764
|
+
};
|
|
765
|
+
}>> & Readonly<{}> & {}>;
|
|
766
|
+
state: {
|
|
767
|
+
orgId: string;
|
|
768
|
+
currentSessionItem: AnyObject;
|
|
769
|
+
id: string;
|
|
770
|
+
userInfo: AnyObject;
|
|
771
|
+
msgList: {
|
|
772
|
+
[x: string]: any;
|
|
773
|
+
id: string;
|
|
774
|
+
sessionKey: string;
|
|
775
|
+
content: {
|
|
776
|
+
[x: string]: any;
|
|
777
|
+
chatMessageType: string;
|
|
778
|
+
msg: string;
|
|
779
|
+
referenceContent?: any;
|
|
780
|
+
forwardMessageList?: AnyObject[] | undefined;
|
|
781
|
+
messageTemplate?: any;
|
|
782
|
+
messageTemplateData?: any;
|
|
783
|
+
fileUrl?: string | undefined;
|
|
784
|
+
avStatus?: string | undefined;
|
|
785
|
+
};
|
|
786
|
+
senderName: string;
|
|
787
|
+
sendTime: string;
|
|
788
|
+
sender: string;
|
|
789
|
+
status: string;
|
|
790
|
+
senderAvatar: string;
|
|
791
|
+
__content: string;
|
|
792
|
+
__time?: string | undefined;
|
|
793
|
+
__sendTime?: string | undefined;
|
|
794
|
+
}[];
|
|
795
|
+
sessionList: AnyObject[];
|
|
796
|
+
isChangeSession: boolean;
|
|
797
|
+
isUpdateSession: boolean;
|
|
798
|
+
currentReferenceMsg: AnyObject | null;
|
|
799
|
+
currentReEditMsg: AnyObject | null;
|
|
800
|
+
showVideo: boolean;
|
|
801
|
+
currentAVMsg: AnyObject;
|
|
802
|
+
currentGroupUser: AnyObject[];
|
|
803
|
+
showMultipleVideo: boolean;
|
|
804
|
+
userDetail: {
|
|
805
|
+
show: boolean;
|
|
806
|
+
position: {
|
|
807
|
+
x: number;
|
|
808
|
+
y: number;
|
|
809
|
+
};
|
|
810
|
+
userId: string;
|
|
811
|
+
info: AnyObject | null;
|
|
812
|
+
};
|
|
813
|
+
isForward: boolean;
|
|
814
|
+
loading: boolean;
|
|
815
|
+
};
|
|
816
|
+
content: import("vue").ComputedRef<string>;
|
|
817
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
818
|
+
data: {
|
|
819
|
+
type: import("vue").PropType<AnyObject>;
|
|
820
|
+
required: true;
|
|
821
|
+
};
|
|
822
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
762
823
|
readonly simplifyMessage: typeof simplifyMessage;
|
|
763
824
|
readonly isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
|
|
764
825
|
readonly getAVTime: typeof getAVTime;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i18n } from '../../../../_virtual/_virtual_i18n-methods.js';
|
|
2
|
-
import { defineComponent, ref, reactive, computed, watch, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle,
|
|
3
|
-
import { NButton, NCheckbox, NAvatar, NIcon, NSpace, NButtonGroup } from 'naive-ui';
|
|
2
|
+
import { defineComponent, ref, reactive, computed, watch, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createBlock, withCtx, createVNode, createElementVNode, createCommentVNode, Fragment, renderList, toDisplayString, createTextVNode, withModifiers, nextTick } from 'vue';
|
|
3
|
+
import { NFlex, NSpin, NButton, NCheckbox, NAvatar, NIcon, NSpace, NButtonGroup } from 'naive-ui';
|
|
4
4
|
import { useEventListener } from '@vueuse/core';
|
|
5
5
|
import { format } from 'date-fns';
|
|
6
6
|
import { getHistoryRecordApi, readMessageApi } from '../api/index.js';
|
|
@@ -18,6 +18,7 @@ import SelectLabel from './SelectLabel.vue.js';
|
|
|
18
18
|
import { emojis } from '../utils/emoji.js';
|
|
19
19
|
import ContextMenu from './ContextMenu.js';
|
|
20
20
|
import ChatAdd from './ChatAdd.vue.js';
|
|
21
|
+
import MessageMarkdown from './MessageMarkdown.vue.js';
|
|
21
22
|
import '../../../../shared/utils/index.js';
|
|
22
23
|
import '@vue/shared';
|
|
23
24
|
import '@vueuse/shared';
|
|
@@ -79,8 +80,8 @@ const _hoisted_22 = {
|
|
|
79
80
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
81
|
__name: "ChatMain",
|
|
81
82
|
setup(__props) {
|
|
82
|
-
const chatMainRef = ref();
|
|
83
83
|
const {
|
|
84
|
+
chatMainRef,
|
|
84
85
|
state,
|
|
85
86
|
setMsgList,
|
|
86
87
|
relayMessage,
|
|
@@ -339,13 +340,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
339
340
|
}
|
|
340
341
|
return true;
|
|
341
342
|
}
|
|
342
|
-
async function setScrollToButtom() {
|
|
343
|
-
var _a;
|
|
344
|
-
(_a = chatMainRef.value) == null ? void 0 : _a.scrollTo({
|
|
345
|
-
top: 0,
|
|
346
|
-
behavior: "auto"
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
343
|
function resetInfo() {
|
|
350
344
|
Object.assign(pageInfo, {
|
|
351
345
|
page: 0,
|
|
@@ -402,15 +396,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
402
396
|
}, {
|
|
403
397
|
immediate: true
|
|
404
398
|
});
|
|
405
|
-
watch(() => state.isAppendMsg, (isAppendMsg) => {
|
|
406
|
-
if (isAppendMsg) {
|
|
407
|
-
setMsgList([state.currentMsg, ...state.msgList]);
|
|
408
|
-
setScrollToButtom();
|
|
409
|
-
state.isAppendMsg = false;
|
|
410
|
-
}
|
|
411
|
-
}, {
|
|
412
|
-
immediate: true
|
|
413
|
-
});
|
|
414
399
|
return (_ctx, _cache) => {
|
|
415
400
|
return openBlock(), createElementBlock("div", {
|
|
416
401
|
class: normalizeClass(["chat-main", {
|
|
@@ -420,8 +405,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
420
405
|
ref_key: "chatMainRef",
|
|
421
406
|
ref: chatMainRef,
|
|
422
407
|
style: normalizeStyle(styleProps.value)
|
|
423
|
-
}, [(openBlock(
|
|
424
|
-
|
|
408
|
+
}, [unref(state).loading ? (openBlock(), createBlock(unref(NFlex), {
|
|
409
|
+
key: 0,
|
|
410
|
+
justify: "center",
|
|
411
|
+
style: {
|
|
412
|
+
"margin": "10px"
|
|
413
|
+
}
|
|
414
|
+
}, {
|
|
415
|
+
default: withCtx(() => [createVNode(unref(NSpin), {
|
|
416
|
+
size: 18
|
|
417
|
+
}), _cache[5] || (_cache[5] = createElementVNode("span", null, "\u6D88\u606F\u603B\u7ED3\u4E2D\uFF0C\u8BF7\u7A0D\u540E", -1))]),
|
|
418
|
+
_: 1
|
|
419
|
+
})) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).msgList, (item, index) => {
|
|
420
|
+
var _a, _b, _c;
|
|
425
421
|
return openBlock(), createElementBlock(Fragment, {
|
|
426
422
|
key: item.id
|
|
427
423
|
}, [showMessage(item) ? (openBlock(), createElementBlock("div", {
|
|
@@ -429,8 +425,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
429
425
|
class: normalizeClass(["message-item", {
|
|
430
426
|
"message-item--mine": item.sender == unref(state).userInfo.id
|
|
431
427
|
}])
|
|
432
|
-
}, [needShowTime(item, index) ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(item.__sendTime), 1)) : createCommentVNode("v-if", true),
|
|
433
|
-
key: 1
|
|
428
|
+
}, [needShowTime(item, index) ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(item.__sendTime), 1)) : createCommentVNode("v-if", true), ((_a = item.content) == null ? void 0 : _a.chatMessageType) === unref(MESSAGE_TYPE).AI_SUMMARY ? (openBlock(), createBlock(MessageMarkdown, {
|
|
429
|
+
key: 1,
|
|
430
|
+
data: item
|
|
431
|
+
}, null, 8, ["data"])) : createCommentVNode("v-if", true), showTemplateMsg(item, "system") || item.status === "WITHDRAWN" || ((_b = item.content) == null ? void 0 : _b.chatMessageType) === unref(MESSAGE_TYPE).EVENT ? (openBlock(), createElementBlock(Fragment, {
|
|
432
|
+
key: 2
|
|
434
433
|
}, [showTemplateMsg(item, "system") ? (openBlock(), createBlock(MessageTemplate, {
|
|
435
434
|
key: 0,
|
|
436
435
|
data: item
|
|
@@ -444,13 +443,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
444
443
|
text: "",
|
|
445
444
|
onClick: () => reEdit(item)
|
|
446
445
|
}, {
|
|
447
|
-
default: withCtx(() => [..._cache[
|
|
446
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(i18n("10010.1.69", "\u91CD\u65B0\u7F16\u8F91"), -1)])]),
|
|
448
447
|
_: 2
|
|
449
448
|
}, 1032, ["onClick"])) : createCommentVNode("v-if", true)])) : (openBlock(), createBlock(MessageEvent, {
|
|
450
449
|
key: 2,
|
|
451
450
|
data: item
|
|
452
|
-
}, null, 8, ["data"]))], 64)) : (openBlock(), createElementBlock("div", {
|
|
453
|
-
key:
|
|
451
|
+
}, null, 8, ["data"]))], 64)) : ((_c = item.content) == null ? void 0 : _c.chatMessageType) !== unref(MESSAGE_TYPE).AI_SUMMARY ? (openBlock(), createElementBlock("div", {
|
|
452
|
+
key: 3,
|
|
454
453
|
class: normalizeClass(["message-wrapper", {
|
|
455
454
|
checked: item.checked
|
|
456
455
|
}]),
|
|
@@ -601,7 +600,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
601
600
|
}, {
|
|
602
601
|
default: withCtx(() => [!unref(isAudioOrVideoMessage)(item.content) ? (openBlock(), createElementBlock(Fragment, {
|
|
603
602
|
key: 0
|
|
604
|
-
}, [createCommentVNode(' <n-button\n quaternary\n size="tiny"\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\n >\n <template #icon>\n <n-icon size="17" :component="HappyOutline" />\n </template>\n </n-button> '), createVNode(unref(NButton), {
|
|
603
|
+
}, [createCommentVNode(' <n-button\r\n quaternary\r\n size="tiny"\r\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\r\n >\r\n <template #icon>\r\n <n-icon size="17" :component="HappyOutline" />\r\n </template>\r\n </n-button> '), createVNode(unref(NButton), {
|
|
605
604
|
quaternary: "",
|
|
606
605
|
size: "tiny",
|
|
607
606
|
onClick: () => setReferenceMsg(item)
|
|
@@ -623,7 +622,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
623
622
|
_: 2
|
|
624
623
|
}, 1032, ["onClick"])]),
|
|
625
624
|
_: 2
|
|
626
|
-
}, 1024)], 42, _hoisted_8)])) : createCommentVNode("v-if", true)])], 10, _hoisted_3))], 2)) : createCommentVNode("v-if", true)], 64);
|
|
625
|
+
}, 1024)], 42, _hoisted_8)])) : createCommentVNode("v-if", true)])], 10, _hoisted_3)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)], 64);
|
|
627
626
|
}), 128)), createVNode(unref(ContextMenu), {
|
|
628
627
|
ref_key: "contextmenuRef",
|
|
629
628
|
ref: contextmenuRef,
|
|
@@ -646,7 +645,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
646
645
|
}, i18n("10010.1.45", "\u8F6C\u53D1"), 512)]),
|
|
647
646
|
_: 1
|
|
648
647
|
}), menuMsgId.value ? (openBlock(), createBlock(SelectLabel, {
|
|
649
|
-
key:
|
|
648
|
+
key: 1,
|
|
650
649
|
show: showLabel.value,
|
|
651
650
|
"onUpdate:show": _cache[1] || (_cache[1] = ($event) => showLabel.value = $event),
|
|
652
651
|
x: labelPosition.x,
|
|
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
};
|
|
18
18
|
}>> & Readonly<{}> & {}>;
|
|
19
19
|
state: {
|
|
20
|
-
orgId: string
|
|
20
|
+
orgId: string;
|
|
21
21
|
currentSessionItem: AnyObject;
|
|
22
22
|
id: string;
|
|
23
23
|
userInfo: AnyObject;
|
|
@@ -45,11 +45,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
45
45
|
__time?: string | undefined;
|
|
46
46
|
__sendTime?: string | undefined;
|
|
47
47
|
}[];
|
|
48
|
-
currentMsg: AnyObject;
|
|
49
|
-
isAppendMsg: boolean;
|
|
50
48
|
sessionList: AnyObject[];
|
|
51
49
|
isChangeSession: boolean;
|
|
52
|
-
updateSessionItem: AnyObject;
|
|
53
50
|
isUpdateSession: boolean;
|
|
54
51
|
currentReferenceMsg: AnyObject | null;
|
|
55
52
|
currentReEditMsg: AnyObject | null;
|
|
@@ -67,6 +64,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
67
64
|
info: AnyObject | null;
|
|
68
65
|
};
|
|
69
66
|
isForward: boolean;
|
|
67
|
+
loading: boolean;
|
|
70
68
|
};
|
|
71
69
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
72
70
|
recordRef: import("vue").Ref<any, any>;
|
|
@@ -301,7 +299,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
301
299
|
};
|
|
302
300
|
}>> & Readonly<{}> & {}>;
|
|
303
301
|
state: {
|
|
304
|
-
orgId: string
|
|
302
|
+
orgId: string;
|
|
305
303
|
currentSessionItem: AnyObject;
|
|
306
304
|
id: string;
|
|
307
305
|
userInfo: AnyObject;
|
|
@@ -329,11 +327,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
329
327
|
__time?: string | undefined;
|
|
330
328
|
__sendTime?: string | undefined;
|
|
331
329
|
}[];
|
|
332
|
-
currentMsg: AnyObject;
|
|
333
|
-
isAppendMsg: boolean;
|
|
334
330
|
sessionList: AnyObject[];
|
|
335
331
|
isChangeSession: boolean;
|
|
336
|
-
updateSessionItem: AnyObject;
|
|
337
332
|
isUpdateSession: boolean;
|
|
338
333
|
currentReferenceMsg: AnyObject | null;
|
|
339
334
|
currentReEditMsg: AnyObject | null;
|
|
@@ -351,6 +346,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
351
346
|
info: AnyObject | null;
|
|
352
347
|
};
|
|
353
348
|
isForward: boolean;
|
|
349
|
+
loading: boolean;
|
|
354
350
|
};
|
|
355
351
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
356
352
|
inviter: import("vue").Ref<any, any>;
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
7
7
|
keyword: import("vue").Ref<string, string>;
|
|
8
8
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
|
9
9
|
state: {
|
|
10
|
-
orgId: string
|
|
10
|
+
orgId: string;
|
|
11
11
|
currentSessionItem: AnyObject;
|
|
12
12
|
id: string;
|
|
13
13
|
userInfo: 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: AnyObject;
|
|
39
|
-
isAppendMsg: boolean;
|
|
40
38
|
sessionList: AnyObject[];
|
|
41
39
|
isChangeSession: boolean;
|
|
42
|
-
updateSessionItem: AnyObject;
|
|
43
40
|
isUpdateSession: boolean;
|
|
44
41
|
currentReferenceMsg: AnyObject | null;
|
|
45
42
|
currentReEditMsg: AnyObject | null;
|
|
@@ -57,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
57
54
|
info: AnyObject | null;
|
|
58
55
|
};
|
|
59
56
|
isForward: boolean;
|
|
57
|
+
loading: boolean;
|
|
60
58
|
};
|
|
61
59
|
openSession: (session: string | AnyObject) => Promise<void>;
|
|
62
60
|
userList: import("vue").Ref<AnyObject[], AnyObject[]>;
|
|
@@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
6
6
|
[x: string]: unknown;
|
|
7
7
|
};
|
|
8
8
|
state: {
|
|
9
|
-
orgId: string
|
|
9
|
+
orgId: string;
|
|
10
10
|
currentSessionItem: AnyObject;
|
|
11
11
|
id: string;
|
|
12
12
|
userInfo: AnyObject;
|
|
@@ -34,11 +34,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
34
34
|
__time?: string | undefined;
|
|
35
35
|
__sendTime?: string | undefined;
|
|
36
36
|
}[];
|
|
37
|
-
currentMsg: AnyObject;
|
|
38
|
-
isAppendMsg: boolean;
|
|
39
37
|
sessionList: AnyObject[];
|
|
40
38
|
isChangeSession: boolean;
|
|
41
|
-
updateSessionItem: AnyObject;
|
|
42
39
|
isUpdateSession: boolean;
|
|
43
40
|
currentReferenceMsg: AnyObject | null;
|
|
44
41
|
currentReEditMsg: AnyObject | null;
|
|
@@ -56,11 +53,16 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
56
53
|
info: AnyObject | null;
|
|
57
54
|
};
|
|
58
55
|
isForward: boolean;
|
|
56
|
+
loading: boolean;
|
|
59
57
|
};
|
|
60
58
|
setCurrentSessionItem: (item: AnyObject) => void;
|
|
61
59
|
setUserDetail: (event: MouseEvent, userDetail: AnyObject) => void;
|
|
62
60
|
isGroupChat: import("vue").ComputedRef<boolean>;
|
|
63
61
|
isGroupLeader: import("vue").ComputedRef<boolean>;
|
|
62
|
+
handleStreamOutput: () => Promise<{
|
|
63
|
+
msgId: string;
|
|
64
|
+
content: string;
|
|
65
|
+
} | undefined>;
|
|
64
66
|
inputRef: import("vue").Ref<any, any>;
|
|
65
67
|
groupNameEditing: import("vue").Ref<boolean, boolean>;
|
|
66
68
|
groupName: import("vue").Ref<string, string>;
|
|
@@ -70,6 +72,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
70
72
|
handleTopping: (value: boolean) => Promise<void>;
|
|
71
73
|
handleLeaveGroup: (dissolution: boolean) => Promise<void>;
|
|
72
74
|
handleToEdit: () => Promise<void>;
|
|
75
|
+
handleGroupSummary: () => Promise<import("naive-ui/es/message").MessageReactive | undefined>;
|
|
73
76
|
submitFormData: (o: AnyObject) => Promise<void>;
|
|
74
77
|
handleGroupName: () => Promise<void>;
|
|
75
78
|
handleAvatar: (options: FileOptions) => Promise<void>;
|
|
@@ -150,7 +153,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
150
153
|
}> & {}>;
|
|
151
154
|
emit: (event: "comfirm", ...args: any[]) => void;
|
|
152
155
|
state: {
|
|
153
|
-
orgId: string
|
|
156
|
+
orgId: string;
|
|
154
157
|
currentSessionItem: AnyObject;
|
|
155
158
|
id: string;
|
|
156
159
|
userInfo: AnyObject;
|
|
@@ -178,11 +181,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
178
181
|
__time?: string | undefined;
|
|
179
182
|
__sendTime?: string | undefined;
|
|
180
183
|
}[];
|
|
181
|
-
currentMsg: AnyObject;
|
|
182
|
-
isAppendMsg: boolean;
|
|
183
184
|
sessionList: AnyObject[];
|
|
184
185
|
isChangeSession: boolean;
|
|
185
|
-
updateSessionItem: AnyObject;
|
|
186
186
|
isUpdateSession: boolean;
|
|
187
187
|
currentReferenceMsg: AnyObject | null;
|
|
188
188
|
currentReEditMsg: AnyObject | null;
|
|
@@ -200,6 +200,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
200
200
|
info: AnyObject | null;
|
|
201
201
|
};
|
|
202
202
|
isForward: boolean;
|
|
203
|
+
loading: boolean;
|
|
203
204
|
};
|
|
204
205
|
setCurrentSessionItem: (item: AnyObject) => void;
|
|
205
206
|
listRef: import("vue").Ref<any, any>;
|
|
@@ -5,11 +5,13 @@ import { ChevronBackOutline, ChevronForwardOutline, AddOutline, RemoveOutline, P
|
|
|
5
5
|
import { useData } from '../hooks/useData.js';
|
|
6
6
|
import 'stompjs';
|
|
7
7
|
import 'sockjs-client/dist/sockjs.min.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { MESSAGE_TYPE } from '../constants/index.js';
|
|
9
|
+
import { toppingSessionApi, groupLeaveApi, messageSummaryApi, groupUpdateApi } from '../api/index.js';
|
|
10
|
+
import { isDoctorRole, getRoleName, $message } from '../utils/index.js';
|
|
11
|
+
import { remove, trim, isFunction } from 'lodash-es';
|
|
11
12
|
import 'trtc-sdk-v5';
|
|
12
13
|
import ChatAdd from './ChatAdd.vue.js';
|
|
14
|
+
import { useStreamOutput } from '../hooks/useStreamOutput.js';
|
|
13
15
|
|
|
14
16
|
const _hoisted_1 = {
|
|
15
17
|
key: 0,
|
|
@@ -78,6 +80,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
80
|
isGroupChat,
|
|
79
81
|
isGroupLeader
|
|
80
82
|
} = useData();
|
|
83
|
+
const {
|
|
84
|
+
handleStreamOutput
|
|
85
|
+
} = useStreamOutput();
|
|
81
86
|
const inputRef = ref();
|
|
82
87
|
const groupNameEditing = ref(false);
|
|
83
88
|
const groupName = ref("");
|
|
@@ -118,6 +123,29 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
123
|
await nextTick();
|
|
119
124
|
(_a = inputRef.value) == null ? void 0 : _a.select();
|
|
120
125
|
}
|
|
126
|
+
async function handleGroupSummary() {
|
|
127
|
+
const [firstMsg] = state.msgList || [];
|
|
128
|
+
if (!firstMsg || firstMsg.content.chatMessageType === MESSAGE_TYPE.AI_SUMMARY)
|
|
129
|
+
return $message.warning("\u6682\u65E0\u53EF\u603B\u7ED3\u7684\u6D88\u606F\u5185\u5BB9\uFF01");
|
|
130
|
+
closeChatSet();
|
|
131
|
+
const {
|
|
132
|
+
msgId,
|
|
133
|
+
content
|
|
134
|
+
} = await handleStreamOutput() || {};
|
|
135
|
+
if (content) {
|
|
136
|
+
try {
|
|
137
|
+
await messageSummaryApi({
|
|
138
|
+
id: state.currentSessionItem.receiver,
|
|
139
|
+
sender: state.userInfo.id,
|
|
140
|
+
summaryMessage: content
|
|
141
|
+
});
|
|
142
|
+
remove(state.msgList, {
|
|
143
|
+
id: msgId
|
|
144
|
+
});
|
|
145
|
+
} catch (err) {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
121
149
|
async function submitFormData(o) {
|
|
122
150
|
const formData = new FormData();
|
|
123
151
|
const _o = Object.assign({
|
|
@@ -304,7 +332,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
304
332
|
}, null, 8, ["component"])]),
|
|
305
333
|
default: withCtx(() => [_cache[12] || (_cache[12] = createTextVNode(i18n("10010.1.89", "\u67E5\u770B\u5168\u90E8\u7FA4\u6210\u5458"), -1))]),
|
|
306
334
|
_: 1
|
|
307
|
-
})]),
|
|
335
|
+
})]), createElementVNode("div", {
|
|
336
|
+
class: "item",
|
|
337
|
+
onClick: handleGroupSummary
|
|
338
|
+
}, [_cache[14] || (_cache[14] = createElementVNode("span", {
|
|
339
|
+
class: "label"
|
|
340
|
+
}, "\u7FA4\u6D88\u606F\u603B\u7ED3", -1)), createVNode(unref(NIcon), {
|
|
341
|
+
size: 20,
|
|
342
|
+
component: unref(ChevronForwardOutline),
|
|
343
|
+
class: "item__right"
|
|
344
|
+
}, null, 8, ["component"])]), createVNode(unref(NUpload), {
|
|
308
345
|
abstract: "",
|
|
309
346
|
multiple: "",
|
|
310
347
|
accept: "image/*",
|
|
@@ -318,7 +355,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
318
355
|
}) => [createElementVNode("div", {
|
|
319
356
|
class: "item",
|
|
320
357
|
onClick: handleClick
|
|
321
|
-
}, [_cache[
|
|
358
|
+
}, [_cache[15] || (_cache[15] = createElementVNode("span", {
|
|
322
359
|
class: "label"
|
|
323
360
|
}, i18n("10010.1.90", "\u7FA4\u5934\u50CF"), -1)), createVNode(unref(NIcon), {
|
|
324
361
|
size: 20,
|
|
@@ -328,7 +365,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
328
365
|
_: 1
|
|
329
366
|
})]),
|
|
330
367
|
_: 1
|
|
331
|
-
}), createElementVNode("div", _hoisted_14, [_cache[
|
|
368
|
+
}), createElementVNode("div", _hoisted_14, [_cache[16] || (_cache[16] = createElementVNode("span", {
|
|
332
369
|
class: "label"
|
|
333
370
|
}, i18n("10010.1.91", "\u7FA4\u540D\u79F0"), -1)), createElementVNode("div", _hoisted_15, [groupNameEditing.value ? (openBlock(), createBlock(unref(NInput), {
|
|
334
371
|
key: 0,
|
|
@@ -357,7 +394,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
357
394
|
_: 1
|
|
358
395
|
})]),
|
|
359
396
|
_: 1
|
|
360
|
-
}))])])], 64)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_17, [_cache[
|
|
397
|
+
}))])])], 64)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_17, [_cache[17] || (_cache[17] = createElementVNode("span", {
|
|
361
398
|
class: "label"
|
|
362
399
|
}, i18n("10010.1.92", "\u7F6E\u9876\u804A\u5929"), -1)), createVNode(unref(NSwitch), {
|
|
363
400
|
value: unref(state).currentSessionItem.topping,
|
|
@@ -368,14 +405,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
368
405
|
}, [createVNode(unref(NPopconfirm), {
|
|
369
406
|
onPositiveClick: _cache[6] || (_cache[6] = () => handleLeaveGroup(false))
|
|
370
407
|
}, {
|
|
371
|
-
trigger: withCtx(() => [createElementVNode("div", _hoisted_18, [_cache[
|
|
408
|
+
trigger: withCtx(() => [createElementVNode("div", _hoisted_18, [_cache[18] || (_cache[18] = createElementVNode("span", {
|
|
372
409
|
class: "label"
|
|
373
410
|
}, i18n("10010.1.93", "\u9000\u51FA\u7FA4\u804A"), -1)), createVNode(unref(NIcon), {
|
|
374
411
|
size: 20,
|
|
375
412
|
component: unref(ChevronForwardOutline),
|
|
376
413
|
class: "item__right"
|
|
377
414
|
}, null, 8, ["component"])])]),
|
|
378
|
-
default: withCtx(() => [_cache[
|
|
415
|
+
default: withCtx(() => [_cache[19] || (_cache[19] = createElementVNode("p", {
|
|
379
416
|
style: {
|
|
380
417
|
"width": "230px"
|
|
381
418
|
}
|
|
@@ -385,14 +422,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
385
422
|
key: 0,
|
|
386
423
|
onPositiveClick: _cache[7] || (_cache[7] = () => handleLeaveGroup(true))
|
|
387
424
|
}, {
|
|
388
|
-
trigger: withCtx(() => [createElementVNode("div", _hoisted_19, [_cache[
|
|
425
|
+
trigger: withCtx(() => [createElementVNode("div", _hoisted_19, [_cache[20] || (_cache[20] = createElementVNode("span", {
|
|
389
426
|
class: "label"
|
|
390
427
|
}, i18n("10010.1.95", "\u89E3\u6563\u8BE5\u7FA4"), -1)), createVNode(unref(NIcon), {
|
|
391
428
|
size: 20,
|
|
392
429
|
component: unref(ChevronForwardOutline),
|
|
393
430
|
class: "item__right"
|
|
394
431
|
}, null, 8, ["component"])])]),
|
|
395
|
-
default: withCtx(() => [_cache[
|
|
432
|
+
default: withCtx(() => [_cache[21] || (_cache[21] = createElementVNode("p", {
|
|
396
433
|
style: {
|
|
397
434
|
"width": "230px"
|
|
398
435
|
}
|