cnhis-design-vue 3.3.1-beta.14 → 3.3.1-beta.15
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 +12 -17
- package/es/components/ai-chat/src/Index.vue.d.ts +12 -17
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +1 -2
- package/es/components/ai-chat/src/api/index.js +1 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +3 -11
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -2
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
- package/es/components/ai-chat/src/hooks/useWebsocket.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 +5 -7
- 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 -4
- 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 +7 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/field-editor/index.d.ts +7 -1
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
- package/es/components/form-config/index.d.ts +38 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +38 -3
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +17 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -1
- package/es/components/form-render/index.d.ts +7 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- 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/input.d.ts +5 -0
- 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 +14 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -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/hooks/useFieldNormalize.d.ts +4 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- 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 +47 -0
- package/es/components/iho-chat/src/Index.vue.d.ts +47 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +22 -0
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +4 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +8 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +7 -0
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +2 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +26 -23
- 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 +78 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
- 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 +1 -2
- 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 +1 -0
- 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/info-header/index.d.ts +24 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -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 +8 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -1
- 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/components/DateIcon/DateIcon.vue.js +1 -0
- package/es/shared/components/DateIcon/index.d.ts +2 -0
- package/es/shared/components/DateIcon/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -6
- package/es/components/ai-chat/src/hooks/useProgram.js +0 -1
- /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -121,18 +121,15 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
121
121
|
};
|
122
122
|
}>> & {
|
123
123
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
124
|
+
onProgram?: ((...args: any[]) => any) | undefined;
|
124
125
|
}>>;
|
125
|
-
emit: (event: "button-click", ...args: any[]) => void;
|
126
|
-
showSmallStyle: import("vue").ComputedRef<boolean>;
|
126
|
+
emit: (event: "button-click" | "program", ...args: any[]) => void;
|
127
127
|
state: import("../../shared/types").AnyObject;
|
128
|
+
onClose: () => void;
|
129
|
+
NIcon: any;
|
130
|
+
NButton: any;
|
128
131
|
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<{}>>, {}>;
|
129
132
|
ChatFooter: import("vue").DefineComponent<{}, {
|
130
|
-
innerDefaultShortcutList: {
|
131
|
-
key: string;
|
132
|
-
value: string;
|
133
|
-
}[];
|
134
|
-
programMethod: (bpmnProcessId: string, params: import("../../shared/types").AnyObject) => Promise<any>;
|
135
|
-
MedicalOrderId: string;
|
136
133
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
137
134
|
audioSdk: import("..").CAudioSDK;
|
138
135
|
emit: (event: string, ...args: any[]) => void;
|
@@ -141,7 +138,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
141
138
|
isSmall: any;
|
142
139
|
audioTimed: any;
|
143
140
|
commandList: any;
|
144
|
-
|
141
|
+
isDefault: any;
|
145
142
|
patientInfo: any;
|
146
143
|
inputRef: import("vue").Ref<any>;
|
147
144
|
showPopover: import("vue").Ref<boolean>;
|
@@ -164,14 +161,13 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
164
161
|
showPatient: import("vue").Ref<boolean>;
|
165
162
|
showAudio: import("vue").Ref<boolean>;
|
166
163
|
placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
|
164
|
+
isAllDisabled: import("vue").ComputedRef<any>;
|
167
165
|
btnDisabled: import("vue").ComputedRef<any>;
|
168
166
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
169
167
|
patient: import("vue").ComputedRef<string>;
|
170
|
-
currentShortcutList: import("vue").ComputedRef<any>;
|
171
|
-
isAllDisabled: import("vue").ComputedRef<any>;
|
172
168
|
recorderStart: () => Promise<void>;
|
173
169
|
getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
|
174
|
-
handleShortcut: (item: string | import("../../shared/types").AnyObject) =>
|
170
|
+
handleShortcut: (item: string | import("../../shared/types").AnyObject) => void;
|
175
171
|
resetCurrentCommand: () => void;
|
176
172
|
handleKeyDown: (event: KeyboardEvent) => void;
|
177
173
|
isWrap: (event: KeyboardEvent) => boolean;
|
@@ -315,7 +311,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
315
311
|
isActive: import("vue").Ref<boolean>;
|
316
312
|
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
317
313
|
formattedTime: import("vue").ComputedRef<string>;
|
318
|
-
checkEnvironment: () => boolean;
|
319
314
|
start: () => Promise<void>;
|
320
315
|
handlePause: () => void;
|
321
316
|
handlePlay: () => void;
|
@@ -334,7 +329,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
334
329
|
show: boolean;
|
335
330
|
}>;
|
336
331
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
337
|
-
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<{}>>, {}>;
|
338
332
|
ChatRight: import("vue").DefineComponent<{}, {
|
339
333
|
medicalLabel: {
|
340
334
|
key: string;
|
@@ -349,7 +343,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
349
343
|
handleSave: () => Promise<void>;
|
350
344
|
createMedicalRecord: () => void;
|
351
345
|
extractContentByTitle: () => import("../../shared/types").AnyObject;
|
352
|
-
NIcon: any;
|
353
346
|
NSpace: any;
|
354
347
|
NButton: any;
|
355
348
|
Editor: SFCWithInstall<import("vue").DefineComponent<{
|
@@ -386,9 +379,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
386
379
|
}>> & {}, {
|
387
380
|
isDisabled: boolean;
|
388
381
|
}>>;
|
389
|
-
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<{}>>, {}>;
|
390
382
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
391
|
-
},
|
383
|
+
ChatMainDefault: 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<{}>>, {}>;
|
384
|
+
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<{}>>, {}>;
|
385
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("button-click" | "program")[], "button-click" | "program", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
392
386
|
token: {
|
393
387
|
type: StringConstructor;
|
394
388
|
required: true;
|
@@ -449,6 +443,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
449
443
|
};
|
450
444
|
}>> & {
|
451
445
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
446
|
+
onProgram?: ((...args: any[]) => any) | undefined;
|
452
447
|
}, {
|
453
448
|
hideInput: boolean;
|
454
449
|
uiStyle: string;
|
@@ -123,18 +123,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
123
123
|
};
|
124
124
|
}>> & {
|
125
125
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
126
|
+
onProgram?: ((...args: any[]) => any) | undefined;
|
126
127
|
}>>;
|
127
|
-
emit: (event: "button-click", ...args: any[]) => void;
|
128
|
-
showSmallStyle: import("vue").ComputedRef<boolean>;
|
128
|
+
emit: (event: "button-click" | "program", ...args: any[]) => void;
|
129
129
|
state: AnyObject;
|
130
|
+
onClose: () => void;
|
131
|
+
NIcon: any;
|
132
|
+
NButton: any;
|
130
133
|
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<{}>>, {}>;
|
131
134
|
ChatFooter: import("vue").DefineComponent<{}, {
|
132
|
-
innerDefaultShortcutList: {
|
133
|
-
key: string;
|
134
|
-
value: string;
|
135
|
-
}[];
|
136
|
-
programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
|
137
|
-
MedicalOrderId: string;
|
138
135
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
139
136
|
audioSdk: import("../..").CAudioSDK;
|
140
137
|
emit: (event: string, ...args: any[]) => void;
|
@@ -143,7 +140,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
143
140
|
isSmall: any;
|
144
141
|
audioTimed: any;
|
145
142
|
commandList: any;
|
146
|
-
|
143
|
+
isDefault: any;
|
147
144
|
patientInfo: any;
|
148
145
|
inputRef: import("vue").Ref<any>;
|
149
146
|
showPopover: import("vue").Ref<boolean>;
|
@@ -166,14 +163,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
166
163
|
showPatient: import("vue").Ref<boolean>;
|
167
164
|
showAudio: import("vue").Ref<boolean>;
|
168
165
|
placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
|
166
|
+
isAllDisabled: import("vue").ComputedRef<any>;
|
169
167
|
btnDisabled: import("vue").ComputedRef<any>;
|
170
168
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
171
169
|
patient: import("vue").ComputedRef<string>;
|
172
|
-
currentShortcutList: import("vue").ComputedRef<any>;
|
173
|
-
isAllDisabled: import("vue").ComputedRef<any>;
|
174
170
|
recorderStart: () => Promise<void>;
|
175
171
|
getShortcutName: (item: string | AnyObject) => any;
|
176
|
-
handleShortcut: (item: string | AnyObject) =>
|
172
|
+
handleShortcut: (item: string | AnyObject) => void;
|
177
173
|
resetCurrentCommand: () => void;
|
178
174
|
handleKeyDown: (event: KeyboardEvent) => void;
|
179
175
|
isWrap: (event: KeyboardEvent) => boolean;
|
@@ -317,7 +313,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
317
313
|
isActive: import("vue").Ref<boolean>;
|
318
314
|
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
319
315
|
formattedTime: import("vue").ComputedRef<string>;
|
320
|
-
checkEnvironment: () => boolean;
|
321
316
|
start: () => Promise<void>;
|
322
317
|
handlePause: () => void;
|
323
318
|
handlePlay: () => void;
|
@@ -336,7 +331,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
336
331
|
show: boolean;
|
337
332
|
}>;
|
338
333
|
}, {}, {}, {}, 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
334
|
ChatRight: import("vue").DefineComponent<{}, {
|
341
335
|
medicalLabel: {
|
342
336
|
key: string;
|
@@ -351,7 +345,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
351
345
|
handleSave: () => Promise<void>;
|
352
346
|
createMedicalRecord: () => void;
|
353
347
|
extractContentByTitle: () => AnyObject;
|
354
|
-
NIcon: any;
|
355
348
|
NSpace: any;
|
356
349
|
NButton: any;
|
357
350
|
Editor: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
@@ -388,9 +381,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
388
381
|
}>> & {}, {
|
389
382
|
isDisabled: boolean;
|
390
383
|
}>>;
|
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<{}>>, {}>;
|
392
384
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
393
|
-
},
|
385
|
+
ChatMainDefault: 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<{}>>, {}>;
|
386
|
+
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<{}>>, {}>;
|
387
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("button-click" | "program")[], "button-click" | "program", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
394
388
|
token: {
|
395
389
|
type: StringConstructor;
|
396
390
|
required: true;
|
@@ -451,6 +445,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
451
445
|
};
|
452
446
|
}>> & {
|
453
447
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
448
|
+
onProgram?: ((...args: any[]) => any) | undefined;
|
454
449
|
}, {
|
455
450
|
hideInput: boolean;
|
456
451
|
uiStyle: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as
|
1
|
+
import{defineComponent as t,reactive as e,provide as o,toRefs as i,computed as s,openBlock as a,createElementBlock as r,normalizeStyle as n,unref as l,normalizeClass as u,createElementVNode as p,createBlock as d,createCommentVNode as h,withDirectives as m,vShow as c,createVNode as y,withCtx as f,renderSlot as g}from"vue";import{NButton as v,NIcon as S}from"naive-ui";import w from"./components/ChatMain.js";import R from"./components/ChatFooter.vue.js";import k from"./components/ChatRight.vue.js";import j from"./components/ChatMainDefault.js";import{useTheme as I}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as x}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{CloseOutline as C}from"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as P,InjectionAIChatEmits as b}from"./types/index.js";import{axiosInstance as q}from"./api/index.js";import{useWebsocket as A}from"./hooks/useWebsocket.js";const D=["id"],F={class:"chat-right-wrapper"},L={class:"header"},M={class:"content"},_={class:"slot-wrapper"};var z=t({__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:"default"},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","program"],setup(t,{expose:z,emit:B}){const T=t,H=I();q.defaults.headers.Authorization="bearer "+T.token;const N=e({id:"ai-chat-"+x(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,showRightSlot:!1});function O(){N.showRight=!1,N.showRightSlot=!1}return o(P,{...i(T),state:N,isSmall:s((()=>"small"===T.uiStyle)),isDefault:s((()=>"default"===T.uiStyle)),vaa07:s((()=>{var t,e;return null==(e=null==(t=T.patientInfo)?void 0:t.info)?void 0:e.vaa07})),axiosInstance:q}),o(b,B),"default"===T.uiStyle&&A(T,N),z({pushMessage:t=>{N.externalData=t},updatePatientInfo:t=>{N.selectedPatient=t},showRight(t){N.showRight=!1,N.showRightSlot=t}}),(e,o)=>(a(),r("div",{style:n(l(H)),class:u(["ai-chat","small"===t.uiStyle?"ai-chat--small":""])},[p("div",{id:N.id,class:"chat-left-wrapper"},["default"===t.uiStyle?(a(),d(l(j),{key:0})):(a(),d(l(w),{key:1})),t.hideInput?h("v-if",!0):(a(),d(R,{key:2}))],8,D),m(p("div",F,[p("div",L,[m(p("h4",null,"问诊记录",512),[[c,N.showRight]]),y(l(v),{quaternary:"",onClick:O},{icon:f((()=>[y(l(S),{size:"20",component:l(C)},null,8,["component"])])),_:1})]),p("div",M,[m(y(k,null,null,512),[[c,N.showRight]]),m(p("div",_,[g(e.$slots,"chat-right")],512),[[c,N.showRightSlot]])])],512),[[c,N.showRight||N.showRightSlot]])],6))}});export{z as default};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
|
-
export declare const
|
3
|
-
export declare function uploadFileApi(params: FormData): import("axios").AxiosPromise<any>;
|
2
|
+
export declare const axiosInstance: import("axios").AxiosInstance;
|
4
3
|
export declare function conversationApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
5
4
|
export declare function saveApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
6
5
|
export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
|
@@ -1 +1 @@
|
|
1
|
-
import e from"axios";import{$message as t}from"../utils/index.js";const
|
1
|
+
import e from"axios";import{$message as t}from"../utils/index.js";const o=e.create({withCredentials:!0,timeout:5e3});function s(e){return o({method:"post",url:"/flow/api/opd/conversation",data:e})}function a(e){return o({method:"put",url:"/flow/api/opd/message",data:e})}function r(e){return o({method:"get",url:`/flow/api/dialog/${e.sessionId}/messages`,params:{page:e.page||1,pageSize:e.pageSize||20}})}o.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})),o.interceptors.response.use((e=>{var o,s,a,r,i;return(null==(o=e.config.url)?void 0:o.includes("/options"))?(null==(s=e.data)?void 0:s.success)?e.data:{success:!1,data:[]}:(null==(a=e.data)?void 0:a.success)?null==(r=e.data)?void 0:r.data:void(!(null==(i=e.data)?void 0:i.success)&&e.data.msg?t.error(e.data.msg):console.log("请求错误"))}));export{o as axiosInstance,s as conversationApi,r as getHistoryRecordApi,a as saveApi};
|
@@ -23,7 +23,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
23
|
isActive: import("vue").Ref<boolean>;
|
24
24
|
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
25
25
|
formattedTime: import("vue").ComputedRef<string>;
|
26
|
-
checkEnvironment: () => boolean;
|
27
26
|
start: () => Promise<void>;
|
28
27
|
handlePause: () => void;
|
29
28
|
handlePlay: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as o,inject as
|
1
|
+
import{defineComponent as o,inject as t,ref as e,computed as a,watch as i,onBeforeUnmount as n,withDirectives as r,openBlock as s,createElementBlock as u,unref as l,createBlock as d,createCommentVNode as c,createElementVNode as m,toDisplayString as p,normalizeStyle as f,createVNode as v,withCtx as w,createTextVNode as h,vShow as g}from"vue";import{NIcon as y,NSpace as k,NButton as S}from"naive-ui";import{StopCircleOutline as _}from"@vicons/ionicons5";import{InjectionAIChat as x}from"../types/index.js";import{useIntervalFn as C,promiseTimeout as F}from"@vueuse/core";import"../../../audio-sdk/index.js";import{$message as $}from"../utils/index.js";import j from"../../../audio-sdk/src/audioSDK.js";const T={class:"ai-chat-audio"};var M=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:M}){const z=o,A=j.create(),{state:B,vaa07:R,immediatelyRecording:q}=t(x),D=e(0);let K="";const{pause:L,resume:b,isActive:E}=C((()=>{D.value++}),1e3,{immediate:!1}),G=a((()=>E.value?"正在录音中...":"录音已暂停")),H=a((()=>{const o=Math.floor(D.value/3600),t=Math.floor(D.value%3600/60),e=D.value%60,a=t.toString().padStart(2,"0"),i=e.toString().padStart(2,"0");if(o>0){return`${o.toString().padStart(2,"0")}:${a}:${i}`}return`${a}:${i}`}));function I(){L(),A.pause()}function J(){b(),A.resume()}async function N(o){K=o||"",null==A||A.stop(),M("update:show",!1)}return i((()=>z.show),(o=>{o?(K="",D.value=0,b(),async function(){try{const o=await A.start({timed:1800,showModal:!1,realTimeRecognition:!1});if(M("update:show",!1),"click"!==K)return;const{result:t,data:e}=o||{};if("success"!==t)return;e&&(B.params={audioText:e,opType:"create_inquiry"},B.sendContent=e,B.sending=!0,B.loading=!0,B.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}catch(o){console.log(o),M("update:show",!1),"fail"===(null==o?void 0:o.result)&&o.msg&&$.warning(o.msg)}}()):L()}),{immediate:!0}),i((()=>R.value),(async o=>{const t=z.show;z.show&&N(),q.value&&(t&&await F(10),M("update:show",!0))}),{immediate:!0}),n((()=>{j.destroy()})),(t,e)=>r((s(),u("div",T,[l(E)?c("v-if",!0):(s(),d(l(y),{key:0,size:"42",color:"#FF1818",component:l(_)},null,8,["component"])),m("p",null,p(l(G)),1),m("h3",{style:f(l(E)?"":"color: #FF1818")},p(l(H)),5),v(l(k),{"wrap-item":!1,size:15},{default:w((()=>[r(v(l(S),{round:"",onClick:I},{default:w((()=>[h("暂停")])),_:1},512),[[g,l(E)]]),r(v(l(S),{round:"",onClick:J},{default:w((()=>[h("继续")])),_:1},512),[[g,!l(E)]]),v(l(S),{round:"",color:"#FF1818",onClick:e[0]||(e[0]=()=>N("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{M 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
|
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 k=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:k,slots:x,emit:C}){const _={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},T=y(),{patientInfo:P,state:w,axiosInstance:O,isSmall:S,appId:j}=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&&C("button-click",{buttonInfo:a,isBI:!0})}function D(e){B[e.button.id+"Disabled"]="1",C("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&&!S.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.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:S.value?"inner":"global",...S.value?{appId:j.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=P.value.info||w.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||(w.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=w.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])})),w.loading=!0,C("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){w.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(){C("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:T.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return o((()=>w.showPatient),(t=>{!e.msgItem.disabled&&q.value&&!t&&w.selectedPatientLabel&&L.value&&(N.vaa05=w.selectedPatientLabel,L.value.selectedPatient={...w.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(E,{"request-instance":{get:O.get,post:O.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 C("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{k as default};
|
@@ -2,12 +2,6 @@ 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;
|
11
5
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
12
6
|
audioSdk: CAudioSDK;
|
13
7
|
emit: (event: string, ...args: any[]) => void;
|
@@ -16,7 +10,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
16
10
|
isSmall: any;
|
17
11
|
audioTimed: any;
|
18
12
|
commandList: any;
|
19
|
-
|
13
|
+
isDefault: any;
|
20
14
|
patientInfo: any;
|
21
15
|
inputRef: import("vue").Ref<any>;
|
22
16
|
showPopover: import("vue").Ref<boolean>;
|
@@ -39,14 +33,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
39
33
|
showPatient: import("vue").Ref<boolean>;
|
40
34
|
showAudio: import("vue").Ref<boolean>;
|
41
35
|
placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
|
36
|
+
isAllDisabled: import("vue").ComputedRef<any>;
|
42
37
|
btnDisabled: import("vue").ComputedRef<any>;
|
43
38
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
44
39
|
patient: import("vue").ComputedRef<string>;
|
45
|
-
currentShortcutList: import("vue").ComputedRef<any>;
|
46
|
-
isAllDisabled: import("vue").ComputedRef<any>;
|
47
40
|
recorderStart: () => Promise<void>;
|
48
41
|
getShortcutName: (item: string | AnyObject) => any;
|
49
|
-
handleShortcut: (item: string | AnyObject) =>
|
42
|
+
handleShortcut: (item: string | AnyObject) => void;
|
50
43
|
resetCurrentCommand: () => void;
|
51
44
|
handleKeyDown: (event: KeyboardEvent) => void;
|
52
45
|
isWrap: (event: KeyboardEvent) => boolean;
|
@@ -190,7 +183,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
190
183
|
isActive: import("vue").Ref<boolean>;
|
191
184
|
tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
|
192
185
|
formattedTime: import("vue").ComputedRef<string>;
|
193
|
-
checkEnvironment: () => boolean;
|
194
186
|
start: () => Promise<void>;
|
195
187
|
handlePause: () => void;
|
196
188
|
handlePlay: () => void;
|
@@ -1 +1 @@
|
|
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};
|
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 j,NInput as I,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"../../../audio-sdk/index.js";import{cloneDeep as U,isString as A,last as R}from"lodash-es";import{useTheme as F}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 N from"./ChatPatient.vue.js";import V from"./ChatAudio.vue.js";import q from"../../../audio-sdk/src/audioSDK.js";const H={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),O={key:0,class:"btn-box"},Q=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),X=["disabled"],Y={class:"command-box"},Z={class:"command-box__header"},$={key:0,class:"title"},ee={class:"command-box__menu"},oe=["onMouseover","onClick"],ne={class:"label"},te={class:"remark"};var le=e({__name:"ChatFooter",setup(e){const le=F(),ae=q.create(),ie=o(K),{shortcutList:se,state:re,isSmall:de,audioTimed:ue,commandList:ce,isDefault:ve,patientInfo:me}=o(L),he=n(),pe=n(!1),fe=n([]),ke=n(U(ce.value||[])),we=n(!1),ge=n(""),ye=n(!1),Ce=n(!1),be=t((()=>ve.value?"请向我提问,Shift+Enter换行":de?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),xe=t((()=>{var e,o;return ve.value&&1!==(null==(o=null==(e=me.value)?void 0:e.info)?void 0:o.vac34)})),_e=t((()=>xe.value||re.loading||!re.sendContent.replace(/( |\s|<br>)+/g,""))),je=t((()=>{var e;return!re.sendContent&&!(null==(e=he.value)?void 0:e.activated.value)})),Ie=t((()=>{var e,o;if(!re.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:n,vaa05:t}=re.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}));async function ze(){try{const e=await ae.start({instance:b(),allowPunctuationMark:!1,timed:ue.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;re.sendContent=e.data||""}catch(e){console.log(e)}}function Me(e){var o;if(A(e))return e;if(ve.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 Te(){var e;pe.value=!1,ke.value=U(ce.value||[]),fe.value=[],(null==(e=ce.value)?void 0:e.length)&&(pe.value=!0,ge.value=ke.value[0].shortcutId)}function Pe(e){if(ve.value)"Enter"!==e.key||De(e)||Be();else if(!["Slash","NumpadDivide"].includes(e.code)||re.selectedCommand||re.sendContent)if("Backspace"===e.key)pe.value=!1,!re.sendContent.startsWith("/")&&!re.sendContent.startsWith("、")||2!==re.sendContent.length||re.selectedCommand?!re.sendContent&&re.selectedCommand&&(e.preventDefault(),re.selectedCommand=null,re.sendContent="/",Te()):Te();else if(pe.value&&["ArrowUp","ArrowDown"].includes(e.key)){const o=ke.value.findIndex((e=>e.shortcutId===ge.value));if("ArrowUp"===e.key){const e=o>0?o-1:ke.value.length-1;ge.value=ke.value[e].shortcutId}else if("ArrowDown"===e.key){const e=o<ke.value.length-1?o+1:0;ge.value=ke.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!De(e))if(e.preventDefault(),pe.value){Ee(ke.value.find((e=>e.shortcutId===ge.value)))}else Be()}else pe.value=!1;else Te()}function De(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Se(e){!e&&re.selectedPrompt&&(re.selectedPrompt=null)}function Be(){_e.value||(re.sending=!0,re.loading=!0)}function Ee(e){var o;ge.value=e.shortcutId,he.value.focus(),(null==(o=e.children)?void 0:o.length)?(ke.value=e.children,ge.value=ke.value[0].shortcutId,fe.value.push(e)):(re.selectedCommand=e||{},pe.value=!1,re.sendContent="")}function Ke(){var e;fe.value.pop(),ke.value=R(fe.value)?null==(e=R(fe.value))?void 0:e.children:U(ce.value||[]),ge.value=ke.value[0].shortcutId,he.value.focus()}function Le(e){e||(re.showPatient=!1)}return l((()=>{q.destroy()})),a((()=>re.showPatient),(e=>{e&&(ye.value=e)})),(e,o)=>(i(),s("section",{class:r(["chat-footer-wrapper",{"is-small":d(de)}])},[u("div",{class:r(["chat-footer",d(re).loading?"disabled":""])},[u("div",H,[d(de)||d(ve)?f("v-if",!0):(i(),c(d(x),{key:0,secondary:"",size:"small",onClick:o[0]||(o[0]=()=>ye.value=!0)},{icon:v((()=>[m(d(_),{color:d(le)["--c-primary-color"],size:"20",component:d(P)},null,8,["color","component"])])),default:v((()=>[h(" "+p(d(Ie)),1)])),_:1})),d(se)&&d(se).length>0?(i(!0),s(k,{key:1},w(d(se),(e=>(i(),c(d(x),{secondary:"",size:"small",style:g(d(de)?"background: #fff":""),round:d(de),key:Me(e),disabled:d(xe),onClick:()=>function(e){var o;if(A(e))re.sendContent=e;else{if(ve.value&&e.key)return void(["recommend_treatment_plan","recommend_examination","recommend_diagnosis"].includes(e.key)?(re.params={opType:e.key},re.sending=!0,re.loading=!0,re.loadingText="","recommend_treatment_plan"===e.key?re.loadingText="参考诊断结果与患者个体信息,正全面梳理知识库和临床指南,综合考量为您匹配最适宜的诊疗方案推荐":"recommend_examination"===e.key&&(re.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目")):ie("program",{key:e.key}));const n=null==(o=null==e?void 0:e.contents)?void 0:o[0];ie("button-click",{msgItem:n,item:e})}}(e)},{default:v((()=>[h(p(Me(e)),1)])),_:2},1032,["style","round","disabled","onClick"])))),128)):f("v-if",!0)]),m(d(j),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:pe.value,onClickoutside:o[4]||(o[4]=e=>pe.value=!1)},{trigger:v((()=>[u("div",G,[m(d(I),{ref_key:"inputRef",ref:he,placeholder:d(be),type:"textarea",autosize:{minRows:d(de)?1:2,maxRows:7},disabled:d(xe)||d(re).loading,value:d(re).sendContent,"onUpdate:value":o[2]||(o[2]=e=>d(re).sendContent=e),onKeydownCapture:Pe,onInput:Se},y({_:2},[d(ve)?void 0:{name:"prefix",fn:v((()=>[d(re).selectedCommand&&d(re).selectedCommand.shortcutTitle?(i(),c(d(z),{key:0,bordered:!1,color:{textColor:d(le)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(d(re).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):d(je)?(i(),c(d(x),{key:1,text:"",onClick:o[1]||(o[1]=()=>we.value=!0)},{default:v((()=>[m(d(_),{color:"#8f66f7",size:"18",component:d(D)},null,8,["component"])])),_:1})):f("v-if",!0)])),key:"0"},d(de)?{name:"suffix",fn:v((()=>[m(d(x),{text:"",disabled:d(re).loading,onClick:ze},{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(_e),onClick:Be},{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(de)?f("v-if",!0):(i(),s("div",O,[d(ve)?(i(),c(d(x),{key:0,text:"",disabled:d(xe)||Ce.value||d(re).loading,onClick:o[3]||(o[3]=e=>Ce.value=!0)},{icon:v((()=>[m(d(_),{size:"38"},{default:v((()=>[Q])),_:1})])),_:1},8,["disabled"])):f("v-if",!0),u("span",{class:r(["btn-send","gradient","fillet-8",d(_e)?"disabled":""]),disabled:d(_e),onClick:Be},[m(d(_),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,X)]))])])),default:v((()=>{var e;return[u("div",Y,[u("div",Z,[0===fe.value.length?(i(),s("span",$,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(i(),s(k,{key:1},[m(d(x),{text:"",onClick:Ke},{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(fe.value,(e=>(i(),c(d(T),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",ee,[(i(!0),s(k,null,w(ke.value,(e=>(i(),s("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",ge.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>ge.value=e.shortcutId),["stop"]),onClick:()=>Ee(e)},[u("span",ne,p(e.shortcutTitle),1),u("span",te,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,oe)))),128))])])]})),_:1},8,["show"]),d(ve)?f("v-if",!0):(i(),c(W,{key:0,show:we.value,"onUpdate:show":o[5]||(o[5]=e=>we.value=e)},null,8,["show"])),d(ve)?f("v-if",!0):(i(),c(N,{key:1,show:ye.value,"onUpdate:show":[o[6]||(o[6]=e=>ye.value=e),Le]},null,8,["show"])),d(ve)?(i(),c(V,{key:2,show:Ce.value,"onUpdate:show":o[7]||(o[7]=e=>Ce.value=e)},null,8,["show"])):f("v-if",!0)],2)],2))}});export{le as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as w,has as b}from"lodash-es";import{uuidGenerator as y}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import I from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function k(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var L=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:u,slots:L,emit:T}){const B=n(m),{userAvatar:E,queryData:P,state:S,queryRecord:z,defaultShortcutList:M,hideInput:D=!1,isSmall:O}=n(g),A=t(null),q=t([]),H=t(!1),N=t(!1),R=t(),U=l((()=>O.value?f:p)),_={page:0,hasMore:!0};async function F(e=!1){if(!_.hasMore)return;_.page++,1==_.page&&(q.value=[]);const{records:n,rows:t}=await z.value({page:_.page});h(t)&&q.value.length<=+n&&(q.value=_.page>1?[...q.value,...t]:t,K(),q.value.length>=+n&&(e&&(H.value=!0),_.hasMore=!1,console.log("没有更多消息了")))}async function J(){var e,n;q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),null==(e=A.value)||e.scrollTo({top:0,behavior:"auto"}),K();const t=S.selectedCommand,l=S.selectedPrompt;S.selectedCommand=null,S.selectedPrompt=null;const o=await P.value({content:S.sendContent,contentType:"text",command:t,prompt:l,patient:S.selectedPatient});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await i(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),S.selectedPatientLabel="",S.selectedPatientForm=null,S.sending=!1,S.loading=!1,S.sendContent=""}function G(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)G(e.childrens[l],n,t)}else t.push(e)}function K(){q.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!j(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{G(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function Q(e,n,t,l){const{contentType:o,content:a}=n;return"json"===o&&a?s(I,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(R.value={item:t,msgItem:l},void(N.value=!0)):l?(B("button-click",e),void(l.disabled=!0)):void(t.link||(S.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",S.sending=!0,S.loading=!0))}({item:e,msgItem:n,...t})},null):null}function V(e,n){const{contents:t=[],buttonType:l="",configs:o={},msgId:a=""}=e,i=Q(e,t[n],o,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)]))]}function W({role:e=""}){return"user"===e}function X(){var e,n;let t;return s("div",{class:"message-item"},[s(r,{round:!0,size:O.value?64:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),s("p",null,[a("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),a("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[a((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.195"))||"你可以试着问我:")]),s(c,{"wrap-item":!1},k(t=M.value.map((e=>s(v,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.loading},k(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return C(A,(()=>{F()}),D.value?"bottom":"top"),F(!0),o((()=>S.externalData),(e=>{var n,t;e&&(b(n=e,"msgId")||(n.msgId=y()),q.value.unshift(n),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),S.loading=!1,S.externalData=null)})),o((()=>S.sending),(e=>{var n,t,l,o,s,a,i;if(e){if(q.value.length>0&&[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.428"))||"确认",(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定"].includes(S.sendContent)){const e=null==(s=null==(l=q.value[0])?void 0:l.contents)?void 0:s[(null==(o=q.value[0].contents)?void 0:o.length)-1];return(null==(a=e.content)?void 0:a.body)&&!e.disabled?(null==(i=document.getElementById(q.value[0].msgId))||i.click(),void setTimeout((()=>{q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),S.selectedCommand=null,S.selectedPrompt=null,S.sending=!1,S.sendContent=""}))):void J()}J()}})),()=>[s("section",{class:"chat-main",ref:A,style:{"flex-direction":D.value?"column":"column-reverse"}},[[S.loading?s("div",{class:"message-item"},[[O.value?null:s(r,{round:!0,size:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[a("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item",key:e.msgId+t},[[O.value?null:s(r,{round:!0,size:40,src:W(n)?E.value:U.value},null),s("div",{class:["content-box",W(n)?"mine":""]},[s("div",{class:"content"},[w(n.render)?n.render():V(e,t)])])]]))))),H.value?X():null]]),s(x,{show:N.value,"onUpdate:show":e=>N.value=e,data:R.value},null)]}});export{L as default};
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as w,has as b}from"lodash-es";import{uuidGenerator as y}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import I from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function k(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var L=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:u,slots:L,emit:T}){const B=n(m),{userAvatar:E,queryData:P,state:S,queryRecord:z,defaultShortcutList:M,hideInput:D=!1,isSmall:O}=n(g),A=t(null),q=t([]),H=t(!1),N=t(!1),R=t(),U=l((()=>O.value?f:p)),_={page:0,hasMore:!0};async function F(e=!1){if(!_.hasMore)return;_.page++,1==_.page&&(q.value=[]);const{records:n,rows:t}=await z.value({page:_.page});h(t)&&q.value.length<=+n&&(q.value=_.page>1?[...q.value,...t]:t,K(),q.value.length>=+n&&(e&&(H.value=!0),_.hasMore=!1,console.log("没有更多消息了")))}async function J(){var e,n;q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),null==(e=A.value)||e.scrollTo({top:0,behavior:"auto"}),K();const t=S.selectedCommand,l=S.selectedPrompt;S.selectedCommand=null,S.selectedPrompt=null;const o=await P.value({content:S.sendContent,contentType:"text",command:t,prompt:l,patient:S.selectedPatient});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await i(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),S.selectedPatientLabel="",S.selectedPatientForm=null,S.sending=!1,S.loading=!1,S.sendContent=""}function G(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)G(e.childrens[l],n,t)}else t.push(e)}function K(){q.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!j(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{G(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function Q(e,n,t,l){const{contentType:o,content:a}=n;return"json"===o&&a?s(I,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(R.value={item:t,msgItem:l},void(N.value=!0)):l?(B("button-click",e),void(l.disabled=!0)):void(t.link||(S.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",S.sending=!0,S.loading=!0))}({item:e,msgItem:n,...t})},null):null}function V(e,n){const{contents:t=[],buttonType:l="",configs:o={},msgId:a=""}=e,i=Q(e,t[n],o,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)]))]}function W({role:e=""}){return"user"===e}function X(){var e,n;let t;return s("div",{class:"message-item"},[s(r,{round:!0,size:O.value?64:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),s("p",null,[a("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),a("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[a((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.195"))||"你可以试着问我:")]),s(c,{"wrap-item":!1},k(t=M.value.map((e=>s(v,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.loading},k(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return C(A,(()=>{F()}),D.value?"bottom":"top"),F(!0),o((()=>S.externalData),(e=>{var n,t;e&&(b(n=e,"msgId")||(n.msgId=y()),q.value.unshift(n),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),S.loading=!1,S.externalData=null)})),o((()=>S.sending),(e=>{var n,t,l,o,s,a,i;if(e){if(q.value.length>0&&[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.428"))||"确认",(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定"].includes(S.sendContent)){const e=null==(s=null==(l=q.value[0])?void 0:l.contents)?void 0:s[(null==(o=q.value[0].contents)?void 0:o.length)-1];return(null==(a=e.content)?void 0:a.body)&&!e.disabled?(null==(i=document.getElementById(q.value[0].msgId))||i.click(),void setTimeout((()=>{q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),S.selectedCommand=null,S.selectedPrompt=null,S.sending=!1,S.sendContent=""}))):void J()}J()}})),()=>[s("section",{class:"chat-main-wrapper",ref:A},[s("div",{class:"chat-main",style:{"flex-direction":D.value?"column":"column-reverse"}},[[S.loading?s("div",{class:"message-item"},[[O.value?null:s(r,{round:!0,size:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[a("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item",key:e.msgId+t},[[O.value?null:s(r,{round:!0,size:40,src:W(n)?E.value:U.value},null),s("div",{class:["content-box",W(n)?"mine":""]},[s("div",{class:"content"},[w(n.render)?n.render():V(e,t)])])]]))))),H.value?X():null]]),s(x,{show:N.value,"onUpdate:show":e=>N.value=e,data:R.value},null)])]}});export{L as 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 c}from"naive-ui";import{InjectionAIChatEmits as u,InjectionAIChat as d}from"../types/index.js";import{isArray as p,cloneDeep as v,isFunction as m}from"lodash-es";import{uuidGenerator as g}from"../../../../shared/utils/index.js";import"@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 _}from"../api/index.js";var T=e({name:"ChatMain",inheritAttrs:!1,components:{JsonCard:y},setup(e,{attrs:y,slots:T,emit:j}){const C=n(u),{patientInfo:b,state:w,vaa07:q}=n(d),k=t(null),I=t([]),M={page:0,hasMore:!0};async function S(){if(!q.value)return;if(!M.hasMore||!q.value)return;M.page++,1==M.page&&(I.value=[]);const e=await x({sessionId:q.value,page:M.page,pageSize:20}),{rows:n,query:t={}}=e||{};p(n)&&(n.forEach((e=>{p(e.contents)&&e.contents.length>1&&e.contents.reverse()})),I.value.length<=+t.records&&(I.value=M.page>1?[...I.value,...n]:n,I.value.length>=+t.records&&(M.hasMore=!1,console.log("没有更多消息了"))))}async function R(e){var n,t;if(p(e.contents)){I.value.unshift(e),await s();const o=(null==(n=k.value)?void 0:n.scrollHeight)||0;null==(t=k.value)||t.scrollTo({top:o,behavior:"auto"})}}function H(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 J(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 O(e,n){var t,o,s,u,d;const{contents:p=[],msgId:v=""}=e;return"json"===(null==(t=p[n])?void 0:t.contentType)?"retry_inquiry"===(null==(o=p[n])?void 0:o.messageType)?[J((null==(u=null==(s=p[n])?void 0:s.content)?void 0:u.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=p[n])?void 0:e.content)?void 0:t.audioUrl,w.params={audioUrl:o,opType:"create_inquiry"},w.sending=!0,w.loading=!0,void(w.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}},{icon:()=>r(c,{component:h},null)})})]:function(e,n){return r(a("json-card"),{item:e,messageItem:n},null)}(e,p[n]):J((null==(d=p[n])?void 0:d.content)||"")}function U({role:e=""}){return"user"===e}return f(k,(()=>{S()}),"top"),o((()=>q.value),(e=>{w.showRight=!1,I.value=[],M.page=0,M.hasMore=!0,S()}),{immediate:!0}),o((()=>w.reportContent),(e=>{e&&(R(e),w.reportContent=null)})),o((()=>w.sending),(async e=>{var n,t,o,r,s,a,l,i;if(e){const{opType:e}=w.params||{};!e&&w.sendContent&&I.value.unshift({msgId:g(),contents:[{role:"user",content:w.sendContent}]});const c=(null==(n=k.value)?void 0:n.scrollHeight)||0;if(null==(t=k.value)||t.scrollTo({top:c,behavior:"auto"}),e&&["recommend_treatment_plan","recommend_diagnosis","recommend_examination"].includes(e)){if(I.value.length>0){const e=I.value.find((e=>{var n;return!U(null==(n=null==e?void 0:e.contents)?void 0:n[0])}));e&&Object.assign(w.params,v(e))}Object.assign(w.params,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const n=await _({contents:[{role:"user",content:w.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:b.value.info,...w.params});["diagnosis","medical_order"].includes(e)&&w.showRightSlot&&C("program",{key:"medical",type:"refresh",params:{vac01:null==(r=null==(o=b.value)?void 0:o.info)?void 0:r.vac01,type:1}}),p(n.contents)&&n.contents.length>1&&n.contents.reverse(),R(n),e&&["create_inquiry","create_medical"].includes(e)&&("create_inquiry"===e?"retry_inquiry"!==(null==(a=null==(s=null==n?void 0:n.contents)?void 0:s[0])?void 0:a.messageType)&&(w.consultationContent=n,w.showRight=!0,w.showRightSlot=!1):C("program",{key:"medical",params:{vac01:null==(i=null==(l=b.value)?void 0:l.info)?void 0:i.vac01,type:1}})),e&&"create_inquiry"!==e||(w.sendContent=""),w.params={}}catch(e){console.log("error ==>",e)}finally{w.sending=!1,w.loading=!1,w.loadingText=""}}})),()=>[r("section",{class:"chat-main-wrapper",ref:k},[r("div",{class:"chat-main",style:"column-reverse"},[[w.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,[w.loadingText||"正在整合数据..."])])])]):null,I.value.map((e=>e.contents.map(((n,t)=>O(e,t)?r("div",{class:"message-item",key:e.msgId+t},[r("div",{class:["content-box",U(n)?"mine":""]},[r("div",{class:["content",{"content-json":!m(n.render)&&H(e,t)}]},[m(n.render)?n.render():O(e,t)])])]):null))))]])])]}});export{T as default};
|
@@ -13,7 +13,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
13
13
|
handleSave: () => Promise<void>;
|
14
14
|
createMedicalRecord: () => void;
|
15
15
|
extractContentByTitle: () => AnyObject;
|
16
|
-
NIcon: any;
|
17
16
|
NSpace: any;
|
18
17
|
NButton: any;
|
19
18
|
Editor: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
@@ -50,6 +49,5 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
50
49
|
}>> & {}, {
|
51
50
|
isDisabled: boolean;
|
52
51
|
}>>;
|
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
52
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
55
53
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,inject as
|
1
|
+
import{defineComponent as t,inject as e,reactive as n,ref as o,watch as l,withDirectives as i,openBlock as s,createElementBlock as a,createVNode as c,unref as r,withCtx as u,createTextVNode as y,vShow as d}from"vue";import{NSpace as p,NButton as f}from"naive-ui";import{InjectionAIChat as k}from"../types/index.js";import{$message as g}from"../utils/index.js";import _ from"../../../editor/index.js";import{saveApi as m}from"../api/index.js";const v={class:"ai-chat-right"};var j=t({__name:"ChatRight",setup(t){const j=[{key:"zs_yy",title:"主诉"},{key:"xbs_fuk",title:"现病史"},{key:"jws_vtk",title:"既往史"},{key:"patient_allergy_sync",title:"过敏史"},{key:"tgjcms_wsssss",title:"体格检查描述"},{key:"marriage",title:"婚姻状况"},{key:"nation",title:"民族"},{key:"profession",title:"职业"},{key:"jkzk_wyuu",title:"一般健康状况"},{key:"ryljlz_tbyvrt",title:"外长期居住史"},{key:"yjbz_qisf1",title:"饮酒标志"},{key:"gydwufcjfsxwzjcs_aogt_oietyntrrqk",title:"工业毒物、粉尘及放射性物质接触史"},{key:"yqtysjcs_ua_uirqk",title:"疫区、疫水接触史"},{key:"ryct_tbsw",title:"入院查体"},{key:"fzjclg_lessxj",title:"辅助检查结果"},{key:"o_hn_iyjc_hr",title:"互认回填"},{key:"cbzd_phyo",title:"初步诊断"},{key:"zljh_yuya",title:"诊疗计划"},{key:"wdcqjzs_qftanwk",title:"外地长期居住史"}],{state:h,patientInfo:w}=e(k),b=n({toolbarKeys:[]}),x=o("");async function C(){var t;try{const e=q();h.consultationContent.contents[0].content.details.autoBackFillData=e,await m({msgId:h.consultationContent.msgId,contents:h.consultationContent.contents,configs:null==(t=w.value)?void 0:t.info}),g.success("保存成功")}catch(t){console.log("error ==>",t)}}function z(){const t=q();console.log("json ==>",t,h.consultationContent),h.consultationContent.contents[0].content.details.autoBackFillData=t,h.params={opType:"create_medical",...h.consultationContent,contents:[{role:"user",content:"",contentType:"text"}],medicalInfo:h.consultationContent},h.sending=!0,h.loading=!0,h.loadingText="系统进入深度分析模式,正在整合数据,调取主诉,获取现病史、既往病史,读取过敏史,综合多维度信息生成诊断建议"}function q(){const t={};return j.forEach((e=>{const n=new RegExp(`<p><span.*?><strong>\\d+、${e.title}<\\/strong><\\/span><\\/p><p>(.*?)<\\/p>`,"i"),o=x.value.match(n);if(o&&o[1]){const n=o[1].trim();t[e.key]="<br>"===n?"":n}})),t}return l((()=>h.showRight),(t=>{var e,n,o,l;if(t){const{autoBackFillData:t}=(null==(l=null==(o=null==(n=null==(e=h.consultationContent)?void 0:e.contents)?void 0:n[0])?void 0:o.content)?void 0:l.details)||{};if(x.value="",!t)return;j.forEach(((e,n)=>{x.value+=`<p><span style="font-size: 16px;"><strong>${n+1}、${e.title}</strong></span></p><p><span>${t[e.key]||""}</span></p><p>${n<j.length-1?"<br>":""}`}))}else h.consultationContent=null})),(t,e)=>i((s(),a("div",v,[c(r(_),{"toolbar-config":b,modelValue:x.value,"onUpdate:modelValue":e[0]||(e[0]=t=>x.value=t)},null,8,["toolbar-config","modelValue"]),c(r(p),{class:"footer","wrap-item":!1},{default:u((()=>[c(r(f),{round:"",class:"gradient",disabled:r(h).loading,onClick:z},{default:u((()=>[y("审核完成")])),_:1},8,["disabled"]),c(r(f),{round:"",onClick:C},{default:u((()=>[y("暂存")])),_:1})])),_:1})],512)),[[d,r(h).showRight]])}});export{j as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as a,ref as i,computed as s,createVNode as l,resolveComponent as
|
1
|
+
import{defineComponent as e,inject as a,ref as i,computed as s,createVNode as l,resolveComponent as n,createTextVNode as t}from"vue";import{NSpace as o,NIcon as d,NImage as c,NButton as r}from"naive-ui";import m from"../../../../../shared/assets/img/file.png.js";import u from"../../../../../shared/assets/img/file-emr.png.js";import p from"../../../../../shared/assets/img/use.png.js";import{CheckmarkCircle as v}from"@vicons/ionicons5";import g from"./SelectIcon.js";import{InjectionAIChatEmits as f,InjectionAIChat as y}from"../../types/index.js";import{isArray as h,isString as b}from"lodash-es";var _=e({name:"ChatJsonCard",inheritAttrs:!1,props:{item:{type:Object,default:()=>({})},messageItem:{type:Object,default:()=>({})}},components:{NSpace:o,NIcon:d,NImage:c,SelectIcon:g},emits:[],setup(e,{attrs:o,slots:d,emit:c}){const g=a(f),{state:_,patientInfo:x}=a(y),{messageType:k,content:C}=e.messageItem,I=i([]),T=i([]),j=s((()=>{var e,a;return(null==(a=null==(e=x.value)?void 0:e.info)?void 0:a.vac01)||"1878974046080958465"})),N=s((()=>null==C?void 0:C.diagnosis)),w=s((()=>{var e;return"diagnosis_added"===k&&(null==(e=N.value)?void 0:e.length)})),S=s((()=>w.value||"medical_added"===k)),E=s((()=>"diagnosis"===k||"diagnosis_added"===k||"treatment_plan"===k));var q,D;"diagnosis_added"===k&&(I.value=null==(D=null==(q=C.recommendedExaminations)?void 0:q.map)?void 0:D.call(q,(e=>e.name)));const O=(e,a="name")=>{T.value.includes(e[a])?T.value=T.value.filter((i=>i!==e[a])):T.value.push(e[a])};function A(a,i){var s,l;null==(s=null==a?void 0:a.preventDefault)||s.call(a),null==(l=null==a?void 0:a.stopPropagation)||l.call(a);let n=i?[i]:[];arguments.length||(n=C.possibleConditions.filter((e=>T.value.includes(e.code)))),n.length&&(_.params={...e.item,opType:"diagnosis",contents:[{role:"user",content:"",contentType:"text"}],possibleConditions:n},_.sending=!0,_.loading=!0,_.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目")}async function J(a,i){var s,l;if(b(a)||(null==(s=null==a?void 0:a.preventDefault)||s.call(a),null==(l=null==a?void 0:a.stopPropagation)||l.call(a)),"edit"===a){const e=i?I.value.includes(i.name)?[i.name]:[]:[...I.value];g("program",{key:"medical_order",params:{bbx05List:JSON.stringify(e),vac01:j.value,type:3}})}else{let a=i?[i]:[];i||(a=C.recommendedExaminations.filter((e=>I.value.includes(e.name)))),_.params={...e.item,opType:"medical_order",contents:[{role:"user",content:"",contentType:"text"}],recommendedExaminations:a},_.sending=!0,_.loading=!0}}const P=async()=>{var e;const a=(null==(e=C.reports)?void 0:e[0])||{};g("program",{key:"report",params:{vaa07:j.value,reportType:a.reportType,reportId:a.reportId}})},L=async(e,a)=>{var i,s;null==(i=null==e?void 0:e.preventDefault)||i.call(e),null==(s=null==e?void 0:e.stopPropagation)||s.call(e);const l=a?[a.name]:T.value;g("program",{key:"recommend_treatment_plan",params:{drugNameList:JSON.stringify(l),vac01:j.value,type:3}})},z=e=>{if(!("diagnosis_added"===k?!I.value.length:!T.value.length))return"diagnosis"===k?A():"diagnosis_added"===k?J(e):"treatment_plan"===k?L():void 0};async function H(){"medical"===k?(async()=>{var e,a;g("program",{key:"medical",params:{vac01:null==(a=null==(e=x.value)?void 0:e.info)?void 0:a.vac01,type:1}})})():(_.consultationContent=e.item,_.showRight=!0)}const R=()=>l("div",{class:"diagnosis-added-box"},[l("div",{class:"recommended-wrap"},[l("div",{class:"title"},[t("检验检查推荐")]),C.recommendedExaminations.map((e=>l("div",{class:"recommended-item"},[l("div",{class:"top"},[l("div",{class:"left-tag"},[l("span",{class:["recommended-tag",{active:I.value.includes(e.name)}],onClick:()=>(e=>{I.value.includes(e.name)?I.value=I.value.filter((a=>a!==e.name)):I.value.push(e.name)})(e)},[e.name,l(n("select-icon"),{class:"select-icon",width:16},null)])]),l("img",{class:"right-icon",src:p,onClick:a=>J(a,e)},null)]),l("div",{class:"desc"},[e.description])])))])]);const W=()=>{if(!S.value)return null;return("medical_added"===k?[{}]:N.value).map((e=>l("div",{class:"card-header"},[l("span",{class:"left-title"},[l(n("n-icon"),{component:v},null),"medical_added"===k?"已完成申请单开立":`已添加诊断:${e.name}`]),"medical_added"===k?null:l("span",{class:"right-desc"},[t("创建时间: "),e.createdTime])])))},$=()=>{if(!E.value)return null;const e="diagnosis_added"===k?!I.value.length:!T.value.length;return l("div",{class:"card-footer"},[l("span",{class:"left-desc"},[t("请注意,推荐信息由AI生成,结果仅供临床参考")]),l("div",{class:"right-btns"},[l(r,{size:"large",disabled:e,onClick:()=>z("edit")},{default:()=>[t("编辑所选")]}),l("span",{class:["right-btn",{disabled:e}],onClick:()=>z()},[t("引用所选")])])])},B=()=>"inquiry"==k||"medical"==k?(()=>{var e,a;const i="inquiry"===k;return l("div",{class:"inquiry_medical-box",onClick:()=>H()},[l("div",{class:"left-img"},[l("img",{src:i?m:u},null)]),l("div",{class:"right-text"},[l("p",{class:"top-info"},[i?null==(e=C.summary)?void 0:e.inquiryStr:C.info]),l("p",{class:"sum-time"},[t("创建时间:"),(null==(a=C.summary)?void 0:a.creationTime)||C.creationTime])])])})():"diagnosis"==k?l("div",{class:"diagnosis-box"},[l("div",{class:"title"},[t("诊断辅助")]),l("div",{class:"desc"},[C.patientHistory]),C.possibleConditions.map((e=>l("div",{class:["con-item",{active:T.value.includes(e.code)}],onClick:()=>O(e,"code")},[l("div",{class:"top-content"},[l("div",{class:"left_wrap"},[l("a",{href:e.link,target:"_blank"},[t("【"),e.condition,t("】")]),e.code,t("("),e.probability,t(")")]),l("img",{class:"right-icon",src:p,onClick:a=>A(a,e)},null)]),l("div",{class:"btm-desc"},[e.description])])))]):"diagnosis_added"==k?R():"treatment_plan"==k?l("div",{class:"treatment-plan-box"},[l("div",{class:"top-div"},[l("div",{class:"title"},[C.title])]),l("div",{class:"desc"},[C.description]),l("div",{class:"medication-wrap"},[l("div",{class:"title"},[t("药物")]),C.medications.map((e=>l("div",{class:["medication-item",{active:T.value.includes(e.name)}],onClick:()=>O(e)},[l("div",{class:"top"},[l("div",{class:"name"},[e.name]),l("img",{class:"right-icon",src:p,onClick:a=>L(a,e)},null)]),l("ul",null,[l("li",null,[t("用量: "),e.dosage,e.purpose]),l("li",null,[t("用法: "),e.usageInstructions])])])))]),l("div",{class:"precaution-wrap"},[l("div",{class:"title"},[t("注意事项")]),l("div",{class:"precaution-div"},[C.precautions.map(((e,a)=>l("div",{class:"treatment-item"},[a+1,t(". "),e])))])])]):"report_message"==k?(()=>{var e,a;const i=(null==(e=C.reports)?void 0:e[0])||{},s=(null==(a=i.reportInterpretation)?void 0:a.replace(/\\n|\n|\r/g,"<br>").split("<br>"))||[""],o=s.map(((e,a)=>[e,a===s.length-1?null:l("br",null,null)]));return l("div",{class:"report-message-box"},[l("div",{class:"top-title"},[l("div",{class:"left-title"},[l(n("n-icon"),{component:v},null),i.reportName]),l("div",{class:"right-detail"},[l(r,{text:!0,onClick:P},{default:()=>[t("报告详情")]}),l(r,{text:!0},{default:()=>[t("推荐方案")]})])]),l("div",{class:"center-img"},[i.images.map((e=>"pdf"===e.imageType?l("embed",{class:"pdf-embed",src:e.image,type:"application/pdf"},null):l(n("n-image"),{src:e.image},null)))]),l("div",{class:"bottom-interpretation"},[o,l("div",{class:"desc-tip"},[t("请注意,辅助诊断由AI推荐,结果仅供临床参考。")])])])})():"medical_added"==k?function(){if(!h(C))return null;const e=C.map((e=>{const{itemName:a,sample:i,execDeptName:s}=e||{};let n="";a&&(n+=a);const t=()=>!n||n.endsWith("/")?"":"/";return i&&(n+=t()+i),s&&(n+=t()+s),l("div",{class:"item"},[l("span",null,[n]),l("span",{class:"time"},[e.beginExecTime])])}));return l("div",{class:"medical-added-box"},[e])}():"默认json内容";return()=>l("section",{class:"json-card_section"},[W(),l("div",{class:"card-content"},[B()]),$()])}});export{_ as default};
|