cnhis-design-vue 3.3.1-beta.3 → 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 (248) hide show
  1. package/es/components/ai-chat/index.d.ts +289 -68
  2. package/es/components/ai-chat/src/Index.vue.d.ts +289 -68
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/api/index.d.ts +5 -3
  5. package/es/components/ai-chat/src/api/index.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +9 -15
  7. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
  9. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
  10. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  11. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +46 -55
  12. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  13. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  14. package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
  15. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
  16. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  17. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
  18. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  19. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +6 -5
  20. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
  21. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
  22. package/es/components/ai-chat/src/components/{card/SelectIcon.d.ts → message-render/CardRender.d.ts} +9 -7
  23. package/es/components/ai-chat/src/components/message-render/CardRender.js +1 -0
  24. package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +16 -0
  25. package/es/components/ai-chat/src/components/message-render/FormRender.js +1 -0
  26. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +36 -0
  27. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +1 -0
  28. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +1 -0
  29. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +105 -0
  30. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +1 -0
  31. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +1 -0
  32. package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +1 -0
  33. package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +1 -0
  34. package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +1 -0
  35. package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +1 -0
  36. package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
  37. package/es/components/ai-chat/src/hooks/index.js +1 -0
  38. package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +18 -0
  39. package/es/components/ai-chat/src/hooks/useChartAudioContext.js +1 -0
  40. package/es/components/ai-chat/src/hooks/useData.d.ts +77 -0
  41. package/es/components/ai-chat/src/hooks/useData.js +1 -0
  42. package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +38 -0
  43. package/es/components/ai-chat/src/hooks/useFooterContext.js +1 -0
  44. package/es/components/ai-chat/src/hooks/useProgram.d.ts +12 -4
  45. package/es/components/ai-chat/src/hooks/useProgram.js +1 -1
  46. package/es/components/ai-chat/src/hooks/useSSE.d.ts +9 -0
  47. package/es/components/ai-chat/src/hooks/useSSE.js +1 -0
  48. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +3 -1
  49. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
  50. package/es/components/ai-chat/src/types/index.d.ts +1 -3
  51. package/es/components/ai-chat/src/types/index.js +1 -1
  52. package/es/components/ai-chat/src/utils/index.d.ts +6 -1
  53. package/es/components/ai-chat/src/utils/index.js +1 -1
  54. package/es/components/ai-chat/style/index.css +1 -1
  55. package/es/components/audio-sdk/index.d.ts +274 -2
  56. package/es/components/audio-sdk/index.js +1 -1
  57. package/es/components/audio-sdk/src/Index.vue.d.ts +274 -0
  58. package/es/components/audio-sdk/src/Index.vue.js +1 -0
  59. package/es/components/audio-sdk/src/Index.vue2.js +1 -0
  60. package/es/components/audio-sdk/src/audioSDK.d.ts +59 -26
  61. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  62. package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
  63. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +100 -0
  64. package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
  65. package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
  66. package/es/components/audio-sdk/src/components/recording.vue.d.ts +53 -4
  67. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  68. package/es/components/audio-sdk/src/utils/index.d.ts +7 -0
  69. package/es/components/audio-sdk/src/utils/index.js +1 -0
  70. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
  71. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  72. package/es/components/audio-sdk/style/index.css +1 -1
  73. package/es/components/button-print/index.d.ts +30 -0
  74. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
  75. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  76. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
  77. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  78. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  79. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  80. package/es/components/button-print/src/utils/print.d.ts +2 -2
  81. package/es/components/button-print/src/utils/print.js +1 -1
  82. package/es/components/calendar/index.d.ts +126 -3
  83. package/es/components/calendar/src/Calendar.vue.d.ts +126 -2
  84. package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
  85. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -8
  86. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  87. package/es/components/card-render/src/components/Button.vue.d.ts +3 -0
  88. package/es/components/card-render/src/components/Button.vue2.js +1 -1
  89. package/es/components/card-render/src/components/ScaleView.vue.d.ts +39 -0
  90. package/es/components/card-render/src/components/ScaleView.vue.js +1 -0
  91. package/es/components/card-render/src/components/ScaleView.vue2.js +1 -0
  92. package/es/components/card-render/src/components/Table.vue.d.ts +104 -0
  93. package/es/components/card-render/src/components/Table.vue.js +1 -0
  94. package/es/components/card-render/src/components/Table.vue2.js +1 -0
  95. package/es/components/card-render/src/components/Text.vue.d.ts +1 -0
  96. package/es/components/card-render/src/components/Text.vue2.js +1 -1
  97. package/es/components/card-render/src/components/index.d.ts +139 -0
  98. package/es/components/card-render/src/components/index.js +1 -1
  99. package/es/components/card-render/src/constants/index.d.ts +4 -1
  100. package/es/components/card-render/src/constants/index.js +1 -1
  101. package/es/components/card-render/style/index.css +1 -1
  102. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  103. package/es/components/fabric-chart/index.d.ts +6 -2
  104. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +6 -2
  105. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  106. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  107. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  108. package/es/components/field-editor/index.d.ts +7 -1
  109. package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
  110. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  111. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  112. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  113. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  114. package/es/components/form-config/index.d.ts +73 -13
  115. package/es/components/form-config/src/FormConfig.vue.d.ts +73 -13
  116. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
  117. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +45 -9
  118. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +15 -3
  119. package/es/components/form-render/index.d.ts +7 -1
  120. package/es/components/form-render/index.js +1 -1
  121. package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
  122. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  123. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
  124. package/es/components/form-render/src/components/renderer/date.d.ts +4 -2
  125. package/es/components/form-render/src/components/renderer/date.js +1 -1
  126. package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
  127. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  128. package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
  129. package/es/components/form-render/src/components/renderer/input.js +1 -1
  130. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +9 -0
  131. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  132. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
  133. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
  134. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  135. package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
  136. package/es/components/form-render/src/components/renderer/select.js +1 -1
  137. package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
  138. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  139. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  140. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  141. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
  142. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  143. package/es/components/form-render/src/types/fieldItem.d.ts +9 -3
  144. package/es/components/form-render/src/types/index.d.ts +2 -0
  145. package/es/components/form-render/src/utils/index.d.ts +1 -0
  146. package/es/components/form-render/src/utils/index.js +1 -1
  147. package/es/components/form-render/style/index.css +1 -1
  148. package/es/components/guide/src/renderer.d.ts +2 -2
  149. package/es/components/iho-chat/index.d.ts +206 -4
  150. package/es/components/iho-chat/src/Index.vue.d.ts +206 -4
  151. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  152. package/es/components/iho-chat/src/api/index.js +1 -1
  153. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +8 -0
  154. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  155. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -3
  156. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  157. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +7 -0
  158. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  159. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +96 -2
  160. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -0
  161. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  162. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +71 -1
  163. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  164. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +8 -2
  165. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  166. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
  167. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  168. package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +70 -1
  169. package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -1
  170. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +7 -0
  171. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
  172. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  173. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
  174. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  175. package/es/components/iho-chat/src/constants/index.d.ts +9 -2
  176. package/es/components/iho-chat/src/constants/index.js +1 -1
  177. package/es/components/iho-chat/src/hooks/useSearchPatientList.d.ts +11 -0
  178. package/es/components/iho-chat/src/hooks/useSearchPatientList.js +1 -0
  179. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  180. package/es/components/iho-chat/src/utils/index.d.ts +6 -0
  181. package/es/components/iho-chat/src/utils/index.js +1 -1
  182. package/es/components/iho-chat/style/index.css +1 -1
  183. package/es/components/iho-table/index.d.ts +3 -0
  184. package/es/components/iho-table/index.js +1 -1
  185. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  186. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
  187. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  188. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
  189. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  190. package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
  191. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  192. package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
  193. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  194. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  195. package/es/components/iho-table/src/plugins/index.d.ts +79 -3
  196. package/es/components/iho-table/src/plugins/index.js +1 -1
  197. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
  198. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
  199. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  200. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
  201. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  202. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  203. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  204. package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
  205. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
  206. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  207. package/es/components/iho-table/src/types/index.d.ts +1 -0
  208. package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
  209. package/es/components/iho-table/src/utils/index.js +1 -1
  210. package/es/components/index.css +1 -1
  211. package/es/components/index.d.ts +2 -1
  212. package/es/components/index.js +1 -1
  213. package/es/components/info-header/index.d.ts +24 -2
  214. package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
  215. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  216. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  217. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
  218. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
  219. package/es/components/scale-view/index.d.ts +17 -3
  220. package/es/components/scale-view/src/ScaleView.vue.d.ts +17 -3
  221. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  222. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +1 -1
  223. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  224. package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
  225. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  226. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  227. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  228. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
  229. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  230. package/es/components/shortcut-setter/index.d.ts +15 -3
  231. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -3
  232. package/es/components/steps-wheel/index.d.ts +18 -0
  233. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +18 -0
  234. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  235. package/es/shared/assets/img/use.png.js +1 -1
  236. package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
  237. package/es/shared/components/ArrowIcon/index.d.ts +2 -0
  238. package/es/shared/components/ArrowIcon/index.js +1 -0
  239. package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
  240. package/es/shared/components/DateIcon/index.d.ts +2 -0
  241. package/es/shared/components/DateIcon/index.js +1 -0
  242. package/es/shared/hooks/useLevelSearchCascader.d.ts +1 -0
  243. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  244. package/es/shared/package.json.js +1 -1
  245. package/package.json +5 -3
  246. package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
  247. package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
  248. /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -1 +1 @@
1
- import{defineComponent as t,inject as e,computed as o,openBlock as n,createBlock as a,unref as s,withCtx as i,createVNode as d,mergeProps as r,createCommentVNode as u}from"vue";import{NDrawer as l,NDrawerContent as m}from"naive-ui";import{InjectionAIChatEmits as p,InjectionAIChat as c}from"../types/index.js";import"../../../index.js";import{isValidJSON as f}from"../utils/index.js";import h from"../../../card-render/index.js";var v=t({__name:"ChatBI",props:{show:{type:Boolean},data:{type:Object}},emits:["update:show"],setup(t,{emit:v}){const g=t,w=e(p),{state:j}=e(c),k=o((()=>{var t,e,o;const{content:n={}}=(null==(t=g.data)?void 0:t.msgItem)||{};return{config:f(null==(e=n.settings)?void 0:e.setting)?JSON.parse(null==(o=n.settings)?void 0:o.setting):null,data:n.data}}));function x(t){const{eventName:e,data:o}=t;v("update:show",!1),e&&w("button-click",{buttonInfo:o,isBI:!0,...g.data})}return(e,o)=>(n(),a(s(l),{placement:"bottom",height:"80%","trap-focus":!1,to:"#"+s(j).id,show:t.show,onMaskClick:o[0]||(o[0]=()=>v("update:show",!1))},{default:i((()=>[d(s(m),null,{default:i((()=>[t.data?(n(),a(s(h),r({key:0},s(k),{onModuleClick:x}),null,16)):u("v-if",!0)])),_:1})])),_:1},8,["to","show"]))}});export{v as default};
1
+ import{defineComponent as t,computed as o,openBlock as e,createBlock as a,unref as n,withCtx as s,createVNode as i,mergeProps as u,createCommentVNode as r}from"vue";import{NDrawer as d,NDrawerContent as l}from"naive-ui";import m from"../../../card-render/index.js";import{isValidJSON as p}from"../utils/index.js";import{useData as c}from"../hooks/useData.js";var f=t({__name:"ChatBI",props:{show:{type:Boolean},data:{type:Object}},emits:["update:show"],setup(t,{emit:f}){const h=t,{state:v,emit:g}=c(),w=o((()=>{var t,o,e;const{content:a={}}=(null==(t=h.data)?void 0:t.msgItem)||{};return{config:p(null==(o=a.settings)?void 0:o.setting)?JSON.parse(null==(e=a.settings)?void 0:e.setting):null,data:a.data}}));function k(t){const{eventName:o,data:e}=t;f("update:show",!1),o&&g("button-click",{buttonInfo:e,isBI:!0,...h.data})}return(o,p)=>(e(),a(n(d),{placement:"bottom",height:"80%","trap-focus":!1,to:"#"+n(v).id,show:t.show,onMaskClick:p[0]||(p[0]=()=>f("update:show",!1))},{default:s((()=>[i(n(l),null,{default:s((()=>[t.data?(e(),a(n(m),u({key:0},n(w),{onModuleClick:k}),null,16)):r("v-if",!0)])),_:1})])),_:1},8,["to","show"]))}});export{f as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as a,reactive as l,computed as n,watch as o,createVNode as i}from"vue";import{NForm as s,NFormItem as r,NInput as u,NIcon as d,NButton as c}from"naive-ui";import{InjectionAIChat as v}from"../types/index.js";import"../../../index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as h,ChevronForward as b}from"@vicons/ionicons5";import{useTheme as y}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import{instanceAxios as E}from"../api/index.js";import k from"../../../form-render/index.js";import I from"../../../card-render/index.js";var x=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:x,slots:C,emit:_}){const T={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},P=y(),{patientInfo:w,state:O,isSmall:j,appId:S}=t(v),M=a([]),R=a(),L=a(),N=l({vaa05:""}),F=a(),q=n((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),A=e.msgItem.content,H={},B=l(p(A.data||{})),K={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=A.body||{},a=null==(n=(l=R.value).getFormValues)?void 0:n.call(l);Object.keys(t.params).forEach((l=>{const n=e.find((e=>e.code===l));"vaa05"===l?t.params.vaa05=L.value.selectedPatient.vaa01:Reflect.has(a,l)?t.params[l]=a[l]:n&&(t.params[l]=n.value)}))}t&&Reflect.has(t,"configs")&&(t.configs=L.value.selectedPatient)}};function U(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function D(e){B[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}if(q.value){const t=A.body.items||[],a=t.some((e=>"vaa05"===e.code));M.value=t.filter((e=>e.showFlag)).map((t=>{var l,n,o;if("vaa05"===t.code&&!j.value)return L.value={...t},t._value?N.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(N.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,L.value.selectedPatient=e.configs),null;const i={html_type:T[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(o=t.labelField)?o:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(i.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===i.html_type){if(i.componentProps={fallbackOption:!1},i.option=t.options||[],i.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(i.default_val=t.value)}if(Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:j.value?"inner":"global",...j.value?{appId:S.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=w.value.info||O.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,i.urlConfig.params.params={},e.forEach((e=>{i.urlConfig.params.params[e]=""}))}}return i})).filter((e=>!!e))}function J(){var t;if(!L.value)return null;function a(){e.msgItem.disabled||(O.showPatient=!0)}return i(s,{class:"form-render",ref:F,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:N,rules:{vaa05:{required:L.value.required,message:L.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[i(r,{label:L.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[i(u,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:N.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>i(d,{color:"#c2c2c2",component:h},null)})]}})]})}async function V(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),A.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=O.selectedPatientLabel,e.value=L.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=H[e.code])?void 0:t[0])&&(e.options=H[e.code])})),O.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=L.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){O.loading=!1}}function z(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(H[n]=[null==a?void 0:a.currentOption])}function X(){_("button-click",{showMore:!0})}function G(){var e;if("1834043761964638208"!==(null==(e=A.settings)?void 0:e.id)||!A.data)return null;const t=JSON.parse(A.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(A.data[l])||JSON.parse(A.data[l]).length<=5?null:(g(B[l])&&(B[l]=JSON.parse(B[l]).slice(0,5)),i(c,{block:!0,text:!0,"icon-placement":"right",color:P.value["--c-primary-color"],style:"margin-top: 10px",onClick:X},{icon:()=>i(d,{component:b},null),default:()=>"查看更多"}))}return o((()=>O.showPatient),(t=>{!e.msgItem.disabled&&q.value&&!t&&O.selectedPatientLabel&&L.value&&(N.vaa05=O.selectedPatientLabel,L.value.selectedPatient={...O.selectedPatientForm})})),()=>{var t;return i("div",{class:"card"},[q.value?[i("p",null,[A.title||A.header.title]),i("div",{class:"form-box"},[[J(),i(k,{"request-instance":{get:E.get,post:E.post},"life-cycle":K,column:12,ref:R,"field-list":M.value,onFormChange:z},null)]]),A.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=q.value?{...a,marginTop:"0"}:a;return i(c,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(q.value){if(!R.value)return;try{L.value?null==(e=F.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:L.value.selectedPatient.vaa01}),await V(t,e)}})):await V(t)}catch(e){}}else _("button-click")}},{default:()=>[q.value?null==t?void 0:t.text:A.buttonName]})}(t)))]:[i(I,{config:g(null==(t=A.settings)?void 0:t.setting)?JSON.parse(A.settings.setting):null,data:B,"onModule-click":U,"onButton-click":D},null),G()]])}}});export{x as default};
1
+ import{defineComponent as e,ref as t,reactive as a,computed as l,watch as n,createVNode as o}from"vue";import{NForm as i,NFormItem as s,NInput as r,NIcon as u,NButton as d}from"naive-ui";import c from"../../../form-render/index.js";import v from"../../../card-render/index.js";import{cloneDeep as p,isArray as m,omit as f}from"lodash-es";import{isValidJSON as g}from"../utils/index.js";import{ChevronDown as b,ChevronForward as y}from"@vicons/ionicons5";import{useData as h}from"../hooks/useData.js";var E=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object},configs:{type:Object},msgId:{type:String}},emits:["button-click"],setup(e,{attrs:E,slots:I,emit:_}){const k={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATE",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},{cssVars:C,patientInfo:T,state:x,axiosInstance:P,isSmall:w,appId:O}=h(),M=t([]),R=t(),S=t(),j=a({vaa05:""}),L=t(),N=l((()=>{var t,a;return!!(null==(a=null==(t=e.msgItem)?void 0:t.content)?void 0:a.body)})),F=e.msgItem.content,q={},A=a(p(F.data||{})),B={beforeRequest(e,t,a){var l,n;if(null==t?void 0:t.params){const{items:e=[]}=F.body||{},a=null==(n=(l=R.value).getFormValues)?void 0:n.call(l);Object.keys(t.params).forEach((l=>{const n=e.find((e=>e.code===l));"vaa05"===l?t.params.vaa05=S.value.selectedPatient.vaa01:Reflect.has(a,l)?t.params[l]=a[l]:n&&(t.params[l]=n.value)}))}t&&Reflect.has(t,"configs")&&(t.configs=S.value.selectedPatient)}};function H(e){const{eventName:t,data:a}=e;t&&_("button-click",{buttonInfo:a,isBI:!0})}function K(e){A[e.button.id+"Disabled"]="1",_("button-click",{buttonInfo:{...f(e.button,["props"]),data:e.data}})}if(N.value){const t=F.body.items||[],a=t.some((e=>"vaa05"===e.code));M.value=t.filter((e=>e.showFlag)).map((t=>{var l,n,o;if("vaa05"===t.code&&!w.value)return S.value={...t},t._value?j.vaa05=t._value:(null==(l=t.options)?void 0:l.length)&&t.value&&(j.vaa05=null==(n=t.options.find((e=>e.value===t.value)))?void 0:n.label,S.value.selectedPatient=e.configs),null;const i={html_type:k[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(o=t.labelField)?o:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("DATETIME"===t.type&&(i.date_format="yyyy-MM-dd HH:mm:ss"),"REMOTE_SEARCH"===i.html_type){if(i.componentProps={fallbackOption:!1},i.option=t.options||[],i.default_val=null,t.value&&m(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(i.default_val=t.value)}if(Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:w.value?"inner":"global",...w.value?{appId:O.value}:{}},dependKey:[]}),a&&(i.urlConfig.params.configs=T.value.info||x.selectedPatient),t.dependencies){const e=t.dependencies.split(",");i.urlConfig.dependKey=e,i.urlConfig.params.params={},e.forEach((e=>{i.urlConfig.params.params[e]=""}))}}return i})).filter((e=>!!e))}function U(){var t;if(!S.value)return null;function a(){e.msgItem.disabled||(x.showPatient=!0)}return o(i,{class:"form-render",ref:L,"require-mark-placement":"left",disabled:e.msgItem.disabled,model:j,rules:{vaa05:{required:S.value.required,message:S.value.name+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.146"))||"为必填"),trigger:["input"]}}},{default:()=>[o(s,{label:S.value.name,path:"vaa05",class:"form-render__formItem",style:"--n-feedback-height: 16px; --n-feedback-padding: 0px; --n-feedback-font-size: 12px"},{default:()=>{var e;return[o(r,{style:"--n-text-color-disabled: #000; --n-placeholder-color-disabled: #000;--n-padding-left: 8px; --n-padding-right: 8px",readonly:!0,value:j.vaa05,placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.147"))||"请选择",onClick:a},{suffix:()=>o(u,{color:"#c2c2c2",component:b},null)})]}})]})}async function D(t,a){var l,n;try{const o=a||R.value.getFormValues();await(null==(l=R.value)?void 0:l.validate()),F.body.items.forEach((e=>{var t;"vaa05"===e.code?(e._value=x.selectedPatientLabel,e.value=S.value.selectedPatient.vaa01||e.value):o[e.code]&&(e.value=o[e.code]),e.showFlag||(o[e.code]=e.value),(null==(t=q[e.code])?void 0:t[0])&&(e.options=q[e.code])})),x.loading=!0,_("button-click",{values:o,buttonInfo:t,patient:(null==(n=S.value)?void 0:n.selectedPatient)||e.configs,isForm:!0})}catch(e){x.loading=!1}}function V(e){const{fieldInstance:t,context:a,value:l,fieldKey:n}=e;"REMOTE_SEARCH"===t.componentType&&(null==l?void 0:l.length)&&(q[n]=[null==a?void 0:a.currentOption])}function J(){_("button-click",{showMore:!0})}function z(){var e;if("1834043761964638208"!==(null==(e=F.settings)?void 0:e.id)||!F.data)return null;const t=JSON.parse(F.settings.setting),a=e=>{var t;let l="";for(let n=0;n<e.length;n++){const o=e[n];if(o.setting.scopeKey){l=o.setting.scopeKey;break}if((null==(t=o.childrens)?void 0:t.length)&&(l=a(o.childrens),l))break}return l},l=a(t.templates);return!l||!g(F.data[l])||JSON.parse(F.data[l]).length<=5?null:(g(A[l])&&(A[l]=JSON.parse(A[l]).slice(0,5)),o(d,{block:!0,text:!0,"icon-placement":"right",color:C.value["--c-primary-color"],style:"margin-top: 10px",onClick:J},{icon:()=>o(u,{component:y},null),default:()=>"查看更多"}))}return n((()=>x.showPatient),(t=>{!e.msgItem.disabled&&N.value&&!t&&x.selectedPatientLabel&&S.value&&(j.vaa05=x.selectedPatientLabel,S.value.selectedPatient={...x.selectedPatientForm})})),()=>{var t;return o("div",{class:"card"},[N.value?[o("p",null,[F.title||F.header.title]),o("div",{class:"form-box"},[[U(),o(c,{"request-instance":{get:P.get,post:P.post},"life-cycle":B,column:12,ref:R,"field-list":M.value,onFormChange:V},null)]]),F.footer.buttons.map((t=>function(t){const a={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=N.value?{...a,marginTop:"0"}:a;return o(d,{id:e.msgId,style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){var e;if(N.value){if(!R.value)return;try{S.value?null==(e=L.value)||e.validate((async e=>{var a,l;if(!e){const e=null==(l=(a=R.value).getFormValues)?void 0:l.call(a);Object.assign(e,{vaa05:S.value.selectedPatient.vaa01}),await D(t,e)}})):await D(t)}catch(e){}}else _("button-click")}},{default:()=>[N.value?null==t?void 0:t.text:F.buttonName]})}(t)))]:[o(v,{config:g(null==(t=F.settings)?void 0:t.setting)?JSON.parse(F.settings.setting):null,data:A,"onModule-click":H,"onButton-click":K},null),z()]])}}});export{E as default};
@@ -1,25 +1,20 @@
1
- import { CommandItem } from '../types';
1
+ import { CSSProperties } from 'vue';
2
2
  import { CAudioSDK } from '../../../../components/audio-sdk';
3
- import { AnyObject } from '../../../../shared/types';
4
3
  declare const _default: import("vue").DefineComponent<{}, {
5
- innerDefaultShortcutList: {
6
- key: string;
7
- value: string;
8
- }[];
9
- programMethod: (bpmnProcessId: string, params: AnyObject) => Promise<any>;
10
- MedicalOrderId: string;
11
- cssVars: import("vue").ComputedRef<AnyObject>;
12
- audioSdk: CAudioSDK;
13
- emit: (event: string, ...args: any[]) => void;
14
- shortcutList: any;
15
- state: any;
16
- isSmall: any;
17
- audioTimed: any;
18
- commandList: any;
19
- isInner: any;
20
- patientInfo: any;
21
- inputRef: import("vue").Ref<any>;
4
+ state: import("../../../../shared/types").AnyObject;
5
+ shortcutList: import("vue").Ref<any>;
6
+ getShortcutName: (item: string | import("../../../../shared/types").AnyObject) => any;
7
+ isAllDisabled: import("vue").ComputedRef<any>;
8
+ isStreamingOutput: import("vue").Ref<any>;
9
+ handleShortcut: (item: string | import("../../../../shared/types").AnyObject) => void;
22
10
  showPopover: import("vue").Ref<boolean>;
11
+ handleKeyDown: (event: KeyboardEvent) => void;
12
+ handleInput: (value: string) => void;
13
+ btnDisabled: import("vue").ComputedRef<any>;
14
+ commandList: import("vue").Ref<any>;
15
+ showAudio: import("vue").Ref<boolean>;
16
+ handleSend: () => void;
17
+ isDefault: import("vue").ComputedRef<boolean>;
23
18
  breadcrumb: import("vue").Ref<{
24
19
  [x: string]: any;
25
20
  shortcutTitle: string;
@@ -27,6 +22,7 @@ declare const _default: import("vue").DefineComponent<{}, {
27
22
  shortcutDescription?: string | undefined;
28
23
  children?: any[] | undefined;
29
24
  }[]>;
25
+ currentShortcutId: import("vue").Ref<string>;
30
26
  currentCommand: import("vue").Ref<{
31
27
  [x: string]: any;
32
28
  shortcutTitle: string;
@@ -34,25 +30,23 @@ declare const _default: import("vue").DefineComponent<{}, {
34
30
  shortcutDescription?: string | undefined;
35
31
  children?: any[] | undefined;
36
32
  }[]>;
33
+ clickMenu: (menu: import("../types").CommandItem) => void;
34
+ audioTimed: import("vue").Ref<any>;
35
+ showLBtn: import("vue").Ref<any>;
36
+ isSmall: import("vue").ComputedRef<boolean>;
37
+ cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
38
+ railStyle: ({ focused, checked }: {
39
+ focused: boolean;
40
+ checked: boolean;
41
+ }) => CSSProperties;
42
+ inputRef: import("vue").Ref<any>;
43
+ placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
44
+ audioSdk: CAudioSDK;
45
+ recorderStart: () => Promise<void>;
37
46
  showPrompt: import("vue").Ref<boolean>;
38
- currentShortcutId: import("vue").Ref<string>;
39
47
  showPatient: import("vue").Ref<boolean>;
40
- showAudio: import("vue").Ref<boolean>;
41
- placeholder: import("vue").ComputedRef<"请向我提问,Shift+Enter换行" | "请向我提问或输入\"/\"查看指令" | "请向我提问或输入\"/\"查看指令,Shift+Enter换行">;
42
- btnDisabled: import("vue").ComputedRef<any>;
43
48
  showMagicWand: import("vue").ComputedRef<boolean>;
44
49
  patient: import("vue").ComputedRef<string>;
45
- currentShortcutList: import("vue").ComputedRef<any>;
46
- isAllDisabled: import("vue").ComputedRef<any>;
47
- recorderStart: () => Promise<void>;
48
- getShortcutName: (item: string | AnyObject) => any;
49
- handleShortcut: (item: string | AnyObject) => Promise<void>;
50
- resetCurrentCommand: () => void;
51
- handleKeyDown: (event: KeyboardEvent) => void;
52
- isWrap: (event: KeyboardEvent) => boolean;
53
- handleInput: (value: string) => void;
54
- handleSend: () => void;
55
- clickMenu: (menu: CommandItem) => void;
56
50
  handleBack: () => void;
57
51
  updateShow: (value: boolean) => void;
58
52
  NButton: any;
@@ -62,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{}, {
62
56
  NBreadcrumb: any;
63
57
  NBreadcrumbItem: any;
64
58
  NTag: any;
59
+ NSwitch: any;
65
60
  PaperPlane: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
66
61
  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<{}>>, {}>;
67
62
  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<{}>>, {}>;
@@ -84,16 +79,16 @@ declare const _default: import("vue").DefineComponent<{}, {
84
79
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
85
80
  }>>;
86
81
  emit: (event: "update:show", ...args: any[]) => void;
87
- queryPrompt: any;
88
- state: any;
82
+ state: import("../../../../shared/types").AnyObject;
83
+ queryPrompt: import("vue").Ref<any>;
89
84
  listRef: import("vue").Ref<any>;
90
85
  keyword: import("vue").Ref<string>;
91
- list: import("vue").Ref<AnyObject[]>;
86
+ list: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
92
87
  showNoData: import("vue").ComputedRef<boolean>;
93
88
  handleInput: () => void;
94
89
  handleSearch: () => Promise<void>;
95
90
  resetAndSearch: () => void;
96
- select: (item: AnyObject) => void;
91
+ select: (item: import("../../../../shared/types").AnyObject) => void;
97
92
  NDrawer: any;
98
93
  NDrawerContent: any;
99
94
  NIcon: any;
@@ -123,8 +118,8 @@ declare const _default: import("vue").DefineComponent<{}, {
123
118
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
124
119
  }>>;
125
120
  emit: (event: "update:show", ...args: any[]) => void;
126
- patientInfo: any;
127
- state: any;
121
+ state: import("../../../../shared/types").AnyObject;
122
+ patientInfo: import("vue").Ref<any>;
128
123
  formValue: {
129
124
  businessType: string;
130
125
  vaa01: null;
@@ -142,9 +137,9 @@ declare const _default: import("vue").DefineComponent<{}, {
142
137
  message: string;
143
138
  };
144
139
  };
145
- options: import("vue").Ref<AnyObject[]>;
140
+ options: import("vue").Ref<import("../../../../shared/types").AnyObject[]>;
146
141
  formRef: import("vue").Ref<any>;
147
- renderLabel: (option: AnyObject) => string;
142
+ renderLabel: (option: import("../../../../shared/types").AnyObject) => string;
148
143
  handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
149
144
  handleSearch: (keyword: string) => Promise<void>;
150
145
  handleBusinessTypeUpdate: () => void;
@@ -171,7 +166,6 @@ declare const _default: import("vue").DefineComponent<{}, {
171
166
  type: BooleanConstructor;
172
167
  };
173
168
  }, {
174
- audioSdk: CAudioSDK;
175
169
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
176
170
  show: {
177
171
  type: BooleanConstructor;
@@ -180,25 +174,21 @@ declare const _default: import("vue").DefineComponent<{}, {
180
174
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
181
175
  }>>;
182
176
  emit: (event: "update:show", ...args: any[]) => void;
183
- state: any;
184
- vaa07: any;
185
- immediatelyRecording: any;
186
- time: import("vue").Ref<number>;
187
- endType: string;
188
- pause: import("@vueuse/shared").Fn;
189
- resume: import("@vueuse/shared").Fn;
177
+ audioChartRef: import("vue").Ref<HTMLDivElement | undefined>;
178
+ isWarning: import("vue").Ref<boolean>;
190
179
  isActive: import("vue").Ref<boolean>;
191
- tip: import("vue").ComputedRef<"正在录音中..." | "录音已暂停">;
192
- formattedTime: import("vue").ComputedRef<string>;
193
- checkEnvironment: () => boolean;
194
- start: () => Promise<void>;
195
- handlePause: () => void;
196
180
  handlePlay: () => void;
181
+ handlePause: () => void;
197
182
  handleEnd: (trigger?: string | undefined) => Promise<void>;
183
+ formattedTime: import("vue").ComputedRef<string>;
184
+ warnTime: import("vue").Ref<number>;
185
+ tip: import("vue").ComputedRef<"未识别录音" | "正在录音中..." | "录音已暂停">;
198
186
  NSpace: any;
199
187
  NButton: any;
200
188
  NIcon: any;
201
189
  StopCircleOutline: 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<{}>>, {}>;
190
+ MicOff: 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<{}>>, {}>;
191
+ AlertCircle: 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<{}>>, {}>;
202
192
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
203
193
  show: {
204
194
  type: BooleanConstructor;
@@ -208,5 +198,6 @@ declare const _default: import("vue").DefineComponent<{}, {
208
198
  }, {
209
199
  show: boolean;
210
200
  }>;
201
+ MicroPhone: any;
211
202
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
212
203
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,ref as n,computed as t,onBeforeUnmount as l,watch as a,openBlock as i,createElementBlock as s,normalizeClass as r,unref as d,createElementVNode as u,createBlock as c,withCtx as v,createVNode as m,createTextVNode as h,toDisplayString as p,createCommentVNode as f,Fragment as k,renderList as w,normalizeStyle as g,createSlots as y,withModifiers as C,getCurrentInstance as b}from"vue";import{NButton as x,NIcon as _,NPopover as I,NInput as j,NTag as z,NBreadcrumb as M,NBreadcrumbItem as T}from"naive-ui";import{PeopleOutline as P,SparklesSharp as D,PaperPlane as S,ChevronBack as B,ChevronForward as E}from"@vicons/ionicons5";import{InjectionAIChatEmits as K,InjectionAIChat as L}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as R,last as F}from"lodash-es";import{useTheme as W}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import N from"./ChatPrompt.vue.js";import V from"./ChatPatient.vue.js";import q from"./ChatAudio.vue.js";import{useProgram as H}from"../hooks/useProgram.js";const O={class:"menu-box fillet-8"},G={class:"input-wrapper fillet-10"},J=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("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"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),Q={key:0,class:"btn-box"},X=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("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"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),Y=["disabled"],Z={class:"command-box"},$={class:"command-box__header"},ee={key:0,class:"title"},oe={class:"command-box__menu"},ne=["onMouseover","onClick"],te={class:"label"},le={class:"remark"};var ae=e({__name:"ChatFooter",setup(e){const ae=[{key:"recommend_diagnosis",value:"推荐诊断"},{key:"recommend_examination",value:"推荐诊查方案"},{key:"recommend_treatment_plan",value:"推荐治疗方案"},{key:"medical",value:"病历"}],{programMethod:ie,MedicalOrderId:se}=H(),re=W(),de=U.create(),ue=o(K),{shortcutList:ce,state:ve,isSmall:me,audioTimed:he,commandList:pe,isInner:fe,patientInfo:ke}=o(L),we=n(),ge=n(!1),ye=n([]),Ce=n(A(pe.value||[])),be=n(!1),xe=n(""),_e=n(!1),Ie=n(!1),je=t((()=>fe.value?"请向我提问,Shift+Enter换行":me?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行')),ze=t((()=>De.value||ve.loading||!ve.sendContent.replace(/(&nbsp;|\s|<br>)+/g,""))),Me=t((()=>{var e;return!ve.sendContent&&!(null==(e=we.value)?void 0:e.activated.value)})),Te=t((()=>{var e,o;if(!ve.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:n,vaa05:t}=ve.selectedPatient;let l="";n&&(l+=n+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.191"))||"床"));return t&&(l+=(!l||l.endsWith("/")?"":"/")+t),l})),Pe=t((()=>fe.value?ae.concat(ce.value||[]):ce.value)),De=t((()=>{var e,o;return fe.value&&1!==(null==(o=null==(e=ke.value)?void 0:e.info)?void 0:o.vac34)}));async function Se(){try{const e=await de.start(b(),{allowPunctuationMark:!1,timed:he.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:o}=e.data;ve.sendContent=o}catch(e){console.log(e)}}function Be(e){var o;if(R(e))return e;if(fe.value)return e.value;const{content:n}=(null==(o=null==e?void 0:e.contents)?void 0:o[0])||{};return null==n?void 0:n.instructionName}function Ee(){var e;ge.value=!1,Ce.value=A(pe.value||[]),ye.value=[],(null==(e=pe.value)?void 0:e.length)&&(ge.value=!0,xe.value=Ce.value[0].shortcutId)}function Ke(e){if(fe.value)"Enter"!==e.key||Le(e)||Ae();else if(!["Slash","NumpadDivide"].includes(e.code)||ve.selectedCommand||ve.sendContent)if("Backspace"===e.key)ge.value=!1,!ve.sendContent.startsWith("/")&&!ve.sendContent.startsWith("、")||2!==ve.sendContent.length||ve.selectedCommand?!ve.sendContent&&ve.selectedCommand&&(e.preventDefault(),ve.selectedCommand=null,ve.sendContent="/",Ee()):Ee();else if(ge.value&&["ArrowUp","ArrowDown"].includes(e.key)){const o=Ce.value.findIndex((e=>e.shortcutId===xe.value));if("ArrowUp"===e.key){const e=o>0?o-1:Ce.value.length-1;xe.value=Ce.value[e].shortcutId}else if("ArrowDown"===e.key){const e=o<Ce.value.length-1?o+1:0;xe.value=Ce.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!Le(e))if(e.preventDefault(),ge.value){Re(Ce.value.find((e=>e.shortcutId===xe.value)))}else Ae()}else ge.value=!1;else Ee()}function Le(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Ue(e){!e&&ve.selectedPrompt&&(ve.selectedPrompt=null)}function Ae(){ze.value||(ve.sending=!0,ve.loading=!0)}function Re(e){var o;xe.value=e.shortcutId,we.value.focus(),(null==(o=e.children)?void 0:o.length)?(Ce.value=e.children,xe.value=Ce.value[0].shortcutId,ye.value.push(e)):(ve.selectedCommand=e||{},ge.value=!1,ve.sendContent="")}function Fe(){var e;ye.value.pop(),Ce.value=F(ye.value)?null==(e=F(ye.value))?void 0:e.children:A(pe.value||[]),xe.value=Ce.value[0].shortcutId,we.value.focus()}function We(e){e||(ve.showPatient=!1)}return l((()=>{U.destroy()})),a((()=>ve.showPatient),(e=>{e&&(_e.value=e)})),(e,o)=>(i(),s("section",{class:r(["chat-footer",d(De)||d(ve).loading?"disabled":""])},[u("div",O,[d(me)||d(fe)?f("v-if",!0):(i(),c(d(x),{key:0,secondary:"",size:"small",onClick:o[0]||(o[0]=()=>_e.value=!0)},{icon:v((()=>[m(d(_),{color:d(re)["--c-primary-color"],size:"20",component:d(P)},null,8,["color","component"])])),default:v((()=>[h(" "+p(d(Te)),1)])),_:1})),d(Pe)&&d(Pe).length>0?(i(!0),s(k,{key:1},w(d(Pe),(e=>(i(),c(d(x),{secondary:"",size:"small",style:g(d(me)?"background: #fff":""),round:d(me),key:Be(e),disabled:d(De),onClick:()=>async function(e){var o,n,t,l;if(R(e))ve.sendContent=e;else{if(fe.value&&e.key){switch(e.key){case"medical":ve.consultationContent=null,ve.showRight=!0,await ie(se,{vac01:(null==(n=null==(o=ke.value)?void 0:o.info)?void 0:n.vac01)||"1878974046080958465",type:1});break;case"recommend_treatment_plan":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0,ve.loadingText="参考诊断结果与患者个体信息,正全面梳理知识库和临床指南,综合考量为您匹配最适宜的诊疗方案推荐";break;case"recommend_examination":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0,ve.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目";break;case"recommend_diagnosis":ve.params={opType:e.key},ve.sending=!0,ve.loading=!0;break;default:ue("button-click",{item:e,patientInfo:null==(t=ke.value)?void 0:t.info})}return}const a=null==(l=null==e?void 0:e.contents)?void 0:l[0];ue("button-click",{msgItem:a,item:e})}}(e)},{default:v((()=>[h(p(Be(e)),1)])),_:2},1032,["style","round","disabled","onClick"])))),128)):f("v-if",!0)]),m(d(I),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ge.value,onClickoutside:o[4]||(o[4]=e=>ge.value=!1)},{trigger:v((()=>[u("div",G,[m(d(j),{ref_key:"inputRef",ref:we,placeholder:d(je),type:"textarea",autosize:{minRows:d(me)?1:2,maxRows:7},disabled:d(De)||d(ve).loading,value:d(ve).sendContent,"onUpdate:value":o[2]||(o[2]=e=>d(ve).sendContent=e),onKeydownCapture:Ke,onInput:Ue},y({_:2},[d(fe)?void 0:{name:"prefix",fn:v((()=>[d(ve).selectedCommand&&d(ve).selectedCommand.shortcutTitle?(i(),c(d(z),{key:0,bordered:!1,color:{textColor:d(re)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[h(" /"+p(d(ve).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):d(Me)?(i(),c(d(x),{key:1,text:"",onClick:o[1]||(o[1]=()=>be.value=!0)},{default:v((()=>[m(d(_),{color:"#8f66f7",size:"18",component:d(D)},null,8,["component"])])),_:1})):f("v-if",!0)])),key:"0"},d(me)?{name:"suffix",fn:v((()=>[m(d(x),{text:"",disabled:d(ve).loading,onClick:Se},{icon:v((()=>[m(d(_),{size:"30"},{default:v((()=>[J])),_:1})])),_:1},8,["disabled"]),m(d(x),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(ze),onClick:Ae},{icon:v((()=>[m(d(_),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),key:"1"}:void 0]),1032,["placeholder","autosize","disabled","value"]),d(me)?f("v-if",!0):(i(),s("div",Q,[d(fe)?(i(),c(d(x),{key:0,text:"",disabled:d(De)||Ie.value||d(ve).loading,onClick:o[3]||(o[3]=e=>Ie.value=!0)},{icon:v((()=>[m(d(_),{size:"38"},{default:v((()=>[X])),_:1})])),_:1},8,["disabled"])):f("v-if",!0),u("span",{class:r(["btn-send","gradient","fillet-8",d(ze)?"disabled":""]),disabled:d(ze),onClick:Ae},[m(d(_),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,Y)]))])])),default:v((()=>{var e;return[u("div",Z,[u("div",$,[0===ye.value.length?(i(),s("span",ee,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(i(),s(k,{key:1},[m(d(x),{text:"",onClick:Fe},{default:v((()=>[m(d(_),{color:"#999",size:"20",component:d(B)},null,8,["component"])])),_:1}),m(d(M),null,{default:v((()=>[(i(!0),s(k,null,w(ye.value,(e=>(i(),c(d(T),{key:e.shortcutId},{default:v((()=>[h(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",oe,[(i(!0),s(k,null,w(Ce.value,(e=>(i(),s("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",xe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>xe.value=e.shortcutId),["stop"]),onClick:()=>Re(e)},[u("span",te,p(e.shortcutTitle),1),u("span",le,p(e.shortcutDescription),1),e.children&&e.children.length?(i(),c(d(_),{key:0,color:"#999",size:"20",component:d(E)},null,8,["component"])):f("v-if",!0)],42,ne)))),128))])])]})),_:1},8,["show"]),d(fe)?f("v-if",!0):(i(),c(N,{key:0,show:be.value,"onUpdate:show":o[5]||(o[5]=e=>be.value=e)},null,8,["show"])),d(fe)?f("v-if",!0):(i(),c(V,{key:1,show:_e.value,"onUpdate:show":[o[6]||(o[6]=e=>_e.value=e),We]},null,8,["show"])),d(fe)?(i(),c(q,{key:2,show:Ie.value,"onUpdate:show":o[7]||(o[7]=e=>Ie.value=e)},null,8,["show"])):f("v-if",!0)],2))}});export{ae as default};
1
+ import{defineComponent as e,ref as o,onMounted as t,computed as l,watch as n,nextTick as a,onBeforeUnmount as s,openBlock as i,createElementBlock as d,normalizeClass as c,unref as r,createElementVNode as u,createBlock as v,withCtx as m,createVNode as h,createTextVNode as f,toDisplayString as p,createCommentVNode as w,Fragment as k,renderList as g,normalizeStyle as y,createSlots as b,withModifiers as C,isRef as x,getCurrentInstance as _}from"vue";import{NButton as z,NIcon as S,NPopover as I,NInput as P,NTag as L,NBreadcrumb as j,NBreadcrumbItem as D,NSwitch as T}from"naive-ui";import{PeopleOutline as M,SparklesSharp as U,PaperPlane as B,ChevronBack as F,ChevronForward as K}from"@vicons/ionicons5";import{useFooterContext as R}from"../hooks/useFooterContext.js";import"../../../audio-sdk/index.js";import{last as A,cloneDeep as E}from"lodash-es";import q from"./ChatPrompt.vue.js";import N from"./ChatPatient.vue.js";import O from"./ChatAudio.vue.js";import V from"./svgs/MicroPhone.vue.js";import W from"../../../audio-sdk/src/audioSDK.js";const G={key:0,class:"menu-box fillet-8"},H={class:"input-wrapper fillet-10"},J={key:0,class:"btn-box"},Q=["disabled"],X={class:"command-box"},Y={class:"command-box__header"},Z={key:0,class:"title"},$={class:"command-box__menu"},ee=["onMouseover","onClick"],oe={class:"label"},te={class:"remark"};var le=e({__name:"ChatFooter",setup(e){const{state:le,shortcutList:ne,getShortcutName:ae,isAllDisabled:se,isStreamingOutput:ie,handleShortcut:de,showPopover:ce,handleKeyDown:re,handleInput:ue,btnDisabled:ve,commandList:me,showAudio:he,handleSend:fe,isDefault:pe,breadcrumb:we,currentShortcutId:ke,currentCommand:ge,clickMenu:ye,audioTimed:be,showLBtn:Ce,isSmall:xe,cssVars:_e}=R();function ze({focused:e,checked:o}){const t={};return o?(t.background="#d03050",e&&(t.boxShadow="0 0 0 2px #d0305040")):(t.background="#2080f0",e&&(t.boxShadow="0 0 0 2px #2080f040")),t}const Se=o();t((()=>{var e;null==(e=Se.value)||e.focus()}));const Ie=l((()=>pe.value?"请向我提问,Shift+Enter换行":xe.value?'请向我提问或输入"/"查看指令':'请向我提问或输入"/"查看指令,Shift+Enter换行'));n((()=>le.loading),(async e=>{var o;e||(await a(),null==(o=Se.value)||o.focus())}));const Pe=W.create();async function Le(){try{const e=await Pe.start({instance:_(),allowPunctuationMark:!1,timed:be.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;le.sendContent=e.data||""}catch(e){console.log(e)}}s((()=>{W.destroy()}));const je=o(!1),De=o(!1),Te=l((()=>{var e;return!le.sendContent&&!(null==(e=Se.value)?void 0:e.activated.value)})),Me=l((()=>{var e,o;if(!le.selectedPatient)return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.190"))||"选择患者";const{bcq04b:t,vaa05:l}=le.selectedPatient;let n="";t&&(n+=t+((null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.191"))||"床"));return l&&(n+=(!n||n.endsWith("/")?"":"/")+l),n}));function Ue(){var e;we.value.pop(),ge.value=A(we.value)?null==(e=A(we.value))?void 0:e.children:E(me.value||[]),ke.value=ge.value[0].shortcutId,Se.value.focus()}function Be(e){e||(le.showPatient=!1)}return n((()=>le.showPatient),(e=>{e&&(De.value=e)})),(e,o)=>(i(),d("section",{class:c(["chat-footer-wrapper",{"is-small":r(xe)}])},[u("div",{class:c(["chat-footer",r(le).loading?"disabled":""])},[r(pe)&&r(ne)&&r(ne).length>0?(i(),d("div",G,[r(xe)||r(pe)?w("v-if",!0):(i(),v(r(z),{key:0,secondary:"",size:"small",onClick:o[0]||(o[0]=()=>De.value=!0)},{icon:m((()=>[h(r(S),{color:r(_e)["--c-primary-color"],size:"20",component:r(M)},null,8,["color","component"])])),default:m((()=>[f(" "+p(r(Me)),1)])),_:1})),r(ne)&&r(ne).length>0?(i(!0),d(k,{key:1},g(r(ne),(e=>(i(),v(r(z),{secondary:"",size:"small",style:y(r(xe)?"background: #fff":""),round:r(xe),key:r(ae)(e),disabled:r(se)||r(ie)&&r(le).loading,onClick:()=>r(de)(e)},{default:m((()=>[f(p(r(ae)(e)),1)])),_:2},1032,["style","round","disabled","onClick"])))),128)):w("v-if",!0)])):w("v-if",!0),h(r(I),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:r(ce),onClickoutside:o[5]||(o[5]=e=>ce.value=!1)},{trigger:m((()=>[u("div",H,[h(r(P),{ref_key:"inputRef",ref:Se,placeholder:r(Ie),type:"textarea",autosize:{minRows:r(xe)?1:2,maxRows:7},disabled:r(se)||r(le).loading||r(he),value:r(le).sendContent,"onUpdate:value":o[2]||(o[2]=e=>r(le).sendContent=e),onKeydownCapture:r(re),onInput:r(ue)},b({_:2},[r(pe)?void 0:{name:"prefix",fn:m((()=>[r(le).selectedCommand&&r(le).selectedCommand.shortcutTitle?(i(),v(r(L),{key:0,bordered:!1,color:{textColor:r(_e)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[f(" /"+p(r(le).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):r(Te)?(i(),v(r(z),{key:1,text:"",onClick:o[1]||(o[1]=()=>je.value=!0)},{default:m((()=>[h(r(S),{color:"#8f66f7",size:"18",component:r(U)},null,8,["component"])])),_:1})):w("v-if",!0)])),key:"0"},r(xe)?{name:"suffix",fn:m((()=>[h(r(z),{text:"",disabled:r(le).loading,onClick:Le},{icon:m((()=>[h(r(S),{size:"30"},{default:m((()=>[h(V)])),_:1})])),_:1},8,["disabled"]),h(r(z),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:r(ve),onClick:r(fe)},{icon:m((()=>[h(r(S),{color:"#fff",size:"20",component:r(B)},null,8,["component"])])),_:1},8,["disabled","onClick"])])),key:"1"}:void 0]),1032,["placeholder","autosize","disabled","value","onKeydownCapture","onInput"]),r(xe)?w("v-if",!0):(i(),d("div",J,[r(pe)?(i(),v(r(z),{key:0,text:"",disabled:r(se)||r(he)||r(le).loading,onClick:o[3]||(o[3]=e=>he.value=!0)},{icon:m((()=>[h(r(S),{size:"60"},{default:m((()=>[h(V)])),_:1})])),_:1},8,["disabled"])):w("v-if",!0),u("span",{class:c(["btn-send","gradient","fillet-8",r(ve)||r(he)?"disabled":""]),disabled:r(ve)||r(he),onClick:o[4]||(o[4]=(...e)=>r(fe)&&r(fe)(...e))},[h(r(S),{color:"#fff",size:"36",component:r(B)},null,8,["component"])],10,Q)]))])])),default:m((()=>{var e;return[u("div",X,[u("div",Y,[0===r(we).length?(i(),d("span",Z,(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.189"))||"推荐指令")):(i(),d(k,{key:1},[h(r(z),{text:"",onClick:Ue},{default:m((()=>[h(r(S),{color:"#999",size:"20",component:r(F)},null,8,["component"])])),_:1}),h(r(j),null,{default:m((()=>[(i(!0),d(k,null,g(r(we),(e=>(i(),v(r(D),{key:e.shortcutId},{default:m((()=>[f(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",$,[(i(!0),d(k,null,g(r(ge),(e=>(i(),d("div",{class:c(["menu-item",e.children&&e.children.length?"":"selectable",r(ke)===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>ke.value=e.shortcutId),["stop"]),onClick:()=>r(ye)(e)},[u("span",oe,p(e.shortcutTitle),1),u("span",te,p(e.shortcutDescription),1),e.children&&e.children.length?(i(),v(r(S),{key:0,color:"#999",size:"20",component:r(K)},null,8,["component"])):w("v-if",!0)],42,ee)))),128))])])]})),_:1},8,["show"]),r(pe)?(i(),v(O,{key:2,show:r(he),"onUpdate:show":o[8]||(o[8]=e=>x(he)?he.value=e:null)},null,8,["show"])):(i(),d(k,{key:1},[h(q,{show:je.value,"onUpdate:show":o[6]||(o[6]=e=>je.value=e)},null,8,["show"]),h(N,{show:De.value,"onUpdate:show":[o[7]||(o[7]=e=>De.value=e),Be]},null,8,["show"])],64)),r(pe)&&r(Ce)?(i(),v(r(T),{key:3,value:r(le).switchFlag,"onUpdate:value":o[9]||(o[9]=e=>r(le).switchFlag=e),"rail-style":ze},{checked:m((()=>[f("L1")])),unchecked:m((()=>[f("L2")])),_:1},8,["value"])):w("v-if",!0)],2)],2))}});export{le as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as n,ref as t,computed as l,watch as o,createVNode as s,createTextVNode as a,nextTick as i,isVNode as u}from"vue";import{NAvatar as r,NSpin as d,NSpace as c,NButton as v}from"naive-ui";import{InjectionAIChatEmits as m,InjectionAIChat as g}from"../types/index.js";import p from"../../../../shared/assets/img/ai__avatar.png.js";import f from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as w,has as b}from"lodash-es";import{uuidGenerator as y}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as C}from"../../../../shared/hooks/useScrollLoading.js";import I from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function k(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var L=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:u,slots:L,emit:T}){const B=n(m),{userAvatar:E,queryData:P,state:S,queryRecord:z,defaultShortcutList:M,hideInput:D=!1,isSmall:O}=n(g),A=t(null),q=t([]),H=t(!1),N=t(!1),R=t(),U=l((()=>O.value?f:p)),_={page:0,hasMore:!0};async function F(e=!1){if(!_.hasMore)return;_.page++,1==_.page&&(q.value=[]);const{records:n,rows:t}=await z.value({page:_.page});h(t)&&q.value.length<=+n&&(q.value=_.page>1?[...q.value,...t]:t,K(),q.value.length>=+n&&(e&&(H.value=!0),_.hasMore=!1,console.log("没有更多消息了")))}async function J(){var e,n;q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),null==(e=A.value)||e.scrollTo({top:0,behavior:"auto"}),K();const t=S.selectedCommand,l=S.selectedPrompt;S.selectedCommand=null,S.selectedPrompt=null;const o=await P.value({content:S.sendContent,contentType:"text",command:t,prompt:l,patient:S.selectedPatient});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await i(),null==(n=A.value)||n.scrollTo({top:0,behavior:"auto"})),S.selectedPatientLabel="",S.selectedPatientForm=null,S.sending=!1,S.loading=!1,S.sendContent=""}function G(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)G(e.childrens[l],n,t)}else t.push(e)}function K(){q.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!j(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{G(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function Q(e,n,t,l){const{contentType:o,content:a}=n;return"json"===o&&a?s(I,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(R.value={item:t,msgItem:l},void(N.value=!0)):l?(B("button-click",e),void(l.disabled=!0)):void(t.link||(S.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",S.sending=!0,S.loading=!0))}({item:e,msgItem:n,...t})},null):null}function V(e,n){const{contents:t=[],buttonType:l="",configs:o={},msgId:a=""}=e,i=Q(e,t[n],o,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)]))]}function W({role:e=""}){return"user"===e}function X(){var e,n;let t;return s("div",{class:"message-item"},[s(r,{round:!0,size:O.value?64:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[a((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),s("p",null,[a("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),a("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[a((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.195"))||"你可以试着问我:")]),s(c,{"wrap-item":!1},k(t=M.value.map((e=>s(v,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.loading},k(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return C(A,(()=>{F()}),D.value?"bottom":"top"),F(!0),o((()=>S.externalData),(e=>{var n,t;e&&(b(n=e,"msgId")||(n.msgId=y()),q.value.unshift(n),null==(t=A.value)||t.scrollTo({top:0,behavior:"auto"}),S.loading=!1,S.externalData=null)})),o((()=>S.sending),(e=>{var n,t,l,o,s,a,i;if(e){if(q.value.length>0&&[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.428"))||"确认",(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定"].includes(S.sendContent)){const e=null==(s=null==(l=q.value[0])?void 0:l.contents)?void 0:s[(null==(o=q.value[0].contents)?void 0:o.length)-1];return(null==(a=e.content)?void 0:a.body)&&!e.disabled?(null==(i=document.getElementById(q.value[0].msgId))||i.click(),void setTimeout((()=>{q.value.unshift({msgId:y(),contents:[{role:"user",content:S.sendContent}]}),S.selectedCommand=null,S.selectedPrompt=null,S.sending=!1,S.sendContent=""}))):void J()}J()}})),()=>[s("section",{class:"chat-main",ref:A,style:{"flex-direction":D.value?"column":"column-reverse"}},[[S.loading?s("div",{class:"message-item"},[[O.value?null:s(r,{round:!0,size:40,src:U.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[a("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item",key:e.msgId+t},[[O.value?null:s(r,{round:!0,size:40,src:W(n)?E.value:U.value},null),s("div",{class:["content-box",W(n)?"mine":""]},[s("div",{class:"content"},[w(n.render)?n.render():V(e,t)])])]]))))),H.value?X():null]]),s(x,{show:N.value,"onUpdate:show":e=>N.value=e,data:R.value},null)]}});export{L as default};
1
+ import{defineComponent as e,ref as n,computed as t,watch as l,createVNode as o,createTextVNode as s,nextTick as a,isVNode as i}from"vue";import{NSpin as u,NAvatar as r,NSpace as d,NButton as c}from"naive-ui";import m from"../../../../shared/assets/img/ai__avatar.png.js";import v from"../../../../shared/assets/img/logo.png.js";import{isArray as g,isFunction as p,has as f}from"lodash-es";import{uuidGenerator as h}from"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as w}from"../../../../shared/hooks/useScrollLoading.js";import b from"./ChatCard.js";import{isValidJSON as C}from"../utils/index.js";import y from"./ChatBI.vue.js";import{useData as I}from"../hooks/useData.js";function j(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!i(e)}var k=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:i,slots:k,emit:x}){const{state:L,queryData:T,queryRecord:B,defaultShortcutList:E,hideInput:P,isSmall:S,emit:D}=I(),M=n(null),O=n([]),z=n(!1),q=n(!1),A=n(),H=t((()=>S.value?v:m)),N={page:0,hasMore:!0};async function R(e=!1){if(!N.hasMore)return;N.page++,1==N.page&&(O.value=[]);const{records:n,rows:t}=await B.value({page:N.page});g(t)&&O.value.length<=+n&&(O.value=N.page>1?[...O.value,...t]:t,F(),O.value.length>=+n&&(e&&(z.value=!0),N.hasMore=!1,console.log("没有更多消息了")))}async function U(){var e,n;O.value.unshift({msgId:h(),contents:[{role:"user",content:L.sendContent}]}),null==(e=M.value)||e.scrollTo({top:0,behavior:"auto"}),F();const t=L.selectedCommand,l=L.selectedPrompt;L.selectedCommand=null,L.selectedPrompt=null;const o=await T.value({content:L.sendContent,contentType:"text",command:t,prompt:l,patient:L.selectedPatient});g(null==o?void 0:o.contents)&&(O.value.unshift(o),await a(),null==(n=M.value)||n.scrollTo({top:0,behavior:"auto"})),L.selectedPatientLabel="",L.selectedPatientForm=null,L.sending=!1,L.loading=!1,L.sendContent=""}function _(e,n,t){if(e.type!==n){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)_(e.childrens[l],n,t)}else t.push(e)}function F(){O.value.forEach((e=>{e.contents.forEach((e=>{var n;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:t,data:l,needConfirms:o}=e.content;if(o||!(null==t?void 0:t.setting)||!C(null==t?void 0:t.setting)||!(null==(n=null==l?void 0:l.buttonList)?void 0:n.length))return;const{templates:s=[]}=JSON.parse(t.setting),a=[];s.forEach((e=>{_(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:n}=e.setting;n.forEach((e=>{var n;const{conditions:t=[]}=(null==(n=null==e?void 0:e.advancedConfig)?void 0:n.disabled)||{};t.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function J(e,n,t,l){const{contentType:s,content:a}=n;return"json"===s&&a?o(b,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:n,configs:t,msgId:l,"onButton-click":(t={})=>function(e){var n;const{item:t,msgItem:l,showMore:o}=e;return o?(A.value={item:t,msgItem:l},void(q.value=!0)):l?(D("button-click",e),void(l.disabled=!0)):void(t.link||(L.sendContent=(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",L.sending=!0,L.loading=!0))}({item:e,msgItem:n,...t})},null):null}function G(e,n){const{contents:t=[],buttonType:l="",configs:s={},msgId:a=""}=e,i=J(e,t[n],s,a);if(i)return i;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:o("br",null,null)]))]}function K({role:e=""}){return"user"===e}function Q(){var e,n;let t;return o("div",{class:"message-item"},[o(r,{round:!0,size:S.value?64:40,src:H.value},null),o("div",{class:"content-box"},[o("div",{class:"content fillet-10 default"},[o("h2",null,[s((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.192"))||"Hi,我是你的AI助理")]),o("p",null,[s("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),o("br",null,null),s("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),g(E.value)&&E.value.length>0?[o("p",{style:"margin: 5px 0 5px"},[s((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.195"))||"你可以试着问我:")]),o(d,{"wrap-item":!1},j(t=E.value.map((e=>o(c,{size:"large",secondary:!0,onClick:()=>L.sendContent=e,disabled:L.loading},j(e)?e:{default:()=>[e]}))))?t:{default:()=>[t]})]:null])])])}return w(M,(()=>{R()}),P.value?"bottom":"top"),R(!0),l((()=>L.externalData),(e=>{var n,t;e&&(f(n=e,"msgId")||(n.msgId=h()),O.value.unshift(n),null==(t=M.value)||t.scrollTo({top:0,behavior:"auto"}),L.loading=!1,L.externalData=null)})),l((()=>L.sending),(e=>{var n,t,l,o,s,a,i;if(e){if(O.value.length>0&&[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.428"))||"确认",(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.27"))||"确定"].includes(L.sendContent)){const e=null==(s=null==(l=O.value[0])?void 0:l.contents)?void 0:s[(null==(o=O.value[0].contents)?void 0:o.length)-1];return(null==(a=e.content)?void 0:a.body)&&!e.disabled?(null==(i=document.getElementById(O.value[0].msgId))||i.click(),void setTimeout((()=>{O.value.unshift({msgId:h(),contents:[{role:"user",content:L.sendContent}]}),L.selectedCommand=null,L.selectedPrompt=null,L.sending=!1,L.sendContent=""}))):void U()}U()}})),()=>[o("section",{class:"chat-main-wrapper",ref:M},[o("div",{class:"chat-main-box"},[o("div",{class:"chat-main",style:{"flex-direction":P.value?"column":"column-reverse"}},[[L.loading?o("div",{class:"message-item"},[[o("div",{class:"content-box"},[o("div",{class:"content loading"},[o(u,{size:22,stroke:"#4170EE"},null),o("span",null,[s("正在加载中,请稍等...")])])])]]):null,O.value.map((e=>e.contents.map(((n,t)=>o("div",{class:"message-item",key:e.msgId+t},[[o("div",{class:["content-box",K(n)?"mine":""]},[o("div",{class:"content"},[p(n.render)?n.render():G(e,t)])])]]))))),z.value?Q():null]]),o(y,{show:q.value,"onUpdate:show":e=>q.value=e,data:A.value},null)])])]}});export{k as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as t,watch as n,createVNode as o}from"vue";import"../../../../shared/utils/index.js";import{NTooltip as r,NButton as s,NIcon as a}from"naive-ui";import"@vueuse/core";import"date-fns";import{isArray as i,isFunction as l,isString as c}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{SyncOutline as u,ChevronUp as d,ChevronDown as p}from"@vicons/ionicons5";import{useScrollLoading as m}from"../../../../shared/hooks/useScrollLoading.js";import v from"markdown-it";import{getSessionMsgApi as g,getHistoryRecordApi as h}from"../api/index.js";import{useData as f}from"../hooks/useData.js";import"../utils/index.js";import y from"./card/JsonCard.js";import x from"./message-render/CardRender.js";import _ from"./message-render/FormRender.js";const b=v({html:!0});var T=e({name:"ChatMain",inheritAttrs:!1,setup(e,{attrs:v,slots:T,emit:w}){const{state:j,sessionId:M,sendMessage:k,appCode:C,isStreamingOutput:S,prologue:E,bpmnProcessIdAndStartToken:I,formatProcessInfo:L}=f(),A=t(null),R=t(!1),q={page:0,hasMore:!0};async function H(){if(!q.hasMore||!M.value)return;q.page++,1==q.page&&(j.record=[]);const e=S.value?await g({appCode:C.value,sessionId:M.value,page:q.page,pageSize:20}):await h({sessionId:M.value,page:q.page,pageSize:20}),{rows:t,query:n={}}=e||{};i(t)&&(t.forEach((e=>{i(e.contents)&&e.contents.length>1&&(e.cntents.forEach((e=>{O(e||{})&&(e.__showMore=!0),"form"===(null==e?void 0:e.messageType)&&(e.disabled=!0)})),e.contents.reverse())})),j.record.length<=+n.records&&(j.record=q.page>1?[...j.record,...t]:t,j.record.length>=+n.records&&(q.hasMore=!1,console.log("没有更多消息了"))))}function P(e,t){var n;const{contentType:o,messageType:r}=(null==(n=null==e?void 0:e.contents)?void 0:n[t])||{};return"json"===o&&"retry_inquiry"!==r}function $(e){return c(e)&&e?[o("div",{class:"ai-chat__markdown",innerHTML:function(e){const t=[],n=e.replace(/<table[^>]*>([\s\S]*?)<\/table>/g,((e,n)=>(t.push(n),`<table>TABLE_PLACEHOLDER_${t.length-1}</table>`)));return n.replace(/(\\n|\r|\n)/g,'<div style="height:4px"></div>').replace(/<div style="height:4px"><\/div>$/,"").replace(/<table>TABLE_PLACEHOLDER_(\d+)<\/table>/g,((e,n)=>`<table>${t[n]}</table>`))}(b.render(e))},null)]:null}function z(e,t){var n;const{contents:i=[],msgId:l=""}=e,{countTime:c,__showMore:m,contentType:v="",messageType:g="",content:h=""}=i[t]||{};if("json"===v)return"retry_inquiry"===g?[$((null==h?void 0:h.errorMsg)||""),o(r,{trigger:"hover"},{default:()=>"重新生成",trigger:()=>o(s,{style:"position: relative;top: 3px;margin-left: 8px",type:"primary",text:!0,onClick:()=>{return e=null==h?void 0:h.audioText,j.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录",void k({contents:[{content:e,contentType:"text",role:"user"}],opType:"create_inquiry"});var e}},{icon:()=>o(a,{component:u},null)})})]:"form"===g?o(_,{"msg-item":i[t]},null):"card"===g?o(x,{"msg-item":i[t]},null):function(e,t){return o(y,{item:e,messageItem:t},null)}(e,i[t]);const f=$((null==(n=i[t])?void 0:n.content)||"");if(f&&O(i[t]||{})){const e=o("div",{style:"cursor: pointer; border-top: 1px solid #e5e5e5;",onClick:()=>{var e;return i[t].__showMore=!(null==(e=i[t])?void 0:e.__showMore)}},[[`已深度分析(用时${null!=c?c:0}秒)`,o(a,{style:"position: relative;top: 4px",size:18,component:m?d:p},null)]]);return[o("div",{style:{display:m?"none":"unset"}},[f]),e]}return f}function D({role:e=""}){return"user"===e}function O({msgSource:e=""}){return"assistant"===e}function B(){const e=$(E.value);return e?o("div",{class:"message-item"},[o("div",{class:"content-box"},[o("div",{class:"content fillet-10 default"},[e])])]):null}return m(A,(()=>{H()}),"top"),n((()=>M.value),(async e=>{var t;j.loading=!1,R.value=!1,j.showRight=!1,j.showRightSlot=!1,j.record=[],q.page=0,q.hasMore=!0,await H(),(null==(t=j.record)?void 0:t.length)||(R.value=!0),L(I.value)}),{immediate:!0}),()=>[o("section",{class:"chat-main-wrapper",ref:A},[o("div",{class:"chat-main-box"},[o("div",{class:"chat-main",style:"column-reverse"},[[j.loading?o("div",{class:"message-item"},[o("div",{class:"content-box"},[o("div",{class:"content loading"},[o("span",{class:"ai-chat__loading-icon"},null),o("span",null,[j.loadingText||"分析中..."])])])]):null,j.record.map((e=>i(e.contents)?e.contents.map(((t,n)=>z(e,n)?o("div",{class:"message-item",key:e.msgId+n},[o("div",{class:["content-box",D(t)?"mine":""]},[o("div",{class:["content",{"content-json":!l(t.render)&&P(e,n)}]},[l(t.render)?t.render():z(e,n)])])]):null)):null)),R.value?B():null]])])])]}});export{T as default};
@@ -13,8 +13,8 @@ declare const _default: import("vue").DefineComponent<{
13
13
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
14
14
  }>>;
15
15
  emit: (event: "update:show", ...args: any[]) => void;
16
- patientInfo: any;
17
- state: any;
16
+ state: AnyObject;
17
+ patientInfo: import("vue").Ref<any>;
18
18
  formValue: {
19
19
  businessType: string;
20
20
  vaa01: null;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,reactive as l,ref as n,openBlock as t,createBlock as o,unref as u,withCtx as i,createVNode as d,createTextVNode as r,toDisplayString as w}from"vue";import{NDrawer as s,NDrawerContent as v,NForm as g,NFormItem as c,NRadioGroup as f,NRadio as p,NSelect as y,NButton as b}from"naive-ui";import{isFunction as m,isArray as h}from"lodash-es";import{InjectionAIChat as C}from"../types/index.js";var L=e({__name:"ChatPatient",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:L}){var B;const{patientInfo:_,state:k}=a(C),I=l({businessType:"CLINICIAN",vaa01:null,bck03a:""}),P={businessType:{required:!0,trigger:"change",message:"请选择类型"},vaa01:{required:!0,trigger:["blur","change"],message:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.201"))||"请选择患者"}},T=n([]),q=n();function N(e){var a,l,n,t;const{bcq04b:o,vae96:u}=e,i="1"==u?(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.203"))||"男":"2"==u?(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.204"))||"女":(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.205"))||"未知";let d="";o&&(d+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));const r=a=>{e[a]&&(d+=(!d||d.endsWith("/")?"":"/")+e[a])};return r("vaa05"),d+="/"+i,r("vae87"),r("bck02a"),d.startsWith("/")&&(d=d.slice(1)),d}function A(e,a){I.bck03a=a.bck03a}async function x(e){var a;if(m(null==(a=_.value)?void 0:a.queryPatient))try{const a=await _.value.queryPatient({keyword:e,businessType:I.businessType});if(h(a))return void(T.value=a);T.value=[]}catch(e){T.value=[]}}function S(){I.vaa01=null,I.bck03a="",x("")}function U(e){var a;e.preventDefault(),null==(a=q.value)||a.validate((e=>{if(!e){const e={...I,...T.value.find((e=>e.vaa01===I.vaa01))};k.showPatient?(k.selectedPatientLabel=N(e),k.selectedPatientForm=e):k.selectedPatient=e,L("update:show",!1)}}))}return x(""),(a,l)=>(t(),o(u(s),{placement:"bottom",height:"300","trap-focus":!1,to:"#"+u(k).id,show:e.show,onMaskClick:l[2]||(l[2]=()=>L("update:show",!1))},{default:i((()=>[d(u(v),null,{default:i((()=>[d(u(g),{ref_key:"formRef",ref:q,"label-placement":"left","label-width":"auto",size:"large",model:I,"require-mark-placement":"right-hanging",rules:P},{default:i((()=>{var e,a,n;return[d(u(c),{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务",path:"businessType"},{default:i((()=>{var e;return[d(u(f),{value:I.businessType,"onUpdate:value":[l[0]||(l[0]=e=>I.businessType=e),S],name:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务"},{default:i((()=>[d(u(p),{value:"CLINICIAN"},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.198"))||"门诊")]})),_:1}),d(u(p),{value:"HOSPITAL"},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.199"))||"住院")]})),_:1})])),_:1},8,["value"])]})),_:1}),d(u(c),{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.200"))||"患者",path:"vaa01"},{default:i((()=>{var e;return[d(u(y),{to:"body",remote:"",value:I.vaa01,"onUpdate:value":[l[1]||(l[1]=e=>I.vaa01=e),A],placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.201"))||"请选择患者",filterable:"",options:T.value,"render-label":N,"value-field":"vaa01",onSearch:x},null,8,["value","options"])]})),_:1}),d(u(c),{label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.202"))||"科室"},{default:i((()=>[r(w(I.bck03a),1)])),_:1}),d(u(c),null,{default:i((()=>[d(u(b),{block:"",type:"primary",onClick:U},{default:i((()=>{var e;return[r((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})]})),_:1},8,["model"])])),_:1})])),_:1},8,["to","show"]))}});export{L as default};
1
+ import{defineComponent as e,reactive as a,ref as l,openBlock as n,createBlock as t,unref as o,withCtx as u,createVNode as i,createTextVNode as d,toDisplayString as r}from"vue";import{NDrawer as s,NDrawerContent as w,NForm as v,NFormItem as g,NRadioGroup as c,NRadio as f,NSelect as p,NButton as y}from"naive-ui";import{isFunction as b,isArray as m}from"lodash-es";import{useData as h}from"../hooks/useData.js";import"../utils/index.js";var C=e({__name:"ChatPatient",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:C}){var L;const{state:k,patientInfo:B}=h(),_=a({businessType:"CLINICIAN",vaa01:null,bck03a:""}),I={businessType:{required:!0,trigger:"change",message:"请选择类型"},vaa01:{required:!0,trigger:["blur","change"],message:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.201"))||"请选择患者"}},P=l([]),T=l();function q(e){var a,l,n,t;const{bcq04b:o,vae96:u}=e,i="1"==u?(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.203"))||"男":"2"==u?(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.204"))||"女":(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.205"))||"未知";let d="";o&&(d+=o+((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.191"))||"床"));const r=a=>{e[a]&&(d+=(!d||d.endsWith("/")?"":"/")+e[a])};return r("vaa05"),d+="/"+i,r("vae87"),r("bck02a"),d.startsWith("/")&&(d=d.slice(1)),d}function N(e,a){_.bck03a=a.bck03a}async function A(e){var a;if(b(null==(a=B.value)?void 0:a.queryPatient))try{const a=await B.value.queryPatient({keyword:e,businessType:_.businessType});if(m(a))return void(P.value=a);P.value=[]}catch(e){P.value=[]}}function j(){_.vaa01=null,_.bck03a="",A("")}function x(e){var a;e.preventDefault(),null==(a=T.value)||a.validate((e=>{if(!e){const e={..._,...P.value.find((e=>e.vaa01===_.vaa01))};k.showPatient?(k.selectedPatientLabel=q(e),k.selectedPatientForm=e):k.selectedPatient=e,C("update:show",!1)}}))}return A(""),(a,l)=>(n(),t(o(s),{placement:"bottom",height:"300","trap-focus":!1,to:"#"+o(k).id,show:e.show,onMaskClick:l[2]||(l[2]=()=>C("update:show",!1))},{default:u((()=>[i(o(w),null,{default:u((()=>[i(o(v),{ref_key:"formRef",ref:T,"label-placement":"left","label-width":"auto",size:"large",model:_,"require-mark-placement":"right-hanging",rules:I},{default:u((()=>{var e,a,n;return[i(o(g),{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务",path:"businessType"},{default:u((()=>{var e;return[i(o(c),{value:_.businessType,"onUpdate:value":[l[0]||(l[0]=e=>_.businessType=e),j],name:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.197"))||"业务"},{default:u((()=>[i(o(f),{value:"CLINICIAN"},{default:u((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.198"))||"门诊")]})),_:1}),i(o(f),{value:"HOSPITAL"},{default:u((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.199"))||"住院")]})),_:1})])),_:1},8,["value"])]})),_:1}),i(o(g),{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.200"))||"患者",path:"vaa01"},{default:u((()=>{var e;return[i(o(p),{to:"body",remote:"",value:_.vaa01,"onUpdate:value":[l[1]||(l[1]=e=>_.vaa01=e),N],placeholder:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.201"))||"请选择患者",filterable:"",options:P.value,"render-label":q,"value-field":"vaa01",onSearch:A},null,8,["value","options"])]})),_:1}),i(o(g),{label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.202"))||"科室"},{default:u((()=>[d(r(_.bck03a),1)])),_:1}),i(o(g),null,{default:u((()=>[i(o(y),{block:"",type:"primary",onClick:x},{default:u((()=>{var e;return[d((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})]})),_:1},8,["model"])])),_:1})])),_:1},8,["to","show"]))}});export{C as default};
@@ -16,8 +16,8 @@ declare const _default: import("vue").DefineComponent<{
16
16
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
17
17
  }>>;
18
18
  emit: (event: "update:show", ...args: any[]) => void;
19
- queryPrompt: any;
20
- state: any;
19
+ state: AnyObject;
20
+ queryPrompt: import("vue").Ref<any>;
21
21
  listRef: import("vue").Ref<any>;
22
22
  keyword: import("vue").Ref<string>;
23
23
  list: import("vue").Ref<AnyObject[]>;
@@ -1 +1 @@
1
- import{createElementVNode as e,defineComponent as o,inject as t,ref as a,computed as l,watch as n,openBlock as r,createBlock as s,unref as p,withCtx as u,createVNode as i,createElementBlock as c,Fragment as d,renderList as m,toDisplayString as v,withDirectives as h,vShow as f}from"vue";import{NDrawer as w,NDrawerContent as g,NButton as k,NIcon as C,NInput as y}from"naive-ui";import{CloseOutline as _,SearchOutline as j}from"@vicons/ionicons5";import{isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as M}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as b}from"../../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as B}from"../types/index.js";var L;const P={class:"title"},R=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.206"))||"发现提示词",-1),S=["onClick"];var U=o({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:L}){const U=o,q={page:0,hasMore:!0},{queryPrompt:z,state:H}=t(B),I=a(),O=a(""),T=a([]),$=l((()=>!T.value.length&&!!(O.value||"").replace(/^\s+|\s+$/g,""))),A=M(E,500);async function D(){try{if(!q.hasMore||!x(z.value))return;q.page++,1==q.page&&(T.value=[]);const e=await z.value({keyword:O.value,page:q.page});T.value.length<=+e.records&&(T.value=q.page>1?T.value.concat(e.rows):e.rows,T.value.length>=+e.records&&(q.hasMore=!1))}catch(e){}}function E(){Object.assign(q,{page:0,hasMore:!0}),D()}return b(I,(()=>{D()})),n((()=>U.show),(e=>{e&&(O.value="",E())})),(t,a)=>(r(),s(p(w),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+p(H).id,show:o.show,"content-class":"prompt-wrapper",onMaskClick:a[2]||(a[2]=()=>L("update:show",!1))},{default:u((()=>[i(p(g),null,{header:u((()=>[e("div",P,[R,i(p(k),{text:"",onClick:a[0]||(a[0]=()=>L("update:show",!1))},{default:u((()=>[i(p(C),{size:"20",component:p(_)},null,8,["component"])])),_:1})]),i(p(y),{ref:"inputRef",clearable:"",autofocus:"",value:O.value,"onUpdate:value":[a[1]||(a[1]=e=>O.value=e),p(A)]},{prefix:u((()=>[i(p(C),{component:p(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:u((()=>{var o;return[e("div",{class:"list-wrapper",ref_key:"listRef",ref:I},[(r(!0),c(d,null,m(T.value,(o=>(r(),c("div",{class:"item",key:o.promptId,onClick:()=>function(e){L("update:show",!1),H.selectedPrompt=e,H.sendContent=e.promptContent}(o)},[e("p",null,v(o.promptTitle),1),e("p",null,v(o.promptContent),1)],8,S)))),128)),h(e("div",null,(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.81"))||"找不到相关的结果",512),[[f,p($)]])],512)]})),_:1})])),_:1},8,["to","show"]))}});export{U as default};
1
+ import{createElementVNode as e,defineComponent as o,ref as t,computed as a,watch as s,openBlock as l,createBlock as n,unref as r,withCtx as u,createVNode as p,createElementBlock as i,Fragment as c,renderList as d,toDisplayString as m,withDirectives as v,vShow as h}from"vue";import{NDrawer as f,NDrawerContent as w,NButton as g,NIcon as k,NInput as C}from"naive-ui";import{CloseOutline as y,SearchOutline as _}from"@vicons/ionicons5";import{isFunction as j}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as x}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as M}from"../../../../shared/hooks/useScrollLoading.js";import{useData as b}from"../hooks/useData.js";import"../utils/index.js";var B;const L={class:"title"},P=e("span",null,(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.206"))||"发现提示词",-1),R=["onClick"];var S=o({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(o,{emit:B}){const S=o,U={page:0,hasMore:!0},{state:q,queryPrompt:z}=b(),D=t(),H=t(""),I=t([]),O=a((()=>!I.value.length&&!!(H.value||"").replace(/^\s+|\s+$/g,""))),T=x(A,500);async function $(){try{if(!U.hasMore||!j(z.value))return;U.page++,1==U.page&&(I.value=[]);const e=await z.value({keyword:H.value,page:U.page});I.value.length<=+e.records&&(I.value=U.page>1?I.value.concat(e.rows):e.rows,I.value.length>=+e.records&&(U.hasMore=!1))}catch(e){}}function A(){Object.assign(U,{page:0,hasMore:!0}),$()}return M(D,(()=>{$()})),s((()=>S.show),(e=>{e&&(H.value="",A())})),(t,a)=>(l(),n(r(f),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+r(q).id,show:o.show,"content-class":"prompt-wrapper",onMaskClick:a[2]||(a[2]=()=>B("update:show",!1))},{default:u((()=>[p(r(w),null,{header:u((()=>[e("div",L,[P,p(r(g),{text:"",onClick:a[0]||(a[0]=()=>B("update:show",!1))},{default:u((()=>[p(r(k),{size:"20",component:r(y)},null,8,["component"])])),_:1})]),p(r(C),{ref:"inputRef",clearable:"",autofocus:"",value:H.value,"onUpdate:value":[a[1]||(a[1]=e=>H.value=e),r(T)]},{prefix:u((()=>[p(r(k),{component:r(_)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:u((()=>{var o;return[e("div",{class:"list-wrapper",ref_key:"listRef",ref:D},[(l(!0),i(c,null,d(I.value,(o=>(l(),i("div",{class:"item",key:o.promptId,onClick:()=>function(e){B("update:show",!1),q.selectedPrompt=e,q.sendContent=e.promptContent}(o)},[e("p",null,m(o.promptTitle),1),e("p",null,m(o.promptContent),1)],8,R)))),128)),v(e("div",null,(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.81"))||"找不到相关的结果",512),[[h,r(O)]])],512)]})),_:1})])),_:1},8,["to","show"]))}});export{S as default};
@@ -4,17 +4,19 @@ declare const _default: import("vue").DefineComponent<{}, {
4
4
  key: string;
5
5
  title: string;
6
6
  }[];
7
- state: any;
8
- patientInfo: any;
7
+ state: AnyObject;
8
+ configs: import("vue").Ref<any>;
9
+ sendMessage: (params?: AnyObject) => Promise<void>;
10
+ isStreamingOutput: import("vue").Ref<any>;
9
11
  toolbarConfig: {
10
12
  toolbarKeys: never[];
11
13
  };
12
14
  content: import("vue").Ref<string>;
13
- key: import("vue").Ref<string>;
15
+ saveDisabled: import("vue").ComputedRef<any>;
14
16
  handleSave: () => Promise<void>;
17
+ handleDelete: () => Promise<void>;
15
18
  createMedicalRecord: () => void;
16
19
  extractContentByTitle: () => AnyObject;
17
- NIcon: any;
18
20
  NSpace: any;
19
21
  NButton: any;
20
22
  Editor: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
@@ -51,6 +53,5 @@ declare const _default: import("vue").DefineComponent<{}, {
51
53
  }>> & {}, {
52
54
  isDisabled: boolean;
53
55
  }>>;
54
- CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
55
56
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
56
57
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,inject as n,reactive as e,ref as o,watch as i,withDirectives as l,openBlock as a,createElementBlock as s,createElementVNode as c,vShow as r,unref as u,createVNode as d,withCtx as y,createTextVNode as p}from"vue";import{NButton as f,NIcon as k,NSpace as m}from"naive-ui";import{InjectionAIChat as g}from"../types/index.js";import{$message as _}from"../utils/index.js";import h from"../../../editor/index.js";import{CloseOutline as v}from"@vicons/ionicons5";import{saveApi as j}from"../api/index.js";const C={class:"ai-chat-doctor__right"},w={class:"header"},b={class:"main"};var x=t({__name:"ChatRight",setup(t){const x=[{key:"zs_yy",title:"主诉"},{key:"xbs_fuk",title:"现病史"},{key:"jws_vtk",title:"既往史"},{key:"patient_allergy_sync",title:"过敏史"},{key:"tgjcms_wsssss",title:"体格检查描述"},{key:"marriage",title:"婚姻状况"},{key:"nation",title:"民族"},{key:"profession",title:"职业"},{key:"jkzk_wyuu",title:"一般健康状况"},{key:"ryljlz_tbyvrt",title:"外长期居住史"},{key:"yjbz_qisf1",title:"饮酒标志"},{key:"gydwufcjfsxwzjcs_aogt_oietyntrrqk",title:"工业毒物、粉尘及放射性物质接触史"},{key:"yqtysjcs_ua_uirqk",title:"疫区、疫水接触史"},{key:"ryct_tbsw",title:"入院查体"},{key:"fzjclg_lessxj",title:"辅助检查结果"},{key:"o_hn_iyjc_hr",title:"互认回填"},{key:"cbzd_phyo",title:"初步诊断"},{key:"zljh_yuya",title:"诊疗计划"},{key:"wdcqjzs_qftanwk",title:"外地长期居住史"}],{state:z,patientInfo:q}=n(g),R=e({toolbarKeys:[]}),D=o(""),$=o(Date.now().toString());async function I(){var t;try{const n=E();z.consultationContent.contents[0].content.details.autoBackFillData=n,await j({msgId:z.consultationContent.msgId,contents:z.consultationContent.contents,configs:null==(t=q.value)?void 0:t.info}),_.success("保存成功")}catch(t){console.log("error ==>",t)}}function B(){const t=E();console.log("json ==>",t,z.consultationContent),z.consultationContent.contents[0].content.details.autoBackFillData=t,z.params={opType:"create_medical",...z.consultationContent,contents:[{role:"user",content:"",contentType:"text"}],medicalInfo:z.consultationContent},z.sending=!0,z.loading=!0,z.loadingText="系统进入深度分析模式,正在整合数据,调取主诉,获取现病史、既往病史,读取过敏史,综合多维度信息生成诊断建议"}function E(){const t={};return x.forEach((n=>{const e=new RegExp(`<p><span.*?><strong>\\d+、${n.title}<\\/strong><\\/span><\\/p><p>(.*?)<\\/p>`,"i"),o=D.value.match(e);if(o&&o[1]){const e=o[1].trim();t[n.key]="<br>"===e?"":e}})),t}return i((()=>z.consultationContent),(t=>{var n,e,o;if(t){const{autoBackFillData:i}=(null==(o=null==(e=null==(n=null==t?void 0:t.contents)?void 0:n[0])?void 0:e.content)?void 0:o.details)||{};if(!i)return;x.forEach(((t,n)=>{D.value+=`<p><span style="font-size: 16px;"><strong>${n+1}、${t.title}</strong></span></p><p><span>${i[t.key]||""}</span></p><p>${n<x.length-1?"<br>":""}`}))}})),i((()=>z.showRight),(t=>{t||(z.consultationContent=null)})),i((()=>z.refreshMedical),(t=>{t&&($.value=Date.now().toString(),z.refreshMedical=!1)})),(t,n)=>l((a(),s("div",C,[c("div",w,[l(c("h4",null,"问诊记录",512),[[r,u(z).consultationContent]]),d(u(f),{quaternary:"",onClick:n[0]||(n[0]=()=>u(z).showRight=!1)},{icon:y((()=>[d(u(k),{size:"20",component:u(v)},null,8,["component"])])),_:1})]),l(c("div",b,[d(u(h),{"toolbar-config":R,modelValue:D.value,"onUpdate:modelValue":n[1]||(n[1]=t=>D.value=t)},null,8,["toolbar-config","modelValue"]),d(u(m),{class:"footer","wrap-item":!1},{default:y((()=>[d(u(f),{round:"",class:"gradient",disabled:u(z).loading,onClick:B},{default:y((()=>[p("审核完成")])),_:1},8,["disabled"]),d(u(f),{round:"",onClick:I},{default:y((()=>[p("暂存")])),_:1})])),_:1})],512),[[r,u(z).consultationContent]]),l((a(),s("div",{class:"main",id:"aiChatMedicalRecord",key:$.value})),[[r,!u(z).consultationContent]])],512)),[[r,u(z).showRight]])}});export{x as default};
1
+ import{defineComponent as t,reactive as n,ref as e,computed as o,watch as l,withDirectives as i,openBlock as s,createElementBlock as a,createVNode as r,unref as c,withCtx as u,createTextVNode as d,createCommentVNode as y,vShow as k}from"vue";import{NSpace as f,NButton as p}from"naive-ui";import{$message as g}from"../utils/index.js";import _ from"../../../editor/index.js";import{callbackApi as m}from"../api/index.js";import{useData as v}from"../hooks/useData.js";import"lodash-es";const h={class:"ai-chat-right"};var j=t({__name:"ChatRight",setup(t){const j=[{key:"zs_yy",title:"主诉"},{key:"xbs_fuk",title:"现病史"},{key:"jws_vtk",title:"既往史"},{key:"patient_allergy_sync",title:"过敏史"},{key:"tgjcms_wsssss",title:"体格检查描述"},{key:"marriage",title:"婚姻状况"},{key:"nation",title:"民族"},{key:"profession",title:"职业"},{key:"jkzk_wyuu",title:"一般健康状况"},{key:"ryljlz_tbyvrt",title:"外长期居住史"},{key:"yjbz_qisf1",title:"饮酒标志"},{key:"gydwufcjfsxwzjcs_aogt_oietyntrrqk",title:"工业毒物、粉尘及放射性物质接触史"},{key:"yqtysjcs_ua_uirqk",title:"疫区、疫水接触史"},{key:"ryct_tbsw",title:"入院查体"},{key:"fzjclg_lessxj",title:"辅助检查结果"},{key:"o_hn_iyjc_hr",title:"互认回填"},{key:"cbzd_phyo",title:"初步诊断"},{key:"zljh_yuya",title:"诊疗计划"},{key:"wdcqjzs_qftanwk",title:"外地长期居住史"}],{state:b,configs:w,sendMessage:C,isStreamingOutput:x}=v(),z=n({toolbarKeys:[]}),q=e(""),R=o((()=>{var t;return b.loading||!(null==(t=b.consultationContent)?void 0:t.id)}));async function D(){try{b.loading=!0;const t=$();b.consultationContent.contents[0].content.details.autoBackFillData=t,await m(b.consultationContent),g.success("保存成功")}catch(t){console.log("error ==>",t)}finally{b.loading=!1}}function S(){var t;const n=$();console.log("json ==>",n,b.consultationContent),b.consultationContent.contents[0].content.details.autoBackFillData=n,x.value||(b.loadingText="系统进入深度分析模式,正在整合数据,调取主诉,获取现病史、既往病史,读取过敏史,综合多维度信息生成诊断建议"),C({opType:"create_medical",...b.consultationContent,contents:[{role:"user",content:"",contentType:"text"}],medicalInfo:b.consultationContent,firstSubmit:!0,parentMsgId:b.consultationContent.msgId,flowResult:b.consultationContent.contents[0].content}),b.inquiryStr=(null==(t=b.consultationContent)?void 0:t.__title)||""}function $(){const t={};return j.forEach((n=>{const e=new RegExp(`<p><span.*?><strong>\\d+、${n.title}<\\/strong><\\/span><\\/p><p>(.*?)<\\/p>`,"i"),o=q.value.match(e);if(o&&o[1]){const e=o[1].trim();t[n.key]="<br>"===e?"":e}})),t}return l((()=>b.showRight),(t=>{var n,e,o,l;if(t){b.showRightSlot=!1;const{autoBackFillData:t}=(null==(l=null==(o=null==(e=null==(n=b.consultationContent)?void 0:n.contents)?void 0:e[0])?void 0:o.content)?void 0:l.details)||{};if(q.value="",!t)return;j.forEach(((n,e)=>{q.value+=`<p><span style="font-size: 16px;"><strong>${e+1}、${n.title}</strong></span></p><p><span>${t[n.key]||""}</span></p>`}));const i=Object.keys(t).reduce(((n,e)=>{var o;return n+=(null==(o=j.find((t=>t.key===e)))?void 0:o.title)+": "+t[e]+"\n"}),"");b.inquiryStr=i}else b.consultationContent=null})),(t,n)=>i((s(),a("div",h,[r(c(_),{"toolbar-config":z,modelValue:q.value,"onUpdate:modelValue":n[0]||(n[0]=t=>q.value=t)},null,8,["toolbar-config","modelValue"]),r(c(f),{class:"footer","wrap-item":!1},{default:u((()=>[r(c(p),{round:"",class:"gradient",disabled:c(b).loading,onClick:S},{default:u((()=>[d("审核完成")])),_:1},8,["disabled"]),r(c(p),{round:"",onClick:D,disabled:c(R)},{default:u((()=>[d("暂存")])),_:1},8,["disabled"]),y(' <n-button round @click="handleDelete" :disabled="state.loading" style="margin-left: auto">删除</n-button> ')])),_:1})],512)),[[k,c(b).showRight]])}});export{j as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,ref as i,computed as s,createVNode as l,resolveComponent as t,createTextVNode as n}from"vue";import{NSpace as o,NIcon as d,NImage as c,NButton as r}from"naive-ui";import m from"../../../../../shared/assets/img/file.png.js";import u from"../../../../../shared/assets/img/file-emr.png.js";import p from"../../../../../shared/assets/img/use.png.js";import{CheckmarkCircle as v}from"@vicons/ionicons5";import g from"./SelectIcon.js";import{InjectionAIChat as f}from"../../types/index.js";import{useProgram as h}from"../../hooks/useProgram.js";import{isArray as y,isString as b}from"lodash-es";var x=e({name:"ChatJsonCard",inheritAttrs:!1,props:{item:{type:Object,default:()=>({})},messageItem:{type:Object,default:()=>({})}},components:{NSpace:o,NIcon:d,NImage:c,SelectIcon:g},emits:[],setup(e,{attrs:o,slots:d,emit:c}){const{state:g,patientInfo:x}=a(f),{programMethod:_,MedicalOrderId:C,ReportId:I}=h(),{messageType:k,content:T}=e.messageItem,w=i([]),j=i([]),N=s((()=>{var e,a;return(null==(a=null==(e=x.value)?void 0:e.info)?void 0:a.vac01)||"1878974046080958465"})),S=s((()=>null==T?void 0:T.diagnosis)),E=s((()=>{var e;return"diagnosis_added"===k&&(null==(e=S.value)?void 0:e.length)})),O=s((()=>E.value||"medical_added"===k)),q=s((()=>"diagnosis"===k||"diagnosis_added"===k||"treatment_plan"===k));var D,P;"diagnosis_added"===k&&(w.value=null==(P=null==(D=T.recommendedExaminations)?void 0:D.map)?void 0:P.call(D,(e=>e.name)));const A=(e,a="name")=>{j.value.includes(e[a])?j.value=j.value.filter((i=>i!==e[a])):j.value.push(e[a])};function J(a,i){var s,l;null==(s=null==a?void 0:a.preventDefault)||s.call(a),null==(l=null==a?void 0:a.stopPropagation)||l.call(a);let t=i?[i]:[];arguments.length||(t=T.possibleConditions.filter((e=>j.value.includes(e.code)))),t.length&&(g.params={...e.item,opType:"diagnosis",contents:[{role:"user",content:"",contentType:"text"}],possibleConditions:t},g.sending=!0,g.loading=!0,g.loadingText="依据当前诊断与病历内容分析,正在筛为您筛选和匹配最适合的检验检查项目")}async function R(a,i){var s,l;if(b(a)||(null==(s=null==a?void 0:a.preventDefault)||s.call(a),null==(l=null==a?void 0:a.stopPropagation)||l.call(a)),"edit"===a){const e=i?w.value.includes(i.name)?[i.name]:[]:[...w.value];await _(C,{bbx05List:JSON.stringify(e),vac01:N.value,type:3})}else{let a=i?[i]:[];i||(a=T.recommendedExaminations.filter((e=>w.value.includes(e.name)))),g.params={...e.item,opType:"medical_order",contents:[{role:"user",content:"",contentType:"text"}],recommendedExaminations:a},g.sending=!0,g.loading=!0}}const L=async()=>{var e;const a=(null==(e=T.reports)?void 0:e[0])||{};await _(I,{vaa07:N.value,reportType:a.reportType,reportId:a.reportId})},M=async(e,a)=>{var i,s;null==(i=null==e?void 0:e.preventDefault)||i.call(e),null==(s=null==e?void 0:e.stopPropagation)||s.call(e);const l=a?[a.name]:j.value;await _(C,{drugNameList:JSON.stringify(l),vac01:N.value,type:3})},z=e=>{if(!("diagnosis_added"===k?!w.value.length:!j.value.length))return"diagnosis"===k?J():"diagnosis_added"===k?R(e):"treatment_plan"===k?M():void 0};async function H(){"medical"===k?(async()=>{g.consultationContent=null,g.showRight=!0,await _(C,{vac01:N.value,type:1})})():(g.consultationContent=e.item,g.showRight=!0)}const W=()=>l("div",{class:"diagnosis-added-box"},[l("div",{class:"recommended-wrap"},[l("div",{class:"title"},[n("检验检查推荐")]),T.recommendedExaminations.map((e=>l("div",{class:"recommended-item"},[l("div",{class:"top"},[l("div",{class:"left-tag"},[l("span",{class:["recommended-tag",{active:w.value.includes(e.name)}],onClick:()=>(e=>{w.value.includes(e.name)?w.value=w.value.filter((a=>a!==e.name)):w.value.push(e.name)})(e)},[e.name,l(t("select-icon"),{class:"select-icon",width:16},null)])]),l("img",{class:"right-icon",src:p,onClick:a=>R(a,e)},null)]),l("div",{class:"desc"},[e.description])])))])]);const $=()=>{if(!O.value)return null;return("medical_added"===k?[{}]:S.value).map((e=>l("div",{class:"card-header"},[l("span",{class:"left-title"},[l(t("n-icon"),{component:v},null),"medical_added"===k?"已完成申请单开立":`已添加诊断:${e.name}`]),"medical_added"===k?null:l("span",{class:"right-desc"},[n("创建时间: "),e.createdTime])])))},B=()=>{if(!q.value)return null;const e="diagnosis_added"===k?!w.value.length:!j.value.length;return l("div",{class:"card-footer"},[l("span",{class:"left-desc"},[n("请注意,推荐信息由AI生成,结果仅供临床参考")]),l("div",{class:"right-btns"},[l(r,{size:"large",disabled:e,onClick:()=>z("edit")},{default:()=>[n("编辑所选")]}),l("span",{class:["right-btn",{disabled:e}],onClick:()=>z()},[n("引用所选")])])])},F=()=>"inquiry"==k||"medical"==k?(()=>{var e,a;const i="inquiry"===k;return l("div",{class:"inquiry_medical-box",onClick:()=>H()},[l("div",{class:"left-img"},[l("img",{src:i?m:u},null)]),l("div",{class:"right-text"},[l("p",{class:"top-info"},[i?null==(e=T.summary)?void 0:e.inquiryStr:T.info]),l("p",{class:"sum-time"},[n("创建时间:"),(null==(a=T.summary)?void 0:a.creationTime)||T.creationTime])])])})():"diagnosis"==k?l("div",{class:"diagnosis-box"},[l("div",{class:"title"},[n("诊断辅助")]),l("div",{class:"desc"},[T.patientHistory]),T.possibleConditions.map((e=>l("div",{class:["con-item",{active:j.value.includes(e.code)}],onClick:()=>A(e,"code")},[l("div",{class:"top-content"},[l("div",{class:"left_wrap"},[l("a",{href:e.link,target:"_blank"},[n("【"),e.condition,n("】")]),e.code,n("("),e.probability,n(")")]),l("img",{class:"right-icon",src:p,onClick:a=>J(a,e)},null)]),l("div",{class:"btm-desc"},[e.description])])))]):"diagnosis_added"==k?W():"treatment_plan"==k?l("div",{class:"treatment-plan-box"},[l("div",{class:"top-div"},[l("div",{class:"title"},[T.title])]),l("div",{class:"desc"},[T.description]),l("div",{class:"medication-wrap"},[l("div",{class:"title"},[n("药物")]),T.medications.map((e=>l("div",{class:["medication-item",{active:j.value.includes(e.name)}],onClick:()=>A(e)},[l("div",{class:"top"},[l("div",{class:"name"},[e.name]),l("img",{class:"right-icon",src:p,onClick:a=>M(a,e)},null)]),l("ul",null,[l("li",null,[n("用量: "),e.dosage,e.purpose]),l("li",null,[n("用法: "),e.usageInstructions])])])))]),l("div",{class:"precaution-wrap"},[l("div",{class:"title"},[n("注意事项")]),l("div",{class:"precaution-div"},[T.precautions.map(((e,a)=>l("div",{class:"treatment-item"},[a+1,n(". "),e])))])])]):"report_message"==k?(()=>{var e,a;const i=(null==(e=T.reports)?void 0:e[0])||{},s=(null==(a=i.reportInterpretation)?void 0:a.replace(/\\n|\n|\r/g,"<br>").split("<br>"))||[""],o=s.map(((e,a)=>[e,a===s.length-1?null:l("br",null,null)]));return l("div",{class:"report-message-box"},[l("div",{class:"top-title"},[l("div",{class:"left-title"},[l(t("n-icon"),{component:v},null),i.reportName]),l("div",{class:"right-detail"},[l(r,{text:!0,onClick:L},{default:()=>[n("报告详情")]}),l(r,{text:!0},{default:()=>[n("推荐方案")]})])]),l("div",{class:"center-img"},[i.images.map((e=>"pdf"===e.imageType?l("embed",{class:"pdf-embed",src:e.image,type:"application/pdf"},null):l(t("n-image"),{src:e.image},null)))]),l("div",{class:"bottom-interpretation"},[o,l("div",{class:"desc-tip"},[n("请注意,辅助诊断由AI推荐,结果仅供临床参考。")])])])})():"medical_added"==k?function(){if(!y(T))return null;const e=T.map((e=>{const{itemName:a,sample:i,execDeptName:s}=e||{};let t="";a&&(t+=a);const n=()=>!t||t.endsWith("/")?"":"/";return i&&(t+=n()+i),s&&(t+=n()+s),l("div",{class:"item"},[l("span",null,[t]),l("span",{class:"time"},[e.beginExecTime])])}));return l("div",{class:"medical-added-box"},[e])}():"默认json内容";return()=>l("section",{class:"json-card_section"},[$(),l("div",{class:"card-content"},[F()]),B()])}});export{x as default};
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};
@@ -1,14 +1,16 @@
1
+ import { PropType } from 'vue';
2
+ import { MessageItem } from '../../types';
1
3
  declare const _default: import("vue").DefineComponent<{
2
- width: {
3
- type: NumberConstructor;
4
- default: number;
4
+ msgItem: {
5
+ type: PropType<MessageItem>;
6
+ default: () => {};
5
7
  };
6
8
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
- width: {
8
- type: NumberConstructor;
9
- default: number;
9
+ msgItem: {
10
+ type: PropType<MessageItem>;
11
+ default: () => {};
10
12
  };
11
13
  }>>, {
12
- width: number;
14
+ msgItem: MessageItem;
13
15
  }>;
14
16
  export default _default;