cnhis-design-vue 3.2.6-beta.2 → 3.2.6-beta.20

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 (188) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/index.d.ts +4 -0
  7. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  8. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  9. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  10. package/es/components/button-print/src/utils/print.d.ts +4 -2
  11. package/es/components/button-print/src/utils/print.js +1 -1
  12. package/es/components/callback/src/components/render/popupMaps.d.ts +6 -4
  13. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  14. package/es/components/default-page/index.d.ts +11 -3
  15. package/es/components/default-page/src/constants/index.d.ts +1 -0
  16. package/es/components/default-page/src/constants/index.js +1 -1
  17. package/es/components/default-page/src/index.vue.d.ts +11 -3
  18. package/es/components/default-page/src/index.vue2.js +1 -1
  19. package/es/components/default-page/style/index.css +1 -1
  20. package/es/components/expand-field/index.d.ts +1109 -321
  21. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +1109 -321
  22. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +1109 -321
  23. package/es/components/expand-field/src/components/form.vue.d.ts +1109 -321
  24. package/es/components/expand-field/src/index.vue.d.ts +1109 -321
  25. package/es/components/fabric-chart/src/constants/index.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -0
  27. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +2 -2
  29. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  32. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  33. package/es/components/form-config/index.d.ts +12 -8
  34. package/es/components/form-config/src/FormConfig.vue.d.ts +12 -8
  35. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  36. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -4
  37. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -4
  38. package/es/components/form-config/src/utils/index.d.ts +1 -0
  39. package/es/components/form-config/src/utils/index.js +1 -1
  40. package/es/components/form-render/index.d.ts +6 -4
  41. package/es/components/form-render/index.js +1 -1
  42. package/es/components/form-render/src/FormRender.vue.d.ts +5 -3
  43. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  44. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -4
  45. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  46. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  47. package/es/components/form-render/src/components/renderer/select.js +1 -1
  48. package/es/components/form-render/src/hooks/index.d.ts +0 -1
  49. package/es/components/form-render/src/hooks/index.js +1 -1
  50. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  51. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  52. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  53. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -0
  54. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  55. package/es/components/form-render/src/types/index.d.ts +4 -1
  56. package/es/components/form-render/src/utils/index.d.ts +1 -0
  57. package/es/components/form-render/src/utils/index.js +1 -1
  58. package/es/components/iho-chat/index.d.ts +543 -35
  59. package/es/components/iho-chat/src/Index.vue.d.ts +549 -40
  60. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  61. package/es/components/iho-chat/src/api/index.d.ts +5 -0
  62. package/es/components/iho-chat/src/api/index.js +1 -1
  63. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +89 -0
  64. package/es/components/iho-chat/src/components/ChatAdd.vue.js +1 -0
  65. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -0
  66. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
  67. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  68. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +103 -30
  69. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  70. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +131 -5
  71. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  72. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +26 -3
  73. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  74. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -2
  75. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  76. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +10 -3
  77. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  78. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +16 -1
  79. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  80. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +133 -0
  81. package/es/components/iho-chat/src/components/MultipleVideo.vue.js +1 -0
  82. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -0
  83. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +15 -1
  84. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  85. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  86. package/es/components/iho-chat/src/components/Video.vue.d.ts +43 -27
  87. package/es/components/iho-chat/src/components/Video.vue.js +1 -0
  88. package/es/components/iho-chat/src/components/Video.vue2.js +1 -0
  89. package/es/components/iho-chat/src/constants/index.d.ts +10 -1
  90. package/es/components/iho-chat/src/constants/index.js +1 -1
  91. package/es/components/iho-chat/src/hooks/index.d.ts +1 -0
  92. package/es/components/iho-chat/src/hooks/index.js +1 -1
  93. package/es/components/iho-chat/src/hooks/useSession.d.ts +1 -0
  94. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  95. package/es/components/iho-chat/src/hooks/useState.d.ts +5 -0
  96. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  97. package/es/components/iho-chat/src/hooks/useVideo.d.ts +24 -0
  98. package/es/components/iho-chat/src/hooks/useVideo.js +1 -0
  99. package/es/components/iho-chat/src/types/index.d.ts +5 -0
  100. package/es/components/iho-chat/src/utils/index.d.ts +3 -2
  101. package/es/components/iho-chat/src/utils/index.js +1 -1
  102. package/es/components/iho-chat/style/index.css +1 -1
  103. package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -1
  104. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -1
  105. package/es/components/index.css +1 -1
  106. package/es/components/index.js +1 -1
  107. package/es/components/info-header/index.d.ts +18 -14
  108. package/es/components/info-header/src/InfoHeader.vue.d.ts +18 -14
  109. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +6 -6
  110. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +6 -6
  111. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +3 -3
  112. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +3 -3
  113. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +1 -1
  114. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +12 -10
  115. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -4
  116. package/es/components/recommend-search/index.d.ts +8 -8
  117. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  118. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  119. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  120. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  121. package/es/components/scale-view/index.d.ts +29 -1
  122. package/es/components/scale-view/src/ScaleView.vue.d.ts +29 -1
  123. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  124. package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +3 -1
  125. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  126. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +8 -0
  127. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  128. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  129. package/es/components/select-person/index.d.ts +1109 -321
  130. package/es/components/select-person/index.js +1 -1
  131. package/es/components/select-person/src/SelectPerson.vue.d.ts +4 -10
  132. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  133. package/es/components/select-person/src/SelectPersonType.vue.d.ts +314 -0
  134. package/es/components/select-person/src/SelectPersonType.vue.js +1 -0
  135. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -0
  136. package/es/components/select-person/src/components/SearchMultiple.vue.js +1 -0
  137. package/es/components/select-person/src/components/SearchOrgAndStaff.vue.js +1 -0
  138. package/es/components/select-person/src/constants/index.d.ts +2 -0
  139. package/es/components/select-person/src/constants/index.js +1 -0
  140. package/es/components/select-person/src/index.vue.d.ts +1385 -0
  141. package/es/components/select-person/src/index.vue.js +1 -0
  142. package/es/components/select-person/src/index.vue2.js +1 -0
  143. package/es/components/shortcut-setter/index.d.ts +6 -4
  144. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -4
  145. package/es/env.d.ts +25 -25
  146. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  147. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  148. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  149. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  150. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  151. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  152. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  153. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  154. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  155. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  156. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  157. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  158. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  159. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  160. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  161. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  162. package/es/shared/assets/img/failure.png.js +1 -1
  163. package/es/shared/assets/img/no-permission.png.js +1 -1
  164. package/es/shared/assets/img/nodata.png.js +1 -1
  165. package/es/shared/assets/img/notfound.png.js +1 -1
  166. package/es/shared/assets/img/qr.png.js +1 -1
  167. package/es/shared/assets/img/success.png.js +1 -1
  168. package/es/shared/assets/img/table_style_2.png.js +1 -1
  169. package/es/shared/assets/img/video.png.js +1 -1
  170. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  171. package/es/shared/assets/img/xb_big.png.js +1 -1
  172. package/es/shared/assets/img/xb_small.png.js +1 -1
  173. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  174. package/es/shared/hooks/useAsyncQueue/index.d.ts +3 -0
  175. package/es/shared/hooks/useAsyncQueue/index.js +1 -1
  176. package/es/shared/package.json.js +1 -1
  177. package/es/shared/utils/business.js +1 -1
  178. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  179. package/es/shared/utils/tapable/index.d.ts +139 -0
  180. package/package.json +2 -2
  181. package/es/components/form-render/src/hooks/useAutoHidden.d.ts +0 -4
  182. package/es/components/form-render/src/hooks/useAutoHidden.js +0 -1
  183. package/es/components/select-person/src/SearchMultiple.vue.js +0 -1
  184. package/es/components/select-person/src/SearchOrgAndStaff.vue.js +0 -1
  185. /package/es/components/select-person/src/{SearchMultiple.vue.d.ts → components/SearchMultiple.vue.d.ts} +0 -0
  186. /package/es/components/select-person/src/{SearchMultiple.vue2.js → components/SearchMultiple.vue2.js} +0 -0
  187. /package/es/components/select-person/src/{SearchOrgAndStaff.vue.d.ts → components/SearchOrgAndStaff.vue.d.ts} +0 -0
  188. /package/es/components/select-person/src/{SearchOrgAndStaff.vue2.js → components/SearchOrgAndStaff.vue2.js} +0 -0
@@ -1,38 +1,54 @@
1
1
  import TRTC from 'trtc-sdk-v5';
2
- declare const _default: import("vue").DefineComponent<{
3
- show: {
4
- type: BooleanConstructor;
5
- default: boolean;
6
- };
7
- }, {
8
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
9
- show: {
10
- type: BooleanConstructor;
11
- default: boolean;
12
- };
13
- }>> & {
14
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
15
- }>>;
16
- emit: (event: "update:show", ...args: any[]) => void;
2
+ import { AV_STATUS } from '../constants';
3
+ declare const _default: import("vue").DefineComponent<{}, {
4
+ sendMessage: (message: {
5
+ chatType?: string | undefined;
6
+ content: import("../../../../shared/types").AnyObject;
7
+ receiver?: string | undefined;
8
+ }) => Promise<void>;
17
9
  state: import("../types").IState;
10
+ trtc: TRTC;
11
+ timing: import("vue").Ref<string>;
12
+ voiceOpen: import("vue").Ref<boolean>;
13
+ isAudio: import("vue").ComputedRef<boolean>;
14
+ isCall: import("vue").ComputedRef<boolean>;
15
+ startTimer: () => void;
16
+ resetTimer: () => void;
17
+ toggleAudio: () => Promise<void>;
18
+ messageTypeText: import("vue").ComputedRef<"语音" | "视频">;
19
+ time: {
20
+ timer: any;
21
+ seconds: number;
22
+ };
18
23
  videoRef: import("vue").Ref<any>;
19
24
  selfVideoRef: import("vue").Ref<any>;
20
- trtc: TRTC;
25
+ isConnect: import("vue").Ref<boolean>;
26
+ timeout: any;
27
+ info: import("vue").ComputedRef<{
28
+ avatar: any;
29
+ name: any;
30
+ userId: any;
31
+ }>;
32
+ tipContent: import("vue").ComputedRef<string>;
33
+ status: import("vue").ComputedRef<any>;
34
+ handleStatus: (status?: AV_STATUS) => Promise<void>;
35
+ init: () => Promise<void>;
21
36
  handleEnter: () => Promise<void>;
37
+ handleFinish: () => void;
38
+ handleExit: () => Promise<void>;
22
39
  installEventHandlers: () => void;
40
+ uninstallEventHandlers: () => void;
41
+ handleRemoteVideoAvailable: (event: any) => Promise<void>;
42
+ handleRemoteAudioAvailable: (event: any) => void;
43
+ handleRemoteUserEnter: () => void;
44
+ handleRemoteUserExit: (event: any) => void;
45
+ handleError: (error: any) => void;
23
46
  NButton: any;
24
47
  NAvatar: any;
25
48
  NIcon: any;
26
- 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<{}>>, {}>;
27
49
  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<{}>>, {}>;
28
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
- show: {
30
- type: BooleanConstructor;
31
- default: boolean;
32
- };
33
- }>> & {
34
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
35
- }, {
36
- show: boolean;
37
- }>;
50
+ 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<{}>>, {}>;
51
+ 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<{}>>, {}>;
52
+ AV_STATUS: typeof AV_STATUS;
53
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
38
54
  export default _default;
@@ -0,0 +1 @@
1
+ import e from"./Video.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","Video.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,computed as n,watch as s,openBlock as t,createElementBlock as r,withDirectives as a,createElementVNode as i,vShow as c,createVNode as l,unref as u,toDisplayString as d,Fragment as E,normalizeClass as v,withCtx as m}from"vue";import{NAvatar as f,NButton as p,NIcon as I}from"naive-ui";import{Mic as T,MicOffCircle as V,Call as A}from"@vicons/ionicons5";import"date-fns";import"lodash-es";import{AV_STATUS as R,CHAT_TYPE as g}from"../constants/index.js";import"../utils/emoji.js";import{avFinishApi as _}from"../api/index.js";import{useVideo as M}from"../hooks/useVideo.js";import y from"trtc-sdk-v5";const N={class:"video-wrapper"},S={class:"user"},w={class:"name"},O={class:"tip"},k={class:"opt-btn"},L={class:"btn"},h=i("span",null,"静音",-1),D=i("span",null,"拒接",-1),C={class:"btn"},b=i("span",null,"挂断",-1),x=i("span",null,"接听",-1);var U=e({__name:"Video",setup(e){const{sendMessage:U,state:j,trtc:z,timing:H,voiceOpen:B,isAudio:F,isCall:X,startTimer:G,resetTimer:J,toggleAudio:P,messageTypeText:$,time:q}=M(),K=o(),Q=o(),W=o(!1);let Y=null;const Z=n((()=>{var e,o,n;return X.value?{avatar:j.currentSessionItem.avatar,name:j.currentSessionItem.name,userId:j.currentSessionItem.receiver}:{avatar:null==(e=j.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=j.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=j.currentAVMsg.currentMsg)?void 0:n.sender}})),ee=n((()=>W.value?F.value?H.value:"":X.value?"正在呼叫...":`邀请你${$.value}问诊...`)),oe=n((()=>{var e,o;return null==(o=null==(e=j.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function ne(e=R.FINISHED){U({chatType:g.SINGLE,content:{msg:e===R.FINISHED?""+q.seconds:"s",chatMessageType:j.currentAVMsg.chatMessageType,avStatus:e},receiver:Z.value.userId}),await _({recordId:j.currentAVMsg.currentMsg.id,status:e,duration:e===R.FINISHED?q.seconds:0})}async function se(){const e=await y.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(j.showVideo=!1);try{if(await z.enterRoom({strRoomId:j.currentAVMsg.strRoomId,sdkAppId:parseInt(j.userInfo.sdkAppID),userId:j.userInfo.id,userSig:j.userInfo.userSig}),X.value||(W.value=!0,G()),function(){if(z.on(y.EVENT.ERROR,ue),z.on(y.EVENT.REMOTE_USER_ENTER,ce),z.on(y.EVENT.REMOTE_AUDIO_AVAILABLE,ie),z.on(y.EVENT.REMOTE_USER_EXIT,le),F.value)return;z.on(y.EVENT.REMOTE_VIDEO_AVAILABLE,ae)}(),await z.startLocalAudio(),F.value)return;await z.startLocalVideo({view:Q.value})}catch(e){console.log("error :>> ",e),j.showVideo=!1}}function te(){X.value&&!W.value?ne(R.CANCELED):ne()}async function re(){try{if(j.showVideo=!1,function(){if(z.off(y.EVENT.ERROR,ue),z.off(y.EVENT.REMOTE_USER_ENTER,ce),z.off(y.EVENT.REMOTE_AUDIO_AVAILABLE,ie),z.off(y.EVENT.REMOTE_USER_EXIT,le),F.value)return;z.off(y.EVENT.REMOTE_VIDEO_AVAILABLE,ae)}(),await z.exitRoom(),await z.stopLocalAudio(),F.value)return;await z.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ae(e){const{userId:o,streamType:n}=e;try{await z.startRemoteVideo({userId:o,streamType:n,view:K.value})}catch(e){console.log("error :>> ",e)}}function ie(e){}function ce(){W.value=!0,G()}function le(e){console.log("event :>> 对方已挂断",e),re()}function ue(e){console.log("error :>> ",e),j.showVideo=!1}return s((()=>oe.value),(e=>{j.showVideo&&(e===R.IN_CALL?async function(){X.value?se():(Y&&clearTimeout(Y),Y=setTimeout((async()=>{W.value||ne(R.NO_RESPONSE)}),6e4))}():re())}),{immediate:!0}),(e,o)=>(t(),r("div",N,[a(i("div",{class:"video-box",ref_key:"videoRef",ref:K},null,512),[[c,W.value]]),a(i("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:Q},null,512),[[c,W.value]]),a(i("div",S,[l(u(f),{size:58,round:"",src:u(Z).avatar},null,8,["src"]),i("span",w,d(u(Z).name),1),i("span",O,d(u(ee)),1)],512),[[c,u(F)||!W.value]]),i("div",k,[i("div",L,[u(X)&&!W.value||W.value?(t(),r(E,{key:0},[l(u(p),{circle:"",onClick:u(P),class:v({bordered:u(B)})},{icon:m((()=>[l(u(I),{size:"30",color:u(B)?"#fff":"#626262",component:u(B)?u(T):u(V)},null,8,["color","component"])])),_:1},8,["onClick","class"]),h],64)):(t(),r(E,{key:1},[l(u(p),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>ne(u(R).REJECTED))},{icon:m((()=>[l(u(I),{size:"30",component:u(A)},null,8,["component"])])),_:1}),D],64))]),i("div",C,[u(X)&&!W.value||W.value?(t(),r(E,{key:0},[l(u(p),{circle:"",color:"#f17568",class:"btn--rotate",onClick:te},{icon:m((()=>[l(u(I),{size:"30",component:u(A)},null,8,["component"])])),_:1}),b],64)):(t(),r(E,{key:1},[l(u(p),{circle:"",color:"#2ac98b",onClick:se},{icon:m((()=>[l(u(I),{size:"30",component:u(A)},null,8,["component"])])),_:1}),x],64))])])]))}});export{U as default};
@@ -1,3 +1,10 @@
1
+ /**
2
+ * 订阅消息类别
3
+ */
4
+ export declare enum CHAT_TYPE {
5
+ SINGLE = "SINGLE",
6
+ GROUP = "GROUP"
7
+ }
1
8
  /**
2
9
  * 聊天消息类型
3
10
  */
@@ -20,13 +27,15 @@ export declare enum SUBSCRIBE_MESSAGE_TYPE {
20
27
  JOIN = "JOIN",
21
28
  LEAVE = "LEAVE",
22
29
  NEW_SESSION = "NEW_SESSION",
23
- MESSAGE = "MESSAGE"
30
+ MESSAGE = "MESSAGE",
31
+ AV_STATUS = "AV_STATUS"
24
32
  }
25
33
  /**
26
34
  * 音视频接通状态
27
35
  */
28
36
  export declare enum AV_STATUS {
29
37
  IN_CALL = "IN_CALL",
38
+ CALL_BUSY = "CALL_BUSY",
30
39
  NO_RESPONSE = "NO_RESPONSE",
31
40
  FINISHED = "FINISHED",
32
41
  REJECTED = "REJECTED",
@@ -1 +1 @@
1
- var E=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(E||{}),I=(E=>(E.JOIN="JOIN",E.LEAVE="LEAVE",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E))(I||{}),N=(E=>(E.IN_CALL="IN_CALL",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(N||{});export{N as AV_STATUS,E as MESSAGE_TYPE,I as SUBSCRIBE_MESSAGE_TYPE};
1
+ var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),I=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(I||{}),S=(E=>(E.JOIN="JOIN",E.LEAVE="LEAVE",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E))(S||{}),A=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(A||{});export{A as AV_STATUS,E as CHAT_TYPE,I as MESSAGE_TYPE,S as SUBSCRIBE_MESSAGE_TYPE};
@@ -1,2 +1,3 @@
1
1
  export * from './useState';
2
2
  export * from './useSession';
3
+ export * from './useVideo';
@@ -1 +1 @@
1
- export{useState}from"./useState.js";export{useSession}from"./useSession.js";
1
+ export{useState}from"./useState.js";export{useSession}from"./useSession.js";export{useVideo}from"./useVideo.js";
@@ -8,4 +8,5 @@ export declare function useSession(state: IState): {
8
8
  setUpdateSessionItem: (item: AnyObject) => void;
9
9
  unreadTotal: import("vue").ComputedRef<number>;
10
10
  setSessionList: (list: AnyObject[]) => void;
11
+ isGroupChat: import("vue").ComputedRef<boolean>;
11
12
  };
@@ -1 +1 @@
1
- import{computed as s}from"vue";import{simplifyMessage as e,isAudioOrVideo as t}from"../utils/index.js";import{uniqBy as n}from"lodash-es";function i(i){function o(s){Object.assign(i.currentSessionItem,s,{lastMessageContent:s.lastMessage?e(s.lastMessage):i.currentSessionItem.lastMessageContent||""}),i.isChangeSession=!0,i.id!==i.currentSessionItem.id&&(i.msgList=[],i.id=i.currentSessionItem.id)}return{openSession:async function(s){o(s)},closeSession:function(){if(!i.id)return null;const{currentSessionItem:s}=i;return i.currentSessionItem={},i.msgList=[],i.id="",s},getCurrentSession:function(){return i.id?i.currentSessionItem:null},setCurrentSessionItem:o,setUpdateSessionItem:function(s){Object.assign(i.updateSessionItem,s,{lastMessageContent:s.lastMessage?e(s.lastMessage):""}),t(s.lastMessage)||(i.isUpdateSession=!0)},unreadTotal:s((()=>i.sessionList.reduce(((s,e)=>s+ +e.unreadNum),0))),setSessionList:function(s){i.sessionList=n(s.map((s=>{const{lastMessage:t}=s;return{...s,lastMessageContent:Reflect.has(s,"lastMessageContent")?s.lastMessageContent:t?e(t):""}})),"id")}}}export{i as useSession};
1
+ import{computed as e}from"vue";import{simplifyMessage as s}from"../utils/index.js";import{cloneDeep as t,isArray as n,uniqBy as i}from"lodash-es";import{CHAT_TYPE as o}from"../constants/index.js";import{groupUserApi as r}from"../api/index.js";function u(e){return e.chatType===o.GROUP}function a(e){const{lastMessage:t,lastSenderName:n=""}=e,i=s(t);return u(e)&&n?n+": "+i:i}function c(s){const o=e((()=>s.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),c=e((()=>u(s.currentSessionItem)));function m(e){Object.assign(s.currentSessionItem,e,{lastMessageContent:e.lastMessage?a({...e,chatType:e.chatType||s.currentSessionItem.chatType}):s.currentSessionItem.lastMessageContent}),s.isChangeSession=!0,s.id!==s.currentSessionItem.id&&(s.msgList=[],s.id=s.currentSessionItem.id)}return{openSession:async function(e){const i=s.currentSessionItem.sessionKey;if(m(e),i!==s.currentSessionItem.sessionKey)if(c.value){const t=await r({id:e.receiver});s.currentGroupUser=n(t)?t:[]}else s.currentGroupUser=[s.userInfo,{...t(e),id:e.receiver}]},closeSession:function(){if(!s.id)return null;const{currentSessionItem:e}=s;return s.currentSessionItem={},s.msgList=[],s.id="",e},getCurrentSession:function(){return s.id?s.currentSessionItem:null},setCurrentSessionItem:m,setUpdateSessionItem:function(e){const n=s.sessionList.find((s=>s.sessionKey===e.sessionKey)),i={...e,lastMessageContent:a({...e,chatType:e.chatType||(null==n?void 0:n.chatType)})};s.updateSessionItem=n?{...t(n),...i}:i,s.isUpdateSession=!0},unreadTotal:o,setSessionList:function(e){s.sessionList=i(e,"id").map((e=>({...e,lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:a(e)})))},isGroupChat:c}}export{c as useSession};
@@ -4,4 +4,9 @@ export declare function useState(): {
4
4
  setMsgList: (list?: AnyObject[]) => void;
5
5
  stompClient: import("vue").Ref<import("../utils/chatSock").ChatSock>;
6
6
  emit: (event: string, ...args: any[]) => void;
7
+ sendMessage: (message: {
8
+ chatType?: string;
9
+ content: AnyObject;
10
+ receiver?: string;
11
+ }) => Promise<void>;
7
12
  };
@@ -1 +1 @@
1
- import{inject as t}from"vue";import{formatTime as e,transformMessage as n}from"../utils/index.js";import{InjectionIChatState as s,InjectionIChatStompClient as i,InjectionIChatEmits as m}from"../types/index.js";import{MESSAGE_TYPE as o}from"../constants/index.js";function r(){const r=t(s),c=t(i),T=t(m);return{state:r,setMsgList:function(t=[]){r.msgList=t.map((t=>{var s,i,m;return Object.assign(t,{__time:e(t.sendTime).msgTime,__content:(m=t.content.chatMessageType,[o.TEXT,o.TEXT].includes(m)?n(null==(s=t.content)?void 0:s.msg):null==(i=t.content)?void 0:i.msg)}),t})).sort(((t,e)=>new Date(e.sendTime).getTime()-new Date(t.sendTime).getTime()))},stompClient:c,emit:T}}export{r as useState};
1
+ import{inject as e}from"vue";import{formatTime as t,transformMessage as n}from"../utils/index.js";import{InjectionIChatState as s,InjectionIChatStompClient as i,InjectionIChatEmits as o}from"../types/index.js";import{MESSAGE_TYPE as r}from"../constants/index.js";function m(){const m=e(s),c=e(i),a=e(o);return{state:m,setMsgList:function(e=[]){m.msgList=e.map((e=>{var s,i,o;return Object.assign(e,{__time:t(e.sendTime).msgTime,__content:(o=e.content.chatMessageType,[r.TEXT,r.TEXT].includes(o)?n(null==(s=e.content)?void 0:s.msg):null==(i=e.content)?void 0:i.msg)}),e})).sort(((e,t)=>new Date(t.sendTime).getTime()-new Date(e.sendTime).getTime()))},stompClient:c,emit:a,sendMessage:async function(e){try{c.value.send("/app/chat/send",{},JSON.stringify({chatType:m.currentSessionItem.chatType,receiver:m.currentSessionItem.receiver,...e}))}catch(e){console.log("error :>> ",e)}}}}export{m as useState};
@@ -0,0 +1,24 @@
1
+ import TRTC from 'trtc-sdk-v5';
2
+ export declare function useVideo(): {
3
+ state: import("../types").IState;
4
+ sendMessage: (message: {
5
+ chatType?: string | undefined;
6
+ content: import("../../../../shared/types").AnyObject;
7
+ receiver?: string | undefined;
8
+ }) => Promise<void>;
9
+ trtc: TRTC;
10
+ timing: import("vue").Ref<string>;
11
+ voiceOpen: import("vue").Ref<boolean>;
12
+ videocamOpen: import("vue").Ref<boolean>;
13
+ isAudio: import("vue").ComputedRef<boolean>;
14
+ isCall: import("vue").ComputedRef<boolean>;
15
+ startTimer: () => void;
16
+ resetTimer: () => void;
17
+ toggleAudio: () => Promise<void>;
18
+ toggleVideo: () => Promise<void>;
19
+ messageTypeText: import("vue").ComputedRef<"语音" | "视频">;
20
+ time: {
21
+ timer: any;
22
+ seconds: number;
23
+ };
24
+ };
@@ -0,0 +1 @@
1
+ import{ref as e,computed as t,onBeforeUnmount as s}from"vue";import{useState as a}from"./useState.js";import{MESSAGE_TYPE as i}from"../constants/index.js";import o from"trtc-sdk-v5";import{formatSeconds as n}from"../utils/index.js";function r(){const r={timer:null,seconds:0},{state:u,sendMessage:l}=a(),c=e(""),m=e(!0),d=e(!0),v=t((()=>u.currentAVMsg.chatMessageType===i.AUDIO)),p=t((()=>"call"===u.currentAVMsg.callMode)),g=t((()=>v.value?"语音":"视频")),f=o.create();function A(){c.value="00:00:00",r.timer&&clearInterval(r.timer),r.timer=null,r.seconds=0}return s((()=>{A()})),{state:u,sendMessage:l,trtc:f,timing:c,voiceOpen:m,videocamOpen:d,isAudio:v,isCall:p,startTimer:function(){A(),r.timer=setInterval((()=>{r.seconds++,c.value=n(r.seconds)}),1e3)},resetTimer:A,toggleAudio:async function(){await f.updateLocalAudio({mute:!m.value}),m.value=!m.value},toggleVideo:async function(){await f.updateLocalVideo({mute:!d.value}),d.value=!d.value},messageTypeText:g,time:r}}export{r as useVideo};
@@ -14,6 +14,11 @@ export type IState = {
14
14
  updateSessionItem: AnyObject;
15
15
  isUpdateSession: boolean;
16
16
  currentReferenceMsg: null | AnyObject;
17
+ showVideo: boolean;
18
+ currentAVMsg: AnyObject;
19
+ userList: AnyObject[];
20
+ currentGroupUser: AnyObject[];
21
+ showMultipleVideo: boolean;
17
22
  };
18
23
  export declare const InjectionIChatState: InjectionKey<IState>;
19
24
  export declare const InjectionIChatStompClient: InjectionKey<Ref<ChatSock>>;
@@ -6,8 +6,9 @@ export declare function formatTime(dateStr: string): {
6
6
  };
7
7
  export declare function listSort(list: AnyObject[]): AnyObject[];
8
8
  export declare function transformMessage(content: string): string;
9
+ export declare function getAVTime(msg: string): string;
9
10
  export declare function simplifyMessage(lastMessage: AnyObject): any;
10
11
  export declare function downloadFile(url: string, filename: string): void;
11
12
  export declare function getFileSize(url: string): Promise<unknown>;
12
- export declare function genTestUserSig(sdkAppId: number, userId: string, sdkSecretKey: string): any;
13
- export declare function isAudioOrVideo(message: AnyObject): boolean;
13
+ export declare function isAudioOrVideoMessage(message: AnyObject): boolean;
14
+ export declare function formatSeconds(seconds: number): string;
@@ -1 +1 @@
1
- import{isToday as e,format as t,isYesterday as n}from"date-fns";import{cloneDeep as r}from"lodash-es";import{MESSAGE_TYPE as o}from"../constants/index.js";import{emojis as s}from"./emoji.js";function a(r){const o=new Date(r);let s,a;if(e(o))s=a=t(o,"HH:mm");else{s=n(o)?"昨天":t(o,"MM-dd");const e=o.getFullYear(),r=(new Date).getFullYear();a=t(o,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:s,msgTime:a,recordTime:function(r){const o=new Date(r),s=Date.now()-o.getTime();if(s<6e4)return"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+"分钟前";if(e(o))return"今天 "+t(o,"HH:mm");if(n(o))return"昨天 "+t(o,"HH:mm");{const e=o.getFullYear(),n=(new Date).getFullYear();return t(o,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function i(e){return r(e).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function c(e){if(!e)return"";const t=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return e=e.toString().replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(t(),"<$1 $2>").replace(t("/"),"</$1>").replace(/\n/g,"<br>")}function l(e){var t;const{chatMessageType:n,msg:r,messageTemplate:a}=e;switch(n){case o.TEXT:return c(r);case o.IMAGE:return"[图片]";case o.FILE:return"[文件]";case o.EMOJI:return`<img alt=${r} src=${s.findEmoji(r)}>`;case o.TEMPLATE:return null==(t=null==a?void 0:a.setting)?void 0:t.title;default:return"其他消息"}}function u(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(r){if(200===n.status){const r=window.URL.createObjectURL(n.response),o=document.createElement("a");o.href=r,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function d(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const o=+n;o>1048576?n=(o/1048576).toFixed(2)+"M":o>1024?n=(o/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}function m(e,t,n){const r=e,o=n;null!=r&&""!==o||alert("请先配置好您的账号信息: SDKAPPID 及 SDKSECRETKEY \r\n\r\nPlease configure your SDKAPPID/SDKSECRETKEY in js/debug/GenerateTestUserSig.js");return new window.LibGenerateTestUserSig(r,o,604800).genTestUserSig(t)}function p(e){return[o.AUDIO,o.VIDEO].includes(e.chatMessageType)}export{u as downloadFile,a as formatTime,m as genTestUserSig,d as getFileSize,p as isAudioOrVideo,i as listSort,l as simplifyMessage,c as transformMessage};
1
+ import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as o,isNumber as s,isNaN as a}from"lodash-es";import{MESSAGE_TYPE as i}from"../constants/index.js";import{emojis as c}from"./emoji.js";function u(r){const o=new Date(r);let s,a;if(e(o))s=a=t(o,"HH:mm");else{s=n(o)?"昨天":t(o,"MM-dd");const e=o.getFullYear(),r=(new Date).getFullYear();a=t(o,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:s,msgTime:a,recordTime:function(r){const o=new Date(r),s=Date.now()-o.getTime();if(s<6e4)return"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+"分钟前";if(e(o))return"今天 "+t(o,"HH:mm");if(n(o))return"昨天 "+t(o,"HH:mm");{const e=o.getFullYear(),n=(new Date).getFullYear();return t(o,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function l(e){return o(e).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function m(e){if(!e)return"";const t=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return e=e.toString().replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(t(),"<$1 $2>").replace(t("/"),"</$1>").replace(/\n/g,"<br>")}function p(e){if(e&&s(+e)&&!a(+e)){const t=w(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return"已取消"}function d(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:o}=e,s=H(e)?p(r):"";switch(n){case i.TEXT:return m(r);case i.IMAGE:return"[图片]";case i.FILE:return"[文件]";case i.EMOJI:return`<img alt=${r} src=${c.findEmoji(r)}>`;case i.TEMPLATE:return null==(t=null==o?void 0:o.setting)?void 0:t.title;case i.VIDEO:return`[视频通话]${s}`;case i.AUDIO:return`[语音通话]${s}`;default:return"其他消息"}}function g(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(r){if(200===n.status){const r=window.URL.createObjectURL(n.response),o=document.createElement("a");o.href=r,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function f(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const o=+n;o>1048576?n=(o/1048576).toFixed(2)+"M":o>1024?n=(o/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}function H(e){return e&&[i.AUDIO,i.VIDEO].includes(e.chatMessageType)}function w(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{g as downloadFile,w as formatSeconds,u as formatTime,p as getAVTime,f as getFileSize,H as isAudioOrVideoMessage,l as listSort,d as simplifyMessage,m as transformMessage};