cnhis-design-vue 3.3.2-release.0 → 3.3.2-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.
- package/es/components/audio-sdk/index.d.ts +173 -146
- package/es/components/audio-sdk/src/Index.vue.d.ts +174 -147
- package/es/components/audio-sdk/src/Index.vue2.js +131 -53
- package/es/components/audio-sdk/src/audioSDK.d.ts +29 -26
- package/es/components/audio-sdk/src/audioSDK.js +123 -42
- package/es/components/audio-sdk/src/components/readyCountdown.vue.d.ts +31 -0
- package/es/components/audio-sdk/src/components/readyCountdown.vue.js +6 -0
- package/es/components/audio-sdk/src/components/readyCountdown.vue2.js +46 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +138 -10
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +139 -11
- package/es/components/audio-sdk/src/components/recording.vue2.js +318 -74
- package/es/components/audio-sdk/src/hooks/useChartAudioContext.d.ts +24 -0
- package/es/components/audio-sdk/src/hooks/useChartAudioContext.js +176 -0
- package/es/components/audio-sdk/src/svgs/Close.vue.js +26 -0
- package/es/components/audio-sdk/src/svgs/Continue.vue.js +20 -0
- package/es/components/audio-sdk/src/svgs/Enlarge.vue.js +20 -0
- package/es/components/audio-sdk/src/svgs/Pause.vue.js +20 -0
- package/es/components/audio-sdk/src/svgs/WaveView.vue.js +20 -0
- package/es/components/audio-sdk/src/svgs/Zoom.vue.js +27 -0
- package/es/components/audio-sdk/src/types/index.d.ts +42 -0
- package/es/components/audio-sdk/src/types/index.js +10 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +9 -3
- package/es/components/audio-sdk/src/utils/recordingModal.js +57 -32
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/base-search/src/index.vue2.js +30 -18
- package/es/components/big-table/src/BigTable.vue2.js +191 -133
- package/es/components/big-table/src/components/NoData.vue2.js +16 -4
- package/es/components/big-table/src/components/edit-form/edit-date.js +12 -6
- package/es/components/big-table/src/components/edit-form/edit-input.js +8 -2
- package/es/components/big-table/src/components/edit-form/edit-select.js +21 -17
- package/es/components/big-table/src/components/edit-form/edit-time.js +11 -4
- package/es/components/big-table/src/components/input-button.vue2.js +8 -4
- package/es/components/big-table/src/hooks/useNestTable.js +18 -4
- package/es/components/big-table/src/hooks/useTableParse.js +16 -3
- package/es/components/body-select/src/index.vue2.js +24 -4
- package/es/components/button-print/index.d.ts +12 -4
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +12 -4
- package/es/components/button-print/src/ButtonPrint.vue2.js +52 -11
- package/es/components/button-print/src/components/EditFormat.vue2.js +16 -8
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -2
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +104 -49
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +7 -2
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +244 -95
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +5 -2
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +92 -32
- package/es/components/button-print/src/components/Preview.vue.d.ts +5 -2
- package/es/components/button-print/src/components/Preview.vue2.js +14 -4
- package/es/components/button-print/src/utils/dialog.js +26 -8
- package/es/components/button-print/src/utils/print.d.ts +5 -5
- package/es/components/button-print/src/utils/print.js +108 -21
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +8 -2
- package/es/components/card-reader-sdk/src/utils/readHealthCard.js +16 -4
- package/es/components/card-reader-sdk-cn/src/henan/index.js +38 -11
- package/es/components/card-render/src/components/index.d.ts +23 -23
- package/es/components/classification/src/components/search-filter/index.vue2.js +24 -10
- package/es/components/classification/src/components/set-classification/index.vue2.js +24 -7
- package/es/components/classification/src/components/table-modal/index.vue2.js +324 -165
- package/es/components/classification/src/index.vue2.js +261 -69
- package/es/components/default-page/src/constants/index.js +144 -19
- package/es/components/default-page/src/index.vue2.js +8 -2
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +75 -51
- package/es/components/expand-field/src/components/FormItemPerson.vue2.js +46 -38
- package/es/components/expand-field/src/components/PersonModal.vue2.js +62 -50
- package/es/components/expand-field/src/components/form.vue2.js +783 -412
- package/es/components/expand-field/src/index.vue2.js +88 -22
- package/es/components/expand-field/src/utils/constant.js +88 -12
- package/es/components/fabric-chart/src/components/PopupMenu.js +32 -15
- package/es/components/fabric-chart/src/constants/index.js +72 -10
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +18 -4
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +8 -2
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +32 -5
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -2
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +63 -41
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +5 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +24 -4
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +4 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +19 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
- package/es/components/fabric-chart/src/utils/index.js +2 -2
- package/es/components/field-editor/src/fields.js +232 -30
- package/es/components/field-set/src/FieldColor.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldColor.vue2.js +88 -21
- package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +32 -16
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldSet.vue2.js +210 -57
- package/es/components/field-set/src/Index.vue2.js +40 -6
- package/es/components/field-set/src/TableStyle.vue2.js +48 -13
- package/es/components/field-set/src/components/condition.vue2.js +26 -10
- package/es/components/field-set/src/components/edit-dialog.vue2.js +148 -68
- package/es/components/field-set/src/components/edit-filter.vue2.js +24 -4
- package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue2.js +123 -42
- package/es/components/field-set/src/constants/filter.js +328 -42
- package/es/components/field-set/src/constants/index.js +504 -64
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +91 -46
- package/es/components/form-config/src/constants/index.js +80 -11
- package/es/components/form-config/src/hooks/useLocale.js +240 -31
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +8 -4
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +8 -4
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +8 -2
- package/es/components/form-render/src/components/renderer/input.js +3 -2
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +8 -4
- package/es/components/form-render/src/components/renderer/remoteSearch.js +8 -2
- package/es/components/form-render/src/components/renderer/switch.js +24 -4
- package/es/components/form-render/src/components/renderer/textarea.js +5 -4
- package/es/components/form-render/src/utils/schema.js +26 -6
- package/es/components/iho-chat/src/Index.vue2.js +42 -38
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +108 -33
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +132 -90
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +110 -48
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +40 -20
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +55 -23
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +77 -45
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +256 -208
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +306 -208
- package/es/components/iho-chat/src/components/ContextMenu.js +50 -9
- package/es/components/iho-chat/src/components/MessageEvent.vue2.js +16 -4
- package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +8 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +104 -18
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +66 -11
- package/es/components/iho-chat/src/components/SelectLabel.vue2.js +47 -43
- package/es/components/iho-chat/src/components/SiderList.vue2.js +68 -38
- package/es/components/iho-chat/src/components/Video.vue2.js +38 -11
- package/es/components/iho-chat/src/hooks/useVideo.js +15 -4
- package/es/components/iho-chat/src/utils/index.js +79 -14
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +8 -2
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +40 -15
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue2.js +40 -15
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +50 -20
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +16 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +10 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +42 -15
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +18 -12
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +144 -25
- package/es/components/keyboard/src/Keyboard.vue2.js +20 -8
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +51 -37
- package/es/components/map/src/Map.vue2.js +8 -4
- package/es/components/picture-clipper/src/PictureClipper.vue2.js +16 -8
- package/es/components/quick-search/src/index.vue2.js +176 -131
- package/es/components/recommend-search/src/components/BaseSearch.js +14 -8
- package/es/components/recommend-search/src/components/RecommendInput.vue2.js +28 -8
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +18 -5
- package/es/components/scale-view/src/ScaleView.vue2.js +16 -8
- package/es/components/scale-view/src/components/NoData.vue2.js +16 -4
- package/es/components/scale-view/src/components/formitem/r-cascader.js +8 -2
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +24 -6
- package/es/components/scale-view/src/components/formitem/r-input.js +8 -2
- package/es/components/scale-view/src/components/formitem/r-map.js +8 -2
- package/es/components/scale-view/src/components/formitem/r-radio.js +24 -6
- package/es/components/scale-view/src/components/formitem/r-select.js +8 -2
- package/es/components/scale-view/src/components/formitem/r-sign.js +32 -11
- package/es/components/scale-view/src/components/formitem/standard-modal.js +16 -3
- package/es/components/scale-view/src/hooks/scaleview-computed.js +24 -5
- package/es/components/scale-view/src/hooks/scaleview-methods.js +16 -4
- package/es/components/scale-view/src/hooks/scaleview-submit.js +16 -3
- package/es/components/scale-view/src/hooks/scaleview-validate.js +40 -9
- package/es/components/search-cascader/src/SearchCascader.vue2.js +20 -14
- package/es/components/select-label/src/LabelFormContent.vue2.js +53 -21
- package/es/components/select-label/src/SelectLabel.vue2.js +81 -51
- package/es/components/select-label/src/components/label-classify.vue2.js +28 -11
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +18 -5
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +34 -8
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +18 -5
- package/es/components/select-person/src/SelectPerson.vue2.js +214 -141
- package/es/components/select-person/src/SelectPersonType.vue2.js +127 -102
- package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +9 -2
- package/es/components/select-person/src/index.vue2.js +20 -7
- package/es/components/slider-tree/src/index.vue2.js +16 -3
- package/es/components/table-export-field/index.d.ts +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +187 -113
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +147 -88
- package/es/components/table-export-field/src/index.vue.d.ts +1 -0
- package/es/components/table-export-field/src/index.vue2.js +28 -12
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +32 -5
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +264 -34
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +214 -135
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +16 -3
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +9 -2
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +39 -6
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +18 -5
- package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +29 -18
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +16 -3
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +8 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +195 -130
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +26 -7
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +12 -6
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +34 -8
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +21 -8
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +8 -4
- package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +19 -6
- package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +16 -3
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +24 -10
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1648 -207
- package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +8 -2
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +16 -3
- package/es/components/table-filter/src/tool/baseOptions.js +144 -19
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +32 -16
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +22 -2
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +8 -4
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +16 -8
- 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/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/hooks/selectHooks/useSelectAllowModify.js +2 -2
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +0 -6
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +0 -40
- package/es/components/audio-sdk/src/utils/recorder/fft.d.ts +0 -4
- package/es/components/audio-sdk/src/utils/recorder/mp3-engine.d.ts +0 -4
- package/es/components/audio-sdk/src/utils/recorder/mp3.d.ts +0 -4
- package/es/components/audio-sdk/src/utils/recorder/recorder.d.ts +0 -4
- package/es/components/audio-sdk/src/utils/recorder/wave.d.ts +0 -4
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,24 +1,4 @@
|
|
1
|
-
|
2
|
-
result: 'success';
|
3
|
-
data?: string;
|
4
|
-
timeout?: boolean;
|
5
|
-
}
|
6
|
-
type AudioOptions = Partial<{
|
7
|
-
timed: number;
|
8
|
-
showModal: boolean;
|
9
|
-
instance: any;
|
10
|
-
token: string;
|
11
|
-
origin: string;
|
12
|
-
wsType: 'whole' | 'chunk';
|
13
|
-
type: 'http' | 'websocket';
|
14
|
-
wsOrigin: string;
|
15
|
-
wsSendInterval: number;
|
16
|
-
uploadOrigin: string;
|
17
|
-
recognizeOrigin: string;
|
18
|
-
allowPunctuationMark: boolean;
|
19
|
-
lastChunkTimeout: number;
|
20
|
-
wsTimeout: number;
|
21
|
-
}>;
|
1
|
+
import { AudioTypes } from './types';
|
22
2
|
export default class AudioSDK {
|
23
3
|
private plugins;
|
24
4
|
private static instance;
|
@@ -36,11 +16,14 @@ export default class AudioSDK {
|
|
36
16
|
contentRef: import("vue").Ref<string>;
|
37
17
|
wsConnected: import("vue").Ref<boolean>;
|
38
18
|
private loading;
|
19
|
+
private pauseContent;
|
20
|
+
recorderStatus: import("vue").Ref<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
|
21
|
+
recorderClosing: import("vue").Ref<boolean>;
|
39
22
|
waveView: any;
|
40
23
|
constructor();
|
41
24
|
static create(): AudioSDK;
|
42
25
|
private initRecorder;
|
43
|
-
start(options: AudioOptions): Promise<SpeechResult>;
|
26
|
+
start(options: AudioTypes.AudioOptions): Promise<AudioTypes.SpeechResult>;
|
44
27
|
private setWsConnected;
|
45
28
|
private setupWebSocket;
|
46
29
|
private startRecording;
|
@@ -54,8 +37,19 @@ export default class AudioSDK {
|
|
54
37
|
private sendBlob;
|
55
38
|
private messageResolver;
|
56
39
|
private lastChunkTimer;
|
40
|
+
/**
|
41
|
+
* 关闭录音
|
42
|
+
* isErrorSet 错误状态需要关闭录音, 关闭页面或者弹框, 并提示
|
43
|
+
* isEndSet 结束 需要校验录音空值并提示
|
44
|
+
* isCloseSet 关闭 不要返回this.contentRef.value
|
45
|
+
* @param params
|
46
|
+
* @returns
|
47
|
+
*/
|
57
48
|
stop(params?: {
|
58
49
|
timeout?: boolean;
|
50
|
+
isErrorSet?: boolean;
|
51
|
+
isEndSet?: boolean;
|
52
|
+
isCloseSet?: boolean;
|
59
53
|
}): Promise<void>;
|
60
54
|
private resolvePendingRequest;
|
61
55
|
private processHttpRecording;
|
@@ -63,14 +57,23 @@ export default class AudioSDK {
|
|
63
57
|
private handleMessage;
|
64
58
|
private handleLastChunk;
|
65
59
|
private parseMessageData;
|
66
|
-
|
60
|
+
/**
|
61
|
+
* 错误处理
|
62
|
+
* @param msg 错误信息
|
63
|
+
* @param isUserNotAllow 是否用户未授权
|
64
|
+
* @param messageType 提示类型 warning 警告 error 错误
|
65
|
+
* @param errorType 错误类型 stop空值提示触发的, 就不需要再调用stop
|
66
|
+
* @returns
|
67
|
+
*/
|
68
|
+
handleError(msg: string, isUserNotAllow?: boolean, messageType?: 'warning' | 'error', errorType?: 'stop'): Promise<void>;
|
67
69
|
private cleanupWebSocket;
|
68
70
|
private cleanupResources;
|
69
71
|
private resetState;
|
70
72
|
private checkEnvironment;
|
71
|
-
|
72
|
-
|
73
|
+
private cleanupWaveView;
|
74
|
+
startWaveView(options: AudioTypes.WaveViewOptions): Promise<void>;
|
75
|
+
pause(): Promise<void>;
|
76
|
+
resume(): Promise<void>;
|
73
77
|
destroy(): void;
|
74
78
|
static destroy(): void;
|
75
79
|
}
|
76
|
-
export {};
|
@@ -6,6 +6,8 @@ import { loadRecorderPlugins } from './utils/recorder/index.js';
|
|
6
6
|
import { ref } from 'vue';
|
7
7
|
import { $message } from './utils/index.js';
|
8
8
|
import { RecordingModal } from './utils/recordingModal.js';
|
9
|
+
import { AudioTypes } from './types/index.js';
|
10
|
+
import { promiseTimeout } from '@vueuse/core';
|
9
11
|
import Recorder from './utils/recorder/recorder.js';
|
10
12
|
|
11
13
|
const DEFAULT_OPTIONS = {
|
@@ -31,7 +33,7 @@ const _AudioSDK = class {
|
|
31
33
|
...DEFAULT_OPTIONS
|
32
34
|
};
|
33
35
|
this.reqId = "";
|
34
|
-
this.connectionState =
|
36
|
+
this.connectionState = AudioTypes.ConnectionState.DISCONNECTED;
|
35
37
|
this.sendBuffer = [];
|
36
38
|
this.startTimestamp = 0;
|
37
39
|
this.bufferIndex = 0;
|
@@ -40,6 +42,9 @@ const _AudioSDK = class {
|
|
40
42
|
this.contentRef = ref("");
|
41
43
|
this.wsConnected = ref(false);
|
42
44
|
this.loading = ref(false);
|
45
|
+
this.pauseContent = "";
|
46
|
+
this.recorderStatus = ref("");
|
47
|
+
this.recorderClosing = ref(false);
|
43
48
|
this.waveView = null;
|
44
49
|
this.messageResolver = null;
|
45
50
|
this.lastChunkTimer = null;
|
@@ -61,8 +66,10 @@ const _AudioSDK = class {
|
|
61
66
|
}
|
62
67
|
async start(options) {
|
63
68
|
this.resetState();
|
69
|
+
this.wsConnected.value = false;
|
64
70
|
Object.assign(this.options, DEFAULT_OPTIONS, options);
|
65
71
|
if (!this.checkEnvironment()) {
|
72
|
+
this.recorderStatus.value = "fail";
|
66
73
|
return Promise.reject({
|
67
74
|
result: "fail",
|
68
75
|
msg: "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5F55\u97F3"
|
@@ -71,6 +78,7 @@ const _AudioSDK = class {
|
|
71
78
|
if (!this.recorder)
|
72
79
|
this.initRecorder();
|
73
80
|
this.reqId = uuidGenerator();
|
81
|
+
this.pauseContent = "";
|
74
82
|
this.contentRef.value = "";
|
75
83
|
if (this.options.type === "websocket") {
|
76
84
|
this.setWsConnected(false);
|
@@ -84,13 +92,13 @@ const _AudioSDK = class {
|
|
84
92
|
this.wsConnected.value = wsConnected;
|
85
93
|
}
|
86
94
|
async setupWebSocket() {
|
87
|
-
if (this.connectionState ===
|
95
|
+
if (this.connectionState === AudioTypes.ConnectionState.CONNECTED)
|
88
96
|
return this.setWsConnected(true);
|
89
97
|
return new Promise((resolve, reject) => {
|
90
98
|
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
91
99
|
const url = this.options.origin || `${protocol}//${window.location.host}${this.options.wsOrigin}`;
|
92
100
|
this.webSocket = new WebSocket(url);
|
93
|
-
this.connectionState =
|
101
|
+
this.connectionState = AudioTypes.ConnectionState.CONNECTING;
|
94
102
|
const timeout = setTimeout(() => {
|
95
103
|
this.cleanupWebSocket();
|
96
104
|
reject({
|
@@ -101,7 +109,7 @@ const _AudioSDK = class {
|
|
101
109
|
}, this.options.wsTimeout);
|
102
110
|
this.webSocket.onopen = () => {
|
103
111
|
clearTimeout(timeout);
|
104
|
-
this.connectionState =
|
112
|
+
this.connectionState = AudioTypes.ConnectionState.CONNECTED;
|
105
113
|
this.setWsConnected(true);
|
106
114
|
resolve();
|
107
115
|
};
|
@@ -110,6 +118,7 @@ const _AudioSDK = class {
|
|
110
118
|
this.webSocket.onclose = () => {
|
111
119
|
this.cleanupWebSocket();
|
112
120
|
clearTimeout(timeout);
|
121
|
+
this.recorderStatus.value = "ws_close";
|
113
122
|
};
|
114
123
|
});
|
115
124
|
}
|
@@ -124,9 +133,11 @@ const _AudioSDK = class {
|
|
124
133
|
this.recorder.start();
|
125
134
|
if (this.options.timed) {
|
126
135
|
this.timer = setTimeout(() => this.stop({
|
127
|
-
timeout: true
|
136
|
+
timeout: true,
|
137
|
+
isEndSet: true
|
128
138
|
}), this.options.timed * 1e3);
|
129
139
|
}
|
140
|
+
this.recorderStatus.value = "recording";
|
130
141
|
if (this.options.showModal) {
|
131
142
|
this.showRecordingModal();
|
132
143
|
}
|
@@ -138,10 +149,14 @@ const _AudioSDK = class {
|
|
138
149
|
showRecordingModal() {
|
139
150
|
this.recordingModal.show({
|
140
151
|
instance: this.options.instance,
|
141
|
-
onClose: () => this.stop(),
|
152
|
+
onClose: async (obj) => await this.stop(obj),
|
153
|
+
startWaveViewMethod: (options) => this.startWaveView(options),
|
154
|
+
pause: () => this.pause(),
|
155
|
+
resume: () => this.resume(),
|
142
156
|
props: {
|
143
157
|
contentRef: this.contentRef,
|
144
|
-
wsConnected: this.wsConnected
|
158
|
+
wsConnected: this.wsConnected,
|
159
|
+
recorderStatus: this.recorderStatus
|
145
160
|
}
|
146
161
|
});
|
147
162
|
}
|
@@ -223,20 +238,38 @@ const _AudioSDK = class {
|
|
223
238
|
reader.readAsDataURL(blob);
|
224
239
|
}
|
225
240
|
async stop(params = {}) {
|
226
|
-
|
241
|
+
var _a, _b;
|
242
|
+
if (this.recorderClosing.value)
|
243
|
+
return;
|
244
|
+
this.recorderClosing.value = true;
|
245
|
+
(_b = (_a = this.recordingModal) == null ? void 0 : _a.setLoading) == null ? void 0 : _b.call(_a);
|
227
246
|
clearTimeout(this.timer);
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
this.
|
234
|
-
|
235
|
-
|
236
|
-
|
247
|
+
!params.isErrorSet && (this.recorderStatus.value = "stop");
|
248
|
+
try {
|
249
|
+
if (this.options.type === "http") {
|
250
|
+
await this.processHttpRecording();
|
251
|
+
} else {
|
252
|
+
this.sendBufferedData(true);
|
253
|
+
await new Promise((resolve) => {
|
254
|
+
this.messageResolver = resolve;
|
255
|
+
this.lastChunkTimer = setTimeout(resolve, this.options.lastChunkTimeout);
|
256
|
+
});
|
257
|
+
this.messageResolver = null;
|
258
|
+
}
|
259
|
+
await this.cleanupResources();
|
260
|
+
this.cleanupWebSocket();
|
261
|
+
if (params.isEndSet && !this.contentRef.value) {
|
262
|
+
this.handleError("\u5F55\u97F3\u5185\u5BB9\u4E3A\u7A7A", false, "warning", "stop");
|
263
|
+
this.recorderClosing.value = false;
|
264
|
+
return;
|
265
|
+
}
|
266
|
+
this.resolvePendingRequest(params);
|
267
|
+
this.recordingModal.hide();
|
268
|
+
this.recorderClosing.value = false;
|
269
|
+
} catch (err) {
|
270
|
+
console.log(err);
|
271
|
+
this.recorderClosing.value = false;
|
237
272
|
}
|
238
|
-
this.resolvePendingRequest(params);
|
239
|
-
this.cleanupResources();
|
240
273
|
}
|
241
274
|
resolvePendingRequest(params) {
|
242
275
|
const handler = this.messageQueue.shift();
|
@@ -244,7 +277,7 @@ const _AudioSDK = class {
|
|
244
277
|
return;
|
245
278
|
const result = {
|
246
279
|
result: "success",
|
247
|
-
data: this.contentRef.value,
|
280
|
+
data: params.isCloseSet ? "" : this.contentRef.value,
|
248
281
|
timeout: params.timeout
|
249
282
|
};
|
250
283
|
handler.resolve(result);
|
@@ -303,11 +336,23 @@ const _AudioSDK = class {
|
|
303
336
|
}
|
304
337
|
handleMessage(event) {
|
305
338
|
const {
|
306
|
-
data
|
307
|
-
|
339
|
+
data: {
|
340
|
+
data,
|
341
|
+
isLast
|
342
|
+
} = {
|
343
|
+
data: "",
|
344
|
+
isLast: false
|
345
|
+
},
|
346
|
+
success,
|
347
|
+
msg
|
308
348
|
} = this.parseMessageData(event.data) || {};
|
349
|
+
if (!success) {
|
350
|
+
this.handleError(msg || "\u670D\u52A1\u5F02\u5E38");
|
351
|
+
return;
|
352
|
+
}
|
309
353
|
if (data) {
|
310
|
-
|
354
|
+
const _data = this.pauseContent + data;
|
355
|
+
this.contentRef.value = this.options.allowPunctuationMark ? _data : _data.replace(/[??,。,.\s]/g, "");
|
311
356
|
}
|
312
357
|
isLast && this.handleLastChunk();
|
313
358
|
}
|
@@ -323,23 +368,23 @@ const _AudioSDK = class {
|
|
323
368
|
}
|
324
369
|
parseMessageData(data) {
|
325
370
|
if (!isString(data))
|
326
|
-
return
|
371
|
+
return {
|
372
|
+
success: true
|
373
|
+
};
|
327
374
|
try {
|
328
|
-
const res = JSON.parse(data)
|
375
|
+
const res = JSON.parse(data);
|
329
376
|
if (!isObject(res))
|
330
377
|
return {
|
331
|
-
|
332
|
-
isLast: false
|
378
|
+
success: true
|
333
379
|
};
|
334
380
|
return res;
|
335
381
|
} catch (e) {
|
336
382
|
return {
|
337
|
-
|
338
|
-
isLast: false
|
383
|
+
success: true
|
339
384
|
};
|
340
385
|
}
|
341
386
|
}
|
342
|
-
handleError(msg, isUserNotAllow = false) {
|
387
|
+
async handleError(msg, isUserNotAllow = false, messageType = "error", errorType) {
|
343
388
|
const handler = this.messageQueue.shift();
|
344
389
|
if (!handler)
|
345
390
|
return;
|
@@ -348,25 +393,31 @@ const _AudioSDK = class {
|
|
348
393
|
msg,
|
349
394
|
isUserNotAllow
|
350
395
|
};
|
351
|
-
|
352
|
-
this.
|
396
|
+
this.recorderStatus.value = "fail";
|
397
|
+
errorType != "stop" && await this.stop({
|
398
|
+
isErrorSet: true
|
399
|
+
});
|
353
400
|
if (isUserNotAllow) {
|
354
401
|
$message.warning("\u8BF7\u5F00\u542F\u9EA6\u514B\u98CE\u6743\u9650");
|
402
|
+
} else if (msg) {
|
403
|
+
$message[messageType](msg);
|
355
404
|
}
|
405
|
+
handler.reject(error);
|
356
406
|
}
|
357
407
|
cleanupWebSocket() {
|
358
|
-
var _a;
|
359
|
-
(_a = this.webSocket) == null ? void 0 : _a.close();
|
408
|
+
var _a, _b;
|
409
|
+
(_b = (_a = this.webSocket) == null ? void 0 : _a.close) == null ? void 0 : _b.call(_a);
|
360
410
|
this.webSocket = null;
|
361
|
-
this.connectionState =
|
411
|
+
this.connectionState = AudioTypes.ConnectionState.DISCONNECTED;
|
362
412
|
}
|
363
|
-
cleanupResources() {
|
364
|
-
var _a;
|
365
|
-
(_a = this.recorder) == null ? void 0 : _a.close();
|
413
|
+
async cleanupResources() {
|
414
|
+
var _a, _b;
|
415
|
+
await ((_b = (_a = this.recorder) == null ? void 0 : _a.close) == null ? void 0 : _b.call(_a));
|
366
416
|
this.sendBuffer = [];
|
367
417
|
this.startTimestamp = 0;
|
368
418
|
}
|
369
419
|
resetState() {
|
420
|
+
this.recorderStatus.value = "";
|
370
421
|
this.cleanupResources();
|
371
422
|
clearTimeout(this.timer);
|
372
423
|
}
|
@@ -377,13 +428,43 @@ const _AudioSDK = class {
|
|
377
428
|
}
|
378
429
|
return true;
|
379
430
|
}
|
380
|
-
|
381
|
-
|
382
|
-
|
431
|
+
cleanupWaveView() {
|
432
|
+
if (!this.waveView)
|
433
|
+
return;
|
434
|
+
this.waveView.elem = null;
|
435
|
+
this.waveView.canvas = null;
|
436
|
+
this.waveView = null;
|
437
|
+
}
|
438
|
+
async startWaveView(options) {
|
439
|
+
var _a, _b, _c, _d;
|
440
|
+
this.cleanupWaveView();
|
441
|
+
await promiseTimeout(50);
|
442
|
+
this.waveView = (_d = (_c = (_b = Recorder).FrequencyHistogramView) == null ? void 0 : _c.call(_b, {
|
443
|
+
elem: (_a = options == null ? void 0 : options.waveSelector) == null ? void 0 : _a.call(options),
|
444
|
+
scale: 1,
|
445
|
+
fps: 15,
|
446
|
+
widthRatio: 0.5,
|
447
|
+
lineCount: 30,
|
448
|
+
minHeight: 2,
|
449
|
+
stripeEnable: false,
|
450
|
+
mirrorEnable: false,
|
451
|
+
linear: [0, "rgba(94, 92, 255, 0.9)", 1, "rgba(95, 88, 224)"],
|
452
|
+
position: 0,
|
453
|
+
...options == null ? void 0 : options.waveProps
|
454
|
+
})) != null ? _d : null;
|
455
|
+
}
|
456
|
+
async pause() {
|
457
|
+
var _a, _b;
|
458
|
+
this.cleanupWebSocket();
|
459
|
+
this.pauseContent = this.contentRef.value;
|
460
|
+
(_b = (_a = this.recorder) == null ? void 0 : _a.pause) == null ? void 0 : _b.call(_a);
|
461
|
+
this.recorderStatus.value = "pause";
|
383
462
|
}
|
384
|
-
resume() {
|
463
|
+
async resume() {
|
385
464
|
var _a;
|
465
|
+
await this.setupWebSocket();
|
386
466
|
(_a = this.recorder) == null ? void 0 : _a.resume();
|
467
|
+
this.recorderStatus.value = "recording";
|
387
468
|
}
|
388
469
|
destroy() {
|
389
470
|
this.resetState();
|
@@ -0,0 +1,31 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
isCountActive: {
|
3
|
+
type: BooleanConstructor;
|
4
|
+
default: boolean;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
8
|
+
isCountActive: {
|
9
|
+
type: BooleanConstructor;
|
10
|
+
default: boolean;
|
11
|
+
};
|
12
|
+
}>> & {
|
13
|
+
"onUpdate:isCountFinished"?: ((...args: any[]) => any) | undefined;
|
14
|
+
}>>;
|
15
|
+
emit: (event: "update:isCountFinished", ...args: any[]) => void;
|
16
|
+
renderCountdown: ({ seconds }: {
|
17
|
+
seconds: number;
|
18
|
+
}) => number;
|
19
|
+
countDownFinish: () => void;
|
20
|
+
NCountdown: any;
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:isCountFinished"[], "update:isCountFinished", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
22
|
+
isCountActive: {
|
23
|
+
type: BooleanConstructor;
|
24
|
+
default: boolean;
|
25
|
+
};
|
26
|
+
}>> & {
|
27
|
+
"onUpdate:isCountFinished"?: ((...args: any[]) => any) | undefined;
|
28
|
+
}, {
|
29
|
+
isCountActive: boolean;
|
30
|
+
}>;
|
31
|
+
export default _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import _sfc_main from './readyCountdown.vue2.js';
|
2
|
+
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
|
3
|
+
|
4
|
+
var ReadyCountdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "readyCountdown.vue"]]);
|
5
|
+
|
6
|
+
export { ReadyCountdown as default };
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref } from 'vue';
|
2
|
+
import { NCountdown } from 'naive-ui';
|
3
|
+
|
4
|
+
const _hoisted_1 = {
|
5
|
+
class: "c-recording-ready"
|
6
|
+
};
|
7
|
+
const _hoisted_2 = {
|
8
|
+
class: "c-recording-countdown-box"
|
9
|
+
};
|
10
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("h4", null, "\u51C6\u5907\u5F00\u59CB\u5F55\u97F3", -1);
|
11
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("p", {
|
12
|
+
class: "c-recording-ready-desc"
|
13
|
+
}, "3\u79D2\u540E\u5F00\u59CB\u5F55\u97F3\uFF0C\u8BF7\u505A\u597D\u51C6\u5907\uFF01", -1);
|
14
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
15
|
+
__name: "readyCountdown",
|
16
|
+
props: {
|
17
|
+
isCountActive: {
|
18
|
+
type: Boolean,
|
19
|
+
default: false
|
20
|
+
}
|
21
|
+
},
|
22
|
+
emits: ["update:isCountFinished"],
|
23
|
+
setup(__props, {
|
24
|
+
emit
|
25
|
+
}) {
|
26
|
+
const props = __props;
|
27
|
+
const renderCountdown = ({
|
28
|
+
seconds
|
29
|
+
}) => {
|
30
|
+
return seconds;
|
31
|
+
};
|
32
|
+
const countDownFinish = () => {
|
33
|
+
emit("update:isCountFinished", true);
|
34
|
+
};
|
35
|
+
return (_ctx, _cache) => {
|
36
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("span", null, [createVNode(unref(NCountdown), {
|
37
|
+
active: props.isCountActive,
|
38
|
+
duration: 3e3,
|
39
|
+
render: renderCountdown,
|
40
|
+
onFinish: countDownFinish
|
41
|
+
}, null, 8, ["active"])])]), _hoisted_3, _hoisted_4]);
|
42
|
+
};
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
46
|
+
export { _sfc_main as default };
|