cnhis-design-vue 3.2.12-release.1 → 3.2.13-beta.10

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 (127) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +83 -0
  3. package/es/components/ai-chat/src/Index.vue.d.ts +84 -1
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatCard.d.ts +6 -0
  6. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +59 -0
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  10. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +58 -0
  11. package/es/components/ai-chat/src/components/ChatPatient.vue.js +1 -0
  12. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -0
  13. package/es/components/ai-chat/src/types/index.d.ts +6 -3
  14. package/es/components/ai-chat/style/index.css +1 -1
  15. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  16. package/es/components/button-print/src/utils/print.js +1 -1
  17. package/es/components/callback/src/components/render/popupMaps.d.ts +31 -0
  18. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  19. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  24. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  25. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  26. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  27. package/es/components/iho-table/index.d.ts +31 -0
  28. package/es/components/iho-table/src/IhoTable.vue.d.ts +32 -0
  29. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  30. package/es/components/iho-table/src/plugins/crossHeaderPlugin.d.ts +1 -0
  31. package/es/components/iho-table/src/plugins/crossHeaderPlugin.js +1 -0
  32. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  33. package/es/components/iho-table/src/plugins/index.js +1 -1
  34. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  35. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  36. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
  37. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +5 -5
  38. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  39. package/es/components/iho-table/src/types/index.d.ts +15 -0
  40. package/es/components/iho-table/style/index.css +1 -1
  41. package/es/components/index.css +1 -1
  42. package/es/components/index.d.ts +2 -1
  43. package/es/components/index.js +1 -1
  44. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  45. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  46. package/es/components/template-render/index.d.ts +60 -0
  47. package/es/components/template-render/index.js +1 -0
  48. package/es/components/template-render/src/TemplateRender.vue.d.ts +62 -0
  49. package/es/components/template-render/src/TemplateRender.vue.js +1 -0
  50. package/es/components/template-render/src/TemplateRender.vue2.js +1 -0
  51. package/es/components/template-render/src/components/Box.vue.d.ts +44 -0
  52. package/es/components/template-render/src/components/Box.vue.js +1 -0
  53. package/es/components/template-render/src/components/Box.vue2.js +1 -0
  54. package/es/components/template-render/src/components/Button.vue.d.ts +50 -0
  55. package/es/components/template-render/src/components/Button.vue.js +1 -0
  56. package/es/components/template-render/src/components/Button.vue2.js +1 -0
  57. package/es/components/template-render/src/components/Divider.vue.d.ts +26 -0
  58. package/es/components/template-render/src/components/Divider.vue.js +1 -0
  59. package/es/components/template-render/src/components/Divider.vue2.js +1 -0
  60. package/es/components/template-render/src/components/Field.vue.d.ts +56 -0
  61. package/es/components/template-render/src/components/Field.vue.js +1 -0
  62. package/es/components/template-render/src/components/Field.vue2.js +1 -0
  63. package/es/components/template-render/src/components/FieldGroup.vue.d.ts +50 -0
  64. package/es/components/template-render/src/components/FieldGroup.vue.js +1 -0
  65. package/es/components/template-render/src/components/FieldGroup.vue2.js +1 -0
  66. package/es/components/template-render/src/components/Image.vue.d.ts +52 -0
  67. package/es/components/template-render/src/components/Image.vue.js +1 -0
  68. package/es/components/template-render/src/components/Image.vue2.js +1 -0
  69. package/es/components/template-render/src/components/Label.vue.d.ts +42 -0
  70. package/es/components/template-render/src/components/Label.vue.js +1 -0
  71. package/es/components/template-render/src/components/Label.vue2.js +1 -0
  72. package/es/components/template-render/src/components/Row.vue.d.ts +47 -0
  73. package/es/components/template-render/src/components/Row.vue.js +1 -0
  74. package/es/components/template-render/src/components/Row.vue2.js +1 -0
  75. package/es/components/template-render/src/components/Slot.d.ts +27 -0
  76. package/es/components/template-render/src/components/Slot.js +1 -0
  77. package/es/components/template-render/src/components/Text.vue.d.ts +40 -0
  78. package/es/components/template-render/src/components/Text.vue.js +1 -0
  79. package/es/components/template-render/src/components/Text.vue2.js +1 -0
  80. package/es/components/template-render/src/components/index.d.ts +530 -0
  81. package/es/components/template-render/src/components/index.js +1 -0
  82. package/es/components/template-render/src/constants/index.d.ts +16 -0
  83. package/es/components/template-render/src/constants/index.js +1 -0
  84. package/es/components/template-render/src/hooks/useCommon.d.ts +10 -0
  85. package/es/components/template-render/src/hooks/useCommon.js +1 -0
  86. package/es/components/template-render/src/utils/index.d.ts +6 -0
  87. package/es/components/template-render/src/utils/index.js +1 -0
  88. package/es/components/template-render/style/index.css +1 -0
  89. package/es/env.d.ts +25 -25
  90. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  91. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  92. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  93. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  94. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  95. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  96. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  97. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  98. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  99. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  100. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  101. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  102. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  103. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  104. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  105. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  106. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  107. package/es/shared/assets/img/failure.png.js +1 -1
  108. package/es/shared/assets/img/logo.png.js +1 -1
  109. package/es/shared/assets/img/no-permission.png.js +1 -1
  110. package/es/shared/assets/img/nodata.png.js +1 -1
  111. package/es/shared/assets/img/notfound.png.js +1 -1
  112. package/es/shared/assets/img/qr.png.js +1 -1
  113. package/es/shared/assets/img/success.png.js +1 -1
  114. package/es/shared/assets/img/table_style_2.png.js +1 -1
  115. package/es/shared/assets/img/video.png.js +1 -1
  116. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  117. package/es/shared/assets/img/xb_big.png.js +1 -1
  118. package/es/shared/assets/img/xb_small.png.js +1 -1
  119. package/es/shared/package.json.js +1 -1
  120. package/package.json +2 -2
  121. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  122. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  123. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  124. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  125. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  126. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  127. package/es/shared/utils/tapable/index.d.ts +0 -139
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
+ ```
@@ -33,6 +33,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
33
33
  queryPrompt: {
34
34
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
35
35
  };
36
+ patientInfo: {
37
+ type: import("vue").PropType<Partial<{
38
+ info: import("../../shared/types").AnyObject;
39
+ queryPatient: (props: {
40
+ keyword: string;
41
+ }) => Promise<import("../../shared/types").AnyObject[]>;
42
+ }>>;
43
+ };
36
44
  }, {
37
45
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
38
46
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -69,6 +77,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
69
77
  queryPrompt: {
70
78
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
71
79
  };
80
+ patientInfo: {
81
+ type: import("vue").PropType<Partial<{
82
+ info: import("../../shared/types").AnyObject;
83
+ queryPatient: (props: {
84
+ keyword: string;
85
+ }) => Promise<import("../../shared/types").AnyObject[]>;
86
+ }>>;
87
+ };
72
88
  }>> & {
73
89
  "onButton-click"?: ((...args: any[]) => any) | undefined;
74
90
  }>>;
@@ -108,8 +124,11 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
108
124
  children?: any[] | undefined;
109
125
  }[]>;
110
126
  showPrompt: import("vue").Ref<boolean>;
127
+ currentShortcutId: import("vue").Ref<string>;
128
+ showPatient: import("vue").Ref<boolean>;
111
129
  btnDisabled: import("vue").ComputedRef<boolean>;
112
130
  showMagicWand: import("vue").ComputedRef<boolean>;
131
+ patient: import("vue").ComputedRef<string>;
113
132
  recorderStart: () => Promise<void>;
114
133
  isValidJSON: (str: string) => boolean;
115
134
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
@@ -132,6 +151,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
132
151
  ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
133
152
  ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
134
153
  SparklesSharp: 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<{}>>, {}>;
154
+ PeopleOutline: 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<{}>>, {}>;
135
155
  ChatPrompt: import("vue").DefineComponent<{
136
156
  show: {
137
157
  type: BooleanConstructor;
@@ -175,6 +195,61 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
175
195
  }, {
176
196
  show: boolean;
177
197
  }>;
198
+ ChatPatient: import("vue").DefineComponent<{
199
+ show: {
200
+ type: BooleanConstructor;
201
+ };
202
+ }, {
203
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
204
+ show: {
205
+ type: BooleanConstructor;
206
+ };
207
+ }>> & {
208
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
209
+ }>>;
210
+ emit: (event: "update:show", ...args: any[]) => void;
211
+ patientInfo: any;
212
+ state: any;
213
+ formValue: {
214
+ businessType: null;
215
+ vaa01: null;
216
+ vaa07: string;
217
+ };
218
+ rules: {
219
+ businessType: {
220
+ required: boolean;
221
+ trigger: string;
222
+ message: string;
223
+ };
224
+ vaa01: {
225
+ required: boolean;
226
+ trigger: string[];
227
+ message: string;
228
+ };
229
+ };
230
+ options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
231
+ formRef: import("vue").Ref<any>;
232
+ renderLabel: (option: import("../../shared/types").AnyObject) => string;
233
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
234
+ handleSearch: (keyword: string) => Promise<void>;
235
+ handleValidateClick: (e: MouseEvent) => void;
236
+ NDrawer: any;
237
+ NDrawerContent: any;
238
+ NForm: any;
239
+ NFormItem: any;
240
+ NButton: any;
241
+ NRadioGroup: any;
242
+ NRadio: any;
243
+ NSelect: any;
244
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
245
+ show: {
246
+ type: BooleanConstructor;
247
+ };
248
+ }>> & {
249
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
250
+ }, {
251
+ show: boolean;
252
+ }>;
178
253
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
179
254
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
180
255
  userAvatar: {
@@ -210,6 +285,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
210
285
  queryPrompt: {
211
286
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
212
287
  };
288
+ patientInfo: {
289
+ type: import("vue").PropType<Partial<{
290
+ info: import("../../shared/types").AnyObject;
291
+ queryPatient: (props: {
292
+ keyword: string;
293
+ }) => Promise<import("../../shared/types").AnyObject[]>;
294
+ }>>;
295
+ };
213
296
  }>> & {
214
297
  "onButton-click"?: ((...args: any[]) => any) | undefined;
215
298
  }, {
@@ -35,6 +35,14 @@ declare const _default: import("vue").DefineComponent<{
35
35
  queryPrompt: {
36
36
  type: PropType<QueryPrompt>;
37
37
  };
38
+ patientInfo: {
39
+ type: PropType<Partial<{
40
+ info: AnyObject;
41
+ queryPatient: (props: {
42
+ keyword: string;
43
+ }) => Promise<AnyObject[]>;
44
+ }>>;
45
+ };
38
46
  }, {
39
47
  cssVars: import("vue").ComputedRef<AnyObject>;
40
48
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -71,6 +79,14 @@ declare const _default: import("vue").DefineComponent<{
71
79
  queryPrompt: {
72
80
  type: PropType<QueryPrompt>;
73
81
  };
82
+ patientInfo: {
83
+ type: PropType<Partial<{
84
+ info: AnyObject;
85
+ queryPatient: (props: {
86
+ keyword: string;
87
+ }) => Promise<AnyObject[]>;
88
+ }>>;
89
+ };
74
90
  }>> & {
75
91
  "onButton-click"?: ((...args: any[]) => any) | undefined;
76
92
  }>>;
@@ -85,7 +101,7 @@ declare const _default: import("vue").DefineComponent<{
85
101
  } | {}>;
86
102
  ChatFooter: import("vue").DefineComponent<{}, {
87
103
  cssVars: import("vue").ComputedRef<AnyObject>;
88
- audioSdk: import("../..").CAudioSDK;
104
+ audioSdk: import("../../../components/index").CAudioSDK;
89
105
  emit: (event: string, ...args: any[]) => void;
90
106
  shortcutList: any;
91
107
  state: any;
@@ -110,8 +126,11 @@ declare const _default: import("vue").DefineComponent<{
110
126
  children?: any[] | undefined;
111
127
  }[]>;
112
128
  showPrompt: import("vue").Ref<boolean>;
129
+ currentShortcutId: import("vue").Ref<string>;
130
+ showPatient: import("vue").Ref<boolean>;
113
131
  btnDisabled: import("vue").ComputedRef<boolean>;
114
132
  showMagicWand: import("vue").ComputedRef<boolean>;
133
+ patient: import("vue").ComputedRef<string>;
115
134
  recorderStart: () => Promise<void>;
116
135
  isValidJSON: (str: string) => boolean;
117
136
  getShortcutName: (item: string | AnyObject) => any;
@@ -134,6 +153,7 @@ declare const _default: import("vue").DefineComponent<{
134
153
  ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
135
154
  ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
136
155
  SparklesSharp: 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<{}>>, {}>;
156
+ PeopleOutline: 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<{}>>, {}>;
137
157
  ChatPrompt: import("vue").DefineComponent<{
138
158
  show: {
139
159
  type: BooleanConstructor;
@@ -177,6 +197,61 @@ declare const _default: import("vue").DefineComponent<{
177
197
  }, {
178
198
  show: boolean;
179
199
  }>;
200
+ ChatPatient: import("vue").DefineComponent<{
201
+ show: {
202
+ type: BooleanConstructor;
203
+ };
204
+ }, {
205
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
206
+ show: {
207
+ type: BooleanConstructor;
208
+ };
209
+ }>> & {
210
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
211
+ }>>;
212
+ emit: (event: "update:show", ...args: any[]) => void;
213
+ patientInfo: any;
214
+ state: any;
215
+ formValue: {
216
+ businessType: null;
217
+ vaa01: null;
218
+ vaa07: string;
219
+ };
220
+ rules: {
221
+ businessType: {
222
+ required: boolean;
223
+ trigger: string;
224
+ message: string;
225
+ };
226
+ vaa01: {
227
+ required: boolean;
228
+ trigger: string[];
229
+ message: string;
230
+ };
231
+ };
232
+ options: import("vue").Ref<AnyObject[]>;
233
+ formRef: import("vue").Ref<any>;
234
+ renderLabel: (option: AnyObject) => string;
235
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
236
+ handleSearch: (keyword: string) => Promise<void>;
237
+ handleValidateClick: (e: MouseEvent) => void;
238
+ NDrawer: any;
239
+ NDrawerContent: any;
240
+ NForm: any;
241
+ NFormItem: any;
242
+ NButton: any;
243
+ NRadioGroup: any;
244
+ NRadio: any;
245
+ NSelect: any;
246
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
247
+ show: {
248
+ type: BooleanConstructor;
249
+ };
250
+ }>> & {
251
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
252
+ }, {
253
+ show: boolean;
254
+ }>;
180
255
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
181
256
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
182
257
  userAvatar: {
@@ -212,6 +287,14 @@ declare const _default: import("vue").DefineComponent<{
212
287
  queryPrompt: {
213
288
  type: PropType<QueryPrompt>;
214
289
  };
290
+ patientInfo: {
291
+ type: PropType<Partial<{
292
+ info: AnyObject;
293
+ queryPatient: (props: {
294
+ keyword: string;
295
+ }) => Promise<AnyObject[]>;
296
+ }>>;
297
+ };
215
298
  }>> & {
216
299
  "onButton-click"?: ((...args: any[]) => any) | undefined;
217
300
  }, {
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as i,openBlock as s,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as u,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import c from"./components/ChatMain.js";import y from"./components/ChatFooter.vue.js";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as f}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 v,InjectionAIChatEmits as S}from"./types/index.js";const j=["id"];var k=e({__name:"Index",props:{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}},emits:["button-click"],setup(e,{emit:k}){const C=e,g=h(),x=t({id:"ai-chat-"+f(),beingSent:!1,sendContent:"",selectedCommand:null,selectedPrompt:null});return o(v,{...r(C),state:x,isSmall:i((()=>"small"===C.uiStyle))}),o(S,k),(t,o)=>(s(),a("div",{id:x.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(u(g))},[p(u(c)),e.hideInput?l("v-if",!0):(s(),d(y,{key:0}))],14,j))}});export{k as default};
1
+ import{defineComponent as e,reactive as t,provide as o,toRefs as s,computed as r,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as p,createVNode as u,createBlock as l,createCommentVNode as d}from"vue";import c from"./components/ChatMain.js";import h from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import{useFormRequest as f}from"../../../shared/hooks/useFormRequest/index.js";import{uuidGenerator as j}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 v,InjectionAIChatEmits as x}from"./types/index.js";import S from"axios";import"../../index.js";const g=["id"];var k=e({__name:"Index",props:{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}},emits:["button-click"],setup(e,{expose:k,emit:C}){const F=e;f().registGlobHttpInstance(S.create());const I=y(),b=t({id:"ai-chat-"+j(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null});return o(v,{...s(F),state:b,isSmall:r((()=>"small"===F.uiStyle))}),o(x,C),k({pushMessage:e=>{b.externalData=e}}),(t,o)=>(i(),a("div",{id:b.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(p(I))},[u(p(c)),e.hideInput?d("v-if",!0):(i(),l(h,{key:0}))],14,g))}});export{k as default};
@@ -5,11 +5,17 @@ declare const _default: import("vue").DefineComponent<{
5
5
  type: PropType<MessageItem>;
6
6
  default: () => {};
7
7
  };
8
+ instructionId: {
9
+ type: StringConstructor;
10
+ };
8
11
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
12
  msgItem: {
10
13
  type: PropType<MessageItem>;
11
14
  default: () => {};
12
15
  };
16
+ instructionId: {
17
+ type: StringConstructor;
18
+ };
13
19
  }>> & {
14
20
  "onButton-click"?: ((...args: any[]) => any) | undefined;
15
21
  }, {
@@ -1 +1 @@
1
- import{defineComponent as t,createVNode as e,createTextVNode as n}from"vue";import{NButton as a,NIcon as i}from"naive-ui";import{ChevronForward as l}from"@vicons/ionicons5";var s=t({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})}},emits:["button-click"],setup(t,{attrs:s,slots:o,emit:c}){function d(t){const{patientName:i,patientAge:l,patientBedNumber:s}=t;return[e("p",null,[`${i}/${l}/${s}`]),e("div",{class:"patient-info"},[[t.fields.slice(0,10).map((t=>e("div",{class:"patient-item"},[e("p",null,[`[${t.classifyName}]${t.ruleName}`]),e("p",null,[t.remark])]))),t.fields.length>10?e(a,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",onClick:()=>c("button-click")},{default:()=>[n("更多")]}):null]])]}const{content:p="{}"}=t.msgItem,r=JSON.parse(p),m=["journaling","dashboard"].includes(r.buttonType);return()=>e("div",{class:"card"},["patientScore"===r.buttonType?d(r):[e("p",null,[r.title]),m?r.fields.map((t=>e(a,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>c("button-click",t)},{default:()=>t.name,icon:()=>e(i,{component:l},null)}))):[e("div",{class:"card-body"},[e("p",{class:"card-body__head"},[r.instructionName]),e("div",{class:"card-body__content"},[r.fields.map((t=>e("div",null,[e("span",{class:"label"},[t.name]),n(""),e("span",null,[t.value])])))])]),e(a,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.msgItem.disabled,onClick:()=>c("button-click")},{default:()=>[r.buttonName]})]]])}});export{s as default};
1
+ import{defineComponent as t,inject as e,ref as n,computed as o,createVNode as i}from"vue";import{NButton as l}from"naive-ui";import{InjectionAIChat as a}from"../types/index.js";import"../../../index.js";import{isArray as r}from"lodash-es";import s from"../../../form-render/index.js";import u from"../../../template-render/index.js";var d=t({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},instructionId:{type:String}},emits:["button-click"],setup(t,{attrs:d,slots:c,emit:m}){const{patientInfo:p,state:f}=e(a),v=n([]),g=n(),b=o((()=>{var e,n;return!!(null==(n=null==(e=t.msgItem)?void 0:e.content)?void 0:n.body)}));function y(t){try{return JSON.parse(t),!0}catch(t){return!1}}const h=t.msgItem.content;function I(t){const{eventName:e,data:n}=t;e&&m("button-click",{buttonInfo:n,isBI:!0})}function x(t){h.data[t.button.id+"Disabled"]=!0,m("button-click",{buttonInfo:t.button})}return b.value&&(v.value=(h.body.items||[]).map((e=>{var n,o;const i={html_type:e.type,val_key:e.code,name:e.name,elem_width:12,default_val:e.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=e.labelField)?n:"label"},option:[],is_null:e.required?"0":"1"};return"SELECT"===i.html_type&&(i.option=e.options,"fixed"===e.dataSourceType&&(null==(o=e.options)?void 0:o.length)||(i.html_type="REMOTE_SEARCH",Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{instructionId:t.instructionId,code:e.code,configs:p.value.info},dependKey:[]}),r(e.dependencies)&&e.dependencies.length&&(i.urlConfig.dependKey=e.dependencies))),i}))),()=>{var e;return i("div",{class:"card"},[b.value?[i("p",null,[h.title||h.header.title]),i(s,{disabled:t.msgItem.disabled,column:12,ref:g,"field-list":v.value},null),h.footer.buttons.map((e=>function(e){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},o=b.value?{...n,marginTop:"0"}:n;return i(l,{style:o,secondary:!0,class:"gradient",disabled:t.msgItem.disabled,onClick:async function(){if(b.value){if(!g.value)return;const t=g.value.getFormValues();try{await g.value.validate(),h.body.items.forEach((e=>{t[e.code]&&(e.value=t[e.code])})),f.loading=!0,m("button-click",{values:t,buttonInfo:e,isForm:!0})}catch(t){}}else m("button-click")}},{default:()=>[b.value?null==e?void 0:e.text:h.buttonName]})}(e)))]:i(u,{config:y(null==(e=h.settings)?void 0:e.setting)?JSON.parse(h.settings.setting):null,data:h.data,"onModule-click":I,"onButton-click":x},null)])}}});export{d as default};
@@ -28,8 +28,11 @@ declare const _default: import("vue").DefineComponent<{}, {
28
28
  children?: any[] | undefined;
29
29
  }[]>;
30
30
  showPrompt: import("vue").Ref<boolean>;
31
+ currentShortcutId: import("vue").Ref<string>;
32
+ showPatient: import("vue").Ref<boolean>;
31
33
  btnDisabled: import("vue").ComputedRef<boolean>;
32
34
  showMagicWand: import("vue").ComputedRef<boolean>;
35
+ patient: import("vue").ComputedRef<string>;
33
36
  recorderStart: () => Promise<void>;
34
37
  isValidJSON: (str: string) => boolean;
35
38
  getShortcutName: (item: string | AnyObject) => any;
@@ -52,6 +55,7 @@ declare const _default: import("vue").DefineComponent<{}, {
52
55
  ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
53
56
  ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
54
57
  SparklesSharp: 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<{}>>, {}>;
58
+ PeopleOutline: 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<{}>>, {}>;
55
59
  ChatPrompt: import("vue").DefineComponent<{
56
60
  show: {
57
61
  type: BooleanConstructor;
@@ -95,5 +99,60 @@ declare const _default: import("vue").DefineComponent<{}, {
95
99
  }, {
96
100
  show: boolean;
97
101
  }>;
102
+ ChatPatient: import("vue").DefineComponent<{
103
+ show: {
104
+ type: BooleanConstructor;
105
+ };
106
+ }, {
107
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
108
+ show: {
109
+ type: BooleanConstructor;
110
+ };
111
+ }>> & {
112
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
113
+ }>>;
114
+ emit: (event: "update:show", ...args: any[]) => void;
115
+ patientInfo: any;
116
+ state: any;
117
+ formValue: {
118
+ businessType: null;
119
+ vaa01: null;
120
+ vaa07: string;
121
+ };
122
+ rules: {
123
+ businessType: {
124
+ required: boolean;
125
+ trigger: string;
126
+ message: string;
127
+ };
128
+ vaa01: {
129
+ required: boolean;
130
+ trigger: string[];
131
+ message: string;
132
+ };
133
+ };
134
+ options: import("vue").Ref<AnyObject[]>;
135
+ formRef: import("vue").Ref<any>;
136
+ renderLabel: (option: AnyObject) => string;
137
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
138
+ handleSearch: (keyword: string) => Promise<void>;
139
+ handleValidateClick: (e: MouseEvent) => void;
140
+ NDrawer: any;
141
+ NDrawerContent: any;
142
+ NForm: any;
143
+ NFormItem: any;
144
+ NButton: any;
145
+ NRadioGroup: any;
146
+ NRadio: any;
147
+ NSelect: any;
148
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
149
+ show: {
150
+ type: BooleanConstructor;
151
+ };
152
+ }>> & {
153
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
154
+ }, {
155
+ show: boolean;
156
+ }>;
98
157
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
99
158
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as l,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as i,normalizeClass as r,unref as u,Fragment as c,renderList as d,createBlock as v,withCtx as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,createVNode as k,createElementVNode as b,getCurrentInstance as y}from"vue";import{NButton as g,NPopover as x,NInput as C,NTag as w,NIcon as _,NBreadcrumb as S,NBreadcrumbItem as j}from"naive-ui";import{SparklesSharp as z,PaperPlane as T,ChevronBack as K,ChevronForward as I}from"@vicons/ionicons5";import{InjectionAIChatEmits as M,InjectionAIChat as R}from"../types/index.js";import D from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as P,isString as E,last as L}from"lodash-es";import{useTheme as N}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 U from"./ChatPrompt.vue.js";const B={key:0,class:"menu-box fillet-8"},F={class:"input-wrapper fillet-10"},J=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),O={class:"btn-box"},W=["disabled"],H={class:"command-box"},V={class:"command-box__header"},q={key:0,class:"title"},A={class:"command-box__menu"},G=["onClick"],Q={class:"label"},X={class:"remark"};var Y=e({__name:"ChatFooter",setup(e){const Y=N(),Z=D.create(),$=t(M),{shortcutList:ee,state:te,isSmall:le,audioTimed:oe,commandList:ne}=t(R),ae=l(),se=l(""),ie=l(!1),re=l([]),ue=l(P(ne.value||[])),ce=l(!1),de=o((()=>!se.value.replace(/(&nbsp;|\s|<br>)+/g,""))),ve=o((()=>{var e;return!se.value&&!(null==(e=ae.value)?void 0:e.activated.value)}));async function me(){try{const e=await Z.start(y(),{allowPunctuationMark:!1,timed:oe.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;se.value=t}catch(e){console.log(e)}}function pe(e){var t,l;if(E(e))return e;const o=null==(l=null==(t=null==e?void 0:e.contents)?void 0:t[0])?void 0:l.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function he(){var e;ue.value=P(ne.value||[]),re.value=[],(null==(e=ne.value)?void 0:e.length)>0&&(ie.value=!0)}function fe(e){ie.value=!1,"Slash"!==e.code||te.selectedCommand||se.value||he(),"Backspace"===e.key&&(!se.value.startsWith("/")&&!se.value.startsWith("、")||2!==se.value.length||te.selectedCommand?!se.value&&te.selectedCommand&&(e.preventDefault(),te.selectedCommand=null,se.value="/",he()):he()),["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),be()))}function ke(e){!e&&te.selectedPrompt&&(te.selectedPrompt=null)}function be(){de.value||(te.beingSent=!0,te.sendContent=se.value,se.value="")}function ye(){var e;re.value.pop(),ue.value=L(re.value)?null==(e=L(re.value))?void 0:e.children:P(ne.value||[])}return n((()=>te.sendContent),(e=>{e&&!te.beingSent&&(se.value=e)})),a((()=>{Z.destroy()})),(e,t)=>(s(),i("section",{class:r(["chat-footer",u(te).beingSent?"disabled":""])},[u(ee)&&u(ee).length>0?(s(),i("div",B,[(s(!0),i(c,null,d(u(ee),(e=>(s(),v(u(g),{secondary:"",size:"small",round:u(le),key:pe(e),onClick:()=>function(e){var t;if(E(e))se.value=e;else{const l=null==(t=null==e?void 0:e.contents)?void 0:t[0];$("button-click",{msgItem:l,item:e})}}(e)},{default:m((()=>[p(h(pe(e)),1)])),_:2},1032,["round","onClick"])))),128))])):f("v-if",!0),k(u(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ie.value,onClickoutside:t[4]||(t[4]=e=>ie.value=!1)},{trigger:m((()=>[b("div",F,[u(le)?(s(),v(u(C),{key:0,ref_key:"inputRef",ref:ae,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:u(te).beingSent,value:se.value,"onUpdate:value":t[1]||(t[1]=e=>se.value=e),onKeydown:fe,onInput:ke},{prefix:m((()=>[u(te).selectedCommand&&u(te).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Y)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(u(te).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):u(ve)?(s(),v(u(g),{key:1,text:"",onClick:t[0]||(t[0]=()=>ce.value=!0)},{default:m((()=>[k(u(_),{color:"#8f66f7",size:"18",component:u(z)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:m((()=>[k(u(g),{text:"",disabled:u(te).beingSent,onClick:me},{icon:m((()=>[k(u(_),{size:"30"},{default:m((()=>[J])),_:1})])),_:1},8,["disabled"]),k(u(g),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:u(de),onClick:be},{icon:m((()=>[k(u(_),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),i(c,{key:1},[k(u(C),{ref_key:"inputRef",ref:ae,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:u(te).beingSent,autosize:{minRows:2,maxRows:7},value:se.value,"onUpdate:value":t[3]||(t[3]=e=>se.value=e),onKeydown:fe,onInput:ke},{prefix:m((()=>[u(te).selectedCommand&&u(te).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Y)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=u(te).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):u(ve)?(s(),v(u(g),{key:1,text:"",onClick:t[2]||(t[2]=()=>ce.value=!0)},{default:m((()=>[k(u(_),{color:"#8f66f7",size:"18",component:u(z)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),b("div",O,[b("span",{class:r(["btn-send","gradient","fillet-8",u(de)?"disabled":""]),disabled:u(de),onClick:be},[k(u(_),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,W)])],64))])])),default:m((()=>[b("div",H,[b("div",V,[0===re.value.length?(s(),i("span",q,"推荐指令")):(s(),i(c,{key:1},[k(u(g),{text:"",onClick:ye},{default:m((()=>[k(u(_),{color:"#999",size:"20",component:u(K)},null,8,["component"])])),_:1}),k(u(S),null,{default:m((()=>[(s(!0),i(c,null,d(re.value,(e=>(s(),v(u(j),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),b("div",A,[(s(!0),i(c,null,d(ue.value,(e=>(s(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable"]),key:e.shortcutId,onClick:()=>{var t,l;(null==(l=(t=e).children)?void 0:l.length)?(ue.value=t.children,re.value.push(t)):(te.selectedCommand=t||{},ie.value=!1,se.value="",ae.value.focus())}},[b("span",Q,h(e.shortcutTitle),1),b("span",X,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(u(_),{key:0,color:"#999",size:"20",component:u(I)},null,8,["component"])):f("v-if",!0)],10,G)))),128))])])])),_:1},8,["show"]),k(U,{show:ce.value,"onUpdate:show":t[5]||(t[5]=e=>ce.value=e)},null,8,["show"])],2))}});export{Y as default};
1
+ import{defineComponent as e,inject as l,ref as o,computed as t,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as r,normalizeClass as u,unref as i,createElementVNode as c,createBlock as d,withCtx as v,createVNode as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,Fragment as k,renderList as y,withModifiers as w,getCurrentInstance as g}from"vue";import{NButton as b,NIcon as C,NPopover as x,NInput as _,NTag as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{PeopleOutline as T,SparklesSharp as K,PaperPlane as M,ChevronBack as P,ChevronForward as D}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as U}from"../types/index.js";import R from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as E,last as L}from"lodash-es";import{useTheme as B}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import F from"./ChatPrompt.vue.js";import W from"./ChatPatient.vue.js";const $={class:"menu-box fillet-8"},q={class:"input-wrapper fillet-10"},H=c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),c("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),c("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),N={class:"btn-box"},V=["disabled"],G={class:"command-box"},J={class:"command-box__header"},O={key:0,class:"title"},Q={class:"command-box__menu"},X=["onMouseover","onClick"],Y={class:"label"},Z={class:"remark"};var ee=e({__name:"ChatFooter",setup(e){const ee=B(),le=R.create(),oe=l(S),{shortcutList:te,state:ne,isSmall:ae,audioTimed:se,commandList:re}=l(U),ue=o(),ie=o(""),ce=o(!1),de=o([]),ve=o(A(re.value||[])),me=o(!1),pe=o(""),he=o(!1),fe=t((()=>!ie.value.replace(/(&nbsp;|\s|<br>)+/g,""))),ke=t((()=>{var e;return!ie.value&&!(null==(e=ue.value)?void 0:e.activated.value)})),ye=t((()=>{if(!ne.selectedPatient)return"选择患者";const{bcq04b:e,vaa05:l}=ne.selectedPatient;return`${e}床/${l}`}));async function we(){try{const e=await le.start(g(),{allowPunctuationMark:!1,timed:se.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:l}=e.data;ie.value=l}catch(e){console.log(e)}}function ge(e){var l;if(E(e))return e;const{content:o}=(null==(l=null==e?void 0:e.contents)?void 0:l[0])||{};return o.instructionName}function be(){var e;ce.value=!1,ve.value=A(re.value||[]),de.value=[],(null==(e=re.value)?void 0:e.length)&&(ce.value=!0,pe.value=ve.value[0].shortcutId)}function Ce(e){if("Slash"!==e.code||ne.selectedCommand||ie.value)if("Backspace"===e.key)ce.value=!1,!ie.value.startsWith("/")&&!ie.value.startsWith("、")||2!==ie.value.length||ne.selectedCommand?!ie.value&&ne.selectedCommand&&(e.preventDefault(),ne.selectedCommand=null,ie.value="/",be()):be();else if(ce.value&&["ArrowUp","ArrowDown"].includes(e.key)){const l=ve.value.findIndex((e=>e.shortcutId===pe.value));if("ArrowUp"===e.key){const e=l>0?l-1:ve.value.length-1;pe.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=l<ve.value.length-1?l+1:0;pe.value=ve.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),ce.value){Ie(ve.value.find((e=>e.shortcutId===pe.value)))}else _e()}else ce.value=!1;else be()}function xe(e){!e&&ne.selectedPrompt&&(ne.selectedPrompt=null)}function _e(){fe.value||(ne.sending=!0,ne.loading=!0,ne.sendContent=ie.value,ie.value="")}function Ie(e){var l;pe.value=e.shortcutId,ue.value.focus(),(null==(l=e.children)?void 0:l.length)?(ve.value=e.children,pe.value=ve.value[0].shortcutId,de.value.push(e)):(ne.selectedCommand=e||{},ce.value=!1,ie.value="")}function je(){var e;de.value.pop(),ve.value=L(de.value)?null==(e=L(de.value))?void 0:e.children:A(re.value||[]),pe.value=ve.value[0].shortcutId,ue.value.focus()}return n((()=>ne.sendContent),(e=>{e&&!ne.sending&&(ie.value=e)})),a((()=>{le.destroy()})),(e,l)=>(s(),r("section",{class:u(["chat-footer",i(ne).loading?"disabled":""])},[c("div",$,[i(ae)?f("v-if",!0):(s(),d(i(b),{key:0,secondary:"",size:"small",onClick:l[0]||(l[0]=()=>he.value=!0)},{icon:v((()=>[m(i(C),{color:i(ee)["--c-primary-color"],size:"20",component:i(T)},null,8,["color","component"])])),default:v((()=>[p(" "+h(i(ye)),1)])),_:1})),i(te)&&i(te).length>0?(s(!0),r(k,{key:1},y(i(te),(e=>(s(),d(i(b),{secondary:"",size:"small",round:i(ae),key:ge(e),onClick:()=>function(e){var l;if(E(e))ie.value=e;else{const o=null==(l=null==e?void 0:e.contents)?void 0:l[0];oe("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[p(h(ge(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ce.value,onClickoutside:l[5]||(l[5]=e=>ce.value=!1)},{trigger:v((()=>[c("div",q,[i(ae)?(s(),d(i(_),{key:0,ref_key:"inputRef",ref:ue,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(ne).loading,value:ie.value,"onUpdate:value":l[2]||(l[2]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[p(" /"+h(i(ne).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[1]||(l[1]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:v((()=>[m(i(b),{text:"",disabled:i(ne).loading,onClick:we},{icon:v((()=>[m(i(C),{size:"30"},{default:v((()=>[H])),_:1})])),_:1},8,["disabled"]),m(i(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(fe),onClick:_e},{icon:v((()=>[m(i(C),{color:"#fff",size:"20",component:i(M)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),r(k,{key:1},[m(i(_),{ref_key:"inputRef",ref:ue,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:i(ne).loading,autosize:{minRows:2,maxRows:7},value:ie.value,"onUpdate:value":l[4]||(l[4]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>{var e;return[p(" /"+h(null==(e=i(ne).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[3]||(l[3]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),c("div",N,[c("span",{class:u(["btn-send","gradient","fillet-8",i(fe)?"disabled":""]),disabled:i(fe),onClick:_e},[m(i(C),{color:"#fff",size:"22",component:i(M)},null,8,["component"])],10,V)])],64))])])),default:v((()=>[c("div",G,[c("div",J,[0===de.value.length?(s(),r("span",O,"推荐指令")):(s(),r(k,{key:1},[m(i(b),{text:"",onClick:je},{default:v((()=>[m(i(C),{color:"#999",size:"20",component:i(P)},null,8,["component"])])),_:1}),m(i(j),null,{default:v((()=>[(s(!0),r(k,null,y(de.value,(e=>(s(),d(i(z),{key:e.shortcutId},{default:v((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),c("div",Q,[(s(!0),r(k,null,y(ve.value,(e=>(s(),r("div",{class:u(["menu-item",e.children&&e.children.length?"":"selectable",pe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:w((()=>pe.value=e.shortcutId),["stop"]),onClick:()=>Ie(e)},[c("span",Y,h(e.shortcutTitle),1),c("span",Z,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),d(i(C),{key:0,color:"#999",size:"20",component:i(D)},null,8,["component"])):f("v-if",!0)],42,X)))),128))])])])),_:1},8,["show"]),m(F,{show:me.value,"onUpdate:show":l[6]||(l[6]=e=>me.value=e)},null,8,["show"]),m(W,{show:he.value,"onUpdate:show":l[7]||(l[7]=e=>he.value=e)},null,8,["show"])],2))}});export{ee as default};