cnhis-design-vue 3.3.3-release.0 → 3.3.3-release.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/audio-sdk/index.d.ts +18 -16
- package/es/components/audio-sdk/src/Index.vue.d.ts +18 -16
- package/es/components/audio-sdk/src/Index.vue2.js +47 -12
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +6 -6
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +6 -6
- package/es/components/audio-sdk/src/components/recording.vue2.js +17 -3
- package/es/components/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- package/es/components/big-table/src/components/NoData.vue2.js +8 -1
- package/es/components/big-table/src/hooks/useTableParse.js +8 -1
- package/es/components/button-print/index.d.ts +69 -3
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +69 -3
- package/es/components/button-print/src/ButtonPrint.vue2.js +12 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +29 -4
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +121 -16
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +18 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +17 -3
- package/es/components/button-print/src/utils/print.d.ts +6 -4
- package/es/components/button-print/src/utils/print.js +201 -27
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +18 -0
- package/es/components/card-reader-sdk-cn/src/henan/index.js +8 -1
- package/es/components/classification/index.d.ts +56 -6
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +56 -6
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +56 -6
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +56 -6
- package/es/components/date-picker/src/DatePicker.vue2.js +8 -1
- package/es/components/expand-field/index.d.ts +792 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +792 -1
- package/es/components/expand-field/src/components/form.vue2.js +8 -1
- package/es/components/expand-field/src/index.vue.d.ts +792 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +3 -1
- package/es/components/field-editor/index.d.ts +18 -0
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +18 -0
- package/es/components/field-editor/src/FieldEditor.vue2.js +2 -1
- package/es/components/field-editor/src/fields.d.ts +1 -0
- package/es/components/field-editor/src/fields.js +6 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +6 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +6 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +38 -1
- package/es/components/field-set/src/FieldSet.vue2.js +118 -69
- package/es/components/field-set/src/Index.vue2.js +8 -3
- package/es/components/field-set/src/TableStyle.vue2.js +2 -2
- package/es/components/field-set/src/components/table-row.vue.d.ts +2 -1
- package/es/components/field-set/src/components/table-row.vue2.js +21 -6
- package/es/components/field-set/src/constants/index.d.ts +1 -1
- package/es/components/field-set/src/types/index.d.ts +3 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +102 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +102 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +18 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +63 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +4 -4
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +18 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +9 -2
- package/es/components/form-config/src/constants/index.d.ts +31 -1
- package/es/components/form-config/src/constants/index.js +150 -1
- package/es/components/form-config/src/hooks/useConfigurationField.d.ts +2 -2
- package/es/components/form-config/src/hooks/useConfigurationField.js +53 -6
- package/es/components/form-config/src/hooks/useLocale.d.ts +6 -0
- package/es/components/form-config/src/hooks/useLocale.js +34 -0
- package/es/components/form-config/src/types/index.d.ts +12 -0
- package/es/components/form-render/index.d.ts +18 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +18 -0
- package/es/components/form-render/src/FormRender.vue2.js +5 -0
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +17 -3
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +4 -2
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +2 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +3 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +12 -3
- package/es/components/form-render/src/hooks/useBusinessBinding.js +7 -7
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +5 -2
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +15 -0
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +8 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +2 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/form-render/src/utils/business.d.ts +3 -1
- package/es/components/form-render/src/utils/business.js +7 -1
- package/es/components/iho-chat/index.d.ts +901 -98
- package/es/components/iho-chat/src/Index.vue.d.ts +901 -98
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +181 -8
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +51 -41
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +66 -6
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +158 -57
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +329 -15
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +21 -19
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +235 -20
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +298 -279
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +51 -5
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +3 -3
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +48 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +34 -27
- package/es/components/iho-chat/src/components/ImageLightbox.vue.d.ts +104 -0
- package/es/components/iho-chat/src/components/ImageLightbox.vue.js +6 -0
- package/es/components/iho-chat/src/components/ImageLightbox.vue2.js +307 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +53 -6
- package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +3 -3
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +93 -30
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +349 -143
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SelectLabel.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +24 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +38 -25
- package/es/components/iho-chat/src/components/Video.vue2.js +35 -40
- package/es/components/iho-chat/src/hooks/index.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/index.js +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +51 -4
- package/es/components/iho-chat/src/hooks/useData.js +2 -7
- package/es/components/iho-chat/src/hooks/useDraggable.d.ts +25 -0
- package/es/components/iho-chat/src/hooks/useDraggable.js +160 -0
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +78 -11
- package/es/components/iho-chat/src/hooks/useVideo.js +422 -44
- package/es/components/iho-chat/src/types/index.d.ts +37 -1
- package/es/components/iho-chat/src/utils/emoji.d.ts +1 -1
- package/es/components/iho-chat/src/utils/emoji.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +4 -3
- package/es/components/iho-chat/src/utils/index.js +33 -39
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +8 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +5 -2
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -0
- package/es/components/index.js +1 -0
- package/es/components/info-header/index.d.ts +41 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +41 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +56 -22
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +19 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +18 -0
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +16 -2
- package/es/components/keyboard/index.d.ts +8 -0
- package/es/components/keyboard/src/Keyboard.vue.d.ts +8 -0
- package/es/components/keyboard/src/Keyboard.vue2.js +33 -9
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +3 -0
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +27 -7
- package/es/components/keyboard/src/types.d.ts +17 -0
- package/es/components/keyboard/src/types.js +1 -0
- package/es/components/quick-search/index.d.ts +2 -0
- package/es/components/quick-search/src/index.vue.d.ts +2 -0
- package/es/components/scale-view/index.d.ts +80 -17
- package/es/components/scale-view/src/ScaleView.vue.d.ts +83 -19
- package/es/components/scale-view/src/ScaleView.vue2.js +84 -10
- package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +5 -0
- package/es/components/scale-view/src/components/AnswerParse.vue2.js +74 -8
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +10 -7
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +28 -4
- package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +10 -7
- package/es/components/scale-view/src/components/EvaluatePage.vue2.js +29 -8
- package/es/components/scale-view/src/components/NoData.vue2.js +9 -3
- package/es/components/scale-view/src/components/ScaleScore.d.ts +1 -1
- package/es/components/scale-view/src/components/ScaleScore.js +47 -4
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +20 -2
- package/es/components/scale-view/src/components/formitem/r-radio.js +2 -0
- package/es/components/scale-view/src/components/formitem/r-sign.js +32 -4
- package/es/components/scale-view/src/components/formitem/r-upload.js +65 -7
- package/es/components/scale-view/src/components/formitem/sign-com.js +8 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +22 -6
- package/es/components/scale-view/src/hooks/scaleview-init.js +24 -3
- package/es/components/scale-view/src/hooks/scaleview-methods.js +40 -5
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +12 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +12 -0
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +2 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +64 -8
- package/es/components/scale-view/src/hooks/scaleview-validate.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +157 -24
- package/es/components/scale-view/src/hooks/use-evaluate.js +16 -2
- package/es/components/scale-view/src/hooks/use-noData.js +33 -5
- package/es/components/scale-view/src/utils/judge-types.d.ts +2 -1
- package/es/components/scale-view/src/utils/judge-types.js +10 -10
- package/es/components/scale-view/src/utils/watch-form-change.d.ts +13 -0
- package/es/components/scale-view/src/utils/watch-form-change.js +71 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-person/index.d.ts +792 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +434 -341
- package/es/components/select-person/src/SelectPerson.vue2.js +521 -675
- package/es/components/select-person/src/SelectPersonRole.vue.d.ts +630 -0
- package/es/components/select-person/src/SelectPersonRole.vue.js +6 -0
- package/es/components/select-person/src/SelectPersonRole.vue2.js +942 -0
- package/es/components/select-person/src/components/GroupItem.vue.d.ts +19 -0
- package/es/components/select-person/src/components/GroupItem.vue.js +6 -0
- package/es/components/select-person/src/components/GroupItem.vue2.js +37 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.d.ts +214 -0
- package/es/components/select-person/src/components/SearchGroupList.vue.js +6 -0
- package/es/components/select-person/src/components/SearchGroupList.vue2.js +145 -0
- package/es/components/select-person/src/components/SearchMultiple.vue2.js +1 -1
- package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +21 -12
- package/es/components/select-person/src/components/TagItem.vue.d.ts +43 -0
- package/es/components/select-person/src/components/TagItem.vue.js +6 -0
- package/es/components/select-person/src/components/TagItem.vue2.js +40 -0
- package/es/components/select-person/src/index.vue.d.ts +793 -1
- package/es/components/select-person/src/index.vue2.js +21 -4
- package/es/components/select-person/src/types/index.d.ts +35 -0
- package/es/components/select-person/src/types/index.js +1 -0
- package/es/components/select-person/src/utils/index.d.ts +3 -0
- package/es/components/select-person/src/utils/index.js +29 -8
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +18 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +54 -6
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +26 -10
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +17 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +37 -2
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +18 -2
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +44 -1
- package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +2 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +55 -6
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +6 -3
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +12 -1
- package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue2.js +25 -6
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +12 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +2 -2
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +32 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +2 -2
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +20 -3
- package/es/components/table-filter/src/hooks/useRenderWidget.js +4 -0
- package/es/components/table-filter/src/tool/baseOptions.js +8 -1
- package/es/components/table-filter/src/tool/date.d.ts +3 -0
- package/es/components/table-filter/src/tool/date.js +139 -0
- package/es/components/table-filter/src/tool/transformData.d.ts +1 -0
- package/es/components/table-filter/src/tool/transformData.js +11 -8
- package/es/components/table-filter/src/types/enums.d.ts +1 -0
- package/es/components/table-filter/src/types/enums.js +2 -1
- package/es/components/table-filter/src/types/index.d.ts +12 -0
- package/es/components/vertify/index.d.ts +1 -0
- package/es/components/vertify/index.js +1 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.d.ts +89 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.js +6 -0
- package/es/components/vertify/src/components/IdentityVerification.vue2.js +256 -0
- package/es/components/vertify/src/utils/dialog.d.ts +7 -0
- package/es/components/vertify/src/utils/dialog.js +73 -0
- package/es/components/vertify/src/utils/index.d.ts +11 -0
- package/es/components/vertify/src/utils/index.js +24 -0
- package/es/components/vod-chunk-upload/index.d.ts +16 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +20 -31
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +205 -78
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.d.ts +1 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +35 -4
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +4 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +78 -11
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +16 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +81 -10
- package/es/components/vod-chunk-upload/style/index.css +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/hooks/useLevelSearchCascader.js +3 -3
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.js +1 -1
- package/package.json +4 -3
@@ -1,19 +1,61 @@
|
|
1
1
|
import TRTC from 'trtc-sdk-v5';
|
2
2
|
import { AnyFn } from '../../../../shared/types';
|
3
|
-
|
3
|
+
export interface RemoteUser {
|
4
|
+
id: string;
|
5
|
+
name: string;
|
6
|
+
hasVideo?: boolean;
|
7
|
+
hasAudio?: boolean;
|
8
|
+
}
|
9
|
+
export interface TRTCEvent {
|
10
|
+
userId: string;
|
11
|
+
streamType?: any;
|
12
|
+
available?: boolean;
|
13
|
+
}
|
14
|
+
export interface VideoEventHandlers {
|
4
15
|
handleError: AnyFn;
|
5
16
|
handleRemoteUserEnter: AnyFn;
|
6
17
|
handleRemoteAudioAvailable: AnyFn;
|
7
18
|
handleRemoteUserExit: AnyFn;
|
8
19
|
handleRemoteVideoAvailable: AnyFn;
|
9
|
-
|
10
|
-
|
20
|
+
handleRemoteVideoUnavailable?: AnyFn;
|
21
|
+
handleRemoteAudioUnavailable?: AnyFn;
|
22
|
+
}
|
23
|
+
export interface VideoConfig {
|
24
|
+
isMultiple?: boolean;
|
25
|
+
enableRetry?: boolean;
|
26
|
+
retryDelay?: number;
|
27
|
+
maxRetries?: number;
|
28
|
+
}
|
29
|
+
export declare function useVideo(config?: VideoConfig): {
|
11
30
|
state: {
|
12
31
|
orgId: string | number;
|
13
32
|
currentSessionItem: import("../../../../shared/types").AnyObject;
|
14
33
|
id: string;
|
15
34
|
userInfo: import("../../../../shared/types").AnyObject;
|
16
|
-
msgList:
|
35
|
+
msgList: {
|
36
|
+
[x: string]: any;
|
37
|
+
id: string;
|
38
|
+
sessionKey: string;
|
39
|
+
content: {
|
40
|
+
[x: string]: any;
|
41
|
+
chatMessageType: string;
|
42
|
+
msg: string;
|
43
|
+
referenceContent?: any;
|
44
|
+
forwardMessageList?: import("../../../../shared/types").AnyObject[] | undefined;
|
45
|
+
messageTemplate?: any;
|
46
|
+
messageTemplateData?: any;
|
47
|
+
fileUrl?: string | undefined;
|
48
|
+
avStatus?: string | undefined;
|
49
|
+
};
|
50
|
+
senderName: string;
|
51
|
+
sendTime: string;
|
52
|
+
sender: string;
|
53
|
+
status: string;
|
54
|
+
senderAvatar: string;
|
55
|
+
__content: string;
|
56
|
+
__time?: string | undefined;
|
57
|
+
__sendTime?: string | undefined;
|
58
|
+
}[];
|
17
59
|
currentMsg: import("../../../../shared/types").AnyObject;
|
18
60
|
isAppendMsg: boolean;
|
19
61
|
sessionList: import("../../../../shared/types").AnyObject[];
|
@@ -47,18 +89,43 @@ export declare function useVideo(): {
|
|
47
89
|
timing: import("vue").Ref<string>;
|
48
90
|
voiceClose: import("vue").Ref<boolean>;
|
49
91
|
videocamClose: import("vue").Ref<boolean>;
|
92
|
+
isConnect: import("vue").Ref<boolean>;
|
50
93
|
isAudio: import("vue").ComputedRef<boolean>;
|
51
94
|
isCall: import("vue").ComputedRef<boolean>;
|
52
|
-
startTimer: () => void;
|
53
|
-
resetTimer: () => void;
|
54
|
-
toggleAudio: () => Promise<void>;
|
55
|
-
toggleVideo: () => Promise<void>;
|
56
95
|
messageTypeText: import("vue").ComputedRef<"语音" | "视频">;
|
57
96
|
time: {
|
58
97
|
timer: any;
|
59
98
|
seconds: number;
|
60
99
|
};
|
61
|
-
|
62
|
-
|
100
|
+
remoteUsers: import("vue").Ref<{
|
101
|
+
id: string;
|
102
|
+
name: string;
|
103
|
+
hasVideo?: boolean | undefined;
|
104
|
+
hasAudio?: boolean | undefined;
|
105
|
+
}[]>;
|
106
|
+
videoRefs: import("vue").Ref<Map<string, HTMLElement>>;
|
107
|
+
startTimer: () => void;
|
108
|
+
resetTimer: () => void;
|
109
|
+
toggleAudio: () => Promise<void>;
|
110
|
+
toggleVideo: () => Promise<void>;
|
111
|
+
enterRoom: () => Promise<boolean>;
|
112
|
+
exitRoom: () => Promise<void>;
|
113
|
+
startLocalMedia: (selfVideoRef?: HTMLElement) => Promise<void>;
|
114
|
+
checkTRTCSupport: () => Promise<boolean>;
|
115
|
+
findUser: (userId: string) => RemoteUser | undefined;
|
116
|
+
addOrUpdateUser: (userId: string, updates: Partial<RemoteUser>) => void;
|
117
|
+
removeUser: (userId: string) => void;
|
118
|
+
tryRenderRemoteVideo: (userId: string) => Promise<void>;
|
119
|
+
stopRemoteVideo: (userId: string) => Promise<void>;
|
120
|
+
setVideoRef: (userId: string, el: HTMLElement | null) => void;
|
121
|
+
installEventHandlers: (handlers: VideoEventHandlers) => void;
|
122
|
+
uninstallEventHandlers: (handlers: VideoEventHandlers) => void;
|
123
|
+
cleanupAllResources: () => void;
|
124
|
+
checkAndRenderAllVideos: () => void;
|
125
|
+
forceRenderAllVideos: () => Promise<void>;
|
126
|
+
cleanupInvalidUsers: () => void;
|
127
|
+
isUserValid: (userId: string) => boolean;
|
128
|
+
startUserConnectionMonitoring: () => void;
|
129
|
+
stopUserConnectionMonitoring: () => void;
|
130
|
+
MAIN_STREAM_TYPE: any;
|
63
131
|
};
|
64
|
-
export {};
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { ref, computed, onBeforeUnmount } from 'vue';
|
1
|
+
import { ref, computed, onBeforeUnmount, nextTick } from 'vue';
|
2
2
|
import { useData } from './useData.js';
|
3
3
|
import 'stompjs';
|
4
4
|
import 'sockjs-client/dist/sockjs.min.js';
|
5
5
|
import { MESSAGE_TYPE } from '../constants/index.js';
|
6
6
|
import '../api/index.js';
|
7
|
-
import { formatSeconds } from '../utils/index.js';
|
7
|
+
import { formatSeconds, $message } from '../utils/index.js';
|
8
8
|
import 'lodash-es';
|
9
9
|
import TRTC from 'trtc-sdk-v5';
|
10
10
|
|
11
|
-
function useVideo() {
|
11
|
+
function useVideo(config = {}) {
|
12
12
|
const time = {
|
13
13
|
timer: null,
|
14
14
|
seconds: 0
|
@@ -21,6 +21,11 @@ function useVideo() {
|
|
21
21
|
const timing = ref("");
|
22
22
|
const voiceClose = ref(false);
|
23
23
|
const videocamClose = ref(false);
|
24
|
+
const isConnect = ref(false);
|
25
|
+
const remoteUsers = ref([]);
|
26
|
+
const videoRefs = ref(/* @__PURE__ */ new Map());
|
27
|
+
const retryTimers = ref(/* @__PURE__ */ new Map());
|
28
|
+
const retryCount = ref(/* @__PURE__ */ new Map());
|
24
29
|
const isAudio = computed(() => state.currentAVMsg.chatMessageType === MESSAGE_TYPE.AUDIO);
|
25
30
|
const isCall = computed(() => state.currentAVMsg.callMode === "call");
|
26
31
|
const messageTypeText = computed(() => isAudio.value ? function() {
|
@@ -39,6 +44,7 @@ function useVideo() {
|
|
39
44
|
}
|
40
45
|
}());
|
41
46
|
const trtc = TRTC.create();
|
47
|
+
const MAIN_STREAM_TYPE = TRTC.TYPE.STREAM_TYPE_MAIN;
|
42
48
|
function startTimer() {
|
43
49
|
resetTimer();
|
44
50
|
time.timer = setInterval(() => {
|
@@ -52,50 +58,401 @@ function useVideo() {
|
|
52
58
|
time.timer = null;
|
53
59
|
time.seconds = 0;
|
54
60
|
}
|
55
|
-
async function
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
61
|
+
async function checkTRTCSupport() {
|
62
|
+
try {
|
63
|
+
const checkResult = await TRTC.isSupported();
|
64
|
+
if (!checkResult.result) {
|
65
|
+
$message.error("\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u89C6\u9891\u901A\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u6700\u65B0\u7248Chrome\u6D4F\u89C8\u5668");
|
66
|
+
return false;
|
67
|
+
}
|
68
|
+
if (!checkResult.detail.isH264EncodeSupported) {
|
69
|
+
$message.error("\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u89C6\u9891\u7F16\u7801");
|
70
|
+
return false;
|
71
|
+
}
|
72
|
+
if (!checkResult.detail.isH264DecodeSupported) {
|
73
|
+
$message.error("\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u89C6\u9891\u89E3\u7801");
|
74
|
+
return false;
|
75
|
+
}
|
76
|
+
return true;
|
77
|
+
} catch (error) {
|
78
|
+
console.error("Error checking TRTC support:", error);
|
79
|
+
$message.error("\u68C0\u67E5\u6D4F\u89C8\u5668\u652F\u6301\u65F6\u51FA\u9519");
|
80
|
+
return false;
|
81
|
+
}
|
60
82
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
83
|
+
function findUser(userId) {
|
84
|
+
return remoteUsers.value.find((user) => user.id === userId);
|
85
|
+
}
|
86
|
+
function findUserIndex(userId) {
|
87
|
+
return remoteUsers.value.findIndex((user) => user.id === userId);
|
88
|
+
}
|
89
|
+
function addOrUpdateUser(userId, updates) {
|
90
|
+
const userIndex = findUserIndex(userId);
|
91
|
+
if (userIndex !== -1) {
|
92
|
+
const oldUser = {
|
93
|
+
...remoteUsers.value[userIndex]
|
94
|
+
};
|
95
|
+
Object.assign(remoteUsers.value[userIndex], updates);
|
96
|
+
console.log(`Updated user ${userId}:`, {
|
97
|
+
old: oldUser,
|
98
|
+
new: remoteUsers.value[userIndex]
|
99
|
+
});
|
100
|
+
} else {
|
101
|
+
const newUser = {
|
102
|
+
id: userId,
|
103
|
+
name: updates.name || userId,
|
104
|
+
hasVideo: updates.hasVideo || false,
|
105
|
+
hasAudio: updates.hasAudio || false
|
106
|
+
};
|
107
|
+
remoteUsers.value.push(newUser);
|
108
|
+
console.log(`Added new user ${userId}:`, newUser);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
function removeUser(userId) {
|
112
|
+
console.log("Removing user:", userId);
|
113
|
+
const userIndex = findUserIndex(userId);
|
114
|
+
if (userIndex !== -1) {
|
115
|
+
remoteUsers.value.splice(userIndex, 1);
|
116
|
+
}
|
117
|
+
videoRefs.value.delete(userId);
|
118
|
+
clearRetryTimer(userId);
|
119
|
+
stopRemoteVideo(userId).catch((error) => {
|
120
|
+
console.warn("Error stopping remote video during user removal:", error);
|
64
121
|
});
|
65
|
-
|
66
|
-
}
|
67
|
-
function
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
122
|
+
console.log("User removed and cleaned up:", userId);
|
123
|
+
}
|
124
|
+
function clearRetryTimer(userId) {
|
125
|
+
const timer = retryTimers.value.get(userId);
|
126
|
+
if (timer) {
|
127
|
+
clearTimeout(timer);
|
128
|
+
retryTimers.value.delete(userId);
|
129
|
+
}
|
130
|
+
retryCount.value.delete(userId);
|
131
|
+
}
|
132
|
+
async function tryRenderRemoteVideo(userId) {
|
133
|
+
var _a, _b;
|
134
|
+
const videoElement = videoRefs.value.get(userId);
|
135
|
+
const user = findUser(userId);
|
136
|
+
console.log("tryRenderRemoteVideo called for user:", userId);
|
137
|
+
console.log("Video element:", videoElement);
|
138
|
+
console.log("User data:", user);
|
139
|
+
console.log("Is connected:", isConnect.value);
|
140
|
+
if (!videoElement) {
|
141
|
+
console.log("Video element not found for user:", userId, "Available refs:", Array.from(videoRefs.value.keys()));
|
79
142
|
return;
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
handleRemoteVideoAvailable
|
88
|
-
}) {
|
89
|
-
trtc.off(TRTC.EVENT.ERROR, handleError);
|
90
|
-
trtc.off(TRTC.EVENT.REMOTE_USER_ENTER, handleRemoteUserEnter);
|
91
|
-
trtc.off(TRTC.EVENT.REMOTE_AUDIO_AVAILABLE, handleRemoteAudioAvailable);
|
92
|
-
trtc.off(TRTC.EVENT.REMOTE_USER_EXIT, handleRemoteUserExit);
|
93
|
-
if (isAudio.value)
|
143
|
+
}
|
144
|
+
if (!isConnect.value) {
|
145
|
+
console.log("Not connected, skipping video render for user:", userId);
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
if (!(user == null ? void 0 : user.hasVideo)) {
|
149
|
+
console.log("User has no video stream:", userId, "User hasVideo:", user == null ? void 0 : user.hasVideo);
|
94
150
|
return;
|
95
|
-
|
151
|
+
}
|
152
|
+
try {
|
153
|
+
const existingVideo = videoElement.querySelector("video");
|
154
|
+
if (existingVideo) {
|
155
|
+
console.log("Video already playing for user:", userId);
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
console.log("Starting remote video for user:", userId, "with element:", videoElement);
|
159
|
+
await trtc.startRemoteVideo({
|
160
|
+
userId,
|
161
|
+
streamType: MAIN_STREAM_TYPE,
|
162
|
+
view: videoElement
|
163
|
+
});
|
164
|
+
console.log("Successfully rendered video for user:", userId);
|
165
|
+
clearRetryTimer(userId);
|
166
|
+
} catch (error) {
|
167
|
+
console.warn("Failed to render video for user:", userId, error);
|
168
|
+
if (error.code === "INVALID_OPERATION" && (((_a = error.message) == null ? void 0 : _a.includes("does not publishing stream")) || ((_b = error.message) == null ? void 0 : _b.includes("not exist"))) || error.code === "OPERATION_ABORT") {
|
169
|
+
console.log("User no longer exists or not publishing, removing from retry:", userId);
|
170
|
+
clearRetryTimer(userId);
|
171
|
+
addOrUpdateUser(userId, {
|
172
|
+
hasVideo: false
|
173
|
+
});
|
174
|
+
}
|
175
|
+
}
|
96
176
|
}
|
97
|
-
|
177
|
+
async function stopRemoteVideo(userId) {
|
178
|
+
var _a;
|
179
|
+
try {
|
180
|
+
await trtc.stopRemoteVideo({
|
181
|
+
userId,
|
182
|
+
streamType: MAIN_STREAM_TYPE
|
183
|
+
});
|
184
|
+
console.log("Stopped remote video for user:", userId);
|
185
|
+
} catch (error) {
|
186
|
+
if (error.code === "INVALID_OPERATION" && ((_a = error.message) == null ? void 0 : _a.includes("does not exist"))) {
|
187
|
+
console.log("User already exited, no need to stop video:", userId);
|
188
|
+
} else {
|
189
|
+
console.warn("Error stopping remote video for user:", userId, error);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
function isUserValid(userId) {
|
194
|
+
const user = findUser(userId);
|
195
|
+
return user !== void 0;
|
196
|
+
}
|
197
|
+
function cleanupInvalidUsers() {
|
198
|
+
const validUserIds = remoteUsers.value.map((user) => user.id);
|
199
|
+
const retryUserIds = Array.from(retryTimers.value.keys());
|
200
|
+
retryUserIds.forEach((userId) => {
|
201
|
+
if (!validUserIds.includes(userId)) {
|
202
|
+
console.log("Cleaning up retry timer for invalid user:", userId);
|
203
|
+
clearRetryTimer(userId);
|
204
|
+
}
|
205
|
+
});
|
206
|
+
}
|
207
|
+
let userConnectionCheckInterval = null;
|
208
|
+
function startUserConnectionMonitoring() {
|
209
|
+
if (userConnectionCheckInterval)
|
210
|
+
return;
|
211
|
+
console.log("Starting user connection monitoring...");
|
212
|
+
userConnectionCheckInterval = setInterval(() => {
|
213
|
+
if (!isConnect.value) {
|
214
|
+
stopUserConnectionMonitoring();
|
215
|
+
return;
|
216
|
+
}
|
217
|
+
remoteUsers.value.forEach((user) => {
|
218
|
+
if (!user.hasVideo && !user.hasAudio) {
|
219
|
+
console.log(`User ${user.id} has no streams for extended period, checking...`);
|
220
|
+
}
|
221
|
+
});
|
222
|
+
}, 1e4);
|
223
|
+
}
|
224
|
+
function stopUserConnectionMonitoring() {
|
225
|
+
if (userConnectionCheckInterval) {
|
226
|
+
clearInterval(userConnectionCheckInterval);
|
227
|
+
userConnectionCheckInterval = null;
|
228
|
+
console.log("Stopped user connection monitoring");
|
229
|
+
}
|
230
|
+
}
|
231
|
+
function checkAndRenderAllVideos() {
|
232
|
+
console.log("Checking and rendering all videos...");
|
233
|
+
cleanupInvalidUsers();
|
234
|
+
const currentUsers = remoteUsers.value.filter((user) => user.hasVideo);
|
235
|
+
console.log("Current users with video:", currentUsers.map((u) => u.id));
|
236
|
+
currentUsers.forEach((user) => {
|
237
|
+
const videoElement = videoRefs.value.get(user.id);
|
238
|
+
if (videoElement) {
|
239
|
+
const hasExistingVideo = videoElement.querySelector("video");
|
240
|
+
console.log(`User ${user.id}: hasVideo=${user.hasVideo}, hasElement=${!!videoElement}, hasExistingVideo=${!!hasExistingVideo}`);
|
241
|
+
if (user.hasVideo && !hasExistingVideo) {
|
242
|
+
console.log(`Attempting to render video for user: ${user.id}`);
|
243
|
+
tryRenderRemoteVideo(user.id);
|
244
|
+
}
|
245
|
+
} else {
|
246
|
+
console.log(`No video element found for user: ${user.id}`);
|
247
|
+
}
|
248
|
+
});
|
249
|
+
}
|
250
|
+
async function forceRenderAllVideos() {
|
251
|
+
var _a;
|
252
|
+
console.log("Force rendering all available videos...");
|
253
|
+
const usersWithVideo = remoteUsers.value.filter((user) => user.hasVideo);
|
254
|
+
console.log("Users with video to force render:", usersWithVideo.map((u) => u.id));
|
255
|
+
for (const user of usersWithVideo) {
|
256
|
+
const videoElement = videoRefs.value.get(user.id);
|
257
|
+
if (videoElement && user.hasVideo) {
|
258
|
+
try {
|
259
|
+
const existingVideo = videoElement.querySelector("video");
|
260
|
+
if (existingVideo) {
|
261
|
+
existingVideo.remove();
|
262
|
+
}
|
263
|
+
await trtc.startRemoteVideo({
|
264
|
+
userId: user.id,
|
265
|
+
streamType: MAIN_STREAM_TYPE,
|
266
|
+
view: videoElement
|
267
|
+
});
|
268
|
+
console.log(`Force rendered video for user: ${user.id}`);
|
269
|
+
} catch (error) {
|
270
|
+
console.error(`Failed to force render video for user ${user.id}:`, error);
|
271
|
+
if (error.code === "INVALID_OPERATION" && ((_a = error.message) == null ? void 0 : _a.includes("does not publishing stream"))) {
|
272
|
+
console.log("User not publishing stream, updating status:", user.id);
|
273
|
+
addOrUpdateUser(user.id, {
|
274
|
+
hasVideo: false
|
275
|
+
});
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
}
|
280
|
+
}
|
281
|
+
function cleanupAllResources() {
|
282
|
+
retryTimers.value.forEach((timer) => clearTimeout(timer));
|
283
|
+
retryTimers.value.clear();
|
284
|
+
retryCount.value.clear();
|
285
|
+
videoRefs.value.clear();
|
286
|
+
remoteUsers.value = [];
|
287
|
+
isConnect.value = false;
|
98
288
|
resetTimer();
|
289
|
+
stopUserConnectionMonitoring();
|
290
|
+
}
|
291
|
+
async function toggleAudio() {
|
292
|
+
try {
|
293
|
+
await trtc.updateLocalAudio({
|
294
|
+
mute: !voiceClose.value
|
295
|
+
});
|
296
|
+
voiceClose.value = !voiceClose.value;
|
297
|
+
} catch (error) {
|
298
|
+
console.error("Error toggling audio:", error);
|
299
|
+
$message.error("\u5207\u6362\u97F3\u9891\u5931\u8D25");
|
300
|
+
}
|
301
|
+
}
|
302
|
+
async function toggleVideo() {
|
303
|
+
try {
|
304
|
+
await trtc.updateLocalVideo({
|
305
|
+
mute: !videocamClose.value
|
306
|
+
});
|
307
|
+
videocamClose.value = !videocamClose.value;
|
308
|
+
} catch (error) {
|
309
|
+
console.error("Error toggling video:", error);
|
310
|
+
$message.error("\u5207\u6362\u89C6\u9891\u5931\u8D25");
|
311
|
+
}
|
312
|
+
}
|
313
|
+
async function enterRoom() {
|
314
|
+
if (isConnect.value) {
|
315
|
+
console.log("Already connected");
|
316
|
+
return true;
|
317
|
+
}
|
318
|
+
const isSupported = await checkTRTCSupport();
|
319
|
+
if (!isSupported) {
|
320
|
+
return false;
|
321
|
+
}
|
322
|
+
try {
|
323
|
+
console.log("Entering TRTC room...");
|
324
|
+
await trtc.enterRoom({
|
325
|
+
strRoomId: state.currentAVMsg.strRoomId,
|
326
|
+
sdkAppId: parseInt(state.userInfo.sdkAppID),
|
327
|
+
userId: state.userInfo.id,
|
328
|
+
userSig: state.userInfo.userSig,
|
329
|
+
proxy: trtcProxy.value
|
330
|
+
});
|
331
|
+
isConnect.value = true;
|
332
|
+
console.log("Successfully entered TRTC room");
|
333
|
+
startUserConnectionMonitoring();
|
334
|
+
return true;
|
335
|
+
} catch (error) {
|
336
|
+
console.error("Failed to enter TRTC room:", error);
|
337
|
+
$message.error(`\u8FDB\u5165\u623F\u95F4\u5931\u8D25: ${error.message || "\u672A\u77E5\u9519\u8BEF"}`);
|
338
|
+
isConnect.value = false;
|
339
|
+
return false;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
async function exitRoom() {
|
343
|
+
try {
|
344
|
+
console.log("Exiting TRTC room...");
|
345
|
+
const stopPromises = [];
|
346
|
+
stopPromises.push(trtc.stopLocalAudio().catch((error) => {
|
347
|
+
console.warn("Error stopping local audio:", error);
|
348
|
+
}));
|
349
|
+
if (!isAudio.value) {
|
350
|
+
stopPromises.push(trtc.stopLocalVideo().catch((error) => {
|
351
|
+
console.warn("Error stopping local video:", error);
|
352
|
+
}));
|
353
|
+
}
|
354
|
+
await Promise.allSettled(stopPromises);
|
355
|
+
if (isConnect.value) {
|
356
|
+
await trtc.exitRoom().catch((error) => {
|
357
|
+
console.warn("Error exiting room:", error);
|
358
|
+
});
|
359
|
+
}
|
360
|
+
cleanupAllResources();
|
361
|
+
console.log("Successfully exited TRTC room");
|
362
|
+
} catch (error) {
|
363
|
+
console.error("Error during exit:", error);
|
364
|
+
}
|
365
|
+
}
|
366
|
+
async function startLocalMedia(selfVideoRef) {
|
367
|
+
try {
|
368
|
+
await trtc.startLocalAudio({
|
369
|
+
mute: voiceClose.value
|
370
|
+
});
|
371
|
+
if (!isAudio.value && selfVideoRef) {
|
372
|
+
await trtc.startLocalVideo({
|
373
|
+
view: selfVideoRef,
|
374
|
+
mute: videocamClose.value
|
375
|
+
});
|
376
|
+
}
|
377
|
+
} catch (error) {
|
378
|
+
console.error("Error starting local media:", error);
|
379
|
+
throw error;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
function installEventHandlers(handlers) {
|
383
|
+
console.log("Installing TRTC event handlers...");
|
384
|
+
const wrappedHandlers = {
|
385
|
+
handleError: (error) => {
|
386
|
+
console.log("TRTC EVENT: ERROR", error);
|
387
|
+
handlers.handleError(error);
|
388
|
+
},
|
389
|
+
handleRemoteUserEnter: (event) => {
|
390
|
+
console.log("TRTC EVENT: REMOTE_USER_ENTER", event);
|
391
|
+
handlers.handleRemoteUserEnter(event);
|
392
|
+
},
|
393
|
+
handleRemoteAudioAvailable: (event) => {
|
394
|
+
console.log("TRTC EVENT: REMOTE_AUDIO_AVAILABLE", event);
|
395
|
+
handlers.handleRemoteAudioAvailable(event);
|
396
|
+
},
|
397
|
+
handleRemoteUserExit: (event) => {
|
398
|
+
console.log("TRTC EVENT: REMOTE_USER_EXIT", event);
|
399
|
+
handlers.handleRemoteUserExit(event);
|
400
|
+
},
|
401
|
+
handleRemoteVideoAvailable: (event) => {
|
402
|
+
console.log("TRTC EVENT: REMOTE_VIDEO_AVAILABLE", event);
|
403
|
+
handlers.handleRemoteVideoAvailable(event);
|
404
|
+
},
|
405
|
+
handleRemoteVideoUnavailable: (event) => {
|
406
|
+
console.log("TRTC EVENT: REMOTE_VIDEO_UNAVAILABLE", event);
|
407
|
+
if (handlers.handleRemoteVideoUnavailable) {
|
408
|
+
handlers.handleRemoteVideoUnavailable(event);
|
409
|
+
}
|
410
|
+
}
|
411
|
+
};
|
412
|
+
trtc.on(TRTC.EVENT.ERROR, wrappedHandlers.handleError);
|
413
|
+
trtc.on(TRTC.EVENT.REMOTE_USER_ENTER, wrappedHandlers.handleRemoteUserEnter);
|
414
|
+
trtc.on(TRTC.EVENT.REMOTE_AUDIO_AVAILABLE, wrappedHandlers.handleRemoteAudioAvailable);
|
415
|
+
trtc.on(TRTC.EVENT.REMOTE_USER_EXIT, wrappedHandlers.handleRemoteUserExit);
|
416
|
+
if (!isAudio.value) {
|
417
|
+
trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, wrappedHandlers.handleRemoteVideoAvailable);
|
418
|
+
trtc.on(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, wrappedHandlers.handleRemoteVideoUnavailable);
|
419
|
+
console.log("REMOTE_VIDEO_UNAVAILABLE event listener added");
|
420
|
+
}
|
421
|
+
}
|
422
|
+
function uninstallEventHandlers(handlers) {
|
423
|
+
trtc.off(TRTC.EVENT.ERROR, handlers.handleError);
|
424
|
+
trtc.off(TRTC.EVENT.REMOTE_USER_ENTER, handlers.handleRemoteUserEnter);
|
425
|
+
trtc.off(TRTC.EVENT.REMOTE_AUDIO_AVAILABLE, handlers.handleRemoteAudioAvailable);
|
426
|
+
trtc.off(TRTC.EVENT.REMOTE_USER_EXIT, handlers.handleRemoteUserExit);
|
427
|
+
if (!isAudio.value) {
|
428
|
+
trtc.off(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, handlers.handleRemoteVideoAvailable);
|
429
|
+
trtc.off(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, handlers.handleRemoteVideoUnavailable || handlers.handleRemoteVideoAvailable);
|
430
|
+
}
|
431
|
+
}
|
432
|
+
function setVideoRef(userId, el) {
|
433
|
+
if (el) {
|
434
|
+
videoRefs.value.set(userId, el);
|
435
|
+
console.log("Video ref set for user:", userId, "Element:", el);
|
436
|
+
if (isConnect.value) {
|
437
|
+
const user = findUser(userId);
|
438
|
+
console.log("User found:", user);
|
439
|
+
if (user == null ? void 0 : user.hasVideo) {
|
440
|
+
console.log("User has video, attempting to render");
|
441
|
+
nextTick(() => {
|
442
|
+
tryRenderRemoteVideo(userId);
|
443
|
+
});
|
444
|
+
} else {
|
445
|
+
console.log("User has no video stream yet, will render when available");
|
446
|
+
}
|
447
|
+
}
|
448
|
+
} else {
|
449
|
+
videoRefs.value.delete(userId);
|
450
|
+
clearRetryTimer(userId);
|
451
|
+
console.log("Video ref removed for user:", userId);
|
452
|
+
}
|
453
|
+
}
|
454
|
+
onBeforeUnmount(() => {
|
455
|
+
cleanupAllResources();
|
99
456
|
});
|
100
457
|
return {
|
101
458
|
state,
|
@@ -105,16 +462,37 @@ function useVideo() {
|
|
105
462
|
timing,
|
106
463
|
voiceClose,
|
107
464
|
videocamClose,
|
465
|
+
isConnect,
|
108
466
|
isAudio,
|
109
467
|
isCall,
|
468
|
+
messageTypeText,
|
469
|
+
time,
|
470
|
+
remoteUsers,
|
471
|
+
videoRefs,
|
110
472
|
startTimer,
|
111
473
|
resetTimer,
|
112
474
|
toggleAudio,
|
113
475
|
toggleVideo,
|
114
|
-
|
115
|
-
|
476
|
+
enterRoom,
|
477
|
+
exitRoom,
|
478
|
+
startLocalMedia,
|
479
|
+
checkTRTCSupport,
|
480
|
+
findUser,
|
481
|
+
addOrUpdateUser,
|
482
|
+
removeUser,
|
483
|
+
tryRenderRemoteVideo,
|
484
|
+
stopRemoteVideo,
|
485
|
+
setVideoRef,
|
116
486
|
installEventHandlers,
|
117
|
-
uninstallEventHandlers
|
487
|
+
uninstallEventHandlers,
|
488
|
+
cleanupAllResources,
|
489
|
+
checkAndRenderAllVideos,
|
490
|
+
forceRenderAllVideos,
|
491
|
+
cleanupInvalidUsers,
|
492
|
+
isUserValid,
|
493
|
+
startUserConnectionMonitoring,
|
494
|
+
stopUserConnectionMonitoring,
|
495
|
+
MAIN_STREAM_TYPE
|
118
496
|
};
|
119
497
|
}
|
120
498
|
|
@@ -1,11 +1,36 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
2
|
import { UploadFileInfo } from 'naive-ui';
|
3
|
+
type ItemContent = {
|
4
|
+
chatMessageType: string;
|
5
|
+
msg: string;
|
6
|
+
referenceContent?: any;
|
7
|
+
forwardMessageList?: AnyObject[];
|
8
|
+
messageTemplate?: any;
|
9
|
+
messageTemplateData?: any;
|
10
|
+
fileUrl?: string;
|
11
|
+
avStatus?: string;
|
12
|
+
[key: string]: any;
|
13
|
+
};
|
14
|
+
export type MsgListItem = {
|
15
|
+
id: string;
|
16
|
+
sessionKey: string;
|
17
|
+
content: ItemContent;
|
18
|
+
senderName: string;
|
19
|
+
sendTime: string;
|
20
|
+
sender: string;
|
21
|
+
status: string;
|
22
|
+
senderAvatar: string;
|
23
|
+
__content: string;
|
24
|
+
__time?: string;
|
25
|
+
__sendTime?: string;
|
26
|
+
[key: string]: any;
|
27
|
+
};
|
3
28
|
export type IState = {
|
4
29
|
orgId: number | string;
|
5
30
|
currentSessionItem: AnyObject;
|
6
31
|
id: string;
|
7
32
|
userInfo: AnyObject;
|
8
|
-
msgList:
|
33
|
+
msgList: MsgListItem[];
|
9
34
|
currentMsg: AnyObject;
|
10
35
|
isAppendMsg: boolean;
|
11
36
|
sessionList: AnyObject[];
|
@@ -45,4 +70,15 @@ export type ProxyServer = Partial<{
|
|
45
70
|
turnServer: Array<TurnServer>;
|
46
71
|
iceTransportPolicy: 'all' | 'relay';
|
47
72
|
}>;
|
73
|
+
export type ImageItem = {
|
74
|
+
id: string;
|
75
|
+
fileUrl: string;
|
76
|
+
senderName: string;
|
77
|
+
fileSize: string;
|
78
|
+
sendTime: string;
|
79
|
+
fileName: string;
|
80
|
+
width?: number;
|
81
|
+
height?: number;
|
82
|
+
[key: string]: any;
|
83
|
+
};
|
48
84
|
export {};
|