cnhis-design-vue 3.2.15-beta.2 → 3.2.15-beta.8

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 (187) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  3. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  4. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  5. package/es/components/branch-notice/index.d.ts +393 -6
  6. package/es/components/branch-notice/src/BranchNotice.vue.d.ts +369 -6
  7. package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -1
  8. package/es/components/branch-notice/src/canstants.d.ts +2 -1
  9. package/es/components/branch-notice/src/canstants.js +1 -1
  10. package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +168 -44
  11. package/es/components/branch-notice/src/components/NoticeItem.vue.js +1 -0
  12. package/es/components/branch-notice/src/components/NoticeItem.vue2.js +1 -0
  13. package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +74 -5
  14. package/es/components/branch-notice/src/components/NoticeItemAside.vue.js +1 -0
  15. package/es/components/branch-notice/src/components/NoticeItemAside.vue2.js +1 -0
  16. package/es/components/branch-notice/src/components/NoticeOperationList.vue.js +1 -0
  17. package/es/components/branch-notice/src/components/NoticeOperationList.vue2.js +1 -0
  18. package/es/components/branch-notice/src/drawLine.js +1 -1
  19. package/es/components/branch-notice/src/hooks/useTheme.d.ts +1 -0
  20. package/es/components/branch-notice/src/hooks/useTheme.js +1 -0
  21. package/es/components/branch-notice/src/types.d.ts +22 -4
  22. package/es/components/branch-notice/style/index.css +1 -1
  23. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  24. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  25. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  26. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  27. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  28. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  29. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  30. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  31. package/es/components/expand-field/src/index.vue2.js +1 -1
  32. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  40. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  41. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  49. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  51. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/{temperature/useShadow.d.ts → useShadow.d.ts} +2 -2
  56. package/es/components/fabric-chart/src/hooks/useShadow.js +1 -0
  57. package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
  58. package/es/components/fabric-chart/src/utils/index.js +1 -1
  59. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  60. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  61. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  62. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  63. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  64. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  65. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  66. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  67. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  68. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  69. package/es/components/field-set/src/constants/filter.js +1 -1
  70. package/es/components/field-set/src/constants/index.js +1 -1
  71. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  72. package/es/components/form-config/src/hooks/useLocale.js +1 -1
  73. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  74. package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
  75. package/es/components/form-render/src/components/renderer/complex.js +1 -1
  76. package/es/components/form-render/src/components/renderer/date.js +1 -1
  77. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  78. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  79. package/es/components/form-render/src/components/renderer/select.js +1 -1
  80. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  81. package/es/components/form-render/src/components/renderer/text.js +1 -1
  82. package/es/components/form-render/src/components/renderer/textarea.js +1 -1
  83. package/es/components/form-render/src/hooks/useAnchor.js +1 -1
  84. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  85. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  86. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  87. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  88. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  89. package/es/components/form-render/src/utils/index.js +1 -1
  90. package/es/components/iho-chat/index.d.ts +261 -27
  91. package/es/components/iho-chat/src/Index.vue.d.ts +261 -27
  92. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  93. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
  94. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  95. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +2 -0
  96. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  97. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +2 -0
  98. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +11 -2
  99. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -1
  100. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  101. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
  102. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +34 -34
  103. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  104. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +4 -1
  105. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  106. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +2 -0
  107. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  108. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +2 -1
  109. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  110. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +203 -4
  111. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  112. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
  113. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  114. package/es/components/iho-chat/src/components/userItemRender.d.ts +18 -0
  115. package/es/components/iho-chat/src/components/userItemRender.js +1 -0
  116. package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
  117. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  118. package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
  119. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
  120. package/es/components/iho-chat/src/types/index.d.ts +2 -0
  121. package/es/components/iho-chat/src/utils/index.js +1 -1
  122. package/es/components/iho-chat/style/index.css +1 -1
  123. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  124. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  125. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  126. package/es/components/index.css +1 -1
  127. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  128. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  129. package/es/components/map/src/Map.vue2.js +1 -1
  130. package/es/components/quick-search/src/index.vue2.js +1 -1
  131. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  132. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  133. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  134. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  135. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  136. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  137. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  138. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  139. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  140. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  141. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  142. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  143. package/es/components/template-render/src/components/index.d.ts +23 -23
  144. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  145. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  146. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  147. package/es/env.d.ts +25 -25
  148. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  149. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  150. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  151. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  152. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  153. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  154. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  155. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  156. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  157. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  158. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  159. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  160. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  161. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  162. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  163. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  164. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  165. package/es/shared/assets/img/failure.png.js +1 -1
  166. package/es/shared/assets/img/logo.png.js +1 -1
  167. package/es/shared/assets/img/no-permission.png.js +1 -1
  168. package/es/shared/assets/img/nodata.png.js +1 -1
  169. package/es/shared/assets/img/notfound.png.js +1 -1
  170. package/es/shared/assets/img/qr.png.js +1 -1
  171. package/es/shared/assets/img/success.png.js +1 -1
  172. package/es/shared/assets/img/table_style_2.png.js +1 -1
  173. package/es/shared/assets/img/video.png.js +1 -1
  174. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  175. package/es/shared/assets/img/xb_big.png.js +1 -1
  176. package/es/shared/assets/img/xb_small.png.js +1 -1
  177. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  178. package/es/shared/package.json.js +1 -1
  179. package/package.json +2 -2
  180. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  181. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  182. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  183. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  184. package/es/components/fabric-chart/src/hooks/temperature/useShadow.js +0 -1
  185. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  186. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  187. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -11,8 +11,7 @@ declare const _default: import("vue").DefineComponent<{}, {
11
11
  unreadSessionKeys: string[];
12
12
  flexWidth: import("vue").Ref<number>;
13
13
  listBoxRef: import("vue").Ref<HTMLElement | undefined>;
14
- loading: import("vue").Ref<boolean>;
15
- filterList: import("vue").Ref<{
14
+ filterListByTag: import("vue").Ref<{
16
15
  label: string;
17
16
  key: string;
18
17
  }[]>;
@@ -21,7 +20,13 @@ declare const _default: import("vue").DefineComponent<{}, {
21
20
  menuPosition: any;
22
21
  sessionId: import("vue").Ref<any>;
23
22
  currentFilterKey: import("vue").Ref<string>;
23
+ dateRange: import("vue").Ref<any>;
24
+ keyword: import("vue").Ref<string>;
25
+ showSearch: import("vue").Ref<boolean>;
26
+ filterList: import("vue").Ref<AnyObject[]>;
27
+ handleInput: () => void;
24
28
  state: {
29
+ filterable: boolean;
25
30
  orgId: string | number;
26
31
  currentSessionItem: AnyObject;
27
32
  id: string;
@@ -41,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{}, {
41
46
  showMultipleVideo: boolean;
42
47
  };
43
48
  unreadTotal: import("vue").ComputedRef<number>;
44
- openSession: (item: AnyObject) => Promise<void>;
49
+ openSession: (session: string | AnyObject) => Promise<void>;
45
50
  setUpdateSessionItem: (item: AnyObject) => void;
46
51
  setCurrentSessionItem: (item: AnyObject) => void;
47
52
  currentWidth: import("vue").ComputedRef<number>;
@@ -52,10 +57,14 @@ declare const _default: import("vue").DefineComponent<{}, {
52
57
  showSession: (item: AnyObject, currentKey?: string) => boolean | undefined;
53
58
  handleContextmenu: (event: MouseEvent, id: string) => Promise<void>;
54
59
  handleSelect: (key: string, session: AnyObject) => Promise<void>;
55
- NSpin: any;
60
+ handleUpdateShow: (value: boolean) => void;
61
+ handleSearch: () => void;
56
62
  NBadge: any;
57
63
  NAvatar: any;
64
+ NInput: any;
58
65
  NTag: any;
66
+ NIcon: any;
67
+ NPopover: any;
59
68
  ContextMenu: import("vue").DefineComponent<{
60
69
  type: {
61
70
  type: StringConstructor;
@@ -99,5 +108,195 @@ declare const _default: import("vue").DefineComponent<{}, {
99
108
  };
100
109
  formatTime: typeof formatTime;
101
110
  STATUS: typeof STATUS;
111
+ CDatePicker: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
112
+ updateUnchangedValue: {
113
+ type: BooleanConstructor;
114
+ };
115
+ onConfirm: {
116
+ type: FunctionConstructor;
117
+ };
118
+ formattedValue: {
119
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
120
+ };
121
+ placeholder: {
122
+ type: StringConstructor;
123
+ };
124
+ allowedInvalidValue: {
125
+ type: StringConstructor;
126
+ };
127
+ to: {
128
+ type: import("vue").PropType<string | false | HTMLElement>;
129
+ default: string;
130
+ };
131
+ holidays: {
132
+ type: import("vue").PropType<Date[]>;
133
+ default: () => never[];
134
+ };
135
+ type: {
136
+ type: StringConstructor;
137
+ default: string;
138
+ };
139
+ }, {
140
+ attrs: {
141
+ [x: string]: unknown;
142
+ };
143
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
144
+ updateUnchangedValue: {
145
+ type: BooleanConstructor;
146
+ };
147
+ onConfirm: {
148
+ type: FunctionConstructor;
149
+ };
150
+ formattedValue: {
151
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
152
+ };
153
+ placeholder: {
154
+ type: StringConstructor;
155
+ };
156
+ allowedInvalidValue: {
157
+ type: StringConstructor;
158
+ };
159
+ to: {
160
+ type: import("vue").PropType<string | false | HTMLElement>;
161
+ default: string;
162
+ };
163
+ holidays: {
164
+ type: import("vue").PropType<Date[]>;
165
+ default: () => never[];
166
+ };
167
+ type: {
168
+ type: StringConstructor;
169
+ default: string;
170
+ };
171
+ }>> & {
172
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
173
+ }>>;
174
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
175
+ datePickerRef: import("vue").Ref<AnyObject | null>;
176
+ panelInstRef: import("vue").Ref<null>;
177
+ placeholderRef: import("vue").Ref<any>;
178
+ oldValue: string;
179
+ currentFormattedValue: import("vue").WritableComputedRef<(string | [string, string]) | null | undefined>;
180
+ isDateTime: import("vue").ComputedRef<boolean>;
181
+ formatRef: import("vue").ComputedRef<string>;
182
+ panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
183
+ focus: () => any;
184
+ blur: () => any;
185
+ handleConfirm: (target: HTMLInputElement) => void;
186
+ onUpdateShow: (show: boolean) => Promise<void>;
187
+ watchers: import("../../../../shared/types").AnyFn[];
188
+ stopWatcher: () => void;
189
+ setHoliday: (show: boolean) => Promise<void>;
190
+ onConfirm: (...args: any[]) => Promise<void>;
191
+ isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
192
+ setShortcutValue: (type: "month" | "week") => Promise<void>;
193
+ NDatePicker: any;
194
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
195
+ updateUnchangedValue: {
196
+ type: BooleanConstructor;
197
+ };
198
+ onConfirm: {
199
+ type: FunctionConstructor;
200
+ };
201
+ formattedValue: {
202
+ type: import("vue").PropType<(string | [string, string]) | null | undefined>;
203
+ };
204
+ placeholder: {
205
+ type: StringConstructor;
206
+ };
207
+ allowedInvalidValue: {
208
+ type: StringConstructor;
209
+ };
210
+ to: {
211
+ type: import("vue").PropType<string | false | HTMLElement>;
212
+ default: string;
213
+ };
214
+ holidays: {
215
+ type: import("vue").PropType<Date[]>;
216
+ default: () => never[];
217
+ };
218
+ type: {
219
+ type: StringConstructor;
220
+ default: string;
221
+ };
222
+ }>> & {
223
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
224
+ }, {
225
+ type: string;
226
+ updateUnchangedValue: boolean;
227
+ to: string | false | HTMLElement;
228
+ holidays: Date[];
229
+ }>>;
230
+ SearchOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
231
+ userItemRender: import("vue").DefineComponent<{
232
+ item: {
233
+ type: import("vue").PropType<AnyObject>;
234
+ default: () => {};
235
+ };
236
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
237
+ item: {
238
+ type: import("vue").PropType<AnyObject>;
239
+ default: () => {};
240
+ };
241
+ }>> & {
242
+ "onItem-click"?: ((...args: any[]) => any) | undefined;
243
+ }, {
244
+ item: AnyObject;
245
+ }>;
246
+ DefaultPage: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
247
+ type: {
248
+ type: StringConstructor;
249
+ default: string;
250
+ };
251
+ config: {
252
+ type: import("vue").PropType<AnyObject>;
253
+ default: () => {
254
+ title: string;
255
+ content: string;
256
+ };
257
+ };
258
+ }, {
259
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
260
+ type: {
261
+ type: StringConstructor;
262
+ default: string;
263
+ };
264
+ config: {
265
+ type: import("vue").PropType<AnyObject>;
266
+ default: () => {
267
+ title: string;
268
+ content: string;
269
+ };
270
+ };
271
+ }>> & {
272
+ onReloadPage?: ((...args: any[]) => any) | undefined;
273
+ }>>;
274
+ emit: (event: "reloadPage", ...args: any[]) => void;
275
+ configResult: import("vue").ComputedRef<{
276
+ title: string;
277
+ content: string;
278
+ img: string;
279
+ }>;
280
+ reloadPage: () => void;
281
+ NIcon: any;
282
+ Refresh: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
283
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
284
+ type: {
285
+ type: StringConstructor;
286
+ default: string;
287
+ };
288
+ config: {
289
+ type: import("vue").PropType<AnyObject>;
290
+ default: () => {
291
+ title: string;
292
+ content: string;
293
+ };
294
+ };
295
+ }>> & {
296
+ onReloadPage?: ((...args: any[]) => any) | undefined;
297
+ }, {
298
+ type: string;
299
+ config: AnyObject;
300
+ }>>;
102
301
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
103
302
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as i,withDirectives as l,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 M}from"naive-ui";import E from"./ContextMenu.js";import{useData as b}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as R}from"../constants/index.js";import{toppingSessionApi as j,updateStatusApi as D}from"../api/index.js";import{listSort as L,formatTime as S}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as B}from"../../../../shared/directive/flexibleResize.js";const N={class:"sider-list__filter box-shadow"},T=["onClick","onContextmenu"],V={class:"avatar-right"},O={class:"name"},H={class:"msg-tip"},I={class:"msg-tip__content"},z={key:0},K=["innerHTML"];var U=e({__name:"SiderList",setup(e){var U,W,A;const X="all",Y="unread",$="ended";let q=[];const F=t(300),G=t(),J=t(!1),P=t([{label:(null==(U=window.getLanguageByCode)?void 0:U.call(window,"10010.1.123"))||"全部",key:X},{label:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.124"))||"未读",key:Y},{label:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.77"))||"结束",key:$}]),Q=t(),Z=t(!1),ee=t({left:0,top:0}),te=t(),ie=t("all"),{state:le,unreadTotal:ne,openSession:oe,setUpdateSessionItem:se,setCurrentSessionItem:ae}=b(),ue=i((()=>Math.min(Math.max(F.value,240),360))),de=i((()=>L(le.sessionList)));function re({distance:e}){F.value=F.value+e}function ve(e,t=a(ie)){var i;return t===X||(t===Y?q.includes(e.sessionKey)||(null!=(i=e.unreadNum)?i:0)>0:t===$?e.status===R.ENDED:void 0)}async function pe(e,t){try{if("topping"===e)return await j({id:t.id,topping:!(null==t?void 0:t.topping)}),void(le.id===t.id?ae({topping:!(null==t?void 0:t.topping)}):se({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await D({id:t.id,status:R.REMOVED}),le.id===t.id?ae({status:R.REMOVED}):se({...t,status:R.REMOVED}))}catch(e){}}return(e,t)=>l((n(),o("section",{class:"sider-list",style:s({width:a(ue)+"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",N,[(n(!0),o(v,null,p(P.value,(e=>(n(),u(a(_),{type:ie.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,ie.value=t,void(t===Y&&(q=(de.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===$?de.value.filter((e=>e.status===R.ENDED)).length:ne.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(de),(e=>{var t;return n(),o(v,{key:e.id},[e.status!==a(R).REMOVED?l((n(),o("div",{key:0,onClick:()=>a(oe)(e),onContextmenu:f((t=>async function(e,t){var i,l,n,o,s;te.value=t,Z.value=!0,await h();const{clientX:a,clientY:u}=e,{width:d=0,height:r=0,left:v=0,top:p=0}=(null==(i=G.value)?void 0:i.getBoundingClientRect())||{},{width:c=100,height:m=80}=(null==(n=null==(l=Q.value)?void 0:l.$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",ee.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",V,[r("div",O,[r("h4",null,g(e.name),1),r("span",null,g(e.lastMessage?a(S)(e.lastMessageSendTime).siderMsgTime:""),1)]),r("div",H,[r("div",I,["WITHDRAWN"===e.lastMessageStatus?(n(),o("div",z,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(n(),o("div",{key:1,innerHTML:e.lastMessageContent},null,8,K))]),w(a(M),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,T)),[[k,ve(e)]]):d("v-if",!0)],64)})),128)),w(a(E),{ref_key:"contextmenuRef",ref:Q,show:Z.value,"onUpdate:show":t[0]||(t[0]=e=>Z.value=e),type:"session",position:ee.value,id:te.value,onSelect:pe},null,8,["show","position","id"])],512)],4)),[[a(B),{mode:"VR",onMove:re}]])}});export{U as default};
1
+ import{defineComponent as e,ref as t,computed as i,withDirectives as l,openBlock as n,createElementBlock as a,normalizeStyle as o,unref as s,createVNode as r,withCtx as u,createElementVNode as d,Fragment as v,renderList as p,createBlock as c,vShow as m,createCommentVNode as f,createTextVNode as g,toDisplayString as w,withModifiers as y,normalizeClass as h,nextTick as k}from"vue";import{NPopover as _,NInput as x,NIcon as C,NTag as M,NAvatar as b,NBadge as j}from"naive-ui";import D from"./ContextMenu.js";import{useData as R}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{STATUS as E}from"../constants/index.js";import{toppingSessionApi as L,updateStatusApi as T}from"../api/index.js";import{listSort as B,formatTime as I}from"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";import{vFlexibleResize as N}from"../../../../shared/directive/flexibleResize.js";import S from"../../../date-picker/index.js";import{SearchOutline as U}from"@vicons/ionicons5";import V from"./userItemRender.js";import O from"../../../default-page/index.js";import{useDebounceFn as H}from"@vueuse/core";import{isBefore as z,isAfter as K}from"date-fns";const W={key:0,class:"sider-list__filter"},A={class:"user-list-wrapper"},F={class:"sider-list__tags box-shadow"},X=["onClick","onContextmenu"],Y={class:"avatar-right"},$={class:"name"},q={class:"msg-tip"},G={class:"msg-tip__content"},J={key:0},P=["innerHTML"];var Q=e({__name:"SiderList",setup(e){var Q,Z,ee;const te="all",ie="unread",le="ended";let ne=[];const ae=t(300),oe=t(),se=t([{label:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.123"))||"全部",key:te},{label:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.124"))||"未读",key:ie},{label:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.77"))||"结束",key:le}]),re=t(),ue=t(!1),de=t({left:0,top:0}),ve=t(),pe=t("all"),ce=t(),me=t(""),fe=t(!1),ge=t([]),we=H(Ee,500),{state:ye,unreadTotal:he,openSession:ke,setUpdateSessionItem:_e,setCurrentSessionItem:xe}=R(),Ce=i((()=>Math.min(Math.max(ae.value,240),360))),Me=i((()=>B(ye.sessionList)));function be({distance:e}){ae.value=ae.value+e}function je(e,t=s(pe)){var i;return t===te||(t===ie?ne.includes(e.sessionKey)||(null!=(i=e.unreadNum)?i:0)>0:t===le?e.status===E.ENDED:void 0)}async function De(e,t){try{if("topping"===e)return await L({id:t.id,topping:!(null==t?void 0:t.topping)}),void(ye.id===t.id?xe({topping:!(null==t?void 0:t.topping)}):_e({...t,topping:!(null==t?void 0:t.topping)}));"remove"===e&&(await T({id:t.id,status:E.REMOVED}),ye.id===t.id?xe({status:E.REMOVED}):_e({...t,status:E.REMOVED}))}catch(e){}}function Re(e){e||(fe.value=!1,me.value="")}function Ee(){ge.value=Me.value.filter((e=>{const t=e.name.includes(me.value);if(!ce.value||!e.createdTime)return t;const[i,l]=ce.value,n=new Date(e.createdTime);return t&&z(n,new Date(l+" 23:59:59"))&&K(n,new Date(i+" 00:00:00"))}))}return(e,t)=>l((n(),a("section",{class:"sider-list",style:o({width:s(Ce)+"px"})},[s(ye).filterable?(n(),a("div",W,[r(s(S),{"formatted-value":ce.value,"onUpdate:formatted-value":t[0]||(t[0]=e=>ce.value=e),type:"daterange",clearable:""},null,8,["formatted-value"]),r(s(_),{"content-class":"search-content__sider",class:"search-wrapper",show:fe.value,"onUpdate:show":[t[3]||(t[3]=e=>fe.value=e),Re],placement:"bottom-start",trigger:"click","display-directive":"show","show-arrow":!1},{trigger:u((()=>[r(s(x),{ref:"inputRef",placeholder:"请输入名称模糊搜索",value:me.value,"onUpdate:value":t[1]||(t[1]=e=>me.value=e),onInput:s(we),onFocus:Ee,style:{"margin-top":"10px"}},{prefix:u((()=>[r(s(C),{component:s(U)},null,8,["component"])])),_:1},8,["value","onInput"])])),default:u((()=>{var e;return[d("div",A,[(n(!0),a(v,null,p(ge.value,(e=>(n(),c(s(V),{key:e.id,item:e,onItemClick:t[2]||(t[2]=()=>Re(!1))},null,8,["item"])))),128)),l(r(s(O),{config:{title:" ",content:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.81"))||"找不到相关的结果"},type:"5"},null,512),[[m,ge.value.length<1]])])]})),_:1},8,["show"])])):f("v-if",!0),d("div",F,[(n(!0),a(v,null,p(se.value,(e=>(n(),c(s(M),{type:pe.value===e.key?"primary":"default",round:"",bordered:!1,key:e.key,onClick:()=>{return t=e.key,pe.value=t,void(t===ie&&(ne=(Me.value.filter((e=>{var t;return(null!=(t=e.unreadNum)?t:0)>0}))||[]).map((e=>e.sessionKey))));var t}},{default:u((()=>{return[g(w(e.label)+"("+w((t=e,t.key===le?Me.value.filter((e=>e.status===E.ENDED)).length:he.value))+") ",1)];var t})),_:2},1032,["type","onClick"])))),128))]),d("div",{class:"sider-list__box",ref_key:"listBoxRef",ref:oe},[(n(!0),a(v,null,p(s(Me),(e=>{var t;return n(),a(v,{key:e.id},[e.status!==s(E).REMOVED?l((n(),a("div",{key:0,onClick:()=>s(ke)(e),onContextmenu:y((t=>async function(e,t){var i,l,n,a,o;ve.value=t,ue.value=!0,await k();const{clientX:s,clientY:r}=e,{width:u=0,height:d=0,left:v=0,top:p=0}=(null==(i=oe.value)?void 0:i.getBoundingClientRect())||{},{width:c=100,height:m=80}=(null==(n=null==(l=re.value)?void 0:l.$el)?void 0:n.getBoundingClientRect())||{},f=null!=(o=null==(a=oe.value)?void 0:a.scrollTop)?o:0,g={};s<v+u-(c+2)-5?g.left=s-v+5+"px":g.right=v+u-s+5+"px",p+d-r<=m+5?g.bottom=5-f+"px":g.top=r-p+f+5+"px",de.value=g}(t,e.id)),["prevent"]),class:h(["sider-list__box__item",{active:e.id===s(ye).id},e.topping?"sider-list__box__item--top":""])},[r(s(b),{round:"",size:"large",src:e.avatar},null,8,["src"]),d("div",Y,[d("div",$,[d("h4",null,w(e.name),1),d("span",null,w(e.lastMessage?s(I)(e.lastMessageSendTime).siderMsgTime:""),1)]),d("div",q,[d("div",G,["WITHDRAWN"===e.lastMessageStatus?(n(),a("div",J,(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.68"))||"撤回了一条消息")):(n(),a("div",{key:1,innerHTML:e.lastMessageContent},null,8,P))]),r(s(j),{value:e.unreadNum>99?"99+":e.unreadNum},null,8,["value"])])])],42,X)),[[m,je(e)]]):f("v-if",!0)],64)})),128)),r(s(D),{ref_key:"contextmenuRef",ref:re,show:ue.value,"onUpdate:show":t[4]||(t[4]=e=>ue.value=e),type:"session",position:de.value,id:ve.value,onSelect:De},null,8,["show","position","id"])],512)],4)),[[s(N),{mode:"VR",onMove:be}]])}});export{Q as default};
@@ -7,6 +7,7 @@ declare const _default: import("vue").DefineComponent<{}, {
7
7
  receiver?: string | undefined;
8
8
  }) => Promise<void>;
9
9
  state: {
10
+ filterable: boolean;
10
11
  orgId: string | number;
11
12
  currentSessionItem: import("../../../../shared/types").AnyObject;
12
13
  id: string;
@@ -1 +1 @@
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.126"))||"接听",-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};
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};
@@ -0,0 +1,18 @@
1
+ import { PropType } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ item: {
5
+ type: PropType<AnyObject>;
6
+ default: () => {};
7
+ };
8
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "item-click"[], "item-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
+ item: {
10
+ type: PropType<AnyObject>;
11
+ default: () => {};
12
+ };
13
+ }>> & {
14
+ "onItem-click"?: ((...args: any[]) => any) | undefined;
15
+ }, {
16
+ item: AnyObject;
17
+ }>;
18
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,createVNode as s}from"vue";import{NAvatar as t}from"naive-ui";import{useData as i}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{openSessionApi as r}from"../api/index.js";import"../utils/index.js";import"lodash-es";import"trtc-sdk-v5";var o=e({name:"UserItemRender",props:{item:{type:Object,default:()=>({})}},emits:["item-click"],setup(e,{attrs:o,slots:m,emit:n}){const{state:a,openSession:c,cssVars:l}=i();return()=>s("div",{class:"user-item",onClick:()=>async function(e){n("item-click");const s=a.sessionList.find((s=>e&&[s.receiver,s.id].includes(e)));let t=s;s||(t=await r({chatType:"SINGLE",receiver:e,sender:a.userInfo.id}));c(t)}(e.item.id)},[s(t,{round:!0,size:32,src:e.item.avatar,color:l.value["--c-primary-color"]},null),s("div",{class:"user-info"},[s("span",null,[e.item.name]),s("span",null,[e.item.deptName]),s("span",null,[e.item.post])])])}});export{o as default};
@@ -6,6 +6,7 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
6
6
  cssVars: import("vue").ComputedRef<AnyObject>;
7
7
  stompClient: import("vue").Ref<ChatSock | undefined>;
8
8
  state: {
9
+ filterable: boolean;
9
10
  orgId: string | number;
10
11
  currentSessionItem: AnyObject;
11
12
  id: string;
@@ -39,7 +40,7 @@ export declare function initData(props: AnyObject, emit: (event: 'template-click
39
40
  remark: string;
40
41
  content: AnyObject;
41
42
  }) => Promise<void>;
42
- openSession: (item: AnyObject) => Promise<void>;
43
+ openSession: (session: string | AnyObject) => Promise<void>;
43
44
  closeSession: () => AnyObject | null;
44
45
  getCurrentSession: () => AnyObject | null;
45
46
  setCurrentSessionItem: (item: AnyObject) => void;
@@ -51,6 +52,7 @@ export declare const useData: () => {
51
52
  cssVars: import("vue").ComputedRef<AnyObject>;
52
53
  stompClient: import("vue").Ref<ChatSock | undefined>;
53
54
  state: {
55
+ filterable: boolean;
54
56
  orgId: string | number;
55
57
  currentSessionItem: AnyObject;
56
58
  id: string;
@@ -84,7 +86,7 @@ export declare const useData: () => {
84
86
  remark: string;
85
87
  content: AnyObject;
86
88
  }) => Promise<void>;
87
- openSession: (item: AnyObject) => Promise<void>;
89
+ openSession: (session: string | AnyObject) => Promise<void>;
88
90
  closeSession: () => AnyObject | null;
89
91
  getCurrentSession: () => AnyObject | null;
90
92
  setCurrentSessionItem: (item: AnyObject) => void;
@@ -1 +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,updateStatusApi as a,groupUserApi as c}from"../api/index.js";import{promiseTimeout as u,useIntervalFn as m}from"@vueuse/core";import{isGroup as d,listSort as l,formatTime as p,transformMessage as g,getFileSize as h,simplifyMessage as f}from"../utils/index.js";import{cloneDeep as S,isArray as I,uniqBy as T}from"lodash-es";import{STATUS as y,MESSAGE_TYPE as v,CHAT_TYPE as L}from"../constants/index.js";import{useTheme as M}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 E=Symbol("InjectionIChatData");function C(e){const{lastMessage:s,lastSenderName:t=""}=e,n=f(s)||"";return d(e)&&t?t+": "+n:n}function N(i,f){const E=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}),D=M(),w=t((()=>N.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),j=t((()=>d(N.currentSessionItem))),U=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)})),_=t((()=>{var e;return(null==(e=N.currentSessionItem)?void 0:e.status)===y.ENDED}));n((()=>w.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))?f("unread-message-update",e,l(n)):(await u(300),s(++t))}()})),n([()=>N.isChangeSession,()=>N.isUpdateSession],(([e,s])=>{e&&(B(N.currentSessionItem),N.currentSessionItem.status===y.REMOVED&&V(),N.isChangeSession=!1),s&&(B(N.updateSessionItem),N.isUpdateSession=!1)}),{immediate:!0});const{pause:G,resume:R,isActive:K}=m((()=>{const e=S(N.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=p(s).recordTime,!0)})),N.msgList=e,O()||G()}),6e4,{immediate:!1});function O(){return!!N.msgList.length&&N.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function k(e){var s;try{null==(s=E.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:N.currentSessionItem.chatType,receiver:N.currentSessionItem.receiver,...e}))}catch(e){}}function x(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 A(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?{...S(s),...t}:t,N.isUpdateSession=!0}function V(){if(!N.id)return null;const{currentSessionItem:e}=N;return N.currentSessionItem={},N.msgList=[],N.id="",N.currentGroupUser=[],e}function b(e){N.sessionList=S(T(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!==L.GROUP||e.name||c({id:e.receiver}).then((s=>{I(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function B(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:D,stompClient:E,state:N,unreadTotal:w,isGroupChat:j,isGroupLeader:U,isEnded:_,setMsgList:function(e=[]){G(),N.msgList=S(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:p(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[v.TEXT,v.TEXT,v.BLEND].includes(t)?g(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:p(e.sendTime).recordTime}),e.content.chatMessageType!==v.FILE||e.__size||h(e.content.fileUrl).then((s=>{e.__size=s}))})),O()&&R()},sendMessage:k,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:L.SINGLE,receiver:i,sender:N.userInfo.id});const a=(null==r?void 0:r.chatType)||L.SINGLE;k({chatType:a,receiver:i,content:n}),await u(100),t&&k({chatType:a,receiver:i,content:{chatMessageType:v.TEXT,msg:t}}),await u(100)}},openSession:async function(e){try{e.status===y.REMOVED&&(await a({id:e.id,status:y.ENABLED}),A({...e,status:y.ENABLED}),e.status=y.ENABLED);const s=N.currentSessionItem.sessionKey;if(x(e),s===N.currentSessionItem.sessionKey)return;if(j.value){const s=await c({id:e.receiver});N.currentGroupUser=I(s)?s:[]}else N.currentGroupUser=T([N.userInfo,{...S(e),id:e.receiver}],"id");f("session-change",{...r(N.currentSessionItem),userList:N.currentGroupUser.map((e=>r(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return N.id?N.currentSessionItem:null},setCurrentSessionItem:x,setUpdateSessionItem:A,setSessionList:b,emit:f}}const D=()=>i(E);export{E as InjectionIChatData,N as initData,D as useData};
1
+ import{ref as e,reactive as s,toRef as t,computed as n,watch as i,inject as r,toRaw as o}from"vue";import{openSessionApi as a,updateStatusApi as c,groupUserApi as u}from"../api/index.js";import{promiseTimeout as m,useIntervalFn as d}from"@vueuse/core";import{isGroup as l,listSort as p,formatTime as g,transformMessage as f,getFileSize as h,simplifyMessage as S}from"../utils/index.js";import{cloneDeep as I,isArray as T,uniqBy as y}from"lodash-es";import{STATUS as v,MESSAGE_TYPE as L,CHAT_TYPE as M}from"../constants/index.js";import{useTheme as E}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 C=Symbol("InjectionIChatData");function N(e){const{lastMessage:s,lastSenderName:t=""}=e,n=S(s)||"";return l(e)&&t?t+": "+n:n}function D(r,S){const C=e(),D=s({filterable:t(r,"filterable"),orgId:r.orgId,currentSessionItem:{},id:"",userInfo:{id:r.userId},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1,currentReferenceMsg:null,currentReEditMsg:null,showVideo:!1,currentAVMsg:{},currentGroupUser:[],showMultipleVideo:!1}),w=E(),j=n((()=>D.sessionList.reduce(((e,s)=>e+ +s.unreadNum),0))),U=n((()=>l(D.currentSessionItem))),_=n((()=>{var e,s,t;return(null==(e=D.userInfo)?void 0:e.id)===(null==(t=null==(s=D.currentGroupUser)?void 0:s[0])?void 0:t.id)})),G=n((()=>{var e;return(null==(e=D.currentSessionItem)?void 0:e.status)===v.ENDED}));i((()=>j.value),(e=>{!async function s(t=0){if(t>2)return;const n=D.sessionList.filter((e=>{var s;return+(null!=(s=e.unreadNum)?s:0)>0}));n.every((e=>!!e.name))?S("unread-message-update",e,p(n)):(await m(300),s(++t))}()})),i([()=>D.isChangeSession,()=>D.isUpdateSession],(([e,s])=>{e&&(X(D.currentSessionItem),D.currentSessionItem.status===v.REMOVED&&V(),D.isChangeSession=!1),s&&(X(D.updateSessionItem),D.isUpdateSession=!1)}),{immediate:!0});const{pause:R,resume:K,isActive:O}=d((()=>{const e=I(D.msgList);e.some((e=>{const{sendTime:s}=e;return!(Date.now()-new Date(s).getTime()>=36e5)&&(e.__sendTime=g(s).recordTime,!0)})),D.msgList=e,b()||R()}),6e4,{immediate:!1});function b(){return!!D.msgList.length&&D.msgList.some((e=>Date.now()-new Date(e.sendTime).getTime()<36e5))}async function k(e){var s;try{null==(s=C.value)||s.send("/app/chat/send",{},JSON.stringify({chatType:D.currentSessionItem.chatType,receiver:D.currentSessionItem.receiver,...e}))}catch(e){}}function x(e){Object.assign(D.currentSessionItem,e,{lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:Reflect.has(e,"lastMessage")?N({...e,chatType:e.chatType||D.currentSessionItem.chatType}):D.currentSessionItem.lastMessageContent}),D.isChangeSession=!0,D.id!==D.currentSessionItem.id&&(D.msgList=[],D.id=D.currentSessionItem.id)}function A(e){const s=D.sessionList.find((s=>s.sessionKey===e.sessionKey)),t={...e,lastMessageContent:N({...e,chatType:e.chatType||(null==s?void 0:s.chatType)})};D.updateSessionItem=s?{...I(s),...t}:t,D.isUpdateSession=!0}function V(){if(!D.id)return null;const{currentSessionItem:e}=D;return D.currentSessionItem={},D.msgList=[],D.id="",D.currentGroupUser=[],e}function B(e){D.sessionList=I(y(e,"id")),D.sessionList.forEach((e=>{Object.assign(e,{defaultName:Reflect.has(e,"defaultName")?e.defaultName:e.name||"",lastMessageContent:Reflect.has(e,"lastMessageContent")?e.lastMessageContent:N(e)}),e.receiver===D.userInfo.id&&(e.unreadNum=0),e.chatType!==M.GROUP||e.name||u({id:e.receiver}).then((s=>{T(s)&&(e.name=s.map((e=>e.name)).join(","))}))}))}function X(e){!e.id||D.sessionList.map((e=>e.id)).includes(e.id)?D.sessionList.some((s=>{if(s.sessionKey===e.sessionKey){let{unreadNum:t=0}=s;return Object.assign(s,e),e.sessionKey!==D.currentSessionItem.sessionKey&&s.sender&&s.sender!==D.userInfo.id&&(s.unreadNum=++t),!0}})):B([...D.sessionList,e])}return{cssVars:w,stompClient:C,state:D,unreadTotal:j,isGroupChat:U,isGroupLeader:_,isEnded:G,setMsgList:function(e=[]){R(),D.msgList=I(e).sort(((e,s)=>new Date(s.sendTime).getTime()-new Date(e.sendTime).getTime())),D.msgList.forEach((e=>{var s,t;Object.assign(e,{__time:g(e.sendTime).msgTime,__content:(t=e.content.chatMessageType,[L.TEXT,L.TEXT,L.BLEND].includes(t)?f(e.content):null==(s=e.content)?void 0:s.msg),__sendTime:g(e.sendTime).recordTime}),e.content.chatMessageType!==L.FILE||e.__size||h(e.content.fileUrl).then((s=>{e.__size=s}))})),b()&&K()},sendMessage:k,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=D.sessionList.find((e=>e.receiver===i));r||await a({chatType:M.SINGLE,receiver:i,sender:D.userInfo.id});const o=(null==r?void 0:r.chatType)||M.SINGLE;k({chatType:o,receiver:i,content:n}),await m(100),t&&k({chatType:o,receiver:i,content:{chatMessageType:L.TEXT,msg:t}}),await m(100)}},openSession:async function(e){try{const s="string"==typeof e?D.sessionList.find((s=>s.id===e)):e;if(!s)return;s.status===v.REMOVED&&(await c({id:s.id,status:v.ENABLED}),A({...s,status:v.ENABLED}),s.status=v.ENABLED);const t=D.currentSessionItem.sessionKey;if(x(s),t===D.currentSessionItem.sessionKey)return;if(U.value){const e=await u({id:s.receiver});D.currentGroupUser=T(e)?e:[]}else D.currentGroupUser=y([D.userInfo,{...I(s),id:s.receiver}],"id");S("session-change",{...o(D.currentSessionItem),userList:D.currentGroupUser.map((e=>o(e)))})}catch(e){console.log("error---\x3e",e)}},closeSession:V,getCurrentSession:function(){return D.id?D.currentSessionItem:null},setCurrentSessionItem:x,setUpdateSessionItem:A,setSessionList:B,emit:S}}const w=()=>r(C);export{C as InjectionIChatData,D as initData,w as useData};
@@ -9,6 +9,7 @@ type EventHandlers = {
9
9
  };
10
10
  export declare function useVideo(): {
11
11
  state: {
12
+ filterable: boolean;
12
13
  orgId: string | number;
13
14
  currentSessionItem: import("../../../../shared/types").AnyObject;
14
15
  id: string;
@@ -1 +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
+ 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:m,setCurrentSessionItem:y}=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 y({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};m(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;m(d);break;case n.JOIN_GROUP:if(s===t.GROUP)return;m(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.id===c.defaultSessionId));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,8 @@
1
+ import { Ref } from 'vue';
1
2
  import { AnyObject } from '../../../../shared/types';
2
3
  import { UploadFileInfo } from 'naive-ui';
3
4
  export type IState = {
5
+ filterable: Ref<boolean>;
4
6
  orgId: number | string;
5
7
  currentSessionItem: AnyObject;
6
8
  id: string;
@@ -1 +1 @@
1
- import{isToday as e,format as t,isYesterday as n,startOfDay as o}from"date-fns";import{cloneDeep as r,isNumber as a,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s,CHAT_TYPE as l}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as u}from"../../../../shared/utils/index.js";import{createDiscreteApi as d}from"naive-ui";const{message:g}=d(["message"]);function m(o){var r;const a=new Date(o);let i,s;if(e(a))i=s=t(a,"HH:mm");else{i=n(a)?(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.135"))||"昨天":t(a,"MM-dd");const e=a.getFullYear(),o=(new Date).getFullYear();s=t(a,e<o?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(o){var r,a,i,s;const l=new Date(o),c=Date.now()-l.getTime();if(c<6e4)return(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.133"))||"刚刚";if(c<36e5)return Math.ceil(c/1e3/60)+((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.136"))||"分钟前");if(e(l))return((null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.134"))||"今天")+t(l,"HH:mm");if(n(l))return((null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.135"))||"昨天")+t(l,"HH:mm");{const e=l.getFullYear(),n=(new Date).getFullYear();return t(l,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(o)}}function p(e){return r(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 w(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let o=n.toString();if(t===s.BLEND){const e=o.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const r=c.findEmoji(n[1]);r&&(o=o.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${r} />`))}})),o}const r=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 o=o.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(r(),"<$1 $2>").replace(r("/"),"</$1>").replace(/\n/g,"<br>"),o}function f(e){var t,n;if(e&&a(+e)&&!i(+e)){const n=E(+e),o=n.split(":");let r=n;return 3===o.length&&"00"===o[0]&&(r=`${o[1]}:${o[2]}`),((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.137"))||"通话时长")+r}return(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.138"))||"已取消"}function y(e){var t;if(!e)return"";const{chatMessageType:n,msg:o,messageTemplate:r}=e,a=T(e)?f(o):"";switch(n){case s.TEXT:return w(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${o} src=${c.findEmoji(o)}>`;case s.TEMPLATE:return null==(t=null==r?void 0:r.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),o=document.createElement("a");o.href=e,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function v(e){return new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open("HEAD",e,!0),o.onreadystatechange=()=>{var e;if(4===o.readyState&&200===o.status){let n=null!=(e=o.getResponseHeader("Content-Length"))?e:0;const r=+n;r>1048576?n=(r/1048576).toFixed(2)+"M":r>1024?n=(r/1024).toFixed(2)+"K":n+="B",t(n)}},o.send()}))}async function H(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${u()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function T(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=o(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}function M(e){return e.chatType===l.GROUP}export{g as $message,H as base64ToFile,h as downloadFile,E as formatSeconds,m as formatTime,f as getAVTime,v as getFileSize,T as isAudioOrVideoMessage,M as isGroup,p as listSort,y as simplifyMessage,w as transformMessage};
1
+ import{isToday as e,format as t,isYesterday as n,startOfDay as o}from"date-fns";import{cloneDeep as r,isNumber as a,isNaN as i}from"lodash-es";import{MESSAGE_TYPE as s,CHAT_TYPE as l}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as u}from"../../../../shared/utils/index.js";import{createDiscreteApi as d}from"naive-ui";const{message:g}=d(["message"]);function m(o){var r;const a=new Date(o);let i,s;if(e(a))i=s=t(a,"HH:mm");else{i=n(a)?(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.132"))||"昨天":t(a,"MM-dd");const e=a.getFullYear(),o=(new Date).getFullYear();s=t(a,e<o?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:i,msgTime:s,recordTime:function(o){var r,a,i,s;const l=new Date(o),c=Date.now()-l.getTime();if(c<6e4)return(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.133"))||"刚刚";if(c<36e5)return Math.ceil(c/1e3/60)+((null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.136"))||"分钟前");if(e(l))return((null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.134"))||"今天")+t(l,"HH:mm");if(n(l))return((null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.132"))||"昨天")+t(l,"HH:mm");{const e=l.getFullYear(),n=(new Date).getFullYear();return t(l,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(o)}}function p(e){return r(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 w(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let o=n.toString();if(t===s.BLEND){const e=o.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const r=c.findEmoji(n[1]);r&&(o=o.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${r} />`))}})),o}const r=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 o=o.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(r(),"<$1 $2>").replace(r("/"),"</$1>").replace(/\n/g,"<br>"),o}function f(e){var t,n;if(e&&a(+e)&&!i(+e)){const n=E(+e),o=n.split(":");let r=n;return 3===o.length&&"00"===o[0]&&(r=`${o[1]}:${o[2]}`),((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.137"))||"通话时长")+r}return(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.138"))||"已取消"}function y(e){var t;if(!e)return"";const{chatMessageType:n,msg:o,messageTemplate:r}=e,a=T(e)?f(o):"";switch(n){case s.TEXT:return w(e);case s.IMAGE:return"[图片]";case s.FILE:return"[文件]";case s.EMOJI:return`<img class="emoji--min" alt=${o} src=${c.findEmoji(o)}>`;case s.TEMPLATE:return null==(t=null==r?void 0:r.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),o=document.createElement("a");o.href=e,o.download=t,o.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function v(e){return new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open("HEAD",e,!0),o.onreadystatechange=()=>{var e;if(4===o.readyState&&200===o.status){let n=null!=(e=o.getResponseHeader("Content-Length"))?e:0;const r=+n;r>1048576?n=(r/1048576).toFixed(2)+"M":r>1024?n=(r/1024).toFixed(2)+"K":n+="B",t(n)}},o.send()}))}async function H(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${u()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function T(e){return e&&[s.AUDIO,s.VIDEO].includes(e.chatMessageType)}function E(e){const n=o(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}function M(e){return e.chatType===l.GROUP}export{g as $message,H as base64ToFile,h as downloadFile,E as formatSeconds,m as formatTime,f as getAVTime,v as getFileSize,T as isAudioOrVideoMessage,M as isGroup,p as listSort,y as simplifyMessage,w as transformMessage};