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,260 +0,0 @@
1
- import { defineComponent, ref, reactive, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, createVNode, createElementVNode, withDirectives, vShow, withModifiers, isRef } from 'vue';
2
- import { ChevronBack, ChevronForward } from '@vicons/ionicons5';
3
- import { useThrottleFn } from '@vueuse/core';
4
- import { last, cloneDeep } from 'lodash-es';
5
- import { NButton, NPopover, NIcon, NInput, NBreadcrumb, NBreadcrumbItem } from 'naive-ui';
6
- import MobileChatAudio from './MobileChatAudio.vue.js';
7
- import AddIcon from '../svgs/AddIcon.vue.js';
8
- import MicroPhone from '../svgs/MicroPhone.vue.js';
9
- import { useChartAudioContext } from '../../hooks/useChartAudioContext.js';
10
- import { useFooterContext } from '../../hooks/useFooterContext.js';
11
- import AudioIcon from '../svgs/AudioIcon.vue.js';
12
- import KeyboardIcon from '../svgs/KeyboardIcon.vue.js';
13
-
14
- const _hoisted_1 = {
15
- key: 0,
16
- class: "menu-box fillet-8"
17
- };
18
- const _hoisted_2 = {
19
- class: "mobile-ai-chat-footer__operation"
20
- };
21
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", {
22
- id: "chat-audio-wave-view"
23
- }, null, -1);
24
- const _hoisted_4 = [_hoisted_3];
25
- const _hoisted_5 = {
26
- class: "command-box"
27
- };
28
- const _hoisted_6 = {
29
- class: "command-box__header"
30
- };
31
- const _hoisted_7 = {
32
- key: 0,
33
- class: "title"
34
- };
35
- const _hoisted_8 = {
36
- class: "command-box__menu"
37
- };
38
- const _hoisted_9 = ["onMouseover", "onClick"];
39
- const _hoisted_10 = {
40
- class: "label"
41
- };
42
- const _hoisted_11 = {
43
- class: "remark"
44
- };
45
- var _sfc_main = /* @__PURE__ */ defineComponent({
46
- __name: "MobileChatFooter",
47
- setup(__props) {
48
- const {
49
- state,
50
- shortcutList,
51
- getShortcutName,
52
- isAllDisabled,
53
- isStreamingOutput,
54
- handleShortcut,
55
- showPopover,
56
- handleKeyDown,
57
- handleInput,
58
- btnDisabled,
59
- showAudio,
60
- breadcrumb,
61
- currentShortcutId,
62
- currentCommand,
63
- commandList,
64
- clickMenu
65
- } = useFooterContext();
66
- function handleBack() {
67
- var _a;
68
- breadcrumb.value.pop();
69
- currentCommand.value = last(breadcrumb.value) ? (_a = last(breadcrumb.value)) == null ? void 0 : _a.children : cloneDeep(commandList.value || []);
70
- currentShortcutId.value = currentCommand.value[0].shortcutId;
71
- }
72
- const AudioStateMap = {
73
- INPUT: "input",
74
- AUDIO: "audio",
75
- "AUDIO_DOING": "audio_doing",
76
- "AUDIO_CANCEL": "audio_cancel"
77
- };
78
- const audioState = ref(AudioStateMap.INPUT);
79
- const showState = reactive({
80
- show: false
81
- });
82
- const footerRef = ref();
83
- let footerRect = null;
84
- function onBarTouchStart() {
85
- audioState.value = AudioStateMap.AUDIO_DOING;
86
- window.addEventListener("touchend", onFooterTouchEnd);
87
- footerRect = footerRef.value.getBoundingClientRect();
88
- showState.show = true;
89
- }
90
- const onFooterTouchMove = useThrottleFn((event) => {
91
- if (![AudioStateMap.AUDIO_DOING, AudioStateMap.AUDIO_CANCEL].includes(audioState.value))
92
- return;
93
- if (!footerRect)
94
- return;
95
- const touch = event.touches[0];
96
- const isInside = touch.clientX >= footerRect.left && touch.clientX <= footerRect.right && touch.clientY >= footerRect.top && touch.clientY <= footerRect.bottom;
97
- if (!isInside) {
98
- audioState.value = AudioStateMap.AUDIO_CANCEL;
99
- handlePause();
100
- } else {
101
- audioState.value = AudioStateMap.AUDIO_DOING;
102
- handlePlay();
103
- }
104
- }, 100);
105
- function onFooterTouchEnd() {
106
- if (audioState.value === AudioStateMap.AUDIO_DOING) {
107
- audioState.value = AudioStateMap.AUDIO;
108
- handleEnd("click");
109
- }
110
- if (audioState.value === AudioStateMap.AUDIO_CANCEL) {
111
- audioState.value = AudioStateMap.AUDIO;
112
- handleCancel();
113
- }
114
- window.removeEventListener("touchend", onFooterTouchEnd);
115
- }
116
- function onFooterTouchCancel() {
117
- audioState.value = AudioStateMap.AUDIO;
118
- handleCancel();
119
- }
120
- const audioChartRef = ref();
121
- const {
122
- isWarning,
123
- isActive,
124
- handlePlay,
125
- handlePause,
126
- handleEnd,
127
- handleCancel,
128
- formattedTime,
129
- warnTime,
130
- audioSdk
131
- } = useChartAudioContext(showState, (en, state2) => {
132
- showState.show = state2;
133
- }, {
134
- waveSelector: () => audioChartRef.value
135
- });
136
- return (_ctx, _cache) => {
137
- var _a;
138
- return openBlock(), createElementBlock("div", {
139
- class: normalizeClass(["mobile-ai-chat-footer", unref(state).loading ? "disabled" : ""]),
140
- style: normalizeStyle({
141
- position: unref(showAudio) ? "" : "relative"
142
- }),
143
- ref_key: "footerRef",
144
- ref: footerRef,
145
- onTouchmove: _cache[6] || (_cache[6] = (...args) => unref(onFooterTouchMove) && unref(onFooterTouchMove)(...args)),
146
- onTouchend: onFooterTouchEnd,
147
- onTouchcancel: onFooterTouchCancel
148
- }, [((_a = unref(shortcutList)) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcutList), (item) => {
149
- return openBlock(), createBlock(unref(NButton), {
150
- secondary: "",
151
- size: "small",
152
- key: unref(getShortcutName)(item),
153
- disabled: unref(isAllDisabled) || unref(isStreamingOutput) && unref(state).loading,
154
- onClick: () => unref(handleShortcut)(item)
155
- }, {
156
- default: withCtx(() => [createTextVNode(toDisplayString(unref(getShortcutName)(item)), 1)]),
157
- _: 2
158
- }, 1032, ["disabled", "onClick"]);
159
- }), 128))])) : createCommentVNode("v-if", true), createVNode(unref(NPopover), {
160
- "content-style": "height: 400px",
161
- placement: "top-start",
162
- trigger: "manual",
163
- width: "trigger",
164
- "show-arrow": false,
165
- to: false,
166
- show: unref(showPopover),
167
- onClickoutside: _cache[4] || (_cache[4] = ($event) => showPopover.value = false)
168
- }, {
169
- trigger: withCtx(() => [createElementVNode("div", _hoisted_2, [createVNode(unref(NButton), {
170
- text: "",
171
- disabled: unref(isAllDisabled) || unref(showAudio) || unref(state).loading,
172
- onClick: _cache[0] || (_cache[0] = ($event) => showAudio.value = true)
173
- }, {
174
- icon: withCtx(() => [createVNode(unref(NIcon), {
175
- size: "32"
176
- }, {
177
- default: withCtx(() => [createVNode(MicroPhone)]),
178
- _: 1
179
- })]),
180
- _: 1
181
- }, 8, ["disabled"]), withDirectives(createVNode(unref(NInput), {
182
- ref: "inputRef",
183
- placeholder: "\u53D1\u6D88\u606F...",
184
- disabled: unref(isAllDisabled) || unref(state).loading || unref(showAudio),
185
- value: unref(state).sendContent,
186
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(state).sendContent = $event),
187
- onKeydownCapture: unref(handleKeyDown),
188
- onInput: unref(handleInput)
189
- }, null, 8, ["disabled", "value", "onKeydownCapture", "onInput"]), [[vShow, audioState.value === AudioStateMap.INPUT]]), withDirectives(createElementVNode("div", {
190
- class: "mobile-ai-chat-footer__audioPushBar",
191
- onTouchstart: onBarTouchStart
192
- }, " \u6309\u4F4F\u8BF4\u8BDD ", 544), [[vShow, audioState.value === AudioStateMap.AUDIO]]), withDirectives(createVNode(unref(NIcon), {
193
- onClick: _cache[2] || (_cache[2] = ($event) => audioState.value = AudioStateMap.AUDIO)
194
- }, {
195
- default: withCtx(() => [createVNode(AudioIcon)]),
196
- _: 1
197
- }, 512), [[vShow, audioState.value === AudioStateMap.INPUT]]), withDirectives(createVNode(unref(NIcon), {
198
- onClick: _cache[3] || (_cache[3] = ($event) => audioState.value = AudioStateMap.INPUT)
199
- }, {
200
- default: withCtx(() => [createVNode(KeyboardIcon)]),
201
- _: 1
202
- }, 512), [[vShow, audioState.value === AudioStateMap.AUDIO]]), withDirectives(createElementVNode("section", {
203
- ref_key: "audioChartRef",
204
- ref: audioChartRef,
205
- class: normalizeClass({
206
- "mobile-ai-chat-footer__audioDoing": audioState.value === AudioStateMap.AUDIO_DOING,
207
- "mobile-ai-chat-footer__audioCancel": audioState.value === AudioStateMap.AUDIO_CANCEL
208
- })
209
- }, _hoisted_4, 2), [[vShow, audioState.value === AudioStateMap.AUDIO_CANCEL || audioState.value === AudioStateMap.AUDIO_DOING]]), createVNode(unref(NIcon), null, {
210
- default: withCtx(() => [createVNode(AddIcon)]),
211
- _: 1
212
- })])]),
213
- default: withCtx(() => {
214
- var _a2;
215
- return [createElementVNode("div", _hoisted_5, [createElementVNode("div", _hoisted_6, [!unref(breadcrumb).length ? (openBlock(), createElementBlock("span", _hoisted_7, ((_a2 = window.getLanguageByCode) == null ? void 0 : _a2.call(window, "10010.1.189")) || "\u63A8\u8350\u6307\u4EE4")) : (openBlock(), createElementBlock(Fragment, {
216
- key: 1
217
- }, [createVNode(unref(NButton), {
218
- text: "",
219
- onClick: handleBack
220
- }, {
221
- default: withCtx(() => [createVNode(unref(NIcon), {
222
- color: "#999",
223
- size: "20",
224
- component: unref(ChevronBack)
225
- }, null, 8, ["component"])]),
226
- _: 1
227
- }), createVNode(unref(NBreadcrumb), null, {
228
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(breadcrumb), (item) => {
229
- return openBlock(), createBlock(unref(NBreadcrumbItem), {
230
- key: item.shortcutId
231
- }, {
232
- default: withCtx(() => [createTextVNode(toDisplayString(item.shortcutTitle), 1)]),
233
- _: 2
234
- }, 1024);
235
- }), 128))]),
236
- _: 1
237
- })], 64))]), createElementVNode("div", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentCommand), (item) => {
238
- return openBlock(), createElementBlock("div", {
239
- class: normalizeClass(["menu-item", !item.children || !item.children.length ? "selectable" : "", unref(currentShortcutId) === item.shortcutId ? "selected" : ""]),
240
- key: item.shortcutId,
241
- onMouseover: withModifiers(() => currentShortcutId.value = item.shortcutId, ["stop"]),
242
- onClick: () => unref(clickMenu)(item)
243
- }, [createElementVNode("span", _hoisted_10, toDisplayString(item.shortcutTitle), 1), createElementVNode("span", _hoisted_11, toDisplayString(item.shortcutDescription), 1), item.children && item.children.length ? (openBlock(), createBlock(unref(NIcon), {
244
- key: 0,
245
- color: "#999",
246
- size: "20",
247
- component: unref(ChevronForward)
248
- }, null, 8, ["component"])) : createCommentVNode("v-if", true)], 42, _hoisted_9);
249
- }), 128))])])];
250
- }),
251
- _: 1
252
- }, 8, ["show"]), createVNode(MobileChatAudio, {
253
- show: unref(showAudio),
254
- "onUpdate:show": _cache[5] || (_cache[5] = ($event) => isRef(showAudio) ? showAudio.value = $event : null)
255
- }, null, 8, ["show"])], 38);
256
- };
257
- }
258
- });
259
-
260
- export { _sfc_main as default };
@@ -1,18 +0,0 @@
1
- import { openBlock, createElementBlock, createStaticVNode } from 'vue';
2
- import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.js';
3
-
4
- const _sfc_main = {};
5
- const _hoisted_1 = {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
8
- viewBox: "0 0 24 24",
9
- version: "1.1"
10
- };
11
- const _hoisted_2 = /* @__PURE__ */ createStaticVNode('<g id="AI\u5DE5\u4F5C\u7AD9" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.8"><g id="\u5E95\u90E8\u804A\u5929\u529F\u80FD\u4EA4\u4E92" transform="translate(-323, -75)" fill="#000000" fill-rule="nonzero"><g id="\u66F4\u591A" transform="translate(323, 75)"><rect id="\u77E9\u5F62" opacity="0" x="0" y="0" width="24" height="24"></rect><path d="M12,0 C5.371875,0 0,5.371875 0,12 C0,18.628125 5.371875,24 12,24 C18.628125,24 24,18.628125 24,12 C24,5.371875 18.628125,0 12,0 Z M12,22 C6.48660714,22 2,17.5133929 2,12 C2,6.48660714 6.48660714,2 12,2 C17.5133929,2 22,6.48660714 22,12 C22,17.5133929 17.5133929,22 12,22 Z M16.0909756,12.9171951 L12.9760976,12.9171951 L12.9760976,16.0807317 C12.9760976,16.5907195 12.5626707,17.0041464 12.0526829,17.0041464 C11.5426951,17.0041464 11.1292683,16.5907195 11.1292683,16.0807317 L11.1292683,12.9171951 L7.98841463,12.9171951 C7.48004325,12.9171951 7.06792682,12.5050787 7.06792682,11.9967073 C7.06792682,11.4883359 7.48004325,11.0762195 7.98841463,11.0762195 L11.1292683,11.0762195 L11.1292683,7.58963414 C11.1292683,7.07964632 11.5426951,6.6662195 12.0526829,6.6662195 C12.5626707,6.6662195 12.9760976,7.07964632 12.9760976,7.58963414 L12.9760976,11.0762195 L16.0909756,11.0762195 C16.599347,11.0762195 17.0114634,11.4883359 17.0114634,11.9967073 C17.0114634,12.5050787 16.599347,12.9171951 16.0909756,12.9171951 Z" id="\u5F62\u72B6"></path></g></g></g>', 1);
12
- const _hoisted_3 = [_hoisted_2];
13
- function _sfc_render(_ctx, _cache) {
14
- return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3);
15
- }
16
- var AddIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "AddIcon.vue"]]);
17
-
18
- export { AddIcon as default };
@@ -1,37 +0,0 @@
1
- import { createElementVNode, openBlock, createElementBlock } from 'vue';
2
- import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.js';
3
-
4
- var _a;
5
- const _sfc_main = {};
6
- const _hoisted_1 = {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
9
- viewBox: "0 0 24 24",
10
- version: "1.1"
11
- };
12
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("g", {
13
- id: "AI\u5DE5\u4F5C\u7AD9",
14
- stroke: "none",
15
- "stroke-width": "1",
16
- fill: "none",
17
- "fill-rule": "evenodd",
18
- "fill-opacity": "0.8"
19
- }, [/* @__PURE__ */ createElementVNode("g", {
20
- id: "\u5E95\u90E8\u804A\u5929\u529F\u80FD\u4EA4\u4E92",
21
- transform: "translate(-283, -75)",
22
- fill: "#000000",
23
- "fill-rule": "nonzero"
24
- }, [/* @__PURE__ */ createElementVNode("g", {
25
- id: ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.130")) || "\u8BED\u97F3",
26
- transform: "translate(283, 75)"
27
- }, [/* @__PURE__ */ createElementVNode("path", {
28
- d: "M12.000014,24.0000279 C5.3956469,23.9454825 0.054539126,18.604381 0,12.000014 C0.0545454541,5.3956469 5.3956469,0.054539126 12.000014,0 C18.604381,0.0545454541 23.9454888,5.3956469 24.0000279,12.000014 C23.9454825,18.604381 18.604381,23.9454888 12.000014,24.0000279 Z M12,2 L12,2 C6.47714635,2 2,6.47714635 2,12 C2,17.5228536 6.47714635,22 12,22 C17.5228536,22 22,17.5228536 22,12 C22,11.9996503 22,11.9993006 22,11.9989509 L22,11.9982034 C22.0019059,6.47882084 17.5291198,2.00293668 12.0097372,2.00104339 C12.0062394,2.00104218 12.0027415,2.00104281 11.9992437,2.00104527 L12,2 Z M13.5883799,19.6363822 L12.4789247,18.3960167 C14.2352908,16.772743 15.4374672,14.4818325 15.4374672,11.9051107 C15.4374672,9.4222094 14.4207379,7.13128486 12.7560031,5.60400183 L13.8654583,4.36363633 L13.8654585,4.36363633 C15.8846156,6.35216775 17.0178528,9.0700795 17.0094622,11.9040047 C17.0094622,14.9585473 15.7145505,17.7272927 13.5883566,19.6363822 L13.5883799,19.6363822 Z M9.24326857,15.1494786 C10.3527285,14.4818419 11.0923653,13.3363866 11.0923653,11.9040139 C11.0923653,10.6636483 10.4454543,9.51819076 9.52145327,8.84947124 L10.7225445,7.60910573 C11.9247279,8.56365293 12.7560008,10.186929 12.7560008,11.9051107 C12.7560008,13.7182027 11.8319997,15.3414741 10.445452,16.3909363 L9.24326857,15.1494809 L9.24326857,15.1494786 Z M7.30145303,13.3363866 C6.65454212,13.3363866 6.10036179,12.7636578 6.10036179,12.0960211 C6.10036179,11.4272922 6.65454446,10.8545658 7.30145303,10.8545658 C7.94945378,10.8545658 8.50363646,11.4272945 8.50363646,12.0960211 C8.50363646,12.7636578 7.94945378,13.3363866 7.30145303,13.3363866 Z",
29
- id: "\u5F62\u72B6"
30
- })])])], -1);
31
- const _hoisted_3 = [_hoisted_2];
32
- function _sfc_render(_ctx, _cache) {
33
- return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3);
34
- }
35
- var AudioIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "AudioIcon.vue"]]);
36
-
37
- export { AudioIcon as default };
@@ -1,20 +0,0 @@
1
- import { openBlock, createElementBlock, createStaticVNode } from 'vue';
2
- import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.js';
3
-
4
- const _sfc_main = {};
5
- const _hoisted_1 = {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
8
- width: "25px",
9
- height: "25px",
10
- viewBox: "0 0 25 25",
11
- version: "1.1"
12
- };
13
- const _hoisted_2 = /* @__PURE__ */ createStaticVNode('<g id="AI\u5DE5\u4F5C\u7AD9" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.8"><g id="\u5E95\u90E8\u804A\u5929\u529F\u80FD\u4EA4\u4E92" transform="translate(-283, -180)" fill="#000000" fill-rule="nonzero"><g id="\u952E\u76D8" transform="translate(283.4361, 180.4245)"><path d="M11.9999578,24 C5.37265887,24 0,18.6273411 0,12.0000422 C0,5.37265887 5.37265887,0 11.9999578,0 C18.6273411,0 24,5.37265887 24,12.0000422 C24,18.6273411 18.6273411,24 11.9999578,24 Z M11.9998665,2 C6.47696399,2 2,6.47704409 2,12 C2,17.5229826 6.47704409,22 11.9998665,22 C17.5229826,22 22,17.5229559 22,11.9998665 C22,6.47701739 17.5229559,2 11.9998665,2 Z" id="\u5F62\u72B6"></path><path d="M17.9706826,14.4002952 L17.0516044,14.4002952 L17.0516044,14.4002952 C16.7978126,14.40022 16.5921033,14.19448 16.5920653,13.9406882 L16.5920653,12.1026702 L16.5920653,12.1027382 C16.5920653,11.8489685 16.7977665,11.6432371 17.0515365,11.6431991 L17.9706147,11.6431991 L17.9706147,11.6431991 C18.2243313,11.6432743 18.4299801,11.8489533 18.4300181,12.1026704 L18.4300181,13.9406884 L18.4300181,13.9406204 C18.4300181,14.1943589 18.2244219,14.4001079 17.9706826,14.4002952 L17.9706826,14.4002952 Z M17.9706826,10.2646533 L17.0516044,10.2646533 L17.0516044,10.2646533 C16.7978658,10.2645771 16.5921793,10.0589201 16.5920653,9.80518097 L16.5920653,7.96716296 L16.5920653,7.96729902 C16.5920653,7.71353388 16.797703,7.50777349 17.0514687,7.50762423 L17.9705469,7.50762423 L17.9705469,7.50762423 C18.2242588,7.50777453 18.4298743,7.71345111 18.4299503,7.96716333 L18.4299503,9.80518134 L18.4299503,9.80513589 C18.4298627,10.0588212 18.2242784,10.2644769 17.970593,10.2646533 L17.9706826,10.2646533 Z M14.2944349,14.4002952 L13.3754245,14.4002952 L13.3754245,14.4002952 C13.1216439,14.40022 12.9159532,14.1944691 12.9159532,13.9406882 L12.9159532,12.1026702 L12.9159532,12.1027382 C12.9159532,11.8489951 13.121613,11.6432751 13.3753567,11.6431991 L14.294367,11.6431991 L14.294367,11.6431991 C14.5481368,11.6431991 14.7538681,11.8489001 14.7539061,12.1026704 L14.7539061,13.9406884 L14.7539061,13.9406203 C14.7539061,14.1944121 14.5482271,14.4001839 14.2944349,14.4002952 L14.2944349,14.4002952 Z M14.2944349,10.264653 L13.3754245,10.264653 L13.3754245,10.264653 C13.1216814,10.2646146 12.9159913,10.0589247 12.9159533,9.80518097 L12.9159533,7.96716296 L12.9159533,7.96723096 C12.9159533,7.71347668 13.1216019,7.50773799 13.3753567,7.50762401 L14.294367,7.50762401 L14.2943671,7.50762401 C14.5481322,7.50769917 14.7538302,7.7133977 14.7539062,7.96716311 L14.7539062,9.80518112 L14.7539062,9.80513561 C14.7538186,10.0588742 14.5481515,10.2645526 14.2944132,10.264653 L14.2944349,10.264653 Z M17.5112059,16.6977872 L17.5112059,17.1573263 L17.5112059,17.1571901 C17.5112059,17.4109818 17.3055269,17.6167536 17.0517346,17.6168649 L6.94235199,17.6168649 L6.942352,17.6168649 C6.6885714,17.6168273 6.48281288,17.4111067 6.48281288,17.1573258 L6.48281288,16.6977867 L6.48281288,16.6978321 C6.48281288,16.4440936 6.68856785,16.2384151 6.94230585,16.2383147 L17.0516071,16.2383147 L17.0516071,16.2383147 C17.3053614,16.2383523 17.5110702,16.4440314 17.5112059,16.697786 L17.5112059,16.6977872 Z M10.6184043,14.4002988 L9.69939391,14.4002988 L9.69939389,14.4002988 C9.44561328,14.4002227 9.23992263,14.1944718 9.23992263,13.940691 L9.23992263,12.102673 L9.23992263,12.1027409 C9.23992263,11.8489978 9.44558234,11.6432778 9.69932604,11.6432018 L10.6183364,11.6432018 L10.6183364,11.6432018 C10.872117,11.6432018 11.0778673,11.8488919 11.0779433,12.1026731 L11.0779433,13.9406911 L11.0779433,13.9406457 C11.0778557,14.1944328 10.8721691,14.4001603 10.6183825,14.4002988 L10.6184043,14.4002988 Z M10.6184043,10.264655 L9.69939391,10.264655 L9.69939391,10.264655 C9.44565075,10.2646174 9.23996064,10.0589274 9.23992264,9.80518368 L9.23992264,7.96716567 L9.23992264,7.96723367 C9.23992264,7.71347939 9.44557123,7.5077407 9.69932606,7.50762672 L10.6183364,7.50762672 L10.6183364,7.50762672 C10.8721127,7.50770186 11.0778294,7.71338929 11.0779434,7.96716583 L11.0779434,9.80518384 L11.0779434,9.80518646 C11.0777916,10.0589361 10.8720834,10.2645817 10.6183337,10.264655 L10.6184043,10.264655 Z M6.94237368,14.4002979 L6.02336332,14.4002979 L6.0233633,14.4002979 C5.76959816,14.4001852 5.56393004,14.1944561 5.56389204,13.940691 L5.56389204,12.102673 L5.56389204,12.1027409 C5.56389204,11.8489978 5.76955175,11.6432778 6.02329545,11.6432018 L6.94230581,11.6432018 L6.9423058,11.6432018 C7.19604435,11.643277 7.40173093,11.848934 7.40184493,12.1026731 L7.40184493,13.9406911 L7.40184493,13.940555 C7.40184493,14.1943312 7.19621832,14.4001104 6.94244151,14.4002979 L6.94237368,14.4002979 Z M6.94237368,10.2646552 L6.02336332,10.2646552 L6.0233633,10.2646552 C5.76963561,10.2645798 5.56396803,10.0589116 5.56389202,9.80518368 L5.56389202,7.96716567 L5.56389202,7.96730171 C5.56389202,7.71356317 5.76948823,7.50781417 6.02322759,7.50762692 L6.94223795,7.50762692 L6.94223794,7.50762692 C7.19598761,7.50773961 7.40166307,7.71341608 7.40177705,7.96716602 L7.40177705,9.80518403 L7.40177705,9.80518668 C7.40162531,10.0589098 7.19595857,10.264544 6.94223523,10.2646552 L6.94237368,10.2646552 Z" id="\u5F62\u72B6\u7ED3\u5408"></path></g></g></g>', 1);
14
- const _hoisted_3 = [_hoisted_2];
15
- function _sfc_render(_ctx, _cache) {
16
- return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3);
17
- }
18
- var KeyboardIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "KeyboardIcon.vue"]]);
19
-
20
- export { KeyboardIcon as default };
@@ -1,48 +0,0 @@
1
- import { openBlock, createElementBlock, createElementVNode } from 'vue';
2
- import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.js';
3
-
4
- const _sfc_main = {};
5
- const _hoisted_1 = {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
8
- viewBox: "0 0 512 512"
9
- };
10
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("path", {
11
- fill: "none",
12
- stroke: "black",
13
- "stroke-linecap": "round",
14
- "stroke-linejoin": "round",
15
- "stroke-width": "32",
16
- d: "M192 448h128"
17
- }, null, -1);
18
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", {
19
- d: "M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",
20
- fill: "none",
21
- stroke: "black",
22
- "stroke-linecap": "round",
23
- "stroke-linejoin": "round",
24
- "stroke-width": "32"
25
- }, null, -1);
26
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("path", {
27
- fill: "none",
28
- stroke: "black",
29
- "stroke-linecap": "round",
30
- "stroke-linejoin": "round",
31
- "stroke-width": "32",
32
- d: "M256 368v80"
33
- }, null, -1);
34
- const _hoisted_5 = /* @__PURE__ */ createElementVNode("path", {
35
- 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",
36
- fill: "none",
37
- stroke: "#4972EF",
38
- "stroke-linecap": "round",
39
- "stroke-linejoin": "round",
40
- "stroke-width": "32"
41
- }, null, -1);
42
- const _hoisted_6 = [_hoisted_2, _hoisted_3, _hoisted_4, _hoisted_5];
43
- function _sfc_render(_ctx, _cache) {
44
- return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_6);
45
- }
46
- var MicroPhone = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "MicroPhone.vue"]]);
47
-
48
- export { MicroPhone as default };
@@ -1,2 +0,0 @@
1
- export * from './useData';
2
- export * from './useWebsocket';
@@ -1,2 +0,0 @@
1
- export { InjectionAIChatData, initData, useData } from './useData.js';
2
- export { useWebsocket } from './useWebsocket.js';
@@ -1,18 +0,0 @@
1
- import { AnyFn, AnyObject } from '../../../../shared/types';
2
- import { CAudioSDK } from '../../../../components/audio-sdk';
3
- export declare function useChartAudioContext(props: {
4
- show: Boolean;
5
- }, emit: AnyFn, options: {
6
- waveSelector: () => string | HTMLElement;
7
- waveProps?: AnyObject;
8
- }): {
9
- audioSdk: CAudioSDK;
10
- isWarning: import("vue").Ref<boolean>;
11
- warnTime: import("vue").Ref<number>;
12
- isActive: import("vue").Ref<boolean>;
13
- formattedTime: import("vue").ComputedRef<string>;
14
- handlePause: () => void;
15
- handlePlay: () => void;
16
- handleEnd: (trigger?: string) => Promise<void>;
17
- handleCancel: () => void;
18
- };
@@ -1,202 +0,0 @@
1
- import { useIntervalFn, promiseTimeout } from '@vueuse/core';
2
- import { ref, computed, watch, nextTick, onBeforeUnmount } from 'vue';
3
- import { useData } from './useData.js';
4
- import { $message } from '../utils/index.js';
5
- import '../../../audio-sdk/index.js';
6
- import AudioSDK from '../../../audio-sdk/src/audioSDK.js';
7
- import Recorder from '../../../audio-sdk/src/utils/recorder/recorder.js';
8
-
9
- function useChartAudioContext(props, emit, options) {
10
- const audioSdk = AudioSDK.create();
11
- const {
12
- state,
13
- sessionId,
14
- immediatelyRecording,
15
- sendMessage,
16
- $dialog,
17
- isStreamingOutput
18
- } = useData();
19
- const time = ref(0);
20
- let warnTimer = null;
21
- let warnCancelTimer = null;
22
- const NO_CONTENT_DURATION = 5e3;
23
- const warnTime = ref(5);
24
- const isWarning = ref(false);
25
- function startWarningTimer() {
26
- clearInterval(warnTimer);
27
- setWarningState(false);
28
- warnTimer = setTimeout(() => {
29
- setWarningState(true);
30
- }, NO_CONTENT_DURATION);
31
- }
32
- function setWarningState(state2) {
33
- isWarning.value = state2;
34
- if (state2) {
35
- clearInterval(warnCancelTimer);
36
- warnTime.value = 5;
37
- warnCancelTimer = setInterval(() => {
38
- if (warnTime.value > 0) {
39
- warnTime.value--;
40
- } else {
41
- warnTime.value = 5;
42
- clearInterval(warnCancelTimer);
43
- startWarningTimer();
44
- }
45
- }, 1e3);
46
- } else {
47
- clearInterval(warnCancelTimer);
48
- }
49
- }
50
- let endType = "";
51
- const {
52
- pause,
53
- resume,
54
- isActive
55
- } = useIntervalFn(() => {
56
- time.value++;
57
- }, 1e3, {
58
- immediate: false
59
- });
60
- const formattedTime = computed(() => {
61
- const hours = Math.floor(time.value / 3600);
62
- const minutes = Math.floor(time.value % 3600 / 60);
63
- const seconds = time.value % 60;
64
- const formattedMinutes = minutes.toString().padStart(2, "0");
65
- const formattedSeconds = seconds.toString().padStart(2, "0");
66
- if (hours > 0) {
67
- const formattedHours = hours.toString().padStart(2, "0");
68
- return `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
69
- } else {
70
- return `${formattedMinutes}:${formattedSeconds}`;
71
- }
72
- });
73
- async function start() {
74
- var _a;
75
- try {
76
- startWarningTimer();
77
- const res = await audioSdk.start({
78
- timed: 30 * 60,
79
- type: "http",
80
- showModal: false
81
- });
82
- emit("update:show", false);
83
- if (endType !== "click")
84
- return;
85
- const {
86
- result,
87
- data
88
- } = res || {};
89
- if (result !== "success")
90
- return;
91
- if (data) {
92
- state.sendContent = data;
93
- if (!isStreamingOutput.value) {
94
- state.loadingText = "\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";
95
- }
96
- sendMessage({
97
- opType: "create_inquiry"
98
- });
99
- } else {
100
- $message.warning("\u5F55\u97F3\u5185\u5BB9\u4E3A\u7A7A");
101
- }
102
- } catch (error) {
103
- emit("update:show", false);
104
- if ((error == null ? void 0 : error.result) === "fail" && error.msg) {
105
- if (error.wsTimeout) {
106
- $dialog.error({
107
- title: "\u9519\u8BEF\u63D0\u793A",
108
- maskClosable: false,
109
- content: error.msg,
110
- positiveText: ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.27")) || "\u786E\u5B9A"
111
- });
112
- return;
113
- }
114
- $message.warning(error.msg);
115
- }
116
- throw error;
117
- }
118
- }
119
- function handlePause() {
120
- pause();
121
- audioSdk.pause();
122
- setWarningState(false);
123
- clearInterval(warnTimer);
124
- }
125
- function handlePlay() {
126
- resume();
127
- audioSdk.resume();
128
- startWarningTimer();
129
- }
130
- function handleCancel() {
131
- audioSdk.handleError("\u7528\u6237\u53D6\u6D88\u5F55\u97F3");
132
- emit("update:show", false);
133
- }
134
- async function handleEnd(trigger) {
135
- endType = trigger || "";
136
- audioSdk == null ? void 0 : audioSdk.stop();
137
- emit("update:show", false);
138
- }
139
- watch(() => props.show, async (val) => {
140
- var _a, _b, _c, _d;
141
- if (val) {
142
- endType = "";
143
- time.value = 0;
144
- resume();
145
- start();
146
- if (!audioSdk.waveView) {
147
- await nextTick();
148
- audioSdk.waveView = (_d = (_c = (_b = Recorder).FrequencyHistogramView) == null ? void 0 : _c.call(_b, {
149
- elem: (_a = options == null ? void 0 : options.waveSelector) == null ? void 0 : _a.call(options),
150
- scale: 1,
151
- fps: 15,
152
- widthRatio: 0.4,
153
- lineCount: 30,
154
- minHeight: 2,
155
- stripeEnable: false,
156
- linear: [0, "rgba(105, 153, 244)", 1, "rgba(47, 118, 252)"],
157
- position: 0,
158
- ...options == null ? void 0 : options.waveProps
159
- })) != null ? _d : null;
160
- }
161
- } else {
162
- pause();
163
- }
164
- }, {
165
- immediate: true
166
- });
167
- watch(() => sessionId.value, async (value) => {
168
- const show = props.show;
169
- if (props.show) {
170
- handleEnd();
171
- }
172
- if (immediatelyRecording.value) {
173
- if (show) {
174
- await promiseTimeout(10);
175
- }
176
- emit("update:show", true);
177
- }
178
- }, {
179
- immediate: true
180
- });
181
- watch(() => audioSdk.contentRef.value, (value) => {
182
- state.sendContent = value || "";
183
- setWarningState(false);
184
- startWarningTimer();
185
- });
186
- onBeforeUnmount(() => {
187
- AudioSDK.destroy();
188
- });
189
- return {
190
- audioSdk,
191
- isWarning,
192
- warnTime,
193
- isActive,
194
- formattedTime,
195
- handlePause,
196
- handlePlay,
197
- handleEnd,
198
- handleCancel
199
- };
200
- }
201
-
202
- export { useChartAudioContext };