cnhis-design-vue 3.2.13-beta.0 → 3.2.13-beta.12

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 (34) hide show
  1. package/es/components/ai-chat/index.d.ts +82 -3
  2. package/es/components/ai-chat/src/Index.vue.d.ts +82 -3
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +58 -0
  6. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +58 -0
  9. package/es/components/ai-chat/src/components/ChatPatient.vue.js +1 -0
  10. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -0
  11. package/es/components/ai-chat/src/types/index.d.ts +6 -5
  12. package/es/components/ai-chat/style/index.css +1 -1
  13. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  14. package/es/components/button-print/src/utils/print.js +1 -1
  15. package/es/components/callback/src/components/render/popupMaps.d.ts +8 -6
  16. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  18. package/es/components/iho-table/index.d.ts +8 -6
  19. package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -6
  20. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  21. package/es/components/iho-table/src/plugins/crossHeaderPlugin.js +1 -1
  22. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  23. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  24. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  25. package/es/components/iho-table/src/types/index.d.ts +3 -2
  26. package/es/components/iho-table/style/index.css +1 -1
  27. package/es/components/index.css +1 -1
  28. package/es/components/template-render/src/components/Button.vue.d.ts +1 -0
  29. package/es/components/template-render/src/components/Button.vue2.js +1 -1
  30. package/es/components/template-render/src/components/Field.vue.d.ts +1 -1
  31. package/es/components/template-render/src/components/Field.vue2.js +1 -1
  32. package/es/components/template-render/src/components/index.d.ts +3 -2
  33. package/es/shared/package.json.js +1 -1
  34. package/package.json +2 -2
@@ -1,5 +1,9 @@
1
1
  import { SFCWithInstall } from '../../shared/types';
2
2
  declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
3
+ token: {
4
+ type: StringConstructor;
5
+ required: true;
6
+ };
3
7
  userAvatar: {
4
8
  type: StringConstructor;
5
9
  };
@@ -34,11 +38,18 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
34
38
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
35
39
  };
36
40
  patientInfo: {
37
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
41
+ type: import("vue").PropType<Partial<{
42
+ info: import("../../shared/types").AnyObject;
43
+ queryPatient: (keyword: string) => Promise<import("../../shared/types").AnyObject[]>;
44
+ }>>;
38
45
  };
39
46
  }, {
40
47
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
41
48
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
49
+ token: {
50
+ type: StringConstructor;
51
+ required: true;
52
+ };
42
53
  userAvatar: {
43
54
  type: StringConstructor;
44
55
  };
@@ -73,7 +84,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
73
84
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
74
85
  };
75
86
  patientInfo: {
76
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
87
+ type: import("vue").PropType<Partial<{
88
+ info: import("../../shared/types").AnyObject;
89
+ queryPatient: (keyword: string) => Promise<import("../../shared/types").AnyObject[]>;
90
+ }>>;
77
91
  };
78
92
  }>> & {
79
93
  "onButton-click"?: ((...args: any[]) => any) | undefined;
@@ -115,8 +129,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
115
129
  }[]>;
116
130
  showPrompt: import("vue").Ref<boolean>;
117
131
  currentShortcutId: import("vue").Ref<string>;
132
+ showPatient: import("vue").Ref<boolean>;
118
133
  btnDisabled: import("vue").ComputedRef<boolean>;
119
134
  showMagicWand: import("vue").ComputedRef<boolean>;
135
+ patient: import("vue").ComputedRef<string>;
120
136
  recorderStart: () => Promise<void>;
121
137
  isValidJSON: (str: string) => boolean;
122
138
  getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
@@ -139,6 +155,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
139
155
  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<{}>>, {}>;
140
156
  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
157
  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<{}>>, {}>;
158
+ PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
142
159
  ChatPrompt: import("vue").DefineComponent<{
143
160
  show: {
144
161
  type: BooleanConstructor;
@@ -182,8 +199,67 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
182
199
  }, {
183
200
  show: boolean;
184
201
  }>;
202
+ ChatPatient: import("vue").DefineComponent<{
203
+ show: {
204
+ type: BooleanConstructor;
205
+ };
206
+ }, {
207
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
208
+ show: {
209
+ type: BooleanConstructor;
210
+ };
211
+ }>> & {
212
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
213
+ }>>;
214
+ emit: (event: "update:show", ...args: any[]) => void;
215
+ patientInfo: any;
216
+ state: any;
217
+ formValue: {
218
+ businessType: null;
219
+ vaa01: null;
220
+ bck03a: string;
221
+ };
222
+ rules: {
223
+ businessType: {
224
+ required: boolean;
225
+ trigger: string;
226
+ message: string;
227
+ };
228
+ vaa01: {
229
+ required: boolean;
230
+ trigger: string[];
231
+ message: string;
232
+ };
233
+ };
234
+ options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
235
+ formRef: import("vue").Ref<any>;
236
+ renderLabel: (option: import("../../shared/types").AnyObject) => string;
237
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
238
+ handleSearch: (keyword: string) => Promise<void>;
239
+ handleValidateClick: (e: MouseEvent) => void;
240
+ NDrawer: any;
241
+ NDrawerContent: any;
242
+ NForm: any;
243
+ NFormItem: any;
244
+ NButton: any;
245
+ NRadioGroup: any;
246
+ NRadio: any;
247
+ NSelect: any;
248
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
249
+ show: {
250
+ type: BooleanConstructor;
251
+ };
252
+ }>> & {
253
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
254
+ }, {
255
+ show: boolean;
256
+ }>;
185
257
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
186
258
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
259
+ token: {
260
+ type: StringConstructor;
261
+ required: true;
262
+ };
187
263
  userAvatar: {
188
264
  type: StringConstructor;
189
265
  };
@@ -218,7 +294,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
218
294
  type: import("vue").PropType<import("./src/types").QueryPrompt>;
219
295
  };
220
296
  patientInfo: {
221
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
297
+ type: import("vue").PropType<Partial<{
298
+ info: import("../../shared/types").AnyObject;
299
+ queryPatient: (keyword: string) => Promise<import("../../shared/types").AnyObject[]>;
300
+ }>>;
222
301
  };
223
302
  }>> & {
224
303
  "onButton-click"?: ((...args: any[]) => any) | undefined;
@@ -2,6 +2,10 @@ import { type PropType } from 'vue';
2
2
  import { QueryData, QueryRecord, CommandItem, QueryPrompt } from './types';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
+ token: {
6
+ type: StringConstructor;
7
+ required: true;
8
+ };
5
9
  userAvatar: {
6
10
  type: StringConstructor;
7
11
  };
@@ -36,11 +40,18 @@ declare const _default: import("vue").DefineComponent<{
36
40
  type: PropType<QueryPrompt>;
37
41
  };
38
42
  patientInfo: {
39
- type: PropType<AnyObject>;
43
+ type: PropType<Partial<{
44
+ info: AnyObject;
45
+ queryPatient: (keyword: string) => Promise<AnyObject[]>;
46
+ }>>;
40
47
  };
41
48
  }, {
42
49
  cssVars: import("vue").ComputedRef<AnyObject>;
43
50
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
51
+ token: {
52
+ type: StringConstructor;
53
+ required: true;
54
+ };
44
55
  userAvatar: {
45
56
  type: StringConstructor;
46
57
  };
@@ -75,7 +86,10 @@ declare const _default: import("vue").DefineComponent<{
75
86
  type: PropType<QueryPrompt>;
76
87
  };
77
88
  patientInfo: {
78
- type: PropType<AnyObject>;
89
+ type: PropType<Partial<{
90
+ info: AnyObject;
91
+ queryPatient: (keyword: string) => Promise<AnyObject[]>;
92
+ }>>;
79
93
  };
80
94
  }>> & {
81
95
  "onButton-click"?: ((...args: any[]) => any) | undefined;
@@ -117,8 +131,10 @@ declare const _default: import("vue").DefineComponent<{
117
131
  }[]>;
118
132
  showPrompt: import("vue").Ref<boolean>;
119
133
  currentShortcutId: import("vue").Ref<string>;
134
+ showPatient: import("vue").Ref<boolean>;
120
135
  btnDisabled: import("vue").ComputedRef<boolean>;
121
136
  showMagicWand: import("vue").ComputedRef<boolean>;
137
+ patient: import("vue").ComputedRef<string>;
122
138
  recorderStart: () => Promise<void>;
123
139
  isValidJSON: (str: string) => boolean;
124
140
  getShortcutName: (item: string | AnyObject) => any;
@@ -141,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
141
157
  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<{}>>, {}>;
142
158
  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
159
  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<{}>>, {}>;
160
+ PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
144
161
  ChatPrompt: import("vue").DefineComponent<{
145
162
  show: {
146
163
  type: BooleanConstructor;
@@ -184,8 +201,67 @@ declare const _default: import("vue").DefineComponent<{
184
201
  }, {
185
202
  show: boolean;
186
203
  }>;
204
+ ChatPatient: import("vue").DefineComponent<{
205
+ show: {
206
+ type: BooleanConstructor;
207
+ };
208
+ }, {
209
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
210
+ show: {
211
+ type: BooleanConstructor;
212
+ };
213
+ }>> & {
214
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
215
+ }>>;
216
+ emit: (event: "update:show", ...args: any[]) => void;
217
+ patientInfo: any;
218
+ state: any;
219
+ formValue: {
220
+ businessType: null;
221
+ vaa01: null;
222
+ bck03a: string;
223
+ };
224
+ rules: {
225
+ businessType: {
226
+ required: boolean;
227
+ trigger: string;
228
+ message: string;
229
+ };
230
+ vaa01: {
231
+ required: boolean;
232
+ trigger: string[];
233
+ message: string;
234
+ };
235
+ };
236
+ options: import("vue").Ref<AnyObject[]>;
237
+ formRef: import("vue").Ref<any>;
238
+ renderLabel: (option: AnyObject) => string;
239
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
240
+ handleSearch: (keyword: string) => Promise<void>;
241
+ handleValidateClick: (e: MouseEvent) => void;
242
+ NDrawer: any;
243
+ NDrawerContent: any;
244
+ NForm: any;
245
+ NFormItem: any;
246
+ NButton: any;
247
+ NRadioGroup: any;
248
+ NRadio: any;
249
+ NSelect: any;
250
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
251
+ show: {
252
+ type: BooleanConstructor;
253
+ };
254
+ }>> & {
255
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
256
+ }, {
257
+ show: boolean;
258
+ }>;
187
259
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
188
260
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
261
+ token: {
262
+ type: StringConstructor;
263
+ required: true;
264
+ };
189
265
  userAvatar: {
190
266
  type: StringConstructor;
191
267
  };
@@ -220,7 +296,10 @@ declare const _default: import("vue").DefineComponent<{
220
296
  type: PropType<QueryPrompt>;
221
297
  };
222
298
  patientInfo: {
223
- type: PropType<AnyObject>;
299
+ type: PropType<Partial<{
300
+ info: AnyObject;
301
+ queryPatient: (keyword: string) => Promise<AnyObject[]>;
302
+ }>>;
224
303
  };
225
304
  }>> & {
226
305
  "onButton-click"?: ((...args: any[]) => any) | undefined;
@@ -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 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};
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 k=["id"];var g=e({__name:"Index",props:{token:{type:String,required:!0},userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object}},emits:["button-click"],setup(e,{expose:g,emit:b}){const q=e,A=y();f().registGlobHttpInstance(S.create({headers:{Authorization:"bearer "+q.token}}));const C=t({id:"ai-chat-"+j(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null});return o(v,{...r(q),state:C,isSmall:s((()=>"small"===q.uiStyle))}),o(x,b),g({pushMessage:e=>{C.externalData=e}}),(t,o)=>(i(),a("div",{id:C.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(p(A))},[u(p(c)),e.hideInput?l("v-if",!0):(i(),d(h,{key:0}))],14,k))}});export{g as default};
@@ -1 +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};
1
+ import{defineComponent as t,inject as e,ref as n,computed as o,createVNode as i}from"vue";import{NButton as l}from"naive-ui";import{InjectionAIChat as a}from"../types/index.js";import"../../../index.js";import{isArray as s}from"lodash-es";import r from"../../../form-render/index.js";import u from"../../../template-render/index.js";var d=t({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},instructionId:{type:String}},emits:["button-click"],setup(t,{attrs:d,slots:c,emit:m}){const p={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATETIME-INPUT"},{patientInfo:f,state:v}=e(a),g=n([]),b=n(),y=o((()=>{var e,n;return!!(null==(n=null==(e=t.msgItem)?void 0:e.content)?void 0:n.body)}));function h(t){try{return JSON.parse(t),!0}catch(t){return!1}}const I=t.msgItem.content;function E(t){const{eventName:e,data:n}=t;e&&m("button-click",{buttonInfo:n,isBI:!0})}function T(t){I.data[t.button.id+"Disabled"]=!0,m("button-click",{buttonInfo:t.button})}return y.value&&(g.value=(I.body.items||[]).map((e=>{var n,o;const i={html_type:p[e.type]||e.type,val_key:e.code,name:e.name,elem_width:12,default_val:e.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=e.labelField)?n:"label"},option:[],is_null:e.required?"0":"1"};return"SELECT"===i.html_type&&(i.option=e.options,(null==(o=e.options)?void 0:o.length)||(i.html_type="REMOTE_SEARCH",Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{instructionId:t.instructionId,code:e.code,configs:f.value.info||v.selectedPatient},dependKey:[]}),s(e.dependencies)&&e.dependencies.length&&(i.urlConfig.dependKey=e.dependencies))),i}))),()=>{var e;return i("div",{class:"card"},[y.value?[i("p",null,[I.title||I.header.title]),i(r,{disabled:t.msgItem.disabled,column:12,ref:b,"field-list":g.value},null),I.footer.buttons.map((e=>function(e){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},o=y.value?{...n,marginTop:"0"}:n;return i(l,{style:o,secondary:!0,class:"gradient",disabled:t.msgItem.disabled,onClick:async function(){if(y.value){if(!b.value)return;const t=b.value.getFormValues();try{await b.value.validate(),I.body.items.forEach((e=>{t[e.code]&&(e.value=t[e.code])})),v.loading=!0,m("button-click",{values:t,buttonInfo:e,isForm:!0})}catch(t){}}else m("button-click")}},{default:()=>[y.value?null==e?void 0:e.text:I.buttonName]})}(e)))]:i(u,{config:h(null==(e=I.settings)?void 0:e.setting)?JSON.parse(I.settings.setting):null,data:I.data,"onModule-click":E,"onButton-click":T},null)])}}});export{d as default};
@@ -29,8 +29,10 @@ declare const _default: import("vue").DefineComponent<{}, {
29
29
  }[]>;
30
30
  showPrompt: import("vue").Ref<boolean>;
31
31
  currentShortcutId: import("vue").Ref<string>;
32
+ showPatient: import("vue").Ref<boolean>;
32
33
  btnDisabled: import("vue").ComputedRef<boolean>;
33
34
  showMagicWand: import("vue").ComputedRef<boolean>;
35
+ patient: import("vue").ComputedRef<string>;
34
36
  recorderStart: () => Promise<void>;
35
37
  isValidJSON: (str: string) => boolean;
36
38
  getShortcutName: (item: string | AnyObject) => any;
@@ -53,6 +55,7 @@ declare const _default: import("vue").DefineComponent<{}, {
53
55
  ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
54
56
  ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
55
57
  SparklesSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
58
+ PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
56
59
  ChatPrompt: import("vue").DefineComponent<{
57
60
  show: {
58
61
  type: BooleanConstructor;
@@ -96,5 +99,60 @@ declare const _default: import("vue").DefineComponent<{}, {
96
99
  }, {
97
100
  show: boolean;
98
101
  }>;
102
+ ChatPatient: import("vue").DefineComponent<{
103
+ show: {
104
+ type: BooleanConstructor;
105
+ };
106
+ }, {
107
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
108
+ show: {
109
+ type: BooleanConstructor;
110
+ };
111
+ }>> & {
112
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
113
+ }>>;
114
+ emit: (event: "update:show", ...args: any[]) => void;
115
+ patientInfo: any;
116
+ state: any;
117
+ formValue: {
118
+ businessType: null;
119
+ vaa01: null;
120
+ bck03a: string;
121
+ };
122
+ rules: {
123
+ businessType: {
124
+ required: boolean;
125
+ trigger: string;
126
+ message: string;
127
+ };
128
+ vaa01: {
129
+ required: boolean;
130
+ trigger: string[];
131
+ message: string;
132
+ };
133
+ };
134
+ options: import("vue").Ref<AnyObject[]>;
135
+ formRef: import("vue").Ref<any>;
136
+ renderLabel: (option: AnyObject) => string;
137
+ handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
138
+ handleSearch: (keyword: string) => Promise<void>;
139
+ handleValidateClick: (e: MouseEvent) => void;
140
+ NDrawer: any;
141
+ NDrawerContent: any;
142
+ NForm: any;
143
+ NFormItem: any;
144
+ NButton: any;
145
+ NRadioGroup: any;
146
+ NRadio: any;
147
+ NSelect: any;
148
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
149
+ show: {
150
+ type: BooleanConstructor;
151
+ };
152
+ }>> & {
153
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
154
+ }, {
155
+ show: boolean;
156
+ }>;
99
157
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
100
158
  export default _default;
@@ -1 +1 @@
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
+ import{defineComponent as e,inject as l,ref as o,computed as t,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as r,normalizeClass as u,unref as i,createElementVNode as c,createBlock as d,withCtx as v,createVNode as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,Fragment as k,renderList as y,withModifiers as w,getCurrentInstance as g}from"vue";import{NButton as b,NIcon as C,NPopover as x,NInput as _,NTag as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{PeopleOutline as T,SparklesSharp as K,PaperPlane as M,ChevronBack as P,ChevronForward as D}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as U}from"../types/index.js";import R from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as E,last as L}from"lodash-es";import{useTheme as B}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import F from"./ChatPrompt.vue.js";import W from"./ChatPatient.vue.js";const $={class:"menu-box fillet-8"},q={class:"input-wrapper fillet-10"},H=c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),c("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),c("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),N={class:"btn-box"},V=["disabled"],G={class:"command-box"},J={class:"command-box__header"},O={key:0,class:"title"},Q={class:"command-box__menu"},X=["onMouseover","onClick"],Y={class:"label"},Z={class:"remark"};var ee=e({__name:"ChatFooter",setup(e){const ee=B(),le=R.create(),oe=l(S),{shortcutList:te,state:ne,isSmall:ae,audioTimed:se,commandList:re}=l(U),ue=o(),ie=o(""),ce=o(!1),de=o([]),ve=o(A(re.value||[])),me=o(!1),pe=o(""),he=o(!1),fe=t((()=>!ie.value.replace(/(&nbsp;|\s|<br>)+/g,""))),ke=t((()=>{var e;return!ie.value&&!(null==(e=ue.value)?void 0:e.activated.value)})),ye=t((()=>{if(!ne.selectedPatient)return"选择患者";const{bcq04b:e,vaa05:l}=ne.selectedPatient;return`${e}床/${l}`}));async function we(){try{const e=await le.start(g(),{allowPunctuationMark:!1,timed:se.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:l}=e.data;ie.value=l}catch(e){console.log(e)}}function ge(e){var l;if(E(e))return e;const{content:o}=(null==(l=null==e?void 0:e.contents)?void 0:l[0])||{};return o.instructionName}function be(){var e;ce.value=!1,ve.value=A(re.value||[]),de.value=[],(null==(e=re.value)?void 0:e.length)&&(ce.value=!0,pe.value=ve.value[0].shortcutId)}function Ce(e){if("Slash"!==e.code||ne.selectedCommand||ie.value)if("Backspace"===e.key)ce.value=!1,!ie.value.startsWith("/")&&!ie.value.startsWith("、")||2!==ie.value.length||ne.selectedCommand?!ie.value&&ne.selectedCommand&&(e.preventDefault(),ne.selectedCommand=null,ie.value="/",be()):be();else if(ce.value&&["ArrowUp","ArrowDown"].includes(e.key)){const l=ve.value.findIndex((e=>e.shortcutId===pe.value));if("ArrowUp"===e.key){const e=l>0?l-1:ve.value.length-1;pe.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=l<ve.value.length-1?l+1:0;pe.value=ve.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),ce.value){Ie(ve.value.find((e=>e.shortcutId===pe.value)))}else _e()}else ce.value=!1;else be()}function xe(e){!e&&ne.selectedPrompt&&(ne.selectedPrompt=null)}function _e(){fe.value||(ne.sending=!0,ne.loading=!0,ne.sendContent=ie.value,ie.value="")}function Ie(e){var l;pe.value=e.shortcutId,ue.value.focus(),(null==(l=e.children)?void 0:l.length)?(ve.value=e.children,pe.value=ve.value[0].shortcutId,de.value.push(e)):(ne.selectedCommand=e||{},ce.value=!1,ie.value="")}function je(){var e;de.value.pop(),ve.value=L(de.value)?null==(e=L(de.value))?void 0:e.children:A(re.value||[]),pe.value=ve.value[0].shortcutId,ue.value.focus()}return n((()=>ne.sendContent),(e=>{e&&!ne.sending&&(ie.value=e)})),a((()=>{le.destroy()})),(e,l)=>(s(),r("section",{class:u(["chat-footer",i(ne).loading?"disabled":""])},[c("div",$,[i(ae)?f("v-if",!0):(s(),d(i(b),{key:0,secondary:"",size:"small",onClick:l[0]||(l[0]=()=>he.value=!0)},{icon:v((()=>[m(i(C),{color:i(ee)["--c-primary-color"],size:"20",component:i(T)},null,8,["color","component"])])),default:v((()=>[p(" "+h(i(ye)),1)])),_:1})),i(te)&&i(te).length>0?(s(!0),r(k,{key:1},y(i(te),(e=>(s(),d(i(b),{secondary:"",size:"small",round:i(ae),key:ge(e),onClick:()=>function(e){var l;if(E(e))ie.value=e;else{const o=null==(l=null==e?void 0:e.contents)?void 0:l[0];oe("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[p(h(ge(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ce.value,onClickoutside:l[5]||(l[5]=e=>ce.value=!1)},{trigger:v((()=>[c("div",q,[i(ae)?(s(),d(i(_),{key:0,ref_key:"inputRef",ref:ue,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(ne).loading,value:ie.value,"onUpdate:value":l[2]||(l[2]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[p(" /"+h(i(ne).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[1]||(l[1]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:v((()=>[m(i(b),{text:"",disabled:i(ne).loading,onClick:we},{icon:v((()=>[m(i(C),{size:"30"},{default:v((()=>[H])),_:1})])),_:1},8,["disabled"]),m(i(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(fe),onClick:_e},{icon:v((()=>[m(i(C),{color:"#fff",size:"20",component:i(M)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),r(k,{key:1},[m(i(_),{ref_key:"inputRef",ref:ue,type:"textarea",placeholder:'请向我提问或输入"/"查看指令,Shift+Enter换行',disabled:i(ne).loading,autosize:{minRows:2,maxRows:7},value:ie.value,"onUpdate:value":l[4]||(l[4]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>{var e;return[p(" /"+h(null==(e=i(ne).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[3]||(l[3]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),c("div",N,[c("span",{class:u(["btn-send","gradient","fillet-8",i(fe)?"disabled":""]),disabled:i(fe),onClick:_e},[m(i(C),{color:"#fff",size:"22",component:i(M)},null,8,["component"])],10,V)])],64))])])),default:v((()=>[c("div",G,[c("div",J,[0===de.value.length?(s(),r("span",O,"推荐指令")):(s(),r(k,{key:1},[m(i(b),{text:"",onClick:je},{default:v((()=>[m(i(C),{color:"#999",size:"20",component:i(P)},null,8,["component"])])),_:1}),m(i(j),null,{default:v((()=>[(s(!0),r(k,null,y(de.value,(e=>(s(),d(i(z),{key:e.shortcutId},{default:v((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),c("div",Q,[(s(!0),r(k,null,y(ve.value,(e=>(s(),r("div",{class:u(["menu-item",e.children&&e.children.length?"":"selectable",pe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:w((()=>pe.value=e.shortcutId),["stop"]),onClick:()=>Ie(e)},[c("span",Y,h(e.shortcutTitle),1),c("span",Z,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),d(i(C),{key:0,color:"#999",size:"20",component:i(D)},null,8,["component"])):f("v-if",!0)],42,X)))),128))])])])),_:1},8,["show"]),m(F,{show:me.value,"onUpdate:show":l[6]||(l[6]=e=>me.value=e)},null,8,["show"]),m(W,{show:he.value,"onUpdate:show":l[7]||(l[7]=e=>he.value=e)},null,8,["show"])],2))}});export{ee as default};
@@ -1 +1 @@
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};
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 P(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,_(),q.value.length>=+t&&(e&&(H.value=!0),O.hasMore=!1,console.log("没有更多消息了")))}function _(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function B(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=B(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,(()=>{P()}),M.value?"bottom":"top"),P(!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"}),_(),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"}),_();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null;const o=await I.value({content:w.sendContent,contentType:"text",command:e,prompt:l,patient:w.selectedPatient});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,58 @@
1
+ import { SelectOption } from 'naive-ui';
2
+ import { AnyObject } from '../../../../shared/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ show: {
5
+ type: BooleanConstructor;
6
+ };
7
+ }, {
8
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
9
+ show: {
10
+ type: BooleanConstructor;
11
+ };
12
+ }>> & {
13
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
14
+ }>>;
15
+ emit: (event: "update:show", ...args: any[]) => void;
16
+ patientInfo: any;
17
+ state: any;
18
+ formValue: {
19
+ businessType: null;
20
+ vaa01: null;
21
+ bck03a: string;
22
+ };
23
+ rules: {
24
+ businessType: {
25
+ required: boolean;
26
+ trigger: string;
27
+ message: string;
28
+ };
29
+ vaa01: {
30
+ required: boolean;
31
+ trigger: string[];
32
+ message: string;
33
+ };
34
+ };
35
+ options: import("vue").Ref<AnyObject[]>;
36
+ formRef: import("vue").Ref<any>;
37
+ renderLabel: (option: AnyObject) => string;
38
+ handleUpdateValue: (value: string, option: SelectOption) => void;
39
+ handleSearch: (keyword: string) => Promise<void>;
40
+ handleValidateClick: (e: MouseEvent) => void;
41
+ NDrawer: any;
42
+ NDrawerContent: any;
43
+ NForm: any;
44
+ NFormItem: any;
45
+ NButton: any;
46
+ NRadioGroup: any;
47
+ NRadio: any;
48
+ NSelect: any;
49
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
+ show: {
51
+ type: BooleanConstructor;
52
+ };
53
+ }>> & {
54
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
55
+ }, {
56
+ show: boolean;
57
+ }>;
58
+ export default _default;
@@ -0,0 +1 @@
1
+ import t from"./ChatPatient.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var r=e(t,[["__file","ChatPatient.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,inject as a,reactive as t,ref as l,openBlock as u,createBlock as n,unref as o,withCtx as r,createVNode as i,createTextVNode as s,toDisplayString as v}from"vue";import{NDrawer as d,NDrawerContent as f,NForm as p,NFormItem as c,NRadioGroup as m,NRadio as b,NSelect as h,NButton as y}from"naive-ui";import{isFunction as _,isArray as g}from"lodash-es";import{InjectionAIChat as k}from"../types/index.js";var w=e({__name:"ChatPatient",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:w}){const{patientInfo:q,state:T}=a(k),C=t({businessType:null,vaa01:null,bck03a:""}),I={businessType:{required:!0,trigger:"change",message:"请选择类型"},vaa01:{required:!0,trigger:["blur","change"],message:"请选择患者"}},P=l([]),$=l();function x(e){const{bcq04b:a,vaa05:t,vae96:l,vae87:u,bck02a:n}=e;return`${a}床/${t}/${"1"==l?"男":"2"==l?"女":"未知"}/${u}/${n}`}function A(e,a){C.bck03a=a.bck03a}async function L(e){var a;if(_(null==(a=q.value)?void 0:a.queryPatient))try{const a=await q.value.queryPatient(e);if(g(a))return void(P.value=a);P.value=[]}catch(e){P.value=[]}}function N(e){var a;e.preventDefault(),null==(a=$.value)||a.validate((e=>{e||(T.selectedPatient={...C,...P.value.find((e=>e.vaa01===C.vaa01))},w("update:show",!1))}))}return L(""),(a,t)=>(u(),n(o(d),{placement:"bottom",height:"300","trap-focus":!1,to:"#"+o(T).id,show:e.show,onMaskClick:t[2]||(t[2]=()=>w("update:show",!1))},{default:r((()=>[i(o(f),null,{default:r((()=>[i(o(p),{ref_key:"formRef",ref:$,"label-placement":"left","label-width":"auto",size:"large",model:C,"require-mark-placement":"right-hanging",rules:I},{default:r((()=>[i(o(c),{label:"业务",path:"businessType"},{default:r((()=>[i(o(m),{value:C.businessType,"onUpdate:value":t[0]||(t[0]=e=>C.businessType=e),name:"业务"},{default:r((()=>[i(o(b),{value:"CLINICIAN"},{default:r((()=>[s("门诊")])),_:1}),i(o(b),{value:"HOSPITAL"},{default:r((()=>[s("住院")])),_:1})])),_:1},8,["value"])])),_:1}),i(o(c),{label:"患者",path:"vaa01"},{default:r((()=>[i(o(h),{remote:"",value:C.vaa01,"onUpdate:value":[t[1]||(t[1]=e=>C.vaa01=e),A],placeholder:"请选择患者",filterable:"",options:P.value,"render-label":x,"value-field":"vaa01",onSearch:L},null,8,["value","options"])])),_:1}),i(o(c),{label:"科室"},{default:r((()=>[s(v(C.bck03a),1)])),_:1}),i(o(c),null,{default:r((()=>[i(o(y),{block:"",type:"primary",onClick:N},{default:r((()=>[s("确定")])),_:1})])),_:1})])),_:1},8,["model"])])),_:1})])),_:1},8,["to","show"]))}});export{w as default};
@@ -17,13 +17,14 @@ export type MessageList = Array<{
17
17
  export type QueryData = (props: {
18
18
  content: string;
19
19
  contentType: string;
20
- command: any;
21
- prompt: any;
22
- }) => Promise<Array<{
23
- contents: MessageItem[];
20
+ command?: any;
21
+ prompt?: any;
22
+ patient?: any;
23
+ }) => Promise<{
24
+ contents: AnyObject[];
24
25
  buttonType?: string;
25
26
  [key: string]: any;
26
- }>>;
27
+ }>;
27
28
  export type QueryRecord = (props: {
28
29
  page: number;
29
30
  }) => Promise<{