cnhis-design-vue 3.2.14-release.1 → 3.2.15-beta.2

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 (289) hide show
  1. package/es/components/ai-chat/index.d.ts +1 -0
  2. package/es/components/ai-chat/src/Index.vue.d.ts +1 -0
  3. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +1 -0
  5. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  9. package/es/components/ai-chat/style/index.css +1 -1
  10. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  11. package/es/components/base-search/index.d.ts +8 -3
  12. package/es/components/base-search/src/index.vue.d.ts +8 -3
  13. package/es/components/base-search/src/index.vue2.js +1 -1
  14. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  15. package/es/components/big-table/src/components/NoData.vue2.js +1 -1
  16. package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
  17. package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
  18. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  19. package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
  20. package/es/components/big-table/src/components/input-button.vue2.js +1 -1
  21. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  22. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  23. package/es/components/body-select/src/index.vue2.js +1 -1
  24. package/es/components/branch-notice/index.d.ts +63 -0
  25. package/es/components/branch-notice/index.js +1 -0
  26. package/es/components/branch-notice/src/BranchNotice.vue.d.ts +64 -0
  27. package/es/components/branch-notice/src/BranchNotice.vue.js +1 -0
  28. package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -0
  29. package/es/components/branch-notice/src/canstants.d.ts +7 -0
  30. package/es/components/branch-notice/src/canstants.js +1 -0
  31. package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +151 -0
  32. package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +35 -0
  33. package/es/components/branch-notice/src/components/NoticeOperationList.vue.d.ts +49 -0
  34. package/es/components/branch-notice/src/drawLine.d.ts +2 -0
  35. package/es/components/branch-notice/src/drawLine.js +1 -0
  36. package/es/components/branch-notice/src/types.d.ts +14 -0
  37. package/es/components/branch-notice/src/types.js +1 -0
  38. package/es/components/branch-notice/style/index.css +1 -0
  39. package/es/components/button-print/index.d.ts +4 -0
  40. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  41. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  42. package/es/components/button-print/src/components/EditFormat.vue2.js +1 -1
  43. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  44. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  45. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  46. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  47. package/es/components/button-print/src/components/Preview.vue2.js +1 -1
  48. package/es/components/button-print/src/utils/dialog.js +1 -1
  49. package/es/components/button-print/src/utils/print.js +1 -1
  50. package/es/components/calendar/index.d.ts +4 -4
  51. package/es/components/calendar/src/Calendar.vue.d.ts +4 -4
  52. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
  53. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
  54. package/es/components/classification/index.d.ts +1 -0
  55. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  56. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  57. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  58. package/es/components/classification/src/index.vue.d.ts +1 -0
  59. package/es/components/classification/src/index.vue2.js +1 -1
  60. package/es/components/classification/style/index.css +1 -1
  61. package/es/components/default-page/src/constants/index.js +1 -1
  62. package/es/components/default-page/src/index.vue2.js +1 -1
  63. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  64. package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -1
  65. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  66. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  67. package/es/components/expand-field/src/index.vue2.js +1 -1
  68. package/es/components/expand-field/src/utils/constant.js +1 -1
  69. package/es/components/fabric-chart/index.d.ts +23 -4
  70. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +23 -4
  71. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  72. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  73. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  74. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  75. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  76. package/es/components/fabric-chart/src/constants/index.d.ts +1 -1
  77. package/es/components/fabric-chart/src/constants/index.js +1 -1
  78. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  79. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  80. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  81. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  82. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  83. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  84. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  85. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  86. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  87. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  88. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
  89. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  90. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  91. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  92. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  93. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  94. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  95. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  96. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  97. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  98. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  99. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  100. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  101. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  102. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  103. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  104. package/es/components/fabric-chart/src/interface.d.ts +3 -0
  105. package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
  106. package/es/components/fabric-chart/src/utils/index.js +1 -1
  107. package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
  108. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  109. package/es/components/field-set/src/FieldFilter.vue.d.ts +5 -4
  110. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  111. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  112. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  113. package/es/components/field-set/src/Index.vue2.js +1 -1
  114. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  115. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  116. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  117. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  118. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  119. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  120. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  121. package/es/components/field-set/src/constants/filter.d.ts +21 -12
  122. package/es/components/field-set/src/constants/filter.js +1 -1
  123. package/es/components/field-set/src/constants/index.js +1 -1
  124. package/es/components/field-set/src/types/index.d.ts +1 -1
  125. package/es/components/form-config/index.d.ts +108 -3
  126. package/es/components/form-config/src/FormConfig.vue.d.ts +108 -3
  127. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  128. package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
  129. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
  130. package/es/components/form-config/src/constants/index.js +1 -1
  131. package/es/components/form-config/src/hooks/useLocale.js +1 -1
  132. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  133. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  134. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  135. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  136. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  137. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  138. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  139. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  140. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
  141. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  142. package/es/components/iho-chat/index.d.ts +635 -54
  143. package/es/components/iho-chat/src/Index.vue.d.ts +638 -61
  144. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  145. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  146. package/es/components/iho-chat/src/api/index.js +1 -1
  147. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
  148. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  149. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
  150. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  151. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
  152. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  153. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +221 -11
  154. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  155. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
  156. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  157. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
  158. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  159. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +49 -10
  160. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  161. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
  162. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  163. package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
  164. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  165. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  166. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  167. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
  168. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  169. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
  170. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  171. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +69 -1
  172. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  173. package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
  174. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  175. package/es/components/iho-chat/src/constants/index.d.ts +12 -3
  176. package/es/components/iho-chat/src/constants/index.js +1 -1
  177. package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
  178. package/es/components/iho-chat/src/hooks/index.js +1 -1
  179. package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
  180. package/es/components/iho-chat/src/hooks/useData.js +1 -0
  181. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  182. package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
  183. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  184. package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
  185. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
  186. package/es/components/iho-chat/src/types/index.d.ts +0 -6
  187. package/es/components/iho-chat/src/types/index.js +1 -1
  188. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  189. package/es/components/iho-chat/src/utils/index.d.ts +2 -0
  190. package/es/components/iho-chat/src/utils/index.js +1 -1
  191. package/es/components/iho-chat/style/index.css +1 -1
  192. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  193. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  194. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  195. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  196. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  197. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  198. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  199. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  200. package/es/components/iho-table/src/utils/index.js +1 -1
  201. package/es/components/index.css +1 -1
  202. package/es/components/index.d.ts +2 -1
  203. package/es/components/index.js +1 -1
  204. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  205. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  206. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  207. package/es/components/map/src/Map.vue2.js +1 -1
  208. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
  209. package/es/components/quick-search/index.d.ts +3 -1
  210. package/es/components/quick-search/src/index.vue.d.ts +3 -1
  211. package/es/components/quick-search/src/index.vue2.js +1 -1
  212. package/es/components/quick-search/style/index.css +1 -1
  213. package/es/components/recommend-search/src/components/BaseSearch.js +1 -1
  214. package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -1
  215. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
  216. package/es/components/scale-view/index.d.ts +31 -0
  217. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  218. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  219. package/es/components/scale-view/src/components/NoData.vue2.js +1 -1
  220. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  221. package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
  222. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  223. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  224. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  225. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  226. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  227. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  228. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  229. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  230. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  231. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  232. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  233. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  234. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  235. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  236. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  237. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  238. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  239. package/es/components/scale-view/style/index.css +1 -1
  240. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  241. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  242. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  243. package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
  244. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  245. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  246. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  247. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  248. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
  249. package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +1 -1
  250. package/es/components/select-person/src/index.vue2.js +1 -1
  251. package/es/components/slider-tree/src/index.vue2.js +1 -1
  252. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  253. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  254. package/es/components/table-export-field/src/index.vue2.js +1 -1
  255. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -1
  256. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  257. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
  258. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  259. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  260. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  261. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
  262. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +1 -1
  263. package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
  264. package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
  265. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  266. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  267. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +1 -1
  268. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  269. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  270. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -1
  271. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -1
  272. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  273. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  274. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  275. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
  276. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +3 -1
  277. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  278. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  279. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  280. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  281. package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
  282. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  283. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  284. package/es/shared/package.json.js +1 -1
  285. package/package.json +2 -2
  286. package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
  287. package/es/components/iho-chat/src/hooks/useSession.js +0 -1
  288. package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
  289. package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as t,computed as o,provide as n,onBeforeUnmount as i,watch as r,openBlock as a,createElementBlock as c,normalizeStyle as u,unref as d,createVNode as l,withCtx as p,createBlock as m,Fragment as h,createElementVNode as f,renderSlot as S,createCommentVNode as y}from"vue";import{NConfigProvider as g,NSpin as v,NLayout as b,NLayoutContent as M}from"naive-ui";import I from"./components/SiderList.vue.js";import k from"./components/ChatHeader.vue.js";import L from"./components/ChatMain.vue.js";import T from"./components/ChatFooter.vue.js";import V from"./components/ChatSearch.vue.js";import j from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import N from"./components/MultipleVideo.vue.js";import{ChatSock as U}from"./utils/chatSock.js";import{instanceAxios as A,readMessageApi as C}from"./api/index.js";import{useTheme as _}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{remove as E,isNumber as O}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import{promiseTimeout as x}from"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{CHAT_TYPE as R,SUBSCRIBE_MESSAGE_TYPE as G,AV_STATUS as K}from"./constants/index.js";import{InjectionIChatState as B,InjectionIChatStompClient as P,InjectionIChatEmits as J,InjectionIChatUnreadTotal as $}from"./types/index.js";import{isAudioOrVideoMessage as q,listSort as F}from"./utils/index.js";import{useSession as H}from"./hooks/useSession.js";import"trtc-sdk-v5";const z={key:0,class:"iho-chat__header"},D={class:"toolbar"};var W=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},chatBox:{type:Boolean,default:!1},defaultSessionKey:{type:String},show:{type:Boolean,default:!0}},emits:["template-click","unread-message-update"],setup(e,{expose:W,emit:Y}){const Q=e;A.defaults.baseURL=Q.baseURL,A.defaults.headers.Authorization="bearer "+Q.token;const X=_(),Z=s(!1),ee=s(),se=t({orgId:Q.orgId,currentSessionItem:{},id:"",userInfo:{id:Q.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),te=o((()=>se.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0)));n(B,se),n(P,ee),n(J,Y),n($,te);const{openSession:oe,closeSession:ne,getCurrentSession:ie,setSessionList:re,setUpdateSessionItem:ae,setCurrentSessionItem:ce,updateSessionList:ue}=H(se),de=[];function le(){const e={headers:{AccessToken:Q.token,UserId:Q.userId},heartbeatFn(){try{ee.value.send("test")}catch(e){ee.value.disconnect(),le()}},connectCb(){console.log("连接成功"),ee.value.subscribe("/user/topic/single",(({body:e})=>me({body:e,chatType:R.SINGLE}))),ee.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{authentication:t,currentUser:o,sessionVos:n}=s;if(Object.assign(se.userInfo,o,t),!(null==n?void 0:n.length))return;re(n),de.splice(0,de.length),de.push(...n.filter((e=>e.chatType===R.GROUP))),de.forEach((e=>{ee.value.subscribe(`/topic/group/${e.receiver}`,(({body:e})=>me({body:e,chatType:R.GROUP})))})),function(){const e=se.sessionList.find((e=>e.sessionKey===Q.defaultSessionKey));e&&oe(e)}()}catch(e){console.log(e)}}))},errorCb(e,s){}};ee.value=new U("/fdp-chat/websocket",e)}async function pe(e,s){if(se.currentMsg=e,e.sessionKey===se.currentSessionItem.sessionKey)return se.isAppendMsg=!0,e.sender!==se.userInfo.id&&await C({chatType:s,messageIdSet:[e.id],receiver:se.userInfo.id,sender:e.sender}),void ce({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};ae(t)}async function me({body:e,chatType:s}){try{const t=JSON.parse(e),{messageVo:o,sessionVo:n,chatAvStatusVo:i}=t;switch(t.event){case G.MESSAGE:q(o.content)?!se.showVideo&&!se.showMultipleVideo||o.content.avStatus!==K.IN_CALL?(se.currentMsg=o,Object.assign(se.currentAVMsg,{strRoomId:o.sessionKey,chatMessageType:o.content.chatMessageType,callMode:o.sender===se.userInfo.id?"call":"invite",currentMsg:o}),se.showVideo||se.showMultipleVideo?pe(o,s):se.showVideo=!0):(ee.value.send("/app/chat/send",{},JSON.stringify({chatType:R.SINGLE,receiver:o.sender,content:{chatMessageType:o.content.chatMessageType,avStatus:K.CALL_BUSY}})),console.log("用户忙!")):pe(o,s);break;case G.RECALL_MESSAGE:break;case G.AV_STATUS:Object.assign(se.currentAVMsg,i,{callMode:i.sender===se.userInfo.id?"call":"invite",checkedIds:[]}),se.showVideo||se.showMultipleVideo?console.log("用户忙!"):se.showMultipleVideo=!0;break;case G.NEW_SESSION:if(s===R.GROUP)return;ae(n);break;case G.JOIN:if(s===R.GROUP)return;ae(n),ee.value.subscribe(`/topic/group/${n.receiver}`,(({body:e})=>me({body:e,chatType:R.GROUP})));break;case G.LEAVE:ne(),E(se.sessionList,(e=>e.sessionKey===n.sessionKey))}}catch(e){console.log(e)}}return async function(){le()}(),i((()=>{var e;null==(e=ee.value)||e.disconnect()})),r((()=>te.value),(e=>{!async function s(t=0){const o=F(se.sessionList),n=o.every((e=>!!e.name));if(!(t>2))if(n){const s=o.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));Y("unread-message-update",e,s)}else await x(100),s(++t)}()})),r([()=>se.isChangeSession,()=>se.isUpdateSession],(([e,s])=>{e&&(ue(se.currentSessionItem),se.isChangeSession=!1),s&&(ue(se.updateSessionItem),se.isUpdateSession=!1)}),{immediate:!0}),W({getUnreadData:function(){return se.sessionList.filter((e=>O(e.unreadNum)&&e.unreadNum>0))},openSession:oe,closeSession:ne,getCurrentSession:ie}),(s,t)=>e.show?(a(),c("div",{key:0,class:"iho-chat",style:u(d(X))},[l(d(g),{abstract:"",namespace:"iho-chat__popover"},{default:p((()=>[Z.value?(a(),m(d(v),{key:0,stroke:"#5585f5"})):(a(),c(h,{key:1},[e.chatBox?y("v-if",!0):(a(),c("div",z,[l(V),l(j,{title:"发起群聊",mode:"create","default-value":[se.userInfo]},null,8,["default-value"]),f("div",D,[S(s.$slots,"toolbar")])])),l(d(b),{class:"iho-chat__body","has-sider":""},{default:p((()=>[e.chatBox?y("v-if",!0):(a(),m(I,{key:0})),l(d(M),{class:"chat-content"},{default:p((()=>[l(k),l(L),l(T)])),_:1}),S(s.$slots,"external")])),_:3}),se.showVideo?(a(),m(w,{key:1})):y("v-if",!0),se.showMultipleVideo?(a(),m(N,{key:2})):y("v-if",!0)],64))])),_:3})],4)):y("v-if",!0)}});export{W as default};
1
+ import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as n,createVNode as i,withCtx as u,createBlock as l,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import g from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import _ from"./components/ChatSearch.vue.js";import b from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import C from"./components/MultipleVideo.vue.js";import{instanceAxios as x}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as H}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const U={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},defaultSessionKey:{type:String},show:{type:Boolean,default:!0},extraParams:{type:Object,default:()=>({})}},emits:["template-click","unread-message-update","session-change","session-close"],setup(e,{expose:q,emit:B}){const M=e;x.defaults.baseURL=M.baseURL,x.defaults.headers.Authorization="bearer "+M.token;const N=t(!1),R=L(M,B);o(V,R),H(M,R);const{cssVars:A,state:D,openSession:F,closeSession:z,getCurrentSession:E,isEnded:K}=R;return q({getUnreadData:function(){return D.sessionList.filter((e=>I(e.unreadNum)&&e.unreadNum>0))},openSession:F,closeSession:z,getCurrentSession:E}),(t,o)=>e.show?(s(),r("div",{key:0,class:"iho-chat",style:a(n(A))},[i(n(f),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>{var o;return[N.value?(s(),l(n(h),{key:0,stroke:"#5585f5"})):(s(),r(d,{key:1},[e.showHeader?(s(),r("div",U,[i(_),i(b,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.31"))||"发起群聊",mode:"create","default-value":[n(D).userInfo]},null,8,["default-value"]),m("div",$,[p(t.$slots,"toolbar")])])):c("v-if",!0),i(n(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[i(S),i(n(y),{class:"chat-content",style:a({"--c-pointer-events":n(K)?"none":"unset","--c-cursor":n(K)?"not-allowed":"unset"})},{default:u((()=>[i(g,null,{header:u((()=>[p(t.$slots,"chatHeader",{session:n(D).currentSessionItem})])),_:3}),i(k),i(j,null,{footer:u((()=>[p(t.$slots,"chatFooter",{session:n(D).currentSessionItem})])),_:3})])),_:3},8,["style"]),p(t.$slots,"external")])),_:3}),n(D).showVideo?(s(),l(w,{key:1})):c("v-if",!0),n(D).showMultipleVideo?(s(),l(C,{key:2})):c("v-if",!0)],64))]})),_:3})],4)):c("v-if",!0)}});export{q as default};
@@ -15,3 +15,4 @@ export declare function groupJoinApi(params: AnyObject): import("axios").AxiosPr
15
15
  export declare function groupLeaveApi(params: AnyObject): import("axios").AxiosPromise<any>;
16
16
  export declare function avFinishApi(params: AnyObject): import("axios").AxiosPromise<any>;
17
17
  export declare function groupUpdateApi(params: FormData): import("axios").AxiosPromise<any>;
18
+ export declare function updateStatusApi(params: AnyObject): import("axios").AxiosPromise<any>;
@@ -1 +1 @@
1
- import t from"axios";import{createDiscreteApi as e}from"naive-ui";const{message:o}=e(["message"]);function r(t){const e=[];for(const o in t){const r=t[o];Array.isArray(r)?r.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(r)}`)}return e.join("&")}const n=t.create({withCredentials:!0,timeout:5e3});function a(t){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/openSession",data:r(t)})}function u(t){return n({method:"get",url:"/chat/recordList",params:t})}function s(t){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/toppingSession",data:r(t)})}function d(t){return n({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function i(t){return n({method:"get",url:"/user/listUser",params:t})}function p(t){return n({method:"get",url:"/user/getUserDetail",params:t})}function c(t){return n({method:"post",url:"/chat/readMessage",data:t})}function m(t){return n({method:"post",url:"/chat/recallMessage",data:t})}function l(t){return n({method:"post",url:"/chat/searchChatRecord",data:t})}function h(t){return n({method:"post",url:"/group/create",data:t})}function f(t){return n({method:"get",url:"/group/user",params:t})}function g(t){return n({method:"post",url:"/group/join",data:t})}function C(t){return n({method:"post",url:"/group/leave",data:t})}function v(t){return n({method:"post",url:"/av/finish",data:t})}function w(t){return n({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/group/update",data:t})}n.interceptors.response.use((t=>{var e,r,n;if(null==(e=t.data)?void 0:e.result)return null==(r=t.data)?void 0:r.data;500==(null==(n=t.data)?void 0:n.code)&&t.data.msg&&o.error(t.data.msg)}));export{v as avFinishApi,u as getHistoryRecordApi,p as getUserDetailApi,h as groupCreateApi,g as groupJoinApi,C as groupLeaveApi,w as groupUpdateApi,f as groupUserApi,n as instanceAxios,i as listUserApi,a as openSessionApi,c as readMessageApi,m as recallMessageApi,l as searchChatRecordApi,s as toppingSessionApi,d as uploadFileApi};
1
+ import t from"axios";import{createDiscreteApi as e}from"naive-ui";const{message:o}=e(["message"]);function r(t){const e=[];for(const o in t){const r=t[o];Array.isArray(r)?r.forEach((t=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(t)}`)})):e.push(`${encodeURIComponent(o)}=${encodeURIComponent(r)}`)}return e.join("&")}const n=t.create({withCredentials:!0,timeout:5e3});function a(t){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/openSession",data:r(t)})}function u(t){return n({method:"get",url:"/chat/recordList",params:t})}function s(t){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/session/toppingSession",data:r(t)})}function d(t){return n({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/chat/uploadFile",data:t})}function i(t){return n({method:"get",url:"/user/listUser",params:t})}function p(t){return n({method:"get",url:"/user/getUserDetail",params:t})}function c(t){return n({method:"post",url:"/chat/readMessage",data:t})}function m(t){return n({method:"post",url:"/chat/recallMessage",data:t})}function l(t){return n({method:"post",url:"/chat/searchChatRecord",data:t})}function h(t){return n({method:"post",url:"/group/create",data:t})}function f(t){return n({method:"get",url:"/group/user",params:t})}function g(t){return n({method:"post",url:"/group/join",data:t})}function C(t){return n({method:"post",url:"/group/leave",data:t})}function w(t){return n({method:"post",url:"/av/finish",data:t})}function v(t){return n({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/group/update",data:t})}function y(t){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"put",url:"/session/updateStatus",data:r(t)})}n.interceptors.response.use((t=>{var e,r,n;if(null==(e=t.data)?void 0:e.result)return null==(r=t.data)?void 0:r.data;500==(null==(n=t.data)?void 0:n.code)&&t.data.msg&&o.error(t.data.msg)}));export{w as avFinishApi,u as getHistoryRecordApi,p as getUserDetailApi,h as groupCreateApi,g as groupJoinApi,C as groupLeaveApi,v as groupUpdateApi,f as groupUserApi,n as instanceAxios,i as listUserApi,a as openSessionApi,c as readMessageApi,m as recallMessageApi,l as searchChatRecordApi,s as toppingSessionApi,y as updateStatusApi,d as uploadFileApi};
@@ -20,6 +20,10 @@ declare const _default: import("vue").DefineComponent<{
20
20
  type: PropType<AnyObject[]>;
21
21
  default: () => never[];
22
22
  };
23
+ disabled: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
23
27
  }, {
24
28
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
25
29
  title: {
@@ -41,11 +45,33 @@ declare const _default: import("vue").DefineComponent<{
41
45
  type: PropType<AnyObject[]>;
42
46
  default: () => never[];
43
47
  };
48
+ disabled: {
49
+ type: BooleanConstructor;
50
+ default: boolean;
51
+ };
44
52
  }>> & {
45
53
  onComfirm?: ((...args: any[]) => any) | undefined;
46
54
  }>>;
47
55
  emit: (event: "comfirm", ...args: any[]) => void;
48
- state: import("../types").IState;
56
+ state: {
57
+ orgId: string | number;
58
+ currentSessionItem: AnyObject;
59
+ id: string;
60
+ userInfo: AnyObject;
61
+ msgList: AnyObject[];
62
+ currentMsg: AnyObject;
63
+ isAppendMsg: boolean;
64
+ sessionList: AnyObject[];
65
+ isChangeSession: boolean;
66
+ updateSessionItem: AnyObject;
67
+ isUpdateSession: boolean;
68
+ currentReferenceMsg: AnyObject | null;
69
+ currentReEditMsg: AnyObject | null;
70
+ showVideo: boolean;
71
+ currentAVMsg: AnyObject;
72
+ currentGroupUser: AnyObject[];
73
+ showMultipleVideo: boolean;
74
+ };
49
75
  setCurrentSessionItem: (item: AnyObject) => void;
50
76
  listRef: import("vue").Ref<any>;
51
77
  keyword: import("vue").Ref<string>;
@@ -105,11 +131,16 @@ declare const _default: import("vue").DefineComponent<{
105
131
  type: PropType<AnyObject[]>;
106
132
  default: () => never[];
107
133
  };
134
+ disabled: {
135
+ type: BooleanConstructor;
136
+ default: boolean;
137
+ };
108
138
  }>> & {
109
139
  onComfirm?: ((...args: any[]) => any) | undefined;
110
140
  }, {
111
141
  title: string;
112
142
  defaultValue: AnyObject[];
143
+ disabled: boolean;
113
144
  mode: string;
114
145
  disabledIds: string[];
115
146
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as u,Fragment as o,createVNode as r,unref as s,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as y,NIcon as I,NCheckbox as k,NCheckboxGroup as w,NSpace as _,NAvatar as x,NTag as S,NTooltip as U,NButton as j}from"naive-ui";import{SearchOutline as C,AddOutline as R}from"@vicons/ionicons5";import{useState as L}from"../hooks/useState.js";import{useSession as V}from"../hooks/useSession.js";import{CHAT_TYPE as A}from"../constants/index.js";import"trtc-sdk-v5";import{listSort as E}from"../utils/index.js";import{groupLeaveApi as G,groupJoinApi as N,groupCreateApi as $}from"../api/index.js";import{cloneDeep as z,union as M,intersection as T,unionBy as D,remove as P,isArray as q,uniqBy as B,trim as F}from"lodash-es";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";const J={class:"iho-chat-dialog__content iho-chat-add-wrapper"},K={key:0,class:"input-box"},O=d("span",null,"群名称:",-1),Q={class:"transfer-box"},W={class:"transfer-box__left"},X={class:"user-list-box"},Y={key:1,class:"no-data"},Z={class:"transfer-box__right"},ee={class:"checked-tag-box"},ae={key:0,class:"input-wrapper"};var le=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]}},emits:["comfirm"],setup(e,{emit:le}){const te=e,{state:ie}=L(),{setCurrentSessionItem:ue}=V(ie),oe=a(),re=a(""),se=a(!1),ne=a([]),de=a([]),ve=a(""),ce=a([]),pe=a(""),{userList:me,handleInput:fe}=H({wrapperRef:oe,keywordRef:re,before:()=>{me.value=z(de.value),we()},after:()=>{he.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=he.value)?void 0:a.includes(e.id)})),we()}}),he=l((()=>"relay"===te.mode?[]:M(te.disabledIds,[ie.userInfo.id]))),be=l((()=>{var e,a;if(!(null==(e=ie.sessionList)?void 0:e.length))return[];const l=E(ie.sessionList);return null==(a="relay"===te.mode?l:l.filter((e=>e.chatType===A.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),ge=l((()=>ne.value.length?ne.value.map((e=>e.id)):[])),ye=l((()=>"create"===te.mode?ge.value.length<3:ge.value.length<1)),Ie=l({get:()=>ce.value.filter((e=>!he.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=te.defaultValue.map((e=>e.id)),l=T(a,he.value,me.value.map((e=>e.id))),t=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?t.map((e=>e.id)):[]),e?ne.value=D(ne.value,t,"id"):P(ne.value,(e=>t.map((e=>e.id)).includes(e.id)))}});async function ke(){switch(te.mode){case"create":await $({creator:ie.userInfo.id,memberIdSet:ge.value,name:F(ve.value),orgId:ie.orgId});break;case"join":if(await N({groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(",");ue({name:`${ie.currentSessionItem.name},${e}`})}ie.currentGroupUser.push(...me.value.filter((e=>ge.value.includes(e.id))));break;case"remove":if(await G({dissolution:!1,groupId:ie.currentSessionItem.receiver,operator:ie.userInfo.id,memberIdSet:ge.value}),!ie.currentSessionItem.defaultName){const e=ne.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ue({name:ie.currentSessionItem.name.replace(a,"")})}P(ie.currentGroupUser,(e=>ge.value.includes(e.id)));break;default:le("comfirm",ge.value,pe.value)}se.value=!1}function we(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>ge.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function _e(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));ne.value.push(e)}else P(ne.value,(e=>e.id===a.value))}return t((()=>se.value),(e=>{if(!e)return;re.value="",ve.value="";const a=q(te.options)&&te.options.length?te.options:be.value;de.value=B(a,"id").map((e=>{var a;return{...e,disabled:null==(a=he.value)?void 0:a.includes(e.id)}})),me.value=z(de.value),q(te.defaultValue)&&te.defaultValue.length?(ne.value=z(te.defaultValue),we()):(ne.value=[],ce.value=[])})),(a,l)=>(i(),u(o,null,[r(s(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:se.value,"onUpdate:show":l[5]||(l[5]=e=>se.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:s(ye)},onPositiveClick:ke},{default:n((()=>[d("div",J,["create"===e.mode?(i(),u("div",K,[O,r(s(y),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ve.value,"onUpdate:value":l[0]||(l[0]=e=>ve.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",Q,[d("div",W,[r(s(y),{placeholder:"搜索",clearable:"",value:re.value,"onUpdate:value":[l[1]||(l[1]=e=>re.value=e),s(fe)],valueModifiers:{trim:!0}},{prefix:n((()=>[r(s(I),{component:s(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",X,[s(me).length>0?(i(),u(o,{key:0},[r(s(k),{label:"全选",checked:s(Ie),"onUpdate:checked":l[2]||(l[2]=e=>c(Ie)?Ie.value=e:null)},null,8,["checked"]),r(s(w),{ref_key:"listRef",ref:oe,value:ce.value,"onUpdate:value":[l[3]||(l[3]=e=>ce.value=e),_e]},{default:n((()=>[(i(!0),u(o,null,p(s(me),(e=>(i(),m(s(k),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[r(s(_),{align:"center","wrap-item":!1},{default:n((()=>[r(s(x),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),u("div",Y,"找不到相关结果"))])]),d("div",Z,[d("span",null,"已选择 "+f(s(ge).length)+" 人",1),d("div",ee,[(i(!0),u(o,null,p(ne.value,(a=>(i(),m(s(S),{key:a.id,bordered:!1,closable:"relay"===e.mode||a.id!==s(ie).userInfo.id,disabled:s(he).includes(a.id),onClose:()=>{return e=a.id,P(ne.value,(a=>a.id===e)),void P(ce.value,(a=>a===e));var e}},{avatar:n((()=>[r(s(x),{round:"",src:a.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(a.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===e.mode?(i(),u("div",ae,[r(s(y),{clearable:"",value:pe.value,"onUpdate:value":l[4]||(l[4]=e=>pe.value=e),type:"textarea",placeholder:"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):v("v-if",!0)])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:l[6]||(l[6]=e=>se.value=!0)},[b(a.$slots,"trigger",{},(()=>[r(s(U),{"show-arrow":!1,placement:"bottom"},{trigger:n((()=>[r(s(j),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[r(s(I),{component:s(R),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))])],64))}});export{le as default};
1
+ import{createElementVNode as e,defineComponent as a,ref as l,computed as o,watch as t,openBlock as i,createElementBlock as n,Fragment as u,createVNode as d,unref as r,withCtx as s,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as g,normalizeClass as w,renderSlot as h}from"vue";import{NModal as b,NInput as y,NIcon as k,NCheckbox as I,NCheckboxGroup as C,NSpace as _,NAvatar as x,NTag as L,NTooltip as S,NButton as j}from"naive-ui";import{SearchOutline as B,AddOutline as U}from"@vicons/ionicons5";import{useData as R}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as V}from"../constants/index.js";import{groupLeaveApi as A,groupJoinApi as E,groupCreateApi as G}from"../api/index.js";import{listSort as N}from"../utils/index.js";import{union as $,intersection as z,unionBy as D,remove as M,isArray as T,uniqBy as P,cloneDeep as q,trim as F}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";var J,K;const O={class:"iho-chat-dialog__content iho-chat-add-wrapper"},Q={key:0,class:"input-box"},W=e("span",null,(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.34"))||"群名称:",-1),X={class:"transfer-box"},Y={class:"transfer-box__left"},Z={class:"user-list-box"},ee={key:1,class:"no-data"},ae={class:"transfer-box__right"},le={class:"checked-tag-box"},oe={key:0,class:"input-wrapper"};var te=a({__name:"ChatAdd",props:{title:{type:String,default:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.42"))||"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(a,{emit:J}){const K=a,{state:te,setCurrentSessionItem:ie}=R(),ne=l(),ue=l(""),de=l(!1),re=l([]),se=l([]),ve=l(""),ce=l([]),pe=l(""),{userList:me,handleInput:fe}=H({wrapperRef:ne,keywordRef:ue,before:()=>{me.value=q(se.value),Ie()},after:()=>{ge.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=ge.value)?void 0:a.includes(e.id)})),Ie()}}),ge=o((()=>"relay"===K.mode?[]:$(K.disabledIds,[te.userInfo.id]))),we=o((()=>{var e,a;if(!(null==(e=te.sessionList)?void 0:e.length))return[];const l=N(te.sessionList);return null==(a="relay"===K.mode?l:l.filter((e=>e.chatType===V.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),he=o((()=>re.value.length?re.value.map((e=>e.id)):[])),be=o((()=>"create"===K.mode?he.value.length<3:he.value.length<1)),ye=o({get:()=>ce.value.filter((e=>!ge.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=K.defaultValue.map((e=>e.id)),l=z(a,ge.value,me.value.map((e=>e.id))),o=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?o.map((e=>e.id)):[]),e?re.value=D(re.value,o,"id"):M(re.value,(e=>o.map((e=>e.id)).includes(e.id)))}});async function ke(){switch(K.mode){case"create":await G({creator:te.userInfo.id,memberIdSet:he.value,name:F(ve.value),orgId:te.orgId});break;case"join":if(await E({groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(",");ie({name:`${te.currentSessionItem.name},${e}`})}te.currentGroupUser.push(...me.value.filter((e=>he.value.includes(e.id))));break;case"remove":if(await A({dissolution:!1,groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ie({name:te.currentSessionItem.name.replace(a,"")})}M(te.currentGroupUser,(e=>he.value.includes(e.id)));break;default:J("comfirm",he.value,pe.value)}de.value=!1}function Ie(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>he.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function Ce(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));re.value.push(e)}else M(re.value,(e=>e.id===a.value))}return t((()=>de.value),(e=>{if(!e)return;ue.value="",ve.value="";const a=T(K.options)&&K.options.length?K.options:we.value;se.value=P(a,"id").map((e=>{var a;return{...e,disabled:null==(a=ge.value)?void 0:a.includes(e.id)}})),me.value=q(se.value),T(K.defaultValue)&&K.defaultValue.length?(re.value=q(K.defaultValue),Ie()):(re.value=[],ce.value=[])})),(l,o)=>{var t,R;return i(),n(u,null,[d(r(b),{preset:"dialog",title:a.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:de.value,"onUpdate:show":o[5]||(o[5]=e=>de.value=e),"negative-text":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.32"))||"取消","positive-text":(null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.33"))||"确定","display-directive":"show","positive-button-props":{disabled:r(be)},onPositiveClick:ke},{default:s((()=>{var l,t,w,h,b,S,j;return[e("div",O,["create"===a.mode?(i(),n("div",Q,[W,d(r(y),{clearable:"",placeholder:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.35"))||"取个群名称方便后续搜索",value:ve.value,"onUpdate:value":o[0]||(o[0]=e=>ve.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),e("div",X,[e("div",Y,[d(r(y),{placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.36"))||"搜索",clearable:"",value:ue.value,"onUpdate:value":[o[1]||(o[1]=e=>ue.value=e),r(fe)],valueModifiers:{trim:!0}},{prefix:s((()=>[d(r(k),{component:r(B)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),e("div",Z,[r(me).length>0?(i(),n(u,{key:0},[d(r(I),{label:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.37"))||"全选",checked:r(ye),"onUpdate:checked":o[2]||(o[2]=e=>c(ye)?ye.value=e:null)},null,8,["checked"]),d(r(C),{ref_key:"listRef",ref:ne,value:ce.value,"onUpdate:value":[o[3]||(o[3]=e=>ce.value=e),Ce]},{default:s((()=>[(i(!0),n(u,null,p(r(me),(a=>(i(),m(r(I),{key:a.id,value:a.id,disabled:a.disabled},{default:s((()=>[d(r(_),{align:"center","wrap-item":!1},{default:s((()=>[d(r(x),{src:a.avatar,round:"",size:32},null,8,["src"]),e("span",null,f(a.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),n("div",ee,(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.38"))||"找不到相关结果"))])]),e("div",ae,[e("span",null,((null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.39"))||"已选择")+f(r(he).length)+((null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.40"))||"人"),1),e("div",le,[(i(!0),n(u,null,p(re.value,(e=>(i(),m(r(L),{key:e.id,bordered:!1,closable:"relay"===a.mode||e.id!==r(te).userInfo.id,disabled:r(ge).includes(e.id),onClose:()=>{return a=e.id,M(re.value,(e=>e.id===a)),void M(ce.value,(e=>e===a));var a}},{avatar:s((()=>[d(r(x),{round:"",src:e.avatar},null,8,["src"])])),default:s((()=>[g(" "+f(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===a.mode?(i(),n("div",oe,[d(r(y),{clearable:"",value:pe.value,"onUpdate:value":o[4]||(o[4]=e=>pe.value=e),type:"textarea",placeholder:(null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.41"))||"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):v("v-if",!0)])])])]})),_:1},8,["title","show","positive-button-props"]),e("span",{class:w(["btn-wrapper",{disabled:a.disabled}]),onClick:o[6]||(o[6]=e=>de.value=!0)},[h(l.$slots,"trigger",{},(()=>[d(r(S),{"show-arrow":!1,placement:"bottom"},{trigger:s((()=>[d(r(j),{color:"#ffffff4D",class:"add-btn"},{icon:s((()=>[d(r(k),{component:r(U),color:"#fff"},null,8,["component"])])),_:1})])),default:s((()=>[g(" "+f(a.title),1)])),_:1})]))],2)],64)}}});export{te as default};
@@ -10,7 +10,6 @@ declare const _default: import("vue").DefineComponent<{
10
10
  type: BooleanConstructor;
11
11
  };
12
12
  }, {
13
- cssVars: import("vue").ComputedRef<AnyObject>;
14
13
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
15
14
  type: {
16
15
  type: StringConstructor;
@@ -20,7 +19,26 @@ declare const _default: import("vue").DefineComponent<{
20
19
  type: BooleanConstructor;
21
20
  };
22
21
  }>> & {}>>;
23
- state: import("../types").IState;
22
+ cssVars: import("vue").ComputedRef<AnyObject>;
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
+ };
24
42
  relayMessage: (param: {
25
43
  checkedIds: string[];
26
44
  remark: string;
@@ -76,6 +94,10 @@ declare const _default: import("vue").DefineComponent<{
76
94
  type: PropType<AnyObject[]>;
77
95
  default: () => never[];
78
96
  };
97
+ disabled: {
98
+ type: BooleanConstructor;
99
+ default: boolean;
100
+ };
79
101
  }, {
80
102
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
81
103
  title: {
@@ -97,11 +119,33 @@ declare const _default: import("vue").DefineComponent<{
97
119
  type: PropType<AnyObject[]>;
98
120
  default: () => never[];
99
121
  };
122
+ disabled: {
123
+ type: BooleanConstructor;
124
+ default: boolean;
125
+ };
100
126
  }>> & {
101
127
  onComfirm?: ((...args: any[]) => any) | undefined;
102
128
  }>>;
103
129
  emit: (event: "comfirm", ...args: any[]) => void;
104
- state: import("../types").IState;
130
+ state: {
131
+ orgId: string | number;
132
+ currentSessionItem: AnyObject;
133
+ id: string;
134
+ userInfo: AnyObject;
135
+ msgList: AnyObject[];
136
+ currentMsg: AnyObject;
137
+ isAppendMsg: boolean;
138
+ sessionList: AnyObject[];
139
+ isChangeSession: boolean;
140
+ updateSessionItem: AnyObject;
141
+ isUpdateSession: boolean;
142
+ currentReferenceMsg: AnyObject | null;
143
+ currentReEditMsg: AnyObject | null;
144
+ showVideo: boolean;
145
+ currentAVMsg: AnyObject;
146
+ currentGroupUser: AnyObject[];
147
+ showMultipleVideo: boolean;
148
+ };
105
149
  setCurrentSessionItem: (item: AnyObject) => void;
106
150
  listRef: import("vue").Ref<any>;
107
151
  keyword: import("vue").Ref<string>;
@@ -161,11 +205,16 @@ declare const _default: import("vue").DefineComponent<{
161
205
  type: PropType<AnyObject[]>;
162
206
  default: () => never[];
163
207
  };
208
+ disabled: {
209
+ type: BooleanConstructor;
210
+ default: boolean;
211
+ };
164
212
  }>> & {
165
213
  onComfirm?: ((...args: any[]) => any) | undefined;
166
214
  }, {
167
215
  title: string;
168
216
  defaultValue: AnyObject[];
217
+ disabled: boolean;
169
218
  mode: string;
170
219
  disabledIds: string[];
171
220
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,watch as o,openBlock as s,createBlock as r,unref as i,withCtx as n,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as d,Fragment as p,renderList as u,toDisplayString as f,vShow as h,normalizeStyle as y,createTextVNode as g}from"vue";import{NModal as v,NImageGroup as w,NImage as k,NInput as M,NIcon as b,NTooltip as _}from"naive-ui";import{SearchOutline as I,OpenOutline as T,DownloadOutline as S}from"@vicons/ionicons5";import{searchChatRecordApi as j}from"../api/index.js";import{useTheme as x}from"../../../../shared/hooks/useTheme.js";import{useDebounceFn as A}from"@vueuse/core";import{format as C,isSameWeek as H,isSameMonth as D}from"date-fns";import{last as z}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as L}from"../../../../shared/hooks/useScrollLoading.js";import{useState as U}from"../hooks/useState.js";import{getFileSize as E,downloadFile as O}from"../utils/index.js";import"trtc-sdk-v5";import $ from"./ChatAdd.vue.js";const F={class:"label"},P={class:"image-box"},R={class:"file-type"},B={class:"text"},G={class:"name"},N={class:"detail"},q={class:"opt-box"};var J=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const J=e,K=x(),{state:Q,relayMessage:V}=U(),W=t([]),X=t([]),Y=t(),Z=t(),ee=t(),te=A(se,500),ae={page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!ae.hasMore)return;ae.page++;const t=await j({orgId:Q.orgId,keyword:ee.value,endTime:"",startTime:"",lastSendTime:ae.lastSendTime,memberIdSet:[],page:ae.page,recordType:"image"===J.type?"IMAGE":"FILE",receiver:Q.currentSessionItem.receiver,userId:Q.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(ae.hasMore=!1);let a=t||[];if(Array.isArray(t)&&t.length>0&&(a=t[0].recordList),ae.lastSendTime=null==(e=z(a))?void 0:e.sendTime,"image"===J.type){const e=function(e){const t={};e.forEach((e=>{const a=new Date(e.sendTime);let o=C(a,"yyyy年MM月");H(a,new Date)?o="本周":D(a,new Date)&&(o="本月"),t[o]||(t[o]=[]),t[o].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(a);W.value=ae.page>1?W.value.concat(e):e}else{const e=a.map((e=>new Promise((async t=>{const a=await E(e.content.fileUrl);t({...e,size:a})})))),t=await Promise.all(e);X.value=ae.page>1?X.value.concat(t):t}}catch(e){}}function se(){Object.assign(ae,{page:0,hasMore:!0,lastSendTime:C(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}L(Y,(()=>{oe()})),L(Z,(()=>{oe()}));const re=a((()=>"image"===J.type?"聊天图片":"聊天文件"));function ie(e){const{size:t,sendTime:a,senderName:o}=e;return`${t} · ${C(new Date(a),"yyyy/MM/dd HH:mm")} ${o}`}function ne(e){var t;const a=(null==(t=e.content)?void 0:t.msg)||"",o=a.lastIndexOf(".");if(-1!==o){return a.charAt(o+1).toUpperCase()}return"?"}return o((()=>J.visible),(e=>{e?se():ee.value=""})),(t,a)=>(s(),r(i(v),{preset:"dialog",title:i(re),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:n((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:Y},[m(i(w),{"show-toolbar-tooltip":""},{default:n((()=>[(s(!0),d(p,null,u(W.value,(e=>(s(),d("div",{class:"image-item",key:e.label},[c("span",F,f(e.label),1),c("div",P,[(s(!0),d(p,null,u(e.list,(e=>(s(),r(i(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[h,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:y(i(K))},[m(i(M),{clearable:"",placeholder:"搜索文件",value:ee.value,"onUpdate:value":a[0]||(a[0]=e=>ee.value=e),valueModifiers:{trim:!0},onInput:i(te)},{prefix:n((()=>[m(i(b),{component:i(I)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:Z},[(s(!0),d(p,null,u(X.value,((e,t)=>(s(),d("div",{class:"file-item",key:t},[c("span",R,f(ne(e)),1),c("div",B,[c("span",G,f(e.content.msg),1),c("span",N,f(ie(e)),1)]),c("div",q,[m($,{title:"转发消息",mode:"relay",onComfirm:(t,a)=>i(V)({content:e.content,checkedIds:t,remark:a})},{trigger:n((()=>[m(i(_),{"show-arrow":!1},{trigger:n((()=>[m(i(b),{size:16,component:i(T)},null,8,["component"])])),default:n((()=>[g(" 转发 ")])),_:1})])),_:2},1032,["onComfirm"]),m(i(_),{"show-arrow":!1},{trigger:n((()=>[m(i(b),{size:16,component:i(S),onClick:()=>i(O)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:n((()=>[g(" 下载 ")])),_:2},1024)])])))),128))],512)],4),[[h,"image"!==e.type]])])),_:1},8,["title"]))}});export{J as default};
1
+ import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as d,createVNode as c,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as w,createTextVNode as y}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as T}from"@vueuse/core";import{format as x,isSameWeek as S,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as z,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";import E from"./ChatAdd.vue.js";const O={class:"label"},$={class:"image-box"},F={class:"file-type"},P={class:"text"},R={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=T(ae,500),te={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),te.lastSendTime=null==(e=B(o))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{var o,a;const n=new Date(e.sendTime);let i=x(n,"yyyy年MM月");S(n,new Date)?i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=te.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await z(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}D(X,(()=>{oe()})),D(Y,(()=>{oe()}));const ne=o((()=>{var e,t;return"image"===V.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${x(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",a=o.lastIndexOf(".");if(-1!==a){return o.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,o)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(d("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[c(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[d("span",O,g(e.label),1),d("div",$,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(d("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:w(r(q))},[c(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":o[0]||(o[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[c(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),d("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var o;return n(),m("div",{class:"file-item",key:t},[d("span",F,g(re(e)),1),d("div",P,[d("span",R,g(e.content.msg),1),d("span",G,g(ie(e)),1)]),d("div",N,[c(E,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.70"))||"转发消息",mode:"relay",onComfirm:(t,o)=>r(K)({content:e.content,checkedIds:t,remark:o})},{trigger:s((()=>[c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(j)},null,8,["component"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.98"))||"转发")]})),_:1})])),_:2},1032,["onComfirm"]),c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(I),onClick:()=>r(U)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载")]})),_:2},1024)])])})),128))],512)],4),[[v,"image"!==e.type]])]})),_:1},8,["title"]))}});export{V as default};
@@ -5,13 +5,32 @@ import { simplifyMessage } from '../utils';
5
5
  import { FileOptions } from '../types';
6
6
  declare const _default: import("vue").DefineComponent<{}, {
7
7
  inputRef: Ref<HTMLDivElement | undefined>;
8
- state: import("../types").IState;
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
+ };
9
27
  sendMessage: (message: {
10
28
  chatType?: string | undefined;
11
29
  content: AnyObject;
12
30
  receiver?: string | undefined;
13
31
  }) => Promise<void>;
14
32
  isGroupChat: import("vue").ComputedRef<boolean>;
33
+ isEnded: import("vue").ComputedRef<boolean>;
15
34
  showEmoji: Ref<boolean>;
16
35
  content: Ref<string>;
17
36
  commonEmoticons: Ref<string[]>;
@@ -56,6 +75,10 @@ declare const _default: import("vue").DefineComponent<{}, {
56
75
  type: import("vue").PropType<AnyObject[]>;
57
76
  default: () => never[];
58
77
  };
78
+ disabled: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
59
82
  }, {
60
83
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
61
84
  title: {
@@ -77,11 +100,33 @@ declare const _default: import("vue").DefineComponent<{}, {
77
100
  type: import("vue").PropType<AnyObject[]>;
78
101
  default: () => never[];
79
102
  };
103
+ disabled: {
104
+ type: BooleanConstructor;
105
+ default: boolean;
106
+ };
80
107
  }>> & {
81
108
  onComfirm?: ((...args: any[]) => any) | undefined;
82
109
  }>>;
83
110
  emit: (event: "comfirm", ...args: any[]) => void;
84
- state: import("../types").IState;
111
+ state: {
112
+ orgId: string | number;
113
+ currentSessionItem: AnyObject;
114
+ id: string;
115
+ userInfo: AnyObject;
116
+ msgList: AnyObject[];
117
+ currentMsg: AnyObject;
118
+ isAppendMsg: boolean;
119
+ sessionList: AnyObject[];
120
+ isChangeSession: boolean;
121
+ updateSessionItem: AnyObject;
122
+ isUpdateSession: boolean;
123
+ currentReferenceMsg: AnyObject | null;
124
+ currentReEditMsg: AnyObject | null;
125
+ showVideo: boolean;
126
+ currentAVMsg: AnyObject;
127
+ currentGroupUser: AnyObject[];
128
+ showMultipleVideo: boolean;
129
+ };
85
130
  setCurrentSessionItem: (item: AnyObject) => void;
86
131
  listRef: Ref<any>;
87
132
  keyword: Ref<string>;
@@ -141,11 +186,16 @@ declare const _default: import("vue").DefineComponent<{}, {
141
186
  type: import("vue").PropType<AnyObject[]>;
142
187
  default: () => never[];
143
188
  };
189
+ disabled: {
190
+ type: BooleanConstructor;
191
+ default: boolean;
192
+ };
144
193
  }>> & {
145
194
  onComfirm?: ((...args: any[]) => any) | undefined;
146
195
  }, {
147
196
  title: string;
148
197
  defaultValue: AnyObject[];
198
+ disabled: boolean;
149
199
  mode: string;
150
200
  disabledIds: string[];
151
201
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as g,renderList as p,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as E,NUpload as C,NUploadTrigger as I}from"naive-ui";import T from"./ChatAdd.vue.js";import{useState as x}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{MESSAGE_TYPE as j,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L,base64ToFile as O}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as A,VideocamOutline as $}from"@vicons/ionicons5";import{xor as H,uniq as J,trim as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";import{useStorage as U}from"@vueuse/core";const G={key:0,class:"reference-content-box"},N={class:"reference-content"},X=["innerHTML"],B={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),P=l("span",null,"最近使用",-1),Q={class:"list-box",style:{"margin-bottom":"8px"}},W=["src"],Y=l("span",null,"默认表情",-1),Z={class:"list-box"},ee=["src"],ne=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),te=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),oe=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),ie={class:"btn-box"},se=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var re=e({__name:"ChatFooter",setup(e){const re=n(),{state:ae,sendMessage:ce}=x(),{isGroupChat:le}=b(ae),ue=n(!1),fe=n(""),de=U("commonEmoticons",[]),me=t((()=>({options:ae.currentGroupUser,defaultValue:[ae.userInfo]}))),ge=t((()=>!fe.value.replace(/(&nbsp;|\s|<br>)+/g,"")));function pe(e,n=[]){const t=F(),o=[],i=n.length>0;ae.showVideo||ae.showMultipleVideo||(i?(o.push(...H(n,[ae.userInfo.id])),Object.assign(ae.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),ae.showMultipleVideo=!0):ce({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function he(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),_e()))}function ye(){var e;fe.value=(null==(e=re.value)?void 0:e.innerHTML)||""}function ve(e){var n;de.value.unshift(e),de.value=J(de.value).slice(0,26),null==(n=re.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(e)} />`)}async function we(e){const n=new FormData;return n.append("sender",ae.userInfo.id),n.append("file",e),await q(n)}async function Me(e,n){const{file:t,name:o}=e.file,i=await we(t);if(!i)return console.log("上传失败");ke({chatMessageType:n,msg:n===j.FILE?o:i,url:i})}async function _e(){const{innerHTML:e="",innerText:n="",outerText:t=""}=re.value||{};if(ge.value)return console.log("请输入内容");let o=j.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),s=(t||[]).length;if(n&&0===s)i=n;else if(n||1!==s){if(o=j.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<s;e++)if(t[e].includes(`data-type="${j.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await O(n[1]);if(e){const t=await we(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(j.EMOJI)){o=j.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=j.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await O(n[1]);if(e){const n=await we(e);n&&(i=n)}}}}else i=V(n);i&&ke({msg:i,chatMessageType:o,origin:"btn"})}async function ke(e){const{chatMessageType:n=j.TEXT,msg:t,url:o,origin:i=""}=e,s={msg:t,chatMessageType:n};n===j.FILE&&(s.fileUrl=o),"btn"===i&&Ee(),ae.currentReferenceMsg&&([j.TEXT,j.EMOJI,j.BLEND].includes(n)&&(s.referenceContent=K(ae.currentReferenceMsg)),ae.currentReferenceMsg=null),ce({content:s})}function Ee(){re.value.innerHTML="",fe.value=""}return o((()=>[ae.currentReferenceMsg,ae.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=re.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===j.TEXT?t:`<img data-msg=${t} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),ae.currentReEditMsg=null}})),o((()=>ae.id),(e=>{e&&Ee()})),(e,n)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ae).id?"default":"not-allowed"})},[c(ae).currentReferenceMsg?(s(),r("div",G,[l("div",N,[l("span",null,u(c(ae).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ae).currentReferenceMsg.content)},null,8,X)]),f(c(M),{component:c(D),onClick:n[0]||(n[0]=()=>c(ae).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",B,[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:ue.value,"onUpdate:show":n[1]||(n[1]=e=>ue.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[S])),_:1})])),default:m((()=>[c(de).length>0?(s(),r(g,{key:0},[P,l("div",Q,[(s(!0),r(g,null,p(c(de),(e=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:c(R).findEmoji(e)},null,8,W)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])],64)):d("v-if",!0),Y,l("div",Z,[(s(!0),r(g,null,p(c(R).default,(([e,n])=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:n},null,8,ee)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:m((()=>[y(" 表情 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>ke({chatMessageType:c(j).EMOJI,msg:0}))},{icon:m((()=>[ne])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>Me(e,c(j).IMAGE))},{default:m((()=>[f(c(I),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[te])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>Me(e,c(j).FILE))},{default:m((()=>[f(c(I),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[oe])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(ae).userInfo.sdkAppID?(s(),r(g,{key:0},[c(le)?(s(),r(g,{key:0},[f(T,v(c(me),{onComfirm:n[5]||(n[5]=e=>pe(c(j).AUDIO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),f(T,v(c(me),{onComfirm:n[6]||(n[6]=e=>pe(c(j).VIDEO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"20",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(s(),r(g,{key:1},[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>pe(c(j).AUDIO))},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>pe(c(j).VIDEO))},{icon:m((()=>[f(c(M),{size:"20",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))],64)):d("v-if",!0)]),i(l("div",{ref_key:"inputRef",ref:re,class:"input-box",contenteditable:"",onKeydown:he,onInput:ye},null,544),[[w,c(ae).id]]),l("div",ie,[se,f(c(E),{type:"primary",round:"",disabled:c(ge),onClick:_e},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ae).id]])}});export{re as default};
1
+ import{createElementVNode as e,defineComponent as n,ref as t,computed as o,watch as i,withDirectives as a,openBlock as r,createElementBlock as l,normalizeStyle as s,unref as c,toDisplayString as u,createVNode as d,createCommentVNode as g,withCtx as f,Fragment as m,renderList as w,createBlock as p,createTextVNode as y,mergeProps as v,renderSlot as h,vShow as C}from"vue";import{NIcon as M,NTooltip as k,NPopover as _,NButton as E,NUpload as I,NUploadTrigger as L}from"naive-ui";import T from"./ChatAdd.vue.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as x,AV_STATUS as j}from"../constants/index.js";import{uploadFileApi as z}from"../api/index.js";import{simplifyMessage as B,base64ToFile as O}from"../utils/index.js";import{xor as R,uniq as D,trim as q,cloneDeep as $}from"lodash-es";import"trtc-sdk-v5";import{emojis as A}from"../utils/emoji.js";import{CloseCircleOutline as H,CallOutline as J,VideocamOutline as V}from"@vicons/ionicons5";import{uuidGenerator as K}from"../../../../shared/utils/index.js";import{useStorage as F}from"@vueuse/core";var U,G;const N={key:0,class:"reference-content-box"},X={class:"reference-content"},S=["innerHTML"],P={class:"tool-box"},Q=e("i",{class:"chat--iconfont chat--icon-face"},null,-1),W=e("span",null,(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.51"))||"最近使用",-1),Y={class:"list-box",style:{"margin-bottom":"8px"}},Z=["src"],ee=e("span",null,(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.52"))||"默认表情",-1),ne={class:"list-box"},te=["src"],oe=e("i",{class:"chat--iconfont chat--icon-good"},null,-1),ie=e("i",{class:"chat--iconfont chat--icon-image"},null,-1),ae=e("i",{class:"chat--iconfont chat--icon-folder"},null,-1),re=["contenteditable"],le={class:"btn-box"},se=e("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ce=n({__name:"ChatFooter",setup(n){const U=t(),{state:G,sendMessage:ce,isGroupChat:ue,isEnded:de}=b(),ge=t(!1),fe=t(""),me=F("commonEmoticons",[]),we=o((()=>({options:G.currentGroupUser,defaultValue:[G.userInfo]}))),pe=o((()=>!fe.value.replace(/(&nbsp;|\s|<br>)+/g,"")));function ye(e,n=[]){const t=K(),o=[],i=n.length>0;G.showVideo||G.showMultipleVideo||(i?(o.push(...R(n,[G.userInfo.id])),Object.assign(G.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),G.showMultipleVideo=!0):ce({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ve(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),_e()))}function he(){var e;fe.value=(null==(e=U.value)?void 0:e.innerHTML)||""}function Ce(e){var n;me.value.unshift(e),me.value=D(me.value).slice(0,26),null==(n=U.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${x.EMOJI} class="emoji--min" src=${A.findEmoji(e)} />`)}async function Me(e){const n=new FormData;return n.append("sender",G.userInfo.id),n.append("file",e),await z(n)}async function ke(e,n){const{file:t,name:o}=e.file,i=await Me(t);if(!i)return console.log("上传失败");Ee({chatMessageType:n,msg:n===x.FILE?o:i,url:i})}async function _e(){const{innerHTML:e="",innerText:n="",outerText:t=""}=U.value||{};if(pe.value)return console.log("请输入内容");let o=x.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),a=(t||[]).length;if(n&&0===a)i=n;else if(n||1!==a){if(o=x.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<a;e++)if(t[e].includes(`data-type="${x.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await O(n[1]);if(e){const t=await Me(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(x.EMOJI)){o=x.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=x.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await O(n[1]);if(e){const n=await Me(e);n&&(i=n)}}}}else i=q(n);i&&Ee({msg:i,chatMessageType:o,origin:"btn"})}async function Ee(e){const{chatMessageType:n=x.TEXT,msg:t,url:o,origin:i=""}=e,a={msg:t,chatMessageType:n};n===x.FILE&&(a.fileUrl=o),"btn"===i&&Ie(),G.currentReferenceMsg&&([x.TEXT,x.EMOJI,x.BLEND].includes(n)&&(a.referenceContent=$(G.currentReferenceMsg)),G.currentReferenceMsg=null),ce({content:a})}function Ie(){U.value.innerHTML="",fe.value=""}return i((()=>[G.currentReferenceMsg,G.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=U.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===x.TEXT?t:`<img data-msg=${t} data-type=${x.EMOJI} class="emoji--min" src=${A.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),G.currentReEditMsg=null}})),i((()=>G.id),(e=>{e&&Ie()})),(n,t)=>a((r(),l("section",{class:"chat-footer",style:s({cursor:c(G).id?"default":"not-allowed"})},[c(G).currentReferenceMsg?(r(),l("div",N,[e("div",X,[e("span",null,u(c(G).currentReferenceMsg.senderName)+":",1),e("pre",{innerHTML:c(B)(c(G).currentReferenceMsg.content)},null,8,S)]),d(c(M),{component:c(H),onClick:t[0]||(t[0]=()=>c(G).currentReferenceMsg=null)},null,8,["component"])])):g("v-if",!0),e("div",P,[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(_),{"content-class":"emoji-content",class:"emoji-wrapper",show:ge.value,"onUpdate:show":t[1]||(t[1]=e=>ge.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny"},{icon:f((()=>[Q])),_:1})])),default:f((()=>[c(me).length>0?(r(),l(m,{key:0},[W,e("div",Y,[(r(!0),l(m,null,w(c(me),(n=>(r(),p(c(k),{key:n,"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:()=>Ce(n)},{icon:f((()=>[e("img",{src:c(A).findEmoji(n)},null,8,Z)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(n),1)])),_:2},1024)))),128))])],64)):g("v-if",!0),ee,e("div",ne,[(r(!0),l(m,null,w(c(A).default,(([n,t])=>(r(),p(c(k),{key:n,"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:()=>Ce(n)},{icon:f((()=>[e("img",{src:t},null,8,te)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(n),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.53"))||"表情")]})),_:1}),d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>Ee({chatMessageType:c(x).EMOJI,msg:0}))},{icon:f((()=>[oe])),_:1})])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.54"))||"点赞")]})),_:1}),d(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ke(e,c(x).IMAGE))},{default:f((()=>[d(c(L),{abstract:""},{default:f((({handleClick:e})=>[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[ie])),_:2},1032,["onClick"])])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.55"))||"上传图片")]})),_:2},1024)])),_:1})])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ke(e,c(x).FILE))},{default:f((()=>[d(c(L),{abstract:""},{default:f((({handleClick:e})=>[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[ae])),_:2},1032,["onClick"])])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.56"))||"上传文件")]})),_:2},1024)])),_:1})])),_:1}),c(G).userInfo.sdkAppID?(r(),l(m,{key:0},[c(ue)?(r(),l(m,{key:0},[d(T,v(c(we),{onComfirm:t[5]||(t[5]=e=>ye(c(x).AUDIO,e))}),{trigger:f((()=>[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny"},{icon:f((()=>[d(c(M),{size:"18",component:c(J)},null,8,["component"])])),_:1})])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1})])),_:1},16),d(T,v(c(we),{onComfirm:t[6]||(t[6]=e=>ye(c(x).VIDEO,e))}),{trigger:f((()=>[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny"},{icon:f((()=>[d(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.58"))||"视频会议")]})),_:1})])),_:1},16)],64)):(r(),l(m,{key:1},[d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ye(c(x).AUDIO))},{icon:f((()=>[d(c(M),{size:"18",component:c(J)},null,8,["component"])])),_:1})])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.57"))||"语音通话")]})),_:1}),d(c(k),{"show-arrow":!1},{trigger:f((()=>[d(c(E),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ye(c(x).VIDEO))},{icon:f((()=>[d(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.59"))||"视频通话")]})),_:1})],64))],64)):g("v-if",!0),h(n.$slots,"footer")]),a(e("div",{ref_key:"inputRef",ref:U,class:"input-box",contenteditable:!c(de),onKeydown:ve,onInput:he},null,40,re),[[C,c(G).id]]),e("div",le,[se,d(c(E),{type:"primary",round:"",disabled:c(pe),onClick:_e},{default:f((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.60"))||"发送")]})),_:1},8,["disabled"])])],4)),[[C,c(G).id]])}});export{ce as default};