cnhis-design-vue 3.3.3-release.12 → 3.3.3-release.14
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.
- package/README.md +87 -87
- package/es/components/button-print/index.d.ts +60 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +60 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +6 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +18 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +33 -4
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +18 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +30 -4
- package/es/components/button-print/src/utils/print.d.ts +6 -4
- package/es/components/button-print/src/utils/print.js +176 -4
- package/es/components/calendar/src/Calendar.vue2.js +15 -5
- package/es/components/classification/index.d.ts +500 -5
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +500 -5
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +500 -5
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +500 -5
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +3 -2
- package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +58 -15
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +4 -3
- package/es/components/field-set/src/FieldColor.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
- package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +3 -1
- package/es/components/form-render/src/components/renderer/date.js +12 -10
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +9 -3
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-chat/index.d.ts +41 -50
- package/es/components/iho-chat/src/Index.vue.d.ts +41 -50
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +6 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ImageLightbox.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +29 -28
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +239 -94
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -24
- package/es/components/iho-chat/src/components/Video.vue2.js +35 -40
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +54 -10
- package/es/components/iho-chat/src/hooks/useVideo.js +420 -44
- package/es/components/iho-chat/src/utils/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.js +7 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -0
- package/es/components/index.js +2 -1
- package/es/components/keyboard/index.d.ts +9 -0
- package/es/components/keyboard/src/Keyboard.vue.d.ts +9 -0
- package/es/components/keyboard/src/Keyboard.vue2.js +33 -9
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +4 -0
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +50 -17
- package/es/components/keyboard/src/types.d.ts +17 -0
- package/es/components/keyboard/src/types.js +1 -0
- package/es/components/scale-view/index.d.ts +13 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +2 -1
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +4 -0
- package/es/components/select-person/src/SelectPerson.vue2.js +8 -1
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +490 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +8 -2
- package/es/components/table-filter/src/components/classify-filter/components/Base/DateOption.vue.d.ts +226 -0
- package/es/components/table-filter/src/components/classify-filter/components/Base/DateOption.vue.js +6 -0
- package/es/components/table-filter/src/components/classify-filter/components/Base/DateOption.vue2.js +156 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +238 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +43 -4
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +239 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +51 -8
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +477 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.d.ts +5 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +49 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +500 -5
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +13 -6
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +3 -3
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +32 -4
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +1 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +23 -2
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +3 -3
- package/es/components/table-filter/src/hooks/useAdvanced.js +5 -4
- package/es/components/table-filter/src/tool/baseOptions.js +8 -1
- package/es/components/table-filter/src/types/enums.d.ts +4 -0
- package/es/components/table-filter/src/types/enums.js +5 -1
- package/es/components/vertify/index.d.ts +1 -0
- package/es/components/vertify/index.js +1 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.d.ts +89 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.js +6 -0
- package/es/components/vertify/src/components/IdentityVerification.vue2.js +256 -0
- package/es/components/vertify/src/utils/dialog.d.ts +7 -0
- package/es/components/vertify/src/utils/dialog.js +73 -0
- package/es/components/vertify/src/utils/index.d.ts +11 -0
- package/es/components/vertify/src/utils/index.js +24 -0
- package/es/components/vod-chunk-upload/index.d.ts +13 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +19 -2
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +104 -75
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.d.ts +1 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +20 -3
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +4 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +6 -2
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +13 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +6 -1
- package/es/components/vod-chunk-upload/style/index.css +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +2 -2
- package/es/shared/utils/fabricjs/index.js +1 -1
- package/package.json +4 -4
@@ -5,7 +5,7 @@ import { Close, Mic, MicOff, Videocam, VideocamOff, Call, PersonAdd, ResizeOutli
|
|
5
5
|
import { getUserDetailApi } from '../api/index.js';
|
6
6
|
import '@vueuse/core';
|
7
7
|
import { $message } from '../utils/index.js';
|
8
|
-
import
|
8
|
+
import 'lodash-es';
|
9
9
|
import { CHAT_TYPE, SUBSCRIBE_MESSAGE_TYPE } from '../constants/index.js';
|
10
10
|
import '../../../../shared/utils/index.js';
|
11
11
|
import 'date-fns';
|
@@ -17,7 +17,6 @@ import 'stompjs';
|
|
17
17
|
import 'sockjs-client/dist/sockjs.min.js';
|
18
18
|
import { useVideo } from '../hooks/useVideo.js';
|
19
19
|
import { useDraggable } from '../hooks/useDraggable.js';
|
20
|
-
import TRTC from 'trtc-sdk-v5';
|
21
20
|
|
22
21
|
const _hoisted_1 = {
|
23
22
|
class: "top-right-btns"
|
@@ -142,26 +141,37 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
142
141
|
__name: "MultipleVideo",
|
143
142
|
setup(__props) {
|
144
143
|
const selfVideoRef = ref();
|
145
|
-
const remoteUsers = ref([]);
|
146
144
|
const {
|
147
145
|
state,
|
148
146
|
sendMessage,
|
149
|
-
trtc,
|
150
|
-
trtcProxy,
|
151
147
|
voiceClose,
|
152
148
|
isAudio,
|
153
149
|
isCall,
|
154
150
|
startTimer,
|
155
|
-
resetTimer,
|
156
151
|
toggleAudio,
|
157
152
|
messageTypeText,
|
158
153
|
timing,
|
159
154
|
toggleVideo,
|
160
155
|
videocamClose,
|
161
156
|
installEventHandlers,
|
162
|
-
uninstallEventHandlers
|
163
|
-
|
164
|
-
|
157
|
+
uninstallEventHandlers,
|
158
|
+
isConnect,
|
159
|
+
remoteUsers,
|
160
|
+
enterRoom,
|
161
|
+
exitRoom,
|
162
|
+
startLocalMedia,
|
163
|
+
findUser,
|
164
|
+
addOrUpdateUser,
|
165
|
+
removeUser,
|
166
|
+
tryRenderRemoteVideo,
|
167
|
+
stopRemoteVideo,
|
168
|
+
setVideoRef,
|
169
|
+
checkAndRenderAllVideos,
|
170
|
+
MAIN_STREAM_TYPE
|
171
|
+
} = useVideo({
|
172
|
+
isMultiple: true,
|
173
|
+
enableRetry: true
|
174
|
+
});
|
165
175
|
const wrapperRef = ref(null);
|
166
176
|
const handleRef = ref(null);
|
167
177
|
const isMaxSize = ref(true);
|
@@ -191,18 +201,40 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
191
201
|
changeMiniPosition("top-right");
|
192
202
|
}
|
193
203
|
});
|
204
|
+
watch(() => remoteUsers.value.length, (newLength, oldLength) => {
|
205
|
+
console.log(`Remote users count changed: ${oldLength} -> ${newLength}`);
|
206
|
+
if (newLength > 0 && isConnect.value) {
|
207
|
+
setTimeout(() => {
|
208
|
+
checkAndRenderAllVideos();
|
209
|
+
}, 500);
|
210
|
+
}
|
211
|
+
});
|
194
212
|
function handleAddPerson({
|
195
213
|
checkedIds,
|
196
214
|
checkedOptions
|
197
215
|
}) {
|
198
|
-
|
199
|
-
|
200
|
-
|
216
|
+
if (!(checkedIds == null ? void 0 : checkedIds.length)) {
|
217
|
+
console.warn("No users selected to add");
|
218
|
+
return;
|
219
|
+
}
|
220
|
+
console.log("Adding persons to call:", checkedIds, checkedOptions);
|
221
|
+
try {
|
222
|
+
state.currentAVMsg.checkedIds.push(...checkedIds);
|
223
|
+
if (isConnect.value) {
|
224
|
+
sendInvitations(checkedIds);
|
225
|
+
} else {
|
226
|
+
handleCall();
|
227
|
+
}
|
228
|
+
} catch (error) {
|
229
|
+
console.error("Error adding persons to call:", error);
|
230
|
+
$message.error("\u6DFB\u52A0\u53C2\u4F1A\u4EBA\u5931\u8D25");
|
231
|
+
}
|
201
232
|
}
|
202
|
-
function
|
203
|
-
|
204
|
-
|
205
|
-
|
233
|
+
function sendInvitations(userIds) {
|
234
|
+
if (!(userIds == null ? void 0 : userIds.length))
|
235
|
+
return;
|
236
|
+
userIds.forEach((id) => {
|
237
|
+
try {
|
206
238
|
sendMessage({
|
207
239
|
chatType: CHAT_TYPE.SINGLE,
|
208
240
|
content: {
|
@@ -211,134 +243,245 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
211
243
|
},
|
212
244
|
receiver: id
|
213
245
|
});
|
214
|
-
})
|
215
|
-
|
216
|
-
|
246
|
+
} catch (error) {
|
247
|
+
console.error("Failed to send invitation to user:", id, error);
|
248
|
+
}
|
249
|
+
});
|
250
|
+
}
|
251
|
+
function handleCall() {
|
252
|
+
var _a;
|
253
|
+
if (isConnect.value) {
|
254
|
+
console.log("Already connected to call");
|
217
255
|
return;
|
218
|
-
|
256
|
+
}
|
257
|
+
try {
|
258
|
+
if ((_a = state.currentAVMsg.checkedIds) == null ? void 0 : _a.length) {
|
259
|
+
sendInvitations(state.currentAVMsg.checkedIds);
|
260
|
+
}
|
261
|
+
handleEnter();
|
262
|
+
} catch (error) {
|
263
|
+
console.error("Error starting call:", error);
|
264
|
+
$message.error("\u5F00\u59CB\u901A\u8BDD\u5931\u8D25");
|
265
|
+
}
|
219
266
|
}
|
220
267
|
async function handleEnter() {
|
221
|
-
const
|
222
|
-
if (!
|
223
|
-
console.log("checkResult :>> ", checkResult);
|
268
|
+
const success = await enterRoom();
|
269
|
+
if (!success) {
|
224
270
|
state.showMultipleVideo = false;
|
225
271
|
return;
|
226
272
|
}
|
227
273
|
try {
|
228
|
-
await trtc.enterRoom({
|
229
|
-
strRoomId: state.currentAVMsg.strRoomId,
|
230
|
-
sdkAppId: parseInt(state.userInfo.sdkAppID),
|
231
|
-
userId: state.userInfo.id,
|
232
|
-
userSig: state.userInfo.userSig,
|
233
|
-
proxy: trtcProxy.value
|
234
|
-
});
|
235
|
-
isConnect.value = true;
|
236
274
|
startTimer();
|
237
275
|
installEventHandlers({
|
238
276
|
handleError,
|
239
277
|
handleRemoteUserEnter,
|
240
278
|
handleRemoteAudioAvailable,
|
241
279
|
handleRemoteUserExit,
|
242
|
-
handleRemoteVideoAvailable
|
243
|
-
|
244
|
-
await trtc.startLocalAudio({
|
245
|
-
mute: voiceClose.value
|
246
|
-
});
|
247
|
-
if (isAudio.value)
|
248
|
-
return;
|
249
|
-
await trtc.startLocalVideo({
|
250
|
-
view: selfVideoRef.value,
|
251
|
-
mute: videocamClose.value
|
280
|
+
handleRemoteVideoAvailable,
|
281
|
+
handleRemoteVideoUnavailable
|
252
282
|
});
|
283
|
+
await startLocalMedia(selfVideoRef.value);
|
284
|
+
console.log("Successfully set up multiple video call");
|
285
|
+
setTimeout(() => {
|
286
|
+
checkAndRenderAllVideos();
|
287
|
+
}, 1e3);
|
288
|
+
periodicCheckInterval = setInterval(() => {
|
289
|
+
if (isConnect.value && remoteUsers.value.length > 0) {
|
290
|
+
console.log("Periodic video check, current users:", remoteUsers.value.map((u) => `${u.id}(video:${u.hasVideo})`));
|
291
|
+
checkAndRenderAllVideos();
|
292
|
+
} else if (!isConnect.value) {
|
293
|
+
console.log("Not connected, clearing check interval");
|
294
|
+
if (periodicCheckInterval) {
|
295
|
+
clearInterval(periodicCheckInterval);
|
296
|
+
periodicCheckInterval = null;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}, 5e3);
|
253
300
|
} catch (error) {
|
254
|
-
console.
|
255
|
-
$message.error(error);
|
256
|
-
state.showMultipleVideo = false;
|
301
|
+
console.error("Error setting up multiple video call:", error);
|
257
302
|
}
|
258
303
|
}
|
259
304
|
async function handleExit() {
|
260
305
|
try {
|
261
306
|
state.showMultipleVideo = false;
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
await trtc.stopLocalVideo();
|
307
|
+
if (isConnect.value) {
|
308
|
+
uninstallEventHandlers({
|
309
|
+
handleError,
|
310
|
+
handleRemoteUserEnter,
|
311
|
+
handleRemoteAudioAvailable,
|
312
|
+
handleRemoteUserExit,
|
313
|
+
handleRemoteVideoAvailable,
|
314
|
+
handleRemoteVideoUnavailable
|
315
|
+
});
|
316
|
+
}
|
317
|
+
await exitRoom();
|
274
318
|
} catch (error) {
|
275
|
-
console.
|
319
|
+
console.error("Error during exit:", error);
|
276
320
|
}
|
277
321
|
}
|
278
322
|
async function handleRemoteVideoAvailable(event) {
|
279
323
|
const {
|
280
324
|
userId,
|
281
|
-
streamType
|
325
|
+
streamType,
|
326
|
+
available
|
282
327
|
} = event;
|
328
|
+
if (!userId) {
|
329
|
+
return;
|
330
|
+
}
|
331
|
+
const isMainStream = !streamType || streamType === MAIN_STREAM_TYPE;
|
332
|
+
if (!isMainStream) {
|
333
|
+
return;
|
334
|
+
}
|
283
335
|
try {
|
284
|
-
|
336
|
+
console.log(`Remote video ${available ? "available" : "unavailable"} for user:`, userId);
|
337
|
+
let user = findUser(userId);
|
338
|
+
if (!user) {
|
339
|
+
const name = await getUserName(userId);
|
340
|
+
addOrUpdateUser(userId, {
|
341
|
+
name,
|
342
|
+
hasVideo: true
|
343
|
+
});
|
344
|
+
console.log("Added user from video available event:", userId, name);
|
285
345
|
await nextTick();
|
286
|
-
|
287
|
-
userId
|
288
|
-
|
289
|
-
|
346
|
+
setTimeout(() => {
|
347
|
+
tryRenderRemoteVideo(userId);
|
348
|
+
}, 100);
|
349
|
+
} else {
|
350
|
+
addOrUpdateUser(userId, {
|
351
|
+
hasVideo: true
|
290
352
|
});
|
353
|
+
await nextTick();
|
354
|
+
await tryRenderRemoteVideo(userId);
|
291
355
|
}
|
292
356
|
} catch (error) {
|
293
|
-
console.
|
357
|
+
console.error("Error handling remote video available:", error);
|
294
358
|
}
|
295
359
|
}
|
360
|
+
async function handleRemoteVideoUnavailable(event) {
|
361
|
+
const {
|
362
|
+
userId,
|
363
|
+
streamType,
|
364
|
+
available
|
365
|
+
} = event;
|
366
|
+
addOrUpdateUser(userId, {
|
367
|
+
hasVideo: false
|
368
|
+
});
|
369
|
+
await stopRemoteVideo(userId);
|
370
|
+
}
|
296
371
|
async function handleRemoteAudioAvailable(event) {
|
297
|
-
var _a;
|
298
372
|
const {
|
299
|
-
userId
|
373
|
+
userId,
|
374
|
+
available
|
300
375
|
} = event;
|
301
|
-
if (
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
376
|
+
if (!userId)
|
377
|
+
return;
|
378
|
+
try {
|
379
|
+
console.log(`Remote audio ${available ? "available" : "unavailable"} for user:`, userId);
|
380
|
+
let user = findUser(userId);
|
381
|
+
if (!user && available) {
|
382
|
+
const name = await getUserName(userId);
|
383
|
+
addOrUpdateUser(userId, {
|
384
|
+
name,
|
385
|
+
hasAudio: true
|
386
|
+
});
|
387
|
+
console.log("Added user from audio available event:", userId, name);
|
388
|
+
} else {
|
389
|
+
addOrUpdateUser(userId, {
|
390
|
+
hasAudio: available
|
391
|
+
});
|
392
|
+
}
|
393
|
+
} catch (error) {
|
394
|
+
console.error("Error handling remote audio available:", error);
|
307
395
|
}
|
308
396
|
}
|
309
397
|
async function handleRemoteUserEnter(event) {
|
310
398
|
const {
|
311
399
|
userId
|
312
400
|
} = event;
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
401
|
+
if (!userId)
|
402
|
+
return;
|
403
|
+
try {
|
404
|
+
console.log("\u76D1\u542C\u5230\u8FDC\u7A0B\u7528\u6237\u8FDB\u623F\u95F4\u4E86\u300B\u300B\u300B\u300B\u300B", userId);
|
405
|
+
if (!findUser(userId)) {
|
406
|
+
const name = await getUserName(userId);
|
407
|
+
addOrUpdateUser(userId, {
|
408
|
+
name
|
409
|
+
});
|
410
|
+
console.log("Remote user entered:", userId, name);
|
411
|
+
await nextTick();
|
412
|
+
setTimeout(() => {
|
413
|
+
const user = findUser(userId);
|
414
|
+
if (user == null ? void 0 : user.hasVideo) {
|
415
|
+
console.log("User already has video stream, attempting to render");
|
416
|
+
tryRenderRemoteVideo(userId);
|
417
|
+
}
|
418
|
+
}, 100);
|
419
|
+
}
|
420
|
+
} catch (error) {
|
421
|
+
console.error("Error handling remote user enter:", error);
|
422
|
+
}
|
319
423
|
}
|
320
424
|
async function getUserName(userId) {
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
425
|
+
try {
|
426
|
+
const data = await getUserDetailApi({
|
427
|
+
userId
|
428
|
+
});
|
429
|
+
return (data == null ? void 0 : data.name) || userId;
|
430
|
+
} catch (error) {
|
431
|
+
console.warn("Failed to get user name for:", userId, error);
|
432
|
+
return userId;
|
433
|
+
}
|
325
434
|
}
|
326
435
|
function handleRemoteUserExit(event) {
|
327
|
-
console.log("event :>> \u9000\u623F", event);
|
328
436
|
const {
|
329
437
|
userId
|
330
438
|
} = event;
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
439
|
+
if (!userId)
|
440
|
+
return;
|
441
|
+
console.log("Remote user exited:", userId);
|
442
|
+
try {
|
443
|
+
removeUser(userId);
|
444
|
+
console.log("Cleaned up resources for user:", userId);
|
445
|
+
setTimeout(() => {
|
446
|
+
const user = findUser(userId);
|
447
|
+
if (user) {
|
448
|
+
console.warn("User still exists after removal, force removing:", userId);
|
449
|
+
const userIndex = remoteUsers.value.findIndex((u) => u.id === userId);
|
450
|
+
if (userIndex !== -1) {
|
451
|
+
remoteUsers.value.splice(userIndex, 1);
|
452
|
+
}
|
453
|
+
}
|
454
|
+
}, 100);
|
455
|
+
} catch (error) {
|
456
|
+
console.error("Error handling remote user exit:", error);
|
457
|
+
}
|
335
458
|
}
|
336
459
|
function handleError(error) {
|
337
|
-
console.
|
460
|
+
console.error("TRTC error occurred:", error);
|
461
|
+
if (error.code) {
|
462
|
+
switch (error.code) {
|
463
|
+
case -3301:
|
464
|
+
$message.error("\u8FDB\u5165\u623F\u95F4\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5");
|
465
|
+
break;
|
466
|
+
case -3302:
|
467
|
+
$message.error("\u7F51\u7EDC\u8FDE\u63A5\u65AD\u5F00\uFF0C\u6B63\u5728\u5C1D\u8BD5\u91CD\u8FDE...");
|
468
|
+
break;
|
469
|
+
default:
|
470
|
+
$message.error(`\u901A\u8BDD\u51FA\u73B0\u9519\u8BEF: ${error.message || "\u672A\u77E5\u9519\u8BEF"}`);
|
471
|
+
}
|
472
|
+
} else {
|
473
|
+
$message.error("\u901A\u8BDD\u51FA\u73B0\u672A\u77E5\u9519\u8BEF");
|
474
|
+
}
|
338
475
|
state.showMultipleVideo = false;
|
339
476
|
}
|
340
|
-
|
341
|
-
|
477
|
+
let periodicCheckInterval = null;
|
478
|
+
onBeforeUnmount(async () => {
|
479
|
+
console.log("Component unmounting, cleaning up...");
|
480
|
+
if (periodicCheckInterval) {
|
481
|
+
clearInterval(periodicCheckInterval);
|
482
|
+
periodicCheckInterval = null;
|
483
|
+
}
|
484
|
+
await handleExit();
|
342
485
|
});
|
343
486
|
return (_ctx, _cache) => {
|
344
487
|
return openBlock(), createElementBlock(Fragment, null, [withDirectives(createElementVNode("div", {
|
@@ -352,7 +495,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
352
495
|
ref: handleRef
|
353
496
|
}, [withDirectives(createElementVNode("span", {
|
354
497
|
class: "title"
|
355
|
-
}, toDisplayString(unref(title)), 513), [[vShow, isConnect
|
498
|
+
}, toDisplayString(unref(title)), 513), [[vShow, unref(isConnect)]]), createElementVNode("div", _hoisted_1, [createVNode(unref(NButton), {
|
356
499
|
quaternary: "",
|
357
500
|
size: "tiny",
|
358
501
|
class: "custom-btn",
|
@@ -367,7 +510,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
367
510
|
component: unref(Close)
|
368
511
|
}, null, 8, ["component"])]),
|
369
512
|
_: 1
|
370
|
-
})])], 512), isConnect
|
513
|
+
})])], 512), unref(isConnect) ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("div", {
|
371
514
|
ref_key: "selfVideoRef",
|
372
515
|
ref: selfVideoRef,
|
373
516
|
class: "video-view",
|
@@ -417,12 +560,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
417
560
|
_: 1
|
418
561
|
}), _hoisted_13])]),
|
419
562
|
_: 1
|
420
|
-
}, 8, ["disabledIds"])])])]), createElementVNode("div", _hoisted_14, [(openBlock(true), createElementBlock(Fragment, null, renderList(remoteUsers
|
563
|
+
}, 8, ["disabledIds"])])])]), createElementVNode("div", _hoisted_14, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(remoteUsers), (user) => {
|
421
564
|
return openBlock(), createElementBlock("div", {
|
422
565
|
key: user.id,
|
423
566
|
id: user.id,
|
424
567
|
class: "video-view",
|
425
|
-
"data-name": user.name
|
568
|
+
"data-name": user.name,
|
569
|
+
ref_for: true,
|
570
|
+
ref: (el) => unref(setVideoRef)(user.id, el)
|
426
571
|
}, null, 8, _hoisted_15);
|
427
572
|
}), 128))])])) : (openBlock(), createElementBlock(Fragment, {
|
428
573
|
key: 1
|
@@ -225,7 +225,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
225
225
|
round: "",
|
226
226
|
size: 100,
|
227
227
|
onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
|
228
|
-
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\
|
228
|
+
}, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\n <n-upload-trigger #="{ handleClick }" abstract>\n <n-button\n circle\n secondary\n class="edit-avatar"\n v-show="userDetail.id === state.userInfo.id"\n @click="handleClick"\n >\n <template #icon>\n <n-icon size="16" color="#666666" :component="Camera" />\n </template>\n </n-button>\n </n-upload-trigger>\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
|
229
229
|
class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
|
230
230
|
}, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
|
231
231
|
strong: "",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { type TRTCEvent } from '../hooks';
|
2
2
|
import { AV_STATUS } from '../constants';
|
3
3
|
declare const _default: import("vue").DefineComponent<{}, {
|
4
4
|
sendMessage: (message: {
|
@@ -58,36 +58,26 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
58
58
|
};
|
59
59
|
isForward: boolean;
|
60
60
|
};
|
61
|
-
|
62
|
-
trtc: TRTC;
|
61
|
+
trtc: import("trtc-sdk-v5").TRTC;
|
63
62
|
timing: import("vue").Ref<string>;
|
64
63
|
voiceClose: import("vue").Ref<boolean>;
|
65
64
|
isAudio: import("vue").ComputedRef<boolean>;
|
66
65
|
isCall: import("vue").ComputedRef<boolean>;
|
67
66
|
startTimer: () => void;
|
68
|
-
resetTimer: () => void;
|
69
67
|
toggleAudio: () => Promise<void>;
|
70
68
|
messageTypeText: import("vue").ComputedRef<"语音" | "视频">;
|
71
69
|
time: {
|
72
70
|
timer: any;
|
73
71
|
seconds: number;
|
74
72
|
};
|
75
|
-
installEventHandlers: (
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
handleError: import("../../../../shared/types").AnyFn;
|
84
|
-
handleRemoteUserEnter: import("../../../../shared/types").AnyFn;
|
85
|
-
handleRemoteAudioAvailable: import("../../../../shared/types").AnyFn;
|
86
|
-
handleRemoteUserExit: import("../../../../shared/types").AnyFn;
|
87
|
-
handleRemoteVideoAvailable: import("../../../../shared/types").AnyFn;
|
88
|
-
}) => void;
|
89
|
-
videoRef: import("vue").Ref<any>;
|
90
|
-
selfVideoRef: import("vue").Ref<any>;
|
73
|
+
installEventHandlers: (handlers: import("../hooks").VideoEventHandlers) => void;
|
74
|
+
uninstallEventHandlers: (handlers: import("../hooks").VideoEventHandlers) => void;
|
75
|
+
enterRoom: () => Promise<boolean>;
|
76
|
+
exitRoom: () => Promise<void>;
|
77
|
+
startLocalMedia: (selfVideoRef?: HTMLElement | undefined) => Promise<void>;
|
78
|
+
MAIN_STREAM_TYPE: any;
|
79
|
+
videoRef: import("vue").Ref<HTMLElement | undefined>;
|
80
|
+
selfVideoRef: import("vue").Ref<HTMLElement | undefined>;
|
91
81
|
isConnect: import("vue").Ref<boolean>;
|
92
82
|
timeout: any;
|
93
83
|
info: import("vue").ComputedRef<{
|
@@ -102,10 +92,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
102
92
|
handleEnter: () => Promise<void>;
|
103
93
|
handleFinish: () => void;
|
104
94
|
handleExit: () => Promise<void>;
|
105
|
-
handleRemoteVideoAvailable: (event:
|
106
|
-
handleRemoteAudioAvailable: (event:
|
107
|
-
handleRemoteUserEnter: () => void;
|
108
|
-
handleRemoteUserExit: (event:
|
95
|
+
handleRemoteVideoAvailable: (event: TRTCEvent) => Promise<void>;
|
96
|
+
handleRemoteAudioAvailable: (event: TRTCEvent) => void;
|
97
|
+
handleRemoteUserEnter: (event: TRTCEvent) => void;
|
98
|
+
handleRemoteUserExit: (event: TRTCEvent) => void;
|
109
99
|
handleError: (error: any) => void;
|
110
100
|
NButton: any;
|
111
101
|
NAvatar: any;
|