cnhis-design-vue 3.3.2-beta.18 → 3.3.2-beta.22
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 +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/button-print/index.d.ts +8 -4
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -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 +4 -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 +3 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +2 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
- package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +17 -3
- 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,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 };
|