cnhis-design-vue 3.3.1-beta.4 → 3.3.1-beta.44

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 (255) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +394 -43
  3. package/es/components/ai-chat/src/Index.vue.d.ts +394 -43
  4. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  5. package/es/components/ai-chat/src/api/index.d.ts +8 -0
  6. package/es/components/ai-chat/src/api/index.js +1 -0
  7. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +38 -0
  8. package/es/components/ai-chat/src/components/ChatAudio.vue.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -0
  10. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
  11. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
  12. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  13. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +75 -31
  14. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  15. package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -7
  16. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  17. package/es/components/ai-chat/src/components/ChatMainDefault.d.ts +2 -0
  18. package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
  19. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
  20. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  21. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
  22. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  23. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +57 -0
  24. package/es/components/ai-chat/src/components/ChatRight.vue.js +1 -0
  25. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -0
  26. package/es/components/ai-chat/src/components/card/JsonCard.d.ts +25 -0
  27. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -0
  28. package/es/components/ai-chat/src/components/message-render/CardRender.d.ts +16 -0
  29. package/es/components/ai-chat/src/components/message-render/CardRender.js +1 -0
  30. package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +16 -0
  31. package/es/components/ai-chat/src/components/message-render/FormRender.js +1 -0
  32. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +36 -0
  33. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +1 -0
  34. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +1 -0
  35. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +105 -0
  36. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +1 -0
  37. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +1 -0
  38. package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +1 -0
  39. package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +1 -0
  40. package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +1 -0
  41. package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +1 -0
  42. package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
  43. package/es/components/ai-chat/src/hooks/index.js +1 -0
  44. package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +18 -0
  45. package/es/components/ai-chat/src/hooks/useChartAudioContext.js +1 -0
  46. package/es/components/ai-chat/src/hooks/useData.d.ts +77 -0
  47. package/es/components/ai-chat/src/hooks/useData.js +1 -0
  48. package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +38 -0
  49. package/es/components/ai-chat/src/hooks/useFooterContext.js +1 -0
  50. package/es/components/ai-chat/src/hooks/useProgram.d.ts +14 -0
  51. package/es/components/ai-chat/src/hooks/useProgram.js +1 -0
  52. package/es/components/ai-chat/src/hooks/useSSE.d.ts +9 -0
  53. package/es/components/ai-chat/src/hooks/useSSE.js +1 -0
  54. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +4 -0
  55. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -0
  56. package/es/components/ai-chat/src/types/index.d.ts +1 -3
  57. package/es/components/ai-chat/src/types/index.js +1 -1
  58. package/es/components/ai-chat/src/utils/index.d.ts +6 -0
  59. package/es/components/ai-chat/src/utils/index.js +1 -1
  60. package/es/components/ai-chat/style/index.css +1 -1
  61. package/es/components/audio-sdk/index.d.ts +274 -2
  62. package/es/components/audio-sdk/index.js +1 -1
  63. package/es/components/audio-sdk/src/Index.vue.d.ts +274 -0
  64. package/es/components/audio-sdk/src/Index.vue.js +1 -0
  65. package/es/components/audio-sdk/src/Index.vue2.js +1 -0
  66. package/es/components/audio-sdk/src/audioSDK.d.ts +60 -28
  67. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  68. package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
  69. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +100 -0
  70. package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
  71. package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
  72. package/es/components/audio-sdk/src/components/recording.vue.d.ts +53 -4
  73. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  74. package/es/components/audio-sdk/src/utils/index.d.ts +7 -0
  75. package/es/components/audio-sdk/src/utils/index.js +1 -0
  76. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -3
  77. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  78. package/es/components/audio-sdk/style/index.css +1 -1
  79. package/es/components/button-print/index.d.ts +30 -0
  80. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
  81. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  82. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
  83. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  84. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  85. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  86. package/es/components/button-print/src/utils/print.d.ts +2 -2
  87. package/es/components/button-print/src/utils/print.js +1 -1
  88. package/es/components/calendar/index.d.ts +126 -3
  89. package/es/components/calendar/src/Calendar.vue.d.ts +126 -2
  90. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -8
  91. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  92. package/es/components/card-render/src/components/Button.vue.d.ts +3 -0
  93. package/es/components/card-render/src/components/Button.vue2.js +1 -1
  94. package/es/components/card-render/src/components/ScaleView.vue.d.ts +39 -0
  95. package/es/components/card-render/src/components/ScaleView.vue.js +1 -0
  96. package/es/components/card-render/src/components/ScaleView.vue2.js +1 -0
  97. package/es/components/card-render/src/components/Table.vue.d.ts +104 -0
  98. package/es/components/card-render/src/components/Table.vue.js +1 -0
  99. package/es/components/card-render/src/components/Table.vue2.js +1 -0
  100. package/es/components/card-render/src/components/Text.vue.d.ts +1 -0
  101. package/es/components/card-render/src/components/Text.vue2.js +1 -1
  102. package/es/components/card-render/src/components/index.d.ts +162 -23
  103. package/es/components/card-render/src/components/index.js +1 -1
  104. package/es/components/card-render/src/constants/index.d.ts +4 -1
  105. package/es/components/card-render/src/constants/index.js +1 -1
  106. package/es/components/card-render/style/index.css +1 -1
  107. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  108. package/es/components/editor/src/Editor.js +1 -1
  109. package/es/components/editor/style/index.css +1 -0
  110. package/es/components/fabric-chart/index.d.ts +6 -2
  111. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +6 -2
  112. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  113. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  114. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  115. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  116. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  117. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  118. package/es/components/form-config/index.d.ts +40 -10
  119. package/es/components/form-config/src/FormConfig.vue.d.ts +40 -10
  120. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +32 -8
  121. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -2
  122. package/es/components/form-render/src/components/renderer/date.d.ts +2 -2
  123. package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
  124. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  125. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +9 -0
  126. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  127. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +12 -1
  128. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +12 -1
  129. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  130. package/es/components/form-render/src/components/renderer/select.js +1 -1
  131. package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
  132. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  133. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  134. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  135. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  136. package/es/components/form-render/src/types/fieldItem.d.ts +9 -3
  137. package/es/components/guide/src/renderer.d.ts +2 -2
  138. package/es/components/iho-chat/index.d.ts +206 -4
  139. package/es/components/iho-chat/src/Index.vue.d.ts +206 -4
  140. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  141. package/es/components/iho-chat/src/api/index.js +1 -1
  142. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +8 -0
  143. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  144. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -3
  145. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  146. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +7 -0
  147. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  148. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +96 -2
  149. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -0
  150. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  151. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +71 -1
  152. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  153. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +8 -2
  154. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  155. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
  156. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  157. package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +70 -1
  158. package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -1
  159. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +7 -0
  160. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
  161. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  162. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
  163. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  164. package/es/components/iho-chat/src/constants/index.d.ts +9 -2
  165. package/es/components/iho-chat/src/constants/index.js +1 -1
  166. package/es/components/iho-chat/src/hooks/useSearchPatientList.d.ts +11 -0
  167. package/es/components/iho-chat/src/hooks/useSearchPatientList.js +1 -0
  168. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  169. package/es/components/iho-chat/src/utils/index.d.ts +6 -0
  170. package/es/components/iho-chat/src/utils/index.js +1 -1
  171. package/es/components/iho-chat/style/index.css +1 -1
  172. package/es/components/iho-table/index.d.ts +3 -0
  173. package/es/components/iho-table/index.js +1 -1
  174. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  175. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
  176. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  177. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
  178. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  179. package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
  180. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  181. package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
  182. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  183. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  184. package/es/components/iho-table/src/plugins/index.d.ts +79 -3
  185. package/es/components/iho-table/src/plugins/index.js +1 -1
  186. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  187. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  188. package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
  189. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
  190. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  191. package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
  192. package/es/components/iho-table/src/utils/index.js +1 -1
  193. package/es/components/index.css +1 -1
  194. package/es/components/index.d.ts +2 -1
  195. package/es/components/index.js +1 -1
  196. package/es/components/scale-view/index.d.ts +17 -3
  197. package/es/components/scale-view/src/ScaleView.vue.d.ts +17 -3
  198. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  199. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +1 -1
  200. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  201. package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
  202. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  203. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  204. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  205. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
  206. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  207. package/es/components/shortcut-setter/index.d.ts +8 -2
  208. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -2
  209. package/es/components/steps-wheel/index.d.ts +18 -0
  210. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +18 -0
  211. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  212. package/es/env.d.ts +25 -25
  213. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  214. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  215. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  216. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  217. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  218. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  219. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  220. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  221. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  222. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  223. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  224. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  225. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  226. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  227. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  228. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  229. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  230. package/es/shared/assets/img/failure.png.js +1 -1
  231. package/es/shared/assets/img/file-emr.png.js +1 -0
  232. package/es/shared/assets/img/file.png.js +1 -0
  233. package/es/shared/assets/img/logo.png.js +1 -1
  234. package/es/shared/assets/img/no-permission.png.js +1 -1
  235. package/es/shared/assets/img/nodata.png.js +1 -1
  236. package/es/shared/assets/img/notfound.png.js +1 -1
  237. package/es/shared/assets/img/qr.png.js +1 -1
  238. package/es/shared/assets/img/success.png.js +1 -1
  239. package/es/shared/assets/img/table_style_2.png.js +1 -1
  240. package/es/shared/assets/img/use.png.js +1 -0
  241. package/es/shared/assets/img/video.png.js +1 -1
  242. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  243. package/es/shared/assets/img/xb_big.png.js +1 -1
  244. package/es/shared/assets/img/xb_small.png.js +1 -1
  245. package/es/shared/hooks/useLevelSearchCascader.d.ts +1 -0
  246. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  247. package/es/shared/package.json.js +1 -1
  248. package/package.json +5 -3
  249. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  250. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  251. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  252. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  253. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  254. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  255. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,computed as i,createVNode as n,resolveComponent as a,createTextVNode as t}from"vue";import{NButton as s}from"naive-ui";import o from"../../../../../shared/assets/img/file.png.js";import d from"../../../../../shared/assets/img/file-emr.png.js";import r from"../../../../../shared/assets/img/use.png.js";import{CheckmarkCircle as c}from"@vicons/ionicons5";import{isArray as u,isString as v}from"lodash-es";import{useData as m}from"../../hooks/useData.js";import"../../utils/index.js";var p=e({name:"ChatJsonCard",inheritAttrs:!1,props:{item:{type:Object,default:()=>({})},messageItem:{type:Object,default:()=>({})}},emits:[],setup(e,{attrs:p,slots:g,emit:f}){const{state:y,isStreamingOutput:b,configs:h,emit:_,sendMessage:k,toNext:x,$dialog:C}=m(),{messageType:w,content:T={}}=e.messageItem,I=l([]),N=l([]),j=i((()=>{var e,l;return null!=(l=null==(e=h.value)?void 0:e.vac01)?l:""})),P=i((()=>{var e,l;return null!=(l=null==(e=h.value)?void 0:e.vac06)?l:""})),O=i((()=>null==T?void 0:T.diagnosis)),D=i((()=>{var e;return"diagnosis_added"===w&&(null==(e=O.value)?void 0:e.length)})),S=i((()=>D.value||"medical_added"===w)),J=i((()=>w&&["diagnosis","diagnosis_added","treatment_plan"].includes(w))),E=i((()=>{var e,l;return"diagnosis_added"===w?(null==(e=T.recommendedExaminations)?void 0:e.filter((e=>"outer"!==e.type)))||[]:"treatment_plan"===w&&(null==(l=T.medications)?void 0:l.filter((e=>"outer"!==e.type)))||[]})),L=i((()=>{var e,l,i;return"diagnosis_added"===w?(null==(l=null==(e=T.recommendedExaminations)?void 0:e.filter)?void 0:l.call(e,(e=>"outer"===e.type)))||[]:"treatment_plan"===w&&(null==(i=T.medications)?void 0:i.filter((e=>"outer"===e.type)))||[]}));var R,q;"diagnosis_added"===w&&(I.value=null==(q=null==(R=E.value)?void 0:R.map)?void 0:q.call(R,(e=>e.name)));const A=(e,l="name")=>{N.value.includes(e[l])?N.value=N.value.filter((i=>i!==e[l])):N.value.push(e[l])};function B(l,i){var n,a,t;if(null==(n=null==l?void 0:l.preventDefault)||n.call(l),null==(a=null==l?void 0:l.stopPropagation)||a.call(l),y.loading)return;let s=i?[i]:[];if(arguments.length||(s=null==(t=T.possibleConditions)?void 0:t.filter((e=>N.value.includes(e.code)))),!s.length)return;b.value||(y.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目");const o="引用诊断####"+JSON.stringify({vaa07:j.value,vac06:P.value,possibleConditions:s});k({...e.item,opType:"diagnosis",contents:[{role:"user",content:"",contentType:"text"}],possibleConditions:s,flowResult:o})}async function $(l,i){var n,a,t;if(v(l)||(null==(n=null==l?void 0:l.preventDefault)||n.call(l),null==(a=null==l?void 0:l.stopPropagation)||a.call(l)),!y.loading)if("edit"===l){const e=i?I.value.includes(i.name)?[i.name]:[]:[...I.value];_("program",{key:"medical_order",params:{bbx05List:JSON.stringify(e),vac01:j.value,type:3}})}else{let l=i?[i]:[];i||(l=null==(t=E.value)?void 0:t.filter((e=>I.value.includes(e.name))));const n="引用医嘱####"+JSON.stringify({vaa07:j.value,vac06:P.value,recommendedExaminations:l});k({...e.item,opType:"medical_order",contents:[{role:"user",content:"",contentType:"text"}],recommendedExaminations:l,flowResult:n})}}const z=async()=>{var e;const l=(null==(e=T.reports)?void 0:e[0])||{};_("program",{key:"report",params:{vaa07:j.value,reportType:l.reportType,reportId:l.reportId}})},H=async(l,i)=>{var n,a,t,s,o;if(null==(n=null==l?void 0:l.preventDefault)||n.call(l),null==(a=null==l?void 0:l.stopPropagation)||a.call(l),y.loading)return;const d=i?[i.name]:N.value,r={drugNameList:JSON.stringify(d),vac01:j.value,type:3};if(!b.value)return void _("program",{key:"recommend_treatment_plan",params:r});function c(){const l="引用治疗方案####"+JSON.stringify(r);k({...e.item,contents:[{role:"user",content:"",contentType:"text"}],flowResult:l})}(null==(t=E.value)?void 0:t.filter((e=>d.includes(e.name)))).some((e=>!F(e.inventory)))?C.warning({title:"提示",maskClosable:!1,content:"存在库存告急的药物,请谨慎开方",positiveText:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{c()}}):c()},M=e=>{if(!("diagnosis_added"===w?!I.value.length:!N.value.length))return"diagnosis"===w?B():"diagnosis_added"===w?$(e):"treatment_plan"===w?H():void 0};const U=()=>{var l,i;const a="inquiry"===w,s="link"===w,{linkType:r,linkURL:c,linkProcess:u,linkParams:v}=T||{};function m(){if(s){if(0==r)window.open(c,"_blank");else if(1==r){if(y.bpmnProcessDoing)return;y.bpmnProcessId=u,x(u,v)}}else!async function(){var l;"medical"===w?_("program",{key:"medical",params:{vac01:null==(l=h.value)?void 0:l.vac01,type:1}}):(b.value?y.consultationContent=y.record.find((e=>e.contents[0].messageType===w)):y.consultationContent=e.item,y.showRight=!0)}()}const p=s&&1==r&&y.bpmnProcessDoing;return n("div",{class:["inquiry_medical-box",{disabled:p}],onClick:()=>m()},[n("div",{class:"left-img"},[n("img",{src:a||s?o:d},null)]),n("div",{class:"right-text"},[n("p",{class:"top-info"},[a?null==(l=T.summary)?void 0:l.inquiryStr:T.info]),n("p",{class:"sum-time"},[t("创建时间:"),(null==(i=T.summary)?void 0:i.creationTime)||T.creationTime])])])},W=()=>{var e,l;return n("div",{class:"diagnosis-added-box"},[n("div",{class:"recommended-wrap"},[n("div",{class:"title"},[t("检验检查推荐")]),null==(e=E.value)?void 0:e.map((e=>n("div",{class:["con-item",{active:I.value.includes(e.name)}],onClick:()=>(e=>{var l;I.value.includes(e.name)?I.value=null==(l=I.value)?void 0:l.filter((l=>l!==e.name)):I.value.push(e.name)})(e)},[n("div",{class:"item-left"},[n("p",{class:"name"},[e.name]),n("div",{class:"desc"},[e.description])]),n("img",{class:"right-icon",src:r,onClick:l=>$(l,e)},null)])))]),(null==(l=L.value)?void 0:l.length)?n("div",{class:"recommended-wrap outer-wrap"},[n("div",{class:"title"},[t("其他检验检查推荐")]),L.value.map((e=>n("div",{class:"con-item outer-item"},[n("div",{class:"item-left"},[n("p",{class:"name"},[e.name]),n("div",{class:"desc"},[e.description])])])))]):null])},F=e=>e&&+e>10;const G=()=>{if(!S.value)return null;return("medical_added"===w?[{}]:O.value).map((e=>n("div",{class:"card-header"},[n("span",{class:"left-title"},[n(a("n-icon"),{component:c},null),"medical_added"===w?"已完成申请单开立":`已添加诊断:${e.name}`]),"medical_added"===w?null:n("span",{class:"right-desc"},[t("创建时间: "),e.createdTime])])))},K=()=>{var e;if(!J.value)return null;const l=y.loading||("diagnosis_added"===w?!(null==(e=I.value)?void 0:e.length):!N.value.length);return n("div",{class:"card-footer"},[n("span",{class:"left-desc"},[t("请注意,推荐信息由AI生成,结果仅供临床参考")]),n("div",{class:"right-btns"},[w&&["diagnosis_added","treatment_plan"].includes(w)?n(s,{size:"large",disabled:l,onClick:()=>M("edit")},{default:()=>[t("编辑所选")]}):null,n("span",{class:["right-btn",{disabled:l}],onClick:()=>M()},[t("引用所选")])])])},Q=()=>w&&["inquiry","medical","link"].includes(w)?U():"diagnosis"==w?(()=>{var e;return n("div",{class:"diagnosis-box"},[n("div",{class:"title"},[t("诊断辅助")]),n("div",{class:"desc"},[T.patientHistory]),null==(e=T.possibleConditions)?void 0:e.map((e=>n("div",{class:["con-item",{active:N.value.includes(e.code)}],onClick:()=>A(e,"code")},[n("div",{class:"item-left"},[n("div",{class:"item-top"},[n("a",{href:e.link,target:"_blank"},[t("【"),e.condition,t("】")]),e.code,t("("),e.probability,t(")")]),n("div",{class:"btm-desc"},[e.description])]),n("img",{class:"right-icon",src:r,onClick:l=>B(l,e)},null)])))])})():"diagnosis_added"==w?W():"treatment_plan"==w?(()=>{var e,l,i;return n("div",{class:"treatment-plan-box"},[n("div",{class:"top-div"},[n("div",{class:"title"},[T.title])]),n("div",{class:"desc"},[T.description]),n("div",{class:"medication-wrap"},[n("div",{class:"title"},[t("药物")]),E.value.map((e=>n("div",{class:["con-item",{active:N.value.includes(e.name)}],onClick:()=>A(e)},[F(e.inventory)?null:n("span",{class:"inventory-tag"},[n("span",null,[t("库存告急【"),e.inventory,t("】")])]),n("div",{class:"item-left"},[n("p",{class:"name"},[e.name]),n("ul",null,[n("li",null,[t("用量: "),e.dosage,e.purpose]),n("li",null,[t("用法: "),e.usageInstructions]),e.bby06?n("li",null,[t("规格:"),e.bby06]):null])]),n("img",{class:"right-icon",src:r,onClick:l=>H(l,e)},null)])))]),(null==(e=T.precautions)?void 0:e.length)?n("div",{class:"precaution-wrap"},[n("div",{class:"title"},[t("注意事项")]),n("div",{class:"precaution-div"},[null==(l=T.precautions)?void 0:l.map(((e,l)=>n("div",{class:"treatment-item"},[l+1,t(". "),e])))])]):null,(null==(i=L.value)?void 0:i.length)?n("div",{class:"medication-wrap"},[n("div",{class:"title"},[t("其他治疗方案推荐")]),L.value.map((e=>n("div",{class:"con-item outer-item"},[n("div",{class:"item-left"},[n("p",{class:"name"},[e.name]),n("ul",null,[n("li",null,[t("用量: "),e.dosage,e.purpose]),n("li",null,[t("用法: "),e.usageInstructions]),e.bby06?n("li",null,[t("规格:"),e.bby06]):null])])])))]):null])})():"report_message"==w?(()=>{var e;const l=T||{},i=(null==(e=l.reportInterpretation)?void 0:e.replace(/\\n|\n|\r/g,"<br>").split("<br>"))||[""],o=i.map(((e,l)=>[e,l===i.length-1?null:n("br",null,null)]));return n("div",{class:"report-message-box"},[n("div",{class:"top-title"},[n("div",{class:"left-title"},[n(a("n-icon"),{component:c},null),l.reportName]),n("div",{class:"right-detail"},[n(s,{text:!0,onClick:z},{default:()=>[t("报告详情")]}),n(s,{text:!0},{default:()=>[t("推荐方案")]})])]),n("div",{class:"center-img"},[l.images.map((e=>"pdf"===e.imageType?n("embed",{class:"pdf-embed",src:e.image,type:"application/pdf"},null):n(a("n-image"),{src:e.image},null)))]),n("div",{class:"bottom-interpretation"},[o,n("div",{class:"desc-tip"},[t("请注意,辅助诊断由AI推荐,结果仅供临床参考。")])])])})():"medical_added"==w?function(){if(!u(T))return null;const e=T.map((e=>{const{itemName:l,sample:i,execDeptName:a}=e||{};let t="";l&&(t+=l);const s=()=>!t||t.endsWith("/")?"":"/";return i&&(t+=s()+i),a&&(t+=s()+a),n("div",{class:"item"},[n("span",null,[t]),n("span",{class:"time"},[e.beginExecTime])])}));return n("div",{class:"medical-added-box"},[e])}():"默认json内容";return()=>n("section",{class:"json-card_section"},[G(),n("div",{class:"card-content"},[Q()]),K()])}});export{p as default};
@@ -0,0 +1,16 @@
1
+ import { PropType } from 'vue';
2
+ import { MessageItem } from '../../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ msgItem: {
5
+ type: PropType<MessageItem>;
6
+ default: () => {};
7
+ };
8
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
+ msgItem: {
10
+ type: PropType<MessageItem>;
11
+ default: () => {};
12
+ };
13
+ }>>, {
14
+ msgItem: MessageItem;
15
+ }>;
16
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,computed as t,createVNode as n}from"vue";import{isArray as o,omit as l,property as i}from"lodash-es";import r from"../../../../card-render/index.js";import{isValidJSON as a}from"../../utils/index.js";var d=e({name:"CardRender",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})}},setup(e){const{settings:d={},data:s={}}=e.msgItem.content,c=t((()=>a(null==d?void 0:d.setting)?JSON.parse(d.setting):null));function u(e){console.log("handleModuleClick ==>",e)}function m(e){var t,n,r;if(!e)return;const{button:a,config:d,data:s,fullData:c=s}=e,u=null!=(r=null==(n=null==(t=null==a?void 0:a.advancedConfig)?void 0:t.eventConfig)?void 0:n.params)?r:[],m={};u.forEach((e=>{const{label:t,value:n}=e,r=n.match(/\${(.*?)}/);if(!r)return void(m[t]=n);const a=r[1].split(".").map((e=>e.trim()));if(2===a.length&&"selected"===a[1]){let e=null==c?void 0:c[a[0]];return o(e)||(e=[]),void(m[t]=e.reduce(((e,t)=>((null==t?void 0:t.__checked)&&e.push(l(t,["__checked"])),e)),[]))}m[t]=i(a.join("."))({...c,row:s})})),console.log("parsed_params=>",m)}return()=>n("div",{class:"card"},[n(r,{config:c.value,data:s,"onModule-click":u,"onButton-click":m},null)])}});export{d as default};
@@ -0,0 +1,16 @@
1
+ import { PropType } from 'vue';
2
+ import { MessageItem } from '../../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ msgItem: {
5
+ type: PropType<MessageItem>;
6
+ default: () => {};
7
+ };
8
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
+ msgItem: {
10
+ type: PropType<MessageItem>;
11
+ default: () => {};
12
+ };
13
+ }>>, {
14
+ msgItem: MessageItem;
15
+ }>;
16
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as t,createVNode as l,createTextVNode as a}from"vue";import{NButton as i}from"naive-ui";import o from"../../../../form-render/index.js";import{isArray as s}from"lodash-es";import{useData as n}from"../../hooks/useData.js";import"../../utils/index.js";const d={input:"INPUT",textarea:"TEXTAREA",radio:"RADIO",switch:"SWITCH",checkbox:"CHECKBOX",datePicker:"DATE",singleSelect:"SELECT",multiSelect:"SELECT"};var r=e({name:"FormRender",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})}},setup(e,{attrs:r,slots:m,emit:u}){var f;const{state:p,axiosInstance:c,toReplyAiConditions:v}=n(),g=t([]),y=t(),{formConfig:b=[],formContent:h=""}=(null==(f=e.msgItem)?void 0:f.content)||{};function C(){return h.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map((t=>t.includes("{form}")?l("div",{class:"form-box"},[l(o,{"request-instance":{get:c.get,post:c.post},column:12,ref:y,"field-list":g.value},null),l(i,{style:{width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},secondary:!0,class:"gradient",disabled:e.msgItem.disabled||p.loading,onClick:async function(){var t,l;if(y.value)try{p.loading=!0;const a=y.value.getFormValues();await(null==(t=y.value)?void 0:t.validate()),b.forEach((e=>{a[e.fieldKey]&&(e.fieldDefValue=a[e.fieldKey])})),v({programData:null==(l=e.msgItem)?void 0:l.__programData,params:a}),e.msgItem.disabled=!0}catch(e){console.log("提交表单 ===>",e)}finally{p.loading=!1}}},{default:()=>[a("提交")]})]):[l("p",null,[t.replace(/(&nbsp;|\s|<br>)+/g,"")])]))}return g.value=b.map((t=>{var l,a;const i=t.dataMap||{label:"label",value:"value"},o={html_type:d[t.fieldInputType]||t.fieldInputType,val_key:t.fieldKey,name:t.fieldName,elem_width:12,default_val:t.fieldDefValue,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:i.label},option:t.dataList||[],is_null:t.fieldRequired?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{...t.fieldConfig},multi_select:"multiSelect"===t.fieldInputType?"0":"1"};return"DATE"===o.html_type&&(o.date_format=t.dateFormat||"yyyy-MM-dd HH:mm:ss"),1==t.dataSources&&(o.html_type,o.componentProps={fallbackOption:!1},o.default_val=null,t.fieldDefValue&&s(t.dataList)&&t.dataList.length>0&&t.dataList.find((e=>(null==e?void 0:e[i.value])===t.fieldDefValue))&&(o.default_val=t.fieldDefValue),Object.assign(o.urlConfig,{url:"/flow/api/process/start",method:"post",nameKey:i.lable,valueKey:i.value,params:{bpmnProcessId:null==(l=t.fieldConfig)?void 0:l.dataSetCode,isRes:1,variables:null==(a=t.fieldConfig)?void 0:a.params},dependKey:[]})),o})),()=>l("div",{class:"card"},[C()])}});export{r as default};
@@ -0,0 +1,36 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ show: {
3
+ type: BooleanConstructor;
4
+ };
5
+ }, {
6
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
7
+ show: {
8
+ type: BooleanConstructor;
9
+ };
10
+ }>> & {
11
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
12
+ }>>;
13
+ emit: (event: "update:show", ...args: any[]) => void;
14
+ audioChatRef: import("vue").Ref<HTMLDivElement | undefined>;
15
+ isWarning: import("vue").Ref<boolean>;
16
+ isActive: import("vue").Ref<boolean>;
17
+ handlePlay: () => void;
18
+ handlePause: () => void;
19
+ handleEnd: (trigger?: string | undefined) => Promise<void>;
20
+ formattedTime: import("vue").ComputedRef<string>;
21
+ warnTime: import("vue").Ref<number>;
22
+ audioSdk: import("../../../..").CAudioSDK;
23
+ audioSdkContentRef: import("vue").Ref<string>;
24
+ tip: import("vue").ComputedRef<"未识别录音" | "录音已暂停" | "正在听...">;
25
+ stateText: import("vue").ComputedRef<"" | "已暂停">;
26
+ NButton: any;
27
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
+ show: {
29
+ type: BooleanConstructor;
30
+ };
31
+ }>> & {
32
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
33
+ }, {
34
+ show: boolean;
35
+ }>;
36
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./MobileChatAudio.vue2.js";import o from"../../../../../_virtual/_plugin-vue_export-helper.js";var i=o(e,[["__file","MobileChatAudio.vue"]]);export{i as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as o,ref as a,computed as e,withDirectives as i,openBlock as t,createElementBlock as l,createElementVNode as n,toDisplayString as s,unref as c,createBlock as r,withCtx as u,createTextVNode as d,createVNode as h,vShow as m}from"vue";import{NButton as p}from"naive-ui";import{useChartAudioContext as f}from"../../hooks/useChartAudioContext.js";const v={class:"mobile-ai-chat-audio"},b={class:"mobile-ai-chat-audio--wrapper"},k={class:"mobile-ai-chat-audio--content"},C={class:"mobile-ai-chat-audio--footer"},w={class:"mobile-ai-chat-audio--operation"},y=n("i",{class:"mobile-ai-chat-audio--operationRedDot"},null,-1),_={class:"mobile-ai-chat-audio--operationTimer"},g={class:"mobile-ai-chat-audio--operationBtns"};var x=o({__name:"MobileChatAudio",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:x}){const A=o,R=a(),{isWarning:T,isActive:B,handlePlay:P,handlePause:S,handleEnd:j,formattedTime:D,warnTime:E,audioSdk:M}=f(A,x,{waveSelector:()=>R.value}),W=M.contentRef,q=e((()=>B.value?T.value?"未识别录音":"正在听...":"录音已暂停")),z=e((()=>B.value?"":"已暂停"));return(a,e)=>i((t(),l("section",v,[n("section",b,[n("section",k,s(c(W)),1),n("footer",C,[n("div",{style:{width:"300px",height:"60px"},ref_key:"audioChatRef",ref:R},null,512),n("div",null,s(c(q)),1),n("section",w,[y,n("div",_,[n("span",null,s(c(D)),1),n("span",null,s(c(z)),1)]),n("div",g,[c(B)?(t(),r(c(p),{key:0,round:"",color:"rgb(236, 96, 42)",onClick:c(S)},{default:u((()=>[d("暂停")])),_:1},8,["onClick"])):(t(),r(c(p),{key:1,type:"warning",round:"",color:"rgb(236, 96, 42)",onClick:c(P)},{default:u((()=>[d("继续")])),_:1},8,["onClick"])),h(c(p),{text:"",color:"white",onClick:c(j)},{default:u((()=>[d("完成")])),_:1},8,["onClick"])])])])])],512)),[[m,o.show]])}});export{x as default};
@@ -0,0 +1,105 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ state: import("../../../../../shared/types").AnyObject;
3
+ shortcutList: import("vue").Ref<any>;
4
+ getShortcutName: (item: string | import("../../../../../shared/types").AnyObject) => any;
5
+ isAllDisabled: import("vue").ComputedRef<any>;
6
+ isStreamingOutput: import("vue").Ref<any>;
7
+ handleShortcut: (item: string | import("../../../../../shared/types").AnyObject) => void;
8
+ showPopover: import("vue").Ref<boolean>;
9
+ handleKeyDown: (event: KeyboardEvent) => void;
10
+ handleInput: (value: string) => void;
11
+ btnDisabled: import("vue").ComputedRef<any>;
12
+ showAudio: import("vue").Ref<boolean>;
13
+ breadcrumb: import("vue").Ref<{
14
+ [x: string]: any;
15
+ shortcutTitle: string;
16
+ shortcutId: string;
17
+ shortcutDescription?: string | undefined;
18
+ children?: any[] | undefined;
19
+ }[]>;
20
+ currentShortcutId: import("vue").Ref<string>;
21
+ currentCommand: import("vue").Ref<{
22
+ [x: string]: any;
23
+ shortcutTitle: string;
24
+ shortcutId: string;
25
+ shortcutDescription?: string | undefined;
26
+ children?: any[] | undefined;
27
+ }[]>;
28
+ commandList: import("vue").Ref<any>;
29
+ clickMenu: (menu: import("../../types").CommandItem) => void;
30
+ handleBack: () => void;
31
+ AudioStateMap: {
32
+ INPUT: string;
33
+ AUDIO: string;
34
+ AUDIO_DOING: string;
35
+ AUDIO_CANCEL: string;
36
+ };
37
+ audioState: any;
38
+ showState: {
39
+ show: boolean;
40
+ };
41
+ footerRef: import("vue").Ref<HTMLDivElement | undefined>;
42
+ footerRect: null;
43
+ onBarTouchStart: () => void;
44
+ onFooterTouchMove: (event: TouchEvent) => void;
45
+ onFooterTouchEnd: () => void;
46
+ onFooterTouchCancel: () => void;
47
+ audioChartRef: import("vue").Ref<HTMLDivElement | undefined>;
48
+ isWarning: import("vue").Ref<boolean>;
49
+ isActive: import("vue").Ref<boolean>;
50
+ handlePlay: () => void;
51
+ handlePause: () => void;
52
+ handleEnd: (trigger?: string | undefined) => Promise<void>;
53
+ handleCancel: () => void;
54
+ formattedTime: import("vue").ComputedRef<string>;
55
+ warnTime: import("vue").Ref<number>;
56
+ audioSdk: import("../../../..").CAudioSDK;
57
+ 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<{}>>, {}>;
58
+ 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<{}>>, {}>;
59
+ NBreadcrumb: any;
60
+ NBreadcrumbItem: any;
61
+ NButton: any;
62
+ NIcon: any;
63
+ NInput: any;
64
+ NPopover: any;
65
+ MobileChatAudio: import("vue").DefineComponent<{
66
+ show: {
67
+ type: BooleanConstructor;
68
+ };
69
+ }, {
70
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
71
+ show: {
72
+ type: BooleanConstructor;
73
+ };
74
+ }>> & {
75
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
76
+ }>>;
77
+ emit: (event: "update:show", ...args: any[]) => void;
78
+ audioChatRef: import("vue").Ref<HTMLDivElement | undefined>;
79
+ isWarning: import("vue").Ref<boolean>;
80
+ isActive: import("vue").Ref<boolean>;
81
+ handlePlay: () => void;
82
+ handlePause: () => void;
83
+ handleEnd: (trigger?: string | undefined) => Promise<void>;
84
+ formattedTime: import("vue").ComputedRef<string>;
85
+ warnTime: import("vue").Ref<number>;
86
+ audioSdk: import("../../../..").CAudioSDK;
87
+ audioSdkContentRef: import("vue").Ref<string>;
88
+ tip: import("vue").ComputedRef<"未识别录音" | "录音已暂停" | "正在听...">;
89
+ stateText: import("vue").ComputedRef<"" | "已暂停">;
90
+ NButton: any;
91
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
92
+ show: {
93
+ type: BooleanConstructor;
94
+ };
95
+ }>> & {
96
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
97
+ }, {
98
+ show: boolean;
99
+ }>;
100
+ AddIcon: any;
101
+ MicroPhone: any;
102
+ AudioIcon: any;
103
+ KeyboardIcon: any;
104
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
105
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./MobileChatFooter.vue2.js";import o from"../../../../../_virtual/_plugin-vue_export-helper.js";var r=o(e,[["__file","MobileChatFooter.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,reactive as t,openBlock as l,createElementBlock as n,normalizeClass as a,unref as i,normalizeStyle as u,Fragment as s,renderList as r,createBlock as d,withCtx as c,createTextVNode as v,toDisplayString as h,createCommentVNode as m,createVNode as f,createElementVNode as I,withDirectives as p,vShow as _,withModifiers as C,isRef as A}from"vue";import{ChevronBack as D,ChevronForward as g}from"@vicons/ionicons5";import{useThrottleFn as w}from"@vueuse/core";import{last as O,cloneDeep as b}from"lodash-es";import{NButton as U,NPopover as k,NIcon as N,NInput as y,NBreadcrumb as T,NBreadcrumbItem as L}from"naive-ui";import x from"./MobileChatAudio.vue.js";import P from"../svgs/AddIcon.vue.js";import E from"../svgs/MicroPhone.vue.js";import{useChartAudioContext as j}from"../../hooks/useChartAudioContext.js";import{useFooterContext as G}from"../../hooks/useFooterContext.js";import M from"../svgs/AudioIcon.vue.js";import S from"../svgs/KeyboardIcon.vue.js";const z={key:0,class:"menu-box fillet-8"},K={class:"mobile-ai-chat-footer__operation"},R=[I("div",{id:"chat-audio-wave-view"},null,-1)],B={class:"command-box"},F={class:"command-box__header"},X={key:0,class:"title"},Y={class:"command-box__menu"},W=["onMouseover","onClick"],q={class:"label"},H={class:"remark"};var J=e({__name:"MobileChatFooter",setup(e){const{state:J,shortcutList:Q,getShortcutName:V,isAllDisabled:Z,isStreamingOutput:$,handleShortcut:ee,showPopover:oe,handleKeyDown:te,handleInput:le,btnDisabled:ne,showAudio:ae,breadcrumb:ie,currentShortcutId:ue,currentCommand:se,commandList:re,clickMenu:de}=G();function ce(){var e;ie.value.pop(),se.value=O(ie.value)?null==(e=O(ie.value))?void 0:e.children:b(re.value||[]),ue.value=se.value[0].shortcutId}const ve={INPUT:"input",AUDIO:"audio",AUDIO_DOING:"audio_doing",AUDIO_CANCEL:"audio_cancel"},he=o(ve.INPUT),me=t({show:!1}),fe=o();let Ie=null;function pe(){he.value=ve.AUDIO_DOING,window.addEventListener("touchend",Ce),Ie=fe.value.getBoundingClientRect(),me.show=!0}const _e=w((e=>{if(![ve.AUDIO_DOING,ve.AUDIO_CANCEL].includes(he.value))return;if(!Ie)return;const o=e.touches[0];o.clientX>=Ie.left&&o.clientX<=Ie.right&&o.clientY>=Ie.top&&o.clientY<=Ie.bottom?(he.value=ve.AUDIO_DOING,Oe()):(he.value=ve.AUDIO_CANCEL,be())}),100);function Ce(){he.value===ve.AUDIO_DOING&&(he.value=ve.AUDIO,Ue("click")),he.value===ve.AUDIO_CANCEL&&(he.value=ve.AUDIO,ke()),window.removeEventListener("touchend",Ce)}function Ae(){he.value=ve.AUDIO,ke()}const De=o(),{isWarning:ge,isActive:we,handlePlay:Oe,handlePause:be,handleEnd:Ue,handleCancel:ke,formattedTime:Ne,warnTime:ye,audioSdk:Te}=j(me,((e,o)=>{me.show=o}),{waveSelector:()=>De.value});return(e,o)=>{var t;return l(),n("div",{class:a(["mobile-ai-chat-footer",i(J).loading?"disabled":""]),style:u({position:i(ae)?"":"relative"}),ref_key:"footerRef",ref:fe,onTouchmove:o[6]||(o[6]=(...e)=>i(_e)&&i(_e)(...e)),onTouchend:Ce,onTouchcancel:Ae},[(null==(t=i(Q))?void 0:t.length)?(l(),n("div",z,[(l(!0),n(s,null,r(i(Q),(e=>(l(),d(i(U),{secondary:"",size:"small",key:i(V)(e),disabled:i(Z)||i($)&&i(J).loading,onClick:()=>i(ee)(e)},{default:c((()=>[v(h(i(V)(e)),1)])),_:2},1032,["disabled","onClick"])))),128))])):m("v-if",!0),f(i(k),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:i(oe),onClickoutside:o[4]||(o[4]=e=>oe.value=!1)},{trigger:c((()=>[I("div",K,[f(i(U),{text:"",disabled:i(Z)||i(ae)||i(J).loading,onClick:o[0]||(o[0]=e=>ae.value=!0)},{icon:c((()=>[f(i(N),{size:"32"},{default:c((()=>[f(E)])),_:1})])),_:1},8,["disabled"]),p(f(i(y),{ref:"inputRef",placeholder:"发消息...",disabled:i(Z)||i(J).loading||i(ae),value:i(J).sendContent,"onUpdate:value":o[1]||(o[1]=e=>i(J).sendContent=e),onKeydownCapture:i(te),onInput:i(le)},null,8,["disabled","value","onKeydownCapture","onInput"]),[[_,he.value===ve.INPUT]]),p(I("div",{class:"mobile-ai-chat-footer__audioPushBar",onTouchstart:pe}," 按住说话 ",544),[[_,he.value===ve.AUDIO]]),p(f(i(N),{onClick:o[2]||(o[2]=e=>he.value=ve.AUDIO)},{default:c((()=>[f(M)])),_:1},512),[[_,he.value===ve.INPUT]]),p(f(i(N),{onClick:o[3]||(o[3]=e=>he.value=ve.INPUT)},{default:c((()=>[f(S)])),_:1},512),[[_,he.value===ve.AUDIO]]),p(I("section",{ref_key:"audioChartRef",ref:De,class:a({"mobile-ai-chat-footer__audioDoing":he.value===ve.AUDIO_DOING,"mobile-ai-chat-footer__audioCancel":he.value===ve.AUDIO_CANCEL})},R,2),[[_,he.value===ve.AUDIO_CANCEL||he.value===ve.AUDIO_DOING]]),f(i(N),null,{default:c((()=>[f(P)])),_:1})])])),default:c((()=>{var e;return[I("div",B,[I("div",F,[i(ie).length?(l(),n(s,{key:1},[f(i(U),{text:"",onClick:ce},{default:c((()=>[f(i(N),{color:"#999",size:"20",component:i(D)},null,8,["component"])])),_:1}),f(i(T),null,{default:c((()=>[(l(!0),n(s,null,r(i(ie),(e=>(l(),d(i(L),{key:e.shortcutId},{default:c((()=>[v(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64)):(l(),n("span",X,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令"))]),I("div",Y,[(l(!0),n(s,null,r(i(se),(e=>(l(),n("div",{class:a(["menu-item",e.children&&e.children.length?"":"selectable",i(ue)===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>ue.value=e.shortcutId),["stop"]),onClick:()=>i(de)(e)},[I("span",q,h(e.shortcutTitle),1),I("span",H,h(e.shortcutDescription),1),e.children&&e.children.length?(l(),d(i(N),{key:0,color:"#999",size:"20",component:i(g)},null,8,["component"])):m("v-if",!0)],42,W)))),128))])])]})),_:1},8,["show"]),f(x,{show:i(ae),"onUpdate:show":o[5]||(o[5]=e=>A(ae)?ae.value=e:null)},null,8,["show"])],38)}}});export{J as default};
@@ -0,0 +1 @@
1
+ import{openBlock as t,createElementBlock as r,createStaticVNode as e}from"vue";import i from"../../../../../_virtual/_plugin-vue_export-helper.js";const o={},l={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24",version:"1.1"},n=[e('<g id="AI工作站" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.8"><g id="底部聊天功能交互" transform="translate(-323, -75)" fill="#000000" fill-rule="nonzero"><g id="更多" transform="translate(323, 75)"><rect id="矩形" 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="形状"></path></g></g></g>',1)];var C=i(o,[["render",function(e,i){return t(),r("svg",l,n)}],["__file","AddIcon.vue"]]);export{C as default};
@@ -0,0 +1 @@
1
+ import{createElementVNode as e,openBlock as o,createElementBlock as r}from"vue";import l from"../../../../../_virtual/_plugin-vue_export-helper.js";var n;const i={},t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24",version:"1.1"},C=[e("g",{id:"AI工作站",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","fill-opacity":"0.8"},[e("g",{id:"底部聊天功能交互",transform:"translate(-283, -75)",fill:"#000000","fill-rule":"nonzero"},[e("g",{id:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.130"))||"语音",transform:"translate(283, 75)"},[e("path",{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",id:"形状"})])])],-1)];var a=l(i,[["render",function(e,l){return o(),r("svg",t,C)}],["__file","AudioIcon.vue"]]);export{a as default};
@@ -0,0 +1 @@
1
+ import{openBlock as L,createElementBlock as C,createStaticVNode as t}from"vue";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";const e={},i={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"25px",height:"25px",viewBox:"0 0 25 25",version:"1.1"},o=[t('<g id="AI工作站" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.8"><g id="底部聊天功能交互" transform="translate(-283, -180)" fill="#000000" fill-rule="nonzero"><g id="键盘" 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="形状"></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="形状结合"></path></g></g></g>',1)];var l=r(e,[["render",function(t,r){return L(),C("svg",i,o)}],["__file","KeyboardIcon.vue"]]);export{l as default};
@@ -0,0 +1 @@
1
+ import{openBlock as o,createElementBlock as n,createElementVNode as e}from"vue";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";const t={},l={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},i=[e("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"},null,-1),e("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"},null,-1),e("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"},null,-1),e("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"},null,-1)];var s=r(t,[["render",function(e,r){return o(),n("svg",l,i)}],["__file","MicroPhone.vue"]]);export{s as default};
@@ -0,0 +1,2 @@
1
+ export * from './useData';
2
+ export * from './useWebsocket';
@@ -0,0 +1 @@
1
+ export{InjectionAIChatData,initData,useData}from"./useData.js";export{useWebsocket}from"./useWebsocket.js";
@@ -0,0 +1,18 @@
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
+ };
@@ -0,0 +1 @@
1
+ import{useIntervalFn as e,promiseTimeout as t}from"@vueuse/core";import a from"recorder-core";import{ref as n,computed as i,watch as o,nextTick as r,onBeforeUnmount as l}from"vue";import{useData as s}from"./useData.js";import{$message as u}from"../utils/index.js";import"../../../audio-sdk/index.js";import d from"../../../audio-sdk/src/audioSDK.js";function c(c,v,m){const p=d.create(),{state:w,sessionId:f,immediatelyRecording:g,sendMessage:h,$dialog:y,isStreamingOutput:S}=s(),I=n(0);let T=null,C=null;const $=n(5),k=n(!1);function x(){clearInterval(T),b(!1),T=setTimeout((()=>{b(!0)}),5e3)}function b(e){k.value=e,e?(clearInterval(C),$.value=5,C=setInterval((()=>{$.value>0?$.value--:($.value=5,clearInterval(C),x())}),1e3)):clearInterval(C)}let j="";const{pause:M,resume:E,isActive:P}=e((()=>{I.value++}),1e3,{immediate:!1}),R=i((()=>{const e=Math.floor(I.value/3600),t=Math.floor(I.value%3600/60),a=I.value%60,n=t.toString().padStart(2,"0"),i=a.toString().padStart(2,"0");if(e>0){return`${e.toString().padStart(2,"0")}:${n}:${i}`}return`${n}:${i}`}));async function V(e){j=e||"",null==p||p.stop(),v("update:show",!1)}return o((()=>c.show),(async e=>{var t,n,i,o;e?(j="",I.value=0,E(),async function(){var e;try{x();const e=await p.start({timed:1800,type:"http",showModal:!1});if(v("update:show",!1),"click"!==j)return;const{result:t,data:a}=e||{};if("success"!==t)return;a?(w.sendContent=a,S.value||(w.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录"),h({opType:"create_inquiry"})):u.warning("录音内容为空")}catch(t){if(v("update:show",!1),"fail"===(null==t?void 0:t.result)&&t.msg){if(t.wsTimeout)return void y.error({title:"错误提示",maskClosable:!1,content:t.msg,positiveText:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定"});u.warning(t.msg)}throw t}}(),p.waveView||(await r(),p.waveView=null!=(o=null==(i=(n=a).FrequencyHistogramView)?void 0:i.call(n,{elem:null==(t=null==m?void 0:m.waveSelector)?void 0:t.call(m),scale:1,fps:15,widthRatio:.4,lineCount:30,minHeight:2,stripeEnable:!1,linear:[0,"rgba(105, 153, 244)",1,"rgba(47, 118, 252)"],position:0,...null==m?void 0:m.waveProps}))?o:null)):M()}),{immediate:!0}),o((()=>f.value),(async e=>{const a=c.show;c.show&&V(),g.value&&(a&&await t(10),v("update:show",!0))}),{immediate:!0}),o((()=>p.contentRef.value),(e=>{w.sendContent=e||"",b(!1),x()})),l((()=>{d.destroy()})),{audioSdk:p,isWarning:k,warnTime:$,isActive:P,formattedTime:R,handlePause:function(){M(),p.pause(),b(!1),clearInterval(T)},handlePlay:function(){E(),p.resume(),x()},handleEnd:V,handleCancel:function(){p.handleError("用户取消录音"),v("update:show",!1)}}}export{c as useChartAudioContext};
@@ -0,0 +1,77 @@
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
+ };
@@ -0,0 +1 @@
1
+ import{ref as e,reactive as t,computed as o,watch as n,nextTick as s,toRef as i,inject as r}from"vue";import{useDialog as a}from"naive-ui";import{useTheme as l}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as c,cloneDeep as d}from"lodash-es";import"@vue/shared";import{uuidGenerator as u}from"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import{axiosInstance as m,conversationApi as p}from"../api/index.js";import{useSSE as g}from"./useSSE.js";import{useProgram as f}from"./useProgram.js";import{isValidJSON as h}from"../utils/index.js";const y=Symbol("InjectionAIChatData");function v(r,y){m.defaults.headers.Authorization="bearer "+r.token;const v=a(),b=e(),I=t({id:"ai-chat-"+u(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null,selectedPatient:null,selectedPatientLabel:"",selectedPatientForm:null,showPatient:!1,showRight:!1,showRightSlot:!1,switchFlag:!0,record:[],bpmnProcessId:"",bpmnProcessDoing:!1,startToken:"",inquiryStr:"",needSubmitMsg:null}),{toNext:P,toBindAiConditions:S,toReplyAiConditions:T,toFinishProgram:w}=f({props:r,state:I,appendMessage:j,emit:y,chatMainRef:b}),C=l(),k=o((()=>"small"===r.uiStyle)),x=o((()=>"default"===r.uiStyle)),_=o((()=>{var e;return null==(e=r.configs)?void 0:e.vaa07})),R=o((()=>r.sessionId||_.value));async function j(e){c(e.contents)&&(I.record.unshift(e),await s(),b.value&&(b.value.scrollTop=0))}function q(e){if(h(e)){const t=JSON.parse(e),{bpmnProcessId:o,startToken:n}=t;o&&(I.bpmnProcessId=o),n&&(I.startToken=n)}}return n((()=>I.startToken),(e=>{e&&I.bpmnProcessId&&(S(),P())})),n((()=>I.bpmnProcessId),(async(e,t)=>{e&&t&&w(t)})),{chatMainRef:b,patientInfo:i(r,"patientInfo"),configs:i(r,"configs"),queryPrompt:i(r,"queryPrompt"),queryData:i(r,"queryData"),queryRecord:i(r,"queryRecord"),defaultShortcutList:i(r,"defaultShortcutList"),hideInput:i(r,"hideInput"),shortcutList:i(r,"shortcutList"),audioTimed:i(r,"audioTimed"),commandList:i(r,"commandList"),appId:i(r,"appId"),immediatelyRecording:i(r,"immediatelyRecording"),isStreamingOutput:i(r,"isStreamingOutput"),showLBtn:i(r,"showLBtn"),disabled:i(r,"disabled"),appCode:i(r,"appCode"),prologue:i(r,"prologue"),mobile:i(r,"mobile"),bpmnProcessIdAndStartToken:i(r,"bpmnProcessIdAndStartToken"),cssVars:C,state:I,isSmall:k,isDefault:x,vaa07:_,sessionId:R,axiosInstance:m,$dialog:v,emit:y,appendMessage:j,sendMessage:async function(e={}){var t,o,n,s,i,a,l,m,f;if(r.isStreamingOutput)return void function(e={}){j({fromMe:!0,msgId:u(),contents:[{role:"user",content:I.sendContent}]});const{opType:t}=e,o={...e};t&&["recommend_treatment_plan","recommend_diagnosis","recommend_examination"].includes(t)&&Object.assign(o,{contents:[{role:"user",content:I.sendContent,contentType:"text"}]}),g({state:I,props:r,appendMessage:j,params:o,emit:y,formatProcessInfo:q})}(e);I.loading=!0;const{opType:h}=e,P={...e};if(!h&&I.sendContent&&I.record.unshift({msgId:u(),contents:[{role:"user",content:I.sendContent}]}),b.value&&(b.value.scrollTop=0),h&&["recommend_treatment_plan","recommend_diagnosis","recommend_examination"].includes(h)){if(I.record.length>0){const e=I.record.find((e=>{var t;return!function({role:e=""}){return"user"===e}(null==(t=null==e?void 0:e.contents)?void 0:t[0])}));e&&Object.assign(P,d(e))}Object.assign(P,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const e=await p({contents:[{role:"user",content:I.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:r.configs,switchFlag:I.switchFlag?1:0,...P});if(["diagnosis","medical_order"].includes(h)&&I.showRightSlot){let e="cliRefreshDiagnosis";"medical_order"===h&&(e="cliRefreshMedical"),y("program",{key:e,type:"refresh",params:{}})}c(e.contents)&&e.contents.length>1&&e.contents.reverse(),j(e),h&&["create_inquiry","create_medical"].includes(h)&&("create_inquiry"===h?"retry_inquiry"!==(null==(o=null==(t=null==e?void 0:e.contents)?void 0:t[0])?void 0:o.messageType)&&(null==(a=null==(i=null==(s=null==(n=null==e?void 0:e.contents)?void 0:n[0])?void 0:s.content)?void 0:i.details)?void 0:a.autoBackFillData)&&(I.consultationContent=e,I.showRight=!0):y("program",{key:"medical",params:{vac01:null==(l=r.configs)?void 0:l.vac01,type:1}})),h&&"create_inquiry"!==h||(I.sendContent="")}catch(e){console.log("error ==>",e),e.message&&v.error({title:"错误提示",maskClosable:!1,content:(null==(m=e.message)?void 0:m.includes("Network Error"))?"网络连接失败":"对话连接失败",positiveText:(null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.27"))||"确定"})}finally{I.loading=!1,I.loadingText=""}},toFinishProgram:w,toNext:P,toReplyAiConditions:T,formatProcessInfo:q}}const b=()=>r(y);export{y as InjectionAIChatData,v as initData,b as useData};
@@ -0,0 +1,38 @@
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
+ };
@@ -0,0 +1 @@
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{cloneDeep as t,isString as n}from"lodash-es";import{ref as o,computed as a,onBeforeUnmount as l}from"vue";import{callbackApi as u}from"../api/index.js";import{useData as s}from"./useData.js";import"../../../audio-sdk/index.js";import i from"../../../audio-sdk/src/audioSDK.js";function r(){const{shortcutList:r,state:d,isSmall:c,audioTimed:m,commandList:v,isDefault:f,showLBtn:p,disabled:h,isStreamingOutput:g,emit:y,sendMessage:C,toReplyAiConditions:k,appendMessage:D,cssVars:S}=s(),b=o(!1),I=o([]),w=o(t(v.value||[])),x=o(""),A=o(!1),M=a((()=>f.value&&h.value)),K=a((()=>M.value||d.loading||!d.sendContent.replace(/(&nbsp;|\s|<br>)+/g,"")));function L(){var e;b.value=!1,w.value=t(v.value||[]),I.value=[],(null==(e=v.value)?void 0:e.length)&&(b.value=!0,x.value=w.value[0].shortcutId)}function T(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function j(){var t;if(!K.value)if(f.value){if(null==(t=d.needSubmitMsg)?void 0:t.programData){k({programData:d.needSubmitMsg.programData,params:{data:d.sendContent}}),d.needSubmitMsg.programData=null;const t={fromMe:!0,msgId:e(),contents:[{role:"user",content:d.sendContent}]};return D(t),void u(t)}C()}else d.sending=!0,d.loading=!0}function _(e){var t;x.value=e.shortcutId,(null==(t=e.children)?void 0:t.length)?(w.value=e.children,x.value=w.value[0].shortcutId,I.value.push(e)):(d.selectedCommand=e||{},b.value=!1,d.sendContent="")}return l((()=>{i.destroy()})),{state:d,shortcutList:r,getShortcutName:function(e){var t;if(n(e))return e;if(f.value)return e.value;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return null==o?void 0:o.instructionName},isAllDisabled:M,isStreamingOutput:g,handleShortcut:function(e){var t,o;if(n(e))return o=e,void(d.sendContent=o);if(g.value)return function(e){d.loadingText="",d.sendContent=e.value,C({opType:e.key})}(e);if(f.value&&e.key)return function(e){const t={recommend_treatment_plan:"参考诊断结果与患者个体信息,正全面梳理知识库和临床指南,综合考量为您匹配最适宜的诊疗方案推荐",recommend_examination:"依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目",recommend_diagnosis:"系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录"}[e.key];if(!t)return y("program",{key:e.key});d.loadingText=t,C({opType:e.key})}(e);const a=null==(t=null==e?void 0:e.contents)?void 0:t[0];y("button-click",{msgItem:a,item:e})},showPopover:b,handleKeyDown:function(e){if(f.value)"Enter"!==e.key||T(e)||(e.preventDefault(),j());else if(!["Slash","NumpadDivide"].includes(e.code)||d.selectedCommand||d.sendContent)if("Backspace"===e.key)b.value=!1,!d.sendContent.startsWith("/")&&!d.sendContent.startsWith("、")||2!==d.sendContent.length||d.selectedCommand?!d.sendContent&&d.selectedCommand&&(e.preventDefault(),d.selectedCommand=null,d.sendContent="/",L()):L();else if(b.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=w.value.findIndex((e=>e.shortcutId===x.value));if("ArrowUp"===e.key){const e=t>0?t-1:w.value.length-1;x.value=w.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<w.value.length-1?t+1:0;x.value=w.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!T(e))if(e.preventDefault(),b.value){_(w.value.find((e=>e.shortcutId===x.value)))}else j()}else b.value=!1;else L()},handleInput:function(e){!e&&d.selectedPrompt&&(d.selectedPrompt=null)},btnDisabled:K,showAudio:A,handleSend:j,breadcrumb:I,currentShortcutId:x,currentCommand:w,clickMenu:_,audioTimed:m,showLBtn:p,isDefault:f,commandList:v,isSmall:c,cssVars:S}}export{r as useFooterContext};
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1 @@
1
+ import{computed as n,nextTick as o}from"vue";import{$message as e,formatType as t,isValidJSON as s}from"../utils/index.js";import{uuidGenerator as i}from"../../../../shared/utils/index.js";import{callbackApi as r}from"../api/index.js";import{useIntervalFn as a,useThrottleFn as c}from"@vueuse/core";import{format as l}from"date-fns";const d={inquiry:"问诊记录",medical:"电子病历",diagnosis:"推荐诊断",diagnosis_added:"检验检查",treatment_plan:"治疗方案",report_message:"报告",medical_added:"开立单"};function m({props:m,state:g,appendMessage:p,emit:u,chatMainRef:y}){let f=0;const{pause:v,resume:T}=a((()=>{f++}),1e3),b=c((()=>{y.value&&(y.value.scrollTop=0)}),2e3),w=n((()=>{var n;return{appCode:m.appCode,sessionId:m.sessionId||(null==(n=m.configs)?void 0:n.vaa07)}}));function I(n){console.log("编排提交 ==> bpmnProcessId",g.bpmnProcessId,n),g.loading=!0,window._programArrange.replyAiConditions(g.bpmnProcessId,n)}function P(){v(),f=0}return{toNext:function(n,o){var t;g.bpmnProcessDoing=!0;const s=n||g.bpmnProcessId;console.log("toNext ==>",s),"function"==typeof(null==(t=window._programArrange)?void 0:t.next)&&window._programArrange.next({bpmnProcessId:n,startToken:n?"":g.startToken,variables:o,programTaskSetting:{showLoading:!1}},(n=>{var o,t;g.bpmnProcessDoing=!1,console.log("获取回调数据:",n),P(),g.loading=!1,(null==(o=null==n?void 0:n.data)?void 0:o.msg)&&e.error(null==(t=null==n?void 0:n.data)?void 0:t.msg),console.log("_bpmnProcessId ==>",s),window._programArrange.removeAiConditions((null==n?void 0:n.programArrangeId)||s)}))},toBindAiConditions:function(){console.log("toBindAiConditions ==>");let n=!0;window._programArrange.bindAiConditions(g.bpmnProcessId,(async e=>{var a,c,m,y;console.log("---获取AI数据",e);const{programData:v,config:_={}}=e||{},{webType:k,renderType:A,renderContent:h,content:j={}}=_;if("ai"!==k&&(g.loading=!1),"error"===k)return g.bpmnProcessDoing=!1,P(),void(n=!0);const x=i();if("render"===k){const n={msgId:x,...w.value};if(0==A){const{messageType:e,json:s,title:i}=t(h);if(e&&Object.keys(d).includes(e)){Object.assign(n,{contents:[{role:"system",content:s,contentType:"json",messageType:e}]}),p({...n,__title:i}),"inquiry"===e?(null==(a=s.details)?void 0:a.autoBackFillData)&&(g.showRight=!1,await o(),g.consultationContent=n,g.showRight=!0):"medical"===e&&u("program",{key:"medical",params:{},type:1}),I({programData:v,params:{data:s}});const t=await r(n);return void((null==t?void 0:t.id)&&"inquiry"===e&&g.showRight&&(g.consultationContent.id=t.id))}Object.assign(n,{contents:[{role:"system",content:h,contentType:"text"}]})}else{if(4==A)return Object.assign(n,{contents:[{role:"system",content:h,contentType:"text"}]}),g.needSubmitMsg={programData:v},p(n),void r(n);1==A?Object.assign(n,{contents:[{role:"system",content:_,contentType:"json",messageType:"card"}]}):2==A?Object.assign(n,{contents:[{role:"system",content:h,contentType:"text"}]}):3==A&&Object.assign(n,{contents:[{role:"system",content:{info:_.linkTitle||"",creationTime:l(new Date,"yyyy-MM-dd HH:mm:ss"),linkType:null!=(c=_.linkType)?c:0,linkURL:_.linkURL||"",linkProcess:_.linkProcess||"",linkParams:_.linkParams||{}},contentType:"json",messageType:"link"}]})}return p(n),r(n),void I({programData:v})}if("form"===k){const n={msgId:x,contents:[{role:"system",content:_,contentType:"json",messageType:k,__programData:v}],...w.value};return p(n),void r(n)}if("ai"!==k);else if(s(j.data)){const o=JSON.parse(j.data),{finish_reason:e="",delta:t={}}=(null==(m=o.choices)?void 0:m[0])||{},{content:s="",role:i}=t;let a=g.record[0];if(n)f=0,T(),g.loading=!0,a={msgId:x,contents:[{role:"system",content:s,contentType:"text"}],...w.value},p(a),n=!1;else if(a.contents[0].content+=s,g.record.splice(0,1,a),b(),console.log("AI渲染ing ==>",g.record[0]),"stop"===e){const o=g.record.find((n=>n.msgId===a.msgId));(null==(y=null==o?void 0:o.contents)?void 0:y.length)&&(o.contents[0].__showMore=!0,o.contents[0].msgSource=i,o.contents[0].countTime=f),P(),g.loading=!1,r(o),I({programData:v,params:{data:a.contents[0].content}}),n=!0,console.log("AI渲染完成 ==>",g.record[0])}}}))},toReplyAiConditions:I,toFinishProgram:function(n){var o;console.log("结束本次流程 ==> bpmnProcessId",n),g.bpmnProcessDoing=!1,n&&(null==(o=window._programArrange)||o.finishProgram(n))}}}export{m as useProgram};
@@ -0,0 +1,9 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ export declare function useSSE({ state, props, appendMessage, params, emit, formatProcessInfo }: {
3
+ state: AnyObject;
4
+ props: AnyObject;
5
+ appendMessage: Function;
6
+ params: AnyObject;
7
+ emit: (event: 'button-click' | 'program', ...args: any[]) => void;
8
+ formatProcessInfo: (str: string) => void;
9
+ }): void;
@@ -0,0 +1 @@
1
+ import{fetchEventSource as o}from"@microsoft/fetch-event-source";import{isArray as e,isString as n}from"lodash-es";import{isValidJSON as t,$message as s}from"../utils/index.js";import{uuidGenerator as r}from"../../../../shared/utils/index.js";function i({state:i,props:l,appendMessage:a,params:d,emit:c,formatProcessInfo:p}){var g,f;const{opType:m,firstSubmit:u}=d;let h=!1;const y=i.inquiryStr&&!u?`${i.inquiryStr}\n完善信息\n${i.sendContent}`:i.sendContent,v=i.inquiryStr&&!u?{multContents:[{role:"user",content:i.sendContent,contentType:"text"}]}:{};u&&(i.inquiryStr="");const S=null==(g=i.record.find((o=>o.msgId&&!o.fromMe)))?void 0:g.msgId;i.loading=!0,o("/flow/ai/api/conversation",{method:"POST",headers:{Authorization:"bearer "+l.token,"Content-Type":"application/json"},body:JSON.stringify({appCode:l.appCode,appId:0,conversationMode:"",extra:{},model:"",msgId:"",parentMsgId:S,platform:"",requestId:r(),sessionId:l.sessionId||(null==(f=l.configs)?void 0:f.vaa07),sessionType:"",shortcutFlag:!0,traceId:"",contents:[{role:"user",content:y,contentType:"text"}],...v,configs:l.configs,...d}),async onopen(o){console.log("onopen ==>","连接已打开",o),h=!0},onmessage(o){var s,r,l,d;if(console.log("event ==>",o),i.loading=!1,!t(o.data))return;const g=JSON.parse(o.data),{result:f,contents:u}=g;if(console.log("result ==>",f,"contents ==>",u),e(u)&&u.length>0){if("json"===(null==(s=u[0])?void 0:s.contentType))return void a(g);if("text"===(null==(r=u[0])?void 0:r.contentType)){h&&(a(g),h=!1);const{content:o}=(null==(d=null==(l=i.record[0])?void 0:l.contents)?void 0:d[0])||{};n(o)&&(i.record[0].contents[0].content+=u[0].content)}}if(p(f),n(u)&&"STOP"===u){if(i.loading=!1,i.sendContent="",["diagnosis","medical_order"].includes(m)&&i.showRightSlot){let o="cliRefreshDiagnosis";"medical_order"===m&&(o="cliRefreshMedical"),c("program",{key:o,type:"refresh",params:{}})}"create_medical"===m&&(i.showRight=!1,i.showRightSlot=!1)}console.log("state.startToken ==>",i.startToken)},onclose(){console.log("onclose ==>","连接关闭"),i.loading=!1,i.sendContent=""},onerror(o){throw console.log("onerror ==>",o),i.loading=!1,s.error("对话连接失败!"),Error(o)},openWhenHidden:!0})}export{i as useSSE};
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
3
+ import { initData } from './useData';
4
+ export declare function useWebsocket(props: AnyObject, data: ReturnType<typeof initData>, sessionId: Ref<string>): void;
@@ -0,0 +1 @@
1
+ import{watch as o,onBeforeUnmount as e}from"vue";import{isValidJSON as n}from"../utils/index.js";function l(l,t,s){let c=!1,a=null;o((()=>s.value),(o=>{(null==a?void 0:a.readyState)!==WebSocket.CLOSED&&(null==a||a.close()),a=null,c=!1,function(){if(l.appCode&&s.value)try{c=!1;const{appendMessage:o}=t,e=window.location.protocol,i=`${"https:"===e?"wss:":"ws:"}//${window.location.host}/flow/ai/app/${l.appCode}_${s.value}`;a=new WebSocket(i),a.onopen=()=>{c=!0,console.log("0 websocket连接成功 ==>")},a.onerror=()=>console.log("WebSocket连接失败"),a.onmessage=e=>{const{data:l}=e||{};if(!n(l))return;const t=JSON.parse(l);o(t||{})},async function o(e=0){return e>5?console.log("websocket连接失败 ==>"):c?console.log("websocket连接成功 ==>"):void setTimeout((()=>{o(++e)}),100)}()}catch(o){console.log("error ==>",o)}}()}),{immediate:!0}),e((()=>{null==a||a.close(),a=null}))}export{l as useWebsocket};
@@ -1,7 +1,5 @@
1
- import { InjectionKey, VNodeChild } from 'vue';
1
+ import { VNodeChild } from 'vue';
2
2
  import { AnyObject } from '../../../../shared/types';
3
- export declare const InjectionAIChat: InjectionKey<AnyObject>;
4
- export declare const InjectionAIChatEmits: InjectionKey<(event: string, ...args: any[]) => void>;
5
3
  export type MessageItem = {
6
4
  role: string;
7
5
  contentType: 'json' | 'text';
@@ -1 +1 @@
1
- const t=Symbol("InjectionAIChat"),o=Symbol("InjectionAIChatEmits");export{t as InjectionAIChat,o as InjectionAIChatEmits};
1
+
@@ -1 +1,7 @@
1
+ export declare const $message: import("naive-ui").MessageApi, $dialog: unknown;
1
2
  export declare function isValidJSON(str: string): boolean;
3
+ export declare function formatType(str: string): {
4
+ messageType: string;
5
+ json: {};
6
+ title: string;
7
+ };
@@ -1 +1 @@
1
- function r(r){try{return JSON.parse(r),!0}catch(r){return!1}}export{r as isValidJSON};
1
+ import{createDiscreteApi as e}from"naive-ui";const{message:s,dialog:t}=e(["message"]);function n(e){try{return!!e&&(JSON.parse(e),!0)}catch(e){return!1}}function o(e){const s={messageType:"",json:{},title:""},t=e.match(/##(.*?)##(.*)/);if(t){const o=e.split("##");if(4===o.length)s.title=o[2],s.messageType=o[1],s.json=n(o[3])?JSON.parse(o[2]):{};else{const e=t[1],o=t[2];s.messageType=e,s.json=n(o)?JSON.parse(o):{}}}return s}export{t as $dialog,s as $message,o as formatType,n as isValidJSON};