cnhis-design-vue 3.3.1-beta.14 → 3.3.1-beta.17

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.
Files changed (153) hide show
  1. package/es/components/ai-chat/index.d.ts +17 -17
  2. package/es/components/ai-chat/src/Index.vue.d.ts +17 -17
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/api/index.d.ts +1 -2
  5. package/es/components/ai-chat/src/api/index.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -1
  7. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +9 -11
  10. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  11. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  12. package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
  13. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -2
  14. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
  15. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
  16. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
  17. package/es/components/ai-chat/style/index.css +1 -1
  18. package/es/components/audio-sdk/index.d.ts +304 -2
  19. package/es/components/audio-sdk/index.js +1 -1
  20. package/es/components/audio-sdk/src/Index.vue.d.ts +304 -0
  21. package/es/components/audio-sdk/src/Index.vue.js +1 -0
  22. package/es/components/audio-sdk/src/Index.vue2.js +1 -0
  23. package/es/components/audio-sdk/src/audioSDK.d.ts +5 -7
  24. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  25. package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
  26. package/es/components/audio-sdk/src/components/form.vue.js +1 -0
  27. package/es/components/audio-sdk/src/components/form.vue2.js +1 -0
  28. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +91 -0
  29. package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
  30. package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
  31. package/es/components/audio-sdk/src/components/recording.vue.d.ts +43 -4
  32. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  33. package/es/components/audio-sdk/src/utils/index.d.ts +4 -0
  34. package/es/components/audio-sdk/src/utils/index.js +1 -0
  35. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
  36. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  37. package/es/components/audio-sdk/style/index.css +1 -1
  38. package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
  39. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  41. package/es/components/field-editor/index.d.ts +7 -1
  42. package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
  43. package/es/components/form-config/index.d.ts +38 -3
  44. package/es/components/form-config/src/FormConfig.vue.d.ts +38 -3
  45. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
  46. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +17 -1
  47. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -1
  48. package/es/components/form-render/index.d.ts +7 -1
  49. package/es/components/form-render/index.js +1 -1
  50. package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
  51. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  52. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
  53. package/es/components/form-render/src/components/renderer/date.d.ts +2 -0
  54. package/es/components/form-render/src/components/renderer/date.js +1 -1
  55. package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
  56. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  57. package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
  58. package/es/components/form-render/src/components/renderer/input.js +1 -1
  59. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
  60. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
  61. package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
  62. package/es/components/form-render/src/components/renderer/select.js +1 -1
  63. package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
  64. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  65. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  66. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
  67. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  68. package/es/components/form-render/src/types/index.d.ts +2 -0
  69. package/es/components/form-render/src/utils/index.d.ts +1 -0
  70. package/es/components/form-render/src/utils/index.js +1 -1
  71. package/es/components/form-render/style/index.css +1 -1
  72. package/es/components/iho-chat/index.d.ts +56 -0
  73. package/es/components/iho-chat/src/Index.vue.d.ts +56 -0
  74. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +7 -0
  75. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  76. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +7 -0
  77. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  78. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
  79. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  80. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +27 -0
  81. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +7 -0
  82. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  83. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +7 -1
  84. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  85. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  86. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +9 -0
  87. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  88. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +6 -0
  89. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
  90. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  91. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
  92. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  93. package/es/components/iho-chat/src/constants/index.d.ts +7 -0
  94. package/es/components/iho-chat/src/constants/index.js +1 -1
  95. package/es/components/iho-chat/src/utils/index.d.ts +2 -0
  96. package/es/components/iho-chat/src/utils/index.js +1 -1
  97. package/es/components/iho-chat/style/index.css +1 -1
  98. package/es/components/iho-table/index.d.ts +3 -0
  99. package/es/components/iho-table/index.js +1 -1
  100. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  101. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
  102. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  103. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
  104. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  105. package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
  106. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  107. package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
  108. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  109. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  110. package/es/components/iho-table/src/plugins/index.d.ts +79 -3
  111. package/es/components/iho-table/src/plugins/index.js +1 -1
  112. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
  113. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
  114. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  115. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
  116. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  117. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  118. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  119. package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
  120. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
  121. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  122. package/es/components/iho-table/src/types/index.d.ts +1 -0
  123. package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
  124. package/es/components/iho-table/src/utils/index.js +1 -1
  125. package/es/components/index.css +1 -1
  126. package/es/components/index.d.ts +2 -1
  127. package/es/components/index.js +1 -1
  128. package/es/components/info-header/index.d.ts +24 -2
  129. package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
  130. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  131. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  132. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
  133. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
  134. package/es/components/scale-view/index.d.ts +3 -2
  135. package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -2
  136. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  137. package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
  138. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  139. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
  140. package/es/components/shortcut-setter/index.d.ts +8 -1
  141. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -1
  142. package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
  143. package/es/shared/components/ArrowIcon/index.d.ts +2 -0
  144. package/es/shared/components/ArrowIcon/index.js +1 -0
  145. package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
  146. package/es/shared/components/DateIcon/index.d.ts +2 -0
  147. package/es/shared/components/DateIcon/index.js +1 -0
  148. package/es/shared/package.json.js +1 -1
  149. package/package.json +2 -2
  150. package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
  151. package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -6
  152. package/es/components/ai-chat/src/hooks/useProgram.js +0 -1
  153. /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
- isInner: any;
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) => Promise<void>;
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;
@@ -180,6 +176,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
180
176
  clickMenu: (menu: import("./src/types").CommandItem) => void;
181
177
  handleBack: () => void;
182
178
  updateShow: (value: boolean) => void;
179
+ railStyle: ({ focused, checked }: {
180
+ focused: boolean;
181
+ checked: boolean;
182
+ }) => import("vue").CSSProperties;
183
183
  NButton: any;
184
184
  NInput: any;
185
185
  NIcon: any;
@@ -187,6 +187,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
187
187
  NBreadcrumb: any;
188
188
  NBreadcrumbItem: any;
189
189
  NTag: any;
190
+ NSwitch: any;
190
191
  PaperPlane: 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<{}>>, {}>;
191
192
  ChevronBack: 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<{}>>, {}>;
192
193
  ChevronForward: 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<{}>>, {}>;
@@ -315,7 +316,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
315
316
  isActive: import("vue").Ref<boolean>;
316
317
  tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
317
318
  formattedTime: import("vue").ComputedRef<string>;
318
- checkEnvironment: () => boolean;
319
319
  start: () => Promise<void>;
320
320
  handlePause: () => void;
321
321
  handlePlay: () => void;
@@ -334,7 +334,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
334
334
  show: boolean;
335
335
  }>;
336
336
  }, {}, {}, {}, 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
337
  ChatRight: import("vue").DefineComponent<{}, {
339
338
  medicalLabel: {
340
339
  key: string;
@@ -349,7 +348,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
349
348
  handleSave: () => Promise<void>;
350
349
  createMedicalRecord: () => void;
351
350
  extractContentByTitle: () => import("../../shared/types").AnyObject;
352
- NIcon: any;
353
351
  NSpace: any;
354
352
  NButton: any;
355
353
  Editor: SFCWithInstall<import("vue").DefineComponent<{
@@ -386,9 +384,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
386
384
  }>> & {}, {
387
385
  isDisabled: boolean;
388
386
  }>>;
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
387
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
391
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
388
+ 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<{}>>, {}>;
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
+ }, 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
391
  token: {
393
392
  type: StringConstructor;
394
393
  required: true;
@@ -449,6 +448,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
449
448
  };
450
449
  }>> & {
451
450
  "onButton-click"?: ((...args: any[]) => any) | undefined;
451
+ onProgram?: ((...args: any[]) => any) | undefined;
452
452
  }, {
453
453
  hideInput: boolean;
454
454
  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
- isInner: any;
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) => Promise<void>;
172
+ handleShortcut: (item: string | AnyObject) => void;
177
173
  resetCurrentCommand: () => void;
178
174
  handleKeyDown: (event: KeyboardEvent) => void;
179
175
  isWrap: (event: KeyboardEvent) => boolean;
@@ -182,6 +178,10 @@ declare const _default: import("vue").DefineComponent<{
182
178
  clickMenu: (menu: CommandItem) => void;
183
179
  handleBack: () => void;
184
180
  updateShow: (value: boolean) => void;
181
+ railStyle: ({ focused, checked }: {
182
+ focused: boolean;
183
+ checked: boolean;
184
+ }) => import("vue").CSSProperties;
185
185
  NButton: any;
186
186
  NInput: any;
187
187
  NIcon: any;
@@ -189,6 +189,7 @@ declare const _default: import("vue").DefineComponent<{
189
189
  NBreadcrumb: any;
190
190
  NBreadcrumbItem: any;
191
191
  NTag: any;
192
+ NSwitch: any;
192
193
  PaperPlane: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
193
194
  ChevronBack: 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<{}>>, {}>;
194
195
  ChevronForward: 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<{}>>, {}>;
@@ -317,7 +318,6 @@ declare const _default: import("vue").DefineComponent<{
317
318
  isActive: import("vue").Ref<boolean>;
318
319
  tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
319
320
  formattedTime: import("vue").ComputedRef<string>;
320
- checkEnvironment: () => boolean;
321
321
  start: () => Promise<void>;
322
322
  handlePause: () => void;
323
323
  handlePlay: () => void;
@@ -336,7 +336,6 @@ declare const _default: import("vue").DefineComponent<{
336
336
  show: boolean;
337
337
  }>;
338
338
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
339
- ChatMainInner: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
340
339
  ChatRight: import("vue").DefineComponent<{}, {
341
340
  medicalLabel: {
342
341
  key: string;
@@ -351,7 +350,6 @@ declare const _default: import("vue").DefineComponent<{
351
350
  handleSave: () => Promise<void>;
352
351
  createMedicalRecord: () => void;
353
352
  extractContentByTitle: () => AnyObject;
354
- NIcon: any;
355
353
  NSpace: any;
356
354
  NButton: any;
357
355
  Editor: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
@@ -388,9 +386,10 @@ declare const _default: import("vue").DefineComponent<{
388
386
  }>> & {}, {
389
387
  isDisabled: boolean;
390
388
  }>>;
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
389
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
393
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
390
+ 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<{}>>, {}>;
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
+ }, 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
393
  token: {
395
394
  type: StringConstructor;
396
395
  required: true;
@@ -451,6 +450,7 @@ declare const _default: import("vue").DefineComponent<{
451
450
  };
452
451
  }>> & {
453
452
  "onButton-click"?: ((...args: any[]) => any) | undefined;
453
+ onProgram?: ((...args: any[]) => any) | undefined;
454
454
  }, {
455
455
  hideInput: boolean;
456
456
  uiStyle: string;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,reactive as o,provide as n,toRefs as i,openBlock as r,createElementBlock as a,normalizeStyle as s,unref as l,createElementVNode as u,normalizeClass as d,createBlock as p,createCommentVNode as m}from"vue";import c from"./components/ChatMain.js";import y from"./components/ChatFooter.vue.js";import h from"./components/ChatMainInner.js";import f from"./components/ChatRight.vue.js";import{useTheme as v}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as S}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as g,InjectionAIChatEmits as k}from"./types/index.js";import{instanceAxios as j}from"./api/index.js";import{useWebsocket as I}from"./hooks/useWebsocket.js";const x=["id"];var C=e({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function},queryRecord:{type:Function},hideInput:{type:Boolean},uiStyle:{type:String,default:"big"},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object},appId:{type:String},orgId:{type:String},userId:{type:String},immediatelyRecording:{type:Boolean,default:!1}},emits:["button-click"],setup(e,{expose:C,emit:P}){const _=e,b=v();j.defaults.headers.Authorization="bearer "+_.token,"inner"!==_.uiStyle&&j.interceptors.response.use((e=>{var t;return(null==(t=e.data)?void 0:t.success)?e.data:{success:!1,data:[]}}));const A=t((()=>["small","inner"].includes(_.uiStyle))),F=o({id:"ai-chat-doctor-"+S(),loading:!1,loadingText:"",sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,consultationContent:null,params:{},reportContent:null});return n(g,{...i(_),state:F,isSmall:t((()=>"small"===_.uiStyle)),isInner:t((()=>"inner"===_.uiStyle)),vaa07:t((()=>{var e,t;return null==(t=null==(e=_.patientInfo)?void 0:e.info)?void 0:t.vaa07}))}),n(k,P),"inner"===_.uiStyle&&I(_,F),C({pushMessage:e=>{F.externalData=e},updatePatientInfo:e=>{F.selectedPatient=e}}),(t,o)=>(r(),a("div",{class:"ai-chat-doctor",style:s(l(b))},[u("div",{id:F.id,class:d(["ai-chat-doctor__main",l(A)?"ai-chat-doctor__main--small":"","inner"===e.uiStyle?"ai-chat-doctor__main--inner":""])},["inner"===e.uiStyle?(r(),p(l(h),{key:0})):(r(),p(l(c),{key:1})),e.hideInput?m("v-if",!0):(r(),p(y,{key:2}))],10,x),"inner"===e.uiStyle?(r(),p(f,{key:0})):m("v-if",!0)],4))}});export{C as default};
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 h,createCommentVNode as d,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 F}from"./api/index.js";import{useWebsocket as q}from"./hooks/useWebsocket.js";const A=["id"],D={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();F.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,switchFlag:!0});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:F}),o(b,B),"default"===T.uiStyle&&q(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(),h(l(j),{key:0})):(a(),h(l(w),{key:1})),t.hideInput?d("v-if",!0):(a(),h(R,{key:2}))],8,A),m(p("div",D,[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 instanceAxios: import("axios").AxiosInstance;
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 r=e.create({withCredentials:!0,timeout:5e3});function o(e){return r({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/storage-service/storage/uploadFile",data:e})}function a(e){return r({method:"post",url:"/flow/api/opd/conversation",data:e})}function s(e){return r({method:"put",url:"/flow/api/opd/message",data:e})}function i(e){return r({method:"get",url:`/flow/api/dialog/${e.sessionId}/messages`,params:{page:e.page||1,pageSize:e.pageSize||20}})}r.interceptors.request.use((e=>{var t;if(null==(t=e.url)?void 0:t.includes("/conversation")){const t={...e};return delete t.timeout,t}return e})),r.interceptors.response.use((e=>{var r,o,a;if(null==(r=e.data)?void 0:r.success)return null==(o=e.data)?void 0:o.data;500==(null==(a=e.data)?void 0:a.code)&&e.data.msg&&t.error(e.data.msg)}));export{a as conversationApi,i as getHistoryRecordApi,r as instanceAxios,s as saveApi,o as uploadFileApi};
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 e,ref as t,computed as i,watch as a,onBeforeUnmount as n,withDirectives as r,openBlock as s,createElementBlock as l,unref as u,createBlock as d,createCommentVNode as c,createElementVNode as p,toDisplayString as m,normalizeStyle as f,createVNode as v,withCtx as w,createTextVNode as h,vShow as g}from"vue";import{NIcon as y,NSpace as _,NButton as F}from"naive-ui";import{StopCircleOutline as S}from"@vicons/ionicons5";import{InjectionAIChat as k}from"../types/index.js";import{useIntervalFn as x,promiseTimeout as C}from"@vueuse/core";import $ from"../../../audio-sdk/src/audioSDK.js";import{uploadFileApi as j}from"../api/index.js";import{uuidGenerator as M}from"../../../../shared/utils/index.js";import{$message as z}from"../utils/index.js";const A={class:"ai-chat-doctor__audio"};var I=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:I}){const B=o,D=$.create(),{state:T,vaa07:b,immediatelyRecording:q}=e(k),K=t(0);let L="";const{pause:N,resume:O,isActive:R}=x((()=>{K.value++}),1e3,{immediate:!1}),U=i((()=>R.value?"正在录音中...":"录音已暂停")),E=i((()=>{const o=Math.floor(K.value/3600),e=Math.floor(K.value%3600/60),t=K.value%60,i=e.toString().padStart(2,"0"),a=t.toString().padStart(2,"0");if(o>0){return`${o.toString().padStart(2,"0")}:${i}:${a}`}return`${i}:${a}`}));async function G(){try{if((null==(o=null==navigator?void 0:navigator.userAgent)?void 0:o.includes("Chrome"))&&!(null==window?void 0:window.isSecureContext)&&(I("update:show",!1),z.warning("当前使用的http协议默认不支持麦克风权限,需要用户开启浏览器麦克风权限"),1))return;const e=await D.start(void 0,{timed:1800,recognizable:!1,showModal:!1});if(I("update:show",!1),"click"!==L)return;const{result:t,data:i}=e||{};if("success"!==t)return;if(i){const o=new File([i],`${M()}.mp3`,{type:i.type}),e=new FormData;e.append("file",o),e.append("channelId","MINIO");const t=await j(e),a=(null==t?void 0:t.path)||"";console.log("音频地址 ==>",a),T.params={audioUrl:a,opType:"create_inquiry"},T.sending=!0,T.loading=!0,T.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录"}}catch(o){console.log(o),I("update:show",!1),"fail"===(null==o?void 0:o.result)&&o.msg&&z.warning(o.msg)}var o}function H(){N(),D.pause()}function J(){O(),D.resume()}async function P(o){L=o||"",null==D||D.stop(),I("update:show",!1)}return a((()=>B.show),(o=>{o?(L="",K.value=0,O(),G()):N()}),{immediate:!0}),a((()=>b.value),(async o=>{const e=B.show;B.show&&P(),q.value&&(e&&await C(10),I("update:show",!0))}),{immediate:!0}),n((()=>{$.destroy()})),(e,t)=>r((s(),l("div",A,[u(R)?c("v-if",!0):(s(),d(u(y),{key:0,size:"42",color:"#FF1818",component:u(S)},null,8,["component"])),p("p",null,m(u(U)),1),p("h3",{style:f(u(R)?"":"color: #FF1818")},m(u(E)),5),v(u(_),{"wrap-item":!1,size:15},{default:w((()=>[r(v(u(F),{round:"",onClick:H},{default:w((()=>[h("暂停")])),_:1},512),[[g,u(R)]]),r(v(u(F),{round:"",onClick:J},{default:w((()=>[h("继续")])),_:1},512),[[g,!u(R)]]),v(u(F),{round:"",color:"#FF1818",onClick:t[0]||(t[0]=()=>P("click"))},{default:w((()=>{var o;return[h((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.77"))||"结束")]})),_:1})])),_:1})],512)),[[g,o.show]])}});export{I as default};
1
+ 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 C}from"../types/index.js";import{useIntervalFn as F,promiseTimeout as x}from"@vueuse/core";import"../../../audio-sdk/index.js";import{$message as $}from"../utils/index.js";import j from"../../../audio-sdk/src/audioSDK.js";const M={class:"ai-chat-audio"};var T=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:T}){const z=o,A=j.create(),{state:B,vaa07:R,immediatelyRecording:q}=t(C),D=e(0);let K="";const{pause:L,resume:b,isActive:E}=F((()=>{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(),T("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(T("update:show",!1),"click"!==K)return;const{result:t,data:e}=o||{};if("success"!==t)return;e&&(B.params={opType:"create_inquiry"},B.sendContent=e,B.sending=!0,B.loading=!0,B.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}catch(o){console.log(o),T("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 x(10),T("update:show",!0))}),{immediate:!0}),n((()=>{j.destroy()})),(t,e)=>r((s(),u("div",M,[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{T 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{instanceAxios as E}from"../api/index.js";import k from"../../../form-render/index.js";import I from"../../../card-render/index.js";var x=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:x,slots:C,emit:_}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},P=y(),{patientInfo:w,state:O,isSmall:j,appId:S}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),F=a(),q=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),A=e.msgItem.content,H={},B=l(p(A.data||{})),K={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=A.body||{},a=null==(n=(l=R.value).getFormValues)?void 0:n.call(l);Object.keys(t.params).forEach((l=>{const n=e.find((e=>e.code===l));"vaa05"===l?t.params.vaa05=L.value.selectedPatient.vaa01:Reflect.has(a,l)?t.params[l]=a[l]:n&&(t.params[l]=n.value)}))}t&&Reflect.has(t,"configs")&&(t.configs=L.value.selectedPatient)}};function U(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function D(e){B[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}if(q.value){const t=A.body.items||[],a=t.some((e=>"vaa05"===e.code));M.value=t.filter((e=>e.showFlag)).map((t=>{var l,n,o;if("vaa05"===t.code&&!j.value)return L.value={...t},t._value?N.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(N.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,L.value.selectedPatient=e.configs),null;const i={html_type:T[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(o=t.labelField)?o:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(i.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===i.html_type){if(i.componentProps={fallbackOption:!1},i.option=t.options||[],i.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(i.default_val=t.value)}if(Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:j.value?"inner":"global",...j.value?{appId:S.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=w.value.info||O.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,i.urlConfig.params.params={},e.forEach((e=>{i.urlConfig.params.params[e]=""}))}}return i})).filter((e=>!!e))}function J(){var t;if(!L.value)return null;function a(){e.msgItem.disabled||(O.showPatient=!0)}return i(s,{class:"form-render",ref:F,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:N,rules:{vaa05:{required:L.value.required,message:L.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:L.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:N.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:h},null)})]}})]})}async function V(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),A.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=O.selectedPatientLabel,e.value=L.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=H[e.code])?void 0:t[0])&&(e.options=H[e.code])})),O.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){O.loading=!1}}function z(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(H[n]=[null==a?void 0:a.currentOption])}function X(){_("button-click",{showMore:!0})}function G(){var e;if("1834043761964638208"!==(null==(e=A.settings)?void 0:e.id)||!A.data)return null;const t=JSON.parse(A.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(A.data[l])||JSON.parse(A.data[l]).length<=5?null:(g(B[l])&&(B[l]=JSON.parse(B[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:P.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return o((()=>O.showPatient),(t=>{!e.msgItem.disabled&&q.value&&!t&&O.selectedPatientLabel&&L.value&&(N.vaa05=O.selectedPatientLabel,L.value.selectedPatient={...O.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[q.value?[i("p",null,[A.title||A.header.title]),i("div",{class:"form-box"},[[J(),i(k,{"request-instance":{get:E.get,post:E.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:z},null)]]),A.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=q.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(q.value){if(!R.value)return;try{L.value?null==(e=F.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:L.value.selectedPatient.vaa01}),await V(t,e)}})):await V(t)}catch(e){}}else _("button-click")}},{default:()=>[q.value?null==t?void 0:t.text:A.buttonName]})}(t)))]:[i(I,{config:g(null==(t=A.settings)?void 0:t.setting)?JSON.parse(A.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{x as default};
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};
@@ -1,13 +1,8 @@
1
+ import { CSSProperties } from 'vue';
1
2
  import { CommandItem } from '../types';
2
3
  import { CAudioSDK } from '../../../../components/audio-sdk';
3
4
  import { AnyObject } from '../../../../shared/types';
4
5
  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
6
  cssVars: import("vue").ComputedRef<AnyObject>;
12
7
  audioSdk: CAudioSDK;
13
8
  emit: (event: string, ...args: any[]) => void;
@@ -16,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{}, {
16
11
  isSmall: any;
17
12
  audioTimed: any;
18
13
  commandList: any;
19
- isInner: any;
14
+ isDefault: any;
20
15
  patientInfo: any;
21
16
  inputRef: import("vue").Ref<any>;
22
17
  showPopover: import("vue").Ref<boolean>;
@@ -39,14 +34,13 @@ declare const _default: import("vue").DefineComponent<{}, {
39
34
  showPatient: import("vue").Ref<boolean>;
40
35
  showAudio: import("vue").Ref<boolean>;
41
36
  placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
37
+ isAllDisabled: import("vue").ComputedRef<any>;
42
38
  btnDisabled: import("vue").ComputedRef<any>;
43
39
  showMagicWand: import("vue").ComputedRef<boolean>;
44
40
  patient: import("vue").ComputedRef<string>;
45
- currentShortcutList: import("vue").ComputedRef<any>;
46
- isAllDisabled: import("vue").ComputedRef<any>;
47
41
  recorderStart: () => Promise<void>;
48
42
  getShortcutName: (item: string | AnyObject) => any;
49
- handleShortcut: (item: string | AnyObject) => Promise<void>;
43
+ handleShortcut: (item: string | AnyObject) => void;
50
44
  resetCurrentCommand: () => void;
51
45
  handleKeyDown: (event: KeyboardEvent) => void;
52
46
  isWrap: (event: KeyboardEvent) => boolean;
@@ -55,6 +49,10 @@ declare const _default: import("vue").DefineComponent<{}, {
55
49
  clickMenu: (menu: CommandItem) => void;
56
50
  handleBack: () => void;
57
51
  updateShow: (value: boolean) => void;
52
+ railStyle: ({ focused, checked }: {
53
+ focused: boolean;
54
+ checked: boolean;
55
+ }) => CSSProperties;
58
56
  NButton: any;
59
57
  NInput: any;
60
58
  NIcon: any;
@@ -62,6 +60,7 @@ declare const _default: import("vue").DefineComponent<{}, {
62
60
  NBreadcrumb: any;
63
61
  NBreadcrumbItem: any;
64
62
  NTag: any;
63
+ NSwitch: any;
65
64
  PaperPlane: 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<{}>>, {}>;
66
65
  ChevronBack: 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<{}>>, {}>;
67
66
  ChevronForward: 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<{}>>, {}>;
@@ -190,7 +189,6 @@ declare const _default: import("vue").DefineComponent<{}, {
190
189
  isActive: import("vue").Ref<boolean>;
191
190
  tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
192
191
  formattedTime: import("vue").ComputedRef<string>;
193
- checkEnvironment: () => boolean;
194
192
  start: () => Promise<void>;
195
193
  handlePause: () => void;
196
194
  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(/(&nbsp;|\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 f,createCommentVNode as p,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,NSwitch as P}from"naive-ui";import{PeopleOutline as S,SparklesSharp as D,PaperPlane as L,ChevronBack as U,ChevronForward as B}from"@vicons/ionicons5";import{InjectionAIChatEmits as E,InjectionAIChat as K}from"../types/index.js";import"../../../audio-sdk/index.js";import{cloneDeep as A,isString as F,last as R}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 H from"../../../audio-sdk/src/audioSDK.js";const G={class:"menu-box fillet-8"},J={class:"input-wrapper fillet-10"},O=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=W(),ie=H.create(),se=o(E),{shortcutList:re,state:de,isSmall:ue,audioTimed:ce,commandList:ve,isDefault:me,patientInfo:he}=o(K),fe=n(),pe=n(!1),ke=n([]),we=n(A(ve.value||[])),ge=n(!1),ye=n(""),Ce=n(!1),be=n(!1),xe=t((()=>me.value?"请向我提问,Shift+Enter换行":ue?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),_e=t((()=>{var e,o;return me.value&&1!==(null==(o=null==(e=he.value)?void 0:e.info)?void 0:o.vac34)})),je=t((()=>_e.value||de.loading||!de.sendContent.replace(/(&nbsp;|\s|<br>)+/g,""))),Ie=t((()=>{var e;return!de.sendContent&&!(null==(e=fe.value)?void 0:e.activated.value)})),ze=t((()=>{var e,o;if(!de.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:n,vaa05:t}=de.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 Me(){try{const e=await ie.start({instance:b(),allowPunctuationMark:!1,timed:ce.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;de.sendContent=e.data||""}catch(e){console.log(e)}}function Te(e){var o;if(F(e))return e;if(me.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 Pe(){var e;pe.value=!1,we.value=A(ve.value||[]),ke.value=[],(null==(e=ve.value)?void 0:e.length)&&(pe.value=!0,ye.value=we.value[0].shortcutId)}function Se(e){if(me.value)"Enter"!==e.key||De(e)||Ue();else if(!["Slash","NumpadDivide"].includes(e.code)||de.selectedCommand||de.sendContent)if("Backspace"===e.key)pe.value=!1,!de.sendContent.startsWith("/")&&!de.sendContent.startsWith("、")||2!==de.sendContent.length||de.selectedCommand?!de.sendContent&&de.selectedCommand&&(e.preventDefault(),de.selectedCommand=null,de.sendContent="/",Pe()):Pe();else if(pe.value&&["ArrowUp","ArrowDown"].includes(e.key)){const o=we.value.findIndex((e=>e.shortcutId===ye.value));if("ArrowUp"===e.key){const e=o>0?o-1:we.value.length-1;ye.value=we.value[e].shortcutId}else if("ArrowDown"===e.key){const e=o<we.value.length-1?o+1:0;ye.value=we.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!De(e))if(e.preventDefault(),pe.value){Be(we.value.find((e=>e.shortcutId===ye.value)))}else Ue()}else pe.value=!1;else Pe()}function De(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Le(e){!e&&de.selectedPrompt&&(de.selectedPrompt=null)}function Ue(){je.value||(de.sending=!0,de.loading=!0)}function Be(e){var o;ye.value=e.shortcutId,fe.value.focus(),(null==(o=e.children)?void 0:o.length)?(we.value=e.children,ye.value=we.value[0].shortcutId,ke.value.push(e)):(de.selectedCommand=e||{},pe.value=!1,de.sendContent="")}function Ee(){var e;ke.value.pop(),we.value=R(ke.value)?null==(e=R(ke.value))?void 0:e.children:A(ve.value||[]),ye.value=we.value[0].shortcutId,fe.value.focus()}function Ke(e){e||(de.showPatient=!1)}function Ae({focused:e,checked:o}){const n={};return o?(n.background="#d03050",e&&(n.boxShadow="0 0 0 2px #d0305040")):(n.background="#2080f0",e&&(n.boxShadow="0 0 0 2px #2080f040")),n}return l((()=>{H.destroy()})),a((()=>de.showPatient),(e=>{e&&(Ce.value=e)})),(e,o)=>(i(),s("section",{class:r(["chat-footer-wrapper",{"is-small":d(ue)}])},[u("div",{class:r(["chat-footer",d(de).loading?"disabled":""])},[u("div",G,[d(ue)||d(me)?p("v-if",!0):(i(),c(d(x),{key:0,secondary:"",size:"small",onClick:o[0]||(o[0]=()=>Ce.value=!0)},{icon:v((()=>[m(d(_),{color:d(ae)["--c-primary-color"],size:"20",component:d(S)},null,8,["color","component"])])),default:v((()=>[h(" "+f(d(ze)),1)])),_:1})),d(re)&&d(re).length>0?(i(!0),s(k,{key:1},w(d(re),(e=>(i(),c(d(x),{secondary:"",size:"small",style:g(d(ue)?"background: #fff":""),round:d(ue),key:Te(e),disabled:d(_e),onClick:()=>function(e){var o;if(F(e))de.sendContent=e;else{if(me.value&&e.key)return void(["recommend_treatment_plan","recommend_examination","recommend_diagnosis"].includes(e.key)?(de.params={opType:e.key},de.sending=!0,de.loading=!0,de.loadingText="","recommend_treatment_plan"===e.key?de.loadingText="参考诊断结果与患者个体信息,正全面梳理知识库和临床指南,综合考量为您匹配最适宜的诊疗方案推荐":"recommend_examination"===e.key&&(de.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目")):se("program",{key:e.key}));const n=null==(o=null==e?void 0:e.contents)?void 0:o[0];se("button-click",{msgItem:n,item:e})}}(e)},{default:v((()=>[h(f(Te(e)),1)])),_:2},1032,["style","round","disabled","onClick"])))),128)):p("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",J,[m(d(I),{ref_key:"inputRef",ref:fe,placeholder:d(xe),type:"textarea",autosize:{minRows:d(ue)?1:2,maxRows:7},disabled:d(_e)||d(de).loading,value:d(de).sendContent,"onUpdate:value":o[2]||(o[2]=e=>d(de).sendContent=e),onKeydownCapture:Se,onInput:Le},y({_:2},[d(me)?void 0:{name:"prefix",fn:v((()=>[d(de).selectedCommand&&d(de).selectedCommand.shortcutTitle?(i(),c(d(z),{key:0,bordered:!1,color:{textColor:d(ae)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+f(d(de).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):d(Ie)?(i(),c(d(x),{key:1,text:"",onClick:o[1]||(o[1]=()=>ge.value=!0)},{default:v((()=>[m(d(_),{color:"#8f66f7",size:"18",component:d(D)},null,8,["component"])])),_:1})):p("v-if",!0)])),key:"0"},d(ue)?{name:"suffix",fn:v((()=>[m(d(x),{text:"",disabled:d(de).loading,onClick:Me},{icon:v((()=>[m(d(_),{size:"30"},{default:v((()=>[O])),_:1})])),_:1},8,["disabled"]),m(d(x),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(je),onClick:Ue},{icon:v((()=>[m(d(_),{color:"#fff",size:"20",component:d(L)},null,8,["component"])])),_:1},8,["disabled"])])),key:"1"}:void 0]),1032,["placeholder","autosize","disabled","value"]),d(ue)?p("v-if",!0):(i(),s("div",Q,[d(me)?(i(),c(d(x),{key:0,text:"",disabled:d(_e)||be.value||d(de).loading,onClick:o[3]||(o[3]=e=>be.value=!0)},{icon:v((()=>[m(d(_),{size:"38"},{default:v((()=>[X])),_:1})])),_:1},8,["disabled"])):p("v-if",!0),u("span",{class:r(["btn-send","gradient","fillet-8",d(je)?"disabled":""]),disabled:d(je),onClick:Ue},[m(d(_),{color:"#fff",size:"22",component:d(L)},null,8,["component"])],10,Y)]))])])),default:v((()=>{var e;return[u("div",Z,[u("div",$,[0===ke.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:Ee},{default:v((()=>[m(d(_),{color:"#999",size:"20",component:d(U)},null,8,["component"])])),_:1}),m(d(M),null,{default:v((()=>[(i(!0),s(k,null,w(ke.value,(e=>(i(),c(d(T),{key:e.shortcutId},{default:v((()=>[h(f(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",oe,[(i(!0),s(k,null,w(we.value,(e=>(i(),s("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",ye.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>ye.value=e.shortcutId),["stop"]),onClick:()=>Be(e)},[u("span",te,f(e.shortcutTitle),1),u("span",le,f(e.shortcutDescription),1),e.children&&e.children.length?(i(),c(d(_),{key:0,color:"#999",size:"20",component:d(B)},null,8,["component"])):p("v-if",!0)],42,ne)))),128))])])]})),_:1},8,["show"]),d(me)?p("v-if",!0):(i(),c(N,{key:0,show:ge.value,"onUpdate:show":o[5]||(o[5]=e=>ge.value=e)},null,8,["show"])),d(me)?p("v-if",!0):(i(),c(V,{key:1,show:Ce.value,"onUpdate:show":[o[6]||(o[6]=e=>Ce.value=e),Ke]},null,8,["show"])),d(me)?(i(),c(q,{key:2,show:be.value,"onUpdate:show":o[7]||(o[7]=e=>be.value=e)},null,8,["show"])):p("v-if",!0),d(me)?(i(),c(d(P),{key:3,value:d(de).switchFlag,"onUpdate:value":o[8]||(o[8]=e=>d(de).switchFlag=e),"rail-style":Ae},{checked:v((()=>[h("L1")])),unchecked:v((()=>[h("L2")])),_:1},8,["value"])):p("v-if",!0)],2)],2))}});export{ae 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{NSpin as r,NAvatar as d,NSpace as c,NButton as m}from"naive-ui";import{InjectionAIChatEmits as v,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(v),{userAvatar:E,queryData:P,state:S,queryRecord:M,defaultShortcutList:D,hideInput:O=!1,isSmall:z}=n(g),A=t(null),q=t([]),H=t(!1),N=t(!1),R=t(),U=l((()=>z.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 M.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(d,{round:!0,size:z.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(D.value)&&D.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=D.value.map((e=>s(m,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.loading},k(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return C(A,(()=>{F()}),O.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-box"},[s("div",{class:"chat-main",style:{"flex-direction":O.value?"column":"column-reverse"}},[[S.loading?s("div",{class:"message-item"},[[s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(r,{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},[[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 a,resolveComponent as s}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 m,isFunction as v}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:b}){const j=n(u),{patientInfo:w,state:C,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;p(e.contents)&&(I.value.unshift(e),await a(),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}))}function F(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,a,u,d;const{contents:p=[],msgId:m=""}=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==(a=p[n])?void 0:a.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,C.params={audioUrl:o,opType:"create_inquiry"},C.sending=!0,C.loading=!0,void(C.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}},{icon:()=>r(c,{component:h},null)})})]:function(e,n){return r(s("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=>{C.showRight=!1,I.value=[],M.page=0,M.hasMore=!0,S()}),{immediate:!0}),o((()=>C.reportContent),(e=>{e&&(R(e),C.reportContent=null)})),o((()=>C.sending),(async e=>{var n,t,o,r,a,s,l;if(e){const{opType:e}=C.params||{};if(!e&&C.sendContent&&I.value.unshift({msgId:g(),contents:[{role:"user",content:C.sendContent}]}),null==(n=k.value)||n.scrollTo({top:0,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(C.params,m(e))}Object.assign(C.params,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const n=await _({contents:[{role:"user",content:C.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:w.value.info,switchFlag:C.switchFlag?1:0,...C.params});["diagnosis","medical_order"].includes(e)&&C.showRightSlot&&j("program",{key:"medical",type:"refresh",params:{vac01:null==(o=null==(t=w.value)?void 0:t.info)?void 0:o.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==(r=null==n?void 0:n.contents)?void 0:r[0])?void 0:a.messageType)&&(C.consultationContent=n,C.showRight=!0,C.showRightSlot=!1):j("program",{key:"medical",params:{vac01:null==(l=null==(s=w.value)?void 0:s.info)?void 0:l.vac01,type:1}})),e&&"create_inquiry"!==e||(C.sendContent=""),C.params={}}catch(e){console.log("error ==>",e)}finally{C.sending=!1,C.loading=!1,C.loadingText=""}}})),()=>[r("section",{class:"chat-main-wrapper",ref:k},[r("div",{class:"chat-main-box"},[r("div",{class:"chat-main",style:"column-reverse"},[[C.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,[C.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":!v(n.render)&&F(e,t)}]},[v(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 n,reactive as o,ref as e,watch as i,withDirectives as l,openBlock as s,createElementBlock as a,createElementVNode as c,vShow as r,unref as u,createVNode as d,withCtx as y,createTextVNode as p}from"vue";import{NButton as f,NIcon as k,NSpace as m}from"naive-ui";import{InjectionAIChat as _}from"../types/index.js";import{$message as g}from"../utils/index.js";import v from"../../../editor/index.js";import{CloseOutline as h}from"@vicons/ionicons5";import{saveApi as j}from"../api/index.js";const C={class:"ai-chat-doctor__right"},w={class:"header"},b={class:"main"},x={class:"main",id:"aiChatMedicalRecord"};var z=t({__name:"ChatRight",setup(t){const z=[{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:q,patientInfo:R}=n(_),$=o({toolbarKeys:[]}),I=e("");async function B(){var t;try{const n=E();q.consultationContent.contents[0].content.details.autoBackFillData=n,await j({msgId:q.consultationContent.msgId,contents:q.consultationContent.contents,configs:null==(t=R.value)?void 0:t.info}),g.success("保存成功")}catch(t){console.log("error ==>",t)}}function D(){const t=E();console.log("json ==>",t,q.consultationContent),q.consultationContent.contents[0].content.details.autoBackFillData=t,q.params={opType:"create_medical",...q.consultationContent,contents:[{role:"user",content:"",contentType:"text"}],medicalInfo:q.consultationContent},q.sending=!0,q.loading=!0,q.loadingText="系统进入深度分析模式,正在整合数据,调取主诉,获取现病史、既往病史,读取过敏史,综合多维度信息生成诊断建议"}function E(){const t={};return z.forEach((n=>{const o=new RegExp(`<p><span.*?><strong>\\d+、${n.title}<\\/strong><\\/span><\\/p><p>(.*?)<\\/p>`,"i"),e=I.value.match(o);if(e&&e[1]){const o=e[1].trim();t[n.key]="<br>"===o?"":o}})),t}return i((()=>q.consultationContent),(t=>{var n,o,e;if(t){const{autoBackFillData:i}=(null==(e=null==(o=null==(n=null==t?void 0:t.contents)?void 0:n[0])?void 0:o.content)?void 0:e.details)||{};if(I.value="",!i)return;z.forEach(((t,n)=>{I.value+=`<p><span style="font-size: 16px;"><strong>${n+1}、${t.title}</strong></span></p><p><span>${i[t.key]||""}</span></p><p>${n<z.length-1?"<br>":""}`}))}})),i((()=>q.showRight),(t=>{t||(q.consultationContent=null)})),(t,n)=>l((s(),a("div",C,[c("div",w,[l(c("h4",null,"问诊记录",512),[[r,u(q).consultationContent]]),d(u(f),{quaternary:"",onClick:n[0]||(n[0]=()=>u(q).showRight=!1)},{icon:y((()=>[d(u(k),{size:"20",component:u(h)},null,8,["component"])])),_:1})]),l(c("div",b,[d(u(v),{"toolbar-config":$,modelValue:I.value,"onUpdate:modelValue":n[1]||(n[1]=t=>I.value=t)},null,8,["toolbar-config","modelValue"]),d(u(m),{class:"footer","wrap-item":!1},{default:y((()=>[d(u(f),{round:"",class:"gradient",disabled:u(q).loading,onClick:D},{default:y((()=>[p("审核完成")])),_:1},8,["disabled"]),d(u(f),{round:"",onClick:B},{default:y((()=>[p("暂存")])),_:1})])),_:1})],512),[[r,u(q).consultationContent]]),l(c("div",x,null,512),[[r,!u(q).consultationContent]])],512)),[[r,u(q).showRight]])}});export{z as default};
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};