cnhis-design-vue 3.2.12-release.0 → 3.2.13-beta.0

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 (83) hide show
  1. package/es/components/ai-chat/index.d.ts +66 -0
  2. package/es/components/ai-chat/src/Index.vue.d.ts +68 -2
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatCard.d.ts +24 -0
  5. package/es/components/ai-chat/src/components/ChatCard.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +48 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +45 -0
  10. package/es/components/ai-chat/src/components/ChatPrompt.vue.js +1 -0
  11. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -0
  12. package/es/components/ai-chat/src/types/index.d.ts +11 -1
  13. package/es/components/ai-chat/style/index.css +1 -1
  14. package/es/components/callback/src/components/render/popupMaps.d.ts +29 -0
  15. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  19. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  20. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  21. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  22. package/es/components/iho-table/index.d.ts +29 -0
  23. package/es/components/iho-table/src/IhoTable.vue.d.ts +30 -0
  24. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  25. package/es/components/iho-table/src/plugins/crossHeaderPlugin.d.ts +1 -0
  26. package/es/components/iho-table/src/plugins/crossHeaderPlugin.js +1 -0
  27. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.js +1 -1
  28. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  29. package/es/components/iho-table/src/plugins/index.js +1 -1
  30. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  31. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  32. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
  33. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +5 -5
  34. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  35. package/es/components/iho-table/src/types/index.d.ts +15 -0
  36. package/es/components/index.css +1 -1
  37. package/es/components/index.d.ts +2 -1
  38. package/es/components/index.js +1 -1
  39. package/es/components/template-render/index.d.ts +60 -0
  40. package/es/components/template-render/index.js +1 -0
  41. package/es/components/template-render/src/TemplateRender.vue.d.ts +62 -0
  42. package/es/components/template-render/src/TemplateRender.vue.js +1 -0
  43. package/es/components/template-render/src/TemplateRender.vue2.js +1 -0
  44. package/es/components/template-render/src/components/Box.vue.d.ts +44 -0
  45. package/es/components/template-render/src/components/Box.vue.js +1 -0
  46. package/es/components/template-render/src/components/Box.vue2.js +1 -0
  47. package/es/components/template-render/src/components/Button.vue.d.ts +49 -0
  48. package/es/components/template-render/src/components/Button.vue.js +1 -0
  49. package/es/components/template-render/src/components/Button.vue2.js +1 -0
  50. package/es/components/template-render/src/components/Divider.vue.d.ts +26 -0
  51. package/es/components/template-render/src/components/Divider.vue.js +1 -0
  52. package/es/components/template-render/src/components/Divider.vue2.js +1 -0
  53. package/es/components/template-render/src/components/Field.vue.d.ts +56 -0
  54. package/es/components/template-render/src/components/Field.vue.js +1 -0
  55. package/es/components/template-render/src/components/Field.vue2.js +1 -0
  56. package/es/components/template-render/src/components/FieldGroup.vue.d.ts +50 -0
  57. package/es/components/template-render/src/components/FieldGroup.vue.js +1 -0
  58. package/es/components/template-render/src/components/FieldGroup.vue2.js +1 -0
  59. package/es/components/template-render/src/components/Image.vue.d.ts +52 -0
  60. package/es/components/template-render/src/components/Image.vue.js +1 -0
  61. package/es/components/template-render/src/components/Image.vue2.js +1 -0
  62. package/es/components/template-render/src/components/Label.vue.d.ts +42 -0
  63. package/es/components/template-render/src/components/Label.vue.js +1 -0
  64. package/es/components/template-render/src/components/Label.vue2.js +1 -0
  65. package/es/components/template-render/src/components/Row.vue.d.ts +47 -0
  66. package/es/components/template-render/src/components/Row.vue.js +1 -0
  67. package/es/components/template-render/src/components/Row.vue2.js +1 -0
  68. package/es/components/template-render/src/components/Slot.d.ts +27 -0
  69. package/es/components/template-render/src/components/Slot.js +1 -0
  70. package/es/components/template-render/src/components/Text.vue.d.ts +40 -0
  71. package/es/components/template-render/src/components/Text.vue.js +1 -0
  72. package/es/components/template-render/src/components/Text.vue2.js +1 -0
  73. package/es/components/template-render/src/components/index.d.ts +529 -0
  74. package/es/components/template-render/src/components/index.js +1 -0
  75. package/es/components/template-render/src/constants/index.d.ts +16 -0
  76. package/es/components/template-render/src/constants/index.js +1 -0
  77. package/es/components/template-render/src/hooks/useCommon.d.ts +10 -0
  78. package/es/components/template-render/src/hooks/useCommon.js +1 -0
  79. package/es/components/template-render/src/utils/index.d.ts +6 -0
  80. package/es/components/template-render/src/utils/index.js +1 -0
  81. package/es/components/template-render/style/index.css +1 -0
  82. package/es/shared/package.json.js +1 -1
  83. package/package.json +2 -2
@@ -30,6 +30,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
30
30
  commandList: {
31
31
  type: import("vue").PropType<import("./src/types").CommandItem[]>;
32
32
  };
33
+ queryPrompt: {
34
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
35
+ };
36
+ patientInfo: {
37
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
38
+ };
33
39
  }, {
34
40
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
35
41
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -63,6 +69,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
63
69
  commandList: {
64
70
  type: import("vue").PropType<import("./src/types").CommandItem[]>;
65
71
  };
72
+ queryPrompt: {
73
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
74
+ };
75
+ patientInfo: {
76
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
77
+ };
66
78
  }>> & {
67
79
  "onButton-click"?: ((...args: any[]) => any) | undefined;
68
80
  }>>;
@@ -101,7 +113,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
101
113
  shortcutDescription?: string | undefined;
102
114
  children?: any[] | undefined;
103
115
  }[]>;
116
+ showPrompt: import("vue").Ref<boolean>;
117
+ currentShortcutId: import("vue").Ref<string>;
104
118
  btnDisabled: import("vue").ComputedRef<boolean>;
119
+ showMagicWand: import("vue").ComputedRef<boolean>;
105
120
  recorderStart: () => Promise<void>;
106
121
  isValidJSON: (str: string) => boolean;
107
122
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
@@ -109,6 +124,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
109
124
  resetCurrentCommand: () => void;
110
125
  handleKeyDown: (event: KeyboardEvent) => void;
111
126
  isWrap: (event: KeyboardEvent) => boolean;
127
+ handleInput: (value: string) => void;
112
128
  handleSend: () => void;
113
129
  clickMenu: (menu: import("./src/types").CommandItem) => void;
114
130
  handleBack: () => void;
@@ -122,6 +138,50 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
122
138
  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<{}>>, {}>;
123
139
  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<{}>>, {}>;
124
140
  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<{}>>, {}>;
141
+ 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<{}>>, {}>;
142
+ ChatPrompt: import("vue").DefineComponent<{
143
+ show: {
144
+ type: BooleanConstructor;
145
+ };
146
+ }, {
147
+ pageInfo: {
148
+ page: number;
149
+ hasMore: boolean;
150
+ };
151
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
152
+ show: {
153
+ type: BooleanConstructor;
154
+ };
155
+ }>> & {
156
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
157
+ }>>;
158
+ emit: (event: "update:show", ...args: any[]) => void;
159
+ queryPrompt: any;
160
+ state: any;
161
+ listRef: import("vue").Ref<any>;
162
+ keyword: import("vue").Ref<string>;
163
+ list: import("vue").Ref<import("../../shared/types").AnyObject[]>;
164
+ showNoData: import("vue").ComputedRef<boolean>;
165
+ handleInput: () => void;
166
+ handleSearch: () => Promise<void>;
167
+ resetAndSearch: () => void;
168
+ select: (item: import("../../shared/types").AnyObject) => void;
169
+ NDrawer: any;
170
+ NDrawerContent: any;
171
+ NIcon: any;
172
+ NInput: any;
173
+ NButton: any;
174
+ 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<{}>>, {}>;
175
+ 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<{}>>, {}>;
176
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
177
+ show: {
178
+ type: BooleanConstructor;
179
+ };
180
+ }>> & {
181
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
182
+ }, {
183
+ show: boolean;
184
+ }>;
125
185
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
126
186
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
127
187
  userAvatar: {
@@ -154,6 +214,12 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
154
214
  commandList: {
155
215
  type: import("vue").PropType<import("./src/types").CommandItem[]>;
156
216
  };
217
+ queryPrompt: {
218
+ type: import("vue").PropType<import("./src/types").QueryPrompt>;
219
+ };
220
+ patientInfo: {
221
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
222
+ };
157
223
  }>> & {
158
224
  "onButton-click"?: ((...args: any[]) => any) | undefined;
159
225
  }, {
@@ -1,5 +1,5 @@
1
1
  import { type PropType } from 'vue';
2
- import { QueryData, QueryRecord, CommandItem } 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: {
@@ -32,6 +32,12 @@ declare const _default: import("vue").DefineComponent<{
32
32
  commandList: {
33
33
  type: PropType<CommandItem[]>;
34
34
  };
35
+ queryPrompt: {
36
+ type: PropType<QueryPrompt>;
37
+ };
38
+ patientInfo: {
39
+ type: PropType<AnyObject>;
40
+ };
35
41
  }, {
36
42
  cssVars: import("vue").ComputedRef<AnyObject>;
37
43
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -65,6 +71,12 @@ declare const _default: import("vue").DefineComponent<{
65
71
  commandList: {
66
72
  type: PropType<CommandItem[]>;
67
73
  };
74
+ queryPrompt: {
75
+ type: PropType<QueryPrompt>;
76
+ };
77
+ patientInfo: {
78
+ type: PropType<AnyObject>;
79
+ };
68
80
  }>> & {
69
81
  "onButton-click"?: ((...args: any[]) => any) | undefined;
70
82
  }>>;
@@ -79,7 +91,7 @@ declare const _default: import("vue").DefineComponent<{
79
91
  } | {}>;
80
92
  ChatFooter: import("vue").DefineComponent<{}, {
81
93
  cssVars: import("vue").ComputedRef<AnyObject>;
82
- audioSdk: import("../..").CAudioSDK;
94
+ audioSdk: import("../../../components/index").CAudioSDK;
83
95
  emit: (event: string, ...args: any[]) => void;
84
96
  shortcutList: any;
85
97
  state: any;
@@ -103,7 +115,10 @@ declare const _default: import("vue").DefineComponent<{
103
115
  shortcutDescription?: string | undefined;
104
116
  children?: any[] | undefined;
105
117
  }[]>;
118
+ showPrompt: import("vue").Ref<boolean>;
119
+ currentShortcutId: import("vue").Ref<string>;
106
120
  btnDisabled: import("vue").ComputedRef<boolean>;
121
+ showMagicWand: import("vue").ComputedRef<boolean>;
107
122
  recorderStart: () => Promise<void>;
108
123
  isValidJSON: (str: string) => boolean;
109
124
  getShortcutName: (item: string | AnyObject) => any;
@@ -111,6 +126,7 @@ declare const _default: import("vue").DefineComponent<{
111
126
  resetCurrentCommand: () => void;
112
127
  handleKeyDown: (event: KeyboardEvent) => void;
113
128
  isWrap: (event: KeyboardEvent) => boolean;
129
+ handleInput: (value: string) => void;
114
130
  handleSend: () => void;
115
131
  clickMenu: (menu: CommandItem) => void;
116
132
  handleBack: () => void;
@@ -124,6 +140,50 @@ declare const _default: import("vue").DefineComponent<{
124
140
  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<{}>>, {}>;
125
141
  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<{}>>, {}>;
126
142
  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<{}>>, {}>;
143
+ 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<{}>>, {}>;
144
+ ChatPrompt: import("vue").DefineComponent<{
145
+ show: {
146
+ type: BooleanConstructor;
147
+ };
148
+ }, {
149
+ pageInfo: {
150
+ page: number;
151
+ hasMore: boolean;
152
+ };
153
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
154
+ show: {
155
+ type: BooleanConstructor;
156
+ };
157
+ }>> & {
158
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
159
+ }>>;
160
+ emit: (event: "update:show", ...args: any[]) => void;
161
+ queryPrompt: any;
162
+ state: any;
163
+ listRef: import("vue").Ref<any>;
164
+ keyword: import("vue").Ref<string>;
165
+ list: import("vue").Ref<AnyObject[]>;
166
+ showNoData: import("vue").ComputedRef<boolean>;
167
+ handleInput: () => void;
168
+ handleSearch: () => Promise<void>;
169
+ resetAndSearch: () => void;
170
+ select: (item: AnyObject) => void;
171
+ NDrawer: any;
172
+ NDrawerContent: any;
173
+ NIcon: any;
174
+ NInput: any;
175
+ NButton: any;
176
+ 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<{}>>, {}>;
177
+ 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<{}>>, {}>;
178
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
179
+ show: {
180
+ type: BooleanConstructor;
181
+ };
182
+ }>> & {
183
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
184
+ }, {
185
+ show: boolean;
186
+ }>;
127
187
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
128
188
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
129
189
  userAvatar: {
@@ -156,6 +216,12 @@ declare const _default: import("vue").DefineComponent<{
156
216
  commandList: {
157
217
  type: PropType<CommandItem[]>;
158
218
  };
219
+ queryPrompt: {
220
+ type: PropType<QueryPrompt>;
221
+ };
222
+ patientInfo: {
223
+ type: PropType<AnyObject>;
224
+ };
159
225
  }>> & {
160
226
  "onButton-click"?: ((...args: any[]) => any) | undefined;
161
227
  }, {
@@ -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 m,unref as u,createVNode as p,createBlock as d,createCommentVNode as l}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"@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},commandList:{type:Array}},emits:["button-click"],setup(e,{emit:S}){const j=e,k=y(),C=t({beingSent:!1,sendContent:"",selectedCommand:null});return o(v,{...r(j),state:C,isSmall:s((()=>"small"===j.uiStyle))}),o(f,S),(t,o)=>(i(),a("div",{class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(u(k))},[p(u(c)),e.hideInput?l("v-if",!0):(i(),d(h,{key:0}))],6))}});export{S as default};
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 m,unref as p,createVNode as u,createBlock as d,createCommentVNode as l}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});return o(v,{...r(F),state:b,isSmall:s((()=>"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?l("v-if",!0):(i(),d(h,{key:0}))],14,g))}});export{k as default};
@@ -0,0 +1,24 @@
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
+ instructionId: {
9
+ type: StringConstructor;
10
+ };
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<{
12
+ msgItem: {
13
+ type: PropType<MessageItem>;
14
+ default: () => {};
15
+ };
16
+ instructionId: {
17
+ type: StringConstructor;
18
+ };
19
+ }>> & {
20
+ "onButton-click"?: ((...args: any[]) => any) | undefined;
21
+ }, {
22
+ msgItem: MessageItem;
23
+ }>;
24
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as t,ref as n,createVNode as i}from"vue";import{NButton as o}from"naive-ui";import{InjectionAIChat as l}from"../types/index.js";import"../../../index.js";import{isArray as a}from"lodash-es";import s from"../../../form-render/index.js";import r from"../../../template-render/index.js";var d=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},instructionId:{type:String}},emits:["button-click"],setup(e,{attrs:d,slots:u,emit:c}){const{patientInfo:m,state:p}=t(l),f=n([]),g=n();function v(e){try{return JSON.parse(e),!0}catch(e){return!1}}const y=e.msgItem.content;function b(e){const{eventName:t,data:n}=e;t&&c("button-click",{fieldItem:n,isBI:!0})}function h(e){y.data[e.id+"Disabled"]=!0,c("button-click")}return y.needConfirms&&(f.value=(y.body.items||[]).map((t=>{var n,i;const o={html_type:t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1"};return"SELECT"===o.html_type&&(o.option=t.options,"fixed"===t.dataSourceType&&(null==(i=t.options)?void 0:i.length)||(o.html_type="REMOTE_SEARCH",Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{instructionId:e.instructionId,code:t.code,configs:m},dependKey:[]}),a(t.dependencies)&&t.dependencies.length&&(o.urlConfig.dependKey=t.dependencies))),o}))),()=>{var t;return i("div",{class:"card"},[y.needConfirms?[i("p",null,[y.title||y.header.title]),i(s,{disabled:e.msgItem.disabled,column:12,ref:g,"field-list":f.value},null),y.footer.buttons.map((t=>function(t){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=y.needConfirms?{...n,marginTop:"0"}:n;return i(o,{style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){if(y.needConfirms){if(!g.value)return;const e=g.value.getFormValues();try{await g.value.validate(),p.loading=!0,c("button-click",{values:e,buttonInfo:t,isForm:!0})}catch(e){}}else c("button-click")}},{default:()=>[y.needConfirms?null==t?void 0:t.text:y.buttonName]})}(t)))]:i(r,{config:v(null==(t=y.settings)?void 0:t.setting)?JSON.parse(y.settings.setting):null,data:y.data,"onModule-click":b,"onButton-click":h},null)])}}});export{d as default};
@@ -27,7 +27,10 @@ declare const _default: import("vue").DefineComponent<{}, {
27
27
  shortcutDescription?: string | undefined;
28
28
  children?: any[] | undefined;
29
29
  }[]>;
30
+ showPrompt: import("vue").Ref<boolean>;
31
+ currentShortcutId: import("vue").Ref<string>;
30
32
  btnDisabled: import("vue").ComputedRef<boolean>;
33
+ showMagicWand: import("vue").ComputedRef<boolean>;
31
34
  recorderStart: () => Promise<void>;
32
35
  isValidJSON: (str: string) => boolean;
33
36
  getShortcutName: (item: string | AnyObject) => any;
@@ -35,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{}, {
35
38
  resetCurrentCommand: () => void;
36
39
  handleKeyDown: (event: KeyboardEvent) => void;
37
40
  isWrap: (event: KeyboardEvent) => boolean;
41
+ handleInput: (value: string) => void;
38
42
  handleSend: () => void;
39
43
  clickMenu: (menu: CommandItem) => void;
40
44
  handleBack: () => void;
@@ -48,5 +52,49 @@ declare const _default: import("vue").DefineComponent<{}, {
48
52
  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<{}>>, {}>;
49
53
  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<{}>>, {}>;
50
54
  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<{}>>, {}>;
55
+ 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<{}>>, {}>;
56
+ ChatPrompt: import("vue").DefineComponent<{
57
+ show: {
58
+ type: BooleanConstructor;
59
+ };
60
+ }, {
61
+ pageInfo: {
62
+ page: number;
63
+ hasMore: boolean;
64
+ };
65
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
66
+ show: {
67
+ type: BooleanConstructor;
68
+ };
69
+ }>> & {
70
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
71
+ }>>;
72
+ emit: (event: "update:show", ...args: any[]) => void;
73
+ queryPrompt: any;
74
+ state: any;
75
+ listRef: import("vue").Ref<any>;
76
+ keyword: import("vue").Ref<string>;
77
+ list: import("vue").Ref<AnyObject[]>;
78
+ showNoData: import("vue").ComputedRef<boolean>;
79
+ handleInput: () => void;
80
+ handleSearch: () => Promise<void>;
81
+ resetAndSearch: () => void;
82
+ select: (item: AnyObject) => void;
83
+ NDrawer: any;
84
+ NDrawerContent: any;
85
+ NIcon: any;
86
+ NInput: any;
87
+ NButton: any;
88
+ 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<{}>>, {}>;
89
+ 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<{}>>, {}>;
90
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
91
+ show: {
92
+ type: BooleanConstructor;
93
+ };
94
+ }>> & {
95
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
96
+ }, {
97
+ show: boolean;
98
+ }>;
51
99
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
52
100
  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 d,renderList as c,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{PaperPlane as T,ChevronBack as z,ChevronForward as K}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 E,isString as I,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";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"},U=["disabled"],W={class:"command-box"},H={class:"command-box__header"},P={key:0,class:"title"},V={class:"command-box__menu"},q=["onClick"],A={class:"label"},G={class:"remark"};var Q=e({__name:"ChatFooter",setup(e){const Q=N(),X=D.create(),Y=t(M),{shortcutList:Z,state:$,isSmall:ee,audioTimed:te,commandList:le}=t(R),oe=l(),ne=l(""),ae=l(!1),se=l([]),ie=l(E(le.value||[])),re=o((()=>!ne.value.replace(/(&nbsp;|\s|<br>)+/g,"")));async function ue(){try{const e=await X.start(y(),{allowPunctuationMark:!1,timed:te.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;ne.value=t}catch(e){console.log(e)}}function de(e){var t,l;if(I(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 ce(){var e;ie.value=E(le.value||[]),se.value=[],(null==(e=le.value)?void 0:e.length)>0&&(ae.value=!0)}function ve(e){ae.value=!1,"Slash"!==e.code||$.selectedCommand||ne.value||ce(),"Backspace"===e.key&&(!ne.value.startsWith("/")&&!ne.value.startsWith("、")||2!==ne.value.length||$.selectedCommand?!ne.value&&$.selectedCommand&&(e.preventDefault(),$.selectedCommand=null,ne.value="/",ce()):ce()),["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),me()))}function me(){re.value||($.beingSent=!0,$.sendContent=ne.value,ne.value="")}function pe(){var e;se.value.pop(),ie.value=L(se.value)?null==(e=L(se.value))?void 0:e.children:E(le.value||[])}return n((()=>$.sendContent),(e=>{e&&!$.beingSent&&(ne.value=e)})),a((()=>{X.destroy()})),(e,t)=>(s(),i("section",{class:r(["chat-footer",u($).beingSent?"disabled":""])},[u(Z)&&u(Z).length>0?(s(),i("div",B,[(s(!0),i(d,null,c(u(Z),(e=>(s(),v(u(g),{secondary:"",size:"small",round:u(ee),key:de(e),onClick:()=>function(e){var t;if(I(e))ne.value=e;else{const l=null==(t=null==e?void 0:e.contents)?void 0:t[0];Y("button-click",{msgItem:l,item:e})}}(e)},{default:m((()=>[p(h(de(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:ae.value,onClickoutside:t[2]||(t[2]=e=>ae.value=!1)},{trigger:m((()=>[b("div",F,[u(ee)?(s(),v(u(C),{key:0,ref_key:"inputRef",ref:oe,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:u($).beingSent,value:ne.value,"onUpdate:value":t[0]||(t[0]=e=>ne.value=e),onKeydown:ve},{prefix:m((()=>[u($).selectedCommand&&u($).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Q)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(u($).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):f("v-if",!0)])),suffix:m((()=>[k(u(g),{text:"",disabled:u($).beingSent,onClick:ue},{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(re),onClick:me},{icon:m((()=>[k(u(_),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),i(d,{key:1},[k(u(C),{ref_key:"inputRef",ref:oe,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:u($).beingSent,autosize:{minRows:2,maxRows:7},value:ne.value,"onUpdate:value":t[1]||(t[1]=e=>ne.value=e),onKeydown:ve},{prefix:m((()=>[u($).selectedCommand&&u($).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Q)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=u($).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):f("v-if",!0)])),_:1},8,["disabled","value"]),b("div",O,[b("span",{class:r(["btn-send","gradient","fillet-8",u(re)?"disabled":""]),disabled:u(re),onClick:me},[k(u(_),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,U)])],64))])])),default:m((()=>[b("div",W,[b("div",H,[0===se.value.length?(s(),i("span",P,"推荐指令")):(s(),i(d,{key:1},[k(u(g),{text:"",onClick:pe},{default:m((()=>[k(u(_),{color:"#999",size:"20",component:u(z)},null,8,["component"])])),_:1}),k(u(S),null,{default:m((()=>[(s(!0),i(d,null,c(se.value,(e=>(s(),v(u(j),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),b("div",V,[(s(!0),i(d,null,c(ie.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)?(ie.value=t.children,se.value.push(t)):($.selectedCommand=t||{},ae.value=!1,ne.value="",oe.value.focus())}},[b("span",A,h(e.shortcutTitle),1),b("span",G,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(u(_),{key:0,color:"#999",size:"20",component:u(K)},null,8,["component"])):f("v-if",!0)],10,q)))),128))])])])),_:1},8,["show"])],2))}});export{Q as default};
1
+ import{defineComponent as e,inject as l,ref as t,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as u,normalizeClass as r,unref as i,Fragment as d,renderList as c,createBlock as v,withCtx as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,createVNode as k,createElementVNode as y,withModifiers as g,getCurrentInstance as w}from"vue";import{NButton as b,NPopover as x,NInput as C,NTag as _,NIcon as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{SparklesSharp as T,PaperPlane as K,ChevronBack as M,ChevronForward as D}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as R}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as P,last as E}from"lodash-es";import{useTheme as L}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 B from"./ChatPrompt.vue.js";const F={key:0,class:"menu-box fillet-8"},W={class:"input-wrapper fillet-10"},H=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[y("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),y("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"}),y("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),y("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"],q={class:"command-box"},G={class:"command-box__header"},J={key:0,class:"title"},O={class:"command-box__menu"},Q=["onMouseover","onClick"],X={class:"label"},Y={class:"remark"};var Z=e({__name:"ChatFooter",setup(e){const Z=L(),$=U.create(),ee=l(S),{shortcutList:le,state:te,isSmall:oe,audioTimed:ne,commandList:ae}=l(R),se=t(),ue=t(""),re=t(!1),ie=t([]),de=t(A(ae.value||[])),ce=t(!1),ve=t(""),me=o((()=>!ue.value.replace(/(&nbsp;|\s|<br>)+/g,""))),pe=o((()=>{var e;return!ue.value&&!(null==(e=se.value)?void 0:e.activated.value)}));async function he(){try{const e=await $.start(w(),{allowPunctuationMark:!1,timed:ne.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:l}=e.data;ue.value=l}catch(e){console.log(e)}}function fe(e){var l;if(P(e))return e;const{content:t}=(null==(l=null==e?void 0:e.contents)?void 0:l[0])||{};return t.instructionName}function ke(){re.value=!1,de.value=A(ae.value||[]),ie.value=[],ae.value.length&&(re.value=!0,ve.value=de.value[0].shortcutId)}function ye(e){if("Slash"!==e.code||te.selectedCommand||ue.value)if("Backspace"===e.key)re.value=!1,!ue.value.startsWith("/")&&!ue.value.startsWith("、")||2!==ue.value.length||te.selectedCommand?!ue.value&&te.selectedCommand&&(e.preventDefault(),te.selectedCommand=null,ue.value="/",ke()):ke();else if(re.value&&["ArrowUp","ArrowDown"].includes(e.key)){const l=de.value.findIndex((e=>e.shortcutId===ve.value));if("ArrowUp"===e.key){const e=l>0?l-1:de.value.length-1;ve.value=de.value[e].shortcutId}else if("ArrowDown"===e.key){const e=l<de.value.length-1?l+1:0;ve.value=de.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(),re.value){be(de.value.find((e=>e.shortcutId===ve.value)))}else we()}else re.value=!1;else ke()}function ge(e){!e&&te.selectedPrompt&&(te.selectedPrompt=null)}function we(){me.value||(te.sending=!0,te.loading=!0,te.sendContent=ue.value,ue.value="")}function be(e){var l;ve.value=e.shortcutId,se.value.focus(),(null==(l=e.children)?void 0:l.length)?(de.value=e.children,ve.value=de.value[0].shortcutId,ie.value.push(e)):(te.selectedCommand=e||{},re.value=!1,ue.value="")}function xe(){var e;ie.value.pop(),de.value=E(ie.value)?null==(e=E(ie.value))?void 0:e.children:A(ae.value||[]),ve.value=de.value[0].shortcutId,se.value.focus()}return n((()=>te.sendContent),(e=>{e&&!te.sending&&(ue.value=e)})),a((()=>{$.destroy()})),(e,l)=>(s(),u("section",{class:r(["chat-footer",i(te).loading?"disabled":""])},[i(le)&&i(le).length>0?(s(),u("div",F,[(s(!0),u(d,null,c(i(le),(e=>(s(),v(i(b),{secondary:"",size:"small",round:i(oe),key:fe(e),onClick:()=>function(e){var l;if(P(e))ue.value=e;else{const t=null==(l=null==e?void 0:e.contents)?void 0:l[0];ee("button-click",{msgItem:t,item:e})}}(e)},{default:m((()=>[p(h(fe(e)),1)])),_:2},1032,["round","onClick"])))),128))])):f("v-if",!0),k(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:re.value,onClickoutside:l[4]||(l[4]=e=>re.value=!1)},{trigger:m((()=>[y("div",W,[i(oe)?(s(),v(i(C),{key:0,ref_key:"inputRef",ref:se,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(te).loading,value:ue.value,"onUpdate:value":l[1]||(l[1]=e=>ue.value=e),onKeydownCapture:ye,onInput:ge},{prefix:m((()=>[i(te).selectedCommand&&i(te).selectedCommand.shortcutTitle?(s(),v(i(_),{key:0,bordered:!1,color:{textColor:i(Z)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(i(te).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(pe)?(s(),v(i(b),{key:1,text:"",onClick:l[0]||(l[0]=()=>ce.value=!0)},{default:m((()=>[k(i(I),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:m((()=>[k(i(b),{text:"",disabled:i(te).loading,onClick:he},{icon:m((()=>[k(i(I),{size:"30"},{default:m((()=>[H])),_:1})])),_:1},8,["disabled"]),k(i(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(me),onClick:we},{icon:m((()=>[k(i(I),{color:"#fff",size:"20",component:i(K)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),u(d,{key:1},[k(i(C),{ref_key:"inputRef",ref:se,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:i(te).loading,autosize:{minRows:2,maxRows:7},value:ue.value,"onUpdate:value":l[3]||(l[3]=e=>ue.value=e),onKeydownCapture:ye,onInput:ge},{prefix:m((()=>[i(te).selectedCommand&&i(te).selectedCommand.shortcutTitle?(s(),v(i(_),{key:0,bordered:!1,color:{textColor:i(Z)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=i(te).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(pe)?(s(),v(i(b),{key:1,text:"",onClick:l[2]||(l[2]=()=>ce.value=!0)},{default:m((()=>[k(i(I),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),y("div",N,[y("span",{class:r(["btn-send","gradient","fillet-8",i(me)?"disabled":""]),disabled:i(me),onClick:we},[k(i(I),{color:"#fff",size:"22",component:i(K)},null,8,["component"])],10,V)])],64))])])),default:m((()=>[y("div",q,[y("div",G,[0===ie.value.length?(s(),u("span",J,"推荐指令")):(s(),u(d,{key:1},[k(i(b),{text:"",onClick:xe},{default:m((()=>[k(i(I),{color:"#999",size:"20",component:i(M)},null,8,["component"])])),_:1}),k(i(j),null,{default:m((()=>[(s(!0),u(d,null,c(ie.value,(e=>(s(),v(i(z),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),y("div",O,[(s(!0),u(d,null,c(de.value,(e=>(s(),u("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",ve.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:g((()=>ve.value=e.shortcutId),["stop"]),onClick:()=>be(e)},[y("span",X,h(e.shortcutTitle),1),y("span",Y,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(i(I),{key:0,color:"#999",size:"20",component:i(D)},null,8,["component"])):f("v-if",!0)],42,Q)))),128))])])])),_:1},8,["show"]),k(B,{show:ce.value,"onUpdate:show":l[5]||(l[5]=e=>ce.value=e)},null,8,["show"])],2))}});export{Z as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as n,computed as l,watch as a,nextTick as s,createVNode as o,createTextVNode as i,mergeProps as r,isVNode as u}from"vue";import{NAvatar as c,NSpin as d,NButton as m,NSpace as p,NIcon as v}from"naive-ui";import{InjectionAIChatEmits as f,InjectionAIChat as g}from"../types/index.js";import h from"../../../../shared/assets/img/ai__avatar.png.js";import b from"../../../../shared/assets/img/logo.png.js";import{isArray as y,isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{ChevronForward as k}from"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";function S(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:j,emit:I}){const T=t(f),{userAvatar:E,queryData:_,state:w,queryRecord:z,defaultShortcutList:M,hideInput:N=!1,isSmall:O}=t(g),A=n(null),q=n([]),H=n(!1),J=l((()=>O.value?b:h)),L={page:0,hasMore:!0};async function D(e=!1){if(!L.hasMore)return;L.page++,1==L.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:L.page});y(n)&&q.value.length<=+t&&(q.value=L.page>1?[...q.value,...n]:n,R(),q.value.length>=+t&&(e&&(H.value=!0),L.hasMore=!1,console.log("没有更多消息了")))}function R(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function B(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return T("button-click",{item:t,msgItem:n,fieldItem:l}),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.beingSent=!0,w.sendContent="确定")}function F(e,t){const{contentType:n,content:l=""}=t;if("json"!==n||!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l))return null;const a=JSON.parse(l),s=["journaling","dashboard"].includes(a.buttonType);return o("div",{class:"card"},[[o("p",null,[a.title]),s?a.fields.map((n=>o(m,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>B({item:e,msgItem:t,fieldItem:n})},{default:()=>n.name,icon:()=>o(v,{component:k},null)}))):[o("div",{class:"card-body"},[o("p",{class:"card-body__head"},[a.instructionName]),o("div",{class:"card-body__content"},[a.fields.map((e=>o("div",null,[o("span",{class:"label"},[e.name]),i(":"),o("span",null,[e.value])])))])]),o(m,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.disabled,onClick:()=>B({item:e,msgItem:t})},{default:()=>[a.buttonName]})]]])}function G(e,t){const{contents:n=[],buttonType:l=""}=e,a=F(e,n[t]);if(a)return a;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:o("br",null,null)])),l&&0===t?[o("br",null,null),o(m,r({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>B({item:e})}),{default:()=>[i("确定")]})]:null]}function K({role:e=""}){return"user"===e}function P(){let e;return o("div",{class:"message-item"},[o(c,{round:!0,size:O.value?64:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content fillet-10 default"},[o("h2",null,[i("Hi,我是你的AI助理")]),o("p",null,[i("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),o("br",null,null),i("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),y(M.value)&&M.value.length>0?[o("p",{style:"margin: 5px 0 5px"},[i("你可以试着问我:")]),o(p,{"wrap-item":!1},S(e=M.value.map((e=>o(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.beingSent},S(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return C(A,(()=>{D()}),N.value?"bottom":"top"),D(!0),a((()=>w.beingSent),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),R();const e=w.selectedCommand;w.selectedCommand=null;const l=await _.value({content:w.sendContent,contentType:"text",command:e});y(null==l?void 0:l.contents)&&(q.value.unshift(l),await s(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),w.beingSent=!1,w.sendContent=""}})),()=>o("section",{class:"chat-main",ref:A,style:{"flex-direction":N.value?"column":"column-reverse"}},[[w.beingSent?o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:J.value},null),o("div",{class:"content-box"},[o("div",{class:"content loading"},[o(d,{size:22,stroke:"#4170EE"},null),o("span",null,[i("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>o("div",{class:"message-item"},[[O.value?null:o(c,{round:!0,size:40,src:K(t)?E.value:J.value},null),o("div",{class:["content-box",K(t)?"mine":""]},[o("div",{class:"content"},[x(t.render)?t.render():G(e,n)])])]]))))),H.value?P():null]])}});export{j as default};
1
+ import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as a,createVNode as s,createTextVNode as r,isVNode as u}from"vue";import{NAvatar as i,NSpin as c,NSpace as d,NButton as m}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as p}from"../types/index.js";import f from"../../../../shared/assets/img/ai__avatar.png.js";import g from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as b}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as y}from"../../../../shared/hooks/useScrollLoading.js";import x from"./ChatCard.js";function C(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:j,emit:k}){const T=t(v),{userAvatar:E,queryData:I,state:w,queryRecord:z,defaultShortcutList:S,hideInput:M=!1,isSmall:A}=t(p),D=n(null),q=n([]),H=n(!1),L=l((()=>A.value?g:f)),O={page:0,hasMore:!0};async function _(e=!1){if(!O.hasMore)return;O.page++,1==O.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:O.page});h(n)&&q.value.length<=+t&&(q.value=O.page>1?[...q.value,...n]:n,B(),q.value.length>=+t&&(e&&(H.value=!0),O.hasMore=!1,console.log("没有更多消息了")))}function B(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function P(e,t){const{contentType:n,content:l}=t;return"json"===n&&l?s(x,{instructionId:e.instructionId,msgItem:t,"onButton-click":(n={})=>function(e){const{item:t,msgItem:n}=e;if(n)return T("button-click",e),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.sendContent="确定",w.sending=!0,w.loading=!0)}({item:e,msgItem:t,...n})},null):null}function R(e,t){const{contents:n=[],buttonType:l=""}=e,o=P(e,n[t]);if(o)return o;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:s("br",null,null)]))]}function F({role:e=""}){return"user"===e}function G(){let e;return s("div",{class:"message-item"},[s(i,{round:!0,size:A.value?64:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[r("Hi,我是你的AI助理")]),s("p",null,[r("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),r("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(S.value)&&S.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[r("你可以试着问我:")]),s(d,{"wrap-item":!1},C(e=S.value.map((e=>s(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.loading},C(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return y(D,(()=>{_()}),M.value?"bottom":"top"),_(!0),o((()=>w.externalData),(e=>{var t,n;e&&(t=e,q.value.unshift(t),null==(n=D.value)||n.scrollTo({top:0,behavior:"auto"}),B(),w.loading=!1,w.externalData=null)})),o((()=>w.sending),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=D.value)||t.scrollTo({top:0,behavior:"auto"}),B();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null;const o=await I.value({content:w.sendContent,contentType:"text",command:e,prompt:l});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await a(),null==(n=D.value)||n.scrollTo({top:0,behavior:"auto"})),w.sending=!1,w.loading=!1,w.sendContent=""}})),()=>s("section",{class:"chat-main",ref:D,style:{"flex-direction":M.value?"column":"column-reverse"}},[[w.loading?s("div",{class:"message-item"},[[A.value?null:s(i,{round:!0,size:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(c,{size:22,stroke:"#4170EE"},null),s("span",null,[r("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>s("div",{class:"message-item"},[[A.value?null:s(i,{round:!0,size:40,src:F(t)?E.value:L.value},null),s("div",{class:["content-box",F(t)?"mine":""]},[s("div",{class:"content"},[b(t.render)?t.render():R(e,n)])])]]))))),H.value?G():null]])}});export{j as default};
@@ -0,0 +1,45 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ show: {
4
+ type: BooleanConstructor;
5
+ };
6
+ }, {
7
+ pageInfo: {
8
+ page: number;
9
+ hasMore: boolean;
10
+ };
11
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
+ show: {
13
+ type: BooleanConstructor;
14
+ };
15
+ }>> & {
16
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
17
+ }>>;
18
+ emit: (event: "update:show", ...args: any[]) => void;
19
+ queryPrompt: any;
20
+ state: any;
21
+ listRef: import("vue").Ref<any>;
22
+ keyword: import("vue").Ref<string>;
23
+ list: import("vue").Ref<AnyObject[]>;
24
+ showNoData: import("vue").ComputedRef<boolean>;
25
+ handleInput: () => void;
26
+ handleSearch: () => Promise<void>;
27
+ resetAndSearch: () => void;
28
+ select: (item: AnyObject) => void;
29
+ NDrawer: any;
30
+ NDrawerContent: any;
31
+ NIcon: any;
32
+ NInput: any;
33
+ NButton: any;
34
+ 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<{}>>, {}>;
35
+ 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<{}>>, {}>;
36
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
+ show: {
38
+ type: BooleanConstructor;
39
+ };
40
+ }>> & {
41
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ show: boolean;
44
+ }>;
45
+ export default _default;
@@ -0,0 +1 @@
1
+ import r from"./ChatPrompt.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var e=t(r,[["__file","ChatPrompt.vue"]]);export{e as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as o,ref as t,computed as a,watch as s,openBlock as r,createBlock as l,unref as n,withCtx as p,createVNode as u,createElementVNode as i,createElementBlock as c,Fragment as m,renderList as d,toDisplayString as h,withDirectives as v,vShow as f}from"vue";import{NDrawer as w,NDrawerContent as g,NButton as k,NIcon as C,NInput as y}from"naive-ui";import{CloseOutline as _,SearchOutline as j}from"@vicons/ionicons5";import{isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as M}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as b}from"../../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as P}from"../types/index.js";const R={class:"title"},S=i("span",null,"发现提示词",-1),U=["onClick"];var q=e({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:q}){const z=e,B={page:0,hasMore:!0},{queryPrompt:H,state:I}=o(P),L=t(),O=t(""),T=t([]),$=a((()=>!T.value.length&&!!(O.value||"").replace(/^\s+|\s+$/g,""))),A=M(E,500);async function D(){try{if(!B.hasMore||!x(H.value))return;B.page++,1==B.page&&(T.value=[]);const e=await H.value({keyword:O.value,page:B.page});T.value.length<=+e.records&&(T.value=B.page>1?T.value.concat(e.rows):e.rows,T.value.length>=+e.records&&(B.hasMore=!1))}catch(e){}}function E(){Object.assign(B,{page:0,hasMore:!0}),D()}return b(L,(()=>{D()})),s((()=>z.show),(e=>{e&&(O.value="",E())})),(o,t)=>(r(),l(n(w),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+n(I).id,show:e.show,"content-class":"prompt-wrapper",onMaskClick:t[2]||(t[2]=()=>q("update:show",!1))},{default:p((()=>[u(n(g),null,{header:p((()=>[i("div",R,[S,u(n(k),{text:"",onClick:t[0]||(t[0]=()=>q("update:show",!1))},{default:p((()=>[u(n(C),{size:"20",component:n(_)},null,8,["component"])])),_:1})]),u(n(y),{ref:"inputRef",clearable:"",autofocus:"",value:O.value,"onUpdate:value":[t[1]||(t[1]=e=>O.value=e),n(A)]},{prefix:p((()=>[u(n(C),{component:n(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:p((()=>[i("div",{class:"list-wrapper",ref_key:"listRef",ref:L},[(r(!0),c(m,null,d(T.value,(e=>(r(),c("div",{class:"item",key:e.promptId,onClick:()=>function(e){q("update:show",!1),I.selectedPrompt=e,I.sendContent=e.promptContent}(e)},[i("p",null,h(e.promptTitle),1),i("p",null,h(e.promptContent),1)],8,U)))),128)),v(i("div",null,"找不到相关的结果",512),[[f,n($)]])],512)])),_:1})])),_:1},8,["to","show"]))}});export{q as default};
@@ -4,7 +4,8 @@ export declare const InjectionAIChat: InjectionKey<AnyObject>;
4
4
  export declare const InjectionAIChatEmits: InjectionKey<(event: string, ...args: any[]) => void>;
5
5
  export type MessageItem = {
6
6
  role: string;
7
- content: string;
7
+ contentType: 'json' | 'text';
8
+ content: AnyObject | string;
8
9
  render?: () => VNodeChild;
9
10
  [key: string]: any;
10
11
  };
@@ -16,6 +17,8 @@ export type MessageList = Array<{
16
17
  export type QueryData = (props: {
17
18
  content: string;
18
19
  contentType: string;
20
+ command: any;
21
+ prompt: any;
19
22
  }) => Promise<Array<{
20
23
  contents: MessageItem[];
21
24
  buttonType?: string;
@@ -34,3 +37,10 @@ export type CommandItem = {
34
37
  children?: CommandItem[];
35
38
  [key: string]: any;
36
39
  };
40
+ export type QueryPrompt = (props: {
41
+ keyword: string;
42
+ page: number;
43
+ }) => Promise<{
44
+ rows: AnyObject[];
45
+ records: number;
46
+ }>;
@@ -1 +1 @@
1
- .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{background:#e5e5e5;border-radius:5px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable{position:relative}.ai-chat .chat-footer .command-box__menu .menu-item.selectable .label{color:var(--c-primary-color);margin-left:30px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable:before{background:#d5d5d5;border-radius:5px;content:"/";height:20px;left:5px;line-height:20px;position:absolute;text-align:center;top:10px;width:20px}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}
1
+ .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;position:relative;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content .card .patient-info{border-top:1px solid #e5e5e5;margin-top:5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item{margin:5px 0 0 5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item:last-child{margin-bottom:0}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:first-child{font-weight:700}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:last-child{color:#888}.ai-chat .chat-main .message-item .content-box .content .card .n-form{margin-top:10px}.ai-chat .chat-main .message-item .content-box .content .card .n-form .form-render__formItemLabel{color:#888}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{cursor:default}.ai-chat .chat-footer .command-box__menu .menu-item.selected{background:#f2f2f2;border-radius:5px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable{position:relative}.ai-chat .chat-footer .command-box__menu .menu-item.selectable .label{color:var(--c-primary-color);margin-left:30px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable:before{background:#e5e5e5;border-radius:5px;content:"/";height:20px;left:5px;line-height:20px;position:absolute;text-align:center;top:10px;width:20px}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}.ai-chat .prompt-wrapper{background:linear-gradient(135deg,#ecf3ff,#ecf3ff 20%,rgba(237,237,253,.5) 70%,rgba(203,175,255,.3))}.ai-chat .prompt-wrapper .n-drawer-header{padding:15px}.ai-chat .prompt-wrapper .n-drawer-header__main{width:100%}.ai-chat .prompt-wrapper .n-drawer-header__main .title{display:flex;font-size:14px}.ai-chat .prompt-wrapper .n-drawer-header__main .title .n-button{margin-left:auto}.ai-chat .prompt-wrapper .n-drawer-header__main .n-input{margin-top:10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper{padding:0 10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper{align-content:flex-start;display:flex;flex-wrap:wrap;height:100%;overflow-y:auto}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar{width:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item{background:#fff;border-radius:10px;box-sizing:border-box;break-inside:avoid;cursor:pointer;margin:5px;padding:10px;width:calc(50% - 10px)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item:hover{background-image:linear-gradient(#ecf3ff,#fff 40%,#fff)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item p:last-child{color:#999;font-size:12px}