cnhis-design-vue 3.2.11-release.3 → 3.2.12-release.1

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 (96) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +92 -1
  3. package/es/components/ai-chat/src/Index.vue.d.ts +93 -2
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatCard.d.ts +18 -0
  6. package/es/components/ai-chat/src/components/ChatCard.js +1 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +75 -1
  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/ChatPrompt.vue.d.ts +45 -0
  11. package/es/components/ai-chat/src/components/ChatPrompt.vue.js +1 -0
  12. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -0
  13. package/es/components/ai-chat/src/types/index.d.ts +14 -0
  14. package/es/components/ai-chat/style/index.css +1 -1
  15. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  16. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  17. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  18. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  19. package/es/components/button-print/index.d.ts +3 -0
  20. package/es/components/button-print/src/ButtonPrint.vue.d.ts +3 -0
  21. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  22. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
  23. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  24. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +2 -0
  25. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  26. package/es/components/callback/src/components/render/popupMaps.d.ts +4 -0
  27. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  28. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  31. package/es/components/form-config/index.d.ts +233 -0
  32. package/es/components/form-config/src/FormConfig.vue.d.ts +233 -0
  33. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +319 -85
  34. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  35. package/es/components/form-config/src/types/index.d.ts +4 -0
  36. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  37. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  38. package/es/components/iho-table/index.d.ts +4 -0
  39. package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -0
  40. package/es/components/iho-table/src/constants/index.d.ts +4 -0
  41. package/es/components/iho-table/src/constants/index.js +1 -1
  42. package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -1
  43. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.js +1 -1
  44. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  45. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  46. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  47. package/es/components/iho-table/src/types/index.d.ts +15 -0
  48. package/es/components/iho-table/src/utils/index.js +1 -1
  49. package/es/components/iho-table/style/index.css +1 -1
  50. package/es/components/index.css +1 -1
  51. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  52. package/es/components/scale-view/src/hooks/use-component.d.ts +2 -7
  53. package/es/components/select-label/index.d.ts +2 -7
  54. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  55. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts +2 -7
  56. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts +2 -7
  57. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  58. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.d.ts +2 -7
  59. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  60. package/es/components/select-label/src/index.vue.d.ts +2 -7
  61. package/es/components/select-label/src/types/index.d.ts +2 -1
  62. package/es/env.d.ts +25 -25
  63. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  64. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  65. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  66. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  67. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  68. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  69. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  70. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  71. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  72. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  73. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  74. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  75. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  76. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  77. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  78. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  79. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  80. package/es/shared/assets/img/failure.png.js +1 -1
  81. package/es/shared/assets/img/logo.png.js +1 -1
  82. package/es/shared/assets/img/no-permission.png.js +1 -1
  83. package/es/shared/assets/img/nodata.png.js +1 -1
  84. package/es/shared/assets/img/notfound.png.js +1 -1
  85. package/es/shared/assets/img/qr.png.js +1 -1
  86. package/es/shared/assets/img/success.png.js +1 -1
  87. package/es/shared/assets/img/table_style_2.png.js +1 -1
  88. package/es/shared/assets/img/video.png.js +1 -1
  89. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  90. package/es/shared/assets/img/xb_big.png.js +1 -1
  91. package/es/shared/assets/img/xb_small.png.js +1 -1
  92. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  93. package/es/shared/package.json.js +1 -1
  94. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  95. package/es/shared/utils/tapable/index.d.ts +139 -0
  96. package/package.json +2 -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
+ ```
@@ -27,6 +27,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
27
27
  type: NumberConstructor;
28
28
  default: number;
29
29
  };
30
+ commandList: {
31
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
32
+ };
33
+ queryPrompt: {
34
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
35
+ };
30
36
  }, {
31
37
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
32
38
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -57,6 +63,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
57
63
  type: NumberConstructor;
58
64
  default: number;
59
65
  };
66
+ commandList: {
67
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
68
+ };
69
+ queryPrompt: {
70
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
71
+ };
60
72
  }>> & {
61
73
  "onButton-click"?: ((...args: any[]) => any) | undefined;
62
74
  }>>;
@@ -70,26 +82,99 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
70
82
  readonly [x: number]: string;
71
83
  } | {}>;
72
84
  ChatFooter: import("vue").DefineComponent<{}, {
85
+ cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
73
86
  audioSdk: import("..").CAudioSDK;
74
87
  emit: (event: string, ...args: any[]) => void;
75
88
  shortcutList: any;
76
89
  state: any;
77
90
  isSmall: any;
78
91
  audioTimed: any;
92
+ commandList: any;
93
+ inputRef: import("vue").Ref<any>;
79
94
  content: import("vue").Ref<string>;
95
+ showPopover: import("vue").Ref<boolean>;
96
+ breadcrumb: import("vue").Ref<{
97
+ [x: string]: any;
98
+ shortcutTitle: string;
99
+ shortcutId: string;
100
+ shortcutDescription?: string | undefined;
101
+ children?: any[] | undefined;
102
+ }[]>;
103
+ currentCommand: import("vue").Ref<{
104
+ [x: string]: any;
105
+ shortcutTitle: string;
106
+ shortcutId: string;
107
+ shortcutDescription?: string | undefined;
108
+ children?: any[] | undefined;
109
+ }[]>;
110
+ showPrompt: import("vue").Ref<boolean>;
80
111
  btnDisabled: import("vue").ComputedRef<boolean>;
112
+ showMagicWand: import("vue").ComputedRef<boolean>;
81
113
  recorderStart: () => Promise<void>;
82
- recorderStop: () => Promise<void>;
83
114
  isValidJSON: (str: string) => boolean;
84
115
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
85
116
  handleShortcut: (item: string | import("../../shared/types").AnyObject) => void;
117
+ resetCurrentCommand: () => void;
86
118
  handleKeyDown: (event: KeyboardEvent) => void;
87
119
  isWrap: (event: KeyboardEvent) => boolean;
120
+ handleInput: (value: string) => void;
88
121
  handleSend: () => void;
122
+ clickMenu: (menu: import("./src/types").CommandItem) => void;
123
+ handleBack: () => void;
89
124
  NButton: any;
90
125
  NInput: any;
91
126
  NIcon: any;
127
+ NPopover: any;
128
+ NBreadcrumb: any;
129
+ NBreadcrumbItem: any;
130
+ NTag: any;
92
131
  PaperPlane: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
132
+ 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
+ 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
+ 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<{}>>, {}>;
135
+ ChatPrompt: import("vue").DefineComponent<{
136
+ show: {
137
+ type: BooleanConstructor;
138
+ };
139
+ }, {
140
+ pageInfo: {
141
+ page: number;
142
+ hasMore: boolean;
143
+ };
144
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
145
+ show: {
146
+ type: BooleanConstructor;
147
+ };
148
+ }>> & {
149
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
150
+ }>>;
151
+ emit: (event: "update:show", ...args: any[]) => void;
152
+ queryPrompt: any;
153
+ state: any;
154
+ listRef: import("vue").Ref<any>;
155
+ keyword: import("vue").Ref<string>;
156
+ list: import("vue").Ref<import("../../shared/types").AnyObject[]>;
157
+ showNoData: import("vue").ComputedRef<boolean>;
158
+ handleInput: () => void;
159
+ handleSearch: () => Promise<void>;
160
+ resetAndSearch: () => void;
161
+ select: (item: import("../../shared/types").AnyObject) => void;
162
+ NDrawer: any;
163
+ NDrawerContent: any;
164
+ NIcon: any;
165
+ NInput: any;
166
+ NButton: any;
167
+ CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
168
+ SearchOutline: 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<{}>>, {}>;
169
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
170
+ show: {
171
+ type: BooleanConstructor;
172
+ };
173
+ }>> & {
174
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
175
+ }, {
176
+ show: boolean;
177
+ }>;
93
178
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
94
179
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
95
180
  userAvatar: {
@@ -119,6 +204,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
119
204
  type: NumberConstructor;
120
205
  default: number;
121
206
  };
207
+ commandList: {
208
+ type: import("vue").PropType<import("./src/types").CommandItem[]>;
209
+ };
210
+ queryPrompt: {
211
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
212
+ };
122
213
  }>> & {
123
214
  "onButton-click"?: ((...args: any[]) => any) | undefined;
124
215
  }, {
@@ -1,5 +1,5 @@
1
1
  import { type PropType } from 'vue';
2
- import { QueryData, QueryRecord } from './types';
2
+ import { QueryData, QueryRecord, CommandItem, QueryPrompt } from './types';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  userAvatar: {
@@ -29,6 +29,12 @@ declare const _default: import("vue").DefineComponent<{
29
29
  type: NumberConstructor;
30
30
  default: number;
31
31
  };
32
+ commandList: {
33
+ type: PropType<CommandItem[]>;
34
+ };
35
+ queryPrompt: {
36
+ type: PropType<QueryPrompt>;
37
+ };
32
38
  }, {
33
39
  cssVars: import("vue").ComputedRef<AnyObject>;
34
40
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -59,6 +65,12 @@ declare const _default: import("vue").DefineComponent<{
59
65
  type: NumberConstructor;
60
66
  default: number;
61
67
  };
68
+ commandList: {
69
+ type: PropType<CommandItem[]>;
70
+ };
71
+ queryPrompt: {
72
+ type: PropType<QueryPrompt>;
73
+ };
62
74
  }>> & {
63
75
  "onButton-click"?: ((...args: any[]) => any) | undefined;
64
76
  }>>;
@@ -72,26 +84,99 @@ declare const _default: import("vue").DefineComponent<{
72
84
  readonly [x: number]: string;
73
85
  } | {}>;
74
86
  ChatFooter: import("vue").DefineComponent<{}, {
87
+ cssVars: import("vue").ComputedRef<AnyObject>;
75
88
  audioSdk: import("../..").CAudioSDK;
76
89
  emit: (event: string, ...args: any[]) => void;
77
90
  shortcutList: any;
78
91
  state: any;
79
92
  isSmall: any;
80
93
  audioTimed: any;
94
+ commandList: any;
95
+ inputRef: import("vue").Ref<any>;
81
96
  content: import("vue").Ref<string>;
97
+ showPopover: import("vue").Ref<boolean>;
98
+ breadcrumb: import("vue").Ref<{
99
+ [x: string]: any;
100
+ shortcutTitle: string;
101
+ shortcutId: string;
102
+ shortcutDescription?: string | undefined;
103
+ children?: any[] | undefined;
104
+ }[]>;
105
+ currentCommand: import("vue").Ref<{
106
+ [x: string]: any;
107
+ shortcutTitle: string;
108
+ shortcutId: string;
109
+ shortcutDescription?: string | undefined;
110
+ children?: any[] | undefined;
111
+ }[]>;
112
+ showPrompt: import("vue").Ref<boolean>;
82
113
  btnDisabled: import("vue").ComputedRef<boolean>;
114
+ showMagicWand: import("vue").ComputedRef<boolean>;
83
115
  recorderStart: () => Promise<void>;
84
- recorderStop: () => Promise<void>;
85
116
  isValidJSON: (str: string) => boolean;
86
117
  getShortcutName: (item: string | AnyObject) => any;
87
118
  handleShortcut: (item: string | AnyObject) => void;
119
+ resetCurrentCommand: () => void;
88
120
  handleKeyDown: (event: KeyboardEvent) => void;
89
121
  isWrap: (event: KeyboardEvent) => boolean;
122
+ handleInput: (value: string) => void;
90
123
  handleSend: () => void;
124
+ clickMenu: (menu: CommandItem) => void;
125
+ handleBack: () => void;
91
126
  NButton: any;
92
127
  NInput: any;
93
128
  NIcon: any;
129
+ NPopover: any;
130
+ NBreadcrumb: any;
131
+ NBreadcrumbItem: any;
132
+ NTag: any;
94
133
  PaperPlane: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
134
+ 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
+ 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
+ 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<{}>>, {}>;
137
+ ChatPrompt: import("vue").DefineComponent<{
138
+ show: {
139
+ type: BooleanConstructor;
140
+ };
141
+ }, {
142
+ pageInfo: {
143
+ page: number;
144
+ hasMore: boolean;
145
+ };
146
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
147
+ show: {
148
+ type: BooleanConstructor;
149
+ };
150
+ }>> & {
151
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
152
+ }>>;
153
+ emit: (event: "update:show", ...args: any[]) => void;
154
+ queryPrompt: any;
155
+ state: any;
156
+ listRef: import("vue").Ref<any>;
157
+ keyword: import("vue").Ref<string>;
158
+ list: import("vue").Ref<AnyObject[]>;
159
+ showNoData: import("vue").ComputedRef<boolean>;
160
+ handleInput: () => void;
161
+ handleSearch: () => Promise<void>;
162
+ resetAndSearch: () => void;
163
+ select: (item: AnyObject) => void;
164
+ NDrawer: any;
165
+ NDrawerContent: any;
166
+ NIcon: any;
167
+ NInput: any;
168
+ NButton: any;
169
+ CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
170
+ SearchOutline: 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<{}>>, {}>;
171
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
172
+ show: {
173
+ type: BooleanConstructor;
174
+ };
175
+ }>> & {
176
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
177
+ }, {
178
+ show: boolean;
179
+ }>;
95
180
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
96
181
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
182
  userAvatar: {
@@ -121,6 +206,12 @@ declare const _default: import("vue").DefineComponent<{
121
206
  type: NumberConstructor;
122
207
  default: number;
123
208
  };
209
+ commandList: {
210
+ type: PropType<CommandItem[]>;
211
+ };
212
+ queryPrompt: {
213
+ type: PropType<QueryPrompt>;
214
+ };
124
215
  }>> & {
125
216
  "onButton-click"?: ((...args: any[]) => any) | undefined;
126
217
  }, {
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as u,unref as m,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import h from"./components/ChatMain.js";import c from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../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 f}from"./types/index.js";var S=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}},emits:["button-click"],setup(e,{emit:S}){const j=e,k=y(),g=t({beingSent:!1,sendContent:""});return o(v,{...r(j),state:g,isSmall:s((()=>"small"===j.uiStyle))}),o(f,S),(t,o)=>(i(),a("div",{class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:u(m(k))},[p(m(h)),e.hideInput?l("v-if",!0):(i(),d(c,{key:0}))],6))}});export{S as default};
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};
@@ -0,0 +1,18 @@
1
+ import { PropType } from 'vue';
2
+ import { MessageItem } from '../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ msgItem: {
5
+ type: PropType<MessageItem>;
6
+ default: () => {};
7
+ };
8
+ }, () => 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
+ msgItem: {
10
+ type: PropType<MessageItem>;
11
+ default: () => {};
12
+ };
13
+ }>> & {
14
+ "onButton-click"?: ((...args: any[]) => any) | undefined;
15
+ }, {
16
+ msgItem: MessageItem;
17
+ }>;
18
+ export default _default;
@@ -0,0 +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,25 +1,99 @@
1
+ import { CommandItem } from '../types';
1
2
  import { CAudioSDK } from '../../../../components/audio-sdk';
2
3
  import { AnyObject } from '../../../../shared/types';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
5
+ cssVars: import("vue").ComputedRef<AnyObject>;
4
6
  audioSdk: CAudioSDK;
5
7
  emit: (event: string, ...args: any[]) => void;
6
8
  shortcutList: any;
7
9
  state: any;
8
10
  isSmall: any;
9
11
  audioTimed: any;
12
+ commandList: any;
13
+ inputRef: import("vue").Ref<any>;
10
14
  content: import("vue").Ref<string>;
15
+ showPopover: import("vue").Ref<boolean>;
16
+ breadcrumb: import("vue").Ref<{
17
+ [x: string]: any;
18
+ shortcutTitle: string;
19
+ shortcutId: string;
20
+ shortcutDescription?: string | undefined;
21
+ children?: any[] | undefined;
22
+ }[]>;
23
+ currentCommand: import("vue").Ref<{
24
+ [x: string]: any;
25
+ shortcutTitle: string;
26
+ shortcutId: string;
27
+ shortcutDescription?: string | undefined;
28
+ children?: any[] | undefined;
29
+ }[]>;
30
+ showPrompt: import("vue").Ref<boolean>;
11
31
  btnDisabled: import("vue").ComputedRef<boolean>;
32
+ showMagicWand: import("vue").ComputedRef<boolean>;
12
33
  recorderStart: () => Promise<void>;
13
- recorderStop: () => Promise<void>;
14
34
  isValidJSON: (str: string) => boolean;
15
35
  getShortcutName: (item: string | AnyObject) => any;
16
36
  handleShortcut: (item: string | AnyObject) => void;
37
+ resetCurrentCommand: () => void;
17
38
  handleKeyDown: (event: KeyboardEvent) => void;
18
39
  isWrap: (event: KeyboardEvent) => boolean;
40
+ handleInput: (value: string) => void;
19
41
  handleSend: () => void;
42
+ clickMenu: (menu: CommandItem) => void;
43
+ handleBack: () => void;
20
44
  NButton: any;
21
45
  NInput: any;
22
46
  NIcon: any;
47
+ NPopover: any;
48
+ NBreadcrumb: any;
49
+ NBreadcrumbItem: any;
50
+ NTag: any;
23
51
  PaperPlane: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
52
+ 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
+ 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
+ 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<{}>>, {}>;
55
+ ChatPrompt: import("vue").DefineComponent<{
56
+ show: {
57
+ type: BooleanConstructor;
58
+ };
59
+ }, {
60
+ pageInfo: {
61
+ page: number;
62
+ hasMore: boolean;
63
+ };
64
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
65
+ show: {
66
+ type: BooleanConstructor;
67
+ };
68
+ }>> & {
69
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
70
+ }>>;
71
+ emit: (event: "update:show", ...args: any[]) => void;
72
+ queryPrompt: any;
73
+ state: any;
74
+ listRef: import("vue").Ref<any>;
75
+ keyword: import("vue").Ref<string>;
76
+ list: import("vue").Ref<AnyObject[]>;
77
+ showNoData: import("vue").ComputedRef<boolean>;
78
+ handleInput: () => void;
79
+ handleSearch: () => Promise<void>;
80
+ resetAndSearch: () => void;
81
+ select: (item: AnyObject) => void;
82
+ NDrawer: any;
83
+ NDrawerContent: any;
84
+ NIcon: any;
85
+ NInput: any;
86
+ NButton: any;
87
+ CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
88
+ SearchOutline: 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<{}>>, {}>;
89
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
+ show: {
91
+ type: BooleanConstructor;
92
+ };
93
+ }>> & {
94
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
95
+ }, {
96
+ show: boolean;
97
+ }>;
24
98
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
25
99
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as f,withCtx as p,createTextVNode as v,toDisplayString as k,createCommentVNode as m,createElementVNode as b,createVNode as h,getCurrentInstance as w}from"vue";import{NButton as y,NInput as g,NIcon as x}from"naive-ui";import{PaperPlane as S}from"@vicons/ionicons5";import{InjectionAIChatEmits as C,InjectionAIChat as K}from"../types/index.js";import _ from"../../../audio-sdk/src/audioSDK.js";import{isString as j}from"lodash-es";const z={key:0,class:"menu-box fillet-8"},M={class:"input-wrapper fillet-10"},E=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),N={class:"btn-box"},R=["disabled"];var D=e({__name:"ChatFooter",setup(e){const D=_.create(),F=n(C),{shortcutList:J,state:O,isSmall:T,audioTimed:U}=n(K),B=t(""),I=o((()=>!B.value.replace(/(&nbsp;|\s|<br>)+/g,"")));async function L(){await D.recorderStart(w(),{onStop:P,allowPunctuationMark:!1,timed:U.value||10,realTimeRecognition:!0})}async function P(){try{const e=await D.recorderStop();if("success"!==e.result)return;const{text:n}=e.data;B.value=n}catch(e){console.log(e)}}function V(e){var n,t;if(j(e))return e;const o=null==(t=null==(n=null==e?void 0:e.contents)?void 0:n[0])?void 0:t.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function q(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),A()))}function A(){I.value||(O.beingSent=!0,O.sendContent=B.value,B.value="")}return l((()=>O.sendContent),(e=>{e&&!O.beingSent&&(B.value=e)})),i((()=>{D.destroy()})),(e,n)=>(a(),s("section",{class:r(["chat-footer",d(O).beingSent?"disabled":""])},[d(J)&&d(J).length>0?(a(),s("div",z,[(a(!0),s(c,null,u(d(J),(e=>(a(),f(d(y),{secondary:"",size:"small",round:d(T),key:V(e),onClick:()=>function(e){var n;if(j(e))B.value=e;else{const t=null==(n=null==e?void 0:e.contents)?void 0:n[0];F("button-click",{msgItem:t,item:e})}}(e)},{default:p((()=>[v(k(V(e)),1)])),_:2},1032,["round","onClick"])))),128))])):m("v-if",!0),b("div",M,[d(T)?(a(),f(d(g),{key:0,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:d(O).beingSent,value:B.value,"onUpdate:value":n[0]||(n[0]=e=>B.value=e),onKeydown:q},{suffix:p((()=>[h(d(y),{text:"",disabled:d(O).beingSent,onClick:L},{icon:p((()=>[h(d(x),{size:"30"},{default:p((()=>[E])),_:1})])),_:1},8,["disabled"]),h(d(y),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(I),onClick:A},{icon:p((()=>[h(d(x),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(a(),s(c,{key:1},[h(d(g),{type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:d(O).beingSent,autosize:{minRows:2,maxRows:7},value:B.value,"onUpdate:value":n[1]||(n[1]=e=>B.value=e),onKeydown:q},null,8,["disabled","value"]),b("div",N,[b("span",{class:r(["btn-send","gradient","fillet-8",d(I)?"disabled":""]),disabled:d(I),onClick:A},[h(d(x),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,R)])],64))])],2))}});export{D as default};
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};