cnhis-design-vue 3.3.1-beta.3 → 3.3.1-beta.4

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 (134) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +17 -147
  3. package/es/components/ai-chat/src/Index.vue.d.ts +17 -147
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +2 -55
  7. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatMain.d.ts +7 -1
  9. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  10. package/es/components/ai-chat/src/utils/index.d.ts +0 -1
  11. package/es/components/ai-chat/src/utils/index.js +1 -1
  12. package/es/components/ai-chat/style/index.css +1 -1
  13. package/es/components/audio-sdk/src/audioSDK.d.ts +7 -6
  14. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  15. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +1 -2
  16. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  17. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  18. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  19. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  20. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  21. package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
  22. package/es/components/card-render/src/components/index.d.ts +23 -23
  23. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  24. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  25. package/es/components/editor/src/Editor.js +1 -1
  26. package/es/components/editor/style/index.css +0 -1
  27. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  28. package/es/components/field-editor/index.d.ts +7 -1
  29. package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
  30. package/es/components/form-config/index.d.ts +33 -3
  31. package/es/components/form-config/src/FormConfig.vue.d.ts +33 -3
  32. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
  33. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -1
  34. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +7 -1
  35. package/es/components/form-render/index.d.ts +7 -1
  36. package/es/components/form-render/index.js +1 -1
  37. package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
  38. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  39. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
  40. package/es/components/form-render/src/components/renderer/date.d.ts +2 -0
  41. package/es/components/form-render/src/components/renderer/date.js +1 -1
  42. package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
  43. package/es/components/form-render/src/components/renderer/input.js +1 -1
  44. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +2 -0
  45. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +2 -0
  46. package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
  47. package/es/components/form-render/src/components/renderer/select.js +1 -1
  48. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  49. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
  50. package/es/components/form-render/src/types/index.d.ts +2 -0
  51. package/es/components/form-render/src/utils/index.d.ts +1 -0
  52. package/es/components/form-render/src/utils/index.js +1 -1
  53. package/es/components/form-render/style/index.css +1 -1
  54. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  55. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
  56. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
  57. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  58. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
  59. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  60. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  61. package/es/components/iho-table/src/types/index.d.ts +1 -0
  62. package/es/components/index.css +1 -1
  63. package/es/components/index.js +1 -1
  64. package/es/components/info-header/index.d.ts +24 -2
  65. package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
  66. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  67. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  68. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
  69. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
  70. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  71. package/es/components/shortcut-setter/index.d.ts +7 -1
  72. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +7 -1
  73. package/es/env.d.ts +25 -25
  74. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  75. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  76. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  77. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  78. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  79. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  80. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  81. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  82. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  83. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  84. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  85. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  86. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  87. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  88. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  89. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  90. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  91. package/es/shared/assets/img/failure.png.js +1 -1
  92. package/es/shared/assets/img/logo.png.js +1 -1
  93. package/es/shared/assets/img/no-permission.png.js +1 -1
  94. package/es/shared/assets/img/nodata.png.js +1 -1
  95. package/es/shared/assets/img/notfound.png.js +1 -1
  96. package/es/shared/assets/img/qr.png.js +1 -1
  97. package/es/shared/assets/img/success.png.js +1 -1
  98. package/es/shared/assets/img/table_style_2.png.js +1 -1
  99. package/es/shared/assets/img/video.png.js +1 -1
  100. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  101. package/es/shared/assets/img/xb_big.png.js +1 -1
  102. package/es/shared/assets/img/xb_small.png.js +1 -1
  103. package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
  104. package/es/shared/components/ArrowIcon/index.d.ts +2 -0
  105. package/es/shared/components/ArrowIcon/index.js +1 -0
  106. package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
  107. package/es/shared/components/DateIcon/index.d.ts +2 -0
  108. package/es/shared/components/DateIcon/index.js +1 -0
  109. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  110. package/es/shared/package.json.js +1 -1
  111. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  112. package/es/shared/utils/tapable/index.d.ts +139 -0
  113. package/package.json +2 -2
  114. package/es/components/ai-chat/src/api/index.d.ts +0 -6
  115. package/es/components/ai-chat/src/api/index.js +0 -1
  116. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -44
  117. package/es/components/ai-chat/src/components/ChatAudio.vue.js +0 -1
  118. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +0 -1
  119. package/es/components/ai-chat/src/components/ChatMainInner.d.ts +0 -2
  120. package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
  121. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -56
  122. package/es/components/ai-chat/src/components/ChatRight.vue.js +0 -1
  123. package/es/components/ai-chat/src/components/ChatRight.vue2.js +0 -1
  124. package/es/components/ai-chat/src/components/card/JsonCard.d.ts +0 -25
  125. package/es/components/ai-chat/src/components/card/JsonCard.js +0 -1
  126. package/es/components/ai-chat/src/components/card/SelectIcon.d.ts +0 -14
  127. package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
  128. package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -6
  129. package/es/components/ai-chat/src/hooks/useProgram.js +0 -1
  130. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +0 -2
  131. package/es/components/ai-chat/src/hooks/useWebsocket.js +0 -1
  132. package/es/shared/assets/img/file-emr.png.js +0 -1
  133. package/es/shared/assets/img/file.png.js +0 -1
  134. package/es/shared/assets/img/use.png.js +0 -1
@@ -17,16 +17,17 @@ declare const _default: import("vue").DefineComponent<{
17
17
  };
18
18
  queryData: {
19
19
  type: PropType<QueryData>;
20
+ reuired: boolean;
20
21
  };
21
22
  queryRecord: {
22
23
  type: PropType<QueryRecord>;
24
+ reuired: boolean;
23
25
  };
24
26
  hideInput: {
25
27
  type: BooleanConstructor;
26
28
  };
27
29
  uiStyle: {
28
30
  type: StringConstructor;
29
- default: string;
30
31
  };
31
32
  audioTimed: {
32
33
  type: NumberConstructor;
@@ -50,16 +51,6 @@ declare const _default: import("vue").DefineComponent<{
50
51
  appId: {
51
52
  type: StringConstructor;
52
53
  };
53
- orgId: {
54
- type: StringConstructor;
55
- };
56
- userId: {
57
- type: StringConstructor;
58
- };
59
- immediatelyRecording: {
60
- type: BooleanConstructor;
61
- default: boolean;
62
- };
63
54
  }, {
64
55
  cssVars: import("vue").ComputedRef<AnyObject>;
65
56
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -78,16 +69,17 @@ declare const _default: import("vue").DefineComponent<{
78
69
  };
79
70
  queryData: {
80
71
  type: PropType<QueryData>;
72
+ reuired: boolean;
81
73
  };
82
74
  queryRecord: {
83
75
  type: PropType<QueryRecord>;
76
+ reuired: boolean;
84
77
  };
85
78
  hideInput: {
86
79
  type: BooleanConstructor;
87
80
  };
88
81
  uiStyle: {
89
82
  type: StringConstructor;
90
- default: string;
91
83
  };
92
84
  audioTimed: {
93
85
  type: NumberConstructor;
@@ -111,30 +103,21 @@ declare const _default: import("vue").DefineComponent<{
111
103
  appId: {
112
104
  type: StringConstructor;
113
105
  };
114
- orgId: {
115
- type: StringConstructor;
116
- };
117
- userId: {
118
- type: StringConstructor;
119
- };
120
- immediatelyRecording: {
121
- type: BooleanConstructor;
122
- default: boolean;
123
- };
124
106
  }>> & {
125
107
  "onButton-click"?: ((...args: any[]) => any) | undefined;
126
108
  }>>;
109
+ axiosInstance: import("axios").AxiosInstance;
127
110
  emit: (event: "button-click", ...args: any[]) => void;
128
- showSmallStyle: import("vue").ComputedRef<boolean>;
129
111
  state: AnyObject;
130
- ChatMain: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
112
+ NMessageProvider: any;
113
+ ChatMain: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
114
+ [x: string]: unknown;
115
+ }>>, () => JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
116
+ [x: string]: unknown;
117
+ }>>>> & {}, {
118
+ readonly [x: number]: string;
119
+ } | {}>;
131
120
  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
121
  cssVars: import("vue").ComputedRef<AnyObject>;
139
122
  audioSdk: import("../..").CAudioSDK;
140
123
  emit: (event: string, ...args: any[]) => void;
@@ -143,8 +126,6 @@ declare const _default: import("vue").DefineComponent<{
143
126
  isSmall: any;
144
127
  audioTimed: any;
145
128
  commandList: any;
146
- isInner: any;
147
- patientInfo: any;
148
129
  inputRef: import("vue").Ref<any>;
149
130
  showPopover: import("vue").Ref<boolean>;
150
131
  breadcrumb: import("vue").Ref<{
@@ -164,16 +145,13 @@ declare const _default: import("vue").DefineComponent<{
164
145
  showPrompt: import("vue").Ref<boolean>;
165
146
  currentShortcutId: import("vue").Ref<string>;
166
147
  showPatient: import("vue").Ref<boolean>;
167
- showAudio: import("vue").Ref<boolean>;
168
- placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
148
+ placeholder: import("vue").ComputedRef<"请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
169
149
  btnDisabled: import("vue").ComputedRef<any>;
170
150
  showMagicWand: import("vue").ComputedRef<boolean>;
171
151
  patient: import("vue").ComputedRef<string>;
172
- currentShortcutList: import("vue").ComputedRef<any>;
173
- isAllDisabled: import("vue").ComputedRef<any>;
174
152
  recorderStart: () => Promise<void>;
175
153
  getShortcutName: (item: string | AnyObject) => any;
176
- handleShortcut: (item: string | AnyObject) => Promise<void>;
154
+ handleShortcut: (item: string | AnyObject) => void;
177
155
  resetCurrentCommand: () => void;
178
156
  handleKeyDown: (event: KeyboardEvent) => void;
179
157
  isWrap: (event: KeyboardEvent) => boolean;
@@ -293,103 +271,6 @@ declare const _default: import("vue").DefineComponent<{
293
271
  }, {
294
272
  show: boolean;
295
273
  }>;
296
- ChatAudio: import("vue").DefineComponent<{
297
- show: {
298
- type: BooleanConstructor;
299
- };
300
- }, {
301
- audioSdk: import("../..").CAudioSDK;
302
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
303
- show: {
304
- type: BooleanConstructor;
305
- };
306
- }>> & {
307
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
308
- }>>;
309
- emit: (event: "update:show", ...args: any[]) => void;
310
- state: any;
311
- vaa07: any;
312
- immediatelyRecording: any;
313
- time: import("vue").Ref<number>;
314
- endType: string;
315
- pause: import("@vueuse/shared").Fn;
316
- resume: import("@vueuse/shared").Fn;
317
- isActive: import("vue").Ref<boolean>;
318
- tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
319
- formattedTime: import("vue").ComputedRef<string>;
320
- checkEnvironment: () => boolean;
321
- start: () => Promise<void>;
322
- handlePause: () => void;
323
- handlePlay: () => void;
324
- handleEnd: (trigger?: string | undefined) => Promise<void>;
325
- NSpace: any;
326
- NButton: any;
327
- NIcon: any;
328
- StopCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
329
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
330
- show: {
331
- type: BooleanConstructor;
332
- };
333
- }>> & {
334
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
335
- }, {
336
- show: boolean;
337
- }>;
338
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
339
- ChatMainInner: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
340
- ChatRight: import("vue").DefineComponent<{}, {
341
- medicalLabel: {
342
- key: string;
343
- title: string;
344
- }[];
345
- state: any;
346
- patientInfo: any;
347
- toolbarConfig: {
348
- toolbarKeys: never[];
349
- };
350
- content: import("vue").Ref<string>;
351
- key: import("vue").Ref<string>;
352
- handleSave: () => Promise<void>;
353
- createMedicalRecord: () => void;
354
- extractContentByTitle: () => AnyObject;
355
- NIcon: any;
356
- NSpace: any;
357
- NButton: any;
358
- Editor: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
359
- editorConfig: {
360
- type: ObjectConstructor;
361
- };
362
- toolbarConfig: {
363
- type: ObjectConstructor;
364
- };
365
- uploadImgUrl: {
366
- type: StringConstructor;
367
- };
368
- isDisabled: {
369
- type: BooleanConstructor;
370
- default: boolean;
371
- };
372
- }, {
373
- editorRef: import("vue").ShallowRef<any>;
374
- renderVN: () => JSX.Element;
375
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
376
- editorConfig: {
377
- type: ObjectConstructor;
378
- };
379
- toolbarConfig: {
380
- type: ObjectConstructor;
381
- };
382
- uploadImgUrl: {
383
- type: StringConstructor;
384
- };
385
- isDisabled: {
386
- type: BooleanConstructor;
387
- default: boolean;
388
- };
389
- }>> & {}, {
390
- isDisabled: boolean;
391
- }>>;
392
- 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<{}>>, {}>;
393
274
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
394
275
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
395
276
  token: {
@@ -407,16 +288,17 @@ declare const _default: import("vue").DefineComponent<{
407
288
  };
408
289
  queryData: {
409
290
  type: PropType<QueryData>;
291
+ reuired: boolean;
410
292
  };
411
293
  queryRecord: {
412
294
  type: PropType<QueryRecord>;
295
+ reuired: boolean;
413
296
  };
414
297
  hideInput: {
415
298
  type: BooleanConstructor;
416
299
  };
417
300
  uiStyle: {
418
301
  type: StringConstructor;
419
- default: string;
420
302
  };
421
303
  audioTimed: {
422
304
  type: NumberConstructor;
@@ -440,22 +322,10 @@ declare const _default: import("vue").DefineComponent<{
440
322
  appId: {
441
323
  type: StringConstructor;
442
324
  };
443
- orgId: {
444
- type: StringConstructor;
445
- };
446
- userId: {
447
- type: StringConstructor;
448
- };
449
- immediatelyRecording: {
450
- type: BooleanConstructor;
451
- default: boolean;
452
- };
453
325
  }>> & {
454
326
  "onButton-click"?: ((...args: any[]) => any) | undefined;
455
327
  }, {
456
328
  hideInput: boolean;
457
- uiStyle: string;
458
329
  audioTimed: number;
459
- immediatelyRecording: boolean;
460
330
  }>;
461
331
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,reactive as o,provide as i,toRefs as n,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.defaults.timeout=5e3,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,refreshMedical:!1});return i(g,{...n(_),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}))}),i(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 e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as a,createElementBlock as i,normalizeClass as n,normalizeStyle as u,unref as l,createVNode as p,withCtx as d,createBlock as m,createCommentVNode as c}from"vue";import{NMessageProvider as h}from"naive-ui";import y from"./components/ChatMain.js";import f from"./components/ChatFooter.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"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as x,InjectionAIChatEmits as g}from"./types/index.js";import j from"axios";const k=["id"];var P=e({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object},appId:{type:String}},emits:["button-click"],setup(e,{expose:P,emit:I}){const b=e,A=v(),C=j.create({headers:{Authorization:"bearer "+b.token}});C.interceptors.response.use((e=>{var t;return(null==(t=e.data)?void 0:t.success)?e.data:{success:!1,data:[]}}));const F=t({id:"ai-chat-"+S(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1});return o(x,{...r(b),state:F,isSmall:s((()=>"small"===b.uiStyle)),axiosInstance:C}),o(g,I),P({pushMessage:e=>{F.externalData=e},updatePatientInfo:e=>{F.selectedPatient=e}}),(t,o)=>(a(),i("div",{id:F.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:u(l(A))},[p(l(h),null,{default:d((()=>[p(l(y)),e.hideInput?c("v-if",!0):(a(),m(f,{key:0}))])),_:1})],14,k))}});export{P 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};
@@ -2,12 +2,6 @@ import { CommandItem } from '../types';
2
2
  import { CAudioSDK } from '../../../../components/audio-sdk';
3
3
  import { AnyObject } from '../../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{}, {
5
- innerDefaultShortcutList: {
6
- key: string;
7
- value: string;
8
- }[];
9
- programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
10
- MedicalOrderId: string;
11
5
  cssVars: import("vue").ComputedRef<AnyObject>;
12
6
  audioSdk: CAudioSDK;
13
7
  emit: (event: string, ...args: any[]) => void;
@@ -16,8 +10,6 @@ declare const _default: import("vue").DefineComponent<{}, {
16
10
  isSmall: any;
17
11
  audioTimed: any;
18
12
  commandList: any;
19
- isInner: any;
20
- patientInfo: any;
21
13
  inputRef: import("vue").Ref<any>;
22
14
  showPopover: import("vue").Ref<boolean>;
23
15
  breadcrumb: import("vue").Ref<{
@@ -37,16 +29,13 @@ declare const _default: import("vue").DefineComponent<{}, {
37
29
  showPrompt: import("vue").Ref<boolean>;
38
30
  currentShortcutId: import("vue").Ref<string>;
39
31
  showPatient: import("vue").Ref<boolean>;
40
- showAudio: import("vue").Ref<boolean>;
41
- placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
32
+ placeholder: import("vue").ComputedRef<"请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
42
33
  btnDisabled: import("vue").ComputedRef<any>;
43
34
  showMagicWand: import("vue").ComputedRef<boolean>;
44
35
  patient: import("vue").ComputedRef<string>;
45
- currentShortcutList: import("vue").ComputedRef<any>;
46
- isAllDisabled: import("vue").ComputedRef<any>;
47
36
  recorderStart: () => Promise<void>;
48
37
  getShortcutName: (item: string | AnyObject) => any;
49
- handleShortcut: (item: string | AnyObject) => Promise<void>;
38
+ handleShortcut: (item: string | AnyObject) => void;
50
39
  resetCurrentCommand: () => void;
51
40
  handleKeyDown: (event: KeyboardEvent) => void;
52
41
  isWrap: (event: KeyboardEvent) => boolean;
@@ -166,47 +155,5 @@ declare const _default: import("vue").DefineComponent<{}, {
166
155
  }, {
167
156
  show: boolean;
168
157
  }>;
169
- ChatAudio: import("vue").DefineComponent<{
170
- show: {
171
- type: BooleanConstructor;
172
- };
173
- }, {
174
- audioSdk: CAudioSDK;
175
- props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
176
- show: {
177
- type: BooleanConstructor;
178
- };
179
- }>> & {
180
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
181
- }>>;
182
- emit: (event: "update:show", ...args: any[]) => void;
183
- state: any;
184
- vaa07: any;
185
- immediatelyRecording: any;
186
- time: import("vue").Ref<number>;
187
- endType: string;
188
- pause: import("@vueuse/shared").Fn;
189
- resume: import("@vueuse/shared").Fn;
190
- isActive: import("vue").Ref<boolean>;
191
- tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
192
- formattedTime: import("vue").ComputedRef<string>;
193
- checkEnvironment: () => boolean;
194
- start: () => Promise<void>;
195
- handlePause: () => void;
196
- handlePlay: () => void;
197
- handleEnd: (trigger?: string | undefined) => Promise<void>;
198
- NSpace: any;
199
- NButton: any;
200
- NIcon: any;
201
- StopCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
202
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
203
- show: {
204
- type: BooleanConstructor;
205
- };
206
- }>> & {
207
- "onUpdate:show"?: ((...args: any[]) => any) | undefined;
208
- }, {
209
- show: boolean;
210
- }>;
211
158
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
212
159
  export default _default;
@@ -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 t,ref as o,computed as n,onBeforeUnmount as l,watch as s,openBlock as a,createElementBlock as i,normalizeClass as r,unref as u,createElementVNode as d,createBlock as c,withCtx as v,createVNode as m,createTextVNode as h,toDisplayString as p,createCommentVNode as f,Fragment as k,renderList as w,createSlots as g,withModifiers as C,getCurrentInstance as y}from"vue";import{NButton as b,NIcon as x,NPopover as _,NInput as I,NTag as j,NBreadcrumb as z,NBreadcrumbItem as P}from"naive-ui";import{PeopleOutline as D,SparklesSharp as M,PaperPlane as T,ChevronBack as K,ChevronForward as L}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as B}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as R,last as E}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 F from"./ChatPrompt.vue.js";import N from"./ChatPatient.vue.js";const q={class:"menu-box fillet-8"},H={class:"input-wrapper fillet-10"},V=d("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),d("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),d("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),G={key:0,class:"btn-box"},J=["disabled"],O={class:"command-box"},Q={class:"command-box__header"},X={key:0,class:"title"},Y={class:"command-box__menu"},Z=["onMouseover","onClick"],$={class:"label"},ee={class:"remark"};var te=e({__name:"ChatFooter",setup(e){const te=W(),oe=U.create(),ne=t(S),{shortcutList:le,state:se,isSmall:ae,audioTimed:ie,commandList:re}=t(B),ue=o(),de=o(!1),ce=o([]),ve=o(A(re.value||[])),me=o(!1),he=o(""),pe=o(!1),fe=n((()=>ae?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),ke=n((()=>se.loading||!se.sendContent.replace(/(&nbsp;|\s|<br>)+/g,""))),we=n((()=>{var e;return!se.sendContent&&!(null==(e=ue.value)?void 0:e.activated.value)})),ge=n((()=>{var e,t;if(!se.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:o,vaa05:n}=se.selectedPatient;let l="";o&&(l+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));return n&&(l+=(!l||l.endsWith("/")?"":"/")+n),l}));async function Ce(){try{const e=await oe.start(y(),{allowPunctuationMark:!1,timed:ie.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;se.sendContent=t}catch(e){console.log(e)}}function ye(e){var t;if(R(e))return e;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return o.instructionName}function be(){var e;de.value=!1,ve.value=A(re.value||[]),ce.value=[],(null==(e=re.value)?void 0:e.length)&&(de.value=!0,he.value=ve.value[0].shortcutId)}function xe(e){if(!["Slash","NumpadDivide"].includes(e.code)||se.selectedCommand||se.sendContent)if("Backspace"===e.key)de.value=!1,!se.sendContent.startsWith("/")&&!se.sendContent.startsWith("、")||2!==se.sendContent.length||se.selectedCommand?!se.sendContent&&se.selectedCommand&&(e.preventDefault(),se.selectedCommand=null,se.sendContent="/",be()):be();else if(de.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=ve.value.findIndex((e=>e.shortcutId===he.value));if("ArrowUp"===e.key){const e=t>0?t-1:ve.value.length-1;he.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<ve.value.length-1?t+1:0;he.value=ve.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),de.value){je(ve.value.find((e=>e.shortcutId===he.value)))}else Ie()}else de.value=!1;else be()}function _e(e){!e&&se.selectedPrompt&&(se.selectedPrompt=null)}function Ie(){ke.value||(se.sending=!0,se.loading=!0)}function je(e){var t;he.value=e.shortcutId,ue.value.focus(),(null==(t=e.children)?void 0:t.length)?(ve.value=e.children,he.value=ve.value[0].shortcutId,ce.value.push(e)):(se.selectedCommand=e||{},de.value=!1,se.sendContent="")}function ze(){var e;ce.value.pop(),ve.value=E(ce.value)?null==(e=E(ce.value))?void 0:e.children:A(re.value||[]),he.value=ve.value[0].shortcutId,ue.value.focus()}function Pe(e){e||(se.showPatient=!1)}return l((()=>{oe.destroy()})),s((()=>se.showPatient),(e=>{e&&(pe.value=e)})),(e,t)=>(a(),i("section",{class:r(["chat-footer",u(se).loading?"disabled":""])},[d("div",q,[u(ae)?f("v-if",!0):(a(),c(u(b),{key:0,secondary:"",size:"small",onClick:t[0]||(t[0]=()=>pe.value=!0)},{icon:v((()=>[m(u(x),{color:u(te)["--c-primary-color"],size:"20",component:u(D)},null,8,["color","component"])])),default:v((()=>[h(" "+p(u(ge)),1)])),_:1})),u(le)&&u(le).length>0?(a(!0),i(k,{key:1},w(u(le),(e=>(a(),c(u(b),{secondary:"",size:"small",round:u(ae),key:ye(e),onClick:()=>function(e){var t;if(R(e))se.sendContent=e;else{const o=null==(t=null==e?void 0:e.contents)?void 0:t[0];ne("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[h(p(ye(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(u(_),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:de.value,onClickoutside:t[3]||(t[3]=e=>de.value=!1)},{trigger:v((()=>[d("div",H,[m(u(I),{ref_key:"inputRef",ref:ue,placeholder:u(fe),type:"textarea",autosize:{minRows:u(ae)?1:2,maxRows:7},disabled:u(se).loading,value:u(se).sendContent,"onUpdate:value":t[2]||(t[2]=e=>u(se).sendContent=e),onKeydownCapture:xe,onInput:_e},g({prefix:v((()=>[u(se).selectedCommand&&u(se).selectedCommand.shortcutTitle?(a(),c(u(j),{key:0,bordered:!1,color:{textColor:u(te)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(u(se).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):u(we)?(a(),c(u(b),{key:1,text:"",onClick:t[1]||(t[1]=()=>me.value=!0)},{default:v((()=>[m(u(x),{color:"#8f66f7",size:"18",component:u(M)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:2},[u(ae)?{name:"suffix",fn:v((()=>[m(u(b),{text:"",disabled:u(se).loading,onClick:Ce},{icon:v((()=>[m(u(x),{size:"30"},{default:v((()=>[V])),_:1})])),_:1},8,["disabled"]),m(u(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:u(ke),onClick:Ie},{icon:v((()=>[m(u(x),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),key:"0"}:void 0]),1032,["placeholder","autosize","disabled","value"]),u(ae)?f("v-if",!0):(a(),i("div",G,[d("span",{class:r(["btn-send","gradient","fillet-8",u(ke)?"disabled":""]),disabled:u(ke),onClick:Ie},[m(u(x),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,J)]))])])),default:v((()=>{var e;return[d("div",O,[d("div",Q,[0===ce.value.length?(a(),i("span",X,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(a(),i(k,{key:1},[m(u(b),{text:"",onClick:ze},{default:v((()=>[m(u(x),{color:"#999",size:"20",component:u(K)},null,8,["component"])])),_:1}),m(u(z),null,{default:v((()=>[(a(!0),i(k,null,w(ce.value,(e=>(a(),c(u(P),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),d("div",Y,[(a(!0),i(k,null,w(ve.value,(e=>(a(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",he.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>he.value=e.shortcutId),["stop"]),onClick:()=>je(e)},[d("span",$,p(e.shortcutTitle),1),d("span",ee,p(e.shortcutDescription),1),e.children&&e.children.length?(a(),c(u(x),{key:0,color:"#999",size:"20",component:u(L)},null,8,["component"])):f("v-if",!0)],42,Z)))),128))])])]})),_:1},8,["show"]),m(F,{show:me.value,"onUpdate:show":t[4]||(t[4]=e=>me.value=e)},null,8,["show"]),m(N,{show:pe.value,"onUpdate:show":[t[5]||(t[5]=e=>pe.value=e),Pe]},null,8,["show"])],2))}});export{te as default};
@@ -1,2 +1,8 @@
1
- declare const _default: import("vue").DefineComponent<{}, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
2
+ [x: string]: unknown;
3
+ }>>, () => JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
4
+ [x: string]: unknown;
5
+ }>>>> & {}, {
6
+ readonly [x: number]: string;
7
+ } | {}>;
2
8
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as w,has as b}from"lodash-es";import{uuidGenerator as y}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import I from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function k(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var L=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:u,slots:L,emit:T}){const B=n(m),{userAvatar:E,queryData:P,state:S,queryRecord:z,defaultShortcutList:M,hideInput:D=!1,isSmall:O}=n(g),A=t(null),q=t([]),H=t(!1),N=t(!1),R=t(),U=l((()=>O.value?f:p)),_={page:0,hasMore:!0};async function F(e=!1){if(!_.hasMore)return;_.page++,1==_.page&&(q.value=[]);const{records:n,rows:t}=await z.value({page:_.page});h(t)&&q.value.length<=+n&&(q.value=_.page>1?[...q.value,...t]:t,K(),q.value.length>=+n&&(e&&(H.value=!0),_.hasMore=!1,console.log("没有更多消息了")))}async function J(){var e,n;q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),null==(e=A.value)||e.scrollTo({top:0,behavior:"auto"}),K();const t=S.selectedCommand,l=S.selectedPrompt;S.selectedCommand=null,S.selectedPrompt=null;const o=await P.value({content:S.sendContent,contentType:"text",command:t,prompt:l,patient:S.selectedPatient});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await i(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),S.selectedPatientLabel="",S.selectedPatientForm=null,S.sending=!1,S.loading=!1,S.sendContent=""}function G(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)G(e.childrens[l],n,t)}else t.push(e)}function K(){q.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!j(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{G(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function Q(e,n,t,l){const{contentType:o,content:a}=n;return"json"===o&&a?s(I,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(R.value={item:t,msgItem:l},void(N.value=!0)):l?(B("button-click",e),void(l.disabled=!0)):void(t.link||(S.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",S.sending=!0,S.loading=!0))}({item:e,msgItem:n,...t})},null):null}function V(e,n){const{contents:t=[],buttonType:l="",configs:o={},msgId:a=""}=e,i=Q(e,t[n],o,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)]))]}function W({role:e=""}){return"user"===e}function X(){var e,n;let t;return s("div",{class:"message-item"},[s(r,{round:!0,size:O.value?64:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),s("p",null,[a("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),a("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[a((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.195"))||"你可以试着问我:")]),s(c,{"wrap-item":!1},k(t=M.value.map((e=>s(v,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.loading},k(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return C(A,(()=>{F()}),D.value?"bottom":"top"),F(!0),o((()=>S.externalData),(e=>{var n,t;e&&(b(n=e,"msgId")||(n.msgId=y()),q.value.unshift(n),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),S.loading=!1,S.externalData=null)})),o((()=>S.sending),(e=>{var n,t,l,o,s,a,i;if(e){if(q.value.length>0&&[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.428"))||"确认",(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定"].includes(S.sendContent)){const e=null==(s=null==(l=q.value[0])?void 0:l.contents)?void 0:s[(null==(o=q.value[0].contents)?void 0:o.length)-1];return(null==(a=e.content)?void 0:a.body)&&!e.disabled?(null==(i=document.getElementById(q.value[0].msgId))||i.click(),void setTimeout((()=>{q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),S.selectedCommand=null,S.selectedPrompt=null,S.sending=!1,S.sendContent=""}))):void J()}J()}})),()=>[s("section",{class:"chat-main",ref:A,style:{"flex-direction":D.value?"column":"column-reverse"}},[[S.loading?s("div",{class:"message-item"},[[O.value?null:s(r,{round:!0,size:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[a("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item",key:e.msgId+t},[[O.value?null:s(r,{round:!0,size:40,src:W(n)?E.value:U.value},null),s("div",{class:["content-box",W(n)?"mine":""]},[s("div",{class:"content"},[w(n.render)?n.render():V(e,t)])])]]))))),H.value?X():null]]),s(x,{show:N.value,"onUpdate:show":e=>N.value=e,data:R.value},null)]}});export{L as default};
1
+ import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as w,has as b}from"lodash-es";import{uuidGenerator as y}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import I from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function k(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var L=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],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,2 +1 @@
1
- export declare const $message: import("naive-ui").MessageApi;
2
1
  export declare function isValidJSON(str: string): boolean;
@@ -1 +1 @@
1
- import{createDiscreteApi as e}from"naive-ui";const{message:r}=e(["message"]);function t(e){try{return JSON.parse(e),!0}catch(e){return!1}}export{r as $message,t as isValidJSON};
1
+ function r(r){try{return JSON.parse(r),!0}catch(r){return!1}}export{r as isValidJSON};