cnhis-design-vue 3.3.1-release.5 → 3.3.2-release.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 (198) hide show
  1. package/README.md +87 -87
  2. package/es/components/audio-sdk/index.d.ts +20 -0
  3. package/es/components/audio-sdk/src/Index.vue.d.ts +20 -0
  4. package/es/components/audio-sdk/src/Index.vue2.js +1 -1
  5. package/es/components/audio-sdk/src/audioSDK.d.ts +1 -0
  6. package/es/components/audio-sdk/src/audioSDK.js +11 -3
  7. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +10 -0
  8. package/es/components/audio-sdk/src/components/recording.vue.d.ts +10 -0
  9. package/es/components/audio-sdk/src/components/recording.vue2.js +5 -0
  10. package/es/components/audio-sdk/src/constants/index.d.ts +1 -0
  11. package/es/components/audio-sdk/src/constants/index.js +3 -0
  12. package/es/components/audio-sdk/src/utils/recorder/fft.d.ts +4 -0
  13. package/es/components/audio-sdk/src/utils/recorder/mp3-engine.d.ts +4 -0
  14. package/es/components/audio-sdk/src/utils/recorder/mp3.d.ts +4 -0
  15. package/es/components/audio-sdk/src/utils/recorder/recorder.d.ts +4 -0
  16. package/es/components/audio-sdk/src/utils/recorder/wave.d.ts +4 -0
  17. package/es/components/audio-sdk/src/utils/recordingModal.js +13 -2
  18. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  19. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  20. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  21. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  22. package/es/components/callback/src/components/render/popupMaps.d.ts +17 -1
  23. package/es/components/card-render/index.d.ts +4 -4
  24. package/es/components/card-render/src/CardRender.vue.d.ts +4 -4
  25. package/es/components/card-render/src/components/index.d.ts +23 -23
  26. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  27. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +12 -6
  28. package/es/components/field-editor/index.d.ts +4 -0
  29. package/es/components/field-editor/src/FieldEditor.vue.d.ts +4 -0
  30. package/es/components/form-config/index.d.ts +80 -5
  31. package/es/components/form-config/src/FormConfig.vue.d.ts +80 -5
  32. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -0
  33. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +57 -4
  34. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +16 -1
  35. package/es/components/form-config/src/constants/index.d.ts +2 -1
  36. package/es/components/form-config/src/constants/index.js +1 -0
  37. package/es/components/form-config/src/hooks/useConfigurationField.js +19 -1
  38. package/es/components/form-config/src/hooks/useLocale.d.ts +1 -0
  39. package/es/components/form-config/src/hooks/useLocale.js +1 -0
  40. package/es/components/form-config/src/types/index.d.ts +1 -0
  41. package/es/components/form-render/index.d.ts +4 -0
  42. package/es/components/form-render/src/FormRender.vue.d.ts +4 -0
  43. package/es/components/form-render/src/FormRender.vue2.js +3 -2
  44. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -0
  45. package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
  46. package/es/components/form-render/src/components/renderer/date.d.ts +2 -2
  47. package/es/components/form-render/src/components/renderer/input.d.ts +16 -4
  48. package/es/components/form-render/src/components/renderer/input.js +39 -7
  49. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +3 -0
  50. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
  51. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
  52. package/es/components/form-render/src/components/renderer/radio_checkbox.js +9 -8
  53. package/es/components/form-render/src/components/renderer/text.js +1 -1
  54. package/es/components/form-render/src/components/renderer/textarea.d.ts +16 -1
  55. package/es/components/form-render/src/components/renderer/textarea.js +36 -8
  56. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -0
  57. package/es/components/form-render/src/hooks/useComplexOptions.js +3 -2
  58. package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +2 -2
  59. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +4 -3
  60. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
  61. package/es/components/form-render/src/hooks/useFormField.d.ts +2 -0
  62. package/es/components/form-render/src/hooks/useFormField.js +5 -1
  63. package/es/components/form-render/src/hooks/useFormValidator.js +1 -0
  64. package/es/components/form-render/src/hooks/usePresetScope.js +1 -0
  65. package/es/components/form-render/src/types/fieldItem.d.ts +11 -0
  66. package/es/components/form-render/src/types/index.d.ts +1 -0
  67. package/es/components/form-render/src/utils/index.js +1 -0
  68. package/es/components/form-render/src/utils/schema.js +60 -15
  69. package/es/components/guide/src/renderer.d.ts +2 -2
  70. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  71. package/es/components/iho-table/index.d.ts +13 -1
  72. package/es/components/iho-table/src/IhoTable.vue.d.ts +13 -2
  73. package/es/components/iho-table/src/IhoTable.vue2.js +27 -20
  74. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +6 -0
  75. package/es/components/index.css +1 -1
  76. package/es/components/index.d.ts +1 -2
  77. package/es/components/index.js +0 -3
  78. package/es/components/info-header/index.d.ts +13 -0
  79. package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -0
  80. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
  81. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
  82. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -0
  83. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -0
  84. package/es/components/scale-view/index.d.ts +1 -1
  85. package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -1
  86. package/es/components/scale-view/src/ScaleView.vue2.js +2 -2
  87. package/es/components/scale-view/src/hooks/scaleview-init.d.ts +1 -1
  88. package/es/components/scale-view/src/hooks/scaleview-init.js +2 -2
  89. package/es/components/select-person/src/SelectPerson.vue2.js +8 -5
  90. package/es/components/shortcut-setter/index.d.ts +16 -1
  91. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +16 -1
  92. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +11 -11
  93. package/es/env.d.ts +25 -25
  94. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  95. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  96. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  97. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  98. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  99. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  100. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  101. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  102. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  103. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  104. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  105. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  106. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  107. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  108. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  109. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  110. package/es/shared/assets/img/failure.png.js +1 -1
  111. package/es/shared/assets/img/no-permission.png.js +1 -1
  112. package/es/shared/assets/img/nodata.png.js +1 -1
  113. package/es/shared/assets/img/notfound.png.js +1 -1
  114. package/es/shared/assets/img/qr.png.js +1 -1
  115. package/es/shared/assets/img/success.png.js +1 -1
  116. package/es/shared/assets/img/table_style_2.png.js +1 -1
  117. package/es/shared/assets/img/video.png.js +1 -1
  118. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  119. package/es/shared/assets/img/xb_big.png.js +1 -1
  120. package/es/shared/assets/img/xb_small.png.js +1 -1
  121. package/es/shared/components/CancelRadio/CancelRadio.d.ts +7 -0
  122. package/es/shared/components/CancelRadio/CancelRadio.js +6 -6
  123. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  124. package/es/shared/package.json.js +1 -1
  125. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  126. package/es/shared/utils/tapable/index.d.ts +139 -0
  127. package/package.json +76 -77
  128. package/es/components/ai-chat/index.d.ts +0 -680
  129. package/es/components/ai-chat/index.js +0 -10
  130. package/es/components/ai-chat/src/Index.vue.d.ts +0 -682
  131. package/es/components/ai-chat/src/Index.vue.js +0 -6
  132. package/es/components/ai-chat/src/Index.vue2.js +0 -175
  133. package/es/components/ai-chat/src/api/index.d.ts +0 -8
  134. package/es/components/ai-chat/src/api/index.js +0 -87
  135. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -38
  136. package/es/components/ai-chat/src/components/ChatAudio.vue.js +0 -6
  137. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +0 -103
  138. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +0 -101
  139. package/es/components/ai-chat/src/components/ChatBI.vue.js +0 -6
  140. package/es/components/ai-chat/src/components/ChatBI.vue2.js +0 -73
  141. package/es/components/ai-chat/src/components/ChatCard.d.ts +0 -43
  142. package/es/components/ai-chat/src/components/ChatCard.js +0 -403
  143. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +0 -203
  144. package/es/components/ai-chat/src/components/ChatFooter.vue.js +0 -6
  145. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +0 -373
  146. package/es/components/ai-chat/src/components/ChatMain.d.ts +0 -2
  147. package/es/components/ai-chat/src/components/ChatMain.js +0 -350
  148. package/es/components/ai-chat/src/components/ChatMainDefault.d.ts +0 -2
  149. package/es/components/ai-chat/src/components/ChatMainDefault.js +0 -278
  150. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +0 -59
  151. package/es/components/ai-chat/src/components/ChatPatient.vue.js +0 -6
  152. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +0 -218
  153. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +0 -45
  154. package/es/components/ai-chat/src/components/ChatPrompt.vue.js +0 -6
  155. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +0 -143
  156. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -57
  157. package/es/components/ai-chat/src/components/ChatRight.vue.js +0 -6
  158. package/es/components/ai-chat/src/components/ChatRight.vue2.js +0 -190
  159. package/es/components/ai-chat/src/components/card/JsonCard.d.ts +0 -25
  160. package/es/components/ai-chat/src/components/card/JsonCard.js +0 -574
  161. package/es/components/ai-chat/src/components/message-render/CardRender.d.ts +0 -16
  162. package/es/components/ai-chat/src/components/message-render/CardRender.js +0 -80
  163. package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +0 -16
  164. package/es/components/ai-chat/src/components/message-render/FormRender.js +0 -173
  165. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +0 -36
  166. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +0 -6
  167. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +0 -96
  168. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +0 -105
  169. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +0 -6
  170. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +0 -260
  171. package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +0 -18
  172. package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +0 -37
  173. package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +0 -20
  174. package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +0 -48
  175. package/es/components/ai-chat/src/hooks/index.d.ts +0 -2
  176. package/es/components/ai-chat/src/hooks/index.js +0 -2
  177. package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +0 -18
  178. package/es/components/ai-chat/src/hooks/useChartAudioContext.js +0 -202
  179. package/es/components/ai-chat/src/hooks/useData.d.ts +0 -77
  180. package/es/components/ai-chat/src/hooks/useData.js +0 -289
  181. package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +0 -38
  182. package/es/components/ai-chat/src/hooks/useFooterContext.js +0 -218
  183. package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -14
  184. package/es/components/ai-chat/src/hooks/useProgram.js +0 -306
  185. package/es/components/ai-chat/src/hooks/useSSE.d.ts +0 -9
  186. package/es/components/ai-chat/src/hooks/useSSE.js +0 -138
  187. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +0 -4
  188. package/es/components/ai-chat/src/hooks/useWebsocket.js +0 -66
  189. package/es/components/ai-chat/src/types/index.d.ts +0 -45
  190. package/es/components/ai-chat/src/types/index.js +0 -1
  191. package/es/components/ai-chat/src/utils/index.d.ts +0 -7
  192. package/es/components/ai-chat/src/utils/index.js +0 -41
  193. package/es/components/ai-chat/style/index.css +0 -1
  194. package/es/shared/assets/img/ai__avatar.png.js +0 -3
  195. package/es/shared/assets/img/file-emr.png.js +0 -3
  196. package/es/shared/assets/img/file.png.js +0 -3
  197. package/es/shared/assets/img/logo.png.js +0 -3
  198. package/es/shared/assets/img/use.png.js +0 -3
@@ -1,77 +0,0 @@
1
- import { InjectionKey } from 'vue';
2
- import { AnyObject } from '../../../../shared/types';
3
- export declare const InjectionAIChatData: InjectionKey<ReturnType<typeof initData>>;
4
- export declare function initData(props: AnyObject, emit: (event: 'button-click' | 'program', ...args: any[]) => void): {
5
- chatMainRef: import("vue").Ref<any>;
6
- patientInfo: import("vue").Ref<any>;
7
- configs: import("vue").Ref<any>;
8
- queryPrompt: import("vue").Ref<any>;
9
- queryData: import("vue").Ref<any>;
10
- queryRecord: import("vue").Ref<any>;
11
- defaultShortcutList: import("vue").Ref<any>;
12
- hideInput: import("vue").Ref<any>;
13
- shortcutList: import("vue").Ref<any>;
14
- audioTimed: import("vue").Ref<any>;
15
- commandList: import("vue").Ref<any>;
16
- appId: import("vue").Ref<any>;
17
- immediatelyRecording: import("vue").Ref<any>;
18
- isStreamingOutput: import("vue").Ref<any>;
19
- showLBtn: import("vue").Ref<any>;
20
- disabled: import("vue").Ref<any>;
21
- appCode: import("vue").Ref<any>;
22
- prologue: import("vue").Ref<any>;
23
- mobile: import("vue").Ref<any>;
24
- bpmnProcessIdAndStartToken: import("vue").Ref<any>;
25
- cssVars: import("vue").ComputedRef<AnyObject>;
26
- state: AnyObject;
27
- isSmall: import("vue").ComputedRef<boolean>;
28
- isDefault: import("vue").ComputedRef<boolean>;
29
- vaa07: import("vue").ComputedRef<any>;
30
- sessionId: import("vue").ComputedRef<any>;
31
- axiosInstance: import("axios").AxiosInstance;
32
- $dialog: import("naive-ui").DialogApi;
33
- emit: (event: 'button-click' | 'program', ...args: any[]) => void;
34
- appendMessage: (item: AnyObject) => Promise<void>;
35
- sendMessage: (params?: AnyObject) => Promise<void>;
36
- toFinishProgram: (bpmnProcessId: string) => void;
37
- toNext: (bpmnProcessId?: string | undefined, variables?: any) => void;
38
- toReplyAiConditions: (params?: AnyObject | undefined) => void;
39
- formatProcessInfo: (result: string) => void;
40
- };
41
- export declare const useData: () => {
42
- chatMainRef: import("vue").Ref<any>;
43
- patientInfo: import("vue").Ref<any>;
44
- configs: import("vue").Ref<any>;
45
- queryPrompt: import("vue").Ref<any>;
46
- queryData: import("vue").Ref<any>;
47
- queryRecord: import("vue").Ref<any>;
48
- defaultShortcutList: import("vue").Ref<any>;
49
- hideInput: import("vue").Ref<any>;
50
- shortcutList: import("vue").Ref<any>;
51
- audioTimed: import("vue").Ref<any>;
52
- commandList: import("vue").Ref<any>;
53
- appId: import("vue").Ref<any>;
54
- immediatelyRecording: import("vue").Ref<any>;
55
- isStreamingOutput: import("vue").Ref<any>;
56
- showLBtn: import("vue").Ref<any>;
57
- disabled: import("vue").Ref<any>;
58
- appCode: import("vue").Ref<any>;
59
- prologue: import("vue").Ref<any>;
60
- mobile: import("vue").Ref<any>;
61
- bpmnProcessIdAndStartToken: import("vue").Ref<any>;
62
- cssVars: import("vue").ComputedRef<AnyObject>;
63
- state: AnyObject;
64
- isSmall: import("vue").ComputedRef<boolean>;
65
- isDefault: import("vue").ComputedRef<boolean>;
66
- vaa07: import("vue").ComputedRef<any>;
67
- sessionId: import("vue").ComputedRef<any>;
68
- axiosInstance: import("axios").AxiosInstance;
69
- $dialog: import("naive-ui").DialogApi;
70
- emit: (event: 'button-click' | 'program', ...args: any[]) => void;
71
- appendMessage: (item: AnyObject) => Promise<void>;
72
- sendMessage: (params?: AnyObject) => Promise<void>;
73
- toFinishProgram: (bpmnProcessId: string) => void;
74
- toNext: (bpmnProcessId?: string | undefined, variables?: any) => void;
75
- toReplyAiConditions: (params?: AnyObject | undefined) => void;
76
- formatProcessInfo: (result: string) => void;
77
- };
@@ -1,289 +0,0 @@
1
- import { ref, reactive, computed, watch, nextTick, toRef, inject } from 'vue';
2
- import { useDialog } from 'naive-ui';
3
- import { useTheme } from '../../../../shared/hooks/useTheme.js';
4
- import '@vueuse/core';
5
- import 'date-fns';
6
- import { isArray, cloneDeep } from 'lodash-es';
7
- import '@vue/shared';
8
- import { uuidGenerator } from '../../../../shared/utils/index.js';
9
- import '@vueuse/shared';
10
- import '../../../../shared/hooks/selectHooks/useSearchContent.js';
11
- import '@vicons/ionicons5';
12
- import '../../../../shared/hooks/useScrollLoading.js';
13
- import { axiosInstance, conversationApi } from '../api/index.js';
14
- import { useSSE } from './useSSE.js';
15
- import { useProgram } from './useProgram.js';
16
- import { isValidJSON } from '../utils/index.js';
17
-
18
- const InjectionAIChatData = Symbol("InjectionAIChatData");
19
- function isMe({
20
- role = ""
21
- }) {
22
- return role === "user";
23
- }
24
- function initData(props, emit) {
25
- axiosInstance.defaults.headers["Authorization"] = "bearer " + props.token;
26
- const $dialog = useDialog();
27
- const chatMainRef = ref();
28
- const state = reactive({
29
- id: "ai-chat-" + uuidGenerator(),
30
- loading: false,
31
- sending: false,
32
- sendContent: "",
33
- selectedCommand: null,
34
- selectedPrompt: null,
35
- externalData: null,
36
- selectedPatient: null,
37
- selectedPatientLabel: "",
38
- selectedPatientForm: null,
39
- showPatient: false,
40
- showRight: false,
41
- showRightSlot: false,
42
- switchFlag: true,
43
- record: [],
44
- bpmnProcessId: "",
45
- bpmnProcessDoing: false,
46
- startToken: "",
47
- inquiryStr: "",
48
- needSubmitMsg: null
49
- });
50
- const {
51
- toNext,
52
- toBindAiConditions,
53
- toReplyAiConditions,
54
- toFinishProgram
55
- } = useProgram({
56
- props,
57
- state,
58
- appendMessage,
59
- emit,
60
- chatMainRef
61
- });
62
- const cssVars = useTheme();
63
- const isSmall = computed(() => props.uiStyle === "small");
64
- const isDefault = computed(() => props.uiStyle === "default");
65
- const vaa07 = computed(() => {
66
- var _a;
67
- return (_a = props.configs) == null ? void 0 : _a.vaa07;
68
- });
69
- const sessionId = computed(() => props.sessionId || vaa07.value);
70
- watch(() => state.startToken, (startToken) => {
71
- if (startToken && state.bpmnProcessId) {
72
- toBindAiConditions();
73
- toNext();
74
- }
75
- });
76
- watch(() => state.bpmnProcessId, async (value, old) => {
77
- if (value) {
78
- if (old) {
79
- toFinishProgram(old);
80
- }
81
- }
82
- });
83
- async function appendMessage(item) {
84
- if (isArray(item.contents)) {
85
- state.record.unshift(item);
86
- await nextTick();
87
- if (chatMainRef.value) {
88
- chatMainRef.value.scrollTop = 0;
89
- }
90
- }
91
- }
92
- function sendMessageSSE(params = {}) {
93
- appendMessage({
94
- fromMe: true,
95
- msgId: uuidGenerator(),
96
- contents: [{
97
- role: "user",
98
- content: state.sendContent
99
- }]
100
- });
101
- const {
102
- opType
103
- } = params;
104
- const _params = {
105
- ...params
106
- };
107
- if (opType && ["recommend_treatment_plan", "recommend_diagnosis", "recommend_examination"].includes(opType)) {
108
- Object.assign(_params, {
109
- contents: [{
110
- role: "user",
111
- content: state.sendContent,
112
- contentType: "text"
113
- }]
114
- });
115
- }
116
- useSSE({
117
- state,
118
- props,
119
- appendMessage,
120
- params: _params,
121
- emit,
122
- formatProcessInfo
123
- });
124
- }
125
- async function sendMessage(params = {}) {
126
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
127
- if (props.isStreamingOutput) {
128
- sendMessageSSE(params);
129
- return;
130
- }
131
- state.loading = true;
132
- const {
133
- opType
134
- } = params;
135
- const _params = {
136
- ...params
137
- };
138
- if (!opType && state.sendContent) {
139
- state.record.unshift({
140
- msgId: uuidGenerator(),
141
- contents: [{
142
- role: "user",
143
- content: state.sendContent
144
- }]
145
- });
146
- }
147
- if (chatMainRef.value) {
148
- chatMainRef.value.scrollTop = 0;
149
- }
150
- if (opType && ["recommend_treatment_plan", "recommend_diagnosis", "recommend_examination"].includes(opType)) {
151
- if (state.record.length > 0) {
152
- const newItem = state.record.find((item) => {
153
- var _a2;
154
- return !isMe((_a2 = item == null ? void 0 : item.contents) == null ? void 0 : _a2[0]);
155
- });
156
- if (newItem) {
157
- Object.assign(_params, cloneDeep(newItem));
158
- }
159
- }
160
- Object.assign(_params, {
161
- contents: [{
162
- role: "user",
163
- content: "",
164
- contentType: "text"
165
- }]
166
- });
167
- }
168
- try {
169
- const data = await conversationApi({
170
- contents: [{
171
- role: "user",
172
- content: state.sendContent,
173
- contentType: "text"
174
- }],
175
- platform: "web",
176
- sessionType: "text_chat",
177
- source: "global",
178
- configs: props.configs,
179
- switchFlag: state.switchFlag ? 1 : 0,
180
- ..._params
181
- });
182
- if (["diagnosis", "medical_order"].includes(opType)) {
183
- if (state.showRightSlot) {
184
- let key = "cliRefreshDiagnosis";
185
- if (opType === "medical_order") {
186
- key = "cliRefreshMedical";
187
- }
188
- emit("program", {
189
- key,
190
- type: "refresh",
191
- params: {}
192
- });
193
- }
194
- }
195
- if (isArray(data.contents) && data.contents.length > 1)
196
- data.contents.reverse();
197
- appendMessage(data);
198
- if (opType && ["create_inquiry", "create_medical"].includes(opType)) {
199
- if (opType === "create_inquiry") {
200
- if (((_b = (_a = data == null ? void 0 : data.contents) == null ? void 0 : _a[0]) == null ? void 0 : _b.messageType) !== "retry_inquiry") {
201
- if ((_f = (_e = (_d = (_c = data == null ? void 0 : data.contents) == null ? void 0 : _c[0]) == null ? void 0 : _d.content) == null ? void 0 : _e.details) == null ? void 0 : _f.autoBackFillData) {
202
- state.consultationContent = data;
203
- state.showRight = true;
204
- }
205
- }
206
- } else {
207
- emit("program", {
208
- key: "medical",
209
- params: {
210
- vac01: (_g = props.configs) == null ? void 0 : _g.vac01,
211
- type: 1
212
- }
213
- });
214
- }
215
- }
216
- if (!opType || opType === "create_inquiry") {
217
- state.sendContent = "";
218
- }
219
- } catch (error) {
220
- console.log("error ==>", error);
221
- if (error.message) {
222
- $dialog.error({
223
- title: "\u9519\u8BEF\u63D0\u793A",
224
- maskClosable: false,
225
- content: ((_h = error.message) == null ? void 0 : _h.includes("Network Error")) ? "\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25" : "\u5BF9\u8BDD\u8FDE\u63A5\u5931\u8D25",
226
- positiveText: ((_i = window.getLanguageByCode) == null ? void 0 : _i.call(window, "10010.1.27")) || "\u786E\u5B9A"
227
- });
228
- }
229
- } finally {
230
- state.loading = false;
231
- state.loadingText = "";
232
- }
233
- }
234
- function formatProcessInfo(result) {
235
- if (isValidJSON(result)) {
236
- const res = JSON.parse(result);
237
- const {
238
- bpmnProcessId,
239
- startToken
240
- } = res;
241
- if (bpmnProcessId) {
242
- state.bpmnProcessId = bpmnProcessId;
243
- }
244
- if (startToken) {
245
- state.startToken = startToken;
246
- }
247
- }
248
- }
249
- return {
250
- chatMainRef,
251
- patientInfo: toRef(props, "patientInfo"),
252
- configs: toRef(props, "configs"),
253
- queryPrompt: toRef(props, "queryPrompt"),
254
- queryData: toRef(props, "queryData"),
255
- queryRecord: toRef(props, "queryRecord"),
256
- defaultShortcutList: toRef(props, "defaultShortcutList"),
257
- hideInput: toRef(props, "hideInput"),
258
- shortcutList: toRef(props, "shortcutList"),
259
- audioTimed: toRef(props, "audioTimed"),
260
- commandList: toRef(props, "commandList"),
261
- appId: toRef(props, "appId"),
262
- immediatelyRecording: toRef(props, "immediatelyRecording"),
263
- isStreamingOutput: toRef(props, "isStreamingOutput"),
264
- showLBtn: toRef(props, "showLBtn"),
265
- disabled: toRef(props, "disabled"),
266
- appCode: toRef(props, "appCode"),
267
- prologue: toRef(props, "prologue"),
268
- mobile: toRef(props, "mobile"),
269
- bpmnProcessIdAndStartToken: toRef(props, "bpmnProcessIdAndStartToken"),
270
- cssVars,
271
- state,
272
- isSmall,
273
- isDefault,
274
- vaa07,
275
- sessionId,
276
- axiosInstance,
277
- $dialog,
278
- emit,
279
- appendMessage,
280
- sendMessage,
281
- toFinishProgram,
282
- toNext,
283
- toReplyAiConditions,
284
- formatProcessInfo
285
- };
286
- }
287
- const useData = () => inject(InjectionAIChatData);
288
-
289
- export { InjectionAIChatData, initData, useData };
@@ -1,38 +0,0 @@
1
- import { AnyObject } from '../../../../shared/types';
2
- import { CommandItem } from '../../../../components/ai-chat/src/types';
3
- export declare function useFooterContext(): {
4
- state: AnyObject;
5
- shortcutList: import("vue").Ref<any>;
6
- getShortcutName: (item: string | AnyObject) => any;
7
- isAllDisabled: import("vue").ComputedRef<any>;
8
- isStreamingOutput: import("vue").Ref<any>;
9
- handleShortcut: (item: string | AnyObject) => void;
10
- showPopover: import("vue").Ref<boolean>;
11
- handleKeyDown: (event: KeyboardEvent) => void;
12
- handleInput: (value: string) => void;
13
- btnDisabled: import("vue").ComputedRef<any>;
14
- showAudio: import("vue").Ref<boolean>;
15
- handleSend: () => void;
16
- breadcrumb: import("vue").Ref<{
17
- [x: string]: any;
18
- shortcutTitle: string;
19
- shortcutId: string;
20
- shortcutDescription?: string | undefined;
21
- children?: any[] | undefined;
22
- }[]>;
23
- currentShortcutId: import("vue").Ref<string>;
24
- currentCommand: import("vue").Ref<{
25
- [x: string]: any;
26
- shortcutTitle: string;
27
- shortcutId: string;
28
- shortcutDescription?: string | undefined;
29
- children?: any[] | undefined;
30
- }[]>;
31
- clickMenu: (menu: CommandItem) => void;
32
- audioTimed: import("vue").Ref<any>;
33
- showLBtn: import("vue").Ref<any>;
34
- isDefault: import("vue").ComputedRef<boolean>;
35
- commandList: import("vue").Ref<any>;
36
- isSmall: import("vue").ComputedRef<boolean>;
37
- cssVars: import("vue").ComputedRef<AnyObject>;
38
- };
@@ -1,218 +0,0 @@
1
- import { uuidGenerator } from '../../../../shared/utils/index.js';
2
- import { cloneDeep, isString } from 'lodash-es';
3
- import { ref, computed, onBeforeUnmount } from 'vue';
4
- import { callbackApi } from '../api/index.js';
5
- import { useData } from './useData.js';
6
- import '../../../audio-sdk/index.js';
7
- import AudioSDK from '../../../audio-sdk/src/audioSDK.js';
8
-
9
- function useFooterContext() {
10
- const {
11
- shortcutList,
12
- state,
13
- isSmall,
14
- audioTimed,
15
- commandList,
16
- isDefault,
17
- showLBtn,
18
- disabled,
19
- isStreamingOutput,
20
- emit,
21
- sendMessage,
22
- toReplyAiConditions,
23
- appendMessage,
24
- cssVars
25
- } = useData();
26
- const showPopover = ref(false);
27
- const breadcrumb = ref([]);
28
- const currentCommand = ref(cloneDeep(commandList.value || []));
29
- const currentShortcutId = ref("");
30
- const showAudio = ref(false);
31
- const isAllDisabled = computed(() => isDefault.value && disabled.value);
32
- const btnDisabled = computed(() => isAllDisabled.value || state.loading || !state.sendContent.replace(/(&nbsp;|\s|<br>)+/g, ""));
33
- function getShortcutName(item) {
34
- var _a;
35
- if (isString(item))
36
- return item;
37
- if (isDefault.value)
38
- return item.value;
39
- const {
40
- content: c
41
- } = ((_a = item == null ? void 0 : item.contents) == null ? void 0 : _a[0]) || {};
42
- return c == null ? void 0 : c.instructionName;
43
- }
44
- function handleShortcut(item) {
45
- var _a;
46
- if (isString(item))
47
- return handleStringShortcut(item);
48
- if (isStreamingOutput.value)
49
- return handleObjectStreamShortcut(item);
50
- if (isDefault.value && item.key)
51
- return handleDefaultModeShortcut(item);
52
- const msgItem = (_a = item == null ? void 0 : item.contents) == null ? void 0 : _a[0];
53
- emit("button-click", {
54
- msgItem,
55
- item
56
- });
57
- }
58
- function handleStringShortcut(shortcut) {
59
- state.sendContent = shortcut;
60
- }
61
- function handleObjectStreamShortcut(shortcut) {
62
- state.loadingText = "";
63
- state.sendContent = shortcut.value;
64
- sendMessage({
65
- opType: shortcut.key
66
- });
67
- }
68
- function handleDefaultModeShortcut(shortcut) {
69
- const keyMap = {
70
- recommend_treatment_plan: "\u53C2\u8003\u8BCA\u65AD\u7ED3\u679C\u4E0E\u60A3\u8005\u4E2A\u4F53\u4FE1\u606F\uFF0C\u6B63\u5168\u9762\u68B3\u7406\u77E5\u8BC6\u5E93\u548C\u4E34\u5E8A\u6307\u5357\uFF0C\u7EFC\u5408\u8003\u91CF\u4E3A\u60A8\u5339\u914D\u6700\u9002\u5B9C\u7684\u8BCA\u7597\u65B9\u6848\u63A8\u8350",
71
- recommend_examination: "\u4F9D\u636E\u5F53\u524D\u8BCA\u65AD\u4E0E\u75C5\u5386\u5185\u5BB9\u5206\u6790\uFF0C\u6B63\u5728\u7B5B\u4E3A\u60A8\u7B5B\u9009\u548C\u5339\u914D\u6700\u9002\u5408\u7684\u68C0\u9A8C\u68C0\u67E5\u9879\u76EE",
72
- recommend_diagnosis: "\u7CFB\u7EDF\u6B63\u5728\u5BF9\u60A8\u7684\u5BF9\u8BDD\u5185\u5BB9\u8FDB\u884C\u68B3\u7406\u6574\u5408\uFF0C\u8F6C\u5316\u4E3A\u89C4\u8303\u7684\u7ED3\u6784\u5316\u95EE\u8BCA\u8BB0\u5F55"
73
- };
74
- const loadingText = keyMap[shortcut.key];
75
- if (!loadingText)
76
- return emit("program", {
77
- key: shortcut.key
78
- });
79
- state.loadingText = loadingText;
80
- sendMessage({
81
- opType: shortcut.key
82
- });
83
- }
84
- function resetCurrentCommand() {
85
- var _a;
86
- showPopover.value = false;
87
- currentCommand.value = cloneDeep(commandList.value || []);
88
- breadcrumb.value = [];
89
- if ((_a = commandList.value) == null ? void 0 : _a.length) {
90
- showPopover.value = true;
91
- currentShortcutId.value = currentCommand.value[0].shortcutId;
92
- }
93
- }
94
- function handleKeyDown(event) {
95
- if (isDefault.value) {
96
- if (event.key === "Enter" && !isWrap(event)) {
97
- event.preventDefault();
98
- handleSend();
99
- }
100
- return;
101
- }
102
- if (["Slash", "NumpadDivide"].includes(event.code) && !state.selectedCommand && !state.sendContent) {
103
- resetCurrentCommand();
104
- } else if (event.key === "Backspace") {
105
- showPopover.value = false;
106
- if ((state.sendContent.startsWith("/") || state.sendContent.startsWith("\u3001")) && state.sendContent.length === 2 && !state.selectedCommand) {
107
- resetCurrentCommand();
108
- } else if (!state.sendContent && state.selectedCommand) {
109
- event.preventDefault();
110
- state.selectedCommand = null;
111
- state.sendContent = "/";
112
- resetCurrentCommand();
113
- }
114
- } else if (showPopover.value && ["ArrowUp", "ArrowDown"].includes(event.key)) {
115
- const currentIndex = currentCommand.value.findIndex((item) => item.shortcutId === currentShortcutId.value);
116
- if (event.key === "ArrowUp") {
117
- const previousIndex = currentIndex > 0 ? currentIndex - 1 : currentCommand.value.length - 1;
118
- currentShortcutId.value = currentCommand.value[previousIndex].shortcutId;
119
- } else if (event.key === "ArrowDown") {
120
- const nextIndex = currentIndex < currentCommand.value.length - 1 ? currentIndex + 1 : 0;
121
- currentShortcutId.value = currentCommand.value[nextIndex].shortcutId;
122
- }
123
- } else if (["Enter"].includes(event.key)) {
124
- if (!isWrap(event)) {
125
- event.preventDefault();
126
- if (showPopover.value) {
127
- const menu = currentCommand.value.find((item) => item.shortcutId === currentShortcutId.value);
128
- clickMenu(menu);
129
- } else {
130
- handleSend();
131
- }
132
- }
133
- } else {
134
- showPopover.value = false;
135
- }
136
- }
137
- function isWrap(event) {
138
- return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
139
- }
140
- function handleInput(value) {
141
- if (!value && state.selectedPrompt) {
142
- state.selectedPrompt = null;
143
- }
144
- }
145
- function handleSend() {
146
- var _a;
147
- if (btnDisabled.value)
148
- return;
149
- if (isDefault.value) {
150
- if ((_a = state.needSubmitMsg) == null ? void 0 : _a.programData) {
151
- toReplyAiConditions({
152
- programData: state.needSubmitMsg.programData,
153
- params: {
154
- data: state.sendContent
155
- }
156
- });
157
- state.needSubmitMsg.programData = null;
158
- const messageItem = {
159
- fromMe: true,
160
- msgId: uuidGenerator(),
161
- contents: [{
162
- role: "user",
163
- content: state.sendContent
164
- }]
165
- };
166
- appendMessage(messageItem);
167
- callbackApi(messageItem);
168
- return;
169
- }
170
- sendMessage();
171
- return;
172
- }
173
- state.sending = true;
174
- state.loading = true;
175
- }
176
- function clickMenu(menu) {
177
- var _a;
178
- currentShortcutId.value = menu.shortcutId;
179
- if ((_a = menu.children) == null ? void 0 : _a.length) {
180
- currentCommand.value = menu.children;
181
- currentShortcutId.value = currentCommand.value[0].shortcutId;
182
- breadcrumb.value.push(menu);
183
- } else {
184
- state.selectedCommand = menu || {};
185
- showPopover.value = false;
186
- state.sendContent = "";
187
- }
188
- }
189
- onBeforeUnmount(() => {
190
- AudioSDK.destroy();
191
- });
192
- return {
193
- state,
194
- shortcutList,
195
- getShortcutName,
196
- isAllDisabled,
197
- isStreamingOutput,
198
- handleShortcut,
199
- showPopover,
200
- handleKeyDown,
201
- handleInput,
202
- btnDisabled,
203
- showAudio,
204
- handleSend,
205
- breadcrumb,
206
- currentShortcutId,
207
- currentCommand,
208
- clickMenu,
209
- audioTimed,
210
- showLBtn,
211
- isDefault,
212
- commandList,
213
- isSmall,
214
- cssVars
215
- };
216
- }
217
-
218
- export { useFooterContext };
@@ -1,14 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { AnyObject } from '../../../../shared/types';
3
- export declare function useProgram({ props, state, appendMessage, emit, chatMainRef }: {
4
- props: AnyObject;
5
- state: AnyObject;
6
- appendMessage: Function;
7
- emit: (event: 'button-click' | 'program', ...args: any[]) => void;
8
- chatMainRef: Ref<Element | undefined>;
9
- }): {
10
- toNext: (bpmnProcessId?: string, variables?: any) => void;
11
- toBindAiConditions: () => void;
12
- toReplyAiConditions: (params?: AnyObject) => void;
13
- toFinishProgram: (bpmnProcessId: string) => void;
14
- };