cnhis-design-vue 3.3.2-beta.17 → 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.
- package/README.md +87 -87
- package/es/components/audio-sdk/index.d.ts +172 -146
- package/es/components/audio-sdk/src/Index.vue.d.ts +173 -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 +124 -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 +137 -10
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +138 -11
- package/es/components/audio-sdk/src/components/recording.vue2.js +317 -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/button-print/index.d.ts +11 -4
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +11 -4
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -2
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +6 -2
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +7 -2
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +12 -2
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +4 -2
- package/es/components/button-print/src/components/Preview.vue.d.ts +5 -2
- package/es/components/button-print/src/components/Preview.vue2.js +6 -2
- package/es/components/button-print/src/utils/dialog.js +2 -2
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +2 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +4 -3
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- 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
@@ -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,15 @@ 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,
|
160
|
+
recorderClosing: this.recorderClosing
|
145
161
|
}
|
146
162
|
});
|
147
163
|
}
|
@@ -223,20 +239,38 @@ const _AudioSDK = class {
|
|
223
239
|
reader.readAsDataURL(blob);
|
224
240
|
}
|
225
241
|
async stop(params = {}) {
|
226
|
-
|
242
|
+
var _a, _b;
|
243
|
+
if (this.recorderClosing.value)
|
244
|
+
return;
|
245
|
+
this.recorderClosing.value = true;
|
246
|
+
(_b = (_a = this.recordingModal) == null ? void 0 : _a.setLoading) == null ? void 0 : _b.call(_a);
|
227
247
|
clearTimeout(this.timer);
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
this.
|
234
|
-
|
235
|
-
|
236
|
-
|
248
|
+
!params.isErrorSet && (this.recorderStatus.value = "stop");
|
249
|
+
try {
|
250
|
+
if (this.options.type === "http") {
|
251
|
+
await this.processHttpRecording();
|
252
|
+
} else {
|
253
|
+
this.sendBufferedData(true);
|
254
|
+
await new Promise((resolve) => {
|
255
|
+
this.messageResolver = resolve;
|
256
|
+
this.lastChunkTimer = setTimeout(resolve, this.options.lastChunkTimeout);
|
257
|
+
});
|
258
|
+
this.messageResolver = null;
|
259
|
+
}
|
260
|
+
await this.cleanupResources();
|
261
|
+
this.cleanupWebSocket();
|
262
|
+
if (params.isEndSet && !this.contentRef.value) {
|
263
|
+
this.handleError("\u5F55\u97F3\u5185\u5BB9\u4E3A\u7A7A", false, "warning", "stop");
|
264
|
+
this.recorderClosing.value = false;
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
this.resolvePendingRequest(params);
|
268
|
+
this.recordingModal.hide();
|
269
|
+
this.recorderClosing.value = false;
|
270
|
+
} catch (err) {
|
271
|
+
console.log(err);
|
272
|
+
this.recorderClosing.value = false;
|
237
273
|
}
|
238
|
-
this.resolvePendingRequest(params);
|
239
|
-
this.cleanupResources();
|
240
274
|
}
|
241
275
|
resolvePendingRequest(params) {
|
242
276
|
const handler = this.messageQueue.shift();
|
@@ -244,7 +278,7 @@ const _AudioSDK = class {
|
|
244
278
|
return;
|
245
279
|
const result = {
|
246
280
|
result: "success",
|
247
|
-
data: this.contentRef.value,
|
281
|
+
data: params.isCloseSet ? "" : this.contentRef.value,
|
248
282
|
timeout: params.timeout
|
249
283
|
};
|
250
284
|
handler.resolve(result);
|
@@ -303,11 +337,23 @@ const _AudioSDK = class {
|
|
303
337
|
}
|
304
338
|
handleMessage(event) {
|
305
339
|
const {
|
306
|
-
data
|
307
|
-
|
340
|
+
data: {
|
341
|
+
data,
|
342
|
+
isLast
|
343
|
+
} = {
|
344
|
+
data: "",
|
345
|
+
isLast: false
|
346
|
+
},
|
347
|
+
success,
|
348
|
+
msg
|
308
349
|
} = this.parseMessageData(event.data) || {};
|
350
|
+
if (!success) {
|
351
|
+
this.handleError(msg || "\u670D\u52A1\u5F02\u5E38");
|
352
|
+
return;
|
353
|
+
}
|
309
354
|
if (data) {
|
310
|
-
|
355
|
+
const _data = this.pauseContent + data;
|
356
|
+
this.contentRef.value = this.options.allowPunctuationMark ? _data : _data.replace(/[??,。,.\s]/g, "");
|
311
357
|
}
|
312
358
|
isLast && this.handleLastChunk();
|
313
359
|
}
|
@@ -323,23 +369,23 @@ const _AudioSDK = class {
|
|
323
369
|
}
|
324
370
|
parseMessageData(data) {
|
325
371
|
if (!isString(data))
|
326
|
-
return
|
372
|
+
return {
|
373
|
+
success: true
|
374
|
+
};
|
327
375
|
try {
|
328
|
-
const res = JSON.parse(data)
|
376
|
+
const res = JSON.parse(data);
|
329
377
|
if (!isObject(res))
|
330
378
|
return {
|
331
|
-
|
332
|
-
isLast: false
|
379
|
+
success: true
|
333
380
|
};
|
334
381
|
return res;
|
335
382
|
} catch (e) {
|
336
383
|
return {
|
337
|
-
|
338
|
-
isLast: false
|
384
|
+
success: true
|
339
385
|
};
|
340
386
|
}
|
341
387
|
}
|
342
|
-
handleError(msg, isUserNotAllow = false) {
|
388
|
+
async handleError(msg, isUserNotAllow = false, messageType = "error", errorType) {
|
343
389
|
const handler = this.messageQueue.shift();
|
344
390
|
if (!handler)
|
345
391
|
return;
|
@@ -348,25 +394,31 @@ const _AudioSDK = class {
|
|
348
394
|
msg,
|
349
395
|
isUserNotAllow
|
350
396
|
};
|
351
|
-
|
352
|
-
this.
|
397
|
+
this.recorderStatus.value = "fail";
|
398
|
+
errorType != "stop" && await this.stop({
|
399
|
+
isErrorSet: true
|
400
|
+
});
|
353
401
|
if (isUserNotAllow) {
|
354
402
|
$message.warning("\u8BF7\u5F00\u542F\u9EA6\u514B\u98CE\u6743\u9650");
|
403
|
+
} else if (msg) {
|
404
|
+
$message[messageType](msg);
|
355
405
|
}
|
406
|
+
handler.reject(error);
|
356
407
|
}
|
357
408
|
cleanupWebSocket() {
|
358
|
-
var _a;
|
359
|
-
(_a = this.webSocket) == null ? void 0 : _a.close();
|
409
|
+
var _a, _b;
|
410
|
+
(_b = (_a = this.webSocket) == null ? void 0 : _a.close) == null ? void 0 : _b.call(_a);
|
360
411
|
this.webSocket = null;
|
361
|
-
this.connectionState =
|
412
|
+
this.connectionState = AudioTypes.ConnectionState.DISCONNECTED;
|
362
413
|
}
|
363
|
-
cleanupResources() {
|
364
|
-
var _a;
|
365
|
-
(_a = this.recorder) == null ? void 0 : _a.close();
|
414
|
+
async cleanupResources() {
|
415
|
+
var _a, _b;
|
416
|
+
await ((_b = (_a = this.recorder) == null ? void 0 : _a.close) == null ? void 0 : _b.call(_a));
|
366
417
|
this.sendBuffer = [];
|
367
418
|
this.startTimestamp = 0;
|
368
419
|
}
|
369
420
|
resetState() {
|
421
|
+
this.recorderStatus.value = "";
|
370
422
|
this.cleanupResources();
|
371
423
|
clearTimeout(this.timer);
|
372
424
|
}
|
@@ -377,13 +429,43 @@ const _AudioSDK = class {
|
|
377
429
|
}
|
378
430
|
return true;
|
379
431
|
}
|
380
|
-
|
381
|
-
|
382
|
-
|
432
|
+
cleanupWaveView() {
|
433
|
+
if (!this.waveView)
|
434
|
+
return;
|
435
|
+
this.waveView.elem = null;
|
436
|
+
this.waveView.canvas = null;
|
437
|
+
this.waveView = null;
|
438
|
+
}
|
439
|
+
async startWaveView(options) {
|
440
|
+
var _a, _b, _c, _d;
|
441
|
+
this.cleanupWaveView();
|
442
|
+
await promiseTimeout(50);
|
443
|
+
this.waveView = (_d = (_c = (_b = Recorder).FrequencyHistogramView) == null ? void 0 : _c.call(_b, {
|
444
|
+
elem: (_a = options == null ? void 0 : options.waveSelector) == null ? void 0 : _a.call(options),
|
445
|
+
scale: 1,
|
446
|
+
fps: 15,
|
447
|
+
widthRatio: 0.5,
|
448
|
+
lineCount: 30,
|
449
|
+
minHeight: 2,
|
450
|
+
stripeEnable: false,
|
451
|
+
mirrorEnable: false,
|
452
|
+
linear: [0, "rgba(94, 92, 255, 0.9)", 1, "rgba(95, 88, 224)"],
|
453
|
+
position: 0,
|
454
|
+
...options == null ? void 0 : options.waveProps
|
455
|
+
})) != null ? _d : null;
|
456
|
+
}
|
457
|
+
async pause() {
|
458
|
+
var _a, _b;
|
459
|
+
this.cleanupWebSocket();
|
460
|
+
this.pauseContent = this.contentRef.value;
|
461
|
+
(_b = (_a = this.recorder) == null ? void 0 : _a.pause) == null ? void 0 : _b.call(_a);
|
462
|
+
this.recorderStatus.value = "pause";
|
383
463
|
}
|
384
|
-
resume() {
|
464
|
+
async resume() {
|
385
465
|
var _a;
|
466
|
+
await this.setupWebSocket();
|
386
467
|
(_a = this.recorder) == null ? void 0 : _a.resume();
|
468
|
+
this.recorderStatus.value = "recording";
|
387
469
|
}
|
388
470
|
destroy() {
|
389
471
|
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 };
|