cnhis-design-vue 3.2.6-release.0 → 3.2.6-release.2

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.
Files changed (88) hide show
  1. package/es/components/button-print/index.d.ts +4 -0
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  3. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  4. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  5. package/es/components/button-print/src/utils/print.js +1 -1
  6. package/es/components/callback/src/components/render/popupMaps.d.ts +6 -2
  7. package/es/components/expand-field/index.d.ts +1109 -321
  8. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +1109 -321
  9. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +1109 -321
  10. package/es/components/expand-field/src/components/form.vue.d.ts +1109 -321
  11. package/es/components/expand-field/src/index.vue.d.ts +1109 -321
  12. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  13. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  14. package/es/components/form-config/index.d.ts +12 -4
  15. package/es/components/form-config/src/FormConfig.vue.d.ts +12 -4
  16. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  17. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -2
  18. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -2
  19. package/es/components/form-config/src/utils/index.d.ts +1 -0
  20. package/es/components/form-config/src/utils/index.js +1 -1
  21. package/es/components/form-render/index.d.ts +6 -2
  22. package/es/components/form-render/src/FormRender.vue.d.ts +5 -1
  23. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  24. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -2
  25. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  26. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  27. package/es/components/form-render/src/types/index.d.ts +4 -1
  28. package/es/components/iho-chat/index.d.ts +57 -27
  29. package/es/components/iho-chat/src/Index.vue.d.ts +58 -27
  30. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  31. package/es/components/iho-chat/src/api/index.js +1 -1
  32. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
  33. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +9 -26
  34. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  35. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -2
  36. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +3 -2
  37. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  38. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -1
  39. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +10 -3
  40. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  41. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  42. package/es/components/iho-chat/src/components/Video.vue.d.ts +30 -25
  43. package/es/components/iho-chat/src/components/Video.vue.js +1 -0
  44. package/es/components/iho-chat/src/components/Video.vue2.js +1 -0
  45. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  46. package/es/components/iho-chat/src/types/index.d.ts +2 -0
  47. package/es/components/iho-chat/src/utils/index.d.ts +1 -1
  48. package/es/components/iho-chat/src/utils/index.js +1 -1
  49. package/es/components/iho-chat/style/index.css +1 -1
  50. package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -1
  51. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -1
  52. package/es/components/index.css +1 -1
  53. package/es/components/info-header/index.d.ts +12 -4
  54. package/es/components/info-header/src/InfoHeader.vue.d.ts +12 -4
  55. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +6 -2
  56. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -2
  57. package/es/components/recommend-search/index.d.ts +8 -8
  58. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  59. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  60. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  61. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  62. package/es/components/select-person/index.d.ts +1109 -321
  63. package/es/components/select-person/index.js +1 -1
  64. package/es/components/select-person/src/SelectPerson.vue.d.ts +4 -10
  65. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  66. package/es/components/select-person/src/SelectPersonType.vue.d.ts +314 -0
  67. package/es/components/select-person/src/SelectPersonType.vue.js +1 -0
  68. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -0
  69. package/es/components/select-person/src/components/SearchMultiple.vue.js +1 -0
  70. package/es/components/select-person/src/components/SearchOrgAndStaff.vue.js +1 -0
  71. package/es/components/select-person/src/constants/index.d.ts +2 -0
  72. package/es/components/select-person/src/constants/index.js +1 -0
  73. package/es/components/select-person/src/index.vue.d.ts +1385 -0
  74. package/es/components/select-person/src/index.vue.js +1 -0
  75. package/es/components/select-person/src/index.vue2.js +1 -0
  76. package/es/components/shortcut-setter/index.d.ts +6 -2
  77. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -2
  78. package/es/shared/hooks/useAsyncQueue/index.d.ts +3 -0
  79. package/es/shared/hooks/useAsyncQueue/index.js +1 -1
  80. package/es/shared/package.json.js +1 -1
  81. package/es/shared/utils/business.js +1 -1
  82. package/package.json +2 -2
  83. package/es/components/select-person/src/SearchMultiple.vue.js +0 -1
  84. package/es/components/select-person/src/SearchOrgAndStaff.vue.js +0 -1
  85. /package/es/components/select-person/src/{SearchMultiple.vue.d.ts → components/SearchMultiple.vue.d.ts} +0 -0
  86. /package/es/components/select-person/src/{SearchMultiple.vue2.js → components/SearchMultiple.vue2.js} +0 -0
  87. /package/es/components/select-person/src/{SearchOrgAndStaff.vue.d.ts → components/SearchOrgAndStaff.vue.d.ts} +0 -0
  88. /package/es/components/select-person/src/{SearchOrgAndStaff.vue2.js → components/SearchOrgAndStaff.vue2.js} +0 -0
@@ -42,7 +42,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
42
42
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
43
43
  loading: import("vue").Ref<boolean>;
44
44
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
45
- showAv: import("vue").Ref<boolean>;
46
45
  state: {
47
46
  orgId: string | number;
48
47
  currentSessionItem: import("../../shared/types").AnyObject;
@@ -56,6 +55,8 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
56
55
  updateSessionItem: import("../../shared/types").AnyObject;
57
56
  isUpdateSession: boolean;
58
57
  currentReferenceMsg: import("../../shared/types").AnyObject | null;
58
+ showVideo: boolean;
59
+ currentAVMsg: import("../../shared/types").AnyObject;
59
60
  };
60
61
  reConnention: number;
61
62
  openSession: (item: import("../../shared/types").AnyObject) => Promise<void>;
@@ -268,7 +269,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
268
269
  fileRef: import("vue").Ref<any>;
269
270
  keyword: import("vue").Ref<any>;
270
271
  handleInput: () => void;
271
- currentInfo: {
272
+ pageInfo: {
272
273
  page: number;
273
274
  hasMore: boolean;
274
275
  lastSendTime: string;
@@ -325,7 +326,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
325
326
  startTime: import("vue").Ref<any>;
326
327
  endTime: import("vue").Ref<any>;
327
328
  handleInput: () => void;
328
- currentInfo: {
329
+ pageInfo: {
329
330
  page: number;
330
331
  hasMore: boolean;
331
332
  lastSendTime: string;
@@ -443,7 +444,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
443
444
  setMsgList: (list?: import("../../shared/types").AnyObject[]) => void;
444
445
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
445
446
  showMenu: import("vue").Ref<boolean>;
446
- currentInfo: {
447
+ pageInfo: {
447
448
  page: number;
448
449
  hasMore: boolean;
449
450
  lastSendTime: string;
@@ -619,30 +620,18 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
619
620
  formatTime: typeof import("./src/utils").formatTime;
620
621
  downloadFile: typeof import("./src/utils").downloadFile;
621
622
  simplifyMessage: typeof import("./src/utils").simplifyMessage;
623
+ isAudioOrVideoMessage: typeof import("./src/utils").isAudioOrVideoMessage;
622
624
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
623
625
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
624
626
  EllipsisHorizontal: 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<{}>>, {}>;
625
627
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
626
- ChatFooter: import("vue").DefineComponent<{
627
- showAv: {
628
- type: BooleanConstructor;
629
- default: boolean;
630
- };
631
- }, {
632
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
633
- showAv: {
634
- type: BooleanConstructor;
635
- default: boolean;
636
- };
637
- }>> & {}>>;
628
+ ChatFooter: import("vue").DefineComponent<{}, {
638
629
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
639
630
  content: import("vue").Ref<string>;
640
631
  state: import("./src/types").IState;
641
632
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock>;
642
633
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
643
634
  showEmoji: import("vue").Ref<boolean>;
644
- showVideo: import("vue").Ref<boolean>;
645
- callMode: import("vue").Ref<string>;
646
635
  handleCall: (chatMessageType: string) => void;
647
636
  handleKeyDown: (event: KeyboardEvent) => void;
648
637
  isWrap: (event: KeyboardEvent) => boolean;
@@ -666,25 +655,26 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
666
655
  };
667
656
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
668
657
  CloseCircleOutline: 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<{}>>, {}>;
658
+ CallOutline: 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<{}>>, {}>;
659
+ VideocamOutline: 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<{}>>, {}>;
669
660
  simplifyMessage: typeof import("./src/utils").simplifyMessage;
670
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
671
- showAv: {
672
- type: BooleanConstructor;
673
- default: boolean;
674
- };
675
- }>>, {
676
- showAv: boolean;
677
- }>;
661
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
678
662
  ChatSearch: import("vue").DefineComponent<{}, {
679
663
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
664
+ listRef: import("vue").Ref<any>;
680
665
  inputRef: import("vue").Ref<any>;
681
666
  showSearch: import("vue").Ref<boolean>;
682
667
  keyword: import("vue").Ref<any>;
683
668
  userList: import("vue").Ref<any>;
684
669
  state: import("./src/types").IState;
685
670
  openSession: (item: import("../../shared/types").AnyObject) => Promise<void>;
686
- handleInput: () => Promise<void>;
671
+ pageInfo: {
672
+ page: number;
673
+ hasMore: boolean;
674
+ };
675
+ handleInput: () => void;
687
676
  handleSearch: () => Promise<void>;
677
+ resetAndSearch: () => void;
688
678
  addSession: (userId: string) => Promise<void>;
689
679
  NPopover: any;
690
680
  NButton: any;
@@ -693,6 +683,46 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
693
683
  NIcon: any;
694
684
  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<{}>>, {}>;
695
685
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
686
+ Video: import("vue").DefineComponent<{}, {
687
+ time: {
688
+ timer: any;
689
+ seconds: number;
690
+ };
691
+ state: import("./src/types").IState;
692
+ videoRef: import("vue").Ref<any>;
693
+ selfVideoRef: import("vue").Ref<any>;
694
+ tipContent: import("vue").Ref<any>;
695
+ isConnect: import("vue").Ref<boolean>;
696
+ voiceOpen: import("vue").Ref<boolean>;
697
+ messageType: import("vue").ComputedRef<any>;
698
+ callMode: import("vue").ComputedRef<any>;
699
+ info: import("vue").ComputedRef<{
700
+ sessionKey: any;
701
+ avatar: any;
702
+ name: any;
703
+ userId: any;
704
+ }>;
705
+ trtc: import("trtc-sdk-v5").default;
706
+ handleEnter: () => Promise<void>;
707
+ handleExit: () => Promise<void>;
708
+ installEventHandlers: () => void;
709
+ uninstallEventHandlers: () => void;
710
+ handleRemoteVideoAvailable: (event: any) => Promise<void>;
711
+ handleRemoteAudioAvailable: (event: any) => void;
712
+ handleRemoteUserEnter: () => void;
713
+ handleRemoteUserExit: (event: any) => void;
714
+ startTimer: () => void;
715
+ resetTimer: () => void;
716
+ formatSeconds: (seconds: number) => string;
717
+ toggleAudio: () => Promise<void>;
718
+ NButton: any;
719
+ NAvatar: any;
720
+ NIcon: any;
721
+ Call: 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<{}>>, {}>;
722
+ MicOffCircle: 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<{}>>, {}>;
723
+ Mic: 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<{}>>, {}>;
724
+ MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
725
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
696
726
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
697
727
  token: {
698
728
  type: StringConstructor;
@@ -3,6 +3,7 @@ import { ChatSock } from './utils/chatSock';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  import { MESSAGE_TYPE } from './constants';
5
5
  import { IState } from './types';
6
+ import { isAudioOrVideoMessage } from './utils';
6
7
  declare const _default: import("vue").DefineComponent<{
7
8
  token: {
8
9
  type: StringConstructor;
@@ -46,7 +47,6 @@ declare const _default: import("vue").DefineComponent<{
46
47
  cssVars: import("vue").ComputedRef<AnyObject>;
47
48
  loading: import("vue").Ref<boolean>;
48
49
  stompClient: import("vue").Ref<ChatSock | undefined>;
49
- showAv: import("vue").Ref<boolean>;
50
50
  state: {
51
51
  orgId: string | number;
52
52
  currentSessionItem: AnyObject;
@@ -60,6 +60,8 @@ declare const _default: import("vue").DefineComponent<{
60
60
  updateSessionItem: AnyObject;
61
61
  isUpdateSession: boolean;
62
62
  currentReferenceMsg: AnyObject | null;
63
+ showVideo: boolean;
64
+ currentAVMsg: AnyObject;
63
65
  };
64
66
  reConnention: number;
65
67
  openSession: (item: AnyObject) => Promise<void>;
@@ -272,7 +274,7 @@ declare const _default: import("vue").DefineComponent<{
272
274
  fileRef: import("vue").Ref<any>;
273
275
  keyword: import("vue").Ref<any>;
274
276
  handleInput: () => void;
275
- currentInfo: {
277
+ pageInfo: {
276
278
  page: number;
277
279
  hasMore: boolean;
278
280
  lastSendTime: string;
@@ -329,7 +331,7 @@ declare const _default: import("vue").DefineComponent<{
329
331
  startTime: import("vue").Ref<any>;
330
332
  endTime: import("vue").Ref<any>;
331
333
  handleInput: () => void;
332
- currentInfo: {
334
+ pageInfo: {
333
335
  page: number;
334
336
  hasMore: boolean;
335
337
  lastSendTime: string;
@@ -447,7 +449,7 @@ declare const _default: import("vue").DefineComponent<{
447
449
  setMsgList: (list?: AnyObject[]) => void;
448
450
  setCurrentSessionItem: (item: AnyObject) => void;
449
451
  showMenu: import("vue").Ref<boolean>;
450
- currentInfo: {
452
+ pageInfo: {
451
453
  page: number;
452
454
  hasMore: boolean;
453
455
  lastSendTime: string;
@@ -623,30 +625,18 @@ declare const _default: import("vue").DefineComponent<{
623
625
  formatTime: typeof import("./utils").formatTime;
624
626
  downloadFile: typeof import("./utils").downloadFile;
625
627
  simplifyMessage: typeof import("./utils").simplifyMessage;
628
+ isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
626
629
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
627
630
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
628
631
  EllipsisHorizontal: 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<{}>>, {}>;
629
632
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
630
- ChatFooter: import("vue").DefineComponent<{
631
- showAv: {
632
- type: BooleanConstructor;
633
- default: boolean;
634
- };
635
- }, {
636
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
637
- showAv: {
638
- type: BooleanConstructor;
639
- default: boolean;
640
- };
641
- }>> & {}>>;
633
+ ChatFooter: import("vue").DefineComponent<{}, {
642
634
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
643
635
  content: import("vue").Ref<string>;
644
636
  state: IState;
645
637
  stompClient: import("vue").Ref<ChatSock>;
646
638
  setCurrentSessionItem: (item: AnyObject) => void;
647
639
  showEmoji: import("vue").Ref<boolean>;
648
- showVideo: import("vue").Ref<boolean>;
649
- callMode: import("vue").Ref<string>;
650
640
  handleCall: (chatMessageType: string) => void;
651
641
  handleKeyDown: (event: KeyboardEvent) => void;
652
642
  isWrap: (event: KeyboardEvent) => boolean;
@@ -670,25 +660,26 @@ declare const _default: import("vue").DefineComponent<{
670
660
  };
671
661
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
672
662
  CloseCircleOutline: 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<{}>>, {}>;
663
+ CallOutline: 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<{}>>, {}>;
664
+ VideocamOutline: 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<{}>>, {}>;
673
665
  simplifyMessage: typeof import("./utils").simplifyMessage;
674
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
675
- showAv: {
676
- type: BooleanConstructor;
677
- default: boolean;
678
- };
679
- }>>, {
680
- showAv: boolean;
681
- }>;
666
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
682
667
  ChatSearch: import("vue").DefineComponent<{}, {
683
668
  cssVars: import("vue").ComputedRef<AnyObject>;
669
+ listRef: import("vue").Ref<any>;
684
670
  inputRef: import("vue").Ref<any>;
685
671
  showSearch: import("vue").Ref<boolean>;
686
672
  keyword: import("vue").Ref<any>;
687
673
  userList: import("vue").Ref<any>;
688
674
  state: IState;
689
675
  openSession: (item: AnyObject) => Promise<void>;
690
- handleInput: () => Promise<void>;
676
+ pageInfo: {
677
+ page: number;
678
+ hasMore: boolean;
679
+ };
680
+ handleInput: () => void;
691
681
  handleSearch: () => Promise<void>;
682
+ resetAndSearch: () => void;
692
683
  addSession: (userId: string) => Promise<void>;
693
684
  NPopover: any;
694
685
  NButton: any;
@@ -697,6 +688,46 @@ declare const _default: import("vue").DefineComponent<{
697
688
  NIcon: any;
698
689
  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<{}>>, {}>;
699
690
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
691
+ Video: import("vue").DefineComponent<{}, {
692
+ time: {
693
+ timer: any;
694
+ seconds: number;
695
+ };
696
+ state: IState;
697
+ videoRef: import("vue").Ref<any>;
698
+ selfVideoRef: import("vue").Ref<any>;
699
+ tipContent: import("vue").Ref<any>;
700
+ isConnect: import("vue").Ref<boolean>;
701
+ voiceOpen: import("vue").Ref<boolean>;
702
+ messageType: import("vue").ComputedRef<any>;
703
+ callMode: import("vue").ComputedRef<any>;
704
+ info: import("vue").ComputedRef<{
705
+ sessionKey: any;
706
+ avatar: any;
707
+ name: any;
708
+ userId: any;
709
+ }>;
710
+ trtc: import("trtc-sdk-v5").default;
711
+ handleEnter: () => Promise<void>;
712
+ handleExit: () => Promise<void>;
713
+ installEventHandlers: () => void;
714
+ uninstallEventHandlers: () => void;
715
+ handleRemoteVideoAvailable: (event: any) => Promise<void>;
716
+ handleRemoteAudioAvailable: (event: any) => void;
717
+ handleRemoteUserEnter: () => void;
718
+ handleRemoteUserExit: (event: any) => void;
719
+ startTimer: () => void;
720
+ resetTimer: () => void;
721
+ formatSeconds: (seconds: number) => string;
722
+ toggleAudio: () => Promise<void>;
723
+ NButton: any;
724
+ NAvatar: any;
725
+ NIcon: any;
726
+ Call: 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<{}>>, {}>;
727
+ MicOffCircle: 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<{}>>, {}>;
728
+ Mic: 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<{}>>, {}>;
729
+ MESSAGE_TYPE: typeof MESSAGE_TYPE;
730
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
700
731
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update")[], "template-click" | "unread-message-update", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
701
732
  token: {
702
733
  type: StringConstructor;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as u,withCtx as d,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as v,NLayout as S,NLayoutContent as g}from"naive-ui";import b from"./components/SiderList.vue.js";import I from"./components/ChatHeader.vue.js";import y from"./components/ChatMain.vue.js";import k from"./components/ChatFooter.vue.js";import j from"./components/ChatSearch.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as C,readMessageApi as L}from"./api/index.js";import{useTheme as N}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as x}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as M}from"./constants/index.js";import{InjectionIChatState as U,InjectionIChatStompClient as T,InjectionIChatEmits as w}from"./types/index.js";import{isAudioOrVideo as A}from"./utils/index.js";import{useSession as E}from"./hooks/useSession.js";const O={class:"iho-chat__header"},R={class:"toolbar"};var V=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:V,emit:q}){const J=e;C.defaults.baseURL=J.baseURL,C.defaults.headers.Authorization="bearer "+J.token;const F=N(),G=s(!1),H=s(),$=s(!1),z=o({orgId:J.orgId,currentSessionItem:{},id:"",userInfo:{id:J.userId,sdkAppId:1600034888},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null});t(U,z),t(T,H),t(w,q);const{openSession:D,closeSession:W,getCurrentSession:B,setSessionList:K,setUpdateSessionItem:P}=E(z);function Q(){const e={headers:{AccessToken:J.token,UserId:J.userId},heartbeatFn(){try{H.value.send("test")}catch(e){H.value.disconnect(),Q()}},connectCb(){console.log("连接成功"),H.value.subscribe("/user/topic/single",(async({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:o,sessionVo:t}=s;switch(s.event){case M.MESSAGE:{if(s.messageVo.sender===z.userInfo.id)return;const e={receiver:o.sender,lastMessageSendTime:o.sendTime,sortTime:o.sendTime,lastMessage:o.content};o.sender===z.currentSessionItem.receiver&&(z.currentMsg=o,A(o.content)||(z.isAppendMsg=!0,await L({chatType:"SINGLE",messageIdSet:o.id,receiver:z.userInfo.id,sender:o.sender})),e.unreadNum=0),P(e),A(o.content)&&($.value=!0);break}case M.NEW_SESSION:P(t)}}catch(e){console.log(e)}})),H.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:o,sessionVos:t}=s;if(console.log("body",s),Object.assign(z.userInfo,o),!(null==t?void 0:t.length))return;K(t)}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};H.value=new _("/fdp-chat/websocket",e)}return async function(){Q()}(),r((()=>{var e;null==(e=H.value)||e.disconnect()})),V({getUnreadData:function(){return z.sessionList.filter((e=>x(e.unreadNum)&&e.unreadNum>0))},openSession:D,closeSession:W,getCurrentSession:B}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(F))},[u(c(f),{abstract:"",namespace:"iho-chat__popover"},{default:d((()=>[G.value?(n(),m(c(v),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",O,[u(j),l("div",R,[h(e.$slots,"toolbar")])]),u(c(S),{class:"iho-chat__body","has-sider":""},{default:d((()=>[u(b),u(c(g),{class:"chat-content"},{default:d((()=>[u(I),u(y),u(k,{"show-av":$.value},null,8,["show-av"])])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{V as default};
1
+ import{defineComponent as e,ref as s,reactive as o,provide as t,onBeforeUnmount as r,openBlock as n,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as d,withCtx as u,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as g,NLayout as v,NLayoutContent as S}from"naive-ui";import b from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import I from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import k from"./components/ChatSearch.vue.js";import M from"./components/Video.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as N,readMessageApi as C}from"./api/index.js";import{useTheme as L}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as V}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as x}from"./constants/index.js";import{InjectionIChatState as A,InjectionIChatStompClient as T,InjectionIChatEmits as U}from"./types/index.js";import{isAudioOrVideoMessage as w}from"./utils/index.js";import{useSession as E}from"./hooks/useSession.js";const O={class:"iho-chat__header"},R={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:q,emit:J}){const F=e;N.defaults.baseURL=F.baseURL,N.defaults.headers.Authorization="bearer "+F.token;const G=L(),H=s(!1),K=s(),$=o({orgId:F.orgId,currentSessionItem:{},id:"",userInfo:{id:F.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,showVideo:!1,currentAVMsg:{}});t(A,$),t(T,K),t(U,J);const{openSession:z,closeSession:D,getCurrentSession:W,setSessionList:B,setUpdateSessionItem:P}=E($);function Q(){const e={headers:{AccessToken:F.token,UserId:F.userId},heartbeatFn(){try{K.value.send("test")}catch(e){K.value.disconnect(),Q()}},connectCb(){console.log("连接成功"),K.value.subscribe("/user/topic/single",(async({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:o,sessionVo:t}=s;switch(s.event){case x.MESSAGE:{if(s.messageVo.sender===$.userInfo.id)return;const e={receiver:o.sender,lastMessageSendTime:o.sendTime,sortTime:o.sendTime,lastMessage:o.content,avatar:o.senderAvatar,name:o.senderName,sessionKey:o.sessionKey};o.sender===$.currentSessionItem.receiver&&($.currentMsg=o,w(o.content)||($.isAppendMsg=!0,await C({chatType:"SINGLE",messageIdSet:[o.id],receiver:$.userInfo.id,sender:o.sender})),e.unreadNum=0),P(e),w(o.content)&&($.currentAVMsg.messageType=o.content.chatMessageType,$.currentAVMsg.callMode="invite",$.showVideo=!0);break}case x.NEW_SESSION:P(t)}}catch(e){console.log(e)}})),K.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:o,currentUser:t,sessionVos:r}=s;if(console.log("body",s),Object.assign($.userInfo,t,o),!(null==r?void 0:r.length))return;B(r)}catch(e){console.log(e)}}))},errorCb(e,s){console.log("断线了,正在重连...")}};K.value=new _("/fdp-chat/websocket",e)}return async function(){Q()}(),r((()=>{var e;null==(e=K.value)||e.disconnect()})),q({getUnreadData:function(){return $.sessionList.filter((e=>V(e.unreadNum)&&e.unreadNum>0))},openSession:z,closeSession:D,getCurrentSession:W}),(e,s)=>(n(),i("div",{class:"iho-chat",style:a(c(G))},[d(c(f),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>[H.value?(n(),m(c(g),{key:0,stroke:"#5585f5"})):(n(),i(p,{key:1},[l("div",O,[d(k),l("div",R,[h(e.$slots,"toolbar")])]),d(c(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[d(b),d(c(S),{class:"chat-content"},{default:u((()=>[d(y),d(I),d(j)])),_:1}),h(e.$slots,"external")])),_:3}),d(M)],64))])),_:3})],4))}});export{q as default};
@@ -1 +1 @@
1
- import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/chat/toppingSession",data:e(t)})}function u(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function s(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function c(t){return o({method:"post",url:"/chat/readMessage",data:t})}function i(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,s as listUserApi,n as openSessionApi,c as readMessageApi,i as searchChatRecordApi,a as toppingSessionApi,u as uploadFileApi};
1
+ import t from"axios";function e(t){const e=[];for(const o in t){const n=t[o];Array.isArray(n)?n.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(n)}`)}return e.join("&")}const o=t.create({withCredentials:!0,timeout:5e3});function n(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/openSession",data:e(t)})}function r(t){return o({method:"get",url:"/chat/recordList",params:t})}function a(t){return o({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/toppingSession",data:e(t)})}function s(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function u(t){return o({method:"get",url:"/user/listUser",params:t})}function d(t){return o({method:"get",url:"/user/getUserDetail",params:t})}function i(t){return o({method:"post",url:"/chat/readMessage",data:t})}function c(t){return o({method:"post",url:"/chat/searchChatRecord",data:t})}o.interceptors.response.use((t=>{var e,o;if(null==(e=t.data)?void 0:e.result)return null==(o=t.data)?void 0:o.data;console.log("请求错误")}));export{r as getHistoryRecordApi,d as getUserDetailApi,o as instanceAxios,u as listUserApi,n as openSessionApi,i as readMessageApi,c as searchChatRecordApi,a as toppingSessionApi,s as uploadFileApi};
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
26
26
  fileRef: import("vue").Ref<any>;
27
27
  keyword: import("vue").Ref<any>;
28
28
  handleInput: () => void;
29
- currentInfo: {
29
+ pageInfo: {
30
30
  page: number;
31
31
  hasMore: boolean;
32
32
  lastSendTime: string;
@@ -2,35 +2,23 @@ import { UploadFileInfo } from 'naive-ui';
2
2
  import { AnyObject } from '../../../../shared/types';
3
3
  import { MESSAGE_TYPE } from '../constants';
4
4
  import { simplifyMessage } from '../utils';
5
- declare const _default: import("vue").DefineComponent<{
6
- showAv: {
7
- type: BooleanConstructor;
8
- default: boolean;
9
- };
10
- }, {
11
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
- showAv: {
13
- type: BooleanConstructor;
14
- default: boolean;
15
- };
16
- }>> & {}>>;
5
+ type FileOptions = {
6
+ file: UploadFileInfo;
7
+ fileList: Array<UploadFileInfo>;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<{}, {
17
10
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
18
11
  content: import("vue").Ref<string>;
19
12
  state: import("../types").IState;
20
13
  stompClient: import("vue").Ref<import("../utils/chatSock").ChatSock>;
21
14
  setCurrentSessionItem: (item: AnyObject) => void;
22
15
  showEmoji: import("vue").Ref<boolean>;
23
- showVideo: import("vue").Ref<boolean>;
24
- callMode: import("vue").Ref<string>;
25
16
  handleCall: (chatMessageType: string) => void;
26
17
  handleKeyDown: (event: KeyboardEvent) => void;
27
18
  isWrap: (event: KeyboardEvent) => boolean;
28
19
  handleInput: () => void;
29
20
  selectEmoji: (name: string) => void;
30
- fileChange: (options: {
31
- file: UploadFileInfo;
32
- fileList: Array<UploadFileInfo>;
33
- }, chatMessageType: MESSAGE_TYPE) => Promise<void>;
21
+ fileChange: (options: FileOptions, chatMessageType: MESSAGE_TYPE) => Promise<void>;
34
22
  handleMsgSend: () => void;
35
23
  sendMessage: (contentInfo: AnyObject) => Promise<void>;
36
24
  NButton: any;
@@ -45,13 +33,8 @@ declare const _default: import("vue").DefineComponent<{
45
33
  };
46
34
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
47
35
  CloseCircleOutline: 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<{}>>, {}>;
36
+ CallOutline: 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<{}>>, {}>;
37
+ VideocamOutline: 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<{}>>, {}>;
48
38
  simplifyMessage: typeof simplifyMessage;
49
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
- showAv: {
51
- type: BooleanConstructor;
52
- default: boolean;
53
- };
54
- }>>, {
55
- showAv: boolean;
56
- }>;
39
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
57
40
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as n,withDirectives as i,openBlock as o,createElementBlock as s,normalizeStyle as a,unref as r,createElementVNode as l,toDisplayString as c,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as m,renderList as p,createBlock as g,createTextVNode as v,vShow as y}from"vue";import{NIcon as h,NPopover as M,NButton as k,NTooltip as E,NUpload as C,NUploadTrigger as b}from"naive-ui";import{format as T}from"date-fns";import{useState as x}from"../hooks/useState.js";import{useSession as I}from"../hooks/useSession.js";import{emojis as w}from"../utils/emoji.js";import{MESSAGE_TYPE as _}from"../constants/index.js";import{uploadFileApi as S}from"../api/index.js";import{CloseCircleOutline as z}from"@vicons/ionicons5";import{cloneDeep as A}from"lodash-es";import{simplifyMessage as O}from"../utils/index.js";const R={key:0,class:"reference-content-box"},j={class:"reference-content"},D=["innerHTML"],L={class:"tool-box"},q=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),F={class:"emoji-box"},H=l("span",null,"默认表情",-1),K={class:"list-box"},N=["src"],V=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),G=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),U=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),J={class:"btn-box"},B=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var P=e({__name:"ChatFooter",props:{showAv:{type:Boolean,default:!1}},setup(e){const P=e,X=t(),Y=t(""),{state:Q,stompClient:W}=x(),{setCurrentSessionItem:Z}=I(Q),$=t(!1),ee=t(!1);function te(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),oe()))}function ne(){var e,t;Y.value=(null==(t=null==(e=X.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ie(e,t){const{file:n,name:i}=e.file,o=new FormData;o.append("sender",Q.userInfo.id),o.append("file",n);const s=await S(o);if(!s)return console.log("上传失败");se({chatMessageType:t,msg:t===_.FILE?i:s,url:s})}function oe(){if(!(Y.value.length>2e3))return Y.value?void se({msg:Y.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function se(e){const{chatMessageType:t=_.TEXT,msg:n,url:i}=e,o={msg:n,chatMessageType:t};t===_.FILE&&(o.fileUrl=i),[_.TEXT,_.BLEND].includes(t)&&(X.value.innerHTML="",Y.value=""),Q.currentReferenceMsg&&(o.referenceContent=A(Q.currentReferenceMsg),Q.currentReferenceMsg=null);const s=T(new Date,"yyyy-MM-dd HH:mm:ss");Q.currentMsg={content:o,sender:Q.userInfo.id,senderName:Q.userInfo.name,senderAvatar:Q.userInfo.avatar,id:"",sendTime:s,sending:!0,fail:!1},[_.AUDIO,_.VIDEO].includes(t)||(Q.isAppendMsg=!0),Z({lastMessageSendTime:s,lastMessage:o,sortTime:s});try{W.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:o,receiver:Q.currentSessionItem.receiver})),Q.currentMsg={...Q.currentMsg,fail:!1}}catch(e){Q.currentMsg={...Q.currentMsg,fail:!0}}finally{Q.currentMsg={...Q.currentMsg,sending:!1}}}return t(""),n((()=>Q.currentReferenceMsg),(e=>{var t;e&&(null==(t=X.value)||t.focus())})),n((()=>P.showAv),(e=>{e&&(ee.value=!0)})),(e,t)=>i((o(),s("section",{class:"chat-footer",style:a({cursor:r(Q).id?"default":"not-allowed"})},[r(Q).currentReferenceMsg?(o(),s("div",R,[l("div",j,[l("span",null,c(r(Q).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:r(O)(r(Q).currentReferenceMsg.content)},null,8,D)]),u(r(h),{component:r(z),onClick:t[0]||(t[0]=()=>r(Q).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",L,[u(r(M),{show:$.value,"onUpdate:show":t[1]||(t[1]=e=>$.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[u(r(k),{quaternary:"",size:"tiny"},{icon:f((()=>[q])),_:1})])),default:f((()=>[l("div",F,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),H,l("div",K,[(o(!0),s(m,null,p(r(w).default,(([e,t])=>(o(),g(r(E),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[u(r(k),{quaternary:"",size:"tiny",onClick:()=>function(e){$.value=!1,se({chatMessageType:_.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,N)])),_:2},1032,["onClick"])])),default:f((()=>[v(" "+c(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),u(r(k),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>se({chatMessageType:r(_).EMOJI,msg:0}))},{icon:f((()=>[V])),_:1}),u(r(C),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ie(e,r(_).IMAGE))},{default:f((()=>[u(r(b),{abstract:""},{default:f((({handleClick:e})=>[u(r(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[G])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(r(C),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ie(e,r(_).FILE))},{default:f((()=>[u(r(b),{abstract:""},{default:f((({handleClick:e})=>[u(r(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[U])),_:2},1032,["onClick"])])),_:1})])),_:1}),d(' <n-button quaternary size="tiny" @click="() => handleCall(MESSAGE_TYPE.AUDIO)">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<n-icon size="18" :component="CallOutline" />\n\t\t\t\t</template>\n\t\t\t</n-button>\n\t\t\t<n-button quaternary size="tiny" @click="() => handleCall(MESSAGE_TYPE.VIDEO)">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<n-icon size="20" :component="VideocamOutline" />\n\t\t\t\t</template>\n\t\t\t</n-button> ')]),i(l("div",{ref_key:"inputRef",ref:X,class:"input-box",contenteditable:"",onKeydown:te,onInput:ne},null,544),[[y,r(Q).id]]),l("div",J,[B,u(r(k),{type:"primary",round:"",disabled:!Y.value,onClick:oe},{default:f((()=>[v("发送")])),_:1},8,["disabled"])]),d(' <Video v-model:show="showVideo" :call-mode="callMode" /> ')],4)),[[y,r(Q).id]])}});export{P as default};
1
+ import{defineComponent as e,ref as n,watch as t,withDirectives as s,openBlock as i,createElementBlock as r,normalizeStyle as o,unref as a,createElementVNode as c,toDisplayString as l,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as m,renderList as p,createBlock as g,createTextVNode as y,vShow as v}from"vue";import{NIcon as h,NPopover as M,NButton as k,NTooltip as C,NUpload as T,NUploadTrigger as x}from"naive-ui";import{format as I}from"date-fns";import{useState as _}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{emojis as E}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as z}from"../api/index.js";import{CloseCircleOutline as R,CallOutline as j,VideocamOutline as D}from"@vicons/ionicons5";import{cloneDeep as L}from"lodash-es";import{simplifyMessage as S}from"../utils/index.js";const q={key:0,class:"reference-content-box"},A={class:"reference-content"},O=["innerHTML"],F={class:"tool-box"},H=c("i",{class:"chat--iconfont chat--icon-face"},null,-1),K={class:"emoji-box"},N=c("span",null,"默认表情",-1),V={class:"list-box"},U=["src"],J=c("i",{class:"chat--iconfont chat--icon-good"},null,-1),G=c("i",{class:"chat--iconfont chat--icon-image"},null,-1),X=c("i",{class:"chat--iconfont chat--icon-folder"},null,-1),B={class:"btn-box"},P=c("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Q=e({__name:"ChatFooter",setup(e){const Q=n(),W=n(""),{state:Y,stompClient:Z}=_(),{setCurrentSessionItem:$}=b(Y),ee=n(!1);function ne(e){Y.currentAVMsg.messageType=e,Y.currentAVMsg.callMode="call",Y.showVideo=!0,oe({chatMessageType:e,msg:""})}function te(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),re()))}function se(){var e,n;W.value=(null==(n=null==(e=Q.value)?void 0:e.innerText)?void 0:n.trim())||""}async function ie(e,n){const{file:t,name:s}=e.file,i=new FormData;i.append("sender",Y.userInfo.id),i.append("file",t);const r=await z(i);if(!r)return console.log("上传失败");oe({chatMessageType:n,msg:n===w.FILE?s:r,url:r})}function re(){if(!(W.value.length>2e3))return W.value?void oe({msg:W.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function oe(e){const{chatMessageType:n=w.TEXT,msg:t,url:s}=e,i={msg:t,chatMessageType:n};n===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(n)&&(Q.value.innerHTML="",W.value=""),Y.currentReferenceMsg&&(i.referenceContent=L(Y.currentReferenceMsg),Y.currentReferenceMsg=null);const r=I(new Date,"yyyy-MM-dd HH:mm:ss");Y.currentMsg={content:i,sender:Y.userInfo.id,senderName:Y.userInfo.name,senderAvatar:Y.userInfo.avatar,id:"",sendTime:r,sending:!0,fail:!1},[w.AUDIO,w.VIDEO].includes(n)||(Y.isAppendMsg=!0),$({lastMessageSendTime:r,lastMessage:i,sortTime:r});try{Z.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:Y.currentSessionItem.receiver})),Y.currentMsg={...Y.currentMsg,fail:!1}}catch(e){Y.currentMsg={...Y.currentMsg,fail:!0}}finally{Y.currentMsg={...Y.currentMsg,sending:!1}}}return t((()=>Y.currentReferenceMsg),(e=>{var n;e&&(null==(n=Q.value)||n.focus())})),(e,n)=>s((i(),r("section",{class:"chat-footer",style:o({cursor:a(Y).id?"default":"not-allowed"})},[a(Y).currentReferenceMsg?(i(),r("div",q,[c("div",A,[c("span",null,l(a(Y).currentReferenceMsg.senderName)+":",1),c("pre",{innerHTML:a(S)(a(Y).currentReferenceMsg.content)},null,8,O)]),u(a(h),{component:a(R),onClick:n[0]||(n[0]=()=>a(Y).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),c("div",F,[u(a(M),{show:ee.value,"onUpdate:show":n[1]||(n[1]=e=>ee.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny"},{icon:f((()=>[H])),_:1})])),default:f((()=>[c("div",K,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),N,c("div",V,[(i(!0),r(m,null,p(a(E).default,(([e,n])=>(i(),g(a(C),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[u(a(k),{quaternary:"",size:"tiny",onClick:()=>function(e){ee.value=!1,oe({chatMessageType:w.EMOJI,msg:e})}(e)},{icon:f((()=>[c("img",{src:n},null,8,U)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+l(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),u(a(k),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>oe({chatMessageType:a(w).EMOJI,msg:0}))},{icon:f((()=>[J])),_:1}),u(a(T),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>ie(e,a(w).IMAGE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[G])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(a(T),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>ie(e,a(w).FILE))},{default:f((()=>[u(a(x),{abstract:""},{default:f((({handleClick:e})=>[u(a(k),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[X])),_:2},1032,["onClick"])])),_:1})])),_:1}),u(a(k),{quaternary:"",size:"tiny",onClick:n[5]||(n[5]=()=>ne(a(w).AUDIO))},{icon:f((()=>[u(a(h),{size:"18",component:a(j)},null,8,["component"])])),_:1}),u(a(k),{quaternary:"",size:"tiny",onClick:n[6]||(n[6]=()=>ne(a(w).VIDEO))},{icon:f((()=>[u(a(h),{size:"20",component:a(D)},null,8,["component"])])),_:1})]),s(c("div",{ref_key:"inputRef",ref:Q,class:"input-box",contenteditable:"",onKeydown:te,onInput:se},null,544),[[v,a(Y).id]]),c("div",B,[P,u(a(k),{type:"primary",round:"",disabled:!W.value,onClick:re},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[v,a(Y).id]])}});export{Q as default};
@@ -161,7 +161,7 @@ declare const _default: import("vue").DefineComponent<{}, {
161
161
  fileRef: import("vue").Ref<any>;
162
162
  keyword: import("vue").Ref<any>;
163
163
  handleInput: () => void;
164
- currentInfo: {
164
+ pageInfo: {
165
165
  page: number;
166
166
  hasMore: boolean;
167
167
  lastSendTime: string;
@@ -218,7 +218,7 @@ declare const _default: import("vue").DefineComponent<{}, {
218
218
  startTime: import("vue").Ref<any>;
219
219
  endTime: import("vue").Ref<any>;
220
220
  handleInput: () => void;
221
- currentInfo: {
221
+ pageInfo: {
222
222
  page: number;
223
223
  hasMore: boolean;
224
224
  lastSendTime: string;
@@ -1,5 +1,5 @@
1
1
  import { AnyObject } from '../../../../shared/types';
2
- import { formatTime, downloadFile, simplifyMessage } from '../utils';
2
+ import { formatTime, downloadFile, simplifyMessage, isAudioOrVideoMessage } from '../utils';
3
3
  import { MESSAGE_TYPE } from '../constants';
4
4
  declare const _default: import("vue").DefineComponent<{}, {
5
5
  chatMainRef: import("vue").Ref<HTMLElement | undefined>;
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  setMsgList: (list?: AnyObject[]) => void;
8
8
  setCurrentSessionItem: (item: AnyObject) => void;
9
9
  showMenu: import("vue").Ref<boolean>;
10
- currentInfo: {
10
+ pageInfo: {
11
11
  page: number;
12
12
  hasMore: boolean;
13
13
  lastSendTime: string;
@@ -183,6 +183,7 @@ declare const _default: import("vue").DefineComponent<{}, {
183
183
  formatTime: typeof formatTime;
184
184
  downloadFile: typeof downloadFile;
185
185
  simplifyMessage: typeof simplifyMessage;
186
+ isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
186
187
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
187
188
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
188
189
  EllipsisHorizontal: 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<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as n,openBlock as s,createElementBlock as i,normalizeClass as o,unref as r,createVNode as a,withCtx as c,Fragment as l,renderList as m,toDisplayString as u,createCommentVNode as d,createBlock as p,withModifiers as f,createElementVNode as v}from"vue";import{NImageGroup as y,NAvatar as g,NImage as T,NButtonGroup as M,NButton as h,NIcon as k}from"naive-ui";import{format as _}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useState as L}from"../hooks/useState.js";import{useSession as I}from"../hooks/useSession.js";import{first as j,last as C,isNumber as A}from"lodash-es";import H from"./PersonProfile.vue.js";import b from"./MessageTemplate.vue.js";import{emojis as w}from"../utils/emoji.js";import x from"./ContextMenu.js";import{formatTime as z,simplifyMessage as N,downloadFile as O}from"../utils/index.js";import{MESSAGE_TYPE as P}from"../constants/index.js";import{useScrollLoading as q}from"../hooks/useScrollLoading.js";import{ChatbubbleEllipsesOutline as D,EllipsisHorizontal as R}from"@vicons/ionicons5";const G={key:0,class:"time"},U={key:2,class:"message-box"},J=["data-time"],K={key:0,class:"reference-content"},F=["innerHTML"],X=["innerHTML"],B=["src"],Q=["href","onClick"],V=v("i",{class:"chat--iconfont chat--icon-face"},null,-1);var W=e({__name:"ChatMain",setup(e){const W=t(),{state:Y,setMsgList:Z}=L(),{setCurrentSessionItem:$}=I(Y),ee=t(!1),te={page:0,hasMore:!0,lastSendTime:_(new Date,"yyyy-MM-dd HH:mm:ss")};async function ne(){try{if(!te.hasMore)return;te.page++;const e=await E({sessionKey:Y.currentSessionItem.sessionKey,page:te.page,lastSendTime:te.lastSendTime});if(!Array.isArray(e)||0===e.length)return te.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=j(e).id;te.lastSendTime=C(e).sendTime,Z(te.page>1?[...e,...Y.msgList]:e),1===te.page&&Y.currentSessionItem.unreadNum&&(await S({chatType:"SINGLE",messageIdSet:[t],receiver:Y.userInfo.id,sender:Y.currentSessionItem.receiver}),$({unreadNum:0}))}catch(e){console.log(e)}}function se(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==P.TEMPLATE||!!n}function ie(e,t){var n,s;const{chatMessageType:i,messageTemplate:o}=e.content;if(i===P.TEMPLATE)return"system"===t?2==(null==(n=null==o?void 0:o.setting)?void 0:n.style.id):2!=(null==(s=null==o?void 0:o.setting)?void 0:s.style.id)}function oe(e){var t,n;const{chatMessageType:s,messageTemplate:i}=e;return s===P.TEMPLATE&&3==(null==(n=null==(t=null==i?void 0:i.setting)?void 0:t.style)?void 0:n.id)}function re(e,t){var n;const s=A(e.sendTime)?e.sendTime:Date.parse(e.sendTime),i=null==(n=Y.msgList[t-1])?void 0:n.sendTime;return s-(0===t?0:A(i)?i:Date.parse(i))>3e5}return q(W,(()=>{ne()}),"top"),n((()=>Y.id),(e=>{e&&(Object.assign(te,{page:0,hasMore:!0,lastSendTime:_(new Date,"yyyy-MM-dd HH:mm:ss")}),ne())}),{immediate:!0}),n((()=>Y.isAppendMsg),(e=>{e&&(Z([...Y.msgList,Y.currentMsg]),Y.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=W.value)?void 0:e.scrollHeight)?t:0;null==(n=W.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(s(),i("div",{class:o(["chat-main",{"home-bg":!r(Y).id}]),ref_key:"chatMainRef",ref:W},[a(r(y),{"show-toolbar-tooltip":""},{default:c((()=>[(s(!0),i(l,null,m(r(Y).msgList,((e,n)=>(s(),i(l,{key:n},[se(e)?(s(),i("div",{key:0,class:o(["message-item",{"message-item--mine":e.sender==r(Y).userInfo.id}])},[re(e,n)?(s(),i("p",G,u(r(z)(e.sendTime).recordTime),1)):d("v-if",!0),ie(e,"system")?(s(),p(b,{key:1,data:e},null,8,["data"])):(s(),i("div",U,[a(H,{"user-id":e.sender},{trigger:c((()=>[a(r(g),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(s(),i("div",{key:0,class:o(["content",{emoji:e.content.chatMessageType===r(P).EMOJI,template:e.content.chatMessageType===r(P).TEMPLATE,"template--3":oe(e.content)}]),"data-time":e.__time,onContextmenu:t[0]||(t[0]=f((e=>ee.value=!0),["prevent"]))},[e.content.chatMessageType===r(P).TEXT?(s(),i(l,{key:0},[e.content.referenceContent?(s(),i("div",K,[v("span",null,u(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:r(N)(e.content.referenceContent.content)},null,8,F)])):d("v-if",!0),v("pre",{innerHTML:e.__content},null,8,X)],64)):d("v-if",!0),e.content.chatMessageType===r(P).EMOJI?(s(),i("img",{key:1,src:r(w).findEmoji(e.__content)},null,8,B)):d("v-if",!0),ie(e,"template")?(s(),p(b,{key:2,data:e},null,8,["data"])):d("v-if",!0),e.content.chatMessageType===r(P).IMAGE?(s(),p(r(T),{key:3,width:"240",src:e.__content},null,8,["src"])):d("v-if",!0),e.content.chatMessageType===r(P).FILE?(s(),i("a",{key:4,href:e.content.fileUrl,onClick:f((()=>r(O)(e.content.fileUrl,e.__content)),["prevent"])},u(e.__content),9,Q)):d("v-if",!0),d(' <div class="quick-menu">\n\t\t\t\t\t\t\t\t\t<n-icon :component="AddCircleOutline" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="ChatbubbleEllipsesOutline" @click="() => setReferenceMsg(item)" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="EllipsisHorizontal" />\n\t\t\t\t\t\t\t\t</div> '),a(r(M),{class:"quick-menu"},{default:c((()=>[a(r(h),{quaternary:"",size:"tiny"},{icon:c((()=>[V])),_:1}),a(r(h),{quaternary:"",size:"tiny",onClick:()=>{return t=e,Y.currentReferenceMsg=t,void Object.assign(Y.currentReferenceMsg,{chatType:"SINGLE",receiver:Y.currentSessionItem.receiver,receiverAvatar:Y.currentSessionItem.avatar,receiverName:Y.currentSessionItem.name});var t}},{icon:c((()=>[a(r(k),{size:"17",component:r(D)},null,8,["component"])])),_:2},1032,["onClick"]),a(r(h),{quaternary:"",size:"tiny"},{icon:c((()=>[a(r(k),{component:r(R)},null,8,["component"])])),_:1})])),_:2},1024)],42,J)):d("v-if",!0)]))],2)):d("v-if",!0)],64)))),128))])),_:1}),a(r(x),{show:ee.value,"onUpdate:show":t[1]||(t[1]=e=>ee.value=e)},null,8,["show"])],2))}});export{W as default};
1
+ import{defineComponent as e,ref as t,watch as n,openBlock as s,createElementBlock as i,normalizeClass as o,unref as r,createVNode as a,withCtx as c,Fragment as l,renderList as m,toDisplayString as u,createCommentVNode as d,createBlock as p,withModifiers as f,createElementVNode as v}from"vue";import{NImageGroup as y,NAvatar as g,NImage as T,NButtonGroup as M,NButton as h,NIcon as k}from"naive-ui";import{format as _}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as S}from"../api/index.js";import{useState as L}from"../hooks/useState.js";import{useSession as I}from"../hooks/useSession.js";import{first as j,last as C,isNumber as A}from"lodash-es";import H from"./PersonProfile.vue.js";import b from"./MessageTemplate.vue.js";import{emojis as w}from"../utils/emoji.js";import x from"./ContextMenu.js";import{formatTime as z,simplifyMessage as N,isAudioOrVideoMessage as O,downloadFile as P}from"../utils/index.js";import{MESSAGE_TYPE as q}from"../constants/index.js";import{useScrollLoading as D}from"../hooks/useScrollLoading.js";import{ChatbubbleEllipsesOutline as R,EllipsisHorizontal as G}from"@vicons/ionicons5";const U={key:0,class:"time"},J={key:2,class:"message-box"},K=["data-time"],F={key:0,class:"reference-content"},X=["innerHTML"],B=["innerHTML"],Q=["src"],V={key:4},W=["href","onClick"],Y=v("i",{class:"chat--iconfont chat--icon-face"},null,-1);var Z=e({__name:"ChatMain",setup(e){const Z=t(),{state:$,setMsgList:ee}=L(),{setCurrentSessionItem:te}=I($),ne=t(!1),se={page:0,hasMore:!0,lastSendTime:_(new Date,"yyyy-MM-dd HH:mm:ss")};async function ie(){try{if(!se.hasMore)return;se.page++;const e=await E({sessionKey:$.currentSessionItem.sessionKey,page:se.page,lastSendTime:se.lastSendTime});if(!Array.isArray(e)||0===e.length)return se.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=j(e).id;se.lastSendTime=C(e).sendTime,ee(se.page>1?[...e,...$.msgList]:e),1===se.page&&$.currentSessionItem.unreadNum&&(await S({chatType:"SINGLE",messageIdSet:[t],receiver:$.userInfo.id,sender:$.currentSessionItem.receiver}),te({unreadNum:0}))}catch(e){console.log(e)}}function oe(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==q.TEMPLATE||!!n}function re(e,t){var n,s;const{chatMessageType:i,messageTemplate:o}=e.content;if(i===q.TEMPLATE)return"system"===t?2==(null==(n=null==o?void 0:o.setting)?void 0:n.style.id):2!=(null==(s=null==o?void 0:o.setting)?void 0:s.style.id)}function ae(e){var t,n;const{chatMessageType:s,messageTemplate:i}=e;return s===q.TEMPLATE&&3==(null==(n=null==(t=null==i?void 0:i.setting)?void 0:t.style)?void 0:n.id)}function ce(e,t){var n;const s=A(e.sendTime)?e.sendTime:Date.parse(e.sendTime),i=null==(n=$.msgList[t-1])?void 0:n.sendTime;return s-(0===t?0:A(i)?i:Date.parse(i))>3e5}return D(Z,(()=>{ie()}),"top"),n((()=>$.id),(e=>{e&&(Object.assign(se,{page:0,hasMore:!0,lastSendTime:_(new Date,"yyyy-MM-dd HH:mm:ss")}),ie())}),{immediate:!0}),n((()=>$.isAppendMsg),(e=>{e&&(ee([...$.msgList,$.currentMsg]),$.isAppendMsg=!1,async function(){var e,t,n;const s=null!=(t=null==(e=Z.value)?void 0:e.scrollHeight)?t:0;null==(n=Z.value)||n.scrollTo({top:s,behavior:"auto"})}())}),{immediate:!0}),(e,t)=>(s(),i("div",{class:o(["chat-main",{"home-bg":!r($).id}]),ref_key:"chatMainRef",ref:Z},[a(r(y),{"show-toolbar-tooltip":""},{default:c((()=>[(s(!0),i(l,null,m(r($).msgList,((e,n)=>(s(),i(l,{key:n},[oe(e)?(s(),i("div",{key:0,class:o(["message-item",{"message-item--mine":e.sender==r($).userInfo.id}])},[ce(e,n)?(s(),i("p",U,u(r(z)(e.sendTime).recordTime),1)):d("v-if",!0),re(e,"system")?(s(),p(b,{key:1,data:e},null,8,["data"])):(s(),i("div",J,[a(H,{"user-id":e.sender},{trigger:c((()=>[a(r(g),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id"]),e.content?(s(),i("div",{key:0,class:o(["content",{emoji:e.content.chatMessageType===r(q).EMOJI,template:e.content.chatMessageType===r(q).TEMPLATE,"template--3":ae(e.content)}]),"data-time":e.__time,onContextmenu:t[0]||(t[0]=f((e=>ne.value=!0),["prevent"]))},[e.content.chatMessageType===r(q).TEXT?(s(),i(l,{key:0},[e.content.referenceContent?(s(),i("div",F,[v("span",null,u(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:r(N)(e.content.referenceContent.content)},null,8,X)])):d("v-if",!0),v("pre",{innerHTML:e.__content},null,8,B)],64)):d("v-if",!0),e.content.chatMessageType===r(q).EMOJI?(s(),i("img",{key:1,src:r(w).findEmoji(e.__content)},null,8,Q)):d("v-if",!0),re(e,"template")?(s(),p(b,{key:2,data:e},null,8,["data"])):d("v-if",!0),e.content.chatMessageType===r(q).IMAGE?(s(),p(r(T),{key:3,width:"240",src:e.__content},null,8,["src"])):d("v-if",!0),r(O)(e.content)?(s(),i("span",V,"音视频通话")):d("v-if",!0),e.content.chatMessageType===r(q).FILE?(s(),i("a",{key:5,href:e.content.fileUrl,onClick:f((()=>r(P)(e.content.fileUrl,e.__content)),["prevent"])},u(e.__content),9,W)):d("v-if",!0),d(' <div class="quick-menu">\n\t\t\t\t\t\t\t\t\t<n-icon :component="AddCircleOutline" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="ChatbubbleEllipsesOutline" @click="() => setReferenceMsg(item)" />\n\t\t\t\t\t\t\t\t\t<n-icon :component="EllipsisHorizontal" />\n\t\t\t\t\t\t\t\t</div> '),a(r(M),{class:"quick-menu"},{default:c((()=>[a(r(h),{quaternary:"",size:"tiny"},{icon:c((()=>[Y])),_:1}),a(r(h),{quaternary:"",size:"tiny",onClick:()=>{return t=e,$.currentReferenceMsg=t,void Object.assign($.currentReferenceMsg,{chatType:"SINGLE",receiver:$.currentSessionItem.receiver,receiverAvatar:$.currentSessionItem.avatar,receiverName:$.currentSessionItem.name});var t}},{icon:c((()=>[a(r(k),{size:"17",component:r(R)},null,8,["component"])])),_:2},1032,["onClick"]),a(r(h),{quaternary:"",size:"tiny"},{icon:c((()=>[a(r(k),{component:r(G)},null,8,["component"])])),_:1})])),_:2},1024)],42,K)):d("v-if",!0)]))],2)):d("v-if",!0)],64)))),128))])),_:1}),a(r(x),{show:ne.value,"onUpdate:show":t[1]||(t[1]=e=>ne.value=e)},null,8,["show"])],2))}});export{Z as default};
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<{
24
24
  startTime: import("vue").Ref<any>;
25
25
  endTime: import("vue").Ref<any>;
26
26
  handleInput: () => void;
27
- currentInfo: {
27
+ pageInfo: {
28
28
  page: number;
29
29
  hasMore: boolean;
30
30
  lastSendTime: string;
@@ -1,13 +1,20 @@
1
+ import { AnyObject } from '../../../../shared/types';
1
2
  declare const _default: import("vue").DefineComponent<{}, {
2
- cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
3
+ cssVars: import("vue").ComputedRef<AnyObject>;
4
+ listRef: import("vue").Ref<any>;
3
5
  inputRef: import("vue").Ref<any>;
4
6
  showSearch: import("vue").Ref<boolean>;
5
7
  keyword: import("vue").Ref<any>;
6
8
  userList: import("vue").Ref<any>;
7
9
  state: import("../types").IState;
8
- openSession: (item: import("../../../../shared/types").AnyObject) => Promise<void>;
9
- handleInput: () => Promise<void>;
10
+ openSession: (item: AnyObject) => Promise<void>;
11
+ pageInfo: {
12
+ page: number;
13
+ hasMore: boolean;
14
+ };
15
+ handleInput: () => void;
10
16
  handleSearch: () => Promise<void>;
17
+ resetAndSearch: () => void;
11
18
  addSession: (userId: string) => Promise<void>;
12
19
  NPopover: any;
13
20
  NButton: any;