cnhis-design-vue 3.3.2-beta.18 → 3.3.2-beta.19

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 (43) hide show
  1. package/es/components/audio-sdk/index.d.ts +172 -146
  2. package/es/components/audio-sdk/src/Index.vue.d.ts +173 -147
  3. package/es/components/audio-sdk/src/Index.vue2.js +131 -53
  4. package/es/components/audio-sdk/src/audioSDK.d.ts +29 -26
  5. package/es/components/audio-sdk/src/audioSDK.js +124 -42
  6. package/es/components/audio-sdk/src/components/readyCountdown.vue.d.ts +31 -0
  7. package/es/components/audio-sdk/src/components/readyCountdown.vue.js +6 -0
  8. package/es/components/audio-sdk/src/components/readyCountdown.vue2.js +46 -0
  9. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +137 -10
  10. package/es/components/audio-sdk/src/components/recording.vue.d.ts +138 -11
  11. package/es/components/audio-sdk/src/components/recording.vue2.js +317 -74
  12. package/es/components/audio-sdk/src/hooks/useChartAudioContext.d.ts +24 -0
  13. package/es/components/audio-sdk/src/hooks/useChartAudioContext.js +176 -0
  14. package/es/components/audio-sdk/src/svgs/Close.vue.js +26 -0
  15. package/es/components/audio-sdk/src/svgs/Continue.vue.js +20 -0
  16. package/es/components/audio-sdk/src/svgs/Enlarge.vue.js +20 -0
  17. package/es/components/audio-sdk/src/svgs/Pause.vue.js +20 -0
  18. package/es/components/audio-sdk/src/svgs/WaveView.vue.js +20 -0
  19. package/es/components/audio-sdk/src/svgs/Zoom.vue.js +27 -0
  20. package/es/components/audio-sdk/src/types/index.d.ts +42 -0
  21. package/es/components/audio-sdk/src/types/index.js +10 -0
  22. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +9 -3
  23. package/es/components/audio-sdk/src/utils/recordingModal.js +57 -32
  24. package/es/components/audio-sdk/style/index.css +1 -1
  25. package/es/components/button-print/index.d.ts +8 -4
  26. package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -4
  27. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -2
  28. package/es/components/button-print/src/components/IdentityVerification.vue2.js +6 -2
  29. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -2
  30. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +4 -2
  31. package/es/components/button-print/src/components/Preview.vue.d.ts +5 -2
  32. package/es/components/button-print/src/components/Preview.vue2.js +6 -2
  33. package/es/components/button-print/src/utils/dialog.js +2 -2
  34. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +2 -1
  35. package/es/components/field-set/src/FieldColor.vue.d.ts +4 -4
  36. package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
  37. package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
  38. package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
  39. package/es/components/index.css +1 -1
  40. package/es/shared/package.json.js +1 -1
  41. package/package.json +2 -2
  42. package/es/components/audio-sdk/src/components/recording-modal.vue.js +0 -6
  43. package/es/components/audio-sdk/src/components/recording-modal.vue2.js +0 -40
@@ -1,6 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
- import { AnyObject } from '../../../shared/types';
3
2
  import AudioSDK from './audioSDK';
3
+ import { AnyObject } from '../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  timed: {
6
6
  type: NumberConstructor;
@@ -22,7 +22,12 @@ declare const _default: import("vue").DefineComponent<{
22
22
  configs: {
23
23
  type: PropType<AnyObject>;
24
24
  };
25
+ useSource: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
25
29
  }, {
30
+ consultationRecordUrl: string;
26
31
  cssVars: import("vue").ComputedRef<AnyObject>;
27
32
  audioSdk: AudioSDK;
28
33
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -46,29 +51,47 @@ declare const _default: import("vue").DefineComponent<{
46
51
  configs: {
47
52
  type: PropType<AnyObject>;
48
53
  };
54
+ useSource: {
55
+ type: StringConstructor;
56
+ default: string;
57
+ };
49
58
  }>> & {
50
59
  onSuccess?: ((...args: any[]) => any) | undefined;
51
60
  onClose?: ((...args: any[]) => any) | undefined;
52
61
  onFail?: ((...args: any[]) => any) | undefined;
62
+ onRecordingHeightChange?: ((...args: any[]) => any) | undefined;
53
63
  }>>;
54
64
  attrs: {
55
65
  [x: string]: unknown;
56
66
  };
57
- emit: (event: "close" | "success" | "fail", ...args: any[]) => void;
67
+ default_height: number;
68
+ emit: (event: "close" | "success" | "fail" | "recordingHeightChange", ...args: any[]) => void;
58
69
  recordingRef: import("vue").Ref<any>;
59
70
  isRecording: import("vue").Ref<boolean>;
60
71
  loading: import("vue").Ref<boolean>;
61
- content: import("vue").ComputedRef<string>;
72
+ content: any;
73
+ wsConnected: import("vue").ComputedRef<boolean>;
74
+ recorderStatus: import("vue").ComputedRef<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
62
75
  recordingProps: import("vue").ComputedRef<{
63
76
  token: string | undefined;
64
77
  configs: AnyObject;
65
- content: string;
78
+ content: any;
66
79
  intentionCode: string;
80
+ show: boolean;
81
+ wsConnected: boolean;
82
+ recorderStatus: "" | "fail" | "recording" | "pause" | "ws_close" | "stop";
83
+ startWaveViewMethod: (options: AnyObject) => void;
67
84
  }>;
68
85
  isGenerateMedicalRecord: import("vue").ComputedRef<boolean>;
69
- onClose: () => void;
70
- onEnd: () => void;
86
+ handleHeightChange: (height: number) => void;
87
+ onClose: (obj?: AnyObject) => Promise<void>;
71
88
  onSuccess: (data: AnyObject) => void;
89
+ onFail: (error: any) => void;
90
+ startWaveViewMethod: (options: AnyObject) => void;
91
+ onPause: () => void;
92
+ onResume: () => void;
93
+ handleToAnalyzing: (obj?: AnyObject) => Promise<void>;
94
+ createMedicalRecord: () => Promise<void>;
72
95
  CRecording: import("vue").DefineComponent<{
73
96
  content: {
74
97
  type: PropType<string | {
@@ -92,11 +115,25 @@ declare const _default: import("vue").DefineComponent<{
92
115
  type: BooleanConstructor;
93
116
  default: boolean;
94
117
  };
118
+ wsConnected: {
119
+ type: BooleanConstructor;
120
+ default: boolean;
121
+ };
95
122
  fromSdk: {
96
123
  type: BooleanConstructor;
97
124
  };
125
+ show: {
126
+ type: BooleanConstructor;
127
+ default: boolean;
128
+ };
129
+ startWaveViewMethod: {
130
+ type: PropType<import("../../../shared/types").AnyFn>;
131
+ };
132
+ recorderStatus: {
133
+ type: PropType<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
134
+ default: string;
135
+ };
98
136
  }, {
99
- consultationRecordUrl: string;
100
137
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
101
138
  content: {
102
139
  type: PropType<string | {
@@ -120,24 +157,117 @@ declare const _default: import("vue").DefineComponent<{
120
157
  type: BooleanConstructor;
121
158
  default: boolean;
122
159
  };
160
+ wsConnected: {
161
+ type: BooleanConstructor;
162
+ default: boolean;
163
+ };
123
164
  fromSdk: {
124
165
  type: BooleanConstructor;
125
166
  };
167
+ show: {
168
+ type: BooleanConstructor;
169
+ default: boolean;
170
+ };
171
+ startWaveViewMethod: {
172
+ type: PropType<import("../../../shared/types").AnyFn>;
173
+ };
174
+ recorderStatus: {
175
+ type: PropType<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
176
+ default: string;
177
+ };
126
178
  }>> & {
127
179
  onSuccess?: ((...args: any[]) => any) | undefined;
128
180
  onClose?: ((...args: any[]) => any) | undefined;
129
181
  onFail?: ((...args: any[]) => any) | undefined;
130
- onEnd?: ((...args: any[]) => any) | undefined;
131
- "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
182
+ onPause?: ((...args: any[]) => any) | undefined;
183
+ onResume?: ((...args: any[]) => any) | undefined;
184
+ onToAnalyzing?: ((...args: any[]) => any) | undefined;
185
+ onHeightChange?: ((...args: any[]) => any) | undefined;
132
186
  }>>;
133
- emit: (event: "close" | "success" | "end" | "fail" | "update:loading", ...args: any[]) => void;
134
- close: () => void;
135
- toAnalyzing: () => Promise<void>;
187
+ emit: (event: "close" | "success" | "fail" | "pause" | "resume" | "toAnalyzing" | "heightChange", ...args: any[]) => void;
188
+ loading: import("vue").Ref<boolean>;
189
+ content: import("vue").Ref<string | {
190
+ data: string;
191
+ }>;
192
+ wsConnected: import("vue").Ref<boolean>;
193
+ recorderStatus: import("vue").Ref<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
194
+ audioChartRef: import("vue").Ref<HTMLDivElement | undefined>;
195
+ audioChartSamllRef: import("vue").Ref<HTMLDivElement | undefined>;
196
+ contentScrollRef: import("vue").Ref<HTMLDivElement | undefined>;
197
+ isActive: import("vue").Ref<boolean>;
198
+ isWarning: import("vue").Ref<boolean>;
199
+ formattedTime: import("vue").ComputedRef<string>;
200
+ isCountFinished: import("vue").Ref<boolean>;
201
+ isCountActive: import("vue").Ref<boolean>;
202
+ isZoomSmall: import("vue").Ref<boolean>;
203
+ pause: any;
204
+ btnDisabled: import("vue").ComputedRef<any>;
205
+ handleEnd: (closeType?: string) => Promise<any>;
206
+ handlePause: () => Promise<void>;
207
+ handlePlay: () => Promise<void>;
208
+ handleZoom: () => Promise<void>;
209
+ setWarningState: (state: boolean) => void;
210
+ startWarningTimer: (initTime?: number) => void;
211
+ initStartWaveView: () => Promise<void>;
212
+ cleanupState: () => void;
213
+ handleHeightChange: (showContent: boolean) => void;
214
+ onEnd: (closeType?: string) => Promise<any>;
215
+ onPause: () => Promise<void>;
216
+ onPlay: () => Promise<void>;
217
+ onZoom: () => Promise<void>;
218
+ isFailStatus: import("vue").ComputedRef<boolean>;
219
+ isActiveStatus: import("vue").ComputedRef<boolean>;
220
+ isWarningStatus: import("vue").ComputedRef<boolean>;
221
+ isPauseStatus: import("vue").ComputedRef<boolean>;
222
+ showContent: import("vue").ComputedRef<boolean>;
223
+ tip: import("vue").ComputedRef<"录音异常!" | "录音识别中..." | "正在录音中..." | "无语音录入,请检测是否录音!" | "已暂停录音">;
224
+ tipSmall: import("vue").ComputedRef<"录入异常" | "识别中..." | "录音中..." | "已暂停">;
225
+ showDom: import("vue").ComputedRef<boolean>;
136
226
  NIcon: any;
137
227
  NButton: any;
138
228
  NSpin: any;
139
- 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<{}>>, {}>;
140
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "end" | "fail" | "update:loading")[], "close" | "success" | "end" | "fail" | "update:loading", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
229
+ NSpace: any;
230
+ NTooltip: any;
231
+ MicOff: 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<{}>>, {}>;
232
+ PlayCircleOutline: 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<{}>>, {}>;
233
+ StopCircle: 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<{}>>, {}>;
234
+ ReadyCountdown: import("vue").DefineComponent<{
235
+ isCountActive: {
236
+ type: BooleanConstructor;
237
+ default: boolean;
238
+ };
239
+ }, {
240
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
241
+ isCountActive: {
242
+ type: BooleanConstructor;
243
+ default: boolean;
244
+ };
245
+ }>> & {
246
+ "onUpdate:isCountFinished"?: ((...args: any[]) => any) | undefined;
247
+ }>>;
248
+ emit: (event: "update:isCountFinished", ...args: any[]) => void;
249
+ renderCountdown: ({ seconds }: {
250
+ seconds: number;
251
+ }) => number;
252
+ countDownFinish: () => void;
253
+ NCountdown: any;
254
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:isCountFinished"[], "update:isCountFinished", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
255
+ isCountActive: {
256
+ type: BooleanConstructor;
257
+ default: boolean;
258
+ };
259
+ }>> & {
260
+ "onUpdate:isCountFinished"?: ((...args: any[]) => any) | undefined;
261
+ }, {
262
+ isCountActive: boolean;
263
+ }>;
264
+ CloseSvg: any;
265
+ ZoomSvg: any;
266
+ PauseSvg: any;
267
+ ContinueSvg: any;
268
+ EnlargeSvg: any;
269
+ WaveView: any;
270
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "fail" | "pause" | "resume" | "toAnalyzing" | "heightChange")[], "close" | "success" | "fail" | "pause" | "resume" | "toAnalyzing" | "heightChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
141
271
  content: {
142
272
  type: PropType<string | {
143
273
  data: string;
@@ -160,154 +290,44 @@ declare const _default: import("vue").DefineComponent<{
160
290
  type: BooleanConstructor;
161
291
  default: boolean;
162
292
  };
293
+ wsConnected: {
294
+ type: BooleanConstructor;
295
+ default: boolean;
296
+ };
163
297
  fromSdk: {
164
298
  type: BooleanConstructor;
165
299
  };
300
+ show: {
301
+ type: BooleanConstructor;
302
+ default: boolean;
303
+ };
304
+ startWaveViewMethod: {
305
+ type: PropType<import("../../../shared/types").AnyFn>;
306
+ };
307
+ recorderStatus: {
308
+ type: PropType<"" | "fail" | "recording" | "pause" | "ws_close" | "stop">;
309
+ default: string;
310
+ };
166
311
  }>> & {
167
312
  onSuccess?: ((...args: any[]) => any) | undefined;
168
313
  onClose?: ((...args: any[]) => any) | undefined;
169
314
  onFail?: ((...args: any[]) => any) | undefined;
170
- onEnd?: ((...args: any[]) => any) | undefined;
171
- "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
315
+ onPause?: ((...args: any[]) => any) | undefined;
316
+ onResume?: ((...args: any[]) => any) | undefined;
317
+ onToAnalyzing?: ((...args: any[]) => any) | undefined;
318
+ onHeightChange?: ((...args: any[]) => any) | undefined;
172
319
  }, {
173
320
  content: string | {
174
321
  data: string;
175
322
  };
176
323
  loading: boolean;
324
+ show: boolean;
177
325
  showBtn: boolean;
326
+ wsConnected: boolean;
178
327
  fromSdk: boolean;
328
+ recorderStatus: "" | "fail" | "recording" | "pause" | "ws_close" | "stop";
179
329
  }>;
180
- RecordingModal: import("vue").DefineComponent<{
181
- content: {
182
- type: StringConstructor;
183
- default: string;
184
- };
185
- }, {
186
- cssVars: import("vue").ComputedRef<AnyObject>;
187
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
188
- content: {
189
- type: StringConstructor;
190
- default: string;
191
- };
192
- }>> & {}>>;
193
- NModal: any;
194
- Recording: import("vue").DefineComponent<{
195
- content: {
196
- type: PropType<string | {
197
- data: string;
198
- }>;
199
- default: string;
200
- };
201
- showBtn: {
202
- type: BooleanConstructor;
203
- };
204
- token: {
205
- type: StringConstructor;
206
- };
207
- intentionCode: {
208
- type: StringConstructor;
209
- };
210
- configs: {
211
- type: PropType<AnyObject>;
212
- };
213
- loading: {
214
- type: BooleanConstructor;
215
- default: boolean;
216
- };
217
- fromSdk: {
218
- type: BooleanConstructor;
219
- };
220
- }, {
221
- consultationRecordUrl: string;
222
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
223
- content: {
224
- type: PropType<string | {
225
- data: string;
226
- }>;
227
- default: string;
228
- };
229
- showBtn: {
230
- type: BooleanConstructor;
231
- };
232
- token: {
233
- type: StringConstructor;
234
- };
235
- intentionCode: {
236
- type: StringConstructor;
237
- };
238
- configs: {
239
- type: PropType<AnyObject>;
240
- };
241
- loading: {
242
- type: BooleanConstructor;
243
- default: boolean;
244
- };
245
- fromSdk: {
246
- type: BooleanConstructor;
247
- };
248
- }>> & {
249
- onSuccess?: ((...args: any[]) => any) | undefined;
250
- onClose?: ((...args: any[]) => any) | undefined;
251
- onFail?: ((...args: any[]) => any) | undefined;
252
- onEnd?: ((...args: any[]) => any) | undefined;
253
- "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
254
- }>>;
255
- emit: (event: "close" | "success" | "end" | "fail" | "update:loading", ...args: any[]) => void;
256
- close: () => void;
257
- toAnalyzing: () => Promise<void>;
258
- NIcon: any;
259
- NButton: any;
260
- NSpin: any;
261
- 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<{}>>, {}>;
262
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "end" | "fail" | "update:loading")[], "close" | "success" | "end" | "fail" | "update:loading", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
263
- content: {
264
- type: PropType<string | {
265
- data: string;
266
- }>;
267
- default: string;
268
- };
269
- showBtn: {
270
- type: BooleanConstructor;
271
- };
272
- token: {
273
- type: StringConstructor;
274
- };
275
- intentionCode: {
276
- type: StringConstructor;
277
- };
278
- configs: {
279
- type: PropType<AnyObject>;
280
- };
281
- loading: {
282
- type: BooleanConstructor;
283
- default: boolean;
284
- };
285
- fromSdk: {
286
- type: BooleanConstructor;
287
- };
288
- }>> & {
289
- onSuccess?: ((...args: any[]) => any) | undefined;
290
- onClose?: ((...args: any[]) => any) | undefined;
291
- onFail?: ((...args: any[]) => any) | undefined;
292
- onEnd?: ((...args: any[]) => any) | undefined;
293
- "onUpdate:loading"?: ((...args: any[]) => any) | undefined;
294
- }, {
295
- content: string | {
296
- data: string;
297
- };
298
- loading: boolean;
299
- showBtn: boolean;
300
- fromSdk: boolean;
301
- }>;
302
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
303
- content: {
304
- type: StringConstructor;
305
- default: string;
306
- };
307
- }>>, {
308
- content: string;
309
- }>;
310
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "fail")[], "close" | "success" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
330
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "fail" | "recordingHeightChange")[], "close" | "success" | "fail" | "recordingHeightChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
311
331
  timed: {
312
332
  type: NumberConstructor;
313
333
  default: number;
@@ -328,13 +348,19 @@ declare const _default: import("vue").DefineComponent<{
328
348
  configs: {
329
349
  type: PropType<AnyObject>;
330
350
  };
351
+ useSource: {
352
+ type: StringConstructor;
353
+ default: string;
354
+ };
331
355
  }>> & {
332
356
  onSuccess?: ((...args: any[]) => any) | undefined;
333
357
  onClose?: ((...args: any[]) => any) | undefined;
334
358
  onFail?: ((...args: any[]) => any) | undefined;
359
+ onRecordingHeightChange?: ((...args: any[]) => any) | undefined;
335
360
  }, {
336
361
  timed: number;
337
362
  realTimeRecognition: boolean;
338
363
  allowPunctuationMark: boolean;
364
+ useSource: string;
339
365
  }>;
340
366
  export default _default;
@@ -1,10 +1,11 @@
1
- import { defineComponent, useAttrs, ref, computed, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeStyle, unref, Fragment, createBlock, mergeProps, createCommentVNode } from 'vue';
1
+ import { defineComponent, useAttrs, ref, computed, onBeforeUnmount, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, Fragment, createBlock, mergeProps, createCommentVNode } from 'vue';
2
+ import axios from 'axios';
3
+ import { isString, isObject } from 'lodash-es';
2
4
  import CRecording from './components/recording.vue.js';
3
- import RecordingModal$1 from './components/recording-modal.vue.js';
5
+ import AudioSDK from './audioSDK.js';
4
6
  import { useTheme } from '../../../shared/hooks/useTheme.js';
5
7
  import '@vueuse/core';
6
8
  import 'date-fns';
7
- import 'lodash-es';
8
9
  import '@vue/shared';
9
10
  import '../../../shared/utils/index.js';
10
11
  import '@vueuse/shared';
@@ -12,7 +13,6 @@ import '../../../shared/hooks/selectHooks/useSearchContent.js';
12
13
  import '@vicons/ionicons5';
13
14
  import 'naive-ui';
14
15
  import '../../../shared/hooks/useScrollLoading.js';
15
- import AudioSDK from './audioSDK.js';
16
16
 
17
17
  var _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  __name: "Index",
@@ -36,86 +36,164 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  },
37
37
  configs: {
38
38
  type: Object
39
+ },
40
+ useSource: {
41
+ type: String,
42
+ default: ""
39
43
  }
40
44
  },
41
- emits: ["close", "success", "fail"],
45
+ emits: ["close", "success", "fail", "recordingHeightChange"],
42
46
  setup(__props, {
43
47
  expose,
44
48
  emit
45
49
  }) {
46
50
  const props = __props;
51
+ const consultationRecordUrl = "/flow/openApi/consultationRecord";
47
52
  const cssVars = useTheme();
48
53
  const audioSdk = AudioSDK.create();
49
54
  const attrs = useAttrs();
55
+ const default_height = 284;
50
56
  const recordingRef = ref();
51
57
  const isRecording = ref(false);
52
- const loading = ref(true);
58
+ const loading = ref(false);
53
59
  const content = computed(() => {
54
60
  return audioSdk.contentRef.value;
55
61
  });
62
+ const wsConnected = computed(() => audioSdk.wsConnected.value);
63
+ const recorderStatus = computed(() => audioSdk.recorderStatus.value);
56
64
  const recordingProps = computed(() => {
57
65
  return {
58
66
  token: props.token,
59
67
  configs: props.configs || {},
60
68
  content: content.value,
61
- intentionCode: props.intentionCode || ""
69
+ intentionCode: props.intentionCode || "",
70
+ show: isRecording.value,
71
+ wsConnected: wsConnected.value,
72
+ recorderStatus: recorderStatus.value,
73
+ startWaveViewMethod
62
74
  };
63
75
  });
64
76
  const isGenerateMedicalRecord = computed(() => !!props.configs);
65
- function onClose() {
66
- audioSdk.stop();
67
- isRecording.value = false;
68
- emit("close");
69
- }
70
- function onEnd() {
71
- audioSdk.stop();
77
+ const handleHeightChange = (height) => {
78
+ emit("recordingHeightChange", height);
79
+ };
80
+ async function onClose(obj = {}) {
81
+ var _a;
82
+ try {
83
+ loading.value = true;
84
+ await ((_a = audioSdk == null ? void 0 : audioSdk.stop) == null ? void 0 : _a.call(audioSdk, obj));
85
+ isRecording.value = false;
86
+ loading.value = false;
87
+ emit("close");
88
+ } catch (error) {
89
+ loading.value = false;
90
+ }
91
+ handleHeightChange(default_height);
72
92
  }
73
93
  function onSuccess(data) {
74
94
  isRecording.value = false;
75
95
  emit("success", data);
96
+ handleHeightChange(default_height);
76
97
  }
77
- watch(() => audioSdk.wsConnected.value, (newVal) => {
78
- if (newVal) {
98
+ function onFail(error) {
99
+ isRecording.value = false;
100
+ emit("fail", error);
101
+ handleHeightChange(default_height);
102
+ }
103
+ function startWaveViewMethod(options) {
104
+ var _a;
105
+ (_a = audioSdk == null ? void 0 : audioSdk.startWaveView) == null ? void 0 : _a.call(audioSdk, {
106
+ waveSelector: options.waveSelector,
107
+ waveProps: options.waveProps || {}
108
+ });
109
+ }
110
+ const onPause = () => {
111
+ var _a;
112
+ (_a = audioSdk == null ? void 0 : audioSdk.pause) == null ? void 0 : _a.call(audioSdk);
113
+ };
114
+ const onResume = () => {
115
+ var _a;
116
+ (_a = audioSdk == null ? void 0 : audioSdk.resume) == null ? void 0 : _a.call(audioSdk);
117
+ };
118
+ const handleToAnalyzing = async (obj = {}) => {
119
+ var _a, _b;
120
+ loading.value = true;
121
+ try {
122
+ await ((_a = audioSdk == null ? void 0 : audioSdk.stop) == null ? void 0 : _a.call(audioSdk, obj));
123
+ const audioText = isString(content.value) ? content.value : isObject(content.value) ? (_b = content.value) == null ? void 0 : _b.data : "";
124
+ if (!audioText)
125
+ return;
126
+ const {
127
+ data
128
+ } = await axios.post(consultationRecordUrl, {
129
+ taskId: 1,
130
+ audioText,
131
+ intentionCode: props.intentionCode,
132
+ configs: props.configs || {}
133
+ }, {
134
+ headers: {
135
+ Authorization: `bearer ${props.token}`
136
+ }
137
+ });
138
+ if (!(data == null ? void 0 : data.success)) {
139
+ onFail({
140
+ result: "fail",
141
+ msg: data.msg
142
+ });
143
+ return;
144
+ }
145
+ const json = (data == null ? void 0 : data.data) || {};
146
+ onSuccess(json);
147
+ } catch (error) {
148
+ onFail(error);
149
+ } finally {
79
150
  loading.value = false;
151
+ isRecording.value = false;
80
152
  }
81
- });
82
- onBeforeUnmount(() => {
83
- AudioSDK.destroy();
84
- });
85
- expose({
86
- createMedicalRecord: async () => {
87
- var _a;
88
- isRecording.value = true;
89
- try {
90
- const res = await audioSdk.start({
91
- ...props,
92
- ...attrs
93
- });
94
- const data = res == null ? void 0 : res.data;
95
- if (!isGenerateMedicalRecord.value) {
96
- emit("success", data);
97
- isRecording.value = false;
98
- return;
99
- }
100
- if (isGenerateMedicalRecord.value && (res == null ? void 0 : res.timeout)) {
101
- if (!content.value) {
102
- isRecording.value = false;
103
- emit("close");
104
- return;
105
- }
106
- (_a = recordingRef.value) == null ? void 0 : _a.toAnalyzing();
153
+ };
154
+ const createMedicalRecord = async () => {
155
+ isRecording.value = true;
156
+ try {
157
+ const res = await audioSdk.start({
158
+ ...props,
159
+ ...attrs
160
+ });
161
+ const {
162
+ result,
163
+ data
164
+ } = res || {};
165
+ if (result !== "success") {
166
+ onFail(res);
167
+ return;
168
+ }
169
+ if (!isGenerateMedicalRecord.value) {
170
+ onSuccess(data);
171
+ return;
172
+ }
173
+ if (isGenerateMedicalRecord.value && (res == null ? void 0 : res.timeout)) {
174
+ if (!content.value) {
175
+ onClose();
107
176
  return;
108
177
  }
109
- } catch (error) {
110
- isRecording.value = false;
111
- emit("fail", error);
178
+ handleToAnalyzing({
179
+ isEndSet: true
180
+ });
181
+ return;
112
182
  }
183
+ } catch (error) {
184
+ onFail(error);
113
185
  }
186
+ };
187
+ onBeforeUnmount(() => {
188
+ AudioSDK.destroy();
189
+ });
190
+ expose({
191
+ createMedicalRecord
114
192
  });
115
193
  return (_ctx, _cache) => {
116
194
  return openBlock(), createElementBlock("div", {
117
195
  style: normalizeStyle(unref(cssVars)),
118
- class: "c-recording-sdk-wrapper"
196
+ class: normalizeClass(["c-recording-sdk-wrapper", ["c-recording-sdk-wrapper-" + props.useSource]])
119
197
  }, [unref(isGenerateMedicalRecord) ? (openBlock(), createElementBlock(Fragment, {
120
198
  key: 0
121
199
  }, [isRecording.value ? (openBlock(), createBlock(CRecording, mergeProps({
@@ -126,14 +204,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
126
204
  loading: loading.value,
127
205
  "onUpdate:loading": _cache[0] || (_cache[0] = ($event) => loading.value = $event)
128
206
  }, unref(recordingProps), {
207
+ onFail,
208
+ onSuccess,
129
209
  onClose,
130
- onEnd,
131
- onFail: _cache[1] || (_cache[1] = (error) => emit("fail", error)),
132
- onSuccess
133
- }), null, 16, ["loading"])) : createCommentVNode("v-if", true), createCommentVNode(' <c-form\n v-if="isForm"\n :configs="configsAndBasicData.configs"\n :data="jsonData"\n @close="onFormClose"\n @finish="onFinish"\n /> ')], 64)) : (openBlock(), createBlock(RecordingModal$1, {
134
- key: 1,
135
- content: unref(content)
136
- }, null, 8, ["content"]))], 4);
210
+ onPause,
211
+ onResume,
212
+ onToAnalyzing: handleToAnalyzing,
213
+ onHeightChange: handleHeightChange
214
+ }), null, 16, ["loading"])) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true)], 6);
137
215
  };
138
216
  }
139
217
  });