cnhis-design-vue 3.3.1-beta.1 → 3.3.1-beta.10
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/ai-chat/index.d.ts +1 -7
- package/es/components/ai-chat/src/Index.vue.d.ts +1 -7
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -7
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/index.d.ts +304 -2
- package/es/components/audio-sdk/index.js +1 -1
- package/es/components/audio-sdk/src/Index.vue.d.ts +304 -0
- package/es/components/audio-sdk/src/Index.vue.js +1 -0
- package/es/components/audio-sdk/src/Index.vue2.js +1 -0
- package/es/components/audio-sdk/src/audioSDK.d.ts +6 -10
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
- package/es/components/audio-sdk/src/components/form.vue.js +1 -0
- package/es/components/audio-sdk/src/components/form.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +91 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +43 -4
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/index.d.ts +4 -0
- package/es/components/audio-sdk/src/utils/index.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -3
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +5 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +12 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +12 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/scale-view/index.d.ts +3 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -2
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
- package/es/shared/components/ArrowIcon/index.d.ts +2 -0
- package/es/shared/components/ArrowIcon/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -0,0 +1,304 @@
|
|
1
|
+
import { type PropType } from 'vue';
|
2
|
+
import { AnyObject } from '../../../shared/types';
|
3
|
+
import AudioSDK from './audioSDK';
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
5
|
+
timed: {
|
6
|
+
type: NumberConstructor;
|
7
|
+
default: number;
|
8
|
+
};
|
9
|
+
realTimeRecognition: {
|
10
|
+
type: BooleanConstructor;
|
11
|
+
};
|
12
|
+
allowPunctuationMark: {
|
13
|
+
type: BooleanConstructor;
|
14
|
+
default: boolean;
|
15
|
+
};
|
16
|
+
isGenerateMedicalRecord: {
|
17
|
+
type: BooleanConstructor;
|
18
|
+
};
|
19
|
+
token: {
|
20
|
+
type: StringConstructor;
|
21
|
+
};
|
22
|
+
medicalTemplateInfo: {
|
23
|
+
type: PropType<Record<string, any>[]>;
|
24
|
+
};
|
25
|
+
}, {
|
26
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
27
|
+
audioSdk: AudioSDK;
|
28
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
29
|
+
timed: {
|
30
|
+
type: NumberConstructor;
|
31
|
+
default: number;
|
32
|
+
};
|
33
|
+
realTimeRecognition: {
|
34
|
+
type: BooleanConstructor;
|
35
|
+
};
|
36
|
+
allowPunctuationMark: {
|
37
|
+
type: BooleanConstructor;
|
38
|
+
default: boolean;
|
39
|
+
};
|
40
|
+
isGenerateMedicalRecord: {
|
41
|
+
type: BooleanConstructor;
|
42
|
+
};
|
43
|
+
token: {
|
44
|
+
type: StringConstructor;
|
45
|
+
};
|
46
|
+
medicalTemplateInfo: {
|
47
|
+
type: PropType<Record<string, any>[]>;
|
48
|
+
};
|
49
|
+
}>> & {
|
50
|
+
onSuccess?: ((...args: any[]) => any) | undefined;
|
51
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
52
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
53
|
+
}>>;
|
54
|
+
emit: (event: "close" | "success" | "fail", ...args: any[]) => void;
|
55
|
+
recordingRef: import("vue").Ref<any>;
|
56
|
+
jsonData: import("vue").Ref<{}>;
|
57
|
+
isRecording: import("vue").Ref<boolean>;
|
58
|
+
isForm: import("vue").Ref<boolean>;
|
59
|
+
configs: import("vue").ComputedRef<AnyObject>;
|
60
|
+
content: import("vue").ComputedRef<string>;
|
61
|
+
onClose: () => void;
|
62
|
+
onFormClose: () => void;
|
63
|
+
onEnd: () => void;
|
64
|
+
onEdit: (data: AnyObject) => void;
|
65
|
+
onFinish: (data: AnyObject) => void;
|
66
|
+
CRecording: import("vue").DefineComponent<{
|
67
|
+
content: {
|
68
|
+
type: StringConstructor;
|
69
|
+
default: string;
|
70
|
+
};
|
71
|
+
showBtn: {
|
72
|
+
type: BooleanConstructor;
|
73
|
+
};
|
74
|
+
token: {
|
75
|
+
type: StringConstructor;
|
76
|
+
};
|
77
|
+
configs: {
|
78
|
+
type: PropType<Record<string, string>>;
|
79
|
+
};
|
80
|
+
}, {
|
81
|
+
consultationRecordUrl: string;
|
82
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
83
|
+
content: {
|
84
|
+
type: StringConstructor;
|
85
|
+
default: string;
|
86
|
+
};
|
87
|
+
showBtn: {
|
88
|
+
type: BooleanConstructor;
|
89
|
+
};
|
90
|
+
token: {
|
91
|
+
type: StringConstructor;
|
92
|
+
};
|
93
|
+
configs: {
|
94
|
+
type: PropType<Record<string, string>>;
|
95
|
+
};
|
96
|
+
}>> & {
|
97
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
98
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
99
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
100
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
101
|
+
}>>;
|
102
|
+
emit: (event: "edit" | "close" | "end" | "fail", ...args: any[]) => void;
|
103
|
+
loading: import("vue").Ref<boolean>;
|
104
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
105
|
+
close: () => void;
|
106
|
+
toEdit: () => Promise<void>;
|
107
|
+
NIcon: any;
|
108
|
+
NButton: any;
|
109
|
+
NSpin: any;
|
110
|
+
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<{}>>, {}>;
|
111
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "close" | "end" | "fail")[], "edit" | "close" | "end" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
112
|
+
content: {
|
113
|
+
type: StringConstructor;
|
114
|
+
default: string;
|
115
|
+
};
|
116
|
+
showBtn: {
|
117
|
+
type: BooleanConstructor;
|
118
|
+
};
|
119
|
+
token: {
|
120
|
+
type: StringConstructor;
|
121
|
+
};
|
122
|
+
configs: {
|
123
|
+
type: PropType<Record<string, string>>;
|
124
|
+
};
|
125
|
+
}>> & {
|
126
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
127
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
128
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
129
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
130
|
+
}, {
|
131
|
+
content: string;
|
132
|
+
showBtn: boolean;
|
133
|
+
}>;
|
134
|
+
RecordingModal: import("vue").DefineComponent<{
|
135
|
+
content: {
|
136
|
+
type: StringConstructor;
|
137
|
+
default: string;
|
138
|
+
};
|
139
|
+
}, {
|
140
|
+
cssVars: import("vue").ComputedRef<AnyObject>;
|
141
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
142
|
+
content: {
|
143
|
+
type: StringConstructor;
|
144
|
+
default: string;
|
145
|
+
};
|
146
|
+
}>> & {}>>;
|
147
|
+
NModal: any;
|
148
|
+
Recording: import("vue").DefineComponent<{
|
149
|
+
content: {
|
150
|
+
type: StringConstructor;
|
151
|
+
default: string;
|
152
|
+
};
|
153
|
+
showBtn: {
|
154
|
+
type: BooleanConstructor;
|
155
|
+
};
|
156
|
+
token: {
|
157
|
+
type: StringConstructor;
|
158
|
+
};
|
159
|
+
configs: {
|
160
|
+
type: PropType<Record<string, string>>;
|
161
|
+
};
|
162
|
+
}, {
|
163
|
+
consultationRecordUrl: string;
|
164
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
165
|
+
content: {
|
166
|
+
type: StringConstructor;
|
167
|
+
default: string;
|
168
|
+
};
|
169
|
+
showBtn: {
|
170
|
+
type: BooleanConstructor;
|
171
|
+
};
|
172
|
+
token: {
|
173
|
+
type: StringConstructor;
|
174
|
+
};
|
175
|
+
configs: {
|
176
|
+
type: PropType<Record<string, string>>;
|
177
|
+
};
|
178
|
+
}>> & {
|
179
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
180
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
181
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
182
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
183
|
+
}>>;
|
184
|
+
emit: (event: "edit" | "close" | "end" | "fail", ...args: any[]) => void;
|
185
|
+
loading: import("vue").Ref<boolean>;
|
186
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
187
|
+
close: () => void;
|
188
|
+
toEdit: () => Promise<void>;
|
189
|
+
NIcon: any;
|
190
|
+
NButton: any;
|
191
|
+
NSpin: any;
|
192
|
+
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<{}>>, {}>;
|
193
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "close" | "end" | "fail")[], "edit" | "close" | "end" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
194
|
+
content: {
|
195
|
+
type: StringConstructor;
|
196
|
+
default: string;
|
197
|
+
};
|
198
|
+
showBtn: {
|
199
|
+
type: BooleanConstructor;
|
200
|
+
};
|
201
|
+
token: {
|
202
|
+
type: StringConstructor;
|
203
|
+
};
|
204
|
+
configs: {
|
205
|
+
type: PropType<Record<string, string>>;
|
206
|
+
};
|
207
|
+
}>> & {
|
208
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
209
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
210
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
211
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
212
|
+
}, {
|
213
|
+
content: string;
|
214
|
+
showBtn: boolean;
|
215
|
+
}>;
|
216
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
217
|
+
content: {
|
218
|
+
type: StringConstructor;
|
219
|
+
default: string;
|
220
|
+
};
|
221
|
+
}>>, {
|
222
|
+
content: string;
|
223
|
+
}>;
|
224
|
+
CForm: import("vue").DefineComponent<{
|
225
|
+
configs: {
|
226
|
+
type: PropType<Record<string, string>>;
|
227
|
+
};
|
228
|
+
data: {
|
229
|
+
type: PropType<Record<string, string>>;
|
230
|
+
};
|
231
|
+
}, {
|
232
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
233
|
+
configs: {
|
234
|
+
type: PropType<Record<string, string>>;
|
235
|
+
};
|
236
|
+
data: {
|
237
|
+
type: PropType<Record<string, string>>;
|
238
|
+
};
|
239
|
+
}>> & {
|
240
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
241
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
242
|
+
}>>;
|
243
|
+
emit: (event: "close" | "finish", ...args: any[]) => void;
|
244
|
+
dynamicForm: {
|
245
|
+
list: {
|
246
|
+
label: string;
|
247
|
+
key: string;
|
248
|
+
value: string;
|
249
|
+
}[];
|
250
|
+
};
|
251
|
+
initForm: () => void;
|
252
|
+
handleClear: () => void;
|
253
|
+
onFinish: () => void;
|
254
|
+
NForm: any;
|
255
|
+
NFormItem: any;
|
256
|
+
NSpace: any;
|
257
|
+
NButton: any;
|
258
|
+
NInput: any;
|
259
|
+
NScrollbar: any;
|
260
|
+
NIcon: any;
|
261
|
+
Close: 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" | "finish")[], "close" | "finish", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
263
|
+
configs: {
|
264
|
+
type: PropType<Record<string, string>>;
|
265
|
+
};
|
266
|
+
data: {
|
267
|
+
type: PropType<Record<string, string>>;
|
268
|
+
};
|
269
|
+
}>> & {
|
270
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
271
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
272
|
+
}, {}>;
|
273
|
+
}, 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<{
|
274
|
+
timed: {
|
275
|
+
type: NumberConstructor;
|
276
|
+
default: number;
|
277
|
+
};
|
278
|
+
realTimeRecognition: {
|
279
|
+
type: BooleanConstructor;
|
280
|
+
};
|
281
|
+
allowPunctuationMark: {
|
282
|
+
type: BooleanConstructor;
|
283
|
+
default: boolean;
|
284
|
+
};
|
285
|
+
isGenerateMedicalRecord: {
|
286
|
+
type: BooleanConstructor;
|
287
|
+
};
|
288
|
+
token: {
|
289
|
+
type: StringConstructor;
|
290
|
+
};
|
291
|
+
medicalTemplateInfo: {
|
292
|
+
type: PropType<Record<string, any>[]>;
|
293
|
+
};
|
294
|
+
}>> & {
|
295
|
+
onSuccess?: ((...args: any[]) => any) | undefined;
|
296
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
297
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
298
|
+
}, {
|
299
|
+
timed: number;
|
300
|
+
realTimeRecognition: boolean;
|
301
|
+
allowPunctuationMark: boolean;
|
302
|
+
isGenerateMedicalRecord: boolean;
|
303
|
+
}>;
|
304
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./Index.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","Index.vue"]]);export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,onBeforeUnmount as n,openBlock as i,createElementBlock as a,normalizeStyle as s,unref as r,Fragment as l,createBlock as c,createCommentVNode as u}from"vue";import d from"./components/recording.vue.js";import m from"./components/recording-modal.vue.js";import p from"./components/form.vue.js";import{useTheme as v}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import f from"./audioSDK.js";import{getConfigs as h,getMedicalTemplateInfo as k}from"./utils/index.js";var y=e({__name:"Index",props:{timed:{type:Number,default:5},realTimeRecognition:{type:Boolean},allowPunctuationMark:{type:Boolean,default:!0},isGenerateMedicalRecord:{type:Boolean},token:{type:String},medicalTemplateInfo:{type:Object}},emits:["close","success","fail"],setup(e,{expose:y,emit:g}){const j=e,R=v(),M=f.create(),x=o(),T=o({}),w=o(!1),G=o(!1),I=t((()=>h(j.medicalTemplateInfo||[]))),S=t((()=>M.contentRef.value));function b(){M.stop(),w.value=!1,G.value=!1,g("close")}function B(){G.value=!1,g("close")}function C(){M.stop()}function E(e){w.value=!1,G.value=!0,T.value=e}function _(e){const o=k(e,j.medicalTemplateInfo||[]);g("success",o)}return n((()=>{f.destroy()})),y({createMedicalRecord:async()=>{var e;G.value=!1,w.value=!0;try{const o=await M.start(j),t=null==o?void 0:o.data;if(!j.isGenerateMedicalRecord)return g("success",t),w.value=!1,void(G.value=!1);if(j.isGenerateMedicalRecord&&(null==o?void 0:o.timeout))return S.value?void(null==(e=x.value)||e.toEdit()):(w.value=!1,void g("close"))}catch(e){w.value=!1,g("fail",e)}}}),(o,t)=>(i(),a("div",{style:s(r(R)),class:"c-recording-sdk-wrapper"},[e.isGenerateMedicalRecord?(i(),a(l,{key:0},[w.value?(i(),c(d,{key:0,ref_key:"recordingRef",ref:x,token:e.token,configs:r(I),content:r(S),"show-btn":"",onClose:b,onEnd:C,onFail:t[0]||(t[0]=e=>g("fail",e)),onEdit:E},null,8,["token","configs","content"])):u("v-if",!0),G.value?(i(),c(p,{key:1,configs:r(I),data:T.value,onClose:B,onFinish:_},null,8,["configs","data"])):u("v-if",!0)],64)):(i(),c(m,{key:1,content:r(S)},null,8,["content"]))],4))}});export{y as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { AnyObject } from '../../../shared/types';
|
2
2
|
import 'recorder-core/src/engine/mp3';
|
3
3
|
import 'recorder-core/src/engine/mp3-engine';
|
4
4
|
export default class AudioSDK {
|
@@ -8,32 +8,28 @@ export default class AudioSDK {
|
|
8
8
|
private webSocket;
|
9
9
|
private messageHandlerQueue;
|
10
10
|
private recorder;
|
11
|
-
private contentRef;
|
12
11
|
private realTimeSendStartTime;
|
13
12
|
private realTimeSendBytesChunks;
|
14
13
|
private realTimeSendClearPrevBufferIdx;
|
15
14
|
private timer;
|
16
15
|
private option;
|
17
16
|
private hasEventListener;
|
17
|
+
contentRef: import("vue").Ref<string>;
|
18
18
|
isReady: boolean;
|
19
19
|
constructor();
|
20
20
|
static create(): AudioSDK;
|
21
21
|
private initRecorder;
|
22
22
|
private onProcess;
|
23
23
|
private takeoffEncodeChunk;
|
24
|
-
|
24
|
+
private toSend;
|
25
|
+
run(handle: {
|
25
26
|
resolve: Function;
|
26
27
|
reject: Function;
|
27
28
|
}): void;
|
28
|
-
start(
|
29
|
-
|
30
|
-
allowPunctuationMark?: boolean;
|
31
|
-
timed?: number;
|
32
|
-
}): Promise<unknown>;
|
33
|
-
stop(): void;
|
29
|
+
start(option?: AnyObject): Promise<unknown>;
|
30
|
+
stop(params?: AnyObject): void;
|
34
31
|
private handleError;
|
35
32
|
private handleMessage;
|
36
|
-
private handleKeydown;
|
37
33
|
private reset;
|
38
34
|
destroy(): void;
|
39
35
|
static destroy(): void;
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e}from"vue";import t from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{RecordingModal as s}from"./utils/recordingModal.js";const
|
1
|
+
import{ref as e}from"vue";import t from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{RecordingModal as s}from"./utils/recordingModal.js";import{isString as i}from"lodash-es";import{$message as n}from"./utils/index.js";const r=class{constructor(){if(this.recordingModal=new s,this.webSocket=null,this.messageHandlerQueue=[],this.recorder=null,this.realTimeSendStartTime=0,this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0,this.timer=null,this.option={},this.hasEventListener=!1,this.contentRef=e(""),this.isReady=!1,r.instance)return r.instance;r.instance=this}static create(){return new r}initRecorder(){this.recorder=t({type:"mp3",sampleRate:16e3,bitRate:16,...this.option.realTimeRecognition?{onProcess:this.onProcess.bind(this),takeoffEncodeChunk:this.takeoffEncodeChunk.bind(this)}:{}})}async onProcess(e,t,s,i,n){0===this.realTimeSendStartTime&&(this.realTimeSendStartTime=Date.now(),this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0);for(let t=this.realTimeSendClearPrevBufferIdx;t<n;t++)e[t]=null;this.realTimeSendClearPrevBufferIdx=n}async takeoffEncodeChunk(e){e&&this.realTimeSendBytesChunks.push(e);const t=Date.now();if(t-this.realTimeSendStartTime<r.sendInterval)return;this.realTimeSendStartTime=t;let s=0;for(let e=0;e<this.realTimeSendBytesChunks.length;e++)s+=this.realTimeSendBytesChunks[e].length;const i=new Uint8Array(s);for(let e=0,t=0;e<this.realTimeSendBytesChunks.length;e++){const s=this.realTimeSendBytesChunks[e];i.set(s,t),t+=s.length}if(this.realTimeSendBytesChunks=[],i.length>0){const e=new Blob([i],{type:"audio/mp3"});this.toSend(e)}}toSend(e){if((null==e?void 0:e.size)>0){const t=new FileReader;t.onloadend=()=>{var e,s;const i=null==(e=t.result)?void 0:e.toString().split(",")[1];i&&(null==(s=this.webSocket)||s.send(JSON.stringify({data:i})))},t.readAsDataURL(e)}}run(e){this.recorder||this.initRecorder(),this.messageHandlerQueue.push(e),this.option.timed&&(this.timer=setTimeout((()=>{this.stop({timeout:!0})}),1e3*this.option.timed)),this.recorder.open((()=>{this.recorder.start(),this.option.instance&&this.recordingModal.show({instance:this.option.instance,onClose:()=>this.stop(),props:{contentRef:this.contentRef}})}),((e,t)=>{t&&n.warning("请开启麦克风权限"),this.handleError({msg:e,isUserNotAllow:t})}))}start(e={}){return this.contentRef.value="",Object.assign(this.option,e),new Promise(((e,t)=>{if(!function(){var e;if((null==(e=null==navigator?void 0:navigator.userAgent)?void 0:e.includes("Chrome"))&&!(null==window?void 0:window.isSecureContext))return n.warning("当前使用的http协议默认不支持麦克风权限,需要用户开启浏览器麦克风权限"),!1;return!0}())return void t({result:"fail",msg:"当前环境不支持录音"});if(this.messageHandlerQueue.length>0)return void t({result:"fail",msg:"当前已存在正在录音的任务"});if(!this.webSocket)return this.webSocket=new WebSocket(this.option.origin||"/flow/ws/speech"),this.webSocket.onopen=()=>{this.isReady=!0,this.run({resolve:e,reject:t})},this.webSocket.onmessage=this.handleMessage.bind(this),void(this.webSocket.onerror=()=>console.log("WebSocket连接失败"));const s=this;!async function i(n=0){if(n>5)return t({result:"fail",msg:"WebSocket连接失败"});s.isReady?s.run({resolve:e,reject:t}):setTimeout((()=>{i(++n)}),100)}()}))}stop(e={}){var s;if(null==(s=this.recordingModal)||s.hide(),t.IsOpen())if(this.option.realTimeRecognition){const t=this.messageHandlerQueue.shift();if(!t)return;const{resolve:s,reject:i}=t;s({result:"success",data:this.contentRef.value,timeout:!!e.timeout}),this.reset()}else this.recorder.stop((async(e,t)=>{this.toSend(e)}),(e=>{this.handleError({msg:e})}),!0)}handleError(e){const t=this.messageHandlerQueue.shift();if(!t)return;const{resolve:s,reject:i}=t;i({result:"fail",...e}),this.reset()}handleMessage(e){const{data:t}=e||{};if(i(t))if(this.option.realTimeRecognition){const e=this.option.allowPunctuationMark?t:t.replace(/[??,。,.\s]/g,"");this.contentRef.value+=e}else{const e=this.messageHandlerQueue.shift();if(!e)return;const{resolve:s,reject:i}=e;s({result:"success",data:this.option.allowPunctuationMark?t:t.replace(/[??,。,.\s]/g,"")}),this.reset()}else this.handleError({msg:"接收到的数据不是一个有效字符串"})}reset(){var e;null==(e=this.recorder)||e.close(),this.realTimeSendStartTime=0,this.timer&&(clearTimeout(this.timer),this.timer=null),Object.assign(this.option,{realTimeRecognition:!1,allowPunctuationMark:!0,timed:5,isGenerateMedicalRecord:!1}),this.messageHandlerQueue=[]}destroy(){this.webSocket&&(this.webSocket.close(),this.webSocket=null,this.isReady=!1),this.hasEventListener=!1,this.reset(),this.recorder=null}static destroy(){r.instance&&(r.instance.destroy(),r.instance=null)}};let o=r;o.sendInterval=1800;export{o as default};
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
3
|
+
configs: {
|
4
|
+
type: PropType<Record<string, string>>;
|
5
|
+
};
|
6
|
+
data: {
|
7
|
+
type: PropType<Record<string, string>>;
|
8
|
+
};
|
9
|
+
}, {
|
10
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
11
|
+
configs: {
|
12
|
+
type: PropType<Record<string, string>>;
|
13
|
+
};
|
14
|
+
data: {
|
15
|
+
type: PropType<Record<string, string>>;
|
16
|
+
};
|
17
|
+
}>> & {
|
18
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
19
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
20
|
+
}>>;
|
21
|
+
emit: (event: "close" | "finish", ...args: any[]) => void;
|
22
|
+
dynamicForm: {
|
23
|
+
list: {
|
24
|
+
label: string;
|
25
|
+
key: string;
|
26
|
+
value: string;
|
27
|
+
}[];
|
28
|
+
};
|
29
|
+
initForm: () => void;
|
30
|
+
handleClear: () => void;
|
31
|
+
onFinish: () => void;
|
32
|
+
NForm: any;
|
33
|
+
NFormItem: any;
|
34
|
+
NSpace: any;
|
35
|
+
NButton: any;
|
36
|
+
NInput: any;
|
37
|
+
NScrollbar: any;
|
38
|
+
NIcon: any;
|
39
|
+
Close: 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<{}>>, {}>;
|
40
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "finish")[], "close" | "finish", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
41
|
+
configs: {
|
42
|
+
type: PropType<Record<string, string>>;
|
43
|
+
};
|
44
|
+
data: {
|
45
|
+
type: PropType<Record<string, string>>;
|
46
|
+
};
|
47
|
+
}>> & {
|
48
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
49
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
50
|
+
}, {}>;
|
51
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./form.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var o=e(r,[["__file","form.vue"]]);export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,reactive as t,openBlock as l,createElementBlock as a,Fragment as n,createVNode as o,unref as i,withCtx as u,renderList as r,createBlock as s,createTextVNode as c,createElementVNode as f}from"vue";import{NSpace as p,NButton as d,NIcon as m,NScrollbar as v,NForm as y,NFormItem as w,NInput as g}from"naive-ui";import{Close as h}from"@vicons/ionicons5";const _=f("h5",null,"病历转录结果",-1);var b=e({__name:"form",props:{configs:{type:Object},data:{type:Object}},emits:["finish","close"],setup(e,{emit:f}){const b=e,k=t({list:[]});function x(){k.list.forEach((e=>{e.value=""}))}function C(){const e=k.list.reduce(((e,t)=>(e[t.key]=t.value,e)),{});f("finish",e)}return function(){var e;for(const t in b.configs)k.list.push({label:b.configs[t],key:t,value:(null==(e=b.data)?void 0:e[t])||""})}(),(e,t)=>(l(),a(n,null,[o(i(p),{justify:"space-between",align:"center","wrap-item":!1,size:30,class:"title"},{default:u((()=>[_,o(i(d),{quaternary:"",onClick:t[0]||(t[0]=()=>f("close"))},{icon:u((()=>[o(i(m),{component:i(h)},null,8,["component"])])),_:1})])),_:1}),o(i(v),{style:{"max-height":"600px"}},{default:u((()=>[o(i(y),{ref:"formRef",model:k},{default:u((()=>[(l(!0),a(n,null,r(k.list,(e=>(l(),s(i(w),{key:e.key,label:e.label,path:e.key},{default:u((()=>{var t;return[o(i(g),{placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.383"))||"请输入",type:"textarea",value:e.value,"onUpdate:value":t=>e.value=t,clearable:"",autosize:{minRows:2,maxRows:5}},null,8,["value","onUpdate:value"])]})),_:2},1032,["label","path"])))),128))])),_:1},8,["model"])])),_:1}),o(i(p),{justify:"center","wrap-item":!1,size:30,style:{"margin-top":"15px"}},{default:u((()=>[o(i(d),{type:"primary",onClick:C},{default:u((()=>[c("导入病历")])),_:1}),o(i(d),{"attr-type":"button",onClick:x},{default:u((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1})])),_:1})],64))}});export{b as default};
|
@@ -0,0 +1,91 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
content: {
|
3
|
+
type: StringConstructor;
|
4
|
+
default: string;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
|
8
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
9
|
+
content: {
|
10
|
+
type: StringConstructor;
|
11
|
+
default: string;
|
12
|
+
};
|
13
|
+
}>> & {}>>;
|
14
|
+
NModal: any;
|
15
|
+
Recording: import("vue").DefineComponent<{
|
16
|
+
content: {
|
17
|
+
type: StringConstructor;
|
18
|
+
default: string;
|
19
|
+
};
|
20
|
+
showBtn: {
|
21
|
+
type: BooleanConstructor;
|
22
|
+
};
|
23
|
+
token: {
|
24
|
+
type: StringConstructor;
|
25
|
+
};
|
26
|
+
configs: {
|
27
|
+
type: import("vue").PropType<Record<string, string>>;
|
28
|
+
};
|
29
|
+
}, {
|
30
|
+
consultationRecordUrl: string;
|
31
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
32
|
+
content: {
|
33
|
+
type: StringConstructor;
|
34
|
+
default: string;
|
35
|
+
};
|
36
|
+
showBtn: {
|
37
|
+
type: BooleanConstructor;
|
38
|
+
};
|
39
|
+
token: {
|
40
|
+
type: StringConstructor;
|
41
|
+
};
|
42
|
+
configs: {
|
43
|
+
type: import("vue").PropType<Record<string, string>>;
|
44
|
+
};
|
45
|
+
}>> & {
|
46
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
47
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
48
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
49
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
50
|
+
}>>;
|
51
|
+
emit: (event: "edit" | "close" | "end" | "fail", ...args: any[]) => void;
|
52
|
+
loading: import("vue").Ref<boolean>;
|
53
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
54
|
+
close: () => void;
|
55
|
+
toEdit: () => Promise<void>;
|
56
|
+
NIcon: any;
|
57
|
+
NButton: any;
|
58
|
+
NSpin: any;
|
59
|
+
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<{}>>, {}>;
|
60
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "close" | "end" | "fail")[], "edit" | "close" | "end" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
61
|
+
content: {
|
62
|
+
type: StringConstructor;
|
63
|
+
default: string;
|
64
|
+
};
|
65
|
+
showBtn: {
|
66
|
+
type: BooleanConstructor;
|
67
|
+
};
|
68
|
+
token: {
|
69
|
+
type: StringConstructor;
|
70
|
+
};
|
71
|
+
configs: {
|
72
|
+
type: import("vue").PropType<Record<string, string>>;
|
73
|
+
};
|
74
|
+
}>> & {
|
75
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
76
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
77
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
78
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
79
|
+
}, {
|
80
|
+
content: string;
|
81
|
+
showBtn: boolean;
|
82
|
+
}>;
|
83
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
84
|
+
content: {
|
85
|
+
type: StringConstructor;
|
86
|
+
default: string;
|
87
|
+
};
|
88
|
+
}>>, {
|
89
|
+
content: string;
|
90
|
+
}>;
|
91
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./recording-modal.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var o=e(r,[["__file","recording-modal.vue"]]);export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,openBlock as o,createBlock as t,unref as s,normalizeStyle as r,withCtx as n,createVNode as i,mergeProps as a}from"vue";import{NModal as m}from"naive-ui";import{useTheme as p}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import u from"./recording.vue.js";var c=e({__name:"recording-modal",props:{content:{type:String,default:""}},setup(e){const c=p();return(p,d)=>(o(),t(s(m),{style:r(s(c)),"close-on-esc":!1,"mask-closable":!1},{default:n((()=>[i(u,a(p.$attrs,{content:e.content}),null,16,["content"])])),_:1},8,["style"]))}});export{c as default};
|
@@ -1,31 +1,70 @@
|
|
1
|
+
import { PropType } from 'vue';
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
2
3
|
content: {
|
3
4
|
type: StringConstructor;
|
4
5
|
default: string;
|
5
6
|
};
|
7
|
+
showBtn: {
|
8
|
+
type: BooleanConstructor;
|
9
|
+
};
|
10
|
+
token: {
|
11
|
+
type: StringConstructor;
|
12
|
+
};
|
13
|
+
configs: {
|
14
|
+
type: PropType<Record<string, string>>;
|
15
|
+
};
|
6
16
|
}, {
|
7
|
-
|
17
|
+
consultationRecordUrl: string;
|
8
18
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
9
19
|
content: {
|
10
20
|
type: StringConstructor;
|
11
21
|
default: string;
|
12
22
|
};
|
23
|
+
showBtn: {
|
24
|
+
type: BooleanConstructor;
|
25
|
+
};
|
26
|
+
token: {
|
27
|
+
type: StringConstructor;
|
28
|
+
};
|
29
|
+
configs: {
|
30
|
+
type: PropType<Record<string, string>>;
|
31
|
+
};
|
13
32
|
}>> & {
|
14
33
|
onClose?: ((...args: any[]) => any) | undefined;
|
34
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
35
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
36
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
15
37
|
}>>;
|
16
|
-
emit: (event: "close", ...args: any[]) => void;
|
38
|
+
emit: (event: "edit" | "close" | "end" | "fail", ...args: any[]) => void;
|
39
|
+
loading: import("vue").Ref<boolean>;
|
40
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
17
41
|
close: () => void;
|
18
|
-
|
42
|
+
toEdit: () => Promise<void>;
|
19
43
|
NIcon: any;
|
44
|
+
NButton: any;
|
45
|
+
NSpin: any;
|
20
46
|
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<{}>>, {}>;
|
21
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
47
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "close" | "end" | "fail")[], "edit" | "close" | "end" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
22
48
|
content: {
|
23
49
|
type: StringConstructor;
|
24
50
|
default: string;
|
25
51
|
};
|
52
|
+
showBtn: {
|
53
|
+
type: BooleanConstructor;
|
54
|
+
};
|
55
|
+
token: {
|
56
|
+
type: StringConstructor;
|
57
|
+
};
|
58
|
+
configs: {
|
59
|
+
type: PropType<Record<string, string>>;
|
60
|
+
};
|
26
61
|
}>> & {
|
27
62
|
onClose?: ((...args: any[]) => any) | undefined;
|
63
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
64
|
+
onFail?: ((...args: any[]) => any) | undefined;
|
65
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
28
66
|
}, {
|
29
67
|
content: string;
|
68
|
+
showBtn: boolean;
|
30
69
|
}>;
|
31
70
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as
|
1
|
+
import{createElementVNode as e,defineComponent as n,ref as o,onMounted as t,onBeforeUnmount as i,openBlock as a,createElementBlock as c,createBlock as l,unref as d,Fragment as r,toDisplayString as s,createVNode as p,withCtx as u,createTextVNode as f,createCommentVNode as m}from"vue";import{NSpin as v,NIcon as y,NButton as k}from"naive-ui";import{Mic as w}from"@vicons/ionicons5";import g from"axios";var b;const h={class:"c-recording-wrapper"},x={class:"content"},B=e("p",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.141"))||"按下空格键停止录音",-1),C={key:0,class:"btns"};var _=n({__name:"recording",props:{content:{type:String,default:""},showBtn:{type:Boolean},token:{type:String},configs:{type:Object}},emits:["close","edit","end","fail"],setup(n,{expose:b,emit:_}){const E=n,L=o(!1);function S(e){if(" "===e.key||"Space"===e.code){if(L.value)return;e.preventDefault(),z()}}function z(){_("close")}async function A(){_("end"),L.value=!0;try{const{data:e}=await g.post("/flow/openApi/consultationRecord",{taskId:1,audioText:E.content||"",medicalTemplateInfo:E.configs},{headers:{Authorization:`bearer ${E.token}`}});_("edit",(null==e?void 0:e.data)||{})}catch(e){_("fail",e)}finally{L.value=!1}}return t((()=>{document.addEventListener("keydown",S)})),i((()=>{document.removeEventListener("keydown",S)})),b({toEdit:A}),(o,t)=>(a(),c("div",h,[L.value?(a(),l(d(v),{key:0,description:"加载中..."})):(a(),c(r,{key:1},[e("p",x,s(n.content||"正在聆听..."),1),e("div",{class:"icon-box",onClick:z},[p(d(y),{size:"60",color:"#fff",component:d(w)},null,8,["component"])]),B,n.showBtn?(a(),c("div",C,[p(d(k),{type:"primary",onClick:A,disabled:!n.content},{default:u((()=>[f("结束录音")])),_:1},8,["disabled"]),p(d(k),{onClick:z},{default:u((()=>[f("取消录音")])),_:1})])):m("v-if",!0)],64))]))}});export{_ as default};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
export declare const $message: import("naive-ui").MessageApi;
|
3
|
+
export declare function getConfigs(medicalTemplateInfo: AnyObject[]): AnyObject;
|
4
|
+
export declare function getMedicalTemplateInfo(data: AnyObject, originList?: AnyObject[]): AnyObject[];
|
@@ -0,0 +1 @@
|
|
1
|
+
import{createDiscreteApi as e}from"naive-ui";const{message:n}=e(["message"]);function r(e){return e.reduce(((e,n)=>{var i;return(null==(i=n.children)?void 0:i.length)?Object.assign(e,r(n.children)):e[n.innerIdentifier||n.dataId]=n.elementName,e}),{})}function i(e,n=[]){const r=[];return n.forEach((n=>{var t;if(null==(t=n.children)?void 0:t.length){const t={...n,children:i(e,n.children)};r.push(t)}else r.push({...n,text:e[n.innerIdentifier||n.dataId]})})),r}export{n as $message,r as getConfigs,i as getMedicalTemplateInfo};
|