vue-chat-kit 0.3.6 → 0.3.7
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/dist/vue-chat-kit.es.js +361 -353
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/composables/useChat.js +18 -8
- package/src/config/index.js +1 -0
- package/src/core/api.js +11 -0
package/dist/vue-chat-kit.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as _, computed as we,
|
|
2
|
-
import { ChatDotRound as Ye, UserFilled as Qe, Bell as
|
|
3
|
-
import
|
|
1
|
+
import { ref as _, computed as we, watch as _t, nextTick as Oe, resolveComponent as be, openBlock as a, createBlock as G, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as Xe, Fragment as me, renderList as he, withModifiers as Be, normalizeClass as J, createVNode as m, createTextVNode as ue, onMounted as bt, onUnmounted as kt, unref as d, resolveDynamicComponent as wt, toDisplayString as y, createCommentVNode as S, isRef as Ie, withDirectives as Ct, withKeys as xt, vModelText as Ut } from "vue";
|
|
2
|
+
import { ChatDotRound as Ye, UserFilled as Qe, Bell as $t, Setting as St, Search as qe, Plus as zt, MoreFilled as At, Document as Vt, Download as Ft, Folder as Ze, Picture as It, ChatLineRound as Rt, Camera as Mt } from "@element-plus/icons-vue";
|
|
3
|
+
import ht from "dayjs";
|
|
4
4
|
import { ElMessage as Q } from "element-plus";
|
|
5
5
|
class Dt {
|
|
6
6
|
constructor(t, n = {}) {
|
|
@@ -177,8 +177,8 @@ class Wt {
|
|
|
177
177
|
U.status
|
|
178
178
|
);
|
|
179
179
|
const A = U.headers.get("content-type");
|
|
180
|
-
let
|
|
181
|
-
return A && A.includes("application/json") ?
|
|
180
|
+
let h;
|
|
181
|
+
return A && A.includes("application/json") ? h = await U.json() : h = await U.text(), h;
|
|
182
182
|
} catch (V) {
|
|
183
183
|
throw V instanceof Je ? V : new Je(
|
|
184
184
|
V instanceof Error ? V.message : "网络错误",
|
|
@@ -201,7 +201,7 @@ class Wt {
|
|
|
201
201
|
return this.request(t, { ...n, method: "DELETE" });
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
class
|
|
204
|
+
class ft {
|
|
205
205
|
constructor(t, n = null) {
|
|
206
206
|
this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new Wt({
|
|
207
207
|
baseUrl: t.api.baseUrl,
|
|
@@ -235,6 +235,15 @@ class ht {
|
|
|
235
235
|
async _getAvailableUsers(t) {
|
|
236
236
|
return this.http.get(this.endpoints.getAvailableUsers, { currentUser: t });
|
|
237
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* 搜索用户
|
|
240
|
+
*/
|
|
241
|
+
async searchUser(t) {
|
|
242
|
+
return this._call("searchUser", t);
|
|
243
|
+
}
|
|
244
|
+
async _searchUser(t) {
|
|
245
|
+
return this.http.get(this.endpoints.searchUser, { keyword: t });
|
|
246
|
+
}
|
|
238
247
|
/**
|
|
239
248
|
* 添加好友
|
|
240
249
|
*/
|
|
@@ -340,13 +349,13 @@ class ht {
|
|
|
340
349
|
return v.append("file", t), v.append("username", n), this.http.post(this.endpoints.uploadAvatar, v);
|
|
341
350
|
}
|
|
342
351
|
}
|
|
343
|
-
const
|
|
352
|
+
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
344
353
|
__proto__: null,
|
|
345
|
-
ChatApi:
|
|
346
|
-
default:
|
|
354
|
+
ChatApi: ft,
|
|
355
|
+
default: ft
|
|
347
356
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
348
|
-
function
|
|
349
|
-
const n = new
|
|
357
|
+
function Tt(x, t) {
|
|
358
|
+
const n = new ft(x);
|
|
350
359
|
let v = null;
|
|
351
360
|
const $ = x.user.username, ee = _(x.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${$}`), H = _({
|
|
352
361
|
username: $,
|
|
@@ -354,82 +363,77 @@ function Lt(x, t) {
|
|
|
354
363
|
email: x.user.email || "",
|
|
355
364
|
phone: x.user.phone || "",
|
|
356
365
|
bio: x.user.bio || ""
|
|
357
|
-
}), Z = _(!1), X = _([]), ve = _([]), V = _([]), U = _(""), A = _(""),
|
|
366
|
+
}), Z = _(!1), X = _([]), ve = _([]), V = _([]), U = _(""), A = _(""), h = _(""), ce = _(null), Ae = _(!1), ye = _(""), C = _([]), fe = _(!1), Ce = _([]), Ve = _(!1), xe = we(() => {
|
|
358
367
|
let i = ve.value;
|
|
359
368
|
if (A.value) {
|
|
360
|
-
const
|
|
369
|
+
const c = A.value.toLowerCase();
|
|
361
370
|
i = i.filter(
|
|
362
371
|
(g) => {
|
|
363
372
|
var F;
|
|
364
|
-
return (F = g.username) == null ? void 0 : F.toLowerCase().includes(
|
|
373
|
+
return (F = g.username) == null ? void 0 : F.toLowerCase().includes(c);
|
|
365
374
|
}
|
|
366
375
|
);
|
|
367
376
|
}
|
|
368
|
-
return i.map((
|
|
369
|
-
id:
|
|
370
|
-
name:
|
|
371
|
-
avatar:
|
|
372
|
-
online:
|
|
373
|
-
lastMsg:
|
|
374
|
-
lastTime:
|
|
375
|
-
unread:
|
|
377
|
+
return i.map((c) => ({
|
|
378
|
+
id: c.username,
|
|
379
|
+
name: c.username,
|
|
380
|
+
avatar: c.avatar || ee.value,
|
|
381
|
+
online: c.online,
|
|
382
|
+
lastMsg: c.lastMsg || "暂无消息",
|
|
383
|
+
lastTime: c.lastTime,
|
|
384
|
+
unread: c.unReadNum || 0
|
|
376
385
|
}));
|
|
377
386
|
}), Se = we(() => {
|
|
378
387
|
let i = X.value;
|
|
379
388
|
if (A.value) {
|
|
380
|
-
const
|
|
389
|
+
const c = A.value.toLowerCase();
|
|
381
390
|
i = i.filter(
|
|
382
391
|
(g) => {
|
|
383
392
|
var F;
|
|
384
|
-
return (F = g.username) == null ? void 0 : F.toLowerCase().includes(
|
|
393
|
+
return (F = g.username) == null ? void 0 : F.toLowerCase().includes(c);
|
|
385
394
|
}
|
|
386
395
|
);
|
|
387
396
|
}
|
|
388
|
-
return i.map((
|
|
389
|
-
id:
|
|
390
|
-
name:
|
|
391
|
-
avatar:
|
|
392
|
-
online:
|
|
393
|
-
isChatting:
|
|
397
|
+
return i.map((c) => ({
|
|
398
|
+
id: c.username,
|
|
399
|
+
name: c.username,
|
|
400
|
+
avatar: c.avatar || ee.value,
|
|
401
|
+
online: c.online,
|
|
402
|
+
isChatting: c.isChatting
|
|
394
403
|
}));
|
|
395
|
-
}), Fe = we(() =>
|
|
396
|
-
|
|
397
|
-
var d;
|
|
398
|
-
return (d = i.username) == null ? void 0 : d.toLowerCase().includes(he.value.toLowerCase());
|
|
399
|
-
}
|
|
400
|
-
) : C.value), Re = we(() => xe.value.find((i) => i.id === U.value) || null), De = we(() => V.value.map((i) => {
|
|
401
|
-
const d = i.type === "file" || i.fileUrl || i.fileName, g = i.fileName || i.msgContent;
|
|
404
|
+
}), Fe = we(() => C.value), Re = we(() => xe.value.find((i) => i.id === U.value) || null), De = we(() => V.value.map((i) => {
|
|
405
|
+
const c = i.type === "file" || i.fileUrl || i.fileName, g = i.fileName || i.msgContent;
|
|
402
406
|
return {
|
|
403
407
|
text: i.msgContent,
|
|
404
408
|
isSelf: i.sendUsername === $,
|
|
405
409
|
time: i.createTime,
|
|
406
410
|
sendUsername: i.sendUsername,
|
|
407
|
-
type:
|
|
411
|
+
type: c ? "file" : "text",
|
|
408
412
|
fileType: w(g) ? "image" : z(g),
|
|
409
413
|
fileUrl: i.fileUrl || "",
|
|
410
414
|
fileName: g,
|
|
411
415
|
fileSize: i.fileSize || 0
|
|
412
416
|
};
|
|
413
|
-
})), We = (i) =>
|
|
417
|
+
})), We = (i) => ht(i).format("HH:mm"), Me = (i) => {
|
|
414
418
|
if (!i) return "";
|
|
415
|
-
const
|
|
416
|
-
return
|
|
419
|
+
const c = ht(), g = ht(i);
|
|
420
|
+
return c.isSame(g, "day") ? g.format("HH:mm") : c.diff(g, "day") === 1 ? "昨天" : c.diff(g, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][g.day()] : g.format("MM/DD");
|
|
417
421
|
}, w = (i) => {
|
|
418
422
|
if (!i) return !1;
|
|
419
|
-
const
|
|
420
|
-
return
|
|
423
|
+
const c = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], g = i.split(".").pop().toLowerCase();
|
|
424
|
+
return c.includes(g);
|
|
421
425
|
}, z = (i) => {
|
|
422
426
|
if (!i) return "default";
|
|
423
|
-
const
|
|
424
|
-
return ["xls", "xlsx"].includes(
|
|
427
|
+
const c = i.split(".").pop().toLowerCase();
|
|
428
|
+
return ["xls", "xlsx"].includes(c) ? "excel" : ["pdf"].includes(c) ? "pdf" : ["doc", "docx"].includes(c) ? "docx" : "default";
|
|
425
429
|
}, Y = () => {
|
|
426
430
|
Oe(() => {
|
|
427
431
|
ce.value && (ce.value.scrollTop = ce.value.scrollHeight);
|
|
428
432
|
});
|
|
429
433
|
}, I = async () => {
|
|
430
434
|
try {
|
|
431
|
-
const
|
|
432
|
-
X.value =
|
|
435
|
+
const c = (await n.getFriends($)).data || [];
|
|
436
|
+
X.value = c, ve.value = c.filter((g) => g.isChatting === 1);
|
|
433
437
|
for (const g of ve.value)
|
|
434
438
|
try {
|
|
435
439
|
const _e = (await n.getHistory($, g.username)).data || [];
|
|
@@ -444,46 +448,46 @@ function Lt(x, t) {
|
|
|
444
448
|
}
|
|
445
449
|
}, R = async (i) => {
|
|
446
450
|
try {
|
|
447
|
-
const
|
|
448
|
-
V.value =
|
|
449
|
-
} catch (
|
|
450
|
-
console.error("[VueChatKit] 获取聊天历史失败",
|
|
451
|
+
const c = await n.getHistory($, i);
|
|
452
|
+
V.value = c.data || [], Y();
|
|
453
|
+
} catch (c) {
|
|
454
|
+
console.error("[VueChatKit] 获取聊天历史失败", c);
|
|
451
455
|
}
|
|
452
456
|
}, M = async (i) => {
|
|
453
457
|
try {
|
|
454
458
|
await n.setRead($, i), I();
|
|
455
|
-
} catch (
|
|
456
|
-
console.error("[VueChatKit] 标记已读失败",
|
|
459
|
+
} catch (c) {
|
|
460
|
+
console.error("[VueChatKit] 标记已读失败", c);
|
|
457
461
|
}
|
|
458
462
|
}, E = async (i) => {
|
|
459
463
|
U.value = i.id, await R(i.id), await M(i.id), Y();
|
|
460
|
-
}, N = async (i,
|
|
464
|
+
}, N = async (i, c = 1) => {
|
|
461
465
|
try {
|
|
462
|
-
return await n.setChatStatus($, i,
|
|
466
|
+
return await n.setChatStatus($, i, c), await I(), !0;
|
|
463
467
|
} catch (g) {
|
|
464
468
|
return console.error("[VueChatKit] 设置聊天状态失败", g), !1;
|
|
465
469
|
}
|
|
466
470
|
}, P = () => {
|
|
467
|
-
if (!
|
|
468
|
-
if (v.send(U.value,
|
|
469
|
-
const
|
|
470
|
-
msgContent:
|
|
471
|
+
if (!h.value.trim() || !U.value || !v) return;
|
|
472
|
+
if (v.send(U.value, h.value.trim(), "text")) {
|
|
473
|
+
const c = {
|
|
474
|
+
msgContent: h.value.trim(),
|
|
471
475
|
sendUsername: $,
|
|
472
476
|
receiveUsername: U.value,
|
|
473
477
|
createTime: /* @__PURE__ */ new Date(),
|
|
474
478
|
isRead: 0,
|
|
475
479
|
type: "text"
|
|
476
480
|
};
|
|
477
|
-
V.value.push(
|
|
481
|
+
V.value.push(c), h.value = "", Y(), setTimeout(() => {
|
|
478
482
|
R(U.value), I();
|
|
479
483
|
}, 300);
|
|
480
484
|
}
|
|
481
485
|
}, L = async (i) => {
|
|
482
486
|
if (!U.value || !v) return !1;
|
|
483
487
|
try {
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
const { fileUrl: g, fileName: F } =
|
|
488
|
+
const c = await n.uploadFile(i);
|
|
489
|
+
if (c.code === 200 && c.data) {
|
|
490
|
+
const { fileUrl: g, fileName: F } = c.data;
|
|
487
491
|
if (v.send(
|
|
488
492
|
U.value,
|
|
489
493
|
F,
|
|
@@ -507,14 +511,14 @@ function Lt(x, t) {
|
|
|
507
511
|
}
|
|
508
512
|
}
|
|
509
513
|
return !1;
|
|
510
|
-
} catch (
|
|
511
|
-
return console.error("[VueChatKit] 发送文件失败",
|
|
514
|
+
} catch (c) {
|
|
515
|
+
return console.error("[VueChatKit] 发送文件失败", c), !1;
|
|
512
516
|
}
|
|
513
|
-
}, q = async (i,
|
|
517
|
+
}, q = async (i, c) => {
|
|
514
518
|
if (!(!U.value || !v)) {
|
|
515
|
-
if (
|
|
519
|
+
if (c && c.trim() && v.send(U.value, c.trim(), "text")) {
|
|
516
520
|
const F = {
|
|
517
|
-
msgContent:
|
|
521
|
+
msgContent: c.trim(),
|
|
518
522
|
sendUsername: $,
|
|
519
523
|
receiveUsername: U.value,
|
|
520
524
|
createTime: /* @__PURE__ */ new Date(),
|
|
@@ -546,18 +550,18 @@ function Lt(x, t) {
|
|
|
546
550
|
};
|
|
547
551
|
} catch {
|
|
548
552
|
}
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
553
|
+
const c = i.match(/^\[(.+?)\]:(.+)$/);
|
|
554
|
+
if (c)
|
|
551
555
|
return {
|
|
552
|
-
username:
|
|
553
|
-
content:
|
|
556
|
+
username: c[1],
|
|
557
|
+
content: c[2],
|
|
554
558
|
type: "text"
|
|
555
559
|
};
|
|
556
|
-
} catch (
|
|
557
|
-
console.error("[VueChatKit] 解析消息失败",
|
|
560
|
+
} catch (c) {
|
|
561
|
+
console.error("[VueChatKit] 解析消息失败", c);
|
|
558
562
|
}
|
|
559
563
|
return null;
|
|
560
|
-
},
|
|
564
|
+
}, ae = (i) => {
|
|
561
565
|
if (i.includes("【状态变更】")) {
|
|
562
566
|
const g = /【状态变更】(.+?) 已(上线|下线)/, F = i.match(g);
|
|
563
567
|
if (F) {
|
|
@@ -566,29 +570,29 @@ function Lt(x, t) {
|
|
|
566
570
|
}
|
|
567
571
|
return;
|
|
568
572
|
}
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
573
|
+
const c = te(i);
|
|
574
|
+
if (c) {
|
|
571
575
|
const g = {
|
|
572
|
-
content:
|
|
573
|
-
username:
|
|
574
|
-
type:
|
|
575
|
-
fileUrl:
|
|
576
|
-
fileName:
|
|
577
|
-
fileSize:
|
|
576
|
+
content: c.content,
|
|
577
|
+
username: c.username || U.value,
|
|
578
|
+
type: c.type || "text",
|
|
579
|
+
fileUrl: c.fileUrl || "",
|
|
580
|
+
fileName: c.fileName || "",
|
|
581
|
+
fileSize: c.fileSize || 0,
|
|
578
582
|
timestamp: /* @__PURE__ */ new Date()
|
|
579
583
|
};
|
|
580
584
|
if (U.value) {
|
|
581
585
|
try {
|
|
582
586
|
let F = {
|
|
583
|
-
msgContent:
|
|
587
|
+
msgContent: c.content,
|
|
584
588
|
sendUsername: g.username,
|
|
585
589
|
receiveUsername: $,
|
|
586
590
|
createTime: /* @__PURE__ */ new Date(),
|
|
587
591
|
isRead: 0,
|
|
588
|
-
type:
|
|
589
|
-
fileUrl:
|
|
590
|
-
fileName:
|
|
591
|
-
fileSize:
|
|
592
|
+
type: c.type || "text",
|
|
593
|
+
fileUrl: c.fileUrl || "",
|
|
594
|
+
fileName: c.fileName || "",
|
|
595
|
+
fileSize: c.fileSize || 0
|
|
592
596
|
};
|
|
593
597
|
V.value.push(F), Y();
|
|
594
598
|
} catch (F) {
|
|
@@ -604,26 +608,26 @@ function Lt(x, t) {
|
|
|
604
608
|
wsUrl: i,
|
|
605
609
|
maxReconnectAttempts: x.websocket.maxReconnectAttempts,
|
|
606
610
|
reconnectDelay: x.websocket.reconnectDelay
|
|
607
|
-
}), v.on("message",
|
|
611
|
+
}), v.on("message", ae), v.connect();
|
|
608
612
|
}, pe = () => {
|
|
609
613
|
v && (v.close(), v = null);
|
|
610
614
|
}, B = async () => {
|
|
611
|
-
Ae.value = !0,
|
|
612
|
-
},
|
|
613
|
-
|
|
615
|
+
Ae.value = !0, ye.value = "", C.value = [];
|
|
616
|
+
}, se = async (i = "") => {
|
|
617
|
+
fe.value = !0;
|
|
614
618
|
try {
|
|
615
|
-
|
|
616
|
-
C.value = (
|
|
617
|
-
} catch (
|
|
618
|
-
console.error("[VueChatKit] 获取可用用户失败",
|
|
619
|
+
let c;
|
|
620
|
+
i ? c = await n.searchUser(i) : c = await n.getAvailableUsers($), C.value = (c == null ? void 0 : c.data) || [];
|
|
621
|
+
} catch (c) {
|
|
622
|
+
console.error("[VueChatKit] 获取可用用户失败", c);
|
|
619
623
|
} finally {
|
|
620
|
-
|
|
624
|
+
fe.value = !1;
|
|
621
625
|
}
|
|
622
626
|
}, ne = async (i) => {
|
|
623
627
|
try {
|
|
624
628
|
await n.addFriend($, i.username), await I(), Ae.value = !1;
|
|
625
|
-
} catch (
|
|
626
|
-
console.error("[VueChatKit] 添加好友失败",
|
|
629
|
+
} catch (c) {
|
|
630
|
+
console.error("[VueChatKit] 添加好友失败", c);
|
|
627
631
|
}
|
|
628
632
|
}, D = async () => {
|
|
629
633
|
Ve.value = !0;
|
|
@@ -638,8 +642,8 @@ function Lt(x, t) {
|
|
|
638
642
|
}, W = async (i) => {
|
|
639
643
|
try {
|
|
640
644
|
await n.agreeFriend(i, $), await D(), await I();
|
|
641
|
-
} catch (
|
|
642
|
-
console.error("[VueChatKit] 同意好友申请失败",
|
|
645
|
+
} catch (c) {
|
|
646
|
+
console.error("[VueChatKit] 同意好友申请失败", c);
|
|
643
647
|
}
|
|
644
648
|
}, ie = async () => {
|
|
645
649
|
try {
|
|
@@ -669,13 +673,15 @@ function Lt(x, t) {
|
|
|
669
673
|
...H.value,
|
|
670
674
|
...i
|
|
671
675
|
}, !0) : !1;
|
|
672
|
-
} catch (
|
|
673
|
-
return console.error("[VueChatKit] 更新用户信息失败",
|
|
676
|
+
} catch (c) {
|
|
677
|
+
return console.error("[VueChatKit] 更新用户信息失败", c), !1;
|
|
674
678
|
}
|
|
675
679
|
}, ze = () => {
|
|
676
|
-
U.value = "", V.value = [],
|
|
680
|
+
U.value = "", V.value = [], h.value = "", A.value = "";
|
|
677
681
|
};
|
|
678
|
-
return ie(), {
|
|
682
|
+
return ie(), _t(ye, async (i) => {
|
|
683
|
+
await se(i);
|
|
684
|
+
}), {
|
|
679
685
|
// 状态
|
|
680
686
|
myUsername: $,
|
|
681
687
|
myAvatar: ee,
|
|
@@ -687,16 +693,16 @@ function Lt(x, t) {
|
|
|
687
693
|
chatMsgList: V,
|
|
688
694
|
currentSelectName: U,
|
|
689
695
|
searchText: A,
|
|
690
|
-
inputText:
|
|
696
|
+
inputText: h,
|
|
691
697
|
messagesContainer: ce,
|
|
692
698
|
filteredUsers: xe,
|
|
693
699
|
filteredAvailableUsers: Fe,
|
|
694
700
|
currentUser: Re,
|
|
695
701
|
currentMessages: De,
|
|
696
702
|
addFriendDialogVisible: Ae,
|
|
697
|
-
addFriendSearchText:
|
|
703
|
+
addFriendSearchText: ye,
|
|
698
704
|
availableUsers: C,
|
|
699
|
-
loadingAvailableUsers:
|
|
705
|
+
loadingAvailableUsers: fe,
|
|
700
706
|
friendApplyList: Ce,
|
|
701
707
|
loadingFriendApply: Ve,
|
|
702
708
|
// 方法
|
|
@@ -714,6 +720,7 @@ function Lt(x, t) {
|
|
|
714
720
|
closeWebSocket: pe,
|
|
715
721
|
reset: ze,
|
|
716
722
|
openAddFriendDialog: B,
|
|
723
|
+
loadAvailableUsers: se,
|
|
717
724
|
addFriend: ne,
|
|
718
725
|
loadFriendApplyList: D,
|
|
719
726
|
agreeFriend: W,
|
|
@@ -761,7 +768,7 @@ const gt = (x, t) => {
|
|
|
761
768
|
displayHeight: 0,
|
|
762
769
|
offsetX: 0,
|
|
763
770
|
offsetY: 0
|
|
764
|
-
}),
|
|
771
|
+
}), h = _({
|
|
765
772
|
x: 0,
|
|
766
773
|
y: 0,
|
|
767
774
|
size: 150,
|
|
@@ -773,13 +780,13 @@ const gt = (x, t) => {
|
|
|
773
780
|
maxHeight: "none",
|
|
774
781
|
display: "block"
|
|
775
782
|
})), Ae = we(() => ({
|
|
776
|
-
left: `${
|
|
777
|
-
top: `${
|
|
778
|
-
width: `${
|
|
779
|
-
height: `${
|
|
783
|
+
left: `${h.value.x}px`,
|
|
784
|
+
top: `${h.value.y}px`,
|
|
785
|
+
width: `${h.value.size}px`,
|
|
786
|
+
height: `${h.value.size / v.aspectRatio}px`
|
|
780
787
|
}));
|
|
781
|
-
let
|
|
782
|
-
const
|
|
788
|
+
let ye = null, C = null;
|
|
789
|
+
const fe = () => {
|
|
783
790
|
Oe(() => {
|
|
784
791
|
const w = V.value, z = ve.value;
|
|
785
792
|
if (!w || !z) return;
|
|
@@ -794,27 +801,27 @@ const gt = (x, t) => {
|
|
|
794
801
|
offsetY: L
|
|
795
802
|
};
|
|
796
803
|
const q = Math.min(E, N) * 0.6;
|
|
797
|
-
|
|
804
|
+
h.value.size = q, h.value.x = P + (E - q) / 2, h.value.y = L + (N - q / v.aspectRatio) / 2, Ce();
|
|
798
805
|
});
|
|
799
806
|
}, Ce = () => {
|
|
800
807
|
const w = U.value, z = V.value;
|
|
801
808
|
if (!w || !z) return;
|
|
802
|
-
const Y = w.getContext("2d"), { naturalWidth: I, naturalHeight: R, displayWidth: M, displayHeight: E, offsetX: N, offsetY: P } = A.value, L = I / M, q = R / E, te = (
|
|
803
|
-
Y.clearRect(0, 0, w.width, w.height), Y.drawImage(z, te,
|
|
809
|
+
const Y = w.getContext("2d"), { naturalWidth: I, naturalHeight: R, displayWidth: M, displayHeight: E, offsetX: N, offsetY: P } = A.value, L = I / M, q = R / E, te = (h.value.x - N) * L, ae = (h.value.y - P) * q, de = h.value.size * L, pe = h.value.size / v.aspectRatio * q;
|
|
810
|
+
Y.clearRect(0, 0, w.width, w.height), Y.drawImage(z, te, ae, de, pe, 0, 0, w.width, w.height);
|
|
804
811
|
}, Ve = (w) => {
|
|
805
812
|
w.preventDefault();
|
|
806
813
|
const z = w.clientX || w.touches[0].clientX, Y = w.clientY || w.touches[0].clientY;
|
|
807
|
-
|
|
814
|
+
ye = {
|
|
808
815
|
startX: z,
|
|
809
816
|
startY: Y,
|
|
810
|
-
boxX:
|
|
811
|
-
boxY:
|
|
817
|
+
boxX: h.value.x,
|
|
818
|
+
boxY: h.value.y
|
|
812
819
|
};
|
|
813
820
|
const I = (M) => {
|
|
814
|
-
const E = M.clientX || M.touches[0].clientX, N = M.clientY || M.touches[0].clientY, P = E -
|
|
815
|
-
|
|
821
|
+
const E = M.clientX || M.touches[0].clientX, N = M.clientY || M.touches[0].clientY, P = E - ye.startX, L = N - ye.startY, { offsetX: q, offsetY: te, displayWidth: ae, displayHeight: de } = A.value, pe = h.value.size / v.aspectRatio, B = Math.max(q, Math.min(q + ae - h.value.size, ye.boxX + P)), se = Math.max(te, Math.min(te + de - pe, ye.boxY + L));
|
|
822
|
+
h.value.x = B, h.value.y = se, Ce();
|
|
816
823
|
}, R = () => {
|
|
817
|
-
|
|
824
|
+
ye = null, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", R), document.removeEventListener("touchmove", I), document.removeEventListener("touchend", R);
|
|
818
825
|
};
|
|
819
826
|
document.addEventListener("mousemove", I), document.addEventListener("mouseup", R), document.addEventListener("touchmove", I, { passive: !1 }), document.addEventListener("touchend", R);
|
|
820
827
|
}, xe = (w, z) => {
|
|
@@ -824,41 +831,41 @@ const gt = (x, t) => {
|
|
|
824
831
|
handle: w,
|
|
825
832
|
startX: Y,
|
|
826
833
|
startY: I,
|
|
827
|
-
boxX:
|
|
828
|
-
boxY:
|
|
829
|
-
boxSize:
|
|
834
|
+
boxX: h.value.x,
|
|
835
|
+
boxY: h.value.y,
|
|
836
|
+
boxSize: h.value.size
|
|
830
837
|
};
|
|
831
838
|
const R = (E) => {
|
|
832
|
-
const N = E.clientX || E.touches[0].clientX, P = E.clientY || E.touches[0].clientY, L = N - C.startX, q = P - C.startY, { offsetX: te, offsetY:
|
|
833
|
-
let B = C.boxSize,
|
|
839
|
+
const N = E.clientX || E.touches[0].clientX, P = E.clientY || E.touches[0].clientY, L = N - C.startX, q = P - C.startY, { offsetX: te, offsetY: ae, displayWidth: de, displayHeight: pe } = A.value;
|
|
840
|
+
let B = C.boxSize, se = C.boxX, ne = C.boxY;
|
|
834
841
|
const D = C.boxSize / v.aspectRatio;
|
|
835
842
|
switch (w) {
|
|
836
843
|
case "se":
|
|
837
|
-
B = Math.max(
|
|
844
|
+
B = Math.max(h.value.minSize, Math.min(de - (C.boxX - te), pe - (C.boxY - ae), C.boxSize + Math.max(L, q)));
|
|
838
845
|
break;
|
|
839
846
|
case "nw":
|
|
840
|
-
B = Math.max(
|
|
847
|
+
B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxY - ae + D, C.boxSize - Math.max(L, q))), se = C.boxX + (C.boxSize - B), ne = C.boxY + (D - B / v.aspectRatio);
|
|
841
848
|
break;
|
|
842
849
|
case "ne":
|
|
843
|
-
B = Math.max(
|
|
850
|
+
B = Math.max(h.value.minSize, Math.min(te + de - C.boxX, C.boxY - ae + D, C.boxSize + Math.max(L, -q))), ne = C.boxY + (D - B / v.aspectRatio);
|
|
844
851
|
break;
|
|
845
852
|
case "sw":
|
|
846
|
-
B = Math.max(
|
|
853
|
+
B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, ae + pe - C.boxY, C.boxSize + Math.max(-L, q))), se = C.boxX + (C.boxSize - B);
|
|
847
854
|
break;
|
|
848
855
|
case "n":
|
|
849
|
-
B = Math.max(
|
|
856
|
+
B = Math.max(h.value.minSize, Math.min(C.boxY - ae + D, C.boxSize - q)), ne = C.boxY + (D - B / v.aspectRatio);
|
|
850
857
|
break;
|
|
851
858
|
case "s":
|
|
852
|
-
B = Math.max(
|
|
859
|
+
B = Math.max(h.value.minSize, Math.min(ae + pe - C.boxY, C.boxSize + q));
|
|
853
860
|
break;
|
|
854
861
|
case "w":
|
|
855
|
-
B = Math.max(
|
|
862
|
+
B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxSize - L)), se = C.boxX + (C.boxSize - B);
|
|
856
863
|
break;
|
|
857
864
|
case "e":
|
|
858
|
-
B = Math.max(
|
|
865
|
+
B = Math.max(h.value.minSize, Math.min(te + de - C.boxX, C.boxSize + L));
|
|
859
866
|
break;
|
|
860
867
|
}
|
|
861
|
-
|
|
868
|
+
h.value.size = B, h.value.x = se, h.value.y = ne, Ce();
|
|
862
869
|
}, M = () => {
|
|
863
870
|
C = null, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", M), document.removeEventListener("touchmove", R), document.removeEventListener("touchend", M);
|
|
864
871
|
};
|
|
@@ -866,11 +873,11 @@ const gt = (x, t) => {
|
|
|
866
873
|
}, Se = () => {
|
|
867
874
|
const w = document.createElement("canvas"), z = V.value;
|
|
868
875
|
if (!z) return null;
|
|
869
|
-
const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (
|
|
870
|
-
return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te,
|
|
876
|
+
const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (h.value.x - E) * P, te = (h.value.y - N) * L, ae = h.value.size * P, de = h.value.size / v.aspectRatio * L;
|
|
877
|
+
return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, ae, de, 0, 0, w.width, w.height), new Promise((B) => {
|
|
871
878
|
w.toBlob(
|
|
872
|
-
(
|
|
873
|
-
B(new File([
|
|
879
|
+
(se) => {
|
|
880
|
+
B(new File([se], "avatar.jpg", { type: v.outputType }));
|
|
874
881
|
},
|
|
875
882
|
v.outputType,
|
|
876
883
|
v.outputQuality
|
|
@@ -879,8 +886,8 @@ const gt = (x, t) => {
|
|
|
879
886
|
}, Fe = () => {
|
|
880
887
|
const w = document.createElement("canvas"), z = V.value;
|
|
881
888
|
if (!z) return null;
|
|
882
|
-
const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (
|
|
883
|
-
return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te,
|
|
889
|
+
const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (h.value.x - E) * P, te = (h.value.y - N) * L, ae = h.value.size * P, de = h.value.size / v.aspectRatio * L;
|
|
890
|
+
return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, ae, de, 0, 0, w.width, w.height), w.toDataURL(v.outputType, v.outputQuality);
|
|
884
891
|
}, Re = async () => {
|
|
885
892
|
if (H.value) {
|
|
886
893
|
X.value = !0;
|
|
@@ -898,13 +905,13 @@ const gt = (x, t) => {
|
|
|
898
905
|
}, We = () => {
|
|
899
906
|
Me(), $("closed");
|
|
900
907
|
}, Me = () => {
|
|
901
|
-
|
|
908
|
+
h.value = { x: 0, y: 0, size: 150, minSize: v.minSize };
|
|
902
909
|
};
|
|
903
|
-
return
|
|
910
|
+
return _t(
|
|
904
911
|
() => v.src,
|
|
905
912
|
(w) => {
|
|
906
913
|
w && Oe(() => {
|
|
907
|
-
V.value && V.value.complete &&
|
|
914
|
+
V.value && V.value.complete && fe();
|
|
908
915
|
});
|
|
909
916
|
}
|
|
910
917
|
), t({
|
|
@@ -956,7 +963,7 @@ const gt = (x, t) => {
|
|
|
956
963
|
src: H.value,
|
|
957
964
|
ref_key: "imageRef",
|
|
958
965
|
ref: V,
|
|
959
|
-
onLoad:
|
|
966
|
+
onLoad: fe,
|
|
960
967
|
style: Xe(ce.value)
|
|
961
968
|
}, null, 44, Yt),
|
|
962
969
|
e("div", {
|
|
@@ -965,7 +972,7 @@ const gt = (x, t) => {
|
|
|
965
972
|
onMousedown: Ve,
|
|
966
973
|
onTouchstart: Ve
|
|
967
974
|
}, [
|
|
968
|
-
(a(), p(me, null,
|
|
975
|
+
(a(), p(me, null, he(Z, (M) => e("div", {
|
|
969
976
|
key: M,
|
|
970
977
|
class: J(["crop-handle", M]),
|
|
971
978
|
onMousedown: Be((E) => xe(M, E), ["stop"]),
|
|
@@ -1007,7 +1014,7 @@ const gt = (x, t) => {
|
|
|
1007
1014
|
}, os = { class: "chat-list-info" }, rs = { class: "chat-list-header" }, cs = { class: "chat-list-name" }, ds = { class: "chat-list-time" }, us = { class: "chat-list-preview" }, vs = { class: "chat-list-last-msg" }, ps = {
|
|
1008
1015
|
key: 0,
|
|
1009
1016
|
class: "chat-list-unread"
|
|
1010
|
-
}, ms = { key: 1 },
|
|
1017
|
+
}, ms = { key: 1 }, hs = { class: "add-friend-section" }, fs = { class: "add-friend-icon" }, gs = ["onClick"], ys = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], bs = { class: "chat-list-info" }, ks = { class: "chat-list-name" }, ws = { key: 2 }, Cs = { class: "friend-request-info" }, xs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, Ss = { class: "chat-main-area" }, zs = {
|
|
1011
1018
|
key: 0,
|
|
1012
1019
|
class: "friend-profile-area"
|
|
1013
1020
|
}, As = ["src", "alt"], Vs = { class: "profile-name" }, Fs = { class: "profile-status" }, Is = {
|
|
@@ -1037,7 +1044,7 @@ const gt = (x, t) => {
|
|
|
1037
1044
|
}, da = { class: "empty-state-text" }, ua = {
|
|
1038
1045
|
key: 0,
|
|
1039
1046
|
class: "chat-detail-panel"
|
|
1040
|
-
}, va = { class: "chat-detail-content" }, pa = { class: "chat-detail-profile" }, ma = ["src", "alt"],
|
|
1047
|
+
}, va = { class: "chat-detail-content" }, pa = { class: "chat-detail-profile" }, ma = ["src", "alt"], ha = { class: "chat-detail-name" }, fa = { class: "add-friend-search-wrapper" }, ga = { class: "add-friend-users-list" }, ya = { class: "add-friend-user-info" }, _a = ["src", "alt"], ba = { class: "add-friend-user-name" }, ka = { class: "chat-settings-container" }, wa = { class: "chat-settings-avatar-section" }, Ca = { class: "chat-settings-avatar-wrapper" }, xa = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, Sa = { class: "chat-settings-username" }, za = { class: "chat-settings-form-section" }, Aa = { class: "chat-settings-form-header" }, Va = { class: "chat-settings-form-title" }, Fa = { class: "chat-settings-form" }, Ia = { class: "chat-settings-form-item" }, Ra = {
|
|
1041
1048
|
key: 1,
|
|
1042
1049
|
class: "chat-settings-form-value"
|
|
1043
1050
|
}, Ma = { class: "chat-settings-form-item" }, La = {
|
|
@@ -1069,12 +1076,12 @@ const gt = (x, t) => {
|
|
|
1069
1076
|
searchText: V,
|
|
1070
1077
|
inputText: U,
|
|
1071
1078
|
messagesContainer: A,
|
|
1072
|
-
filteredUsers:
|
|
1079
|
+
filteredUsers: h,
|
|
1073
1080
|
filteredAvailableUsers: ce,
|
|
1074
1081
|
currentUser: Ae,
|
|
1075
|
-
currentMessages:
|
|
1082
|
+
currentMessages: ye,
|
|
1076
1083
|
addFriendDialogVisible: C,
|
|
1077
|
-
addFriendSearchText:
|
|
1084
|
+
addFriendSearchText: fe,
|
|
1078
1085
|
availableUsers: Ce,
|
|
1079
1086
|
loadingAvailableUsers: Ve,
|
|
1080
1087
|
friendApplyList: xe,
|
|
@@ -1096,48 +1103,48 @@ const gt = (x, t) => {
|
|
|
1096
1103
|
addFriend: L,
|
|
1097
1104
|
loadFriendApplyList: q,
|
|
1098
1105
|
agreeFriend: te,
|
|
1099
|
-
updateMyAvatar:
|
|
1106
|
+
updateMyAvatar: ae,
|
|
1100
1107
|
getUserInfo: de,
|
|
1101
1108
|
updateUserInfo: pe
|
|
1102
|
-
} =
|
|
1103
|
-
v("message",
|
|
1109
|
+
} = Tt(n.config, (f) => {
|
|
1110
|
+
v("message", f);
|
|
1104
1111
|
}), B = we(() => {
|
|
1105
1112
|
var r;
|
|
1106
|
-
const
|
|
1107
|
-
return n.config.modules.friends &&
|
|
1108
|
-
}),
|
|
1109
|
-
|
|
1113
|
+
const f = [{ id: "chat", icon: Ye, badge: 0 }];
|
|
1114
|
+
return n.config.modules.friends && f.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && f.push({ id: "apply", icon: $t, badge: ((r = xe.value) == null ? void 0 : r.length) || 0 }), f;
|
|
1115
|
+
}), se = _("chat"), ne = _(null), D = _(null), W = _(null), ie = _(!1), le = _(!1), K = _({ nickname: "", email: "", phone: "", bio: "" }), oe = _(!1), ze = _(!1), i = _(!1), c = _(!1), g = _(null), F = _(""), _e = _(null), j = _([]), O = _({ visible: !1, x: 0, y: 0, chat: null }), Ue = (f, r) => {
|
|
1116
|
+
f.preventDefault(), f.stopPropagation(), O.value = { visible: !0, x: f.clientX, y: f.clientY, chat: r };
|
|
1110
1117
|
}, Le = () => {
|
|
1111
1118
|
O.value.visible = !1;
|
|
1112
1119
|
}, et = async () => {
|
|
1113
1120
|
if (!O.value.chat) return;
|
|
1114
1121
|
await w(O.value.chat.id, 0) && ne.value === O.value.chat.id && (ne.value = null, D.value = null), Le();
|
|
1115
|
-
}, Te = (
|
|
1116
|
-
ne.value =
|
|
1117
|
-
id:
|
|
1118
|
-
name:
|
|
1119
|
-
avatar:
|
|
1120
|
-
online:
|
|
1122
|
+
}, Te = (f) => {
|
|
1123
|
+
ne.value = f.id, D.value = f, W.value = null, ie.value = !1, z({
|
|
1124
|
+
id: f.id,
|
|
1125
|
+
name: f.name,
|
|
1126
|
+
avatar: f.avatar,
|
|
1127
|
+
online: f.online
|
|
1121
1128
|
});
|
|
1122
|
-
}, tt = (
|
|
1123
|
-
W.value =
|
|
1129
|
+
}, tt = (f) => {
|
|
1130
|
+
W.value = f, ne.value = null, D.value = null;
|
|
1124
1131
|
}, st = async () => {
|
|
1125
1132
|
if (!W.value) return;
|
|
1126
1133
|
if (await w(W.value.id)) {
|
|
1127
|
-
|
|
1128
|
-
const r =
|
|
1134
|
+
se.value = "chat", await Oe();
|
|
1135
|
+
const r = h.value.find((u) => u.id === W.value.id);
|
|
1129
1136
|
r && Te(r), W.value = null;
|
|
1130
1137
|
}
|
|
1131
1138
|
}, at = () => {
|
|
1132
1139
|
ze.value = !0;
|
|
1133
1140
|
}, nt = () => {
|
|
1134
|
-
var
|
|
1135
|
-
(
|
|
1141
|
+
var f;
|
|
1142
|
+
(f = g.value) == null || f.click();
|
|
1136
1143
|
}, it = () => {
|
|
1137
|
-
var
|
|
1138
|
-
(
|
|
1139
|
-
}, lt = (
|
|
1140
|
-
const r = Array.from(
|
|
1144
|
+
var f;
|
|
1145
|
+
(f = _e.value) == null || f.click();
|
|
1146
|
+
}, lt = (f) => {
|
|
1147
|
+
const r = Array.from(f.target.files || []);
|
|
1141
1148
|
if (r.length !== 0) {
|
|
1142
1149
|
for (const u of r) {
|
|
1143
1150
|
if (u.size > 50 * 1024 * 1024) {
|
|
@@ -1157,22 +1164,22 @@ const gt = (x, t) => {
|
|
|
1157
1164
|
}
|
|
1158
1165
|
_e.value && (_e.value.value = "");
|
|
1159
1166
|
}
|
|
1160
|
-
}, Ke = (
|
|
1161
|
-
const r = j.value[
|
|
1162
|
-
r.previewUrl && URL.revokeObjectURL(r.previewUrl), j.value.splice(
|
|
1163
|
-
}, Ne = (
|
|
1164
|
-
if (
|
|
1165
|
-
const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(
|
|
1166
|
-
return parseFloat((
|
|
1167
|
+
}, Ke = (f) => {
|
|
1168
|
+
const r = j.value[f];
|
|
1169
|
+
r.previewUrl && URL.revokeObjectURL(r.previewUrl), j.value.splice(f, 1);
|
|
1170
|
+
}, Ne = (f) => {
|
|
1171
|
+
if (f === 0) return "0 B";
|
|
1172
|
+
const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(f) / Math.log(r));
|
|
1173
|
+
return parseFloat((f / Math.pow(r, s)).toFixed(2)) + " " + u[s];
|
|
1167
1174
|
}, Pe = async () => {
|
|
1168
1175
|
if (!U.value.trim() && j.value.length === 0) return;
|
|
1169
|
-
const
|
|
1176
|
+
const f = [...j.value], r = U.value;
|
|
1170
1177
|
U.value = "", j.value.forEach((u) => {
|
|
1171
1178
|
u.previewUrl && URL.revokeObjectURL(u.previewUrl);
|
|
1172
|
-
}), j.value = [], await R(
|
|
1173
|
-
}, ot = (
|
|
1179
|
+
}), j.value = [], await R(f, r), v("send", { text: r, files: f });
|
|
1180
|
+
}, ot = (f) => {
|
|
1174
1181
|
var u;
|
|
1175
|
-
const r = (u =
|
|
1182
|
+
const r = (u = f.clipboardData) == null ? void 0 : u.items;
|
|
1176
1183
|
if (r) {
|
|
1177
1184
|
for (const s of r)
|
|
1178
1185
|
if (s.kind === "file") {
|
|
@@ -1195,16 +1202,16 @@ const gt = (x, t) => {
|
|
|
1195
1202
|
}
|
|
1196
1203
|
}
|
|
1197
1204
|
}
|
|
1198
|
-
}, je = (
|
|
1199
|
-
if (!
|
|
1205
|
+
}, je = (f) => {
|
|
1206
|
+
if (!f) {
|
|
1200
1207
|
Q.warning("文件地址无效");
|
|
1201
1208
|
return;
|
|
1202
1209
|
}
|
|
1203
|
-
window.open(
|
|
1204
|
-
}, rt = (
|
|
1205
|
-
console.warn("图片加载失败",
|
|
1206
|
-
}, ct = (
|
|
1207
|
-
const r =
|
|
1210
|
+
window.open(f, "_blank");
|
|
1211
|
+
}, rt = (f) => {
|
|
1212
|
+
console.warn("图片加载失败", f);
|
|
1213
|
+
}, ct = (f) => {
|
|
1214
|
+
const r = f.target.files[0];
|
|
1208
1215
|
if (!r) return;
|
|
1209
1216
|
if (!r.type.startsWith("image/")) {
|
|
1210
1217
|
Q.error("只能上传图片文件");
|
|
@@ -1218,16 +1225,16 @@ const gt = (x, t) => {
|
|
|
1218
1225
|
u.onload = (s) => {
|
|
1219
1226
|
F.value = s.target.result, i.value = !0;
|
|
1220
1227
|
}, u.readAsDataURL(r);
|
|
1221
|
-
}, dt = async ({ file:
|
|
1222
|
-
if (
|
|
1223
|
-
|
|
1228
|
+
}, dt = async ({ file: f }) => {
|
|
1229
|
+
if (f) {
|
|
1230
|
+
c.value = !0;
|
|
1224
1231
|
try {
|
|
1225
|
-
const { ChatApi: r } = await Promise.resolve().then(() =>
|
|
1226
|
-
s.code === 200 ? (Q.success("头像上传成功"),
|
|
1232
|
+
const { ChatApi: r } = await Promise.resolve().then(() => Lt), s = await new r(n.config).uploadAvatar(f, $);
|
|
1233
|
+
s.code === 200 ? (Q.success("头像上传成功"), ae(s.data), Ge()) : Q.error(s.msg || "头像上传失败");
|
|
1227
1234
|
} catch (r) {
|
|
1228
1235
|
console.error(r), Q.error("头像上传失败");
|
|
1229
1236
|
} finally {
|
|
1230
|
-
|
|
1237
|
+
c.value = !1;
|
|
1231
1238
|
}
|
|
1232
1239
|
}
|
|
1233
1240
|
}, Ge = () => {
|
|
@@ -1245,17 +1252,17 @@ const gt = (x, t) => {
|
|
|
1245
1252
|
oe.value = !0;
|
|
1246
1253
|
try {
|
|
1247
1254
|
await pe(K.value) ? (Q.success("保存成功"), le.value = !1) : Q.error("保存失败");
|
|
1248
|
-
} catch (
|
|
1249
|
-
console.error(
|
|
1255
|
+
} catch (f) {
|
|
1256
|
+
console.error(f), Q.error("保存失败");
|
|
1250
1257
|
} finally {
|
|
1251
1258
|
oe.value = !1;
|
|
1252
1259
|
}
|
|
1253
1260
|
};
|
|
1254
|
-
return
|
|
1255
|
-
await Promise.all([We(), q()]), M(),
|
|
1256
|
-
}),
|
|
1261
|
+
return bt(async () => {
|
|
1262
|
+
await Promise.all([We(), q()]), M(), h.value.length > 0 && Te(h.value[0]), v("init"), document.addEventListener("click", Le);
|
|
1263
|
+
}), kt(() => {
|
|
1257
1264
|
N(), E(), document.removeEventListener("click", Le);
|
|
1258
|
-
}), (
|
|
1265
|
+
}), (f, r) => {
|
|
1259
1266
|
var ke, He, Ee;
|
|
1260
1267
|
const u = be("el-icon"), s = be("el-input"), b = be("el-empty"), T = be("el-button"), re = be("el-dialog");
|
|
1261
1268
|
return a(), p("div", jt, [
|
|
@@ -1265,22 +1272,22 @@ const gt = (x, t) => {
|
|
|
1265
1272
|
onClick: at
|
|
1266
1273
|
}, [
|
|
1267
1274
|
e("img", {
|
|
1268
|
-
src:
|
|
1275
|
+
src: d(ee),
|
|
1269
1276
|
alt: "头像",
|
|
1270
1277
|
class: "sidebar-avatar-img"
|
|
1271
1278
|
}, null, 8, Gt)
|
|
1272
1279
|
]),
|
|
1273
|
-
(a(!0), p(me, null,
|
|
1280
|
+
(a(!0), p(me, null, he(B.value, (o) => (a(), p("div", {
|
|
1274
1281
|
key: o.id,
|
|
1275
1282
|
class: J([
|
|
1276
1283
|
"sidebar-nav-item",
|
|
1277
|
-
|
|
1284
|
+
se.value === o.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
|
|
1278
1285
|
]),
|
|
1279
|
-
onClick: (
|
|
1286
|
+
onClick: (ge) => se.value = o.id
|
|
1280
1287
|
}, [
|
|
1281
1288
|
m(u, { size: 24 }, {
|
|
1282
1289
|
default: k(() => [
|
|
1283
|
-
(a(), G(
|
|
1290
|
+
(a(), G(wt(o.icon)))
|
|
1284
1291
|
]),
|
|
1285
1292
|
_: 2
|
|
1286
1293
|
}, 1024),
|
|
@@ -1295,7 +1302,7 @@ const gt = (x, t) => {
|
|
|
1295
1302
|
}, [
|
|
1296
1303
|
m(u, { size: 24 }, {
|
|
1297
1304
|
default: k(() => [
|
|
1298
|
-
m(
|
|
1305
|
+
m(d(St))
|
|
1299
1306
|
]),
|
|
1300
1307
|
_: 1
|
|
1301
1308
|
})
|
|
@@ -1304,23 +1311,23 @@ const gt = (x, t) => {
|
|
|
1304
1311
|
e("div", Zt, [
|
|
1305
1312
|
e("div", es, [
|
|
1306
1313
|
m(s, {
|
|
1307
|
-
modelValue:
|
|
1314
|
+
modelValue: d(V),
|
|
1308
1315
|
"onUpdate:modelValue": r[1] || (r[1] = (o) => Ie(V) ? V.value = o : null),
|
|
1309
1316
|
placeholder: "搜索",
|
|
1310
|
-
"prefix-icon":
|
|
1317
|
+
"prefix-icon": d(qe),
|
|
1311
1318
|
class: "chat-search-input"
|
|
1312
1319
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1313
1320
|
]),
|
|
1314
1321
|
e("div", ts, [
|
|
1315
|
-
|
|
1316
|
-
(a(!0), p(me, null,
|
|
1322
|
+
se.value === "chat" ? (a(), p("div", ss, [
|
|
1323
|
+
(a(!0), p(me, null, he(d(h), (o) => (a(), p("div", {
|
|
1317
1324
|
key: o.id,
|
|
1318
1325
|
class: J([
|
|
1319
1326
|
"chat-list-item",
|
|
1320
1327
|
ne.value === o.id ? "chat-list-item-active" : ""
|
|
1321
1328
|
]),
|
|
1322
|
-
onClick: (
|
|
1323
|
-
onContextmenu: Be((
|
|
1329
|
+
onClick: (ge) => Te(o),
|
|
1330
|
+
onContextmenu: Be((ge) => Ue(ge, o), ["prevent", "stop"])
|
|
1324
1331
|
}, [
|
|
1325
1332
|
e("div", ns, [
|
|
1326
1333
|
e("img", {
|
|
@@ -1333,7 +1340,7 @@ const gt = (x, t) => {
|
|
|
1333
1340
|
e("div", os, [
|
|
1334
1341
|
e("div", rs, [
|
|
1335
1342
|
e("span", cs, y(o.name), 1),
|
|
1336
|
-
e("span", ds, y(
|
|
1343
|
+
e("span", ds, y(d(Re)(o.lastTime)), 1)
|
|
1337
1344
|
]),
|
|
1338
1345
|
e("div", us, [
|
|
1339
1346
|
e("span", vs, y(o.lastMsg), 1),
|
|
@@ -1342,19 +1349,19 @@ const gt = (x, t) => {
|
|
|
1342
1349
|
])
|
|
1343
1350
|
], 42, as))), 128))
|
|
1344
1351
|
])) : S("", !0),
|
|
1345
|
-
|
|
1346
|
-
e("div",
|
|
1352
|
+
se.value === "friends" && x.config.modules.friends ? (a(), p("div", ms, [
|
|
1353
|
+
e("div", hs, [
|
|
1347
1354
|
e("div", {
|
|
1348
1355
|
class: "add-friend-btn",
|
|
1349
|
-
onClick: r[2] || (r[2] = (...o) =>
|
|
1356
|
+
onClick: r[2] || (r[2] = (...o) => d(P) && d(P)(...o))
|
|
1350
1357
|
}, [
|
|
1351
|
-
e("div",
|
|
1358
|
+
e("div", fs, [
|
|
1352
1359
|
m(u, {
|
|
1353
1360
|
class: "text-white",
|
|
1354
1361
|
size: 20
|
|
1355
1362
|
}, {
|
|
1356
1363
|
default: k(() => [
|
|
1357
|
-
m(
|
|
1364
|
+
m(d(zt))
|
|
1358
1365
|
]),
|
|
1359
1366
|
_: 1
|
|
1360
1367
|
})
|
|
@@ -1362,10 +1369,10 @@ const gt = (x, t) => {
|
|
|
1362
1369
|
r[14] || (r[14] = e("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
1363
1370
|
])
|
|
1364
1371
|
]),
|
|
1365
|
-
(a(!0), p(me, null,
|
|
1372
|
+
(a(!0), p(me, null, he(d(ve), (o) => (a(), p("div", {
|
|
1366
1373
|
key: o.id,
|
|
1367
1374
|
class: "chat-list-item",
|
|
1368
|
-
onClick: (
|
|
1375
|
+
onClick: (ge) => tt(o)
|
|
1369
1376
|
}, [
|
|
1370
1377
|
e("div", ys, [
|
|
1371
1378
|
e("img", {
|
|
@@ -1385,14 +1392,14 @@ const gt = (x, t) => {
|
|
|
1385
1392
|
])
|
|
1386
1393
|
], 8, gs))), 128))
|
|
1387
1394
|
])) : S("", !0),
|
|
1388
|
-
|
|
1389
|
-
|
|
1395
|
+
se.value === "apply" && x.config.modules.apply ? (a(), p("div", ws, [
|
|
1396
|
+
d(Se) ? (a(), G(b, {
|
|
1390
1397
|
key: 0,
|
|
1391
1398
|
description: "加载中..."
|
|
1392
|
-
})) :
|
|
1399
|
+
})) : d(xe).length === 0 ? (a(), G(b, {
|
|
1393
1400
|
key: 1,
|
|
1394
1401
|
description: "暂无好友申请"
|
|
1395
|
-
})) : (a(!0), p(me, { key: 2 },
|
|
1402
|
+
})) : (a(!0), p(me, { key: 2 }, he(d(xe), (o) => (a(), p("div", {
|
|
1396
1403
|
key: o.applyUser || o.id,
|
|
1397
1404
|
class: "friend-request-item"
|
|
1398
1405
|
}, [
|
|
@@ -1410,7 +1417,7 @@ const gt = (x, t) => {
|
|
|
1410
1417
|
m(T, {
|
|
1411
1418
|
type: "primary",
|
|
1412
1419
|
size: "small",
|
|
1413
|
-
onClick: (
|
|
1420
|
+
onClick: (ge) => d(te)(o.applyUser)
|
|
1414
1421
|
}, {
|
|
1415
1422
|
default: k(() => [...r[16] || (r[16] = [
|
|
1416
1423
|
ue("同意", -1)
|
|
@@ -1447,7 +1454,7 @@ const gt = (x, t) => {
|
|
|
1447
1454
|
default: k(() => [
|
|
1448
1455
|
m(u, null, {
|
|
1449
1456
|
default: k(() => [
|
|
1450
|
-
m(
|
|
1457
|
+
m(d(Ye))
|
|
1451
1458
|
]),
|
|
1452
1459
|
_: 1
|
|
1453
1460
|
}),
|
|
@@ -1470,7 +1477,7 @@ const gt = (x, t) => {
|
|
|
1470
1477
|
e("div", Ts, [
|
|
1471
1478
|
m(u, { class: "chat-action-icon" }, {
|
|
1472
1479
|
default: k(() => [
|
|
1473
|
-
m(
|
|
1480
|
+
m(d(qe))
|
|
1474
1481
|
]),
|
|
1475
1482
|
_: 1
|
|
1476
1483
|
}),
|
|
@@ -1479,7 +1486,7 @@ const gt = (x, t) => {
|
|
|
1479
1486
|
onClick: r[3] || (r[3] = (o) => ie.value = !ie.value)
|
|
1480
1487
|
}, {
|
|
1481
1488
|
default: k(() => [
|
|
1482
|
-
m(
|
|
1489
|
+
m(d(At))
|
|
1483
1490
|
]),
|
|
1484
1491
|
_: 1
|
|
1485
1492
|
})
|
|
@@ -1490,8 +1497,8 @@ const gt = (x, t) => {
|
|
|
1490
1497
|
ref: A,
|
|
1491
1498
|
class: "chat-messages-container"
|
|
1492
1499
|
}, [
|
|
1493
|
-
(a(!0), p(me, null,
|
|
1494
|
-
key:
|
|
1500
|
+
(a(!0), p(me, null, he(d(ye), (o, ge) => (a(), p("div", {
|
|
1501
|
+
key: ge,
|
|
1495
1502
|
class: J([
|
|
1496
1503
|
"message-wrapper",
|
|
1497
1504
|
o.isSelf ? "message-self" : "message-other"
|
|
@@ -1499,7 +1506,7 @@ const gt = (x, t) => {
|
|
|
1499
1506
|
}, [
|
|
1500
1507
|
e("div", Es, [
|
|
1501
1508
|
e("img", {
|
|
1502
|
-
src: o.isSelf ?
|
|
1509
|
+
src: o.isSelf ? d(ee) : D.value.avatar,
|
|
1503
1510
|
class: "message-avatar-img"
|
|
1504
1511
|
}, null, 8, Ds)
|
|
1505
1512
|
]),
|
|
@@ -1546,7 +1553,7 @@ const gt = (x, t) => {
|
|
|
1546
1553
|
e("div", Ns, [
|
|
1547
1554
|
m(u, { size: 28 }, {
|
|
1548
1555
|
default: k(() => [
|
|
1549
|
-
m(
|
|
1556
|
+
m(d(Vt))
|
|
1550
1557
|
]),
|
|
1551
1558
|
_: 1
|
|
1552
1559
|
})
|
|
@@ -1556,7 +1563,7 @@ const gt = (x, t) => {
|
|
|
1556
1563
|
e("div", Os, [
|
|
1557
1564
|
m(u, { size: 12 }, {
|
|
1558
1565
|
default: k(() => [
|
|
1559
|
-
m(
|
|
1566
|
+
m(d(Ft))
|
|
1560
1567
|
]),
|
|
1561
1568
|
_: 1
|
|
1562
1569
|
}),
|
|
@@ -1571,14 +1578,14 @@ const gt = (x, t) => {
|
|
|
1571
1578
|
"message-time",
|
|
1572
1579
|
o.isSelf ? "message-time-right" : "message-time-left"
|
|
1573
1580
|
])
|
|
1574
|
-
}, y(
|
|
1581
|
+
}, y(d(Fe)(o.time)), 3)
|
|
1575
1582
|
])
|
|
1576
1583
|
], 2)
|
|
1577
1584
|
], 2))), 128))
|
|
1578
1585
|
], 512),
|
|
1579
1586
|
e("div", Js, [
|
|
1580
1587
|
j.value.length > 0 ? (a(), p("div", Qs, [
|
|
1581
|
-
(a(!0), p(me, null,
|
|
1588
|
+
(a(!0), p(me, null, he(j.value, (o, ge) => (a(), p("div", {
|
|
1582
1589
|
key: o.id,
|
|
1583
1590
|
class: "pending-file-item"
|
|
1584
1591
|
}, [
|
|
@@ -1589,19 +1596,19 @@ const gt = (x, t) => {
|
|
|
1589
1596
|
class: "pending-image"
|
|
1590
1597
|
}, null, 8, ea),
|
|
1591
1598
|
e("button", {
|
|
1592
|
-
onClick: (l) => Ke(
|
|
1599
|
+
onClick: (l) => Ke(ge),
|
|
1593
1600
|
class: "pending-file-remove-btn"
|
|
1594
1601
|
}, " × ", 8, ta)
|
|
1595
1602
|
])) : (a(), p("div", sa, [
|
|
1596
1603
|
m(u, { class: "pending-file-icon" }, {
|
|
1597
1604
|
default: k(() => [
|
|
1598
|
-
m(
|
|
1605
|
+
m(d(Ze))
|
|
1599
1606
|
]),
|
|
1600
1607
|
_: 1
|
|
1601
1608
|
}),
|
|
1602
1609
|
e("span", aa, y(o.name), 1),
|
|
1603
1610
|
e("button", {
|
|
1604
|
-
onClick: (l) => Ke(
|
|
1611
|
+
onClick: (l) => Ke(ge),
|
|
1605
1612
|
class: "pending-file-remove-btn"
|
|
1606
1613
|
}, " × ", 8, na)
|
|
1607
1614
|
]))
|
|
@@ -1610,7 +1617,7 @@ const gt = (x, t) => {
|
|
|
1610
1617
|
x.config.modules.fileUpload ? (a(), p("div", ia, [
|
|
1611
1618
|
m(u, { class: "input-toolbar-icon" }, {
|
|
1612
1619
|
default: k(() => [
|
|
1613
|
-
m(
|
|
1620
|
+
m(d(Ye))
|
|
1614
1621
|
]),
|
|
1615
1622
|
_: 1
|
|
1616
1623
|
}),
|
|
@@ -1619,33 +1626,33 @@ const gt = (x, t) => {
|
|
|
1619
1626
|
onClick: it
|
|
1620
1627
|
}, {
|
|
1621
1628
|
default: k(() => [
|
|
1622
|
-
m(
|
|
1629
|
+
m(d(Ze))
|
|
1623
1630
|
]),
|
|
1624
1631
|
_: 1
|
|
1625
1632
|
}),
|
|
1626
1633
|
m(u, { class: "input-toolbar-icon" }, {
|
|
1627
1634
|
default: k(() => [
|
|
1628
|
-
m(
|
|
1635
|
+
m(d(It))
|
|
1629
1636
|
]),
|
|
1630
1637
|
_: 1
|
|
1631
1638
|
})
|
|
1632
1639
|
])) : S("", !0),
|
|
1633
1640
|
e("div", la, [
|
|
1634
|
-
|
|
1641
|
+
Ct(e("textarea", {
|
|
1635
1642
|
"onUpdate:modelValue": r[4] || (r[4] = (o) => Ie(U) ? U.value = o : null),
|
|
1636
|
-
onKeydown:
|
|
1643
|
+
onKeydown: xt(Be(Pe, ["prevent"]), ["enter"]),
|
|
1637
1644
|
onPaste: ot,
|
|
1638
1645
|
placeholder: "输入消息或粘贴文件...",
|
|
1639
1646
|
class: "message-input-textarea",
|
|
1640
1647
|
rows: "3"
|
|
1641
1648
|
}, null, 40, oa), [
|
|
1642
|
-
[
|
|
1649
|
+
[Ut, d(U)]
|
|
1643
1650
|
])
|
|
1644
1651
|
]),
|
|
1645
1652
|
e("div", ra, [
|
|
1646
1653
|
m(T, {
|
|
1647
1654
|
type: "primary",
|
|
1648
|
-
disabled: !
|
|
1655
|
+
disabled: !d(U).trim() && j.value.length === 0,
|
|
1649
1656
|
onClick: Pe,
|
|
1650
1657
|
class: "send-message-btn"
|
|
1651
1658
|
}, {
|
|
@@ -1670,11 +1677,11 @@ const gt = (x, t) => {
|
|
|
1670
1677
|
class: "empty-state-icon"
|
|
1671
1678
|
}, {
|
|
1672
1679
|
default: k(() => [
|
|
1673
|
-
m(
|
|
1680
|
+
m(d(Rt))
|
|
1674
1681
|
]),
|
|
1675
1682
|
_: 1
|
|
1676
1683
|
}),
|
|
1677
|
-
e("div", da, y(
|
|
1684
|
+
e("div", da, y(se.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
1678
1685
|
]))
|
|
1679
1686
|
]),
|
|
1680
1687
|
ie.value ? (a(), p("div", ua, [
|
|
@@ -1686,7 +1693,7 @@ const gt = (x, t) => {
|
|
|
1686
1693
|
alt: (He = D.value) == null ? void 0 : He.name,
|
|
1687
1694
|
class: "chat-detail-avatar"
|
|
1688
1695
|
}, null, 8, ma),
|
|
1689
|
-
e("div",
|
|
1696
|
+
e("div", ha, y((Ee = D.value) == null ? void 0 : Ee.name), 1),
|
|
1690
1697
|
r[20] || (r[20] = e("div", { class: "chat-detail-actions" }, [
|
|
1691
1698
|
e("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
|
|
1692
1699
|
e("div", { class: "chat-detail-action-item" }, "清空聊天记录")
|
|
@@ -1695,30 +1702,30 @@ const gt = (x, t) => {
|
|
|
1695
1702
|
])
|
|
1696
1703
|
])) : S("", !0),
|
|
1697
1704
|
m(re, {
|
|
1698
|
-
modelValue:
|
|
1705
|
+
modelValue: d(C),
|
|
1699
1706
|
"onUpdate:modelValue": r[6] || (r[6] = (o) => Ie(C) ? C.value = o : null),
|
|
1700
1707
|
title: "添加好友",
|
|
1701
1708
|
width: "500px",
|
|
1702
1709
|
"append-to-body": ""
|
|
1703
1710
|
}, {
|
|
1704
1711
|
default: k(() => [
|
|
1705
|
-
e("div",
|
|
1712
|
+
e("div", fa, [
|
|
1706
1713
|
m(s, {
|
|
1707
|
-
modelValue:
|
|
1708
|
-
"onUpdate:modelValue": r[5] || (r[5] = (o) => Ie(
|
|
1714
|
+
modelValue: d(fe),
|
|
1715
|
+
"onUpdate:modelValue": r[5] || (r[5] = (o) => Ie(fe) ? fe.value = o : null),
|
|
1709
1716
|
placeholder: "搜索用户",
|
|
1710
|
-
"prefix-icon":
|
|
1717
|
+
"prefix-icon": d(qe),
|
|
1711
1718
|
class: "add-friend-search-input"
|
|
1712
1719
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1713
1720
|
]),
|
|
1714
1721
|
e("div", ga, [
|
|
1715
|
-
|
|
1722
|
+
d(Ve) ? (a(), G(b, {
|
|
1716
1723
|
key: 0,
|
|
1717
1724
|
description: "加载中..."
|
|
1718
|
-
})) :
|
|
1725
|
+
})) : d(ce).length === 0 ? (a(), G(b, {
|
|
1719
1726
|
key: 1,
|
|
1720
1727
|
description: "暂无用户"
|
|
1721
|
-
})) : (a(!0), p(me, { key: 2 },
|
|
1728
|
+
})) : (a(!0), p(me, { key: 2 }, he(d(ce), (o) => (a(), p("div", {
|
|
1722
1729
|
key: o.username,
|
|
1723
1730
|
class: "add-friend-user-item"
|
|
1724
1731
|
}, [
|
|
@@ -1733,7 +1740,7 @@ const gt = (x, t) => {
|
|
|
1733
1740
|
m(T, {
|
|
1734
1741
|
type: "primary",
|
|
1735
1742
|
size: "small",
|
|
1736
|
-
onClick: (
|
|
1743
|
+
onClick: (ge) => d(L)(o)
|
|
1737
1744
|
}, {
|
|
1738
1745
|
default: k(() => [...r[22] || (r[22] = [
|
|
1739
1746
|
ue("添加", -1)
|
|
@@ -1759,7 +1766,7 @@ const gt = (x, t) => {
|
|
|
1759
1766
|
e("div", wa, [
|
|
1760
1767
|
e("div", Ca, [
|
|
1761
1768
|
e("img", {
|
|
1762
|
-
src:
|
|
1769
|
+
src: d(ee),
|
|
1763
1770
|
alt: "头像",
|
|
1764
1771
|
class: "chat-settings-avatar"
|
|
1765
1772
|
}, null, 8, xa),
|
|
@@ -1773,7 +1780,7 @@ const gt = (x, t) => {
|
|
|
1773
1780
|
class: "chat-settings-avatar-icon"
|
|
1774
1781
|
}, {
|
|
1775
1782
|
default: k(() => [
|
|
1776
|
-
m(
|
|
1783
|
+
m(d(Mt))
|
|
1777
1784
|
]),
|
|
1778
1785
|
_: 1
|
|
1779
1786
|
})
|
|
@@ -1788,8 +1795,8 @@ const gt = (x, t) => {
|
|
|
1788
1795
|
}, null, 544)
|
|
1789
1796
|
]),
|
|
1790
1797
|
e("div", Ua, [
|
|
1791
|
-
e("div", $a, y(
|
|
1792
|
-
e("div", Sa, "@" + y(
|
|
1798
|
+
e("div", $a, y(d(H).nickname || d($)), 1),
|
|
1799
|
+
e("div", Sa, "@" + y(d($)), 1)
|
|
1793
1800
|
])
|
|
1794
1801
|
]),
|
|
1795
1802
|
e("div", za, [
|
|
@@ -1797,7 +1804,7 @@ const gt = (x, t) => {
|
|
|
1797
1804
|
e("div", Va, [
|
|
1798
1805
|
m(u, null, {
|
|
1799
1806
|
default: k(() => [
|
|
1800
|
-
m(
|
|
1807
|
+
m(d(Qe))
|
|
1801
1808
|
]),
|
|
1802
1809
|
_: 1
|
|
1803
1810
|
}),
|
|
@@ -1825,7 +1832,7 @@ const gt = (x, t) => {
|
|
|
1825
1832
|
"onUpdate:modelValue": r[7] || (r[7] = (o) => K.value.nickname = o),
|
|
1826
1833
|
placeholder: "请输入昵称",
|
|
1827
1834
|
size: "large"
|
|
1828
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Ra, y(
|
|
1835
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ra, y(d(H).nickname || "未设置"), 1))
|
|
1829
1836
|
]),
|
|
1830
1837
|
e("div", Ma, [
|
|
1831
1838
|
r[26] || (r[26] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
|
|
@@ -1835,7 +1842,7 @@ const gt = (x, t) => {
|
|
|
1835
1842
|
"onUpdate:modelValue": r[8] || (r[8] = (o) => K.value.email = o),
|
|
1836
1843
|
placeholder: "请输入邮箱",
|
|
1837
1844
|
size: "large"
|
|
1838
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", La, y(
|
|
1845
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", La, y(d(H).email || "未设置"), 1))
|
|
1839
1846
|
]),
|
|
1840
1847
|
e("div", Ta, [
|
|
1841
1848
|
r[27] || (r[27] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
|
|
@@ -1845,7 +1852,7 @@ const gt = (x, t) => {
|
|
|
1845
1852
|
"onUpdate:modelValue": r[9] || (r[9] = (o) => K.value.phone = o),
|
|
1846
1853
|
placeholder: "请输入手机号",
|
|
1847
1854
|
size: "large"
|
|
1848
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Ea, y(
|
|
1855
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ea, y(d(H).phone || "未设置"), 1))
|
|
1849
1856
|
]),
|
|
1850
1857
|
e("div", Da, [
|
|
1851
1858
|
r[28] || (r[28] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
|
|
@@ -1857,7 +1864,7 @@ const gt = (x, t) => {
|
|
|
1857
1864
|
rows: 4,
|
|
1858
1865
|
placeholder: "介绍一下自己吧...",
|
|
1859
1866
|
size: "large"
|
|
1860
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(
|
|
1867
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(d(H).bio || "这个人很懒,什么都没写~"), 1))
|
|
1861
1868
|
]),
|
|
1862
1869
|
le.value ? (a(), p("div", Ha, [
|
|
1863
1870
|
m(T, {
|
|
@@ -1915,7 +1922,7 @@ const gt = (x, t) => {
|
|
|
1915
1922
|
}, sn = { class: "friend-info" }, an = { class: "friend-header" }, nn = { class: "friend-name" }, ln = { class: "last-time" }, on = { class: "friend-preview" }, rn = { class: "last-msg" }, cn = {
|
|
1916
1923
|
key: 0,
|
|
1917
1924
|
class: "unread-badge"
|
|
1918
|
-
}, dn = { key: 1 }, un = { class: "add-friend-section" }, vn = { class: "add-friend-icon" }, pn = ["onClick"], mn = { class: "friend-avatar-wrapper" },
|
|
1925
|
+
}, dn = { key: 1 }, un = { class: "add-friend-section" }, vn = { class: "add-friend-icon" }, pn = ["onClick"], mn = { class: "friend-avatar-wrapper" }, hn = ["src", "alt"], fn = { class: "friend-info" }, gn = { class: "friend-name" }, yn = { key: 2 }, _n = { class: "request-info" }, bn = ["src", "alt"], kn = { class: "request-details" }, wn = { class: "request-username" }, Cn = { class: "chat-area" }, xn = {
|
|
1919
1926
|
key: 0,
|
|
1920
1927
|
class: "friend-profile"
|
|
1921
1928
|
}, Un = ["src", "alt"], $n = { class: "profile-name" }, Sn = { class: "profile-status" }, zn = {
|
|
@@ -1945,7 +1952,7 @@ const gt = (x, t) => {
|
|
|
1945
1952
|
}, li = { class: "empty-text" }, oi = {
|
|
1946
1953
|
key: 0,
|
|
1947
1954
|
class: "detail-panel"
|
|
1948
|
-
}, ri = { class: "detail-content" }, ci = { class: "detail-profile" }, di = ["src", "alt"], ui = { class: "detail-name" }, vi = { class: "search-users-wrapper" }, pi = { class: "search-users-input" }, mi = { class: "users-list-scroll" },
|
|
1955
|
+
}, ri = { class: "detail-content" }, ci = { class: "detail-profile" }, di = ["src", "alt"], ui = { class: "detail-name" }, vi = { class: "search-users-wrapper" }, pi = { class: "search-users-input" }, mi = { class: "users-list-scroll" }, hi = { class: "available-user-info" }, fi = ["src", "alt"], gi = { class: "available-user-name" }, yi = { class: "settings-container" }, _i = { class: "settings-avatar-section" }, bi = { class: "settings-avatar-wrapper" }, ki = ["src"], wi = { class: "settings-user-display" }, Ci = { class: "settings-nickname" }, xi = { class: "settings-username" }, Ui = { class: "settings-form-section" }, $i = { class: "settings-form-header" }, Si = { class: "settings-form-title" }, zi = { class: "settings-form" }, Ai = { class: "settings-form-item" }, Vi = {
|
|
1949
1956
|
key: 1,
|
|
1950
1957
|
class: "settings-form-value"
|
|
1951
1958
|
}, Fi = { class: "settings-form-item" }, Ii = {
|
|
@@ -1981,12 +1988,12 @@ const gt = (x, t) => {
|
|
|
1981
1988
|
filteredFriendList: V,
|
|
1982
1989
|
searchText: U,
|
|
1983
1990
|
inputText: A,
|
|
1984
|
-
messagesContainer:
|
|
1991
|
+
messagesContainer: h,
|
|
1985
1992
|
filteredUsers: ce,
|
|
1986
1993
|
filteredAvailableUsers: Ae,
|
|
1987
|
-
currentUser:
|
|
1994
|
+
currentUser: ye,
|
|
1988
1995
|
currentMessages: C,
|
|
1989
|
-
addFriendDialogVisible:
|
|
1996
|
+
addFriendDialogVisible: fe,
|
|
1990
1997
|
addFriendSearchText: Ce,
|
|
1991
1998
|
availableUsers: Ve,
|
|
1992
1999
|
loadingAvailableUsers: xe,
|
|
@@ -2008,15 +2015,15 @@ const gt = (x, t) => {
|
|
|
2008
2015
|
openAddFriendDialog: L,
|
|
2009
2016
|
addFriend: q,
|
|
2010
2017
|
loadFriendApplyList: te,
|
|
2011
|
-
agreeFriend:
|
|
2018
|
+
agreeFriend: ae,
|
|
2012
2019
|
updateMyAvatar: de,
|
|
2013
2020
|
getUserInfo: pe,
|
|
2014
2021
|
updateUserInfo: B
|
|
2015
|
-
} =
|
|
2022
|
+
} = Tt(n.config), se = we(() => {
|
|
2016
2023
|
var s;
|
|
2017
2024
|
const u = [{ id: "chat", icon: Ye, badge: 0 }];
|
|
2018
|
-
return n.config.modules.friends && u.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && u.push({ id: "apply", icon:
|
|
2019
|
-
}), ne = _("chat"), D = _(null), W = _(null), ie = _(null), le = _(!1), K = _(!1), oe = _({ nickname: "", email: "", phone: "", bio: "" }), ze = _(!1), i = _(!1),
|
|
2025
|
+
return n.config.modules.friends && u.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && u.push({ id: "apply", icon: $t, badge: ((s = Se.value) == null ? void 0 : s.length) || 0 }), u;
|
|
2026
|
+
}), ne = _("chat"), D = _(null), W = _(null), ie = _(null), le = _(!1), K = _(!1), oe = _({ nickname: "", email: "", phone: "", bio: "" }), ze = _(!1), i = _(!1), c = _(!1), g = _(!1), F = _(null), _e = _(""), j = _(null), O = _([]), Ue = _({ visible: !1, x: 0, y: 0, chat: null }), Le = () => {
|
|
2020
2027
|
Ue.value.visible = !1;
|
|
2021
2028
|
}, et = async () => {
|
|
2022
2029
|
if (!Ue.value.chat) return;
|
|
@@ -2125,13 +2132,13 @@ const gt = (x, t) => {
|
|
|
2125
2132
|
}
|
|
2126
2133
|
const b = new FileReader();
|
|
2127
2134
|
b.onload = (T) => {
|
|
2128
|
-
_e.value = T.target.result,
|
|
2135
|
+
_e.value = T.target.result, c.value = !0;
|
|
2129
2136
|
}, b.readAsDataURL(s);
|
|
2130
2137
|
}, dt = async ({ file: u }) => {
|
|
2131
2138
|
if (u) {
|
|
2132
2139
|
g.value = !0;
|
|
2133
2140
|
try {
|
|
2134
|
-
const { ChatApi: s } = await Promise.resolve().then(() =>
|
|
2141
|
+
const { ChatApi: s } = await Promise.resolve().then(() => Lt), T = await new s(n.config).uploadAvatar(u, ee);
|
|
2135
2142
|
T.code === 200 ? (Q.success("头像上传成功"), de(T.data), Ge()) : Q.error(T.msg || "头像上传失败");
|
|
2136
2143
|
} catch (s) {
|
|
2137
2144
|
console.error(s), Q.error("头像上传失败");
|
|
@@ -2140,7 +2147,7 @@ const gt = (x, t) => {
|
|
|
2140
2147
|
}
|
|
2141
2148
|
}
|
|
2142
2149
|
}, Ge = () => {
|
|
2143
|
-
_e.value = "",
|
|
2150
|
+
_e.value = "", c.value = !1, F.value && (F.value.value = "");
|
|
2144
2151
|
}, ut = () => {
|
|
2145
2152
|
oe.value = {
|
|
2146
2153
|
nickname: Z.value.nickname || "",
|
|
@@ -2159,14 +2166,14 @@ const gt = (x, t) => {
|
|
|
2159
2166
|
} finally {
|
|
2160
2167
|
ze.value = !1;
|
|
2161
2168
|
}
|
|
2162
|
-
},
|
|
2169
|
+
}, f = () => {
|
|
2163
2170
|
P(), N(), le.value = !1, i.value = !1, Ge(), K.value = !1, v("close");
|
|
2164
2171
|
}, r = async () => {
|
|
2165
2172
|
await Promise.all([Me(), te(), pe()]), E(), ce.value.length > 0 && Te(ce.value[0]), v("open");
|
|
2166
2173
|
};
|
|
2167
|
-
return
|
|
2174
|
+
return bt(() => {
|
|
2168
2175
|
document.addEventListener("click", Le);
|
|
2169
|
-
}),
|
|
2176
|
+
}), kt(() => {
|
|
2170
2177
|
document.removeEventListener("click", Le), N();
|
|
2171
2178
|
}), (u, s) => {
|
|
2172
2179
|
const b = be("el-icon"), T = be("el-input"), re = be("el-empty"), ke = be("el-button"), He = be("el-dialog");
|
|
@@ -2177,11 +2184,11 @@ const gt = (x, t) => {
|
|
|
2177
2184
|
"close-on-click-modal": !1,
|
|
2178
2185
|
class: "chat-dialog",
|
|
2179
2186
|
"append-to-body": "",
|
|
2180
|
-
onClosed:
|
|
2187
|
+
onClosed: f,
|
|
2181
2188
|
onOpen: r
|
|
2182
2189
|
}, {
|
|
2183
2190
|
default: k(() => {
|
|
2184
|
-
var Ee, o,
|
|
2191
|
+
var Ee, o, ge;
|
|
2185
2192
|
return [
|
|
2186
2193
|
e("div", qa, [
|
|
2187
2194
|
e("div", Ba, [
|
|
@@ -2190,12 +2197,12 @@ const gt = (x, t) => {
|
|
|
2190
2197
|
onClick: at
|
|
2191
2198
|
}, [
|
|
2192
2199
|
e("img", {
|
|
2193
|
-
src:
|
|
2200
|
+
src: d(H),
|
|
2194
2201
|
alt: "头像",
|
|
2195
2202
|
class: "avatar-img"
|
|
2196
2203
|
}, null, 8, Ka)
|
|
2197
2204
|
]),
|
|
2198
|
-
(a(!0), p(me, null,
|
|
2205
|
+
(a(!0), p(me, null, he(se.value, (l) => (a(), p("div", {
|
|
2199
2206
|
key: l.id,
|
|
2200
2207
|
class: J([
|
|
2201
2208
|
"nav-item",
|
|
@@ -2205,7 +2212,7 @@ const gt = (x, t) => {
|
|
|
2205
2212
|
}, [
|
|
2206
2213
|
m(b, { size: 24 }, {
|
|
2207
2214
|
default: k(() => [
|
|
2208
|
-
(a(), G(
|
|
2215
|
+
(a(), G(wt(l.icon)))
|
|
2209
2216
|
]),
|
|
2210
2217
|
_: 2
|
|
2211
2218
|
}, 1024),
|
|
@@ -2220,7 +2227,7 @@ const gt = (x, t) => {
|
|
|
2220
2227
|
}, [
|
|
2221
2228
|
m(b, { size: 24 }, {
|
|
2222
2229
|
default: k(() => [
|
|
2223
|
-
m(
|
|
2230
|
+
m(d(St))
|
|
2224
2231
|
]),
|
|
2225
2232
|
_: 1
|
|
2226
2233
|
})
|
|
@@ -2229,15 +2236,15 @@ const gt = (x, t) => {
|
|
|
2229
2236
|
e("div", ja, [
|
|
2230
2237
|
e("div", Oa, [
|
|
2231
2238
|
m(T, {
|
|
2232
|
-
modelValue:
|
|
2239
|
+
modelValue: d(U),
|
|
2233
2240
|
"onUpdate:modelValue": s[1] || (s[1] = (l) => Ie(U) ? U.value = l : null),
|
|
2234
2241
|
placeholder: "搜索",
|
|
2235
|
-
"prefix-icon":
|
|
2242
|
+
"prefix-icon": d(qe)
|
|
2236
2243
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2237
2244
|
]),
|
|
2238
2245
|
e("div", Ga, [
|
|
2239
2246
|
ne.value === "chat" ? (a(), p("div", Ja, [
|
|
2240
|
-
(a(!0), p(me, null,
|
|
2247
|
+
(a(!0), p(me, null, he(d(ce), (l) => (a(), p("div", {
|
|
2241
2248
|
key: l.id,
|
|
2242
2249
|
class: J([
|
|
2243
2250
|
"chat-item",
|
|
@@ -2257,7 +2264,7 @@ const gt = (x, t) => {
|
|
|
2257
2264
|
e("div", sn, [
|
|
2258
2265
|
e("div", an, [
|
|
2259
2266
|
e("span", nn, y(l.name), 1),
|
|
2260
|
-
e("span", ln, y(
|
|
2267
|
+
e("span", ln, y(d(De)(l.lastTime)), 1)
|
|
2261
2268
|
]),
|
|
2262
2269
|
e("div", on, [
|
|
2263
2270
|
e("span", rn, y(l.lastMsg), 1),
|
|
@@ -2270,7 +2277,7 @@ const gt = (x, t) => {
|
|
|
2270
2277
|
e("div", un, [
|
|
2271
2278
|
e("div", {
|
|
2272
2279
|
class: "add-friend-btn",
|
|
2273
|
-
onClick: s[2] || (s[2] = (...l) =>
|
|
2280
|
+
onClick: s[2] || (s[2] = (...l) => d(L) && d(L)(...l))
|
|
2274
2281
|
}, [
|
|
2275
2282
|
e("div", vn, [
|
|
2276
2283
|
m(b, {
|
|
@@ -2278,7 +2285,7 @@ const gt = (x, t) => {
|
|
|
2278
2285
|
size: 20
|
|
2279
2286
|
}, {
|
|
2280
2287
|
default: k(() => [
|
|
2281
|
-
m(
|
|
2288
|
+
m(d(zt))
|
|
2282
2289
|
]),
|
|
2283
2290
|
_: 1
|
|
2284
2291
|
})
|
|
@@ -2286,7 +2293,7 @@ const gt = (x, t) => {
|
|
|
2286
2293
|
s[15] || (s[15] = e("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
2287
2294
|
])
|
|
2288
2295
|
]),
|
|
2289
|
-
(a(!0), p(me, null,
|
|
2296
|
+
(a(!0), p(me, null, he(d(V), (l) => (a(), p("div", {
|
|
2290
2297
|
key: l.id,
|
|
2291
2298
|
class: "chat-item",
|
|
2292
2299
|
onClick: ($e) => tt(l)
|
|
@@ -2296,7 +2303,7 @@ const gt = (x, t) => {
|
|
|
2296
2303
|
src: l.avatar,
|
|
2297
2304
|
alt: l.name,
|
|
2298
2305
|
class: "friend-avatar"
|
|
2299
|
-
}, null, 8,
|
|
2306
|
+
}, null, 8, hn),
|
|
2300
2307
|
e("span", {
|
|
2301
2308
|
class: J([
|
|
2302
2309
|
"online-indicator",
|
|
@@ -2304,19 +2311,19 @@ const gt = (x, t) => {
|
|
|
2304
2311
|
])
|
|
2305
2312
|
}, null, 2)
|
|
2306
2313
|
]),
|
|
2307
|
-
e("div",
|
|
2314
|
+
e("div", fn, [
|
|
2308
2315
|
e("span", gn, y(l.name), 1)
|
|
2309
2316
|
])
|
|
2310
2317
|
], 8, pn))), 128))
|
|
2311
2318
|
])) : S("", !0),
|
|
2312
2319
|
ne.value === "apply" && x.config.modules.apply ? (a(), p("div", yn, [
|
|
2313
|
-
|
|
2320
|
+
d(Fe) ? (a(), G(re, {
|
|
2314
2321
|
key: 0,
|
|
2315
2322
|
description: "加载中..."
|
|
2316
|
-
})) :
|
|
2323
|
+
})) : d(Se).length === 0 ? (a(), G(re, {
|
|
2317
2324
|
key: 1,
|
|
2318
2325
|
description: "暂无好友申请"
|
|
2319
|
-
})) : (a(!0), p(me, { key: 2 },
|
|
2326
|
+
})) : (a(!0), p(me, { key: 2 }, he(d(Se), (l) => (a(), p("div", {
|
|
2320
2327
|
key: l.applyUser || l.id,
|
|
2321
2328
|
class: "friend-request-item"
|
|
2322
2329
|
}, [
|
|
@@ -2334,7 +2341,7 @@ const gt = (x, t) => {
|
|
|
2334
2341
|
m(ke, {
|
|
2335
2342
|
type: "primary",
|
|
2336
2343
|
size: "small",
|
|
2337
|
-
onClick: ($e) =>
|
|
2344
|
+
onClick: ($e) => d(ae)(l.applyUser)
|
|
2338
2345
|
}, {
|
|
2339
2346
|
default: k(() => [...s[17] || (s[17] = [
|
|
2340
2347
|
ue("同意", -1)
|
|
@@ -2371,7 +2378,7 @@ const gt = (x, t) => {
|
|
|
2371
2378
|
default: k(() => [
|
|
2372
2379
|
m(b, null, {
|
|
2373
2380
|
default: k(() => [
|
|
2374
|
-
m(
|
|
2381
|
+
m(d(Ye))
|
|
2375
2382
|
]),
|
|
2376
2383
|
_: 1
|
|
2377
2384
|
}),
|
|
@@ -2394,7 +2401,7 @@ const gt = (x, t) => {
|
|
|
2394
2401
|
e("div", In, [
|
|
2395
2402
|
m(b, { class: "action-icon" }, {
|
|
2396
2403
|
default: k(() => [
|
|
2397
|
-
m(
|
|
2404
|
+
m(d(qe))
|
|
2398
2405
|
]),
|
|
2399
2406
|
_: 1
|
|
2400
2407
|
}),
|
|
@@ -2403,7 +2410,7 @@ const gt = (x, t) => {
|
|
|
2403
2410
|
onClick: s[3] || (s[3] = (l) => le.value = !le.value)
|
|
2404
2411
|
}, {
|
|
2405
2412
|
default: k(() => [
|
|
2406
|
-
m(
|
|
2413
|
+
m(d(At))
|
|
2407
2414
|
]),
|
|
2408
2415
|
_: 1
|
|
2409
2416
|
})
|
|
@@ -2411,10 +2418,10 @@ const gt = (x, t) => {
|
|
|
2411
2418
|
]),
|
|
2412
2419
|
e("div", {
|
|
2413
2420
|
ref_key: "messagesContainer",
|
|
2414
|
-
ref:
|
|
2421
|
+
ref: h,
|
|
2415
2422
|
class: "messages-container"
|
|
2416
2423
|
}, [
|
|
2417
|
-
(a(!0), p(me, null,
|
|
2424
|
+
(a(!0), p(me, null, he(d(C), (l, $e) => (a(), p("div", {
|
|
2418
2425
|
key: $e,
|
|
2419
2426
|
class: J([
|
|
2420
2427
|
"message-wrapper",
|
|
@@ -2423,7 +2430,7 @@ const gt = (x, t) => {
|
|
|
2423
2430
|
}, [
|
|
2424
2431
|
e("div", Rn, [
|
|
2425
2432
|
e("img", {
|
|
2426
|
-
src: l.isSelf ?
|
|
2433
|
+
src: l.isSelf ? d(H) : W.value.avatar,
|
|
2427
2434
|
class: "avatar-sm"
|
|
2428
2435
|
}, null, 8, Mn)
|
|
2429
2436
|
]),
|
|
@@ -2470,7 +2477,7 @@ const gt = (x, t) => {
|
|
|
2470
2477
|
e("div", Yn, [
|
|
2471
2478
|
m(b, { size: 28 }, {
|
|
2472
2479
|
default: k(() => [
|
|
2473
|
-
m(
|
|
2480
|
+
m(d(Vt))
|
|
2474
2481
|
]),
|
|
2475
2482
|
_: 1
|
|
2476
2483
|
})
|
|
@@ -2480,7 +2487,7 @@ const gt = (x, t) => {
|
|
|
2480
2487
|
e("div", Kn, [
|
|
2481
2488
|
m(b, { size: 12 }, {
|
|
2482
2489
|
default: k(() => [
|
|
2483
|
-
m(
|
|
2490
|
+
m(d(Ft))
|
|
2484
2491
|
]),
|
|
2485
2492
|
_: 1
|
|
2486
2493
|
}),
|
|
@@ -2495,14 +2502,14 @@ const gt = (x, t) => {
|
|
|
2495
2502
|
"message-time",
|
|
2496
2503
|
l.isSelf ? "time-right" : "time-left"
|
|
2497
2504
|
])
|
|
2498
|
-
}, y(
|
|
2505
|
+
}, y(d(Re)(l.time)), 3)
|
|
2499
2506
|
])
|
|
2500
2507
|
], 2)
|
|
2501
2508
|
], 2))), 128))
|
|
2502
2509
|
], 512),
|
|
2503
2510
|
e("div", Pn, [
|
|
2504
2511
|
O.value.length > 0 ? (a(), p("div", jn, [
|
|
2505
|
-
(a(!0), p(me, null,
|
|
2512
|
+
(a(!0), p(me, null, he(O.value, (l, $e) => (a(), p("div", {
|
|
2506
2513
|
key: l.id,
|
|
2507
2514
|
class: "pending-file"
|
|
2508
2515
|
}, [
|
|
@@ -2519,7 +2526,7 @@ const gt = (x, t) => {
|
|
|
2519
2526
|
])) : (a(), p("div", Qn, [
|
|
2520
2527
|
m(b, { class: "pending-file-icon" }, {
|
|
2521
2528
|
default: k(() => [
|
|
2522
|
-
m(
|
|
2529
|
+
m(d(Ze))
|
|
2523
2530
|
]),
|
|
2524
2531
|
_: 1
|
|
2525
2532
|
}),
|
|
@@ -2534,7 +2541,7 @@ const gt = (x, t) => {
|
|
|
2534
2541
|
x.config.modules.fileUpload ? (a(), p("div", ti, [
|
|
2535
2542
|
m(b, { class: "action-icon" }, {
|
|
2536
2543
|
default: k(() => [
|
|
2537
|
-
m(
|
|
2544
|
+
m(d(Ye))
|
|
2538
2545
|
]),
|
|
2539
2546
|
_: 1
|
|
2540
2547
|
}),
|
|
@@ -2543,33 +2550,33 @@ const gt = (x, t) => {
|
|
|
2543
2550
|
onClick: it
|
|
2544
2551
|
}, {
|
|
2545
2552
|
default: k(() => [
|
|
2546
|
-
m(
|
|
2553
|
+
m(d(Ze))
|
|
2547
2554
|
]),
|
|
2548
2555
|
_: 1
|
|
2549
2556
|
}),
|
|
2550
2557
|
m(b, { class: "action-icon" }, {
|
|
2551
2558
|
default: k(() => [
|
|
2552
|
-
m(
|
|
2559
|
+
m(d(It))
|
|
2553
2560
|
]),
|
|
2554
2561
|
_: 1
|
|
2555
2562
|
})
|
|
2556
2563
|
])) : S("", !0),
|
|
2557
2564
|
e("div", si, [
|
|
2558
|
-
|
|
2565
|
+
Ct(e("textarea", {
|
|
2559
2566
|
"onUpdate:modelValue": s[4] || (s[4] = (l) => Ie(A) ? A.value = l : null),
|
|
2560
|
-
onKeydown:
|
|
2567
|
+
onKeydown: xt(Be(Pe, ["prevent"]), ["enter"]),
|
|
2561
2568
|
onPaste: ot,
|
|
2562
2569
|
placeholder: "输入消息或粘贴文件...",
|
|
2563
2570
|
class: "message-input",
|
|
2564
2571
|
rows: "3"
|
|
2565
2572
|
}, null, 40, ai), [
|
|
2566
|
-
[
|
|
2573
|
+
[Ut, d(A)]
|
|
2567
2574
|
])
|
|
2568
2575
|
]),
|
|
2569
2576
|
e("div", ni, [
|
|
2570
2577
|
m(ke, {
|
|
2571
2578
|
type: "primary",
|
|
2572
|
-
disabled: !
|
|
2579
|
+
disabled: !d(A).trim() && O.value.length === 0,
|
|
2573
2580
|
onClick: Pe,
|
|
2574
2581
|
class: "send-btn"
|
|
2575
2582
|
}, {
|
|
@@ -2594,7 +2601,7 @@ const gt = (x, t) => {
|
|
|
2594
2601
|
class: "empty-icon"
|
|
2595
2602
|
}, {
|
|
2596
2603
|
default: k(() => [
|
|
2597
|
-
m(
|
|
2604
|
+
m(d(Rt))
|
|
2598
2605
|
]),
|
|
2599
2606
|
_: 1
|
|
2600
2607
|
}),
|
|
@@ -2610,7 +2617,7 @@ const gt = (x, t) => {
|
|
|
2610
2617
|
alt: (o = W.value) == null ? void 0 : o.name,
|
|
2611
2618
|
class: "detail-avatar"
|
|
2612
2619
|
}, null, 8, di),
|
|
2613
|
-
e("div", ui, y((
|
|
2620
|
+
e("div", ui, y((ge = W.value) == null ? void 0 : ge.name), 1),
|
|
2614
2621
|
s[21] || (s[21] = e("div", { class: "detail-actions" }, [
|
|
2615
2622
|
e("div", { class: "detail-action-item" }, "查找聊天记录"),
|
|
2616
2623
|
e("div", { class: "detail-action-item" }, "清空聊天记录")
|
|
@@ -2620,8 +2627,8 @@ const gt = (x, t) => {
|
|
|
2620
2627
|
])) : S("", !0)
|
|
2621
2628
|
]),
|
|
2622
2629
|
m(He, {
|
|
2623
|
-
modelValue:
|
|
2624
|
-
"onUpdate:modelValue": s[6] || (s[6] = (l) => Ie(
|
|
2630
|
+
modelValue: d(fe),
|
|
2631
|
+
"onUpdate:modelValue": s[6] || (s[6] = (l) => Ie(fe) ? fe.value = l : null),
|
|
2625
2632
|
title: "添加好友",
|
|
2626
2633
|
width: "500px",
|
|
2627
2634
|
"append-to-body": ""
|
|
@@ -2630,36 +2637,36 @@ const gt = (x, t) => {
|
|
|
2630
2637
|
e("div", vi, [
|
|
2631
2638
|
e("div", pi, [
|
|
2632
2639
|
m(T, {
|
|
2633
|
-
modelValue:
|
|
2640
|
+
modelValue: d(Ce),
|
|
2634
2641
|
"onUpdate:modelValue": s[5] || (s[5] = (l) => Ie(Ce) ? Ce.value = l : null),
|
|
2635
2642
|
placeholder: "搜索用户",
|
|
2636
|
-
"prefix-icon":
|
|
2643
|
+
"prefix-icon": d(qe)
|
|
2637
2644
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2638
2645
|
])
|
|
2639
2646
|
]),
|
|
2640
2647
|
e("div", mi, [
|
|
2641
|
-
|
|
2648
|
+
d(xe) ? (a(), G(re, {
|
|
2642
2649
|
key: 0,
|
|
2643
2650
|
description: "加载中..."
|
|
2644
|
-
})) :
|
|
2651
|
+
})) : d(Ae).length === 0 ? (a(), G(re, {
|
|
2645
2652
|
key: 1,
|
|
2646
2653
|
description: "暂无用户"
|
|
2647
|
-
})) : (a(!0), p(me, { key: 2 },
|
|
2654
|
+
})) : (a(!0), p(me, { key: 2 }, he(d(Ae), (l) => (a(), p("div", {
|
|
2648
2655
|
key: l.username,
|
|
2649
2656
|
class: "available-user-item"
|
|
2650
2657
|
}, [
|
|
2651
|
-
e("div",
|
|
2658
|
+
e("div", hi, [
|
|
2652
2659
|
e("img", {
|
|
2653
2660
|
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.username}`,
|
|
2654
2661
|
alt: l.username,
|
|
2655
2662
|
class: "available-user-avatar"
|
|
2656
|
-
}, null, 8,
|
|
2663
|
+
}, null, 8, fi),
|
|
2657
2664
|
e("div", gi, y(l.username), 1)
|
|
2658
2665
|
]),
|
|
2659
2666
|
m(ke, {
|
|
2660
2667
|
type: "primary",
|
|
2661
2668
|
size: "small",
|
|
2662
|
-
onClick: ($e) =>
|
|
2669
|
+
onClick: ($e) => d(q)(l)
|
|
2663
2670
|
}, {
|
|
2664
2671
|
default: k(() => [...s[23] || (s[23] = [
|
|
2665
2672
|
ue("添加", -1)
|
|
@@ -2685,7 +2692,7 @@ const gt = (x, t) => {
|
|
|
2685
2692
|
e("div", _i, [
|
|
2686
2693
|
e("div", bi, [
|
|
2687
2694
|
e("img", {
|
|
2688
|
-
src:
|
|
2695
|
+
src: d(H),
|
|
2689
2696
|
alt: "头像",
|
|
2690
2697
|
class: "settings-avatar"
|
|
2691
2698
|
}, null, 8, ki),
|
|
@@ -2699,7 +2706,7 @@ const gt = (x, t) => {
|
|
|
2699
2706
|
class: "settings-avatar-icon"
|
|
2700
2707
|
}, {
|
|
2701
2708
|
default: k(() => [
|
|
2702
|
-
m(
|
|
2709
|
+
m(d(Mt))
|
|
2703
2710
|
]),
|
|
2704
2711
|
_: 1
|
|
2705
2712
|
})
|
|
@@ -2714,8 +2721,8 @@ const gt = (x, t) => {
|
|
|
2714
2721
|
}, null, 544)
|
|
2715
2722
|
]),
|
|
2716
2723
|
e("div", wi, [
|
|
2717
|
-
e("div", Ci, y(
|
|
2718
|
-
e("div", xi, "@" + y(
|
|
2724
|
+
e("div", Ci, y(d(Z).nickname || d(ee)), 1),
|
|
2725
|
+
e("div", xi, "@" + y(d(ee)), 1)
|
|
2719
2726
|
])
|
|
2720
2727
|
]),
|
|
2721
2728
|
e("div", Ui, [
|
|
@@ -2723,7 +2730,7 @@ const gt = (x, t) => {
|
|
|
2723
2730
|
e("div", Si, [
|
|
2724
2731
|
m(b, null, {
|
|
2725
2732
|
default: k(() => [
|
|
2726
|
-
m(
|
|
2733
|
+
m(d(Qe))
|
|
2727
2734
|
]),
|
|
2728
2735
|
_: 1
|
|
2729
2736
|
}),
|
|
@@ -2751,7 +2758,7 @@ const gt = (x, t) => {
|
|
|
2751
2758
|
"onUpdate:modelValue": s[7] || (s[7] = (l) => oe.value.nickname = l),
|
|
2752
2759
|
placeholder: "请输入昵称",
|
|
2753
2760
|
size: "large"
|
|
2754
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Vi, y(
|
|
2761
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Vi, y(d(Z).nickname || "未设置"), 1))
|
|
2755
2762
|
]),
|
|
2756
2763
|
e("div", Fi, [
|
|
2757
2764
|
s[27] || (s[27] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
|
|
@@ -2761,7 +2768,7 @@ const gt = (x, t) => {
|
|
|
2761
2768
|
"onUpdate:modelValue": s[8] || (s[8] = (l) => oe.value.email = l),
|
|
2762
2769
|
placeholder: "请输入邮箱",
|
|
2763
2770
|
size: "large"
|
|
2764
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Ii, y(
|
|
2771
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ii, y(d(Z).email || "未设置"), 1))
|
|
2765
2772
|
]),
|
|
2766
2773
|
e("div", Ri, [
|
|
2767
2774
|
s[28] || (s[28] = e("label", { class: "settings-form-label" }, "手机号", -1)),
|
|
@@ -2771,7 +2778,7 @@ const gt = (x, t) => {
|
|
|
2771
2778
|
"onUpdate:modelValue": s[9] || (s[9] = (l) => oe.value.phone = l),
|
|
2772
2779
|
placeholder: "请输入手机号",
|
|
2773
2780
|
size: "large"
|
|
2774
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Mi, y(
|
|
2781
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Mi, y(d(Z).phone || "未设置"), 1))
|
|
2775
2782
|
]),
|
|
2776
2783
|
e("div", Li, [
|
|
2777
2784
|
s[29] || (s[29] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
|
|
@@ -2783,7 +2790,7 @@ const gt = (x, t) => {
|
|
|
2783
2790
|
rows: 4,
|
|
2784
2791
|
placeholder: "介绍一下自己吧...",
|
|
2785
2792
|
size: "large"
|
|
2786
|
-
}, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(
|
|
2793
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(d(Z).bio || "这个人很懒,什么都没写~"), 1))
|
|
2787
2794
|
]),
|
|
2788
2795
|
K.value ? (a(), p("div", Ei, [
|
|
2789
2796
|
m(ke, {
|
|
@@ -2814,8 +2821,8 @@ const gt = (x, t) => {
|
|
|
2814
2821
|
_: 1
|
|
2815
2822
|
}, 8, ["modelValue"]),
|
|
2816
2823
|
m(yt, {
|
|
2817
|
-
modelValue:
|
|
2818
|
-
"onUpdate:modelValue": s[12] || (s[12] = (l) =>
|
|
2824
|
+
modelValue: c.value,
|
|
2825
|
+
"onUpdate:modelValue": s[12] || (s[12] = (l) => c.value = l),
|
|
2819
2826
|
src: _e.value,
|
|
2820
2827
|
onConfirm: dt
|
|
2821
2828
|
}, null, 8, ["modelValue", "src"]),
|
|
@@ -2850,6 +2857,7 @@ const gt = (x, t) => {
|
|
|
2850
2857
|
agreeFriend: "/chart/friend/agree",
|
|
2851
2858
|
setChatStatus: "/chart/friend/chat/status",
|
|
2852
2859
|
getAvailableUsers: "/chart/user/canAddFriend",
|
|
2860
|
+
searchUser: "/chart/user/search",
|
|
2853
2861
|
getUserInfo: "/user/info",
|
|
2854
2862
|
updateUserInfo: "/user/info",
|
|
2855
2863
|
getUserAvatar: "/user/getAvatar",
|
|
@@ -2899,13 +2907,13 @@ const gt = (x, t) => {
|
|
|
2899
2907
|
}
|
|
2900
2908
|
};
|
|
2901
2909
|
function Ki(x = {}) {
|
|
2902
|
-
const t =
|
|
2910
|
+
const t = Et(Hi, x);
|
|
2903
2911
|
return t.api.baseUrl || console.warn("[VueChatKit] 请配置 api.baseUrl"), t.api.websocketUrl || console.warn("[VueChatKit] 请配置 api.websocketUrl"), t.user.username || console.warn("[VueChatKit] 请配置 user.username"), t;
|
|
2904
2912
|
}
|
|
2905
|
-
function
|
|
2913
|
+
function Et(x, t) {
|
|
2906
2914
|
const n = { ...x };
|
|
2907
2915
|
for (const v in t)
|
|
2908
|
-
t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] =
|
|
2916
|
+
t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Et(x[v] || {}, t[v]) : n[v] = t[v];
|
|
2909
2917
|
return n;
|
|
2910
2918
|
}
|
|
2911
2919
|
const Ni = {
|
|
@@ -2915,7 +2923,7 @@ const Ni = {
|
|
|
2915
2923
|
};
|
|
2916
2924
|
export {
|
|
2917
2925
|
yt as AvatarCrop,
|
|
2918
|
-
|
|
2926
|
+
ft as ChatApi,
|
|
2919
2927
|
Ya as ChatPanel,
|
|
2920
2928
|
Dt as ChatWebSocket,
|
|
2921
2929
|
Wi as ChatWindow,
|
|
@@ -2923,5 +2931,5 @@ export {
|
|
|
2923
2931
|
Ni as VueChatKit,
|
|
2924
2932
|
Ki as createChatConfig,
|
|
2925
2933
|
Ni as default,
|
|
2926
|
-
|
|
2934
|
+
Tt as useChat
|
|
2927
2935
|
};
|