cnhis-design-vue 3.3.1-beta.18 → 3.3.1-beta.19

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/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +58 -20
  3. package/es/components/ai-chat/src/Index.vue.d.ts +58 -20
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/api/index.d.ts +2 -0
  6. package/es/components/ai-chat/src/api/index.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +5 -3
  8. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
  10. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
  11. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  12. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +19 -17
  13. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  14. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  15. package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -1
  16. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
  17. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  18. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
  19. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  20. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +3 -2
  21. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
  22. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
  23. package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
  24. package/es/components/ai-chat/src/hooks/index.js +1 -0
  25. package/es/components/ai-chat/src/hooks/useData.d.ts +47 -0
  26. package/es/components/ai-chat/src/hooks/useData.js +1 -0
  27. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +2 -1
  28. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
  29. package/es/components/ai-chat/src/types/index.d.ts +1 -3
  30. package/es/components/ai-chat/src/types/index.js +1 -1
  31. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  32. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  33. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  34. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  35. package/es/components/card-render/src/components/index.d.ts +23 -23
  36. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  37. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  38. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  39. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  40. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  41. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  42. package/es/components/iho-chat/index.d.ts +61 -0
  43. package/es/components/iho-chat/src/Index.vue.d.ts +61 -0
  44. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
  45. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  46. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -0
  47. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -0
  48. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +57 -0
  49. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +1 -0
  50. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +54 -0
  51. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +1 -0
  53. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -0
  54. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  55. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  56. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  57. package/es/env.d.ts +25 -25
  58. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  59. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  60. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  61. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  62. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  63. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  64. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  65. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  66. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  67. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  68. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  69. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  70. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  71. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  72. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  73. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  74. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  75. package/es/shared/assets/img/failure.png.js +1 -1
  76. package/es/shared/assets/img/file-emr.png.js +1 -1
  77. package/es/shared/assets/img/file.png.js +1 -1
  78. package/es/shared/assets/img/logo.png.js +1 -1
  79. package/es/shared/assets/img/no-permission.png.js +1 -1
  80. package/es/shared/assets/img/nodata.png.js +1 -1
  81. package/es/shared/assets/img/notfound.png.js +1 -1
  82. package/es/shared/assets/img/qr.png.js +1 -1
  83. package/es/shared/assets/img/success.png.js +1 -1
  84. package/es/shared/assets/img/table_style_2.png.js +1 -1
  85. package/es/shared/assets/img/use.png.js +1 -1
  86. package/es/shared/assets/img/video.png.js +1 -1
  87. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  88. package/es/shared/assets/img/xb_big.png.js +1 -1
  89. package/es/shared/assets/img/xb_small.png.js +1 -1
  90. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  91. package/es/shared/package.json.js +1 -1
  92. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  93. package/es/shared/utils/tapable/index.d.ts +139 -0
  94. package/package.json +3 -2
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -58,8 +58,11 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
58
58
  type: BooleanConstructor;
59
59
  default: boolean;
60
60
  };
61
+ isStreamingOutput: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
61
65
  }, {
62
- cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
63
66
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
64
67
  token: {
65
68
  type: StringConstructor;
@@ -119,27 +122,55 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
119
122
  type: BooleanConstructor;
120
123
  default: boolean;
121
124
  };
125
+ isStreamingOutput: {
126
+ type: BooleanConstructor;
127
+ default: boolean;
128
+ };
122
129
  }>> & {
123
130
  "onButton-click"?: ((...args: any[]) => any) | undefined;
124
131
  onProgram?: ((...args: any[]) => any) | undefined;
125
132
  }>>;
126
133
  emit: (event: "button-click" | "program", ...args: any[]) => void;
134
+ data: {
135
+ patientInfo: import("vue").Ref<any>;
136
+ queryPrompt: import("vue").Ref<any>;
137
+ queryData: import("vue").Ref<any>;
138
+ queryRecord: import("vue").Ref<any>;
139
+ defaultShortcutList: import("vue").Ref<any>;
140
+ hideInput: import("vue").Ref<any>;
141
+ shortcutList: import("vue").Ref<any>;
142
+ audioTimed: import("vue").Ref<any>;
143
+ commandList: import("vue").Ref<any>;
144
+ appId: import("vue").Ref<any>;
145
+ immediatelyRecording: import("vue").Ref<any>;
146
+ cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
147
+ state: import("../../shared/types").AnyObject;
148
+ isSmall: import("vue").ComputedRef<boolean>;
149
+ isDefault: import("vue").ComputedRef<boolean>;
150
+ vaa07: import("vue").ComputedRef<any>;
151
+ axiosInstance: import("axios").AxiosInstance;
152
+ emit: (event: "button-click" | "program", ...args: any[]) => void;
153
+ appendMessage: (item: import("../../shared/types").AnyObject) => Promise<void>;
154
+ sendMessage: (params?: import("../../shared/types").AnyObject) => Promise<void>;
155
+ };
156
+ cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
127
157
  state: import("../../shared/types").AnyObject;
128
158
  onClose: () => void;
129
159
  NIcon: any;
130
160
  NButton: any;
131
161
  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<{}>>, {}>;
132
162
  ChatFooter: import("vue").DefineComponent<{}, {
133
- cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
134
163
  audioSdk: import("..").CAudioSDK;
135
- emit: (event: string, ...args: any[]) => void;
136
- shortcutList: any;
137
- state: any;
138
- isSmall: any;
139
- audioTimed: any;
140
- commandList: any;
141
- isDefault: any;
142
- patientInfo: any;
164
+ cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
165
+ shortcutList: import("vue").Ref<any>;
166
+ state: import("../../shared/types").AnyObject;
167
+ isSmall: import("vue").ComputedRef<boolean>;
168
+ audioTimed: import("vue").Ref<any>;
169
+ commandList: import("vue").Ref<any>;
170
+ isDefault: import("vue").ComputedRef<boolean>;
171
+ patientInfo: import("vue").Ref<any>;
172
+ emit: (event: "button-click" | "program", ...args: any[]) => void;
173
+ sendMessage: (params?: import("../../shared/types").AnyObject) => Promise<void>;
143
174
  inputRef: import("vue").Ref<any>;
144
175
  showPopover: import("vue").Ref<boolean>;
145
176
  breadcrumb: import("vue").Ref<{
@@ -161,7 +192,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
161
192
  showPatient: import("vue").Ref<boolean>;
162
193
  showAudio: import("vue").Ref<boolean>;
163
194
  placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
164
- isAllDisabled: import("vue").ComputedRef<any>;
195
+ isAllDisabled: import("vue").ComputedRef<boolean>;
165
196
  btnDisabled: import("vue").ComputedRef<any>;
166
197
  showMagicWand: import("vue").ComputedRef<boolean>;
167
198
  patient: import("vue").ComputedRef<string>;
@@ -210,8 +241,8 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
210
241
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
211
242
  }>>;
212
243
  emit: (event: "update:show", ...args: any[]) => void;
213
- queryPrompt: any;
214
- state: any;
244
+ state: import("../../shared/types").AnyObject;
245
+ queryPrompt: import("vue").Ref<any>;
215
246
  listRef: import("vue").Ref<any>;
216
247
  keyword: import("vue").Ref<string>;
217
248
  list: import("vue").Ref<import("../../shared/types").AnyObject[]>;
@@ -249,8 +280,8 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
249
280
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
250
281
  }>>;
251
282
  emit: (event: "update:show", ...args: any[]) => void;
252
- patientInfo: any;
253
- state: any;
283
+ state: import("../../shared/types").AnyObject;
284
+ patientInfo: import("vue").Ref<any>;
254
285
  formValue: {
255
286
  businessType: string;
256
287
  vaa01: null;
@@ -306,9 +337,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
306
337
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
307
338
  }>>;
308
339
  emit: (event: "update:show", ...args: any[]) => void;
309
- state: any;
310
- vaa07: any;
311
- immediatelyRecording: any;
340
+ state: import("../../shared/types").AnyObject;
341
+ vaa07: import("vue").ComputedRef<any>;
342
+ immediatelyRecording: import("vue").Ref<any>;
343
+ sendMessage: (params?: import("../../shared/types").AnyObject) => Promise<void>;
312
344
  time: import("vue").Ref<number>;
313
345
  endType: string;
314
346
  pause: import("@vueuse/shared").Fn;
@@ -339,8 +371,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
339
371
  key: string;
340
372
  title: string;
341
373
  }[];
342
- state: any;
343
- patientInfo: any;
374
+ state: import("../../shared/types").AnyObject;
375
+ patientInfo: import("vue").Ref<any>;
376
+ sendMessage: (params?: import("../../shared/types").AnyObject) => Promise<void>;
344
377
  toolbarConfig: {
345
378
  toolbarKeys: never[];
346
379
  };
@@ -447,6 +480,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
447
480
  type: BooleanConstructor;
448
481
  default: boolean;
449
482
  };
483
+ isStreamingOutput: {
484
+ type: BooleanConstructor;
485
+ default: boolean;
486
+ };
450
487
  }>> & {
451
488
  "onButton-click"?: ((...args: any[]) => any) | undefined;
452
489
  onProgram?: ((...args: any[]) => any) | undefined;
@@ -455,5 +492,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
455
492
  uiStyle: string;
456
493
  audioTimed: number;
457
494
  immediatelyRecording: boolean;
495
+ isStreamingOutput: boolean;
458
496
  }>>;
459
497
  export default AiChat;
@@ -60,8 +60,11 @@ declare const _default: import("vue").DefineComponent<{
60
60
  type: BooleanConstructor;
61
61
  default: boolean;
62
62
  };
63
+ isStreamingOutput: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
63
67
  }, {
64
- cssVars: import("vue").ComputedRef<AnyObject>;
65
68
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
66
69
  token: {
67
70
  type: StringConstructor;
@@ -121,27 +124,55 @@ declare const _default: import("vue").DefineComponent<{
121
124
  type: BooleanConstructor;
122
125
  default: boolean;
123
126
  };
127
+ isStreamingOutput: {
128
+ type: BooleanConstructor;
129
+ default: boolean;
130
+ };
124
131
  }>> & {
125
132
  "onButton-click"?: ((...args: any[]) => any) | undefined;
126
133
  onProgram?: ((...args: any[]) => any) | undefined;
127
134
  }>>;
128
135
  emit: (event: "button-click" | "program", ...args: any[]) => void;
136
+ data: {
137
+ patientInfo: import("vue").Ref<any>;
138
+ queryPrompt: import("vue").Ref<any>;
139
+ queryData: import("vue").Ref<any>;
140
+ queryRecord: import("vue").Ref<any>;
141
+ defaultShortcutList: import("vue").Ref<any>;
142
+ hideInput: import("vue").Ref<any>;
143
+ shortcutList: import("vue").Ref<any>;
144
+ audioTimed: import("vue").Ref<any>;
145
+ commandList: import("vue").Ref<any>;
146
+ appId: import("vue").Ref<any>;
147
+ immediatelyRecording: import("vue").Ref<any>;
148
+ cssVars: import("vue").ComputedRef<AnyObject>;
149
+ state: AnyObject;
150
+ isSmall: import("vue").ComputedRef<boolean>;
151
+ isDefault: import("vue").ComputedRef<boolean>;
152
+ vaa07: import("vue").ComputedRef<any>;
153
+ axiosInstance: import("axios").AxiosInstance;
154
+ emit: (event: "button-click" | "program", ...args: any[]) => void;
155
+ appendMessage: (item: AnyObject) => Promise<void>;
156
+ sendMessage: (params?: AnyObject) => Promise<void>;
157
+ };
158
+ cssVars: import("vue").ComputedRef<AnyObject>;
129
159
  state: AnyObject;
130
160
  onClose: () => void;
131
161
  NIcon: any;
132
162
  NButton: any;
133
163
  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<{}>>, {}>;
134
164
  ChatFooter: import("vue").DefineComponent<{}, {
135
- cssVars: import("vue").ComputedRef<AnyObject>;
136
165
  audioSdk: import("../..").CAudioSDK;
137
- emit: (event: string, ...args: any[]) => void;
138
- shortcutList: any;
139
- state: any;
140
- isSmall: any;
141
- audioTimed: any;
142
- commandList: any;
143
- isDefault: any;
144
- patientInfo: any;
166
+ cssVars: import("vue").ComputedRef<AnyObject>;
167
+ shortcutList: import("vue").Ref<any>;
168
+ state: AnyObject;
169
+ isSmall: import("vue").ComputedRef<boolean>;
170
+ audioTimed: import("vue").Ref<any>;
171
+ commandList: import("vue").Ref<any>;
172
+ isDefault: import("vue").ComputedRef<boolean>;
173
+ patientInfo: import("vue").Ref<any>;
174
+ emit: (event: "button-click" | "program", ...args: any[]) => void;
175
+ sendMessage: (params?: AnyObject) => Promise<void>;
145
176
  inputRef: import("vue").Ref<any>;
146
177
  showPopover: import("vue").Ref<boolean>;
147
178
  breadcrumb: import("vue").Ref<{
@@ -163,7 +194,7 @@ declare const _default: import("vue").DefineComponent<{
163
194
  showPatient: import("vue").Ref<boolean>;
164
195
  showAudio: import("vue").Ref<boolean>;
165
196
  placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
166
- isAllDisabled: import("vue").ComputedRef<any>;
197
+ isAllDisabled: import("vue").ComputedRef<boolean>;
167
198
  btnDisabled: import("vue").ComputedRef<any>;
168
199
  showMagicWand: import("vue").ComputedRef<boolean>;
169
200
  patient: import("vue").ComputedRef<string>;
@@ -212,8 +243,8 @@ declare const _default: import("vue").DefineComponent<{
212
243
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
213
244
  }>>;
214
245
  emit: (event: "update:show", ...args: any[]) => void;
215
- queryPrompt: any;
216
- state: any;
246
+ state: AnyObject;
247
+ queryPrompt: import("vue").Ref<any>;
217
248
  listRef: import("vue").Ref<any>;
218
249
  keyword: import("vue").Ref<string>;
219
250
  list: import("vue").Ref<AnyObject[]>;
@@ -251,8 +282,8 @@ declare const _default: import("vue").DefineComponent<{
251
282
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
252
283
  }>>;
253
284
  emit: (event: "update:show", ...args: any[]) => void;
254
- patientInfo: any;
255
- state: any;
285
+ state: AnyObject;
286
+ patientInfo: import("vue").Ref<any>;
256
287
  formValue: {
257
288
  businessType: string;
258
289
  vaa01: null;
@@ -308,9 +339,10 @@ declare const _default: import("vue").DefineComponent<{
308
339
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
309
340
  }>>;
310
341
  emit: (event: "update:show", ...args: any[]) => void;
311
- state: any;
312
- vaa07: any;
313
- immediatelyRecording: any;
342
+ state: AnyObject;
343
+ vaa07: import("vue").ComputedRef<any>;
344
+ immediatelyRecording: import("vue").Ref<any>;
345
+ sendMessage: (params?: AnyObject) => Promise<void>;
314
346
  time: import("vue").Ref<number>;
315
347
  endType: string;
316
348
  pause: import("@vueuse/shared").Fn;
@@ -341,8 +373,9 @@ declare const _default: import("vue").DefineComponent<{
341
373
  key: string;
342
374
  title: string;
343
375
  }[];
344
- state: any;
345
- patientInfo: any;
376
+ state: AnyObject;
377
+ patientInfo: import("vue").Ref<any>;
378
+ sendMessage: (params?: AnyObject) => Promise<void>;
346
379
  toolbarConfig: {
347
380
  toolbarKeys: never[];
348
381
  };
@@ -449,6 +482,10 @@ declare const _default: import("vue").DefineComponent<{
449
482
  type: BooleanConstructor;
450
483
  default: boolean;
451
484
  };
485
+ isStreamingOutput: {
486
+ type: BooleanConstructor;
487
+ default: boolean;
488
+ };
452
489
  }>> & {
453
490
  "onButton-click"?: ((...args: any[]) => any) | undefined;
454
491
  onProgram?: ((...args: any[]) => any) | undefined;
@@ -457,5 +494,6 @@ declare const _default: import("vue").DefineComponent<{
457
494
  uiStyle: string;
458
495
  audioTimed: number;
459
496
  immediatelyRecording: boolean;
497
+ isStreamingOutput: boolean;
460
498
  }>;
461
499
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,reactive as e,provide as o,toRefs as i,computed as s,openBlock as a,createElementBlock as r,normalizeStyle as n,unref as l,normalizeClass as u,createElementVNode as p,createBlock as d,createCommentVNode as h,withDirectives as m,vShow as c,createVNode as y,withCtx as f,renderSlot as g}from"vue";import{NButton as v,NIcon as S}from"naive-ui";import w from"./components/ChatMain.js";import R from"./components/ChatFooter.vue.js";import k from"./components/ChatRight.vue.js";import j from"./components/ChatMainDefault.js";import{useTheme as I}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as x}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{CloseOutline as C}from"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as P,InjectionAIChatEmits as b}from"./types/index.js";import{axiosInstance as F}from"./api/index.js";import{useWebsocket as q}from"./hooks/useWebsocket.js";const A=["id"],D={class:"chat-right-wrapper"},L={class:"header"},M={class:"content"},_={class:"slot-wrapper"};var z=t({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function},queryRecord:{type:Function},hideInput:{type:Boolean},uiStyle:{type:String,default:"default"},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object},appId:{type:String},orgId:{type:String},userId:{type:String},immediatelyRecording:{type:Boolean,default:!1}},emits:["button-click","program"],setup(t,{expose:z,emit:B}){const T=t,H=I();F.defaults.headers.Authorization="bearer "+T.token;const N=e({id:"ai-chat-"+x(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,showRightSlot:!1,switchFlag:!0,removedMsgId:""});function O(){N.showRight=!1,N.showRightSlot=!1}return o(P,{...i(T),state:N,isSmall:s((()=>"small"===T.uiStyle)),isDefault:s((()=>"default"===T.uiStyle)),vaa07:s((()=>{var t,e;return null==(e=null==(t=T.patientInfo)?void 0:t.info)?void 0:e.vaa07})),axiosInstance:F}),o(b,B),"default"===T.uiStyle&&q(T,N),z({pushMessage:t=>{N.externalData=t},updatePatientInfo:t=>{N.selectedPatient=t},showRight(t){N.showRight=!1,N.showRightSlot=t}}),(e,o)=>(a(),r("div",{style:n(l(H)),class:u(["ai-chat","small"===t.uiStyle?"ai-chat--small":""])},[p("div",{id:N.id,class:"chat-left-wrapper"},["default"===t.uiStyle?(a(),d(l(j),{key:0})):(a(),d(l(w),{key:1})),t.hideInput?h("v-if",!0):(a(),d(R,{key:2}))],8,A),m(p("div",D,[p("div",L,[m(p("h4",null,"问诊记录",512),[[c,N.showRight]]),y(l(v),{quaternary:"",onClick:O},{icon:f((()=>[y(l(S),{size:"20",component:l(C)},null,8,["component"])])),_:1})]),p("div",M,[m(y(k,null,null,512),[[c,N.showRight]]),m(p("div",_,[g(e.$slots,"chat-right")],512),[[c,N.showRightSlot]])])],512),[[c,N.showRight||N.showRightSlot]])],6))}});export{z as default};
1
+ import{defineComponent as t,provide as e,openBlock as o,createElementBlock as i,normalizeStyle as a,unref as s,normalizeClass as r,createElementVNode as n,createBlock as p,createCommentVNode as l,withDirectives as u,vShow as h,createVNode as c,withCtx as m,renderSlot as d}from"vue";import{NButton as y,NIcon as f}from"naive-ui";import g from"./components/ChatMain.js";import S from"./components/ChatFooter.vue.js";import v from"./components/ChatRight.vue.js";import R from"./components/ChatMainDefault.js";import{CloseOutline as w}from"@vicons/ionicons5";import{initData as k,InjectionAIChatData as I}from"./hooks/useData.js";import{useWebsocket as j}from"./hooks/useWebsocket.js";const q=["id"],C={class:"chat-right-wrapper"},b={class:"header"},x={class:"content"},A={class:"slot-wrapper"};var D=t({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function},queryRecord:{type:Function},hideInput:{type:Boolean},uiStyle:{type:String,default:"default"},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object},appId:{type:String},orgId:{type:String},userId:{type:String},immediatelyRecording:{type:Boolean,default:!1},isStreamingOutput:{type:Boolean,default:!1}},emits:["button-click","program"],setup(t,{expose:D,emit:F}){const M=t,B=k(M,F);e(I,B);const{cssVars:L,state:P}=B;function _(){P.showRight=!1,P.showRightSlot=!1}return"default"===M.uiStyle&&j(M,B),D({pushMessage:t=>{P.externalData=t},updatePatientInfo:t=>{P.selectedPatient=t},showRight(t){P.showRight=!1,P.showRightSlot=t}}),(e,k)=>(o(),i("div",{style:a(s(L)),class:r(["ai-chat","small"===t.uiStyle?"ai-chat--small":""])},[n("div",{id:s(P).id,class:"chat-left-wrapper"},["default"===t.uiStyle?(o(),p(s(R),{key:0,ref:"chatMainRef"},null,512)):(o(),p(s(g),{key:1})),t.hideInput?l("v-if",!0):(o(),p(S,{key:2}))],8,q),u(n("div",C,[n("div",b,[u(n("h4",null,"问诊记录",512),[[h,s(P).showRight]]),c(s(y),{quaternary:"",onClick:_},{icon:m((()=>[c(s(f),{size:"20",component:s(w)},null,8,["component"])])),_:1})]),n("div",x,[u(c(v,null,null,512),[[h,s(P).showRight]]),u(n("div",A,[d(e.$slots,"chat-right")],512),[[h,s(P).showRightSlot]])])],512),[[h,s(P).showRight||s(P).showRightSlot]])],6))}});export{D as default};
@@ -4,3 +4,5 @@ export declare function conversationApi(params: AnyObject): import("axios").Axio
4
4
  export declare function saveApi(params: AnyObject): import("axios").AxiosPromise<any>;
5
5
  export declare function deleteApi(params: AnyObject): import("axios").AxiosPromise<any>;
6
6
  export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
7
+ export declare function conversationStreamApi(params: AnyObject): import("axios").AxiosPromise<any>;
8
+ export declare function getSessionMsgApi(params: AnyObject): import("axios").AxiosPromise<any>;
@@ -1 +1 @@
1
- import e from"axios";import{$message as t}from"../utils/index.js";const o=e.create({withCredentials:!0,timeout:5e3});function s(e){return o({method:"post",url:"/flow/api/opd/conversation",data:e})}function a(e){return o({method:"put",url:"/flow/api/opd/message",data:e})}function r(e){return o({method:"delete",url:`/flow/api/opd/message/${e.messageId}`})}function n(e){return o({method:"get",url:`/flow/api/dialog/${e.sessionId}/messages`,params:{page:e.page||1,pageSize:e.pageSize||20}})}o.interceptors.request.use((e=>{var t;if(null==(t=e.url)?void 0:t.includes("/conversation")){const t={...e};return delete t.timeout,t}return e})),o.interceptors.response.use((e=>{var o,s,a,r,n;return(null==(o=e.config.url)?void 0:o.includes("/options"))?(null==(s=e.data)?void 0:s.success)?e.data:{success:!1,data:[]}:(null==(a=e.data)?void 0:a.success)?null==(r=e.data)?void 0:r.data:void(!(null==(n=e.data)?void 0:n.success)&&e.data.msg?t.error(e.data.msg):console.log("请求错误"))}));export{o as axiosInstance,s as conversationApi,r as deleteApi,n as getHistoryRecordApi,a as saveApi};
1
+ import e from"axios";import{$message as t}from"../utils/index.js";const o=e.create({withCredentials:!0,timeout:5e3});function s(e){return o({method:"post",url:"/flow/api/opd/conversation",data:e})}function a(e){return o({method:"put",url:"/flow/api/opd/message",data:e})}function n(e){return o({method:"delete",url:`/flow/api/opd/message/${e.messageId}`})}function r(e){return o({method:"get",url:`/flow/api/dialog/${e.sessionId}/messages`,params:{page:e.page||1,pageSize:e.pageSize||20}})}function i(e){return o({method:"post",url:"/flow/ai/api/conversation",data:e})}function u(e){return o({method:"get",url:"/flow/ai/api/sessionMsg",params:{sessionId:e.sessionId}})}o.interceptors.request.use((e=>{var t;if(null==(t=e.url)?void 0:t.includes("/conversation")){const t={...e};return delete t.timeout,t}return e})),o.interceptors.response.use((e=>{var o,s,a,n,r;return(null==(o=e.config.url)?void 0:o.includes("/options"))?(null==(s=e.data)?void 0:s.success)?e.data:{success:!1,data:[]}:(null==(a=e.data)?void 0:a.success)?null==(n=e.data)?void 0:n.data:void(!(null==(r=e.data)?void 0:r.success)&&e.data.msg?t.error(e.data.msg):console.log("请求错误"))}));export{o as axiosInstance,s as conversationApi,i as conversationStreamApi,n as deleteApi,r as getHistoryRecordApi,u as getSessionMsgApi,a as saveApi};
@@ -1,3 +1,4 @@
1
+ import { AnyObject } from '../../../../shared/types';
1
2
  import { CAudioSDK } from '../../../../components/audio-sdk';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  show: {
@@ -13,9 +14,10 @@ declare const _default: import("vue").DefineComponent<{
13
14
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
14
15
  }>>;
15
16
  emit: (event: "update:show", ...args: any[]) => void;
16
- state: any;
17
- vaa07: any;
18
- immediatelyRecording: any;
17
+ state: AnyObject;
18
+ vaa07: import("vue").ComputedRef<any>;
19
+ immediatelyRecording: import("vue").Ref<any>;
20
+ sendMessage: (params?: AnyObject) => Promise<void>;
19
21
  time: import("vue").Ref<number>;
20
22
  endType: string;
21
23
  pause: import("@vueuse/shared").Fn;
@@ -1 +1 @@
1
- import{defineComponent as o,inject as t,ref as e,computed as a,watch as i,onBeforeUnmount as n,withDirectives as r,openBlock as s,createElementBlock as u,unref as l,createBlock as d,createCommentVNode as c,createElementVNode as m,toDisplayString as p,normalizeStyle as f,createVNode as v,withCtx as w,createTextVNode as h,vShow as g}from"vue";import{NIcon as y,NSpace as k,NButton as S}from"naive-ui";import{StopCircleOutline as _}from"@vicons/ionicons5";import{InjectionAIChat as C}from"../types/index.js";import{useIntervalFn as F,promiseTimeout as x}from"@vueuse/core";import"../../../audio-sdk/index.js";import{$message as $}from"../utils/index.js";import j from"../../../audio-sdk/src/audioSDK.js";const M={class:"ai-chat-audio"};var T=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:T}){const z=o,A=j.create(),{state:B,vaa07:R,immediatelyRecording:q}=t(C),D=e(0);let K="";const{pause:L,resume:b,isActive:E}=F((()=>{D.value++}),1e3,{immediate:!1}),G=a((()=>E.value?"正在录音中...":"录音已暂停")),H=a((()=>{const o=Math.floor(D.value/3600),t=Math.floor(D.value%3600/60),e=D.value%60,a=t.toString().padStart(2,"0"),i=e.toString().padStart(2,"0");if(o>0){return`${o.toString().padStart(2,"0")}:${a}:${i}`}return`${a}:${i}`}));function I(){L(),A.pause()}function J(){b(),A.resume()}async function N(o){K=o||"",null==A||A.stop(),T("update:show",!1)}return i((()=>z.show),(o=>{o?(K="",D.value=0,b(),async function(){try{const o=await A.start({timed:1800,showModal:!1,realTimeRecognition:!1});if(T("update:show",!1),"click"!==K)return;const{result:t,data:e}=o||{};if("success"!==t)return;e&&(B.params={opType:"create_inquiry"},B.sendContent=e,B.sending=!0,B.loading=!0,B.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}catch(o){console.log(o),T("update:show",!1),"fail"===(null==o?void 0:o.result)&&o.msg&&$.warning(o.msg)}}()):L()}),{immediate:!0}),i((()=>R.value),(async o=>{const t=z.show;z.show&&N(),q.value&&(t&&await x(10),T("update:show",!0))}),{immediate:!0}),n((()=>{j.destroy()})),(t,e)=>r((s(),u("div",M,[l(E)?c("v-if",!0):(s(),d(l(y),{key:0,size:"42",color:"#FF1818",component:l(_)},null,8,["component"])),m("p",null,p(l(G)),1),m("h3",{style:f(l(E)?"":"color: #FF1818")},p(l(H)),5),v(l(k),{"wrap-item":!1,size:15},{default:w((()=>[r(v(l(S),{round:"",onClick:I},{default:w((()=>[h("暂停")])),_:1},512),[[g,l(E)]]),r(v(l(S),{round:"",onClick:J},{default:w((()=>[h("继续")])),_:1},512),[[g,!l(E)]]),v(l(S),{round:"",color:"#FF1818",onClick:e[0]||(e[0]=()=>N("click"))},{default:w((()=>{var o;return[h((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.77"))||"结束")]})),_:1})])),_:1})],512)),[[g,o.show]])}});export{T as default};
1
+ import{defineComponent as o,ref as t,computed as e,watch as a,onBeforeUnmount as i,withDirectives as n,openBlock as s,createElementBlock as r,unref as u,createBlock as l,createCommentVNode as c,createElementVNode as d,toDisplayString as m,normalizeStyle as p,createVNode as f,withCtx as v,createTextVNode as w,vShow as h}from"vue";import{NIcon as g,NSpace as y,NButton as k}from"naive-ui";import{StopCircleOutline as S}from"@vicons/ionicons5";import{useIntervalFn as _,promiseTimeout as C}from"@vueuse/core";import"../../../audio-sdk/index.js";import{$message as F}from"../utils/index.js";import{useData as $}from"../hooks/useData.js";import j from"../../../audio-sdk/src/audioSDK.js";const x={class:"ai-chat-audio"};var M=o({__name:"ChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:M}){const T=o,z=j.create(),{state:A,vaa07:B,immediatelyRecording:D,sendMessage:R}=$(),q=t(0);let K="";const{pause:L,resume:b,isActive:E}=_((()=>{q.value++}),1e3,{immediate:!1}),G=e((()=>E.value?"正在录音中...":"录音已暂停")),H=e((()=>{const o=Math.floor(q.value/3600),t=Math.floor(q.value%3600/60),e=q.value%60,a=t.toString().padStart(2,"0"),i=e.toString().padStart(2,"0");if(o>0){return`${o.toString().padStart(2,"0")}:${a}:${i}`}return`${a}:${i}`}));function I(){L(),z.pause()}function J(){b(),z.resume()}async function N(o){K=o||"",null==z||z.stop(),M("update:show",!1)}return a((()=>T.show),(o=>{o?(K="",q.value=0,b(),async function(){try{const o=await z.start({timed:1800,showModal:!1,realTimeRecognition:!1});if(M("update:show",!1),"click"!==K)return;const{result:t,data:e}=o||{};if("success"!==t)return;e&&(A.sendContent=e,A.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录",R({opType:"create_inquiry"}))}catch(o){console.log(o),M("update:show",!1),"fail"===(null==o?void 0:o.result)&&o.msg&&F.warning(o.msg)}}()):L()}),{immediate:!0}),a((()=>B.value),(async o=>{const t=T.show;T.show&&N(),D.value&&(t&&await C(10),M("update:show",!0))}),{immediate:!0}),i((()=>{j.destroy()})),(t,e)=>n((s(),r("div",x,[u(E)?c("v-if",!0):(s(),l(u(g),{key:0,size:"42",color:"#FF1818",component:u(S)},null,8,["component"])),d("p",null,m(u(G)),1),d("h3",{style:p(u(E)?"":"color: #FF1818")},m(u(H)),5),f(u(y),{"wrap-item":!1,size:15},{default:v((()=>[n(f(u(k),{round:"",onClick:I},{default:v((()=>[w("暂停")])),_:1},512),[[h,u(E)]]),n(f(u(k),{round:"",onClick:J},{default:v((()=>[w("继续")])),_:1},512),[[h,!u(E)]]),f(u(k),{round:"",color:"#FF1818",onClick:e[0]||(e[0]=()=>N("click"))},{default:v((()=>{var o;return[w((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.77"))||"结束")]})),_:1})])),_:1})],512)),[[h,o.show]])}});export{M as default};
@@ -18,9 +18,9 @@ declare const _default: import("vue").DefineComponent<{
18
18
  }>> & {
19
19
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
20
20
  }>>;
21
- emit: (event: string, ...args: any[]) => void;
22
21
  _emit: (event: "update:show", ...args: any[]) => void;
23
- state: any;
22
+ state: AnyObject;
23
+ emit: (event: "button-click" | "program", ...args: any[]) => void;
24
24
  templateProps: import("vue").ComputedRef<{
25
25
  config: any;
26
26
  data: any;
@@ -1 +1 @@
1
- import{defineComponent as t,inject as e,computed as o,openBlock as n,createBlock as a,unref as s,withCtx as i,createVNode as d,mergeProps as r,createCommentVNode as u}from"vue";import{NDrawer as l,NDrawerContent as m}from"naive-ui";import{InjectionAIChatEmits as p,InjectionAIChat as c}from"../types/index.js";import"../../../index.js";import{isValidJSON as f}from"../utils/index.js";import h from"../../../card-render/index.js";var v=t({__name:"ChatBI",props:{show:{type:Boolean},data:{type:Object}},emits:["update:show"],setup(t,{emit:v}){const g=t,w=e(p),{state:j}=e(c),k=o((()=>{var t,e,o;const{content:n={}}=(null==(t=g.data)?void 0:t.msgItem)||{};return{config:f(null==(e=n.settings)?void 0:e.setting)?JSON.parse(null==(o=n.settings)?void 0:o.setting):null,data:n.data}}));function x(t){const{eventName:e,data:o}=t;v("update:show",!1),e&&w("button-click",{buttonInfo:o,isBI:!0,...g.data})}return(e,o)=>(n(),a(s(l),{placement:"bottom",height:"80%","trap-focus":!1,to:"#"+s(j).id,show:t.show,onMaskClick:o[0]||(o[0]=()=>v("update:show",!1))},{default:i((()=>[d(s(m),null,{default:i((()=>[t.data?(n(),a(s(h),r({key:0},s(k),{onModuleClick:x}),null,16)):u("v-if",!0)])),_:1})])),_:1},8,["to","show"]))}});export{v as default};
1
+ import{defineComponent as t,computed as o,openBlock as e,createBlock as a,unref as n,withCtx as s,createVNode as i,mergeProps as r,createCommentVNode as u}from"vue";import{NDrawer as d,NDrawerContent as l}from"naive-ui";import"../../../index.js";import{isValidJSON as m}from"../utils/index.js";import{useData as p}from"../hooks/useData.js";import c from"../../../card-render/index.js";var f=t({__name:"ChatBI",props:{show:{type:Boolean},data:{type:Object}},emits:["update:show"],setup(t,{emit:f}){const h=t,{state:v,emit:g}=p(),w=o((()=>{var t,o,e;const{content:a={}}=(null==(t=h.data)?void 0:t.msgItem)||{};return{config:m(null==(o=a.settings)?void 0:o.setting)?JSON.parse(null==(e=a.settings)?void 0:e.setting):null,data:a.data}}));function k(t){const{eventName:o,data:e}=t;f("update:show",!1),o&&g("button-click",{buttonInfo:e,isBI:!0,...h.data})}return(o,m)=>(e(),a(n(d),{placement:"bottom",height:"80%","trap-focus":!1,to:"#"+n(v).id,show:t.show,onMaskClick:m[0]||(m[0]=()=>f("update:show",!1))},{default:s((()=>[i(n(l),null,{default:s((()=>[t.data?(e(),a(n(c),r({key:0},n(w),{onModuleClick:k}),null,16)):u("v-if",!0)])),_:1})])),_:1},8,["to","show"]))}});export{f as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as h,ChevronForward as b}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import E from"../../../form-render/index.js";import I from"../../../card-render/index.js";var k=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:k,slots:x,emit:C}){const _={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},T=y(),{patientInfo:P,state:w,axiosInstance:O,isSmall:S,appId:j}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),F=a(),q=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),A=e.msgItem.content,H={},B=l(p(A.data||{})),K={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=A.body||{},a=null==(n=(l=R.value).getFormValues)?void 0:n.call(l);Object.keys(t.params).forEach((l=>{const n=e.find((e=>e.code===l));"vaa05"===l?t.params.vaa05=L.value.selectedPatient.vaa01:Reflect.has(a,l)?t.params[l]=a[l]:n&&(t.params[l]=n.value)}))}t&&Reflect.has(t,"configs")&&(t.configs=L.value.selectedPatient)}};function U(e){const{eventName:t,data:a}=e;t&&C("button-click",{buttonInfo:a,isBI:!0})}function D(e){B[e.button.id+"Disabled"]="1",C("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}if(q.value){const t=A.body.items||[],a=t.some((e=>"vaa05"===e.code));M.value=t.filter((e=>e.showFlag)).map((t=>{var l,n,o;if("vaa05"===t.code&&!S.value)return L.value={...t},t._value?N.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(N.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,L.value.selectedPatient=e.configs),null;const i={html_type:_[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(o=t.labelField)?o:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(i.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===i.html_type){if(i.componentProps={fallbackOption:!1},i.option=t.options||[],i.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(i.default_val=t.value)}if(Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:S.value?"inner":"global",...S.value?{appId:j.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=P.value.info||w.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,i.urlConfig.params.params={},e.forEach((e=>{i.urlConfig.params.params[e]=""}))}}return i})).filter((e=>!!e))}function J(){var t;if(!L.value)return null;function a(){e.msgItem.disabled||(w.showPatient=!0)}return i(s,{class:"form-render",ref:F,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:N,rules:{vaa05:{required:L.value.required,message:L.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:L.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:N.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:h},null)})]}})]})}async function V(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),A.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=w.selectedPatientLabel,e.value=L.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=H[e.code])?void 0:t[0])&&(e.options=H[e.code])})),w.loading=!0,C("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){w.loading=!1}}function z(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(H[n]=[null==a?void 0:a.currentOption])}function X(){C("button-click",{showMore:!0})}function G(){var e;if("1834043761964638208"!==(null==(e=A.settings)?void 0:e.id)||!A.data)return null;const t=JSON.parse(A.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(A.data[l])||JSON.parse(A.data[l]).length<=5?null:(g(B[l])&&(B[l]=JSON.parse(B[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:T.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return o((()=>w.showPatient),(t=>{!e.msgItem.disabled&&q.value&&!t&&w.selectedPatientLabel&&L.value&&(N.vaa05=w.selectedPatientLabel,L.value.selectedPatient={...w.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[q.value?[i("p",null,[A.title||A.header.title]),i("div",{class:"form-box"},[[J(),i(E,{"request-instance":{get:O.get,post:O.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:z},null)]]),A.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=q.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(q.value){if(!R.value)return;try{L.value?null==(e=F.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:L.value.selectedPatient.vaa01}),await V(t,e)}})):await V(t)}catch(e){}}else C("button-click")}},{default:()=>[q.value?null==t?void 0:t.text:A.buttonName]})}(t)))]:[i(I,{config:g(null==(t=A.settings)?void 0:t.setting)?JSON.parse(A.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{k as default};
1
+ import{defineComponent as e,ref as t,reactive as a,computed as l,watch as n,createVNode as o}from"vue";import{NForm as i,NFormItem as s,NInput as r,NIcon as u,NButton as d}from"naive-ui";import"../../../index.js";import{cloneDeep as c,isArray as v,omit as p}from"lodash-es";import{isValidJSON as m}from"../utils/index.js";import{ChevronDown as f,ChevronForward as g}from"@vicons/ionicons5";import{useData as b}from"../hooks/useData.js";import y from"../../../form-render/index.js";import h from"../../../card-render/index.js";var E=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:E,slots:I,emit:_}){const k={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},{cssVars:C,patientInfo:x,state:T,axiosInstance:P,isSmall:w,appId:O}=b(),M=t([]),R=t(),S=t(),j=a({vaa05:""}),L=t(),N=l((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),F=e.msgItem.content,q={},A=a(c(F.data||{})),B={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=F.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=S.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=S.value.selectedPatient)}};function H(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function K(e){A[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...p(e.button,["props"]),data:e.data}})}if(N.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&&!w.value)return S.value={...t},t._value?j.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(j.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,S.value.selectedPatient=e.configs),null;const i={html_type:k[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&&v(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:w.value?"inner":"global",...w.value?{appId:O.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=x.value.info||T.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 U(){var t;if(!S.value)return null;function a(){e.msgItem.disabled||(T.showPatient=!0)}return o(i,{class:"form-render",ref:L,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:j,rules:{vaa05:{required:S.value.required,message:S.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[o(s,{label:S.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[o(r,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:j.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>o(u,{color:"#c2c2c2",component:f},null)})]}})]})}async function D(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=T.selectedPatientLabel,e.value=S.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=q[e.code])?void 0:t[0])&&(e.options=q[e.code])})),T.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=S.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){T.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)&&(q[n]=[null==a?void 0:a.currentOption])}function J(){_("button-click",{showMore:!0})}function z(){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||!m(F.data[l])||JSON.parse(F.data[l]).length<=5?null:(m(A[l])&&(A[l]=JSON.parse(A[l]).slice(0,5)),o(d,{block:!0,text:!0,"icon-placement":"right",color:C.value["--c-primary-color"],style:"margin-top: 10px",onClick:J},{icon:()=>o(u,{component:g},null),default:()=>"查看更多"}))}return n((()=>T.showPatient),(t=>{!e.msgItem.disabled&&N.value&&!t&&T.selectedPatientLabel&&S.value&&(j.vaa05=T.selectedPatientLabel,S.value.selectedPatient={...T.selectedPatientForm})})),()=>{var t;return o("div",{class:"card"},[N.value?[o("p",null,[F.title||F.header.title]),o("div",{class:"form-box"},[[U(),o(y,{"request-instance":{get:P.get,post:P.post},"life-cycle":B,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=N.value?{...a,marginTop:"0"}:a;return o(d,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(N.value){if(!R.value)return;try{S.value?null==(e=L.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:S.value.selectedPatient.vaa01}),await D(t,e)}})):await D(t)}catch(e){}}else _("button-click")}},{default:()=>[N.value?null==t?void 0:t.text:F.buttonName]})}(t)))]:[o(h,{config:m(null==(t=F.settings)?void 0:t.setting)?JSON.parse(F.settings.setting):null,data:A,"onModule-click":H,"onButton-click":K},null),z()]])}}});export{E as default};