cnhis-design-vue 3.3.1-beta.13 → 3.3.1-beta.14
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/ai-chat/index.d.ts +145 -10
- package/es/components/ai-chat/src/Index.vue.d.ts +145 -10
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +6 -0
- package/es/components/ai-chat/src/api/index.js +1 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +44 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +55 -2
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMainInner.d.ts +2 -0
- package/es/components/ai-chat/src/components/ChatMainInner.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +55 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -0
- package/es/components/ai-chat/src/components/card/JsonCard.d.ts +25 -0
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -0
- package/es/components/ai-chat/src/components/card/SelectIcon.d.ts +14 -0
- package/es/components/ai-chat/src/components/card/SelectIcon.js +1 -0
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +6 -0
- package/es/components/ai-chat/src/hooks/useProgram.js +1 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +2 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -0
- package/es/components/ai-chat/src/utils/index.d.ts +1 -0
- package/es/components/ai-chat/src/utils/index.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/index.d.ts +2 -304
- package/es/components/audio-sdk/index.js +1 -1
- package/es/components/audio-sdk/src/audioSDK.d.ts +8 -5
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +4 -43
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +4 -7
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +1 -7
- package/es/components/card-render/src/components/index.d.ts +23 -23
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/editor/src/Editor.js +1 -1
- package/es/components/editor/style/index.css +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/field-editor/index.d.ts +1 -7
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +1 -7
- package/es/components/form-config/index.d.ts +3 -38
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -38
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -7
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -17
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1 -8
- package/es/components/form-render/index.d.ts +1 -7
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -7
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -7
- package/es/components/form-render/src/components/renderer/date.d.ts +0 -2
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +0 -2
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/input.d.ts +0 -5
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -14
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -14
- package/es/components/form-render/src/components/renderer/select.d.ts +0 -5
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +1 -12
- 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/hooks/useFieldNormalize.d.ts +0 -4
- package/es/components/form-render/src/types/fieldItem.d.ts +0 -1
- package/es/components/form-render/src/types/index.d.ts +0 -2
- package/es/components/form-render/src/utils/index.d.ts +0 -1
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-chat/index.d.ts +0 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-table/index.d.ts +23 -26
- package/es/components/iho-table/index.js +1 -1
- 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/hooks/useTablePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.d.ts +0 -78
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +0 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.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/index.d.ts +0 -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 +1 -2
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +2 -24
- package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -24
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +0 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +0 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -9
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -7
- package/es/components/scale-view/index.d.ts +2 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +2 -3
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.d.ts +1 -3
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +2189 -1
- package/es/components/shortcut-setter/index.d.ts +1 -8
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -8
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/file-emr.png.js +1 -0
- package/es/shared/assets/img/file.png.js +1 -0
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/use.png.js +1 -0
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/audio-sdk/src/Index.vue.d.ts +0 -304
- package/es/components/audio-sdk/src/Index.vue.js +0 -1
- package/es/components/audio-sdk/src/Index.vue2.js +0 -1
- package/es/components/audio-sdk/src/components/form.vue.d.ts +0 -51
- package/es/components/audio-sdk/src/components/form.vue.js +0 -1
- package/es/components/audio-sdk/src/components/form.vue2.js +0 -1
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +0 -91
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +0 -1
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +0 -1
- package/es/components/audio-sdk/src/utils/index.d.ts +0 -4
- package/es/components/audio-sdk/src/utils/index.js +0 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +0 -1
- package/es/shared/components/ArrowIcon/index.d.ts +0 -2
- package/es/shared/components/ArrowIcon/index.js +0 -1
- package/es/shared/components/DateIcon/DateIcon.vue.js +0 -1
- package/es/shared/components/DateIcon/index.d.ts +0 -2
- package/es/shared/components/DateIcon/index.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -17,17 +17,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
17
17
|
};
|
18
18
|
queryData: {
|
19
19
|
type: PropType<QueryData>;
|
20
|
-
reuired: boolean;
|
21
20
|
};
|
22
21
|
queryRecord: {
|
23
22
|
type: PropType<QueryRecord>;
|
24
|
-
reuired: boolean;
|
25
23
|
};
|
26
24
|
hideInput: {
|
27
25
|
type: BooleanConstructor;
|
28
26
|
};
|
29
27
|
uiStyle: {
|
30
28
|
type: StringConstructor;
|
29
|
+
default: string;
|
31
30
|
};
|
32
31
|
audioTimed: {
|
33
32
|
type: NumberConstructor;
|
@@ -51,6 +50,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
51
50
|
appId: {
|
52
51
|
type: StringConstructor;
|
53
52
|
};
|
53
|
+
orgId: {
|
54
|
+
type: StringConstructor;
|
55
|
+
};
|
56
|
+
userId: {
|
57
|
+
type: StringConstructor;
|
58
|
+
};
|
59
|
+
immediatelyRecording: {
|
60
|
+
type: BooleanConstructor;
|
61
|
+
default: boolean;
|
62
|
+
};
|
54
63
|
}, {
|
55
64
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
56
65
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -69,17 +78,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
69
78
|
};
|
70
79
|
queryData: {
|
71
80
|
type: PropType<QueryData>;
|
72
|
-
reuired: boolean;
|
73
81
|
};
|
74
82
|
queryRecord: {
|
75
83
|
type: PropType<QueryRecord>;
|
76
|
-
reuired: boolean;
|
77
84
|
};
|
78
85
|
hideInput: {
|
79
86
|
type: BooleanConstructor;
|
80
87
|
};
|
81
88
|
uiStyle: {
|
82
89
|
type: StringConstructor;
|
90
|
+
default: string;
|
83
91
|
};
|
84
92
|
audioTimed: {
|
85
93
|
type: NumberConstructor;
|
@@ -103,15 +111,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
103
111
|
appId: {
|
104
112
|
type: StringConstructor;
|
105
113
|
};
|
114
|
+
orgId: {
|
115
|
+
type: StringConstructor;
|
116
|
+
};
|
117
|
+
userId: {
|
118
|
+
type: StringConstructor;
|
119
|
+
};
|
120
|
+
immediatelyRecording: {
|
121
|
+
type: BooleanConstructor;
|
122
|
+
default: boolean;
|
123
|
+
};
|
106
124
|
}>> & {
|
107
125
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
108
126
|
}>>;
|
109
|
-
axiosInstance: import("axios").AxiosInstance;
|
110
127
|
emit: (event: "button-click", ...args: any[]) => void;
|
128
|
+
showSmallStyle: import("vue").ComputedRef<boolean>;
|
111
129
|
state: AnyObject;
|
112
|
-
NMessageProvider: any;
|
113
130
|
ChatMain: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
114
131
|
ChatFooter: import("vue").DefineComponent<{}, {
|
132
|
+
innerDefaultShortcutList: {
|
133
|
+
key: string;
|
134
|
+
value: string;
|
135
|
+
}[];
|
136
|
+
programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
|
137
|
+
MedicalOrderId: string;
|
115
138
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
116
139
|
audioSdk: import("../..").CAudioSDK;
|
117
140
|
emit: (event: string, ...args: any[]) => void;
|
@@ -120,6 +143,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
120
143
|
isSmall: any;
|
121
144
|
audioTimed: any;
|
122
145
|
commandList: any;
|
146
|
+
isInner: any;
|
147
|
+
patientInfo: any;
|
123
148
|
inputRef: import("vue").Ref<any>;
|
124
149
|
showPopover: import("vue").Ref<boolean>;
|
125
150
|
breadcrumb: import("vue").Ref<{
|
@@ -139,13 +164,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
139
164
|
showPrompt: import("vue").Ref<boolean>;
|
140
165
|
currentShortcutId: import("vue").Ref<string>;
|
141
166
|
showPatient: import("vue").Ref<boolean>;
|
142
|
-
|
167
|
+
showAudio: import("vue").Ref<boolean>;
|
168
|
+
placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
|
143
169
|
btnDisabled: import("vue").ComputedRef<any>;
|
144
170
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
145
171
|
patient: import("vue").ComputedRef<string>;
|
172
|
+
currentShortcutList: import("vue").ComputedRef<any>;
|
173
|
+
isAllDisabled: import("vue").ComputedRef<any>;
|
146
174
|
recorderStart: () => Promise<void>;
|
147
175
|
getShortcutName: (item: string | AnyObject) => any;
|
148
|
-
handleShortcut: (item: string | AnyObject) => void
|
176
|
+
handleShortcut: (item: string | AnyObject) => Promise<void>;
|
149
177
|
resetCurrentCommand: () => void;
|
150
178
|
handleKeyDown: (event: KeyboardEvent) => void;
|
151
179
|
isWrap: (event: KeyboardEvent) => boolean;
|
@@ -265,6 +293,102 @@ declare const _default: import("vue").DefineComponent<{
|
|
265
293
|
}, {
|
266
294
|
show: boolean;
|
267
295
|
}>;
|
296
|
+
ChatAudio: import("vue").DefineComponent<{
|
297
|
+
show: {
|
298
|
+
type: BooleanConstructor;
|
299
|
+
};
|
300
|
+
}, {
|
301
|
+
audioSdk: import("../..").CAudioSDK;
|
302
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
303
|
+
show: {
|
304
|
+
type: BooleanConstructor;
|
305
|
+
};
|
306
|
+
}>> & {
|
307
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
308
|
+
}>>;
|
309
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
310
|
+
state: any;
|
311
|
+
vaa07: any;
|
312
|
+
immediatelyRecording: any;
|
313
|
+
time: import("vue").Ref<number>;
|
314
|
+
endType: string;
|
315
|
+
pause: import("@vueuse/shared").Fn;
|
316
|
+
resume: import("@vueuse/shared").Fn;
|
317
|
+
isActive: import("vue").Ref<boolean>;
|
318
|
+
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
319
|
+
formattedTime: import("vue").ComputedRef<string>;
|
320
|
+
checkEnvironment: () => boolean;
|
321
|
+
start: () => Promise<void>;
|
322
|
+
handlePause: () => void;
|
323
|
+
handlePlay: () => void;
|
324
|
+
handleEnd: (trigger?: string | undefined) => Promise<void>;
|
325
|
+
NSpace: any;
|
326
|
+
NButton: any;
|
327
|
+
NIcon: any;
|
328
|
+
StopCircleOutline: 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<{}>>, {}>;
|
329
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
330
|
+
show: {
|
331
|
+
type: BooleanConstructor;
|
332
|
+
};
|
333
|
+
}>> & {
|
334
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
335
|
+
}, {
|
336
|
+
show: boolean;
|
337
|
+
}>;
|
338
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
339
|
+
ChatMainInner: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
340
|
+
ChatRight: import("vue").DefineComponent<{}, {
|
341
|
+
medicalLabel: {
|
342
|
+
key: string;
|
343
|
+
title: string;
|
344
|
+
}[];
|
345
|
+
state: any;
|
346
|
+
patientInfo: any;
|
347
|
+
toolbarConfig: {
|
348
|
+
toolbarKeys: never[];
|
349
|
+
};
|
350
|
+
content: import("vue").Ref<string>;
|
351
|
+
handleSave: () => Promise<void>;
|
352
|
+
createMedicalRecord: () => void;
|
353
|
+
extractContentByTitle: () => AnyObject;
|
354
|
+
NIcon: any;
|
355
|
+
NSpace: any;
|
356
|
+
NButton: any;
|
357
|
+
Editor: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
358
|
+
editorConfig: {
|
359
|
+
type: ObjectConstructor;
|
360
|
+
};
|
361
|
+
toolbarConfig: {
|
362
|
+
type: ObjectConstructor;
|
363
|
+
};
|
364
|
+
uploadImgUrl: {
|
365
|
+
type: StringConstructor;
|
366
|
+
};
|
367
|
+
isDisabled: {
|
368
|
+
type: BooleanConstructor;
|
369
|
+
default: boolean;
|
370
|
+
};
|
371
|
+
}, {
|
372
|
+
editorRef: import("vue").ShallowRef<any>;
|
373
|
+
renderVN: () => JSX.Element;
|
374
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
375
|
+
editorConfig: {
|
376
|
+
type: ObjectConstructor;
|
377
|
+
};
|
378
|
+
toolbarConfig: {
|
379
|
+
type: ObjectConstructor;
|
380
|
+
};
|
381
|
+
uploadImgUrl: {
|
382
|
+
type: StringConstructor;
|
383
|
+
};
|
384
|
+
isDisabled: {
|
385
|
+
type: BooleanConstructor;
|
386
|
+
default: boolean;
|
387
|
+
};
|
388
|
+
}>> & {}, {
|
389
|
+
isDisabled: boolean;
|
390
|
+
}>>;
|
391
|
+
CloseOutline: 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<{}>>, {}>;
|
268
392
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
269
393
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
270
394
|
token: {
|
@@ -282,17 +406,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
282
406
|
};
|
283
407
|
queryData: {
|
284
408
|
type: PropType<QueryData>;
|
285
|
-
reuired: boolean;
|
286
409
|
};
|
287
410
|
queryRecord: {
|
288
411
|
type: PropType<QueryRecord>;
|
289
|
-
reuired: boolean;
|
290
412
|
};
|
291
413
|
hideInput: {
|
292
414
|
type: BooleanConstructor;
|
293
415
|
};
|
294
416
|
uiStyle: {
|
295
417
|
type: StringConstructor;
|
418
|
+
default: string;
|
296
419
|
};
|
297
420
|
audioTimed: {
|
298
421
|
type: NumberConstructor;
|
@@ -316,10 +439,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
316
439
|
appId: {
|
317
440
|
type: StringConstructor;
|
318
441
|
};
|
442
|
+
orgId: {
|
443
|
+
type: StringConstructor;
|
444
|
+
};
|
445
|
+
userId: {
|
446
|
+
type: StringConstructor;
|
447
|
+
};
|
448
|
+
immediatelyRecording: {
|
449
|
+
type: BooleanConstructor;
|
450
|
+
default: boolean;
|
451
|
+
};
|
319
452
|
}>> & {
|
320
453
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
321
454
|
}, {
|
322
455
|
hideInput: boolean;
|
456
|
+
uiStyle: string;
|
323
457
|
audioTimed: number;
|
458
|
+
immediatelyRecording: boolean;
|
324
459
|
}>;
|
325
460
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,
|
1
|
+
import{defineComponent as e,computed as t,reactive as o,provide as n,toRefs as i,openBlock as r,createElementBlock as a,normalizeStyle as s,unref as l,createElementVNode as u,normalizeClass as d,createBlock as p,createCommentVNode as m}from"vue";import c from"./components/ChatMain.js";import y from"./components/ChatFooter.vue.js";import h from"./components/ChatMainInner.js";import f from"./components/ChatRight.vue.js";import{useTheme as v}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as S}from"../../../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{InjectionAIChat as g,InjectionAIChatEmits as k}from"./types/index.js";import{instanceAxios as j}from"./api/index.js";import{useWebsocket as I}from"./hooks/useWebsocket.js";const x=["id"];var C=e({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function},queryRecord:{type:Function},hideInput:{type:Boolean},uiStyle:{type:String,default:"big"},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object},appId:{type:String},orgId:{type:String},userId:{type:String},immediatelyRecording:{type:Boolean,default:!1}},emits:["button-click"],setup(e,{expose:C,emit:P}){const _=e,b=v();j.defaults.headers.Authorization="bearer "+_.token,"inner"!==_.uiStyle&&j.interceptors.response.use((e=>{var t;return(null==(t=e.data)?void 0:t.success)?e.data:{success:!1,data:[]}}));const A=t((()=>["small","inner"].includes(_.uiStyle))),F=o({id:"ai-chat-doctor-"+S(),loading:!1,loadingText:"",sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,consultationContent:null,params:{},reportContent:null});return n(g,{...i(_),state:F,isSmall:t((()=>"small"===_.uiStyle)),isInner:t((()=>"inner"===_.uiStyle)),vaa07:t((()=>{var e,t;return null==(t=null==(e=_.patientInfo)?void 0:e.info)?void 0:t.vaa07}))}),n(k,P),"inner"===_.uiStyle&&I(_,F),C({pushMessage:e=>{F.externalData=e},updatePatientInfo:e=>{F.selectedPatient=e}}),(t,o)=>(r(),a("div",{class:"ai-chat-doctor",style:s(l(b))},[u("div",{id:F.id,class:d(["ai-chat-doctor__main",l(A)?"ai-chat-doctor__main--small":"","inner"===e.uiStyle?"ai-chat-doctor__main--inner":""])},["inner"===e.uiStyle?(r(),p(l(h),{key:0})):(r(),p(l(c),{key:1})),e.hideInput?m("v-if",!0):(r(),p(y,{key:2}))],10,x),"inner"===e.uiStyle?(r(),p(f,{key:0})):m("v-if",!0)],4))}});export{C as default};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
export declare const instanceAxios: import("axios").AxiosInstance;
|
3
|
+
export declare function uploadFileApi(params: FormData): import("axios").AxiosPromise<any>;
|
4
|
+
export declare function conversationApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
5
|
+
export declare function saveApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
6
|
+
export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"axios";import{$message as t}from"../utils/index.js";const r=e.create({withCredentials:!0,timeout:5e3});function o(e){return r({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/storage-service/storage/uploadFile",data:e})}function a(e){return r({method:"post",url:"/flow/api/opd/conversation",data:e})}function s(e){return r({method:"put",url:"/flow/api/opd/message",data:e})}function i(e){return r({method:"get",url:`/flow/api/dialog/${e.sessionId}/messages`,params:{page:e.page||1,pageSize:e.pageSize||20}})}r.interceptors.request.use((e=>{var t;if(null==(t=e.url)?void 0:t.includes("/conversation")){const t={...e};return delete t.timeout,t}return e})),r.interceptors.response.use((e=>{var r,o,a;if(null==(r=e.data)?void 0:r.success)return null==(o=e.data)?void 0:o.data;500==(null==(a=e.data)?void 0:a.code)&&e.data.msg&&t.error(e.data.msg)}));export{a as conversationApi,i as getHistoryRecordApi,r as instanceAxios,s as saveApi,o as uploadFileApi};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { CAudioSDK } from '../../../../components/audio-sdk';
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
3
|
+
show: {
|
4
|
+
type: BooleanConstructor;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
audioSdk: CAudioSDK;
|
8
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
9
|
+
show: {
|
10
|
+
type: BooleanConstructor;
|
11
|
+
};
|
12
|
+
}>> & {
|
13
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
14
|
+
}>>;
|
15
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
16
|
+
state: any;
|
17
|
+
vaa07: any;
|
18
|
+
immediatelyRecording: any;
|
19
|
+
time: import("vue").Ref<number>;
|
20
|
+
endType: string;
|
21
|
+
pause: import("@vueuse/shared").Fn;
|
22
|
+
resume: import("@vueuse/shared").Fn;
|
23
|
+
isActive: import("vue").Ref<boolean>;
|
24
|
+
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
25
|
+
formattedTime: import("vue").ComputedRef<string>;
|
26
|
+
checkEnvironment: () => boolean;
|
27
|
+
start: () => Promise<void>;
|
28
|
+
handlePause: () => void;
|
29
|
+
handlePlay: () => void;
|
30
|
+
handleEnd: (trigger?: string) => Promise<void>;
|
31
|
+
NSpace: any;
|
32
|
+
NButton: any;
|
33
|
+
NIcon: any;
|
34
|
+
StopCircleOutline: 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<{}>>, {}>;
|
35
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
36
|
+
show: {
|
37
|
+
type: BooleanConstructor;
|
38
|
+
};
|
39
|
+
}>> & {
|
40
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
41
|
+
}, {
|
42
|
+
show: boolean;
|
43
|
+
}>;
|
44
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./ChatAudio.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","ChatAudio.vue"]]);export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as o,inject as e,ref as t,computed as i,watch as a,onBeforeUnmount as n,withDirectives as r,openBlock as s,createElementBlock as l,unref as u,createBlock as d,createCommentVNode as c,createElementVNode as p,toDisplayString as m,normalizeStyle as f,createVNode as v,withCtx as w,createTextVNode as h,vShow as g}from"vue";import{NIcon as y,NSpace as _,NButton as F}from"naive-ui";import{StopCircleOutline as S}from"@vicons/ionicons5";import{InjectionAIChat as k}from"../types/index.js";import{useIntervalFn as x,promiseTimeout as C}from"@vueuse/core";import $ from"../../../audio-sdk/src/audioSDK.js";import{uploadFileApi as j}from"../api/index.js";import{uuidGenerator as M}from"../../../../shared/utils/index.js";import{$message as z}from"../utils/index.js";const A={class:"ai-chat-doctor__audio"};var I=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:I}){const B=o,D=$.create(),{state:T,vaa07:b,immediatelyRecording:q}=e(k),K=t(0);let L="";const{pause:N,resume:O,isActive:R}=x((()=>{K.value++}),1e3,{immediate:!1}),U=i((()=>R.value?"正在录音中...":"录音已暂停")),E=i((()=>{const o=Math.floor(K.value/3600),e=Math.floor(K.value%3600/60),t=K.value%60,i=e.toString().padStart(2,"0"),a=t.toString().padStart(2,"0");if(o>0){return`${o.toString().padStart(2,"0")}:${i}:${a}`}return`${i}:${a}`}));async function G(){try{if((null==(o=null==navigator?void 0:navigator.userAgent)?void 0:o.includes("Chrome"))&&!(null==window?void 0:window.isSecureContext)&&(I("update:show",!1),z.warning("当前使用的http协议默认不支持麦克风权限,需要用户开启浏览器麦克风权限"),1))return;const e=await D.start(void 0,{timed:1800,recognizable:!1,showModal:!1});if(I("update:show",!1),"click"!==L)return;const{result:t,data:i}=e||{};if("success"!==t)return;if(i){const o=new File([i],`${M()}.mp3`,{type:i.type}),e=new FormData;e.append("file",o),e.append("channelId","MINIO");const t=await j(e),a=(null==t?void 0:t.path)||"";console.log("音频地址 ==>",a),T.params={audioUrl:a,opType:"create_inquiry"},T.sending=!0,T.loading=!0,T.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录"}}catch(o){console.log(o),I("update:show",!1),"fail"===(null==o?void 0:o.result)&&o.msg&&z.warning(o.msg)}var o}function H(){N(),D.pause()}function J(){O(),D.resume()}async function P(o){L=o||"",null==D||D.stop(),I("update:show",!1)}return a((()=>B.show),(o=>{o?(L="",K.value=0,O(),G()):N()}),{immediate:!0}),a((()=>b.value),(async o=>{const e=B.show;B.show&&P(),q.value&&(e&&await C(10),I("update:show",!0))}),{immediate:!0}),n((()=>{$.destroy()})),(e,t)=>r((s(),l("div",A,[u(R)?c("v-if",!0):(s(),d(u(y),{key:0,size:"42",color:"#FF1818",component:u(S)},null,8,["component"])),p("p",null,m(u(U)),1),p("h3",{style:f(u(R)?"":"color: #FF1818")},m(u(E)),5),v(u(_),{"wrap-item":!1,size:15},{default:w((()=>[r(v(u(F),{round:"",onClick:H},{default:w((()=>[h("暂停")])),_:1},512),[[g,u(R)]]),r(v(u(F),{round:"",onClick:J},{default:w((()=>[h("继续")])),_:1},512),[[g,!u(R)]]),v(u(F),{round:"",color:"#FF1818",onClick:t[0]||(t[0]=()=>P("click"))},{default:w((()=>{var o;return[h((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.77"))||"结束")]})),_:1})])),_:1})],512)),[[g,o.show]])}});export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as h,ChevronForward as b}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import E from"../../../form-render/index.js";import I from"../../../card-render/index.js";var
|
1
|
+
import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as h,ChevronForward as b}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import{instanceAxios as E}from"../api/index.js";import k from"../../../form-render/index.js";import I from"../../../card-render/index.js";var x=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:x,slots:C,emit:_}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},P=y(),{patientInfo:w,state:O,isSmall:j,appId:S}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),F=a(),q=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),A=e.msgItem.content,H={},B=l(p(A.data||{})),K={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=A.body||{},a=null==(n=(l=R.value).getFormValues)?void 0:n.call(l);Object.keys(t.params).forEach((l=>{const n=e.find((e=>e.code===l));"vaa05"===l?t.params.vaa05=L.value.selectedPatient.vaa01:Reflect.has(a,l)?t.params[l]=a[l]:n&&(t.params[l]=n.value)}))}t&&Reflect.has(t,"configs")&&(t.configs=L.value.selectedPatient)}};function U(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function D(e){B[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}if(q.value){const t=A.body.items||[],a=t.some((e=>"vaa05"===e.code));M.value=t.filter((e=>e.showFlag)).map((t=>{var l,n,o;if("vaa05"===t.code&&!j.value)return L.value={...t},t._value?N.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(N.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,L.value.selectedPatient=e.configs),null;const i={html_type:T[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(o=t.labelField)?o:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(i.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===i.html_type){if(i.componentProps={fallbackOption:!1},i.option=t.options||[],i.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(i.default_val=t.value)}if(Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:j.value?"inner":"global",...j.value?{appId:S.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=w.value.info||O.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,i.urlConfig.params.params={},e.forEach((e=>{i.urlConfig.params.params[e]=""}))}}return i})).filter((e=>!!e))}function J(){var t;if(!L.value)return null;function a(){e.msgItem.disabled||(O.showPatient=!0)}return i(s,{class:"form-render",ref:F,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:N,rules:{vaa05:{required:L.value.required,message:L.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:L.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:N.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:h},null)})]}})]})}async function V(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),A.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=O.selectedPatientLabel,e.value=L.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=H[e.code])?void 0:t[0])&&(e.options=H[e.code])})),O.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){O.loading=!1}}function z(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(H[n]=[null==a?void 0:a.currentOption])}function X(){_("button-click",{showMore:!0})}function G(){var e;if("1834043761964638208"!==(null==(e=A.settings)?void 0:e.id)||!A.data)return null;const t=JSON.parse(A.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(A.data[l])||JSON.parse(A.data[l]).length<=5?null:(g(B[l])&&(B[l]=JSON.parse(B[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:P.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return o((()=>O.showPatient),(t=>{!e.msgItem.disabled&&q.value&&!t&&O.selectedPatientLabel&&L.value&&(N.vaa05=O.selectedPatientLabel,L.value.selectedPatient={...O.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[q.value?[i("p",null,[A.title||A.header.title]),i("div",{class:"form-box"},[[J(),i(k,{"request-instance":{get:E.get,post:E.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:z},null)]]),A.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=q.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(q.value){if(!R.value)return;try{L.value?null==(e=F.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:L.value.selectedPatient.vaa01}),await V(t,e)}})):await V(t)}catch(e){}}else _("button-click")}},{default:()=>[q.value?null==t?void 0:t.text:A.buttonName]})}(t)))]:[i(I,{config:g(null==(t=A.settings)?void 0:t.setting)?JSON.parse(A.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{x as default};
|
@@ -2,6 +2,12 @@ import { CommandItem } from '../types';
|
|
2
2
|
import { CAudioSDK } from '../../../../components/audio-sdk';
|
3
3
|
import { AnyObject } from '../../../../shared/types';
|
4
4
|
declare const _default: import("vue").DefineComponent<{}, {
|
5
|
+
innerDefaultShortcutList: {
|
6
|
+
key: string;
|
7
|
+
value: string;
|
8
|
+
}[];
|
9
|
+
programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
|
10
|
+
MedicalOrderId: string;
|
5
11
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
6
12
|
audioSdk: CAudioSDK;
|
7
13
|
emit: (event: string, ...args: any[]) => void;
|
@@ -10,6 +16,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
10
16
|
isSmall: any;
|
11
17
|
audioTimed: any;
|
12
18
|
commandList: any;
|
19
|
+
isInner: any;
|
20
|
+
patientInfo: any;
|
13
21
|
inputRef: import("vue").Ref<any>;
|
14
22
|
showPopover: import("vue").Ref<boolean>;
|
15
23
|
breadcrumb: import("vue").Ref<{
|
@@ -29,13 +37,16 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
29
37
|
showPrompt: import("vue").Ref<boolean>;
|
30
38
|
currentShortcutId: import("vue").Ref<string>;
|
31
39
|
showPatient: import("vue").Ref<boolean>;
|
32
|
-
|
40
|
+
showAudio: import("vue").Ref<boolean>;
|
41
|
+
placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
|
33
42
|
btnDisabled: import("vue").ComputedRef<any>;
|
34
43
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
35
44
|
patient: import("vue").ComputedRef<string>;
|
45
|
+
currentShortcutList: import("vue").ComputedRef<any>;
|
46
|
+
isAllDisabled: import("vue").ComputedRef<any>;
|
36
47
|
recorderStart: () => Promise<void>;
|
37
48
|
getShortcutName: (item: string | AnyObject) => any;
|
38
|
-
handleShortcut: (item: string | AnyObject) => void
|
49
|
+
handleShortcut: (item: string | AnyObject) => Promise<void>;
|
39
50
|
resetCurrentCommand: () => void;
|
40
51
|
handleKeyDown: (event: KeyboardEvent) => void;
|
41
52
|
isWrap: (event: KeyboardEvent) => boolean;
|
@@ -155,5 +166,47 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
155
166
|
}, {
|
156
167
|
show: boolean;
|
157
168
|
}>;
|
169
|
+
ChatAudio: import("vue").DefineComponent<{
|
170
|
+
show: {
|
171
|
+
type: BooleanConstructor;
|
172
|
+
};
|
173
|
+
}, {
|
174
|
+
audioSdk: CAudioSDK;
|
175
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
176
|
+
show: {
|
177
|
+
type: BooleanConstructor;
|
178
|
+
};
|
179
|
+
}>> & {
|
180
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
181
|
+
}>>;
|
182
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
183
|
+
state: any;
|
184
|
+
vaa07: any;
|
185
|
+
immediatelyRecording: any;
|
186
|
+
time: import("vue").Ref<number>;
|
187
|
+
endType: string;
|
188
|
+
pause: import("@vueuse/shared").Fn;
|
189
|
+
resume: import("@vueuse/shared").Fn;
|
190
|
+
isActive: import("vue").Ref<boolean>;
|
191
|
+
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
192
|
+
formattedTime: import("vue").ComputedRef<string>;
|
193
|
+
checkEnvironment: () => boolean;
|
194
|
+
start: () => Promise<void>;
|
195
|
+
handlePause: () => void;
|
196
|
+
handlePlay: () => void;
|
197
|
+
handleEnd: (trigger?: string | undefined) => Promise<void>;
|
198
|
+
NSpace: any;
|
199
|
+
NButton: any;
|
200
|
+
NIcon: any;
|
201
|
+
StopCircleOutline: 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<{}>>, {}>;
|
202
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
203
|
+
show: {
|
204
|
+
type: BooleanConstructor;
|
205
|
+
};
|
206
|
+
}>> & {
|
207
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
208
|
+
}, {
|
209
|
+
show: boolean;
|
210
|
+
}>;
|
158
211
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
159
212
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as o,computed as n,onBeforeUnmount as l,watch as s,openBlock as a,createElementBlock as i,normalizeClass as r,unref as u,createElementVNode as d,createBlock as c,withCtx as v,createVNode as m,createTextVNode as h,toDisplayString as p,createCommentVNode as f,Fragment as k,renderList as w,createSlots as g,withModifiers as C,getCurrentInstance as y}from"vue";import{NButton as b,NIcon as x,NPopover as _,NInput as I,NTag as j,NBreadcrumb as z,NBreadcrumbItem as P}from"naive-ui";import{PeopleOutline as D,SparklesSharp as M,PaperPlane as T,ChevronBack as K,ChevronForward as L}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as B}from"../types/index.js";import"../../../audio-sdk/index.js";import{cloneDeep as U,isString as A,last as R}from"lodash-es";import{useTheme as E}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import W from"./ChatPrompt.vue.js";import F from"./ChatPatient.vue.js";import N from"../../../audio-sdk/src/audioSDK.js";const q={class:"menu-box fillet-8"},H={class:"input-wrapper fillet-10"},V=d("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),d("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),d("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),G={key:0,class:"btn-box"},J=["disabled"],O={class:"command-box"},Q={class:"command-box__header"},X={key:0,class:"title"},Y={class:"command-box__menu"},Z=["onMouseover","onClick"],$={class:"label"},ee={class:"remark"};var te=e({__name:"ChatFooter",setup(e){const te=E(),oe=N.create(),ne=t(S),{shortcutList:le,state:se,isSmall:ae,audioTimed:ie,commandList:re}=t(B),ue=o(),de=o(!1),ce=o([]),ve=o(U(re.value||[])),me=o(!1),he=o(""),pe=o(!1),fe=n((()=>ae?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),ke=n((()=>se.loading||!se.sendContent.replace(/( |\s|<br>)+/g,""))),we=n((()=>{var e;return!se.sendContent&&!(null==(e=ue.value)?void 0:e.activated.value)})),ge=n((()=>{var e,t;if(!se.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:o,vaa05:n}=se.selectedPatient;let l="";o&&(l+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));return n&&(l+=(!l||l.endsWith("/")?"":"/")+n),l}));async function Ce(){try{const e=await oe.start({instance:y(),allowPunctuationMark:!1,timed:ie.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;se.sendContent=e.data||""}catch(e){console.log(e)}}function ye(e){var t;if(A(e))return e;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return o.instructionName}function be(){var e;de.value=!1,ve.value=U(re.value||[]),ce.value=[],(null==(e=re.value)?void 0:e.length)&&(de.value=!0,he.value=ve.value[0].shortcutId)}function xe(e){if(!["Slash","NumpadDivide"].includes(e.code)||se.selectedCommand||se.sendContent)if("Backspace"===e.key)de.value=!1,!se.sendContent.startsWith("/")&&!se.sendContent.startsWith("、")||2!==se.sendContent.length||se.selectedCommand?!se.sendContent&&se.selectedCommand&&(e.preventDefault(),se.selectedCommand=null,se.sendContent="/",be()):be();else if(de.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=ve.value.findIndex((e=>e.shortcutId===he.value));if("ArrowUp"===e.key){const e=t>0?t-1:ve.value.length-1;he.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<ve.value.length-1?t+1:0;he.value=ve.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),de.value){je(ve.value.find((e=>e.shortcutId===he.value)))}else Ie()}else de.value=!1;else be()}function _e(e){!e&&se.selectedPrompt&&(se.selectedPrompt=null)}function Ie(){ke.value||(se.sending=!0,se.loading=!0)}function je(e){var t;he.value=e.shortcutId,ue.value.focus(),(null==(t=e.children)?void 0:t.length)?(ve.value=e.children,he.value=ve.value[0].shortcutId,ce.value.push(e)):(se.selectedCommand=e||{},de.value=!1,se.sendContent="")}function ze(){var e;ce.value.pop(),ve.value=R(ce.value)?null==(e=R(ce.value))?void 0:e.children:U(re.value||[]),he.value=ve.value[0].shortcutId,ue.value.focus()}function Pe(e){e||(se.showPatient=!1)}return l((()=>{oe.destroy()})),s((()=>se.showPatient),(e=>{e&&(pe.value=e)})),(e,t)=>(a(),i("section",{class:r(["chat-footer",u(se).loading?"disabled":""])},[d("div",q,[u(ae)?f("v-if",!0):(a(),c(u(b),{key:0,secondary:"",size:"small",onClick:t[0]||(t[0]=()=>pe.value=!0)},{icon:v((()=>[m(u(x),{color:u(te)["--c-primary-color"],size:"20",component:u(D)},null,8,["color","component"])])),default:v((()=>[h(" "+p(u(ge)),1)])),_:1})),u(le)&&u(le).length>0?(a(!0),i(k,{key:1},w(u(le),(e=>(a(),c(u(b),{secondary:"",size:"small",round:u(ae),key:ye(e),onClick:()=>function(e){var t;if(A(e))se.sendContent=e;else{const o=null==(t=null==e?void 0:e.contents)?void 0:t[0];ne("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[h(p(ye(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(u(_),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:de.value,onClickoutside:t[3]||(t[3]=e=>de.value=!1)},{trigger:v((()=>[d("div",H,[m(u(I),{ref_key:"inputRef",ref:ue,placeholder:u(fe),type:"textarea",autosize:{minRows:u(ae)?1:2,maxRows:7},disabled:u(se).loading,value:u(se).sendContent,"onUpdate:value":t[2]||(t[2]=e=>u(se).sendContent=e),onKeydownCapture:xe,onInput:_e},g({prefix:v((()=>[u(se).selectedCommand&&u(se).selectedCommand.shortcutTitle?(a(),c(u(j),{key:0,bordered:!1,color:{textColor:u(te)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(u(se).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):u(we)?(a(),c(u(b),{key:1,text:"",onClick:t[1]||(t[1]=()=>me.value=!0)},{default:v((()=>[m(u(x),{color:"#8f66f7",size:"18",component:u(M)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:2},[u(ae)?{name:"suffix",fn:v((()=>[m(u(b),{text:"",disabled:u(se).loading,onClick:Ce},{icon:v((()=>[m(u(x),{size:"30"},{default:v((()=>[V])),_:1})])),_:1},8,["disabled"]),m(u(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:u(ke),onClick:Ie},{icon:v((()=>[m(u(x),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),key:"0"}:void 0]),1032,["placeholder","autosize","disabled","value"]),u(ae)?f("v-if",!0):(a(),i("div",G,[d("span",{class:r(["btn-send","gradient","fillet-8",u(ke)?"disabled":""]),disabled:u(ke),onClick:Ie},[m(u(x),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,J)]))])])),default:v((()=>{var e;return[d("div",O,[d("div",Q,[0===ce.value.length?(a(),i("span",X,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(a(),i(k,{key:1},[m(u(b),{text:"",onClick:ze},{default:v((()=>[m(u(x),{color:"#999",size:"20",component:u(K)},null,8,["component"])])),_:1}),m(u(z),null,{default:v((()=>[(a(!0),i(k,null,w(ce.value,(e=>(a(),c(u(P),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),d("div",Y,[(a(!0),i(k,null,w(ve.value,(e=>(a(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",he.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>he.value=e.shortcutId),["stop"]),onClick:()=>je(e)},[d("span",$,p(e.shortcutTitle),1),d("span",ee,p(e.shortcutDescription),1),e.children&&e.children.length?(a(),c(u(x),{key:0,color:"#999",size:"20",component:u(L)},null,8,["component"])):f("v-if",!0)],42,Z)))),128))])])]})),_:1},8,["show"]),m(W,{show:me.value,"onUpdate:show":t[4]||(t[4]=e=>me.value=e)},null,8,["show"]),m(F,{show:pe.value,"onUpdate:show":[t[5]||(t[5]=e=>pe.value=e),Pe]},null,8,["show"])],2))}});export{te as default};
|
1
|
+
import{defineComponent as e,inject as o,ref as n,computed as t,onBeforeUnmount as l,watch as a,openBlock as i,createElementBlock as s,normalizeClass as r,unref as d,createElementVNode as u,createBlock as c,withCtx as v,createVNode as m,createTextVNode as h,toDisplayString as p,createCommentVNode as f,Fragment as k,renderList as w,normalizeStyle as g,createSlots as y,withModifiers as C,getCurrentInstance as b}from"vue";import{NButton as x,NIcon as _,NPopover as I,NInput as j,NTag as z,NBreadcrumb as M,NBreadcrumbItem as T}from"naive-ui";import{PeopleOutline as P,SparklesSharp as D,PaperPlane as S,ChevronBack as B,ChevronForward as E}from"@vicons/ionicons5";import{InjectionAIChatEmits as K,InjectionAIChat as L}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as R,last as F}from"lodash-es";import{useTheme as W}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import N from"./ChatPrompt.vue.js";import V from"./ChatPatient.vue.js";import q from"./ChatAudio.vue.js";import{useProgram as H}from"../hooks/useProgram.js";const O={class:"menu-box fillet-8"},G={class:"input-wrapper fillet-10"},J=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),Q={key:0,class:"btn-box"},X=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),Y=["disabled"],Z={class:"command-box"},$={class:"command-box__header"},ee={key:0,class:"title"},oe={class:"command-box__menu"},ne=["onMouseover","onClick"],te={class:"label"},le={class:"remark"};var ae=e({__name:"ChatFooter",setup(e){const ae=[{key:"recommend_diagnosis",value:"推荐诊断"},{key:"recommend_examination",value:"推荐诊查方案"},{key:"recommend_treatment_plan",value:"推荐治疗方案"},{key:"medical",value:"病历"}],{programMethod:ie,MedicalOrderId:se}=H(),re=W(),de=U.create(),ue=o(K),{shortcutList:ce,state:ve,isSmall:me,audioTimed:he,commandList:pe,isInner:fe,patientInfo:ke}=o(L),we=n(),ge=n(!1),ye=n([]),Ce=n(A(pe.value||[])),be=n(!1),xe=n(""),_e=n(!1),Ie=n(!1),je=t((()=>fe.value?"请向我提问,Shift+Enter换行":me?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),ze=t((()=>De.value||ve.loading||!ve.sendContent.replace(/( |\s|<br>)+/g,""))),Me=t((()=>{var e;return!ve.sendContent&&!(null==(e=we.value)?void 0:e.activated.value)})),Te=t((()=>{var e,o;if(!ve.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:n,vaa05:t}=ve.selectedPatient;let l="";n&&(l+=n+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.191"))||"床"));return t&&(l+=(!l||l.endsWith("/")?"":"/")+t),l})),Pe=t((()=>fe.value?ae.concat(ce.value||[]):ce.value)),De=t((()=>{var e,o;return fe.value&&1!==(null==(o=null==(e=ke.value)?void 0:e.info)?void 0:o.vac34)}));async function Se(){try{const e=await de.start(b(),{allowPunctuationMark:!1,timed:he.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:o}=e.data;ve.sendContent=o}catch(e){console.log(e)}}function Be(e){var o;if(R(e))return e;if(fe.value)return e.value;const{content:n}=(null==(o=null==e?void 0:e.contents)?void 0:o[0])||{};return null==n?void 0:n.instructionName}function Ee(){var e;ge.value=!1,Ce.value=A(pe.value||[]),ye.value=[],(null==(e=pe.value)?void 0:e.length)&&(ge.value=!0,xe.value=Ce.value[0].shortcutId)}function Ke(e){if(fe.value)"Enter"!==e.key||Le(e)||Ae();else if(!["Slash","NumpadDivide"].includes(e.code)||ve.selectedCommand||ve.sendContent)if("Backspace"===e.key)ge.value=!1,!ve.sendContent.startsWith("/")&&!ve.sendContent.startsWith("、")||2!==ve.sendContent.length||ve.selectedCommand?!ve.sendContent&&ve.selectedCommand&&(e.preventDefault(),ve.selectedCommand=null,ve.sendContent="/",Ee()):Ee();else if(ge.value&&["ArrowUp","ArrowDown"].includes(e.key)){const o=Ce.value.findIndex((e=>e.shortcutId===xe.value));if("ArrowUp"===e.key){const e=o>0?o-1:Ce.value.length-1;xe.value=Ce.value[e].shortcutId}else if("ArrowDown"===e.key){const e=o<Ce.value.length-1?o+1:0;xe.value=Ce.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!Le(e))if(e.preventDefault(),ge.value){Re(Ce.value.find((e=>e.shortcutId===xe.value)))}else Ae()}else ge.value=!1;else Ee()}function Le(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Ue(e){!e&&ve.selectedPrompt&&(ve.selectedPrompt=null)}function Ae(){ze.value||(ve.sending=!0,ve.loading=!0)}function Re(e){var o;xe.value=e.shortcutId,we.value.focus(),(null==(o=e.children)?void 0:o.length)?(Ce.value=e.children,xe.value=Ce.value[0].shortcutId,ye.value.push(e)):(ve.selectedCommand=e||{},ge.value=!1,ve.sendContent="")}function Fe(){var e;ye.value.pop(),Ce.value=F(ye.value)?null==(e=F(ye.value))?void 0:e.children:A(pe.value||[]),xe.value=Ce.value[0].shortcutId,we.value.focus()}function We(e){e||(ve.showPatient=!1)}return l((()=>{U.destroy()})),a((()=>ve.showPatient),(e=>{e&&(_e.value=e)})),(e,o)=>(i(),s("section",{class:r(["chat-footer",d(De)||d(ve).loading?"disabled":""])},[u("div",O,[d(me)||d(fe)?f("v-if",!0):(i(),c(d(x),{key:0,secondary:"",size:"small",onClick:o[0]||(o[0]=()=>_e.value=!0)},{icon:v((()=>[m(d(_),{color:d(re)["--c-primary-color"],size:"20",component:d(P)},null,8,["color","component"])])),default:v((()=>[h(" "+p(d(Te)),1)])),_:1})),d(Pe)&&d(Pe).length>0?(i(!0),s(k,{key:1},w(d(Pe),(e=>(i(),c(d(x),{secondary:"",size:"small",style:g(d(me)?"background: #fff":""),round:d(me),key:Be(e),disabled:d(De),onClick:()=>async function(e){var o,n,t,l;if(R(e))ve.sendContent=e;else{if(fe.value&&e.key){switch(e.key){case"medical":ve.consultationContent=null,ve.showRight=!0,await ie(se,{vac01:(null==(n=null==(o=ke.value)?void 0:o.info)?void 0:n.vac01)||"1878974046080958465",type:1});break;case"recommend_treatment_plan":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0,ve.loadingText="参考诊断结果与患者个体信息,正全面梳理知识库和临床指南,综合考量为您匹配最适宜的诊疗方案推荐";break;case"recommend_examination":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0,ve.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目";break;case"recommend_diagnosis":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0;break;default:ue("button-click",{item:e,patientInfo:null==(t=ke.value)?void 0:t.info})}return}const a=null==(l=null==e?void 0:e.contents)?void 0:l[0];ue("button-click",{msgItem:a,item:e})}}(e)},{default:v((()=>[h(p(Be(e)),1)])),_:2},1032,["style","round","disabled","onClick"])))),128)):f("v-if",!0)]),m(d(I),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ge.value,onClickoutside:o[4]||(o[4]=e=>ge.value=!1)},{trigger:v((()=>[u("div",G,[m(d(j),{ref_key:"inputRef",ref:we,placeholder:d(je),type:"textarea",autosize:{minRows:d(me)?1:2,maxRows:7},disabled:d(De)||d(ve).loading,value:d(ve).sendContent,"onUpdate:value":o[2]||(o[2]=e=>d(ve).sendContent=e),onKeydownCapture:Ke,onInput:Ue},y({_:2},[d(fe)?void 0:{name:"prefix",fn:v((()=>[d(ve).selectedCommand&&d(ve).selectedCommand.shortcutTitle?(i(),c(d(z),{key:0,bordered:!1,color:{textColor:d(re)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(d(ve).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):d(Me)?(i(),c(d(x),{key:1,text:"",onClick:o[1]||(o[1]=()=>be.value=!0)},{default:v((()=>[m(d(_),{color:"#8f66f7",size:"18",component:d(D)},null,8,["component"])])),_:1})):f("v-if",!0)])),key:"0"},d(me)?{name:"suffix",fn:v((()=>[m(d(x),{text:"",disabled:d(ve).loading,onClick:Se},{icon:v((()=>[m(d(_),{size:"30"},{default:v((()=>[J])),_:1})])),_:1},8,["disabled"]),m(d(x),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(ze),onClick:Ae},{icon:v((()=>[m(d(_),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),key:"1"}:void 0]),1032,["placeholder","autosize","disabled","value"]),d(me)?f("v-if",!0):(i(),s("div",Q,[d(fe)?(i(),c(d(x),{key:0,text:"",disabled:d(De)||Ie.value||d(ve).loading,onClick:o[3]||(o[3]=e=>Ie.value=!0)},{icon:v((()=>[m(d(_),{size:"38"},{default:v((()=>[X])),_:1})])),_:1},8,["disabled"])):f("v-if",!0),u("span",{class:r(["btn-send","gradient","fillet-8",d(ze)?"disabled":""]),disabled:d(ze),onClick:Ae},[m(d(_),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,Y)]))])])),default:v((()=>{var e;return[u("div",Z,[u("div",$,[0===ye.value.length?(i(),s("span",ee,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(i(),s(k,{key:1},[m(d(x),{text:"",onClick:Fe},{default:v((()=>[m(d(_),{color:"#999",size:"20",component:d(B)},null,8,["component"])])),_:1}),m(d(M),null,{default:v((()=>[(i(!0),s(k,null,w(ye.value,(e=>(i(),c(d(T),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",oe,[(i(!0),s(k,null,w(Ce.value,(e=>(i(),s("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",xe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>xe.value=e.shortcutId),["stop"]),onClick:()=>Re(e)},[u("span",te,p(e.shortcutTitle),1),u("span",le,p(e.shortcutDescription),1),e.children&&e.children.length?(i(),c(d(_),{key:0,color:"#999",size:"20",component:d(E)},null,8,["component"])):f("v-if",!0)],42,ne)))),128))])])]})),_:1},8,["show"]),d(fe)?f("v-if",!0):(i(),c(N,{key:0,show:be.value,"onUpdate:show":o[5]||(o[5]=e=>be.value=e)},null,8,["show"])),d(fe)?f("v-if",!0):(i(),c(V,{key:1,show:_e.value,"onUpdate:show":[o[6]||(o[6]=e=>_e.value=e),We]},null,8,["show"])),d(fe)?(i(),c(q,{key:2,show:Ie.value,"onUpdate:show":o[7]||(o[7]=e=>Ie.value=e)},null,8,["show"])):f("v-if",!0)],2))}});export{ae as default};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
2
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,inject as n,ref as t,watch as o,createVNode as r,nextTick as s,resolveComponent as a}from"vue";import{NTooltip as l,NButton as i,NIcon as u}from"naive-ui";import{InjectionAIChat as c}from"../types/index.js";import{isArray as d,cloneDeep as m,isFunction as p}from"lodash-es";import{uuidGenerator as v}from"../../../../shared/utils/index.js";import{promiseTimeout as g}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{SyncOutline as h}from"@vicons/ionicons5";import{useScrollLoading as f}from"../../../../shared/hooks/useScrollLoading.js";import y from"./card/JsonCard.js";import{getHistoryRecordApi as x,conversationApi as T}from"../api/index.js";import{useProgram as _}from"../hooks/useProgram.js";var C=e({name:"ChatMain",inheritAttrs:!1,components:{JsonCard:y},setup(e,{attrs:y,slots:C,emit:j}){const{patientInfo:w,state:b,vaa07:M}=n(c),{programMethod:q,MedicalOrderId:I}=_(),k=t(null),R=t([]),O={page:0,hasMore:!0};async function S(){if(!M.value)return;if(!O.hasMore||!M.value)return;O.page++,1==O.page&&(R.value=[]);const e=await x({sessionId:M.value,page:O.page,pageSize:20}),{rows:n,query:t={}}=e||{};d(n)&&(n.forEach((e=>{d(e.contents)&&e.contents.length>1&&e.contents.reverse()})),R.value.length<=+t.records&&(R.value=O.page>1?[...R.value,...n]:n,R.value.length>=+t.records&&(O.hasMore=!1,console.log("没有更多消息了"))))}async function J(e){var n;d(e.contents)&&(R.value.unshift(e),await s(),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}))}function U(e,n){var t;const{contentType:o,messageType:r}=(null==(t=null==e?void 0:e.contents)?void 0:t[n])||{};return"json"===o&&"retry_inquiry"!==r}function z(e){const n=e.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:r("br",null,null)]));return n.length?[n]:null}function A(e,n){var t,o,s,c,d;const{contents:m=[],msgId:p=""}=e;return"json"===(null==(t=m[n])?void 0:t.contentType)?"retry_inquiry"===(null==(o=m[n])?void 0:o.messageType)?[z((null==(c=null==(s=m[n])?void 0:s.content)?void 0:c.errorMsg)||""),r(l,{trigger:"hover"},{default:()=>"重新生成",trigger:()=>r(i,{style:"position: relative;top: 3px;margin-left: 8px",type:"primary",text:!0,onClick:()=>{var e,t,o;return o=null==(t=null==(e=m[n])?void 0:e.content)?void 0:t.audioUrl,b.params={audioUrl:o,opType:"create_inquiry"},b.sending=!0,b.loading=!0,void(b.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}},{icon:()=>r(u,{component:h},null)})})]:function(e,n){return r(a("json-card"),{item:e,messageItem:n},null)}(e,m[n]):z((null==(d=m[n])?void 0:d.content)||"")}function E({role:e=""}){return"user"===e}return f(k,(()=>{S()}),"top"),o((()=>M.value),(e=>{b.showRight=!1,R.value=[],O.page=0,O.hasMore=!0,S()}),{immediate:!0}),o((()=>b.reportContent),(e=>{e&&(J(e),b.reportContent=null)})),o((()=>b.sending),(async e=>{var n,t,o,r,s,a,l;if(e){const{opType:e}=b.params||{};if(!e&&b.sendContent&&R.value.unshift({msgId:v(),contents:[{role:"user",content:b.sendContent}]}),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}),e&&["recommend_treatment_plan","recommend_diagnosis","recommend_examination"].includes(e)){if(R.value.length>0){const e=R.value.find((e=>{var n;return!E(null==(n=null==e?void 0:e.contents)?void 0:n[0])}));e&&Object.assign(b.params,m(e))}Object.assign(b.params,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const n=await T({contents:[{role:"user",content:b.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:w.value.info,...b.params});["diagnosis","medical_order"].includes(e)&&b.showRight&&!b.consultationContent&&await q(I,{vac01:(null==(o=null==(t=w.value)?void 0:t.info)?void 0:o.vac01)||"1878974046080958465",type:1}),d(n.contents)&&n.contents.length>1&&n.contents.reverse(),J(n),e&&["create_inquiry","create_medical"].includes(e)&&("create_inquiry"===e?"retry_inquiry"!==(null==(s=null==(r=null==n?void 0:n.contents)?void 0:r[0])?void 0:s.messageType)&&(b.consultationContent=n,b.showRight=!0):(b.consultationContent=null,await g(1e3),b.showRight=!0,await q(I,{vac01:(null==(l=null==(a=w.value)?void 0:a.info)?void 0:l.vac01)||"1878974046080958465",type:1}))),e||(b.sendContent=""),b.params={}}catch(e){console.log("error ==>",e)}finally{b.sending=!1,b.loading=!1,b.loadingText=""}}})),()=>[r("section",{class:"chat-main",ref:k,style:"column-reverse"},[[b.loading?r("div",{class:"message-item"},[r("div",{class:"content-box"},[r("div",{class:"content loading"},[r("span",{class:"ai-chat__loading-icon"},null),r("span",null,[b.loadingText||"正在整合数据..."])])])]):null,R.value.map((e=>e.contents.map(((n,t)=>A(e,t)?r("div",{class:"message-item",key:e.msgId+t},[r("div",{class:["content-box",E(n)?"mine":""]},[r("div",{class:["content",{"content-json":!p(n.render)&&U(e,t)}]},[p(n.render)?n.render():A(e,t)])])]):null))))]])]}});export{C as default};
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
3
|
+
medicalLabel: {
|
4
|
+
key: string;
|
5
|
+
title: string;
|
6
|
+
}[];
|
7
|
+
state: any;
|
8
|
+
patientInfo: any;
|
9
|
+
toolbarConfig: {
|
10
|
+
toolbarKeys: never[];
|
11
|
+
};
|
12
|
+
content: import("vue").Ref<string>;
|
13
|
+
handleSave: () => Promise<void>;
|
14
|
+
createMedicalRecord: () => void;
|
15
|
+
extractContentByTitle: () => AnyObject;
|
16
|
+
NIcon: any;
|
17
|
+
NSpace: any;
|
18
|
+
NButton: any;
|
19
|
+
Editor: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
20
|
+
editorConfig: {
|
21
|
+
type: ObjectConstructor;
|
22
|
+
};
|
23
|
+
toolbarConfig: {
|
24
|
+
type: ObjectConstructor;
|
25
|
+
};
|
26
|
+
uploadImgUrl: {
|
27
|
+
type: StringConstructor;
|
28
|
+
};
|
29
|
+
isDisabled: {
|
30
|
+
type: BooleanConstructor;
|
31
|
+
default: boolean;
|
32
|
+
};
|
33
|
+
}, {
|
34
|
+
editorRef: import("vue").ShallowRef<any>;
|
35
|
+
renderVN: () => JSX.Element;
|
36
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
37
|
+
editorConfig: {
|
38
|
+
type: ObjectConstructor;
|
39
|
+
};
|
40
|
+
toolbarConfig: {
|
41
|
+
type: ObjectConstructor;
|
42
|
+
};
|
43
|
+
uploadImgUrl: {
|
44
|
+
type: StringConstructor;
|
45
|
+
};
|
46
|
+
isDisabled: {
|
47
|
+
type: BooleanConstructor;
|
48
|
+
default: boolean;
|
49
|
+
};
|
50
|
+
}>> & {}, {
|
51
|
+
isDisabled: boolean;
|
52
|
+
}>>;
|
53
|
+
CloseOutline: 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<{}>>, {}>;
|
54
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
55
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import t from"./ChatRight.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var r=e(t,[["__file","ChatRight.vue"]]);export{r as default};
|