cnhis-design-vue 3.2.14-beta.2 → 3.2.14-beta.24

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 (233) hide show
  1. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  2. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  3. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  6. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  7. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  8. package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
  9. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  10. package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
  11. package/es/components/big-table/src/components/input-button.vue2.js +1 -1
  12. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  13. package/es/components/button-print/index.d.ts +4 -0
  14. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  15. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  16. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  17. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  18. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  19. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  20. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  21. package/es/components/classification/src/index.vue2.js +1 -1
  22. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  23. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  24. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  25. package/es/components/expand-field/src/index.vue2.js +1 -1
  26. package/es/components/expand-field/src/utils/constant.js +1 -1
  27. package/es/components/fabric-chart/index.d.ts +19 -2
  28. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +19 -2
  29. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  30. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  31. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  32. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  33. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  34. package/es/components/fabric-chart/src/constants/index.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  37. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  41. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  49. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  51. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  56. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  57. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  58. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  59. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  60. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  61. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  62. package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
  63. package/es/components/fabric-chart/src/utils/index.js +1 -1
  64. package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
  65. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  66. package/es/components/field-set/src/FieldFilter.vue.d.ts +5 -4
  67. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  68. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  69. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  70. package/es/components/field-set/src/Index.vue2.js +1 -1
  71. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  72. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  73. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  74. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  75. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  76. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  77. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  78. package/es/components/field-set/src/constants/filter.d.ts +21 -12
  79. package/es/components/field-set/src/constants/filter.js +1 -1
  80. package/es/components/field-set/src/constants/index.js +1 -1
  81. package/es/components/field-set/src/types/index.d.ts +1 -1
  82. package/es/components/form-config/index.d.ts +7 -5
  83. package/es/components/form-config/index.js +1 -1
  84. package/es/components/form-config/src/FormConfig.vue.d.ts +7 -5
  85. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  86. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +2 -0
  87. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  88. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +2 -2
  89. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  90. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  91. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  92. package/es/components/form-config/src/constants/index.d.ts +1 -11
  93. package/es/components/form-config/src/constants/index.js +1 -1
  94. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  95. package/es/components/form-config/src/hooks/useLocale.d.ts +52 -0
  96. package/es/components/form-config/src/hooks/useLocale.js +1 -0
  97. package/es/components/form-render/index.js +1 -1
  98. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  99. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  100. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  101. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  102. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  103. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  104. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  105. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
  106. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  107. package/es/components/form-render/src/utils/index.d.ts +1 -0
  108. package/es/components/form-render/src/utils/index.js +1 -1
  109. package/es/components/iho-chat/index.d.ts +612 -52
  110. package/es/components/iho-chat/src/Index.vue.d.ts +615 -59
  111. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  112. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  113. package/es/components/iho-chat/src/api/index.js +1 -1
  114. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
  115. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  116. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
  117. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  118. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
  119. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  120. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +221 -11
  121. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  122. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
  123. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  124. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
  125. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  126. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +20 -2
  127. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  128. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
  129. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  130. package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
  131. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  132. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  133. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  134. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
  135. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  136. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
  137. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  138. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +66 -1
  139. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  140. package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
  141. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  142. package/es/components/iho-chat/src/constants/index.d.ts +13 -3
  143. package/es/components/iho-chat/src/constants/index.js +1 -1
  144. package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
  145. package/es/components/iho-chat/src/hooks/index.js +1 -1
  146. package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
  147. package/es/components/iho-chat/src/hooks/useData.js +1 -0
  148. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  149. package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
  150. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  151. package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
  152. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
  153. package/es/components/iho-chat/src/types/index.d.ts +0 -6
  154. package/es/components/iho-chat/src/types/index.js +1 -1
  155. package/es/components/iho-chat/src/utils/index.d.ts +1 -0
  156. package/es/components/iho-chat/src/utils/index.js +1 -1
  157. package/es/components/iho-chat/style/index.css +1 -1
  158. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  159. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  160. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  161. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  162. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  163. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  164. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  165. package/es/components/iho-table/src/utils/index.js +1 -1
  166. package/es/components/index.css +1 -1
  167. package/es/components/index.js +1 -1
  168. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  169. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  170. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  171. package/es/components/map/src/Map.vue2.js +1 -1
  172. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
  173. package/es/components/quick-search/src/index.vue2.js +1 -1
  174. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
  175. package/es/components/scale-view/index.d.ts +31 -0
  176. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  177. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  178. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  179. package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
  180. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  181. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  182. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  183. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  184. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  185. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  186. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  187. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  188. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  189. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  190. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  191. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  192. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  193. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  194. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  195. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  196. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  197. package/es/components/scale-view/style/index.css +1 -1
  198. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  199. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  200. package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
  201. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  202. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  203. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  204. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
  205. package/es/components/select-person/src/index.vue2.js +1 -1
  206. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  207. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  208. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  209. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
  210. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  211. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  212. package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
  213. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  214. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +4 -7
  215. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  216. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -7
  217. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  218. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
  219. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -7
  220. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  221. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  222. package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
  223. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  224. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  225. package/es/shared/package.json.js +1 -1
  226. package/es/shared/types/index.d.ts +3 -0
  227. package/es/shared/utils/index.d.ts +1 -0
  228. package/es/shared/utils/index.js +1 -1
  229. package/package.json +2 -2
  230. package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
  231. package/es/components/iho-chat/src/hooks/useSession.js +0 -1
  232. package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
  233. package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as r,unref as n,withCtx as s,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),r(n(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[i(e.$slots,"trigger")])),default:s((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(n(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(n(w),{strong:"",secondary:"",onClick:W},{default:s((()=>[m(n(j),{size:"13",color:"#666666",component:n(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(n(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),r(n(j),{key:0,size:"16",color:"#666666",component:M.value?n(I):n(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(n(w),{circle:"",size:"small",secondary:""},{icon:s((()=>[m(n(j),{size:24,component:n(x),color:"#fff"},null,8,["component"])])),_:1}),m(n(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
1
+ import{defineComponent as t,ref as e,reactive as l,computed as n,openBlock as o,createBlock as a,unref as i,withCtx as r,renderSlot as s,createElementBlock as d,Fragment as c,withDirectives as u,createElementVNode as p,createVNode as v,createCommentVNode as g,toDisplayString as m,createTextVNode as w,renderList as y,vShow as f}from"vue";import{NPopover as k,NAvatar as h,NButton as b,NIcon as C}from"naive-ui";import{ChatbubbleEllipses as j,EyeOffOutline as L,EyeOutline as B,Close as I}from"@vicons/ionicons5";import{useData as _}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as x}from"../constants/index.js";import{openSessionApi as z,getUserDetailApi as N}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";const D={class:"person-profile-main"},S={class:"left"},$={class:"profile"},E={class:"profile__text"},P={class:"right"},q={class:"right__content"},G={class:"label"},O={class:"content"};var T=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:T}){var U,A,F,H,J,K,M,Q;const R=t,{state:V,openSession:W}=_(),X=e(!1),Y=e(!1),Z=e(!1),tt=l({}),et=[{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.115"))||"机构",value:"",key:"orgName"},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.116"))||"姓名",value:"",key:"name"},{label:(null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.117"))||"归属科室",value:"",key:"deptName"},{label:(null==(H=window.getLanguageByCode)?void 0:H.call(window,"10010.1.118"))||"业务科室",value:"",key:"businessDeptNames"},{label:(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.119"))||"手机号",value:"",key:"phone"},{label:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.120"))||"岗位",value:"",key:"post"},{label:(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.121"))||"工号",value:"",key:"jobId"},{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.122"))||"性别",value:"",key:"orgName"}],lt=n((()=>(tt.id&&et.forEach((t=>{const{key:e}=t;t.value=tt[e]})),et)));async function nt(){X.value=!1;let t=V.sessionList.find((t=>t.receiver===R.userId));if(!t)try{t=await z({chatType:x.SINGLE,receiver:R.userId,sender:V.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&W(t),T("close")}async function ot(t){if(!t)return;const e=await N({userId:R.userId});(null==e?void 0:e.id)?Object.assign(tt,e):tt.id=""}function at(t){const{key:e,value:l}=t;return"phone"!==e||Z.value?l:(l||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,l)=>(o(),a(i(k),{raw:"",class:"person-profile-wrapper",show:X.value,"onUpdate:show":[l[3]||(l[3]=t=>X.value=t),ot],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:r((()=>[s(e.$slots,"trigger")])),default:r((()=>[tt.id?(o(),d(c,{key:0},[u(p("div",D,[p("div",S,[p("div",$,[v(i(h),{src:tt.avatar,bordered:"",round:"",size:100,onClickCapture:l[0]||(l[0]=t=>Y.value=!0)},null,8,["src"]),g(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",E,[p("h4",null,m(tt.name),1),p("p",null,m(tt.orgName),1)]),v(i(b),{strong:"",secondary:"",onClick:nt},{default:r((()=>[v(i(C),{size:"13",color:"#666666",component:i(j),style:{"margin-right":"6px"}},null,8,["component"]),w(" 发消息 ")])),_:1})])]),p("div",P,[p("div",q,[(o(!0),d(c,null,y(i(lt),((t,e)=>(o(),d("div",{class:"info-item",key:e},[p("span",G,m(t.label),1),p("div",O,[p("span",null,m(at(t)),1),"phone"===t.key&&at(t)?(o(),a(i(C),{key:0,size:"16",color:"#666666",component:Z.value?i(L):i(B),style:{"margin-left":"10px"},onClick:l[1]||(l[1]=t=>Z.value=!Z.value)},null,8,["component"])):g("v-if",!0)])])))),128))])])],512),[[f,!Y.value]]),u(p("div",{class:"large-avatar",onClick:l[2]||(l[2]=t=>Y.value=!1)},[v(i(b),{circle:"",size:"small",secondary:""},{icon:r((()=>[v(i(C),{size:24,component:i(I),color:"#fff"},null,8,["component"])])),_:1}),v(i(h),{size:310,round:"",src:tt.avatar},null,8,["src"])],512),[[f,Y.value]])],64)):g("v-if",!0)])),_:3},8,["show","trigger"]))}});export{T as default};
@@ -1,9 +1,11 @@
1
+ import { CSSProperties } from 'vue';
1
2
  import { AnyObject } from '../../../../shared/types';
2
3
  import { formatTime } from '../utils';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
4
5
  filterKey: {
5
6
  all: string;
6
7
  unread: string;
8
+ ended: string;
7
9
  };
8
10
  unreadSessionKeys: string[];
9
11
  flexWidth: import("vue").Ref<number>;
@@ -13,19 +15,82 @@ declare const _default: import("vue").DefineComponent<{}, {
13
15
  label: string;
14
16
  key: string;
15
17
  }[]>;
18
+ contextmenuRef: import("vue").Ref<any>;
19
+ showMenu: import("vue").Ref<boolean>;
20
+ menuPosition: any;
21
+ sessionId: import("vue").Ref<any>;
16
22
  currentFilterKey: import("vue").Ref<string>;
17
- state: import("../types").IState;
23
+ state: {
24
+ orgId: string | number;
25
+ currentSessionItem: AnyObject;
26
+ id: string;
27
+ userInfo: AnyObject;
28
+ msgList: AnyObject[];
29
+ currentMsg: AnyObject;
30
+ isAppendMsg: boolean;
31
+ sessionList: AnyObject[];
32
+ isChangeSession: boolean;
33
+ updateSessionItem: AnyObject;
34
+ isUpdateSession: boolean;
35
+ currentReferenceMsg: AnyObject | null;
36
+ currentReEditMsg: AnyObject | null;
37
+ showVideo: boolean;
38
+ currentAVMsg: AnyObject;
39
+ currentGroupUser: AnyObject[];
40
+ showMultipleVideo: boolean;
41
+ };
18
42
  unreadTotal: import("vue").ComputedRef<number>;
19
43
  openSession: (item: AnyObject) => Promise<void>;
44
+ setUpdateSessionItem: (item: AnyObject) => void;
20
45
  currentWidth: import("vue").ComputedRef<number>;
21
46
  sessionList: import("vue").ComputedRef<AnyObject[]>;
47
+ getLabelNum: (session: AnyObject) => number;
22
48
  changeWidth: ({ distance }: AnyObject) => void;
23
49
  handleFilter: (key: string) => void;
24
50
  showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
51
+ handleContextmenu: (event: MouseEvent, id: string) => Promise<void>;
52
+ handleSelect: (key: string, session: AnyObject) => Promise<void>;
25
53
  NSpin: any;
26
54
  NBadge: any;
27
55
  NAvatar: any;
28
56
  NTag: any;
57
+ ContextMenu: import("vue").DefineComponent<{
58
+ type: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
62
+ show: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
66
+ position: {
67
+ type: import("vue").PropType<CSSProperties>;
68
+ };
69
+ id: {
70
+ type: StringConstructor;
71
+ };
72
+ }, () => JSX.Element | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show")[], "select" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
73
+ type: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
77
+ show: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ position: {
82
+ type: import("vue").PropType<CSSProperties>;
83
+ };
84
+ id: {
85
+ type: StringConstructor;
86
+ };
87
+ }>> & {
88
+ onSelect?: ((...args: any[]) => any) | undefined;
89
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
90
+ }, {
91
+ type: string;
92
+ show: boolean;
93
+ }>;
29
94
  vFlexibleResize: {
30
95
  mounted(el: any, { value }: any): void;
31
96
  beforeUnmount(el: any): void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,computed as l,withDirectives as i,openBlock as a,createElementBlock as t,normalizeStyle as n,unref as r,createBlock as o,createCommentVNode as u,createElementVNode as d,Fragment as v,renderList as m,withCtx as c,createTextVNode as p,toDisplayString as k,normalizeClass as f,createVNode as y,vShow as _}from"vue";import{NSpin as h,NTag as g,NAvatar as x,NBadge as M}from"naive-ui";import{useState as b}from"../hooks/useState.js";import{useSession as S}from"../hooks/useSession.js";import"trtc-sdk-v5";import{listSort as T,formatTime as C}from"../utils/index.js";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";const j={class:"sider-list__filter box-shadow"},L=["onClick"],R={class:"avatar-right"},w={class:"name"},H={class:"msg-tip"},z={class:"msg-tip__content"},K={key:0},W=["innerHTML"];var A=e({__name:"SiderList",setup(e){const A="all",B="unread";let D=[];const I=s(300),V=s(),q=s(!1),E=s([{label:"全部",key:A},{label:"未读",key:B}]),F=s("all"),{state:G,unreadTotal:J}=b(),{openSession:O}=S(G),P=l((()=>Math.min(Math.max(I.value,240),360))),Q=l((()=>T(G.sessionList)));function U({distance:e}){I.value=I.value+e}function X(e,s=r(F)){var l;return s===A||(s===B?D.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:void 0)}return(e,s)=>i((a(),t("section",{class:"sider-list",style:n({width:r(P)+"px"})},[q.value?(a(),o(r(h),{key:0,stroke:"#5585f5"})):u("v-if",!0),u(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),d("div",j,[(a(!0),t(v,null,m(E.value,(e=>(a(),o(r(g),{type:F.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return s=e.key,F.value=s,void(s===B&&(D=(Q.value.filter((e=>{var s;return(null!=(s=e.unreadNum)?s:0)>0}))||[]).map((e=>e.sessionKey))));var s}},{default:c((()=>[p(k(e.label)+"("+k(r(J))+") ",1)])),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:V},[(a(!0),t(v,null,m(r(Q),(e=>i((a(),t("div",{key:e.id,onClick:()=>r(O)(e),class:f(["sider-list__box__item",{active:e.id===r(G).id},e.topping?"sider-list__box__item--top":""])},[y(r(x),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",R,[d("div",w,[d("h4",null,k(e.name),1),d("span",null,k(e.lastMessage?r(C)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",H,[d("div",z,["WITHDRAWN"===e.lastMessageStatus?(a(),t("div",K,"撤回了一条消息")):(a(),t("div",{key:1,innerHTML:e.lastMessageContent},null,8,W))]),y(r(M),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],10,L)),[[_,X(e)]]))),128))],512)],4)),[[r(N),{mode:"VR",onMove:U}]])}});export{A as default};
1
+ import{defineComponent as e,ref as t,computed as l,withDirectives as i,openBlock as n,createElementBlock as o,normalizeStyle as s,unref as a,createBlock as u,createCommentVNode as d,createElementVNode as r,Fragment as v,renderList as p,withCtx as c,createTextVNode as m,toDisplayString as g,withModifiers as f,normalizeClass as y,createVNode as w,vShow as k,nextTick as h}from"vue";import{NSpin as x,NTag as _,NAvatar as C,NBadge as b}from"naive-ui";import M from"./ContextMenu.js";import{useData as j}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as L}from"../constants/index.js";import{toppingSessionApi as B}from"../api/index.js";import{listSort as N,formatTime as R}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as S}from"../../../../shared/directive/flexibleResize.js";const T={class:"sider-list__filter box-shadow"},D=["onClick","onContextmenu"],E={class:"avatar-right"},H={class:"name"},z={class:"msg-tip"},I={class:"msg-tip__content"},K={key:0},U=["innerHTML"];var W=e({__name:"SiderList",setup(e){var W,A,V;const X="all",Y="unread",$="ended";let q=[];const F=t(300),G=t(),J=t(!1),O=t([{label:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.123"))||"全部",key:X},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.124"))||"未读",key:Y},{label:(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.77"))||"结束",key:$}]),P=t(),Q=t(!1),Z=t({left:0,top:0}),ee=t(),te=t("all"),{state:le,unreadTotal:ie,openSession:ne,setUpdateSessionItem:oe}=j(),se=l((()=>Math.min(Math.max(F.value,240),360))),ae=l((()=>N(le.sessionList)));function ue({distance:e}){F.value=F.value+e}function de(e,t=a(te)){var l;return t===X||(t===Y?q.includes(e.sessionKey)||(null!=(l=e.unreadNum)?l:0)>0:t===$?e.status===L.ENDED:void 0)}async function re(e,t){if("topping"!==e);else try{await B({id:t.id,topping:!(null==t?void 0:t.topping)}),oe({...t,topping:!(null==t?void 0:t.topping)})}catch(e){}}return(e,t)=>i((n(),o("section",{class:"sider-list",style:s({width:a(se)+"px"})},[J.value?(n(),u(a(x),{key:0,stroke:"#5585f5"})):d("v-if",!0),d(' <n-input v-else placeholder="输入用户名模糊搜索" v-model:value="keyword" @keyup.enter="handleSearch"></n-input> '),r("div",T,[(n(!0),o(v,null,p(O.value,(e=>(n(),u(a(_),{type:te.value===e.key?"info":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,te.value=t,void(t===Y&&(q=(ae.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:c((()=>{return[m(g(e.label)+"("+g((t=e,t.key===$?ae.value.filter((e=>e.status===L.ENDED)).length:ie.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),r("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:G},[(n(!0),o(v,null,p(a(ae),(e=>{var t;return i((n(),o("div",{key:e.id,onClick:()=>a(ne)(e),onContextmenu:f((t=>async function(e,t){var l,i,n,o,s;ee.value=t,Q.value=!0,await h();const{clientX:a,clientY:u}=e,{width:d=0,height:r=0,left:v=0,top:p=0}=(null==(l=G.value)?void 0:l.getBoundingClientRect())||{},{width:c=100,height:m=80}=(null==(n=null==(i=P.value)?void 0:i.$el)?void 0:n.getBoundingClientRect())||{},g=null!=(s=null==(o=G.value)?void 0:o.scrollTop)?s:0,f={};a<v+d-(c+2)-5?f.left=a-v+5+"px":f.right=v+d-a+5+"px",p+r-u<=m+5?f.bottom=5-g+"px":f.top=u-p+g+5+"px",Z.value=f}(t,e.id)),["prevent"]),class:y(["sider-list__box__item",{active:e.id===a(le).id},e.topping?"sider-list__box__item--top":""])},[w(a(C),{round:"",size:"large",src:e.avatar},null,8,["src"]),r("div",E,[r("div",H,[r("h4",null,g(e.name),1),r("span",null,g(e.lastMessage?a(R)(e.lastMessageSendTime).siderMsgTime:""),1)]),r("div",z,[r("div",I,["WITHDRAWN"===e.lastMessageStatus?(n(),o("div",K,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(n(),o("div",{key:1,innerHTML:e.lastMessageContent},null,8,U))]),w(a(b),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,D)),[[k,de(e)]])})),128)),w(a(M),{ref_key:"contextmenuRef",ref:P,show:Q.value,"onUpdate:show":t[0]||(t[0]=e=>Q.value=e),type:"session",position:Z.value,id:ee.value,onSelect:re},null,8,["show","position","id"])],512)],4)),[[a(S),{mode:"VR",onMove:ue}]])}});export{W as default};
@@ -6,7 +6,25 @@ declare const _default: import("vue").DefineComponent<{}, {
6
6
  content: import("../../../../shared/types").AnyObject;
7
7
  receiver?: string | undefined;
8
8
  }) => Promise<void>;
9
- state: import("../types").IState;
9
+ state: {
10
+ orgId: string | number;
11
+ currentSessionItem: import("../../../../shared/types").AnyObject;
12
+ id: string;
13
+ userInfo: import("../../../../shared/types").AnyObject;
14
+ msgList: import("../../../../shared/types").AnyObject[];
15
+ currentMsg: import("../../../../shared/types").AnyObject;
16
+ isAppendMsg: boolean;
17
+ sessionList: import("../../../../shared/types").AnyObject[];
18
+ isChangeSession: boolean;
19
+ updateSessionItem: import("../../../../shared/types").AnyObject;
20
+ isUpdateSession: boolean;
21
+ currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
22
+ currentReEditMsg: import("../../../../shared/types").AnyObject | null;
23
+ showVideo: boolean;
24
+ currentAVMsg: import("../../../../shared/types").AnyObject;
25
+ currentGroupUser: import("../../../../shared/types").AnyObject[];
26
+ showMultipleVideo: boolean;
27
+ };
10
28
  trtc: TRTC;
11
29
  timing: import("vue").Ref<string>;
12
30
  voiceOpen: import("vue").Ref<boolean>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as n,watch as t,onBeforeUnmount as s,openBlock as r,createElementBlock as a,withDirectives as l,createElementVNode as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as f}from"vue";import{NAvatar as g,NButton as I,NIcon as h}from"naive-ui";import{Mic as A,MicOffCircle as y,Call as E}from"@vicons/ionicons5";import"lodash-es";import"date-fns";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import{avFinishApi as w}from"../api/index.js";import{useVideo as k}from"../hooks/useVideo.js";import S from"trtc-sdk-v5";const M={class:"video-wrapper"},b={class:"user"},T={class:"name"},x={class:"tip"},C={class:"opt-btn"},_={class:"btn"},N=i("span",null,"静音",-1),L=i("span",null,"拒接",-1),D={class:"btn"},H=i("span",null,"挂断",-1),j=i("span",null,"接听",-1);var z=e({__name:"Video",setup(e){const{sendMessage:z,state:U,trtc:F,timing:O,voiceOpen:G,isAudio:J,isCall:P,startTimer:$,resetTimer:q,toggleAudio:B,messageTypeText:K,time:Q,installEventHandlers:W,uninstallEventHandlers:X}=k(),Y=o(),Z=o(),ee=o(!1);let oe=null;const ne=n((()=>{var e,o,n;return P.value?{avatar:U.currentSessionItem.avatar,name:U.currentSessionItem.name,userId:U.currentSessionItem.receiver}:{avatar:null==(e=U.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=U.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=U.currentAVMsg.currentMsg)?void 0:n.sender}})),te=n((()=>ee.value?J.value?O.value:"":P.value?"正在呼叫...":`邀请你${K.value}问诊...`)),se=n((()=>{var e,o;return null==(o=null==(e=U.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function re(e=V.FINISHED){z({chatType:R.SINGLE,content:{msg:e===V.FINISHED?""+Q.seconds:"s",chatMessageType:U.currentAVMsg.chatMessageType,avStatus:e},receiver:ne.value.userId}),await w({recordId:U.currentAVMsg.currentMsg.id,status:e,duration:e===V.FINISHED?Q.seconds:0})}async function ae(){const e=await S.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(U.showVideo=!1);try{if(await F.enterRoom({strRoomId:U.currentAVMsg.strRoomId,sdkAppId:parseInt(U.userInfo.sdkAppID),userId:U.userInfo.id,userSig:U.userInfo.userSig}),P.value||(ee.value=!0,$()),W({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await F.startLocalAudio(),J.value)return;await F.startLocalVideo({view:Z.value})}catch(e){console.log("error :>> ",e),U.showVideo=!1}}function le(){P.value&&!ee.value?re(V.CANCELED):re()}async function ie(){try{if(U.showVideo=!1,X({handleError:me,handleRemoteUserEnter:de,handleRemoteAudioAvailable:ue,handleRemoteUserExit:ve,handleRemoteVideoAvailable:ce}),await F.exitRoom(),await F.stopLocalAudio(),J.value)return;await F.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ce(e){const{userId:o,streamType:n}=e;try{await F.startRemoteVideo({userId:o,streamType:n,view:Y.value})}catch(e){console.log("error :>> ",e)}}function ue(e){}function de(){ee.value=!0,$()}function ve(e){console.log("event :>> 对方已挂断",e),ie()}function me(e){console.log("error :>> ",e),U.showVideo=!1}return t((()=>se.value),(e=>{U.showVideo&&(e===V.IN_CALL?async function(){P.value?ae():(oe&&clearTimeout(oe),oe=setTimeout((async()=>{ee.value||re(V.NO_RESPONSE)}),6e4))}():ie())}),{immediate:!0}),s((()=>{ie()})),(e,o)=>(r(),a("div",M,[l(i("div",{class:"video-box",ref_key:"videoRef",ref:Y},null,512),[[c,ee.value]]),l(i("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:Z},null,512),[[c,ee.value]]),l(i("div",b,[u(d(g),{size:58,round:"",src:d(ne).avatar},null,8,["src"]),i("span",T,v(d(ne).name),1),i("span",x,v(d(te)),1)],512),[[c,d(J)||!ee.value]]),i("div",C,[i("div",_,[d(P)&&!ee.value||ee.value?(r(),a(m,{key:0},[u(d(I),{circle:"",onClick:d(B),class:p({bordered:d(G)})},{icon:f((()=>[u(d(h),{size:"30",color:d(G)?"#fff":"#626262",component:d(G)?d(A):d(y)},null,8,["color","component"])])),_:1},8,["onClick","class"]),N],64)):(r(),a(m,{key:1},[u(d(I),{circle:"",color:"#f17568",class:"btn--rotate",onClick:o[0]||(o[0]=()=>re(d(V).REJECTED))},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),L],64))]),i("div",D,[d(P)&&!ee.value||ee.value?(r(),a(m,{key:0},[u(d(I),{circle:"",color:"#f17568",class:"btn--rotate",onClick:le},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),H],64)):(r(),a(m,{key:1},[u(d(I),{circle:"",color:"#2ac98b",onClick:ae},{icon:f((()=>[u(d(h),{size:"30",component:d(E)},null,8,["component"])])),_:1}),j],64))])])]))}});export{z as default};
1
+ import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as r,openBlock as a,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as I,MicOffCircle as y,Call as A}from"@vicons/ionicons5";import{avFinishApi as k}from"../api/index.js";import"@vueuse/core";import{$message as E}from"../utils/index.js";import"lodash-es";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as S}from"../hooks/useVideo.js";import C from"trtc-sdk-v5";var M,b,L,T;const j={class:"video-wrapper"},x={class:"user"},_={class:"name"},N={class:"tip"},H={class:"opt-btn"},D={class:"btn"},z=e("span",null,(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.104"))||"静音",-1),B=e("span",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.113"))||"拒接",-1),U={class:"btn"},F=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.125"))||"挂断",-1),O=e("span",null,(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.114"))||"接听",-1);var G=o({__name:"Video",setup(o){const{sendMessage:M,state:b,trtc:L,timing:T,voiceOpen:G,isAudio:J,isCall:P,startTimer:$,resetTimer:q,toggleAudio:K,messageTypeText:Q,time:W,installEventHandlers:X,uninstallEventHandlers:Y}=S(),Z=n(),ee=n(),oe=n(!1);let ne=null;const se=s((()=>{var e,o,n;return P.value?{avatar:b.currentSessionItem.avatar,name:b.currentSessionItem.name,userId:b.currentSessionItem.receiver}:{avatar:null==(e=b.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=b.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=b.currentAVMsg.currentMsg)?void 0:n.sender}})),te=s((()=>oe.value?J.value?T.value:"":P.value?"正在呼叫...":`邀请你${Q.value}问诊...`)),re=s((()=>{var e,o;return null==(o=null==(e=b.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function ae(e=V.FINISHED){M({chatType:R.SINGLE,content:{msg:e===V.FINISHED?""+W.seconds:"s",chatMessageType:b.currentAVMsg.chatMessageType,avStatus:e},receiver:se.value.userId}),await k({recordId:b.currentAVMsg.currentMsg.id,status:e,duration:e===V.FINISHED?W.seconds:0})}async function le(){const e=await C.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(b.showVideo=!1);try{if(await L.enterRoom({strRoomId:b.currentAVMsg.strRoomId,sdkAppId:parseInt(b.userInfo.sdkAppID),userId:b.userInfo.id,userSig:b.userInfo.userSig}),P.value||(oe.value=!0,$()),X({handleError:pe,handleRemoteUserEnter:ve,handleRemoteAudioAvailable:de,handleRemoteUserExit:me,handleRemoteVideoAvailable:ue}),await L.startLocalAudio(),J.value)return;await L.startLocalVideo({view:ee.value})}catch(e){console.log("error :>> ",e),E.error(e),b.showVideo=!1}}function ie(){P.value&&!oe.value?ae(V.CANCELED):ae()}async function ce(){try{if(b.showVideo=!1,Y({handleError:pe,handleRemoteUserEnter:ve,handleRemoteAudioAvailable:de,handleRemoteUserExit:me,handleRemoteVideoAvailable:ue}),await L.exitRoom(),await L.stopLocalAudio(),J.value)return;await L.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function ue(e){const{userId:o,streamType:n}=e;try{await L.startRemoteVideo({userId:o,streamType:n,view:Z.value})}catch(e){console.log("error :>> ",e)}}function de(e){}function ve(){oe.value=!0,$()}function me(e){console.log("event :>> 对方已挂断",e),ce()}function pe(e){console.log("error :>> ",e),b.showVideo=!1}return t((()=>re.value),(e=>{b.showVideo&&(e===V.IN_CALL?async function(){P.value?le():(ne&&clearTimeout(ne),ne=setTimeout((async()=>{oe.value||ae(V.NO_RESPONSE)}),6e4))}():ce())}),{immediate:!0}),r((()=>{ce()})),(o,n)=>(a(),l("div",j,[i(e("div",{class:"video-box",ref_key:"videoRef",ref:Z},null,512),[[c,oe.value]]),i(e("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:ee},null,512),[[c,oe.value]]),i(e("div",x,[u(d(f),{size:58,round:"",src:d(se).avatar},null,8,["src"]),e("span",_,v(d(se).name),1),e("span",N,v(d(te)),1)],512),[[c,d(J)||!oe.value]]),e("div",H,[e("div",D,[d(P)&&!oe.value||oe.value?(a(),l(m,{key:0},[u(d(w),{circle:"",onClick:d(K),class:p({bordered:d(G)})},{icon:g((()=>[u(d(h),{size:"30",color:d(G)?"#fff":"#626262",component:d(G)?d(I):d(y)},null,8,["color","component"])])),_:1},8,["onClick","class"]),z],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:n[0]||(n[0]=()=>ae(d(V).REJECTED))},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),B],64))]),e("div",U,[d(P)&&!oe.value||oe.value?(a(),l(m,{key:0},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:ie},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),F],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#2ac98b",onClick:le},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),O],64))])])]))}});export{G as default};
@@ -24,12 +24,13 @@ export declare enum MESSAGE_TYPE {
24
24
  * 订阅消息类别
25
25
  */
26
26
  export declare enum SUBSCRIBE_MESSAGE_TYPE {
27
- JOIN = "JOIN",
28
- LEAVE = "LEAVE",
27
+ JOIN_GROUP = "JOIN_GROUP",
28
+ LEAVE_GROUP = "LEAVE_GROUP",
29
29
  NEW_SESSION = "NEW_SESSION",
30
30
  MESSAGE = "MESSAGE",
31
31
  AV_STATUS = "AV_STATUS",
32
- RECALL_MESSAGE = "RECALL_MESSAGE"
32
+ RECALL_MESSAGE = "RECALL_MESSAGE",
33
+ DISABLE_SESSION = "DISABLE_SESSION"
33
34
  }
34
35
  /**
35
36
  * 音视频接通状态
@@ -42,3 +43,12 @@ export declare enum AV_STATUS {
42
43
  REJECTED = "REJECTED",
43
44
  CANCELED = "CANCELED"
44
45
  }
46
+ /**
47
+ * 会话状态
48
+ */
49
+ export declare enum STATUS {
50
+ REMOVED = "REMOVED",
51
+ ENABLED = "ENABLED",
52
+ ENDED = "ENDED",
53
+ EXITED = "EXITED"
54
+ }
@@ -1 +1 @@
1
- var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),S=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(S||{}),A=(E=>(E.JOIN="JOIN",E.LEAVE="LEAVE",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E.RECALL_MESSAGE="RECALL_MESSAGE",E))(A||{}),L=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(L||{});export{L as AV_STATUS,E as CHAT_TYPE,S as MESSAGE_TYPE,A as SUBSCRIBE_MESSAGE_TYPE};
1
+ var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),S=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(S||{}),A=(E=>(E.JOIN_GROUP="JOIN_GROUP",E.LEAVE_GROUP="LEAVE_GROUP",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E.RECALL_MESSAGE="RECALL_MESSAGE",E.DISABLE_SESSION="DISABLE_SESSION",E))(A||{}),I=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(I||{}),L=(E=>(E.REMOVED="REMOVED",E.ENABLED="ENABLED",E.ENDED="ENDED",E.EXITED="EXITED",E))(L||{});export{I as AV_STATUS,E as CHAT_TYPE,S as MESSAGE_TYPE,L as STATUS,A as SUBSCRIBE_MESSAGE_TYPE};
@@ -1,3 +1,3 @@
1
- export * from './useState';
2
- export * from './useSession';
1
+ export * from './useData';
2
+ export * from './useWebSocket';
3
3
  export * from './useVideo';
@@ -1 +1 @@
1
- export{useState}from"./useState.js";export{useSession}from"./useSession.js";export{useVideo}from"./useVideo.js";
1
+ export{InjectionIChatData,initData,useData}from"./useData.js";export{useWebSocket}from"./useWebSocket.js";export{useVideo}from"./useVideo.js";
@@ -0,0 +1,94 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { ChatSock } from '../utils/chatSock';
3
+ import { AnyObject } from '../../../../shared/types';
4
+ export declare const InjectionIChatData: InjectionKey<ReturnType<typeof initData>>;
5
+ export declare function initData(props: AnyObject, emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void): {
6
+ cssVars: import("vue").ComputedRef<AnyObject>;
7
+ stompClient: import("vue").Ref<ChatSock | undefined>;
8
+ state: {
9
+ orgId: string | number;
10
+ currentSessionItem: AnyObject;
11
+ id: string;
12
+ userInfo: AnyObject;
13
+ msgList: AnyObject[];
14
+ currentMsg: AnyObject;
15
+ isAppendMsg: boolean;
16
+ sessionList: AnyObject[];
17
+ isChangeSession: boolean;
18
+ updateSessionItem: AnyObject;
19
+ isUpdateSession: boolean;
20
+ currentReferenceMsg: AnyObject | null;
21
+ currentReEditMsg: AnyObject | null;
22
+ showVideo: boolean;
23
+ currentAVMsg: AnyObject;
24
+ currentGroupUser: AnyObject[];
25
+ showMultipleVideo: boolean;
26
+ };
27
+ unreadTotal: import("vue").ComputedRef<number>;
28
+ isGroupChat: import("vue").ComputedRef<boolean>;
29
+ isGroupLeader: import("vue").ComputedRef<boolean>;
30
+ isEnded: import("vue").ComputedRef<boolean>;
31
+ setMsgList: (list?: AnyObject[]) => void;
32
+ sendMessage: (message: {
33
+ chatType?: string;
34
+ content: AnyObject;
35
+ receiver?: string;
36
+ }) => Promise<void>;
37
+ relayMessage: (param: {
38
+ checkedIds: string[];
39
+ remark: string;
40
+ content: AnyObject;
41
+ }) => Promise<void>;
42
+ openSession: (item: AnyObject) => Promise<void>;
43
+ closeSession: () => AnyObject | null;
44
+ getCurrentSession: () => AnyObject | null;
45
+ setCurrentSessionItem: (item: AnyObject) => void;
46
+ setUpdateSessionItem: (item: AnyObject) => void;
47
+ setSessionList: (list: AnyObject[]) => void;
48
+ emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
49
+ };
50
+ export declare const useData: () => {
51
+ cssVars: import("vue").ComputedRef<AnyObject>;
52
+ stompClient: import("vue").Ref<ChatSock | undefined>;
53
+ state: {
54
+ orgId: string | number;
55
+ currentSessionItem: AnyObject;
56
+ id: string;
57
+ userInfo: AnyObject;
58
+ msgList: AnyObject[];
59
+ currentMsg: AnyObject;
60
+ isAppendMsg: boolean;
61
+ sessionList: AnyObject[];
62
+ isChangeSession: boolean;
63
+ updateSessionItem: AnyObject;
64
+ isUpdateSession: boolean;
65
+ currentReferenceMsg: AnyObject | null;
66
+ currentReEditMsg: AnyObject | null;
67
+ showVideo: boolean;
68
+ currentAVMsg: AnyObject;
69
+ currentGroupUser: AnyObject[];
70
+ showMultipleVideo: boolean;
71
+ };
72
+ unreadTotal: import("vue").ComputedRef<number>;
73
+ isGroupChat: import("vue").ComputedRef<boolean>;
74
+ isGroupLeader: import("vue").ComputedRef<boolean>;
75
+ isEnded: import("vue").ComputedRef<boolean>;
76
+ setMsgList: (list?: AnyObject[]) => void;
77
+ sendMessage: (message: {
78
+ chatType?: string;
79
+ content: AnyObject;
80
+ receiver?: string;
81
+ }) => Promise<void>;
82
+ relayMessage: (param: {
83
+ checkedIds: string[];
84
+ remark: string;
85
+ content: AnyObject;
86
+ }) => Promise<void>;
87
+ openSession: (item: AnyObject) => Promise<void>;
88
+ closeSession: () => AnyObject | null;
89
+ getCurrentSession: () => AnyObject | null;
90
+ setCurrentSessionItem: (item: AnyObject) => void;
91
+ setUpdateSessionItem: (item: AnyObject) => void;
92
+ setSessionList: (list: AnyObject[]) => void;
93
+ emit: (event: 'template-click' | 'unread-message-update' | 'session-change' | 'session-close', ...args: any[]) => void;
94
+ };
@@ -0,0 +1 @@
1
+ import{ref as e,reactive as s,computed as t,watch as n,inject as i,toRaw as r}from"vue";import{openSessionApi as o,groupUserApi as a}from"../api/index.js";import{promiseTimeout as c,useIntervalFn as u}from"@vueuse/core";import{listSort as m,formatTime as d,transformMessage as l,getFileSize as p,simplifyMessage as g}from"../utils/index.js";import{cloneDeep as h,isArray as f,uniqBy as S}from"lodash-es";import{STATUS as T,CHAT_TYPE as I,MESSAGE_TYPE as y}from"../constants/index.js";import{useTheme as v}from"../../../../shared/hooks/useTheme.js";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";const L=Symbol("InjectionIChatData");function M(e){return e.chatType===I.GROUP}function C(e){const{lastMessage:s,lastSenderName:t=""}=e,n=g(s)||"";return M(e)&&t?t+": "+n:n}function N(i,g){const L=e(),N=s({orgId:i.orgId,currentSessionItem:{},id:"",userInfo:{id:i.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),U=v(),j=t((()=>N.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),w=t((()=>M(N.currentSessionItem))),E=t((()=>{var e,s,t;return(null==(e=N.userInfo)?void 0:e.id)===(null==(t=null==(s=N.currentGroupUser)?void 0:s[0])?void 0:t.id)})),G=t((()=>{var e;return(null==(e=N.currentSessionItem)?void 0:e.status)===T.ENDED}));n((()=>j.value),(e=>{!async function s(t=0){if(t>2)return;const n=N.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?g("unread-message-update",e,m(n)):(await c(300),s(++t))}()})),n([()=>N.isChangeSession,()=>N.isUpdateSession],(([e,s])=>{e&&(x(N.currentSessionItem),N.isChangeSession=!1),s&&(x(N.updateSessionItem),N.isUpdateSession=!1)}),{immediate:!0});const{pause:_,resume:D,isActive:K}=u((()=>{const e=h(N.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=d(s).recordTime,!0)})),N.msgList=e,R()||_()}),6e4,{immediate:!1});function R(){return!!N.msgList.length&&N.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function O(e){var s;try{null==(s=L.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:N.currentSessionItem.chatType,receiver:N.currentSessionItem.receiver,...e}))}catch(e){}}function k(e){Object.assign(N.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?C({...e,chatType:e.chatType||N.currentSessionItem.chatType}):N.currentSessionItem.lastMessageContent}),N.isChangeSession=!0,N.id!==N.currentSessionItem.id&&(N.msgList=[],N.id=N.currentSessionItem.id)}function b(e){N.sessionList=h(S(e,"id")),N.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:C(e)}),e.receiver===N.userInfo.id&&(e.unreadNum=0),e.chatType!==I.GROUP||e.name||a({id:e.receiver}).then((s=>{f(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function x(e){!e.id||N.sessionList.map((e=>e.id)).includes(e.id)?N.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==N.currentSessionItem.sessionKey&&s.sender&&s.sender!==N.userInfo.id&&(s.unreadNum=++t),!0}})):b([...N.sessionList,e])}return{cssVars:U,stompClient:L,state:N,unreadTotal:j,isGroupChat:w,isGroupLeader:E,isEnded:G,setMsgList:function(e=[]){_(),N.msgList=h(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),N.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:d(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[y.TEXT,y.TEXT,y.BLEND].includes(t)?l(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:d(e.sendTime).recordTime}),e.content.chatMessageType!==y.FILE||e.__size||p(e.content.fileUrl).then((s=>{e.__size=s}))})),R()&&D()},sendMessage:O,relayMessage:async function(e){const{checkedIds:s,remark:t,content:n}=e;for(let e=0;e<s.length;e++){const i=s[e],r=N.sessionList.find((e=>e.receiver===i));r||await o({chatType:I.SINGLE,receiver:i,sender:N.userInfo.id});const a=(null==r?void 0:r.chatType)||I.SINGLE;O({chatType:a,receiver:i,content:n}),await c(100),t&&O({chatType:a,receiver:i,content:{chatMessageType:y.TEXT,msg:t}}),await c(100)}},openSession:async function(e){const s=N.currentSessionItem.sessionKey;if(k(e),s!==N.currentSessionItem.sessionKey){if(w.value){const s=await a({id:e.receiver});N.currentGroupUser=f(s)?s:[]}else N.currentGroupUser=S([N.userInfo,{...h(e),id:e.receiver}],"id");g("session-change",{...r(N.currentSessionItem),userList:N.currentGroupUser.map((e=>r(e)))})}},closeSession:function(){if(!N.id)return null;const{currentSessionItem:e}=N;return N.currentSessionItem={},N.msgList=[],N.id="",N.currentGroupUser=[],e},getCurrentSession:function(){return N.id?N.currentSessionItem:null},setCurrentSessionItem:k,setUpdateSessionItem:function(e){const s=N.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:C({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};N.updateSessionItem=s?{...h(s),...t}:t,N.isUpdateSession=!0},setSessionList:b,emit:g}}const U=()=>i(L);export{L as InjectionIChatData,N as initData,U as useData};
@@ -1 +1 @@
1
- import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as t}from"@vueuse/core";import"../../../../shared/utils/index.js";import"naive-ui";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as s}from"../../../../shared/hooks/useScrollLoading.js";import{useState as a}from"./useState.js";import"../utils/emoji.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:p,after:u}){const m={page:0,hasMore:!0},{state:c}=a(),l=e([]),d=t((function(){Object.assign(m,{page:0,hasMore:!0}),f()}),300);async function f(){const e=(n.value||"").replace(/^\s+|\s+$/g,"");if(!e)return void(p?p():l.value=[]);if(!m.hasMore)return;m.page++,1==m.page&&(l.value=[]);const t=await r({orgId:c.orgId,keyword:e,page:m.page,pageSize:10});o(t.records)&&l.value.length<=+t.total&&(l.value=m.page>1?l.value.concat(t.records):t.records,null==u||u(),l.value.length>=+t.total&&(m.hasMore=!1))}return s(i,(()=>{f()})),{userList:l,handleInput:d}}export{i as useSearchUserList};
1
+ import{ref as e}from"vue";import{isArray as o}from"lodash-es";import{listUserApi as r}from"../api/index.js";import{useDebounceFn as s}from"@vueuse/core";import"../../../../shared/utils/index.js";import"naive-ui";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as t}from"../../../../shared/hooks/useScrollLoading.js";import{useData as a}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import"../utils/index.js";import"trtc-sdk-v5";function i({wrapperRef:i,keywordRef:n,before:p,after:u}){const m={page:0,hasMore:!0},{state:c}=a(),d=e([]),l=s((function(){Object.assign(m,{page:0,hasMore:!0}),f()}),300);async function f(){const e=(n.value||"").replace(/^\s+|\s+$/g,"");if(!e)return void(p?p():d.value=[]);if(!m.hasMore)return;m.page++,1==m.page&&(d.value=[]);const s=await r({orgId:c.orgId,keyword:e,page:m.page,pageSize:10});o(s.records)&&d.value.length<=+s.total&&(d.value=m.page>1?d.value.concat(s.records):s.records,null==u||u(),d.value.length>=+s.total&&(m.hasMore=!1))}return t(i,(()=>{f()})),{userList:d,handleInput:l}}export{i as useSearchUserList};
@@ -8,7 +8,25 @@ type EventHandlers = {
8
8
  handleRemoteVideoAvailable: AnyFn;
9
9
  };
10
10
  export declare function useVideo(): {
11
- state: import("../types").IState;
11
+ state: {
12
+ orgId: string | number;
13
+ currentSessionItem: import("../../../../shared/types").AnyObject;
14
+ id: string;
15
+ userInfo: import("../../../../shared/types").AnyObject;
16
+ msgList: import("../../../../shared/types").AnyObject[];
17
+ currentMsg: import("../../../../shared/types").AnyObject;
18
+ isAppendMsg: boolean;
19
+ sessionList: import("../../../../shared/types").AnyObject[];
20
+ isChangeSession: boolean;
21
+ updateSessionItem: import("../../../../shared/types").AnyObject;
22
+ isUpdateSession: boolean;
23
+ currentReferenceMsg: import("../../../../shared/types").AnyObject | null;
24
+ currentReEditMsg: import("../../../../shared/types").AnyObject | null;
25
+ showVideo: boolean;
26
+ currentAVMsg: import("../../../../shared/types").AnyObject;
27
+ currentGroupUser: import("../../../../shared/types").AnyObject[];
28
+ showMultipleVideo: boolean;
29
+ };
12
30
  sendMessage: (message: {
13
31
  chatType?: string | undefined;
14
32
  content: import("../../../../shared/types").AnyObject;
@@ -1 +1 @@
1
- import{ref as e,computed as t,onBeforeUnmount as E}from"vue";import{useState as a}from"./useState.js";import{MESSAGE_TYPE as n}from"../constants/index.js";import o from"trtc-sdk-v5";import{formatSeconds as l}from"../utils/index.js";function i(){const i={timer:null,seconds:0},{state:r,sendMessage:s}=a(),u=e(""),d=e(!0),m=e(!0),c=t((()=>r.currentAVMsg.chatMessageType===n.AUDIO)),R=t((()=>"call"===r.currentAVMsg.callMode)),T=t((()=>c.value?"语音":"视频")),A=o.create();function v(){u.value="00:00:00",i.timer&&clearInterval(i.timer),i.timer=null,i.seconds=0}return E((()=>{v()})),{state:r,sendMessage:s,trtc:A,timing:u,voiceOpen:d,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){v(),i.timer=setInterval((()=>{i.seconds++,u.value=l(i.seconds)}),1e3)},resetTimer:v,toggleAudio:async function(){await A.updateLocalAudio({mute:!d.value}),d.value=!d.value},toggleVideo:async function(){await A.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:i,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:E,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.on(o.EVENT.ERROR,e),A.on(o.EVENT.REMOTE_USER_ENTER,t),A.on(o.EVENT.REMOTE_AUDIO_AVAILABLE,E),A.on(o.EVENT.REMOTE_USER_EXIT,a),c.value||A.on(o.EVENT.REMOTE_VIDEO_AVAILABLE,n)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:E,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.off(o.EVENT.ERROR,e),A.off(o.EVENT.REMOTE_USER_ENTER,t),A.off(o.EVENT.REMOTE_AUDIO_AVAILABLE,E),A.off(o.EVENT.REMOTE_USER_EXIT,a),c.value||A.off(o.EVENT.REMOTE_VIDEO_AVAILABLE,n)}}}export{i as useVideo};
1
+ import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as n}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as a}from"../constants/index.js";import"../api/index.js";import{formatSeconds as i}from"../utils/index.js";import"lodash-es";import l from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,sendMessage:r}=n(),d=e(""),u=e(!0),m=e(!0),c=t((()=>s.currentAVMsg.chatMessageType===a.AUDIO)),R=t((()=>"call"===s.currentAVMsg.callMode)),T=t((()=>{var e,t;return c.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),v=l.create();function A(){d.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{A()})),{state:s,sendMessage:r,trtc:v,timing:d,voiceOpen:u,videocamOpen:m,isAudio:c,isCall:R,startTimer:function(){A(),E.timer=setInterval((()=>{E.seconds++,d.value=i(E.seconds)}),1e3)},resetTimer:A,toggleAudio:async function(){await v.updateLocalAudio({mute:!u.value}),u.value=!u.value},toggleVideo:async function(){await v.updateLocalVideo({mute:!m.value}),m.value=!m.value},messageTypeText:T,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.on(l.EVENT.ERROR,e),v.on(l.EVENT.REMOTE_USER_ENTER,t),v.on(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.on(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.on(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:n,handleRemoteVideoAvailable:a}){v.off(l.EVENT.ERROR,e),v.off(l.EVENT.REMOTE_USER_ENTER,t),v.off(l.EVENT.REMOTE_AUDIO_AVAILABLE,o),v.off(l.EVENT.REMOTE_USER_EXIT,n),c.value||v.off(l.EVENT.REMOTE_VIDEO_AVAILABLE,a)}}}export{E as useVideo};
@@ -0,0 +1,3 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ import { initData } from './index';
3
+ export declare function useWebSocket(props: AnyObject, data: ReturnType<typeof initData>): void;
@@ -0,0 +1 @@
1
+ import{onBeforeUnmount as e}from"vue";import{ChatSock as s}from"../utils/chatSock.js";import{CHAT_TYPE as t,SUBSCRIBE_MESSAGE_TYPE as n,AV_STATUS as o}from"../constants/index.js";import{readMessageApi as i}from"../api/index.js";import{isAudioOrVideoMessage as r}from"../utils/index.js";import{remove as a}from"lodash-es";function c(c,d){const{stompClient:l,state:u,openSession:p,closeSession:h,setSessionList:S,setUpdateSessionItem:y,setCurrentSessionItem:m}=d,g=[];async function b(e,s){if(u.currentMsg=e,e.sessionKey===u.currentSessionItem.sessionKey)return u.isAppendMsg=!0,e.sender!==u.userInfo.id&&await i({chatType:s,messageIdSet:[e.id],receiver:u.userInfo.id,sender:e.sender}),void m({lastMessageSendTime:e.sendTime,lastMessage:e.content,sortTime:e.sendTime,unreadNum:0,lastSenderName:e.senderName});const t={lastMessageSendTime:e.sendTime,sortTime:e.sendTime,lastMessage:e.content,sessionKey:e.sessionKey,lastSenderName:e.senderName,sender:e.sender};y(t)}async function f({body:e,chatType:s}){try{const i=JSON.parse(e),{messageVo:c,sessionVo:d,chatAvStatusVo:p}=i;switch(i.event){case n.MESSAGE:r(c.content)?!u.showVideo&&!u.showMultipleVideo||c.content.avStatus!==o.IN_CALL?(u.currentMsg=c,Object.assign(u.currentAVMsg,{strRoomId:c.sessionKey,chatMessageType:c.content.chatMessageType,callMode:c.sender===u.userInfo.id?"call":"invite",currentMsg:c}),u.showVideo||u.showMultipleVideo?b(c,s):u.showVideo=!0):(l.value.send("/app/chat/send",{},JSON.stringify({chatType:t.SINGLE,receiver:c.sender,content:{chatMessageType:c.content.chatMessageType,avStatus:o.CALL_BUSY}})),console.log("用户忙!")):b(c,s);break;case n.RECALL_MESSAGE:break;case n.AV_STATUS:Object.assign(u.currentAVMsg,p,{callMode:p.sender===u.userInfo.id?"call":"invite",checkedIds:[]}),u.showVideo||u.showMultipleVideo?console.log("用户忙!"):u.showMultipleVideo=!0;break;case n.NEW_SESSION:if(s===t.GROUP)return;y(d);break;case n.JOIN_GROUP:if(s===t.GROUP)return;y(d),l.value.subscribe(`/topic/group/${d.receiver}`,(({body:e})=>f({body:e,chatType:t.GROUP})));break;case n.LEAVE_GROUP:h(),a(u.sessionList,(e=>e.sessionKey===d.sessionKey));case n.DISABLE_SESSION:}}catch(e){console.log(e)}}!function e(){const n={headers:{AccessToken:c.token,UserId:c.userId},heartbeatFn(){try{l.value.send("test")}catch(s){l.value.disconnect(),e()}},connectCb(){console.log("连接成功"),l.value.subscribe("/user/topic/single",(({body:e})=>f({body:e,chatType:t.SINGLE}))),l.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:n,currentUser:o,sessionVos:i}=s;if(Object.assign(u.userInfo,o,n),!(null==i?void 0:i.length))return;S(i),g.splice(0,g.length),g.push(...i.filter((e=>e.chatType===t.GROUP))),g.forEach((e=>{l.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>f({body:e,chatType:t.GROUP})))})),function(){const e=u.sessionList.find((e=>e.sessionKey===c.defaultSessionKey));e&&p(e)}()}catch(e){console.log(e)}}),{extraConfig:JSON.stringify(c.extraParams)})},errorCb(e,s){}};l.value=new s("/fdp-chat/websocket",n)}(),e((()=>{var e;null==(e=l.value)||e.disconnect()}))}export{c as useWebSocket};
@@ -1,6 +1,4 @@
1
- import { InjectionKey, Ref, ComputedRef } from 'vue';
2
1
  import { AnyObject } from '../../../../shared/types';
3
- import { ChatSock } from '../utils/chatSock';
4
2
  import { UploadFileInfo } from 'naive-ui';
5
3
  export type IState = {
6
4
  orgId: number | string;
@@ -25,7 +23,3 @@ export type FileOptions = {
25
23
  file: UploadFileInfo;
26
24
  fileList: Array<UploadFileInfo>;
27
25
  };
28
- export declare const InjectionIChatState: InjectionKey<IState>;
29
- export declare const InjectionIChatStompClient: InjectionKey<Ref<ChatSock>>;
30
- export declare const InjectionIChatEmits: InjectionKey<(event: string, ...args: any[]) => void>;
31
- export declare const InjectionIChatUnreadTotal: InjectionKey<ComputedRef<number>>;
@@ -1 +1 @@
1
- const t=Symbol("InjectionIChatState"),o=Symbol("InjectionIChatStompClient"),n=Symbol("InjectionIChatEmits"),e=Symbol("InjectionIChatUnreadTotal");export{n as InjectionIChatEmits,t as InjectionIChatState,o as InjectionIChatStompClient,e as InjectionIChatUnreadTotal};
1
+
@@ -1,4 +1,5 @@
1
1
  import { AnyObject } from '../../../../shared/types';
2
+ export declare const $message: import("naive-ui").MessageApi;
2
3
  export declare function formatTime(dateStr: string): {
3
4
  siderMsgTime: any;
4
5
  msgTime: any;
@@ -1 +1 @@
1
- import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as s,isNumber as o,isNaN as a}from"lodash-es";import{MESSAGE_TYPE as i}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as l}from"../../../../shared/utils/index.js";function u(r){const s=new Date(r);let o,a;if(e(s))o=a=t(s,"HH:mm");else{o=n(s)?"昨天":t(s,"MM-dd");const e=s.getFullYear(),r=(new Date).getFullYear();a=t(s,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:o,msgTime:a,recordTime:function(r){const s=new Date(r),o=Date.now()-s.getTime();if(o<6e4)return"刚刚";if(o<36e5)return Math.ceil(o/1e3/60)+"分钟前";if(e(s))return"今天 "+t(s,"HH:mm");if(n(s))return"昨天 "+t(s,"HH:mm");{const e=s.getFullYear(),n=(new Date).getFullYear();return t(s,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function m(e){return s(e).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let r=n.toString();if(t===i.BLEND){const e=r.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const s=c.findEmoji(n[1]);s&&(r=r.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${s} />`))}})),r}const s=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return r=r.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(s(),"<$1 $2>").replace(s("/"),"</$1>").replace(/\n/g,"<br>"),r}function d(e){if(e&&o(+e)&&!a(+e)){const t=H(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return"已取消"}function g(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:s}=e,o=y(e)?d(r):"";switch(n){case i.TEXT:return p(e);case i.IMAGE:return"[图片]";case i.FILE:return"[文件]";case i.EMOJI:return`<img class="emoji--min" alt=${r} src=${c.findEmoji(r)}>`;case i.TEMPLATE:return null==(t=null==s?void 0:s.setting)?void 0:t.title;case i.VIDEO:return`[视频通话]${o}`;case i.AUDIO:return`[语音通话]${o}`;default:return"[消息]"}}function f(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),r=document.createElement("a");r.href=e,r.download=t,r.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function h(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const s=+n;s>1048576?n=(s/1048576).toFixed(2)+"M":s>1024?n=(s/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}async function w(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${l()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function y(e){return e&&[i.AUDIO,i.VIDEO].includes(e.chatMessageType)}function H(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{w as base64ToFile,f as downloadFile,H as formatSeconds,u as formatTime,d as getAVTime,h as getFileSize,y as isAudioOrVideoMessage,m as listSort,g as simplifyMessage,p as transformMessage};
1
+ import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as o,isNumber as a,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{createDiscreteApi as u}from"naive-ui";const{message:d}=u(["message"]);function m(r){var o;const a=new Date(r);let i,s;if(e(a))i=s=t(a,"HH:mm");else{i=n(a)?(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.132"))||"昨天":t(a,"MM-dd");const e=a.getFullYear(),r=(new Date).getFullYear();s=t(a,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(r){var o,a;const i=new Date(r),s=Date.now()-i.getTime();if(s<6e4)return(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.133"))||"刚刚";if(s<36e5)return Math.ceil(s/1e3/60)+((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.136"))||"分钟前");if(e(i))return"今天 "+t(i,"HH:mm");if(n(i))return"昨天 "+t(i,"HH:mm");{const e=i.getFullYear(),n=(new Date).getFullYear();return t(i,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function g(e){return o(e||[]).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let r=n.toString();if(t===s.BLEND){const e=r.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const o=c.findEmoji(n[1]);o&&(r=r.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${o} />`))}})),r}const o=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return r=r.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(o(),"<$1 $2>").replace(o("/"),"</$1>").replace(/\n/g,"<br>"),r}function f(e){var t;if(e&&a(+e)&&!i(+e)){const t=E(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.138"))||"已取消"}function w(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:o}=e,a=v(e)?f(r):"";switch(n){case s.TEXT:return p(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${r} src=${c.findEmoji(r)}>`;case s.TEMPLATE:return null==(t=null==o?void 0:o.setting)?void 0:t.title;case s.VIDEO:return`[视频通话]${a}`;case s.AUDIO:return`[语音通话]${a}`;default:return"[消息]"}}function h(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),r=document.createElement("a");r.href=e,r.download=t,r.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function y(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const o=+n;o>1048576?n=(o/1048576).toFixed(2)+"M":o>1024?n=(o/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}async function H(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${l()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function v(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{d as $message,H as base64ToFile,h as downloadFile,E as formatSeconds,m as formatTime,f as getAVTime,y as getFileSize,v as isAudioOrVideoMessage,g as listSort,w as simplifyMessage,p as transformMessage};