cnhis-design-vue 3.2.17-release.1 → 3.2.18-beta.6

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 (94) hide show
  1. package/es/components/ai-chat/index.d.ts +123 -17
  2. package/es/components/ai-chat/src/Index.vue.d.ts +123 -17
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/api/index.d.ts +5 -0
  5. package/es/components/ai-chat/src/api/index.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +40 -0
  7. package/es/components/ai-chat/src/components/ChatAudio.vue.js +1 -0
  8. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  10. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +45 -2
  11. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  12. package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -7
  13. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  14. package/es/components/ai-chat/src/components/ChatMainInner.d.ts +2 -0
  15. package/es/components/ai-chat/src/components/ChatMainInner.js +1 -0
  16. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +55 -0
  17. package/es/components/ai-chat/src/components/ChatRight.vue.js +1 -0
  18. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -0
  19. package/es/components/ai-chat/src/components/card/JsonCard.d.ts +25 -0
  20. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -0
  21. package/es/components/ai-chat/src/components/card/SelectIcon.d.ts +14 -0
  22. package/es/components/ai-chat/src/components/card/SelectIcon.js +1 -0
  23. package/es/components/ai-chat/src/hooks/useProgram.d.ts +6 -0
  24. package/es/components/ai-chat/src/hooks/useProgram.js +1 -0
  25. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +2 -0
  26. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -0
  27. package/es/components/ai-chat/style/index.css +1 -1
  28. package/es/components/audio-sdk/src/audioSDK.d.ts +5 -3
  29. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  30. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +2 -1
  31. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  32. package/es/components/button-print/index.d.ts +1 -0
  33. package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
  34. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
  35. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  36. package/es/components/editor/src/Editor.js +1 -1
  37. package/es/components/editor/style/index.css +1 -0
  38. package/es/components/field-set/index.d.ts +3 -2
  39. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -0
  40. package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -0
  41. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -0
  42. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  43. package/es/components/field-set/src/Index.vue.d.ts +3 -2
  44. package/es/components/field-set/src/Index.vue2.js +1 -1
  45. package/es/components/field-set/src/types/index.d.ts +1 -0
  46. package/es/components/field-set/style/index.css +1 -1
  47. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  48. package/es/components/iho-chat/index.d.ts +155 -3
  49. package/es/components/iho-chat/src/Index.vue.d.ts +155 -3
  50. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  51. package/es/components/iho-chat/src/api/index.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +9 -0
  53. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  54. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -1
  55. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  56. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +22 -0
  57. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  58. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +32 -1
  59. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -3
  60. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
  62. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  63. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +1 -0
  64. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
  65. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  66. package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +1 -0
  67. package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +59 -0
  68. package/es/components/iho-chat/src/components/MessageMergeForward.vue.js +1 -0
  69. package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -0
  70. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +10 -0
  71. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -0
  72. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -0
  73. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
  74. package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
  75. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  76. package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
  77. package/es/components/iho-chat/src/types/index.d.ts +1 -0
  78. package/es/components/iho-chat/src/utils/index.d.ts +1 -0
  79. package/es/components/iho-chat/src/utils/index.js +1 -1
  80. package/es/components/iho-chat/style/iconfont.ttf +0 -0
  81. package/es/components/iho-chat/style/index.css +1 -1
  82. package/es/components/index.css +1 -1
  83. package/es/components/select-label/style/index.css +1 -1
  84. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  85. package/es/components/select-person/src/index.vue2.js +1 -1
  86. package/es/components/select-person/style/index.css +1 -1
  87. package/es/components/shortcut-provider/src/types/index.d.ts +3 -0
  88. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  89. package/es/shared/assets/img/file-emr.png.js +1 -0
  90. package/es/shared/assets/img/file.png.js +1 -0
  91. package/es/shared/assets/img/use.png.js +1 -0
  92. package/es/shared/package.json.js +1 -1
  93. package/es/shared/utils/index.js +1 -1
  94. package/package.json +2 -2
@@ -15,17 +15,16 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
15
15
  };
16
16
  queryData: {
17
17
  type: import("vue").PropType<import("./src/types").QueryData>;
18
- reuired: boolean;
19
18
  };
20
19
  queryRecord: {
21
20
  type: import("vue").PropType<import("./src/types").QueryRecord>;
22
- reuired: boolean;
23
21
  };
24
22
  hideInput: {
25
23
  type: BooleanConstructor;
26
24
  };
27
25
  uiStyle: {
28
26
  type: StringConstructor;
27
+ default: string;
29
28
  };
30
29
  audioTimed: {
31
30
  type: NumberConstructor;
@@ -49,6 +48,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
49
48
  appId: {
50
49
  type: StringConstructor;
51
50
  };
51
+ orgId: {
52
+ type: StringConstructor;
53
+ };
54
+ userId: {
55
+ type: StringConstructor;
56
+ };
52
57
  }, {
53
58
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
54
59
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -67,17 +72,16 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
67
72
  };
68
73
  queryData: {
69
74
  type: import("vue").PropType<import("./src/types").QueryData>;
70
- reuired: boolean;
71
75
  };
72
76
  queryRecord: {
73
77
  type: import("vue").PropType<import("./src/types").QueryRecord>;
74
- reuired: boolean;
75
78
  };
76
79
  hideInput: {
77
80
  type: BooleanConstructor;
78
81
  };
79
82
  uiStyle: {
80
83
  type: StringConstructor;
84
+ default: string;
81
85
  };
82
86
  audioTimed: {
83
87
  type: NumberConstructor;
@@ -101,21 +105,22 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
101
105
  appId: {
102
106
  type: StringConstructor;
103
107
  };
108
+ orgId: {
109
+ type: StringConstructor;
110
+ };
111
+ userId: {
112
+ type: StringConstructor;
113
+ };
104
114
  }>> & {
105
115
  "onButton-click"?: ((...args: any[]) => any) | undefined;
106
116
  }>>;
107
- axiosInstance: import("axios").AxiosInstance;
108
117
  emit: (event: "button-click", ...args: any[]) => void;
118
+ showSmallStyle: import("vue").ComputedRef<boolean>;
109
119
  state: import("../../shared/types").AnyObject;
110
- NMessageProvider: any;
111
- ChatMain: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
112
- [x: string]: unknown;
113
- }>>, () => 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<{
114
- [x: string]: unknown;
115
- }>>>> & {}, {
116
- readonly [x: number]: string;
117
- } | {}>;
120
+ 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<{}>>, {}>;
118
121
  ChatFooter: import("vue").DefineComponent<{}, {
122
+ programMethod: (bpmnProcessId: string, params: import("../../shared/types").AnyObject) => Promise<any>;
123
+ MedicalOrderId: string;
119
124
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
120
125
  audioSdk: import("..").CAudioSDK;
121
126
  emit: (event: string, ...args: any[]) => void;
@@ -124,6 +129,8 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
124
129
  isSmall: any;
125
130
  audioTimed: any;
126
131
  commandList: any;
132
+ isInner: any;
133
+ patientInfo: any;
127
134
  inputRef: import("vue").Ref<any>;
128
135
  showPopover: import("vue").Ref<boolean>;
129
136
  breadcrumb: import("vue").Ref<{
@@ -143,13 +150,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
143
150
  showPrompt: import("vue").Ref<boolean>;
144
151
  currentShortcutId: import("vue").Ref<string>;
145
152
  showPatient: import("vue").Ref<boolean>;
146
- placeholder: import("vue").ComputedRef<"请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
153
+ showAudio: import("vue").Ref<boolean>;
154
+ placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
147
155
  btnDisabled: import("vue").ComputedRef<any>;
148
156
  showMagicWand: import("vue").ComputedRef<boolean>;
149
157
  patient: import("vue").ComputedRef<string>;
150
158
  recorderStart: () => Promise<void>;
151
159
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
152
- handleShortcut: (item: string | import("../../shared/types").AnyObject) => void;
160
+ handleShortcut: (item: string | import("../../shared/types").AnyObject) => Promise<void>;
153
161
  resetCurrentCommand: () => void;
154
162
  handleKeyDown: (event: KeyboardEvent) => void;
155
163
  isWrap: (event: KeyboardEvent) => boolean;
@@ -269,6 +277,98 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
269
277
  }, {
270
278
  show: boolean;
271
279
  }>;
280
+ ChatAudio: import("vue").DefineComponent<{
281
+ show: {
282
+ type: BooleanConstructor;
283
+ };
284
+ }, {
285
+ audioSdk: import("..").CAudioSDK;
286
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
287
+ show: {
288
+ type: BooleanConstructor;
289
+ };
290
+ }>> & {
291
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
292
+ }>>;
293
+ emit: (event: "update:show", ...args: any[]) => void;
294
+ state: any;
295
+ time: import("vue").Ref<number>;
296
+ pause: import("@vueuse/shared").Fn;
297
+ resume: import("@vueuse/shared").Fn;
298
+ isActive: import("vue").Ref<boolean>;
299
+ tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
300
+ formattedTime: import("vue").ComputedRef<string>;
301
+ start: () => Promise<void>;
302
+ handlePause: () => void;
303
+ handlePlay: () => void;
304
+ handleEnd: () => Promise<void>;
305
+ NSpace: any;
306
+ NButton: any;
307
+ NIcon: any;
308
+ 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<{}>>, {}>;
309
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
310
+ show: {
311
+ type: BooleanConstructor;
312
+ };
313
+ }>> & {
314
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
315
+ }, {
316
+ show: boolean;
317
+ }>;
318
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
319
+ 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<{}>>, {}>;
320
+ ChatRight: import("vue").DefineComponent<{}, {
321
+ medicalLabel: {
322
+ key: string;
323
+ title: string;
324
+ }[];
325
+ emit: (event: string, ...args: any[]) => void;
326
+ state: any;
327
+ toolbarConfig: {
328
+ toolbarKeys: string[];
329
+ };
330
+ content: import("vue").Ref<string>;
331
+ handleSave: () => Promise<void>;
332
+ createMedicalRecord: () => void;
333
+ extractContentByTitle: () => import("../../shared/types").AnyObject;
334
+ NIcon: any;
335
+ NSpace: any;
336
+ NButton: any;
337
+ Editor: SFCWithInstall<import("vue").DefineComponent<{
338
+ editorConfig: {
339
+ type: ObjectConstructor;
340
+ };
341
+ toolbarConfig: {
342
+ type: ObjectConstructor;
343
+ };
344
+ uploadImgUrl: {
345
+ type: StringConstructor;
346
+ };
347
+ isDisabled: {
348
+ type: BooleanConstructor;
349
+ default: boolean;
350
+ };
351
+ }, {
352
+ editorRef: import("vue").ShallowRef<any>;
353
+ renderVN: () => JSX.Element;
354
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
355
+ editorConfig: {
356
+ type: ObjectConstructor;
357
+ };
358
+ toolbarConfig: {
359
+ type: ObjectConstructor;
360
+ };
361
+ uploadImgUrl: {
362
+ type: StringConstructor;
363
+ };
364
+ isDisabled: {
365
+ type: BooleanConstructor;
366
+ default: boolean;
367
+ };
368
+ }>> & {}, {
369
+ isDisabled: boolean;
370
+ }>>;
371
+ 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<{}>>, {}>;
272
372
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
273
373
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
274
374
  token: {
@@ -286,17 +386,16 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
286
386
  };
287
387
  queryData: {
288
388
  type: import("vue").PropType<import("./src/types").QueryData>;
289
- reuired: boolean;
290
389
  };
291
390
  queryRecord: {
292
391
  type: import("vue").PropType<import("./src/types").QueryRecord>;
293
- reuired: boolean;
294
392
  };
295
393
  hideInput: {
296
394
  type: BooleanConstructor;
297
395
  };
298
396
  uiStyle: {
299
397
  type: StringConstructor;
398
+ default: string;
300
399
  };
301
400
  audioTimed: {
302
401
  type: NumberConstructor;
@@ -320,10 +419,17 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
320
419
  appId: {
321
420
  type: StringConstructor;
322
421
  };
422
+ orgId: {
423
+ type: StringConstructor;
424
+ };
425
+ userId: {
426
+ type: StringConstructor;
427
+ };
323
428
  }>> & {
324
429
  "onButton-click"?: ((...args: any[]) => any) | undefined;
325
430
  }, {
326
431
  hideInput: boolean;
432
+ uiStyle: string;
327
433
  audioTimed: number;
328
434
  }>>;
329
435
  export default AiChat;
@@ -17,17 +17,16 @@ declare const _default: import("vue").DefineComponent<{
17
17
  };
18
18
  queryData: {
19
19
  type: PropType<QueryData>;
20
- reuired: boolean;
21
20
  };
22
21
  queryRecord: {
23
22
  type: PropType<QueryRecord>;
24
- reuired: boolean;
25
23
  };
26
24
  hideInput: {
27
25
  type: BooleanConstructor;
28
26
  };
29
27
  uiStyle: {
30
28
  type: StringConstructor;
29
+ default: string;
31
30
  };
32
31
  audioTimed: {
33
32
  type: NumberConstructor;
@@ -51,6 +50,12 @@ declare const _default: import("vue").DefineComponent<{
51
50
  appId: {
52
51
  type: StringConstructor;
53
52
  };
53
+ orgId: {
54
+ type: StringConstructor;
55
+ };
56
+ userId: {
57
+ type: StringConstructor;
58
+ };
54
59
  }, {
55
60
  cssVars: import("vue").ComputedRef<AnyObject>;
56
61
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -69,17 +74,16 @@ declare const _default: import("vue").DefineComponent<{
69
74
  };
70
75
  queryData: {
71
76
  type: PropType<QueryData>;
72
- reuired: boolean;
73
77
  };
74
78
  queryRecord: {
75
79
  type: PropType<QueryRecord>;
76
- reuired: boolean;
77
80
  };
78
81
  hideInput: {
79
82
  type: BooleanConstructor;
80
83
  };
81
84
  uiStyle: {
82
85
  type: StringConstructor;
86
+ default: string;
83
87
  };
84
88
  audioTimed: {
85
89
  type: NumberConstructor;
@@ -103,21 +107,22 @@ declare const _default: import("vue").DefineComponent<{
103
107
  appId: {
104
108
  type: StringConstructor;
105
109
  };
110
+ orgId: {
111
+ type: StringConstructor;
112
+ };
113
+ userId: {
114
+ type: StringConstructor;
115
+ };
106
116
  }>> & {
107
117
  "onButton-click"?: ((...args: any[]) => any) | undefined;
108
118
  }>>;
109
- axiosInstance: import("axios").AxiosInstance;
110
119
  emit: (event: "button-click", ...args: any[]) => void;
120
+ showSmallStyle: import("vue").ComputedRef<boolean>;
111
121
  state: AnyObject;
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
- } | {}>;
122
+ 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<{}>>, {}>;
120
123
  ChatFooter: import("vue").DefineComponent<{}, {
124
+ programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
125
+ MedicalOrderId: string;
121
126
  cssVars: import("vue").ComputedRef<AnyObject>;
122
127
  audioSdk: import("../..").CAudioSDK;
123
128
  emit: (event: string, ...args: any[]) => void;
@@ -126,6 +131,8 @@ declare const _default: import("vue").DefineComponent<{
126
131
  isSmall: any;
127
132
  audioTimed: any;
128
133
  commandList: any;
134
+ isInner: any;
135
+ patientInfo: any;
129
136
  inputRef: import("vue").Ref<any>;
130
137
  showPopover: import("vue").Ref<boolean>;
131
138
  breadcrumb: import("vue").Ref<{
@@ -145,13 +152,14 @@ declare const _default: import("vue").DefineComponent<{
145
152
  showPrompt: import("vue").Ref<boolean>;
146
153
  currentShortcutId: import("vue").Ref<string>;
147
154
  showPatient: import("vue").Ref<boolean>;
148
- placeholder: import("vue").ComputedRef<"请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
155
+ showAudio: import("vue").Ref<boolean>;
156
+ placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
149
157
  btnDisabled: import("vue").ComputedRef<any>;
150
158
  showMagicWand: import("vue").ComputedRef<boolean>;
151
159
  patient: import("vue").ComputedRef<string>;
152
160
  recorderStart: () => Promise<void>;
153
161
  getShortcutName: (item: string | AnyObject) => any;
154
- handleShortcut: (item: string | AnyObject) => void;
162
+ handleShortcut: (item: string | AnyObject) => Promise<void>;
155
163
  resetCurrentCommand: () => void;
156
164
  handleKeyDown: (event: KeyboardEvent) => void;
157
165
  isWrap: (event: KeyboardEvent) => boolean;
@@ -271,6 +279,98 @@ declare const _default: import("vue").DefineComponent<{
271
279
  }, {
272
280
  show: boolean;
273
281
  }>;
282
+ ChatAudio: import("vue").DefineComponent<{
283
+ show: {
284
+ type: BooleanConstructor;
285
+ };
286
+ }, {
287
+ audioSdk: import("../..").CAudioSDK;
288
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
289
+ show: {
290
+ type: BooleanConstructor;
291
+ };
292
+ }>> & {
293
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
294
+ }>>;
295
+ emit: (event: "update:show", ...args: any[]) => void;
296
+ state: any;
297
+ time: import("vue").Ref<number>;
298
+ pause: import("@vueuse/shared").Fn;
299
+ resume: import("@vueuse/shared").Fn;
300
+ isActive: import("vue").Ref<boolean>;
301
+ tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
302
+ formattedTime: import("vue").ComputedRef<string>;
303
+ start: () => Promise<void>;
304
+ handlePause: () => void;
305
+ handlePlay: () => void;
306
+ handleEnd: () => Promise<void>;
307
+ NSpace: any;
308
+ NButton: any;
309
+ NIcon: any;
310
+ 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<{}>>, {}>;
311
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
312
+ show: {
313
+ type: BooleanConstructor;
314
+ };
315
+ }>> & {
316
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
317
+ }, {
318
+ show: boolean;
319
+ }>;
320
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
321
+ 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<{}>>, {}>;
322
+ ChatRight: import("vue").DefineComponent<{}, {
323
+ medicalLabel: {
324
+ key: string;
325
+ title: string;
326
+ }[];
327
+ emit: (event: string, ...args: any[]) => void;
328
+ state: any;
329
+ toolbarConfig: {
330
+ toolbarKeys: string[];
331
+ };
332
+ content: import("vue").Ref<string>;
333
+ handleSave: () => Promise<void>;
334
+ createMedicalRecord: () => void;
335
+ extractContentByTitle: () => AnyObject;
336
+ NIcon: any;
337
+ NSpace: any;
338
+ NButton: any;
339
+ Editor: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
340
+ editorConfig: {
341
+ type: ObjectConstructor;
342
+ };
343
+ toolbarConfig: {
344
+ type: ObjectConstructor;
345
+ };
346
+ uploadImgUrl: {
347
+ type: StringConstructor;
348
+ };
349
+ isDisabled: {
350
+ type: BooleanConstructor;
351
+ default: boolean;
352
+ };
353
+ }, {
354
+ editorRef: import("vue").ShallowRef<any>;
355
+ renderVN: () => JSX.Element;
356
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
357
+ editorConfig: {
358
+ type: ObjectConstructor;
359
+ };
360
+ toolbarConfig: {
361
+ type: ObjectConstructor;
362
+ };
363
+ uploadImgUrl: {
364
+ type: StringConstructor;
365
+ };
366
+ isDisabled: {
367
+ type: BooleanConstructor;
368
+ default: boolean;
369
+ };
370
+ }>> & {}, {
371
+ isDisabled: boolean;
372
+ }>>;
373
+ 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<{}>>, {}>;
274
374
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
275
375
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
276
376
  token: {
@@ -288,17 +388,16 @@ declare const _default: import("vue").DefineComponent<{
288
388
  };
289
389
  queryData: {
290
390
  type: PropType<QueryData>;
291
- reuired: boolean;
292
391
  };
293
392
  queryRecord: {
294
393
  type: PropType<QueryRecord>;
295
- reuired: boolean;
296
394
  };
297
395
  hideInput: {
298
396
  type: BooleanConstructor;
299
397
  };
300
398
  uiStyle: {
301
399
  type: StringConstructor;
400
+ default: string;
302
401
  };
303
402
  audioTimed: {
304
403
  type: NumberConstructor;
@@ -322,10 +421,17 @@ declare const _default: import("vue").DefineComponent<{
322
421
  appId: {
323
422
  type: StringConstructor;
324
423
  };
424
+ orgId: {
425
+ type: StringConstructor;
426
+ };
427
+ userId: {
428
+ type: StringConstructor;
429
+ };
325
430
  }>> & {
326
431
  "onButton-click"?: ((...args: any[]) => any) | undefined;
327
432
  }, {
328
433
  hideInput: boolean;
434
+ uiStyle: string;
329
435
  audioTimed: number;
330
436
  }>;
331
437
  export default _default;
@@ -1 +1 @@
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
+ import{defineComponent as e,computed as t,reactive as i,provide as n,toRefs as o,openBlock as r,createElementBlock as s,normalizeStyle as a,unref as u,createElementVNode as l,normalizeClass as p,createBlock as m,createCommentVNode as d}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 S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as v}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}},emits:["button-click"],setup(e,{expose:C,emit:P}){const _=e,b=S();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=i({id:"ai-chat-"+v(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,consultationContent:null,params:{}});return n(g,{...o(_),state:F,isSmall:t((()=>"small"===_.uiStyle)),isInner:t((()=>"inner"===_.uiStyle))}),n(k,P),"inner"===_.uiStyle&&I(_),C({pushMessage:e=>{F.externalData=e},updatePatientInfo:e=>{F.selectedPatient=e}}),(t,i)=>(r(),s("div",{class:"ai-chat",style:a(u(b))},[l("div",{id:F.id,class:p(["ai-chat__main",u(A)?"ai-chat__main--small":"","inner"===e.uiStyle?"ai-chat__main--inner":""])},["inner"===e.uiStyle?(r(),m(u(h),{key:0})):(r(),m(u(c),{key:1})),e.hideInput?d("v-if",!0):(r(),m(y,{key:2}))],10,x),"inner"===e.uiStyle?(r(),m(f,{key:0})):d("v-if",!0)],4))}});export{C as default};
@@ -0,0 +1,5 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ export declare const instanceAxios: import("axios").AxiosInstance;
3
+ export declare function uploadFileApi(params: FormData): import("axios").AxiosPromise<any>;
4
+ export declare function conversationApi(params: AnyObject): import("axios").AxiosPromise<any>;
5
+ export declare function saveApi(params: AnyObject): import("axios").AxiosPromise<any>;
@@ -0,0 +1 @@
1
+ import t from"axios";import{createDiscreteApi as e}from"naive-ui";const{message:a}=e(["message"]),o=t.create({withCredentials:!0,timeout:5e4});function r(t){return o({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/storage-service/storage/uploadFile",data:t})}function s(t){return o({method:"post",url:"/flow/api/opd/conversation",data:t})}function d(t){return o({method:"put",url:"/flow/api/opd/message",data:t})}o.interceptors.response.use((t=>{var e,o,r;if(null==(e=t.data)?void 0:e.success)return null==(o=t.data)?void 0:o.data;500==(null==(r=t.data)?void 0:r.code)&&t.data.msg&&a.error(t.data.msg)}));export{s as conversationApi,o as instanceAxios,d as saveApi,r as uploadFileApi};
@@ -0,0 +1,40 @@
1
+ import { CAudioSDK } from '../../../../components/audio-sdk';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ show: {
4
+ type: BooleanConstructor;
5
+ };
6
+ }, {
7
+ audioSdk: CAudioSDK;
8
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
9
+ show: {
10
+ type: BooleanConstructor;
11
+ };
12
+ }>> & {
13
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
14
+ }>>;
15
+ emit: (event: "update:show", ...args: any[]) => void;
16
+ state: any;
17
+ time: import("vue").Ref<number>;
18
+ pause: import("@vueuse/shared").Fn;
19
+ resume: import("@vueuse/shared").Fn;
20
+ isActive: import("vue").Ref<boolean>;
21
+ tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
22
+ formattedTime: import("vue").ComputedRef<string>;
23
+ start: () => Promise<void>;
24
+ handlePause: () => void;
25
+ handlePlay: () => void;
26
+ handleEnd: () => Promise<void>;
27
+ NSpace: any;
28
+ NButton: any;
29
+ NIcon: any;
30
+ 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<{}>>, {}>;
31
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
32
+ show: {
33
+ type: BooleanConstructor;
34
+ };
35
+ }>> & {
36
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
37
+ }, {
38
+ show: boolean;
39
+ }>;
40
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./ChatAudio.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","ChatAudio.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as o,ref as t,computed as a,watch as n,withDirectives as i,openBlock as r,createElementBlock as s,unref as u,createBlock as c,createCommentVNode as l,createElementVNode as p,toDisplayString as d,normalizeStyle as m,createVNode as f,withCtx as v,createTextVNode as h,vShow as w}from"vue";import{NIcon as y,NSpace as g,NButton as b}from"naive-ui";import{StopCircleOutline as k}from"@vicons/ionicons5";import{InjectionAIChat as F}from"../types/index.js";import{useIntervalFn as C}from"@vueuse/core";import S from"../../../audio-sdk/src/audioSDK.js";import{uploadFileApi as x}from"../api/index.js";import{uuidGenerator as I}from"../../../../shared/utils/index.js";const $={class:"ai-chat__audio"};var j=e({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:j}){const M=e,T=S.create(),{state:z}=o(F),A=t(0),{pause:N,resume:B,isActive:D}=C((()=>{A.value++}),1e3,{immediate:!1}),L=a((()=>D.value?"正在录音中...":"录音已暂停")),q=a((()=>{const e=Math.floor(A.value/3600),o=Math.floor(A.value%3600/60),t=A.value%60,a=o.toString().padStart(2,"0"),n=t.toString().padStart(2,"0");if(e>0){return`${e.toString().padStart(2,"0")}:${a}:${n}`}return`${a}:${n}`}));function K(){N(),T.pause()}function O(){B(),T.resume()}async function U(){T.stop(),j("update:show",!1)}return n((()=>M.show),(e=>{e?(A.value=0,B(),async function(){try{const e=await T.start(_,{timed:1800,recognizable:!1,showModal:!1});j("update:show",!1);const{result:o,data:t}=e||{};if("success"!==o)return;if(t){const e=new File([t],`${I()}.mp3`,{type:t.type}),o=new FormData;o.append("file",e),o.append("channelId","MINIO");const a=await x(o),n=(null==a?void 0:a.path)||"";console.log("音频地址 ==>",n),z.params={contents:[{role:"user",content:"",contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",audioUrl:n,opType:"create_inquiry",configs:{businessType:"CLINICIAN",vaa01:"1876237139894923265",bck03a:"西安接口部",vaa07:"1876237140589948928",bce03d:"李雨淋",bce01d:6008046,vaa05:"老大",vac36:"1736164767794",bck01a:3000519,bck02a:"5013",vae96:"1"}},z.sending=!0,z.loading=!0}}catch(e){console.log(e)}}()):N()}),{immediate:!0}),(o,t)=>i((r(),s("div",$,[u(D)?l("v-if",!0):(r(),c(u(y),{key:0,size:"42",color:"#FF1818",component:u(k)},null,8,["component"])),p("p",null,d(u(L)),1),p("h3",{style:m(u(D)?"":"color: #FF1818")},d(u(q)),5),f(u(g),{"wrap-item":!1,size:15},{default:v((()=>[i(f(u(b),{round:"",onClick:K},{default:v((()=>[h("暂停")])),_:1},512),[[w,u(D)]]),i(f(u(b),{round:"",onClick:O},{default:v((()=>[h("继续")])),_:1},512),[[w,!u(D)]]),f(u(b),{round:"",color:"#FF1818",onClick:U},{default:v((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.77"))||"结束")]})),_:1})])),_:1})],512)),[[w,e.show]])}});export{j 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 b,ChevronForward as h}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"../../../template-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:_}){const C={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:""}),q=a(),A=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),F=e.msgItem.content,H={},B=l(p(F.data||{})),K={beforeRequest(e,t,a){(null==t?void 0:t.params)&&(t.params.vaa05=L.value.selectedPatient.vaa01),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(A.value){const t=F.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:C[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,e.includes("vaa05")&&(i.urlConfig.params.params={vaa05:""})}}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:q,"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:b},null)})]}})]})}async function z(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),F.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,_("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 V(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=F.settings)?void 0:e.id)||!F.data)return null;const t=JSON.parse(F.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(F.data[l])||JSON.parse(F.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:h},null),default:()=>"查看更多"}))}return o((()=>w.showPatient),(t=>{!e.msgItem.disabled&&A.value&&!t&&w.selectedPatientLabel&&L.value&&(N.vaa05=w.selectedPatientLabel,L.value.selectedPatient={...w.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[A.value?[i("p",null,[F.title||F.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:V},null)]]),F.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=A.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(A.value){if(!R.value)return;try{L.value?null==(e=q.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 z(t,e)}})):await z(t)}catch(e){}}else _("button-click")}},{default:()=>[A.value?null==t?void 0:t.text:F.buttonName]})}(t)))]:[i(I,{config:g(null==(t=F.settings)?void 0:t.setting)?JSON.parse(F.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{k 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 b,ChevronForward as h}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 I from"../../../form-render/index.js";import k from"../../../template-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:_,emit:C}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},P=y(),{patientInfo:w,state:O,isSmall:S,appId:j}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),q=a(),A=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),F=e.msgItem.content,H={},B=l(p(F.data||{})),K={beforeRequest(e,t,a){(null==t?void 0:t.params)&&(t.params.vaa05=L.value.selectedPatient.vaa01),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(A.value){const t=F.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[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=w.value.info||O.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,e.includes("vaa05")&&(i.urlConfig.params.params={vaa05:""})}}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:q,"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:b},null)})]}})]})}async function z(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),F.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,C("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 V(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=F.settings)?void 0:e.id)||!F.data)return null;const t=JSON.parse(F.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(F.data[l])||JSON.parse(F.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:h},null),default:()=>"查看更多"}))}return o((()=>O.showPatient),(t=>{!e.msgItem.disabled&&A.value&&!t&&O.selectedPatientLabel&&L.value&&(N.vaa05=O.selectedPatientLabel,L.value.selectedPatient={...O.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[A.value?[i("p",null,[F.title||F.header.title]),i("div",{class:"form-box"},[[J(),i(I,{"request-instance":{get:E.get,post:E.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:V},null)]]),F.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=A.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(A.value){if(!R.value)return;try{L.value?null==(e=q.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 z(t,e)}})):await z(t)}catch(e){}}else C("button-click")}},{default:()=>[A.value?null==t?void 0:t.text:F.buttonName]})}(t)))]:[i(k,{config:g(null==(t=F.settings)?void 0:t.setting)?JSON.parse(F.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{x as default};