vue-chat-kit 0.2.2 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-chat-kit.es.js +369 -369
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/index.js +8 -3
package/dist/vue-chat-kit.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as h, computed as ye, nextTick as Qe, watch as Dt, resolveComponent as ie, openBlock as n, createBlock as
|
|
2
|
-
import { ChatDotRound as Re, UserFilled as Ge, Bell as
|
|
1
|
+
import { ref as h, computed as ye, nextTick as Qe, watch as Dt, resolveComponent as ie, openBlock as n, createBlock as K, withCtx as b, createElementVNode as e, createElementBlock as v, createCommentVNode as U, createVNode as p, createTextVNode as J, onMounted as _t, onUnmounted as yt, unref as c, Fragment as se, renderList as ae, normalizeClass as W, resolveDynamicComponent as bt, toDisplayString as _, isRef as Ce, withModifiers as Ye, withDirectives as kt, withKeys as wt, vModelText as Ct, normalizeStyle as Ut } from "vue";
|
|
2
|
+
import { ChatDotRound as Re, UserFilled as Ge, Bell as $t, Setting as xt, Search as Le, Plus as Vt, MoreFilled as At, Document as St, Download as Ft, Folder as Je, Picture as It, ChatLineRound as zt, Camera as Rt } from "@element-plus/icons-vue";
|
|
3
3
|
import mt from "dayjs";
|
|
4
|
-
import { ElMessage as
|
|
4
|
+
import { ElMessage as N } from "element-plus";
|
|
5
5
|
class Et {
|
|
6
6
|
constructor(t, a = {}) {
|
|
7
7
|
this.userId = t, this.wsUrl = a.wsUrl || "", this.socket = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = a.maxReconnectAttempts || 5, this.reconnectDelay = a.reconnectDelay || 3e3, this.handlers = {
|
|
@@ -40,14 +40,14 @@ class Et {
|
|
|
40
40
|
/**
|
|
41
41
|
* 发送消息
|
|
42
42
|
*/
|
|
43
|
-
send(t, a, m = "text", C = "",
|
|
43
|
+
send(t, a, m = "text", C = "", P = "", I = 0) {
|
|
44
44
|
if (this.isConnected()) {
|
|
45
45
|
const T = JSON.stringify({
|
|
46
46
|
to: t,
|
|
47
47
|
msg: a,
|
|
48
48
|
type: m,
|
|
49
49
|
fileUrl: C,
|
|
50
|
-
fileName:
|
|
50
|
+
fileName: P,
|
|
51
51
|
fileSize: I
|
|
52
52
|
});
|
|
53
53
|
return this.socket.send(T), !0;
|
|
@@ -141,11 +141,11 @@ class qt {
|
|
|
141
141
|
* 核心请求方法
|
|
142
142
|
*/
|
|
143
143
|
async request(t, a = {}) {
|
|
144
|
-
const { method: m = "GET", headers: C = {}, body:
|
|
144
|
+
const { method: m = "GET", headers: C = {}, body: P, params: I } = a;
|
|
145
145
|
let T = t.startsWith("http") ? t : `${this.baseUrl}${t}`, L = {
|
|
146
146
|
method: m,
|
|
147
147
|
headers: { ...this.headers, ...C },
|
|
148
|
-
body:
|
|
148
|
+
body: P,
|
|
149
149
|
params: I
|
|
150
150
|
};
|
|
151
151
|
this.requestInterceptors.forEach((x) => {
|
|
@@ -340,15 +340,15 @@ class ft {
|
|
|
340
340
|
return m.append("file", t), m.append("username", a), this.http.post(this.endpoints.uploadAvatar, m);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
const
|
|
343
|
+
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
344
344
|
__proto__: null,
|
|
345
345
|
ChatApi: ft,
|
|
346
346
|
default: ft
|
|
347
347
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
348
|
-
function
|
|
348
|
+
function Tt(w, t) {
|
|
349
349
|
const a = new ft(w);
|
|
350
350
|
let m = null;
|
|
351
|
-
const C = w.user.username,
|
|
351
|
+
const C = w.user.username, P = h(w.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${C}`), I = h({
|
|
352
352
|
username: C,
|
|
353
353
|
nickname: w.user.nickname || "",
|
|
354
354
|
email: w.user.email || "",
|
|
@@ -360,15 +360,15 @@ function Lt(w, t) {
|
|
|
360
360
|
const d = S.value.toLowerCase();
|
|
361
361
|
l = l.filter(
|
|
362
362
|
(g) => {
|
|
363
|
-
var
|
|
364
|
-
return (
|
|
363
|
+
var V;
|
|
364
|
+
return (V = g.username) == null ? void 0 : V.toLowerCase().includes(d);
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
367
|
}
|
|
368
368
|
return l.map((d) => ({
|
|
369
369
|
id: d.username,
|
|
370
370
|
name: d.username,
|
|
371
|
-
avatar: d.avatar ||
|
|
371
|
+
avatar: d.avatar || P.value,
|
|
372
372
|
online: d.online,
|
|
373
373
|
lastMsg: d.lastMsg || "暂无消息",
|
|
374
374
|
lastTime: d.lastTime,
|
|
@@ -380,15 +380,15 @@ function Lt(w, t) {
|
|
|
380
380
|
const d = S.value.toLowerCase();
|
|
381
381
|
l = l.filter(
|
|
382
382
|
(g) => {
|
|
383
|
-
var
|
|
384
|
-
return (
|
|
383
|
+
var V;
|
|
384
|
+
return (V = g.username) == null ? void 0 : V.toLowerCase().includes(d);
|
|
385
385
|
}
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
return l.map((d) => ({
|
|
389
389
|
id: d.username,
|
|
390
390
|
name: d.username,
|
|
391
|
-
avatar: d.avatar ||
|
|
391
|
+
avatar: d.avatar || P.value,
|
|
392
392
|
online: d.online,
|
|
393
393
|
isChatting: d.isChatting
|
|
394
394
|
}));
|
|
@@ -483,24 +483,24 @@ function Lt(w, t) {
|
|
|
483
483
|
try {
|
|
484
484
|
const d = await a.uploadFile(l);
|
|
485
485
|
if (d.code === 200 && d.data) {
|
|
486
|
-
const { fileUrl: g, fileName:
|
|
486
|
+
const { fileUrl: g, fileName: V } = d.data;
|
|
487
487
|
if (m.send(
|
|
488
488
|
k.value,
|
|
489
|
-
|
|
489
|
+
V,
|
|
490
490
|
"file",
|
|
491
491
|
g,
|
|
492
|
-
|
|
492
|
+
V,
|
|
493
493
|
l.size
|
|
494
494
|
)) {
|
|
495
495
|
const E = {
|
|
496
|
-
msgContent:
|
|
496
|
+
msgContent: V,
|
|
497
497
|
sendUsername: C,
|
|
498
498
|
receiveUsername: k.value,
|
|
499
499
|
createTime: /* @__PURE__ */ new Date(),
|
|
500
500
|
isRead: 0,
|
|
501
501
|
type: "file",
|
|
502
502
|
fileUrl: g,
|
|
503
|
-
fileName:
|
|
503
|
+
fileName: V,
|
|
504
504
|
fileSize: l.size
|
|
505
505
|
};
|
|
506
506
|
return x.value.push(E), ce(), !0;
|
|
@@ -513,7 +513,7 @@ function Lt(w, t) {
|
|
|
513
513
|
}, De = async (l, d) => {
|
|
514
514
|
if (!(!k.value || !m)) {
|
|
515
515
|
if (d && d.trim() && m.send(k.value, d.trim(), "text")) {
|
|
516
|
-
const
|
|
516
|
+
const V = {
|
|
517
517
|
msgContent: d.trim(),
|
|
518
518
|
sendUsername: C,
|
|
519
519
|
receiveUsername: k.value,
|
|
@@ -521,11 +521,11 @@ function Lt(w, t) {
|
|
|
521
521
|
isRead: 0,
|
|
522
522
|
type: "text"
|
|
523
523
|
};
|
|
524
|
-
x.value.push(
|
|
524
|
+
x.value.push(V);
|
|
525
525
|
}
|
|
526
526
|
for (const g of l) {
|
|
527
|
-
const
|
|
528
|
-
await xe(
|
|
527
|
+
const V = g.file || g;
|
|
528
|
+
await xe(V);
|
|
529
529
|
}
|
|
530
530
|
setTimeout(() => {
|
|
531
531
|
we(k.value), de();
|
|
@@ -559,9 +559,9 @@ function Lt(w, t) {
|
|
|
559
559
|
return null;
|
|
560
560
|
}, qe = (l) => {
|
|
561
561
|
if (l.includes("【状态变更】")) {
|
|
562
|
-
const g = /【状态变更】(.+?) 已(上线|下线)/,
|
|
563
|
-
if (
|
|
564
|
-
const le =
|
|
562
|
+
const g = /【状态变更】(.+?) 已(上线|下线)/, V = l.match(g);
|
|
563
|
+
if (V) {
|
|
564
|
+
const le = V[1], E = V[2] === "上线", q = L.value.find((pe) => pe.username === le);
|
|
565
565
|
q && (q.online = E);
|
|
566
566
|
}
|
|
567
567
|
return;
|
|
@@ -579,7 +579,7 @@ function Lt(w, t) {
|
|
|
579
579
|
};
|
|
580
580
|
if (k.value) {
|
|
581
581
|
try {
|
|
582
|
-
let
|
|
582
|
+
let V = {
|
|
583
583
|
msgContent: d.content,
|
|
584
584
|
sendUsername: g.username,
|
|
585
585
|
receiveUsername: C,
|
|
@@ -590,24 +590,24 @@ function Lt(w, t) {
|
|
|
590
590
|
fileName: d.fileName || "",
|
|
591
591
|
fileSize: d.fileSize || 0
|
|
592
592
|
};
|
|
593
|
-
x.value.push(
|
|
594
|
-
} catch (
|
|
595
|
-
console.error("[VueChatKit] 添加临时消息失败",
|
|
593
|
+
x.value.push(V), ce();
|
|
594
|
+
} catch (V) {
|
|
595
|
+
console.error("[VueChatKit] 添加临时消息失败", V);
|
|
596
596
|
}
|
|
597
597
|
we(k.value);
|
|
598
598
|
}
|
|
599
599
|
de(), t && typeof t == "function" && t(g);
|
|
600
600
|
}
|
|
601
|
-
},
|
|
601
|
+
}, Be = () => {
|
|
602
602
|
const l = `${w.api.websocketUrl}?userId=${C}`;
|
|
603
603
|
m = new Et(C, {
|
|
604
604
|
wsUrl: l,
|
|
605
605
|
maxReconnectAttempts: w.websocket.maxReconnectAttempts,
|
|
606
606
|
reconnectDelay: w.websocket.reconnectDelay
|
|
607
607
|
}), m.on("message", qe), m.connect();
|
|
608
|
-
},
|
|
608
|
+
}, Ke = () => {
|
|
609
609
|
m && (m.close(), m = null);
|
|
610
|
-
},
|
|
610
|
+
}, We = async () => {
|
|
611
611
|
fe.value = !0, oe.value = "", await ve();
|
|
612
612
|
}, ve = async () => {
|
|
613
613
|
ne.value = !0;
|
|
@@ -625,7 +625,7 @@ function Lt(w, t) {
|
|
|
625
625
|
} catch (d) {
|
|
626
626
|
console.error("[VueChatKit] 添加好友失败", d);
|
|
627
627
|
}
|
|
628
|
-
},
|
|
628
|
+
}, B = async () => {
|
|
629
629
|
$.value = !0;
|
|
630
630
|
try {
|
|
631
631
|
const l = await a.getApplyList(C);
|
|
@@ -637,19 +637,19 @@ function Lt(w, t) {
|
|
|
637
637
|
}
|
|
638
638
|
}, F = async (l) => {
|
|
639
639
|
try {
|
|
640
|
-
await a.agreeFriend(l, C), await
|
|
640
|
+
await a.agreeFriend(l, C), await B(), await de();
|
|
641
641
|
} catch (d) {
|
|
642
642
|
console.error("[VueChatKit] 同意好友申请失败", d);
|
|
643
643
|
}
|
|
644
644
|
}, O = async () => {
|
|
645
645
|
try {
|
|
646
646
|
const l = await a.getUserAvatar(C);
|
|
647
|
-
l.code === 200 && l.data && (
|
|
647
|
+
l.code === 200 && l.data && (P.value = l.data);
|
|
648
648
|
} catch (l) {
|
|
649
649
|
console.warn("[VueChatKit] 加载头像失败", l);
|
|
650
650
|
}
|
|
651
651
|
}, j = (l) => {
|
|
652
|
-
|
|
652
|
+
P.value = l;
|
|
653
653
|
}, D = async () => {
|
|
654
654
|
T.value = !0;
|
|
655
655
|
try {
|
|
@@ -678,7 +678,7 @@ function Lt(w, t) {
|
|
|
678
678
|
return O(), {
|
|
679
679
|
// 状态
|
|
680
680
|
myUsername: C,
|
|
681
|
-
myAvatar:
|
|
681
|
+
myAvatar: P,
|
|
682
682
|
userInfo: I,
|
|
683
683
|
loadingUserInfo: T,
|
|
684
684
|
friendList: L,
|
|
@@ -710,12 +710,12 @@ function Lt(w, t) {
|
|
|
710
710
|
sendMessage: Ie,
|
|
711
711
|
sendFile: xe,
|
|
712
712
|
sendFilesAndText: De,
|
|
713
|
-
initWebSocket:
|
|
714
|
-
closeWebSocket:
|
|
713
|
+
initWebSocket: Be,
|
|
714
|
+
closeWebSocket: Ke,
|
|
715
715
|
reset: ge,
|
|
716
|
-
openAddFriendDialog:
|
|
716
|
+
openAddFriendDialog: We,
|
|
717
717
|
addFriend: ee,
|
|
718
|
-
loadFriendApplyList:
|
|
718
|
+
loadFriendApplyList: B,
|
|
719
719
|
agreeFriend: F,
|
|
720
720
|
updateMyAvatar: j,
|
|
721
721
|
getUserInfo: D,
|
|
@@ -727,7 +727,7 @@ const ht = (w, t) => {
|
|
|
727
727
|
for (const [m, C] of t)
|
|
728
728
|
a[m] = C;
|
|
729
729
|
return a;
|
|
730
|
-
},
|
|
730
|
+
}, Bt = { class: "avatar-crop-container" }, Kt = ["src"], Wt = { class: "crop-overlay" }, Nt = { class: "crop-box" }, Pt = {
|
|
731
731
|
key: 0,
|
|
732
732
|
class: "crop-mask"
|
|
733
733
|
}, Ht = { class: "zoom-controls" }, Ot = {
|
|
@@ -741,9 +741,9 @@ const ht = (w, t) => {
|
|
|
741
741
|
const a = w, m = t, C = ye({
|
|
742
742
|
get: () => a.modelValue,
|
|
743
743
|
set: ($) => m("update:modelValue", $)
|
|
744
|
-
}),
|
|
744
|
+
}), P = h(""), I = h(null), T = h(null), L = h(null), H = h(1), x = h({ x: 0, y: 0 }), k = h(!1), S = h({ x: 0, y: 0 }), z = h({ width: 0, height: 0 });
|
|
745
745
|
Dt(() => a.src, ($) => {
|
|
746
|
-
$ && (
|
|
746
|
+
$ && (P.value = $, H.value = 1, x.value = { x: 0, y: 0 });
|
|
747
747
|
});
|
|
748
748
|
const G = () => {
|
|
749
749
|
Qe(() => {
|
|
@@ -789,11 +789,11 @@ const ht = (w, t) => {
|
|
|
789
789
|
}, "image/png");
|
|
790
790
|
}
|
|
791
791
|
}, _e = () => {
|
|
792
|
-
|
|
792
|
+
P.value = "", H.value = 1, x.value = { x: 0, y: 0 };
|
|
793
793
|
};
|
|
794
794
|
return ($, R) => {
|
|
795
795
|
const M = ie("el-slider"), Z = ie("el-button"), he = ie("el-dialog");
|
|
796
|
-
return n(),
|
|
796
|
+
return n(), K(he, {
|
|
797
797
|
modelValue: C.value,
|
|
798
798
|
"onUpdate:modelValue": R[2] || (R[2] = (re) => C.value = re),
|
|
799
799
|
title: "裁剪头像",
|
|
@@ -821,23 +821,23 @@ const ht = (w, t) => {
|
|
|
821
821
|
})
|
|
822
822
|
]),
|
|
823
823
|
default: b(() => [
|
|
824
|
-
e("div",
|
|
824
|
+
e("div", Bt, [
|
|
825
825
|
e("div", {
|
|
826
826
|
class: "crop-area",
|
|
827
827
|
ref_key: "cropAreaRef",
|
|
828
828
|
ref: T
|
|
829
829
|
}, [
|
|
830
830
|
e("img", {
|
|
831
|
-
src:
|
|
831
|
+
src: P.value,
|
|
832
832
|
ref_key: "imageRef",
|
|
833
833
|
ref: I,
|
|
834
834
|
class: "crop-image",
|
|
835
835
|
onLoad: G,
|
|
836
836
|
onMousedown: fe,
|
|
837
837
|
onTouchstart: fe
|
|
838
|
-
}, null, 40,
|
|
839
|
-
e("div",
|
|
840
|
-
e("div",
|
|
838
|
+
}, null, 40, Kt),
|
|
839
|
+
e("div", Wt, [
|
|
840
|
+
e("div", Nt, [
|
|
841
841
|
e("div", {
|
|
842
842
|
class: "crop-border",
|
|
843
843
|
ref_key: "cropBoxRef",
|
|
@@ -845,7 +845,7 @@ const ht = (w, t) => {
|
|
|
845
845
|
}, null, 512)
|
|
846
846
|
])
|
|
847
847
|
]),
|
|
848
|
-
k.value ? (n(), v("div",
|
|
848
|
+
k.value ? (n(), v("div", Pt)) : U("", !0)
|
|
849
849
|
], 512),
|
|
850
850
|
e("div", Ht, [
|
|
851
851
|
p(M, {
|
|
@@ -863,7 +863,7 @@ const ht = (w, t) => {
|
|
|
863
863
|
}, 8, ["modelValue"]);
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
},
|
|
866
|
+
}, gt = /* @__PURE__ */ ht(Ot, [["__scopeId", "data-v-4e4a992b"]]), jt = { class: "chat-panel" }, Xt = { class: "chat-sidebar" }, Yt = ["src"], Gt = ["onClick"], Jt = {
|
|
867
867
|
key: 0,
|
|
868
868
|
class: "sidebar-nav-badge"
|
|
869
869
|
}, Qt = { class: "chat-content-panel" }, Zt = { class: "chat-search-bar" }, es = { class: "chat-content-scroll" }, ts = { key: 0 }, ss = ["onClick", "onContextmenu"], as = { class: "chat-list-avatar-wrapper" }, ns = ["src", "alt"], ls = {
|
|
@@ -872,19 +872,19 @@ const ht = (w, t) => {
|
|
|
872
872
|
}, is = { class: "chat-list-info" }, os = { class: "chat-list-header" }, rs = { class: "chat-list-name" }, cs = { class: "chat-list-time" }, ds = { class: "chat-list-preview" }, us = { class: "chat-list-last-msg" }, vs = {
|
|
873
873
|
key: 0,
|
|
874
874
|
class: "chat-list-unread"
|
|
875
|
-
}, ps = { key: 1 }, ms = { class: "add-friend-section" }, fs = { class: "add-friend-icon" }, hs = ["onClick"], gs = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], ys = { class: "chat-list-info" }, bs = { class: "chat-list-name" }, ks = { key: 2 }, ws = { class: "friend-request-info" }, Cs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, xs = { class: "chat-main-area" },
|
|
875
|
+
}, ps = { key: 1 }, ms = { class: "add-friend-section" }, fs = { class: "add-friend-icon" }, hs = ["onClick"], gs = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], ys = { class: "chat-list-info" }, bs = { class: "chat-list-name" }, ks = { key: 2 }, ws = { class: "friend-request-info" }, Cs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, xs = { class: "chat-main-area" }, Vs = {
|
|
876
876
|
key: 0,
|
|
877
877
|
class: "friend-profile-area"
|
|
878
|
-
},
|
|
878
|
+
}, As = ["src", "alt"], Ss = { class: "profile-name" }, Fs = { class: "profile-status" }, Is = {
|
|
879
879
|
key: 1,
|
|
880
880
|
class: "chat-window-area"
|
|
881
881
|
}, zs = { class: "chat-window-header" }, Rs = { class: "chat-window-title" }, Ls = { class: "chat-window-name" }, Ts = { class: "chat-window-actions" }, Ms = { class: "message-avatar" }, Ds = ["src"], Es = {
|
|
882
882
|
key: 0,
|
|
883
883
|
class: "message-sender-name"
|
|
884
|
-
}, qs = { class: "message-bubble-wrapper" },
|
|
884
|
+
}, qs = { class: "message-bubble-wrapper" }, Bs = ["onClick"], Ks = ["src", "alt"], Ws = {
|
|
885
885
|
key: 0,
|
|
886
886
|
class: "message-image-size"
|
|
887
|
-
},
|
|
887
|
+
}, Ns = ["onClick"], Ps = { class: "message-file-content" }, Hs = { class: "message-file-icon" }, Os = { class: "message-file-info" }, js = { class: "message-file-name" }, Xs = { class: "message-file-meta" }, Ys = { key: 0 }, Gs = { class: "chat-input-area" }, Js = {
|
|
888
888
|
key: 0,
|
|
889
889
|
class: "pending-files-area"
|
|
890
890
|
}, Qs = {
|
|
@@ -902,7 +902,7 @@ const ht = (w, t) => {
|
|
|
902
902
|
}, ca = { class: "empty-state-text" }, da = {
|
|
903
903
|
key: 0,
|
|
904
904
|
class: "chat-detail-panel"
|
|
905
|
-
}, ua = { class: "chat-detail-content" }, va = { class: "chat-detail-profile" }, pa = ["src", "alt"], ma = { class: "chat-detail-name" }, fa = { class: "add-friend-search-wrapper" }, ha = { class: "add-friend-users-list" }, ga = { class: "add-friend-user-info" }, _a = ["src", "alt"], ya = { class: "add-friend-user-name" }, ba = { class: "chat-settings-container" }, ka = { class: "chat-settings-avatar-section" }, wa = { class: "chat-settings-avatar-wrapper" }, Ca = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, xa = { class: "chat-settings-username" },
|
|
905
|
+
}, ua = { class: "chat-detail-content" }, va = { class: "chat-detail-profile" }, pa = ["src", "alt"], ma = { class: "chat-detail-name" }, fa = { class: "add-friend-search-wrapper" }, ha = { class: "add-friend-users-list" }, ga = { class: "add-friend-user-info" }, _a = ["src", "alt"], ya = { class: "add-friend-user-name" }, ba = { class: "chat-settings-container" }, ka = { class: "chat-settings-avatar-section" }, wa = { class: "chat-settings-avatar-wrapper" }, Ca = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, xa = { class: "chat-settings-username" }, Va = { class: "chat-settings-form-section" }, Aa = { class: "chat-settings-form-header" }, Sa = { class: "chat-settings-form-title" }, Fa = { class: "chat-settings-form" }, Ia = { class: "chat-settings-form-item" }, za = {
|
|
906
906
|
key: 1,
|
|
907
907
|
class: "chat-settings-form-value"
|
|
908
908
|
}, Ra = { class: "chat-settings-form-item" }, La = {
|
|
@@ -917,7 +917,7 @@ const ht = (w, t) => {
|
|
|
917
917
|
}, qa = {
|
|
918
918
|
key: 0,
|
|
919
919
|
class: "chat-settings-form-actions"
|
|
920
|
-
},
|
|
920
|
+
}, Ba = {
|
|
921
921
|
__name: "ChatPanel",
|
|
922
922
|
props: {
|
|
923
923
|
config: { type: Object, required: !0 }
|
|
@@ -926,7 +926,7 @@ const ht = (w, t) => {
|
|
|
926
926
|
setup(w, { emit: t }) {
|
|
927
927
|
const a = w, m = t, {
|
|
928
928
|
myUsername: C,
|
|
929
|
-
myAvatar:
|
|
929
|
+
myAvatar: P,
|
|
930
930
|
userInfo: I,
|
|
931
931
|
loadingUserInfo: T,
|
|
932
932
|
friendList: L,
|
|
@@ -962,36 +962,36 @@ const ht = (w, t) => {
|
|
|
962
962
|
loadFriendApplyList: De,
|
|
963
963
|
agreeFriend: Ee,
|
|
964
964
|
updateMyAvatar: qe,
|
|
965
|
-
getUserInfo:
|
|
966
|
-
updateUserInfo:
|
|
967
|
-
} =
|
|
965
|
+
getUserInfo: Be,
|
|
966
|
+
updateUserInfo: Ke
|
|
967
|
+
} = Tt(a.config, (f) => {
|
|
968
968
|
m("message", f);
|
|
969
|
-
}),
|
|
969
|
+
}), We = ye(() => {
|
|
970
970
|
var r;
|
|
971
971
|
const f = [{ id: "chat", icon: Re, badge: 0 }];
|
|
972
|
-
return a.config.modules.friends && f.push({ id: "friends", icon: Ge, badge: 0 }), a.config.modules.apply && f.push({ id: "apply", icon:
|
|
973
|
-
}), ve = h("chat"), ee = h(null),
|
|
972
|
+
return a.config.modules.friends && f.push({ id: "friends", icon: Ge, badge: 0 }), a.config.modules.apply && f.push({ id: "apply", icon: $t, badge: ((r = R.value) == null ? void 0 : r.length) || 0 }), f;
|
|
973
|
+
}), ve = h("chat"), ee = h(null), B = h(null), F = h(null), O = h(!1), j = h(!1), D = h({ nickname: "", email: "", phone: "", bio: "" }), X = h(!1), ge = h(!1), l = h(!1), d = h(!1), g = h(null), V = h(""), le = h(null), E = h([]), q = h({ visible: !1, x: 0, y: 0, chat: null }), pe = (f, r) => {
|
|
974
974
|
f.preventDefault(), f.stopPropagation(), q.value = { visible: !0, x: f.clientX, y: f.clientY, chat: r };
|
|
975
|
-
},
|
|
975
|
+
}, Ve = () => {
|
|
976
976
|
q.value.visible = !1;
|
|
977
977
|
}, Ze = async () => {
|
|
978
978
|
if (!q.value.chat) return;
|
|
979
|
-
await $e(q.value.chat.id, 0) && ee.value === q.value.chat.id && (ee.value = null,
|
|
980
|
-
},
|
|
981
|
-
ee.value = f.id,
|
|
979
|
+
await $e(q.value.chat.id, 0) && ee.value === q.value.chat.id && (ee.value = null, B.value = null), Ve();
|
|
980
|
+
}, Ae = (f) => {
|
|
981
|
+
ee.value = f.id, B.value = f, F.value = null, O.value = !1, ke({
|
|
982
982
|
id: f.id,
|
|
983
983
|
name: f.name,
|
|
984
984
|
avatar: f.avatar,
|
|
985
985
|
online: f.online
|
|
986
986
|
});
|
|
987
987
|
}, et = (f) => {
|
|
988
|
-
F.value = f, ee.value = null,
|
|
988
|
+
F.value = f, ee.value = null, B.value = null;
|
|
989
989
|
}, tt = async () => {
|
|
990
990
|
if (!F.value) return;
|
|
991
991
|
if (await $e(F.value.id)) {
|
|
992
992
|
ve.value = "chat", await Qe();
|
|
993
993
|
const r = z.value.find((u) => u.id === F.value.id);
|
|
994
|
-
r &&
|
|
994
|
+
r && Ae(r), F.value = null;
|
|
995
995
|
}
|
|
996
996
|
}, st = () => {
|
|
997
997
|
ge.value = !0;
|
|
@@ -1006,7 +1006,7 @@ const ht = (w, t) => {
|
|
|
1006
1006
|
if (r.length !== 0) {
|
|
1007
1007
|
for (const u of r) {
|
|
1008
1008
|
if (u.size > 50 * 1024 * 1024) {
|
|
1009
|
-
|
|
1009
|
+
N.warning(`文件 ${u.name} 超过50MB,已跳过`);
|
|
1010
1010
|
continue;
|
|
1011
1011
|
}
|
|
1012
1012
|
const s = URL.createObjectURL(u);
|
|
@@ -1022,10 +1022,10 @@ const ht = (w, t) => {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
le.value && (le.value.value = "");
|
|
1024
1024
|
}
|
|
1025
|
-
},
|
|
1025
|
+
}, Ne = (f) => {
|
|
1026
1026
|
const r = E.value[f];
|
|
1027
1027
|
r.previewUrl && URL.revokeObjectURL(r.previewUrl), E.value.splice(f, 1);
|
|
1028
|
-
},
|
|
1028
|
+
}, Pe = (f) => {
|
|
1029
1029
|
if (f === 0) return "0 B";
|
|
1030
1030
|
const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(f) / Math.log(r));
|
|
1031
1031
|
return parseFloat((f / Math.pow(r, s)).toFixed(2)) + " " + u[s];
|
|
@@ -1044,17 +1044,17 @@ const ht = (w, t) => {
|
|
|
1044
1044
|
const y = s.getAsFile();
|
|
1045
1045
|
if (y) {
|
|
1046
1046
|
if (y.size > 50 * 1024 * 1024) {
|
|
1047
|
-
|
|
1047
|
+
N.warning(`文件 ${y.name} 超过50MB,已跳过`);
|
|
1048
1048
|
continue;
|
|
1049
1049
|
}
|
|
1050
|
-
const
|
|
1050
|
+
const A = URL.createObjectURL(y);
|
|
1051
1051
|
E.value.push({
|
|
1052
1052
|
id: Date.now() + Math.random(),
|
|
1053
1053
|
file: y,
|
|
1054
1054
|
name: y.name,
|
|
1055
1055
|
size: y.size,
|
|
1056
1056
|
type: y.type,
|
|
1057
|
-
previewUrl:
|
|
1057
|
+
previewUrl: A,
|
|
1058
1058
|
isImage: y.type.startsWith("image/")
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
@@ -1062,7 +1062,7 @@ const ht = (w, t) => {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
}, Oe = (f) => {
|
|
1064
1064
|
if (!f) {
|
|
1065
|
-
|
|
1065
|
+
N.warning("文件地址无效");
|
|
1066
1066
|
return;
|
|
1067
1067
|
}
|
|
1068
1068
|
window.open(f, "_blank");
|
|
@@ -1072,31 +1072,31 @@ const ht = (w, t) => {
|
|
|
1072
1072
|
const r = f.target.files[0];
|
|
1073
1073
|
if (!r) return;
|
|
1074
1074
|
if (!r.type.startsWith("image/")) {
|
|
1075
|
-
|
|
1075
|
+
N.error("只能上传图片文件");
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
1078
|
if (r.size > 5 * 1024 * 1024) {
|
|
1079
|
-
|
|
1079
|
+
N.error("图片大小不能超过 5MB");
|
|
1080
1080
|
return;
|
|
1081
1081
|
}
|
|
1082
1082
|
const u = new FileReader();
|
|
1083
1083
|
u.onload = (s) => {
|
|
1084
|
-
|
|
1084
|
+
V.value = s.target.result, l.value = !0;
|
|
1085
1085
|
}, u.readAsDataURL(r);
|
|
1086
1086
|
}, ct = async ({ file: f }) => {
|
|
1087
1087
|
if (f) {
|
|
1088
1088
|
d.value = !0;
|
|
1089
1089
|
try {
|
|
1090
|
-
const { ChatApi: r } = await Promise.resolve().then(() =>
|
|
1091
|
-
s.code === 200 ? (
|
|
1090
|
+
const { ChatApi: r } = await Promise.resolve().then(() => Lt), s = await new r(a.config).uploadAvatar(f, C);
|
|
1091
|
+
s.code === 200 ? (N.success("头像上传成功"), qe(s.data), je()) : N.error(s.msg || "头像上传失败");
|
|
1092
1092
|
} catch (r) {
|
|
1093
|
-
console.error(r),
|
|
1093
|
+
console.error(r), N.error("头像上传失败");
|
|
1094
1094
|
} finally {
|
|
1095
1095
|
d.value = !1;
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
1098
|
}, je = () => {
|
|
1099
|
-
|
|
1099
|
+
V.value = "", l.value = !1, g.value && (g.value.value = "");
|
|
1100
1100
|
}, dt = () => {
|
|
1101
1101
|
D.value = {
|
|
1102
1102
|
nickname: I.value.nickname || "",
|
|
@@ -1109,20 +1109,20 @@ const ht = (w, t) => {
|
|
|
1109
1109
|
}, vt = async () => {
|
|
1110
1110
|
X.value = !0;
|
|
1111
1111
|
try {
|
|
1112
|
-
await
|
|
1112
|
+
await Ke(D.value) ? (N.success("保存成功"), j.value = !1) : N.error("保存失败");
|
|
1113
1113
|
} catch (f) {
|
|
1114
|
-
console.error(f),
|
|
1114
|
+
console.error(f), N.error("保存失败");
|
|
1115
1115
|
} finally {
|
|
1116
1116
|
X.value = !1;
|
|
1117
1117
|
}
|
|
1118
1118
|
};
|
|
1119
|
-
return
|
|
1120
|
-
await Promise.all([be(), De(),
|
|
1121
|
-
}),
|
|
1122
|
-
Fe(), Me(), document.removeEventListener("click",
|
|
1119
|
+
return _t(async () => {
|
|
1120
|
+
await Promise.all([be(), De(), Be()]), Te(), z.value.length > 0 && Ae(z.value[0]), m("init"), document.addEventListener("click", Ve);
|
|
1121
|
+
}), yt(() => {
|
|
1122
|
+
Fe(), Me(), document.removeEventListener("click", Ve);
|
|
1123
1123
|
}), (f, r) => {
|
|
1124
1124
|
var ue, ze, Se;
|
|
1125
|
-
const u = ie("el-icon"), s = ie("el-input"), y = ie("el-empty"),
|
|
1125
|
+
const u = ie("el-icon"), s = ie("el-input"), y = ie("el-empty"), A = ie("el-button"), Y = ie("el-dialog");
|
|
1126
1126
|
return n(), v("div", jt, [
|
|
1127
1127
|
e("div", Xt, [
|
|
1128
1128
|
e("div", {
|
|
@@ -1130,14 +1130,14 @@ const ht = (w, t) => {
|
|
|
1130
1130
|
onClick: st
|
|
1131
1131
|
}, [
|
|
1132
1132
|
e("img", {
|
|
1133
|
-
src: c(
|
|
1133
|
+
src: c(P),
|
|
1134
1134
|
alt: "头像",
|
|
1135
1135
|
class: "sidebar-avatar-img"
|
|
1136
1136
|
}, null, 8, Yt)
|
|
1137
1137
|
]),
|
|
1138
|
-
(n(!0), v(se, null, ae(
|
|
1138
|
+
(n(!0), v(se, null, ae(We.value, (o) => (n(), v("div", {
|
|
1139
1139
|
key: o.id,
|
|
1140
|
-
class:
|
|
1140
|
+
class: W([
|
|
1141
1141
|
"sidebar-nav-item",
|
|
1142
1142
|
ve.value === o.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
|
|
1143
1143
|
]),
|
|
@@ -1145,7 +1145,7 @@ const ht = (w, t) => {
|
|
|
1145
1145
|
}, [
|
|
1146
1146
|
p(u, { size: 24 }, {
|
|
1147
1147
|
default: b(() => [
|
|
1148
|
-
(n(),
|
|
1148
|
+
(n(), K(bt(o.icon)))
|
|
1149
1149
|
]),
|
|
1150
1150
|
_: 2
|
|
1151
1151
|
}, 1024),
|
|
@@ -1160,7 +1160,7 @@ const ht = (w, t) => {
|
|
|
1160
1160
|
}, [
|
|
1161
1161
|
p(u, { size: 24 }, {
|
|
1162
1162
|
default: b(() => [
|
|
1163
|
-
p(c(
|
|
1163
|
+
p(c(xt))
|
|
1164
1164
|
]),
|
|
1165
1165
|
_: 1
|
|
1166
1166
|
})
|
|
@@ -1180,11 +1180,11 @@ const ht = (w, t) => {
|
|
|
1180
1180
|
ve.value === "chat" ? (n(), v("div", ts, [
|
|
1181
1181
|
(n(!0), v(se, null, ae(c(z), (o) => (n(), v("div", {
|
|
1182
1182
|
key: o.id,
|
|
1183
|
-
class:
|
|
1183
|
+
class: W([
|
|
1184
1184
|
"chat-list-item",
|
|
1185
1185
|
ee.value === o.id ? "chat-list-item-active" : ""
|
|
1186
1186
|
]),
|
|
1187
|
-
onClick: (te) =>
|
|
1187
|
+
onClick: (te) => Ae(o),
|
|
1188
1188
|
onContextmenu: Ye((te) => pe(te, o), ["prevent", "stop"])
|
|
1189
1189
|
}, [
|
|
1190
1190
|
e("div", as, [
|
|
@@ -1219,7 +1219,7 @@ const ht = (w, t) => {
|
|
|
1219
1219
|
size: 20
|
|
1220
1220
|
}, {
|
|
1221
1221
|
default: b(() => [
|
|
1222
|
-
p(c(
|
|
1222
|
+
p(c(Vt))
|
|
1223
1223
|
]),
|
|
1224
1224
|
_: 1
|
|
1225
1225
|
})
|
|
@@ -1239,7 +1239,7 @@ const ht = (w, t) => {
|
|
|
1239
1239
|
class: "chat-list-avatar"
|
|
1240
1240
|
}, null, 8, _s),
|
|
1241
1241
|
e("span", {
|
|
1242
|
-
class:
|
|
1242
|
+
class: W([
|
|
1243
1243
|
"chat-list-online-indicator",
|
|
1244
1244
|
o.online ? "chat-list-online" : "chat-list-offline"
|
|
1245
1245
|
])
|
|
@@ -1251,10 +1251,10 @@ const ht = (w, t) => {
|
|
|
1251
1251
|
], 8, hs))), 128))
|
|
1252
1252
|
])) : U("", !0),
|
|
1253
1253
|
ve.value === "apply" && w.config.modules.apply ? (n(), v("div", ks, [
|
|
1254
|
-
c(M) ? (n(),
|
|
1254
|
+
c(M) ? (n(), K(y, {
|
|
1255
1255
|
key: 0,
|
|
1256
1256
|
description: "加载中..."
|
|
1257
|
-
})) : c(R).length === 0 ? (n(),
|
|
1257
|
+
})) : c(R).length === 0 ? (n(), K(y, {
|
|
1258
1258
|
key: 1,
|
|
1259
1259
|
description: "暂无好友申请"
|
|
1260
1260
|
})) : (n(!0), v(se, { key: 2 }, ae(c(R), (o) => (n(), v("div", {
|
|
@@ -1272,7 +1272,7 @@ const ht = (w, t) => {
|
|
|
1272
1272
|
r[15] || (r[15] = e("div", { class: "friend-request-desc" }, "请求添加你为好友", -1))
|
|
1273
1273
|
])
|
|
1274
1274
|
]),
|
|
1275
|
-
p(
|
|
1275
|
+
p(A, {
|
|
1276
1276
|
type: "primary",
|
|
1277
1277
|
size: "small",
|
|
1278
1278
|
onClick: (te) => c(Ee)(o.applyUser)
|
|
@@ -1287,23 +1287,23 @@ const ht = (w, t) => {
|
|
|
1287
1287
|
])
|
|
1288
1288
|
]),
|
|
1289
1289
|
e("div", xs, [
|
|
1290
|
-
F.value && !
|
|
1290
|
+
F.value && !B.value ? (n(), v("div", Vs, [
|
|
1291
1291
|
e("img", {
|
|
1292
1292
|
src: F.value.avatar,
|
|
1293
1293
|
alt: F.value.name,
|
|
1294
1294
|
class: "profile-avatar"
|
|
1295
|
-
}, null, 8,
|
|
1295
|
+
}, null, 8, As),
|
|
1296
1296
|
e("div", Ss, _(F.value.name), 1),
|
|
1297
1297
|
e("div", Fs, [
|
|
1298
1298
|
e("span", {
|
|
1299
|
-
class:
|
|
1299
|
+
class: W([
|
|
1300
1300
|
"profile-status-dot",
|
|
1301
1301
|
F.value.online ? "profile-status-online" : "profile-status-offline"
|
|
1302
1302
|
])
|
|
1303
1303
|
}, null, 2),
|
|
1304
1304
|
e("span", null, _(F.value.online ? "在线" : "离线"), 1)
|
|
1305
1305
|
]),
|
|
1306
|
-
p(
|
|
1306
|
+
p(A, {
|
|
1307
1307
|
type: "primary",
|
|
1308
1308
|
size: "large",
|
|
1309
1309
|
onClick: tt,
|
|
@@ -1321,16 +1321,16 @@ const ht = (w, t) => {
|
|
|
1321
1321
|
_: 1
|
|
1322
1322
|
})
|
|
1323
1323
|
])) : U("", !0),
|
|
1324
|
-
|
|
1324
|
+
B.value ? (n(), v("div", Is, [
|
|
1325
1325
|
e("div", zs, [
|
|
1326
1326
|
e("div", Rs, [
|
|
1327
|
-
e("span", Ls, _(
|
|
1327
|
+
e("span", Ls, _(B.value.name), 1),
|
|
1328
1328
|
e("span", {
|
|
1329
|
-
class:
|
|
1329
|
+
class: W([
|
|
1330
1330
|
"chat-window-status",
|
|
1331
|
-
|
|
1331
|
+
B.value.online ? "chat-window-status-online" : "chat-window-status-offline"
|
|
1332
1332
|
])
|
|
1333
|
-
}, _(
|
|
1333
|
+
}, _(B.value.online ? "在线" : "离线"), 3)
|
|
1334
1334
|
]),
|
|
1335
1335
|
e("div", Ts, [
|
|
1336
1336
|
p(u, { class: "chat-action-icon" }, {
|
|
@@ -1357,34 +1357,34 @@ const ht = (w, t) => {
|
|
|
1357
1357
|
}, [
|
|
1358
1358
|
(n(!0), v(se, null, ae(c(oe), (o, te) => (n(), v("div", {
|
|
1359
1359
|
key: te,
|
|
1360
|
-
class:
|
|
1360
|
+
class: W([
|
|
1361
1361
|
"message-wrapper",
|
|
1362
1362
|
o.isSelf ? "message-self" : "message-other"
|
|
1363
1363
|
])
|
|
1364
1364
|
}, [
|
|
1365
1365
|
e("div", Ms, [
|
|
1366
1366
|
e("img", {
|
|
1367
|
-
src: o.isSelf ? c(
|
|
1367
|
+
src: o.isSelf ? c(P) : B.value.avatar,
|
|
1368
1368
|
class: "message-avatar-img"
|
|
1369
1369
|
}, null, 8, Ds)
|
|
1370
1370
|
]),
|
|
1371
1371
|
e("div", {
|
|
1372
|
-
class:
|
|
1372
|
+
class: W([
|
|
1373
1373
|
"message-content",
|
|
1374
1374
|
o.isSelf ? "message-content-self" : "message-content-other"
|
|
1375
1375
|
])
|
|
1376
1376
|
}, [
|
|
1377
|
-
o.isSelf ? U("", !0) : (n(), v("div", Es, _(
|
|
1377
|
+
o.isSelf ? U("", !0) : (n(), v("div", Es, _(B.value.name), 1)),
|
|
1378
1378
|
e("div", qs, [
|
|
1379
1379
|
o.type === "text" ? (n(), v("div", {
|
|
1380
1380
|
key: 0,
|
|
1381
|
-
class:
|
|
1381
|
+
class: W([
|
|
1382
1382
|
"message-bubble",
|
|
1383
1383
|
o.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
1384
1384
|
])
|
|
1385
1385
|
}, _(o.text), 3)) : o.type === "file" && o.fileType === "image" ? (n(), v("div", {
|
|
1386
1386
|
key: 1,
|
|
1387
|
-
class:
|
|
1387
|
+
class: W([
|
|
1388
1388
|
"message-bubble",
|
|
1389
1389
|
"message-image-bubble",
|
|
1390
1390
|
o.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
@@ -1396,22 +1396,22 @@ const ht = (w, t) => {
|
|
|
1396
1396
|
alt: o.fileName,
|
|
1397
1397
|
class: "message-image",
|
|
1398
1398
|
onError: ot
|
|
1399
|
-
}, null, 40,
|
|
1400
|
-
o.fileSize ? (n(), v("div",
|
|
1401
|
-
], 10,
|
|
1399
|
+
}, null, 40, Ks),
|
|
1400
|
+
o.fileSize ? (n(), v("div", Ws, _(Pe(o.fileSize)), 1)) : U("", !0)
|
|
1401
|
+
], 10, Bs)) : o.type === "file" ? (n(), v("div", {
|
|
1402
1402
|
key: 2,
|
|
1403
|
-
class:
|
|
1403
|
+
class: W([
|
|
1404
1404
|
"message-bubble",
|
|
1405
1405
|
"message-file-bubble",
|
|
1406
1406
|
o.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
1407
1407
|
]),
|
|
1408
1408
|
onClick: (i) => Oe(o.fileUrl)
|
|
1409
1409
|
}, [
|
|
1410
|
-
e("div",
|
|
1410
|
+
e("div", Ps, [
|
|
1411
1411
|
e("div", Hs, [
|
|
1412
1412
|
p(u, { size: 28 }, {
|
|
1413
1413
|
default: b(() => [
|
|
1414
|
-
p(c(
|
|
1414
|
+
p(c(St))
|
|
1415
1415
|
]),
|
|
1416
1416
|
_: 1
|
|
1417
1417
|
})
|
|
@@ -1421,18 +1421,18 @@ const ht = (w, t) => {
|
|
|
1421
1421
|
e("div", Xs, [
|
|
1422
1422
|
p(u, { size: 12 }, {
|
|
1423
1423
|
default: b(() => [
|
|
1424
|
-
p(c(
|
|
1424
|
+
p(c(Ft))
|
|
1425
1425
|
]),
|
|
1426
1426
|
_: 1
|
|
1427
1427
|
}),
|
|
1428
1428
|
r[18] || (r[18] = e("span", null, "点击下载", -1)),
|
|
1429
|
-
o.fileSize ? (n(), v("span", Ys, "· " + _(
|
|
1429
|
+
o.fileSize ? (n(), v("span", Ys, "· " + _(Pe(o.fileSize)), 1)) : U("", !0)
|
|
1430
1430
|
])
|
|
1431
1431
|
])
|
|
1432
1432
|
])
|
|
1433
|
-
], 10,
|
|
1433
|
+
], 10, Ns)) : U("", !0),
|
|
1434
1434
|
e("div", {
|
|
1435
|
-
class:
|
|
1435
|
+
class: W([
|
|
1436
1436
|
"message-time",
|
|
1437
1437
|
o.isSelf ? "message-time-right" : "message-time-left"
|
|
1438
1438
|
])
|
|
@@ -1454,7 +1454,7 @@ const ht = (w, t) => {
|
|
|
1454
1454
|
class: "pending-image"
|
|
1455
1455
|
}, null, 8, Zs),
|
|
1456
1456
|
e("button", {
|
|
1457
|
-
onClick: (i) =>
|
|
1457
|
+
onClick: (i) => Ne(te),
|
|
1458
1458
|
class: "pending-file-remove-btn"
|
|
1459
1459
|
}, " × ", 8, ea)
|
|
1460
1460
|
])) : (n(), v("div", ta, [
|
|
@@ -1466,7 +1466,7 @@ const ht = (w, t) => {
|
|
|
1466
1466
|
}),
|
|
1467
1467
|
e("span", sa, _(o.name), 1),
|
|
1468
1468
|
e("button", {
|
|
1469
|
-
onClick: (i) =>
|
|
1469
|
+
onClick: (i) => Ne(te),
|
|
1470
1470
|
class: "pending-file-remove-btn"
|
|
1471
1471
|
}, " × ", 8, aa)
|
|
1472
1472
|
]))
|
|
@@ -1490,25 +1490,25 @@ const ht = (w, t) => {
|
|
|
1490
1490
|
}),
|
|
1491
1491
|
p(u, { class: "input-toolbar-icon" }, {
|
|
1492
1492
|
default: b(() => [
|
|
1493
|
-
p(c(
|
|
1493
|
+
p(c(It))
|
|
1494
1494
|
]),
|
|
1495
1495
|
_: 1
|
|
1496
1496
|
})
|
|
1497
1497
|
])) : U("", !0),
|
|
1498
1498
|
e("div", la, [
|
|
1499
|
-
|
|
1499
|
+
kt(e("textarea", {
|
|
1500
1500
|
"onUpdate:modelValue": r[4] || (r[4] = (o) => Ce(k) ? k.value = o : null),
|
|
1501
|
-
onKeydown:
|
|
1501
|
+
onKeydown: wt(Ye(He, ["prevent"]), ["enter"]),
|
|
1502
1502
|
onPaste: it,
|
|
1503
1503
|
placeholder: "输入消息或粘贴文件...",
|
|
1504
1504
|
class: "message-input-textarea",
|
|
1505
1505
|
rows: "3"
|
|
1506
1506
|
}, null, 40, ia), [
|
|
1507
|
-
[
|
|
1507
|
+
[Ct, c(k)]
|
|
1508
1508
|
])
|
|
1509
1509
|
]),
|
|
1510
1510
|
e("div", oa, [
|
|
1511
|
-
p(
|
|
1511
|
+
p(A, {
|
|
1512
1512
|
type: "primary",
|
|
1513
1513
|
disabled: !c(k).trim() && E.value.length === 0,
|
|
1514
1514
|
onClick: He,
|
|
@@ -1535,7 +1535,7 @@ const ht = (w, t) => {
|
|
|
1535
1535
|
class: "empty-state-icon"
|
|
1536
1536
|
}, {
|
|
1537
1537
|
default: b(() => [
|
|
1538
|
-
p(c(
|
|
1538
|
+
p(c(zt))
|
|
1539
1539
|
]),
|
|
1540
1540
|
_: 1
|
|
1541
1541
|
}),
|
|
@@ -1547,11 +1547,11 @@ const ht = (w, t) => {
|
|
|
1547
1547
|
e("div", ua, [
|
|
1548
1548
|
e("div", va, [
|
|
1549
1549
|
e("img", {
|
|
1550
|
-
src: (ue =
|
|
1551
|
-
alt: (ze =
|
|
1550
|
+
src: (ue = B.value) == null ? void 0 : ue.avatar,
|
|
1551
|
+
alt: (ze = B.value) == null ? void 0 : ze.name,
|
|
1552
1552
|
class: "chat-detail-avatar"
|
|
1553
1553
|
}, null, 8, pa),
|
|
1554
|
-
e("div", ma, _((Se =
|
|
1554
|
+
e("div", ma, _((Se = B.value) == null ? void 0 : Se.name), 1),
|
|
1555
1555
|
r[20] || (r[20] = e("div", { class: "chat-detail-actions" }, [
|
|
1556
1556
|
e("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
|
|
1557
1557
|
e("div", { class: "chat-detail-action-item" }, "清空聊天记录")
|
|
@@ -1577,10 +1577,10 @@ const ht = (w, t) => {
|
|
|
1577
1577
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1578
1578
|
]),
|
|
1579
1579
|
e("div", ha, [
|
|
1580
|
-
c($) ? (n(),
|
|
1580
|
+
c($) ? (n(), K(y, {
|
|
1581
1581
|
key: 0,
|
|
1582
1582
|
description: "加载中..."
|
|
1583
|
-
})) : c(G).length === 0 ? (n(),
|
|
1583
|
+
})) : c(G).length === 0 ? (n(), K(y, {
|
|
1584
1584
|
key: 1,
|
|
1585
1585
|
description: "暂无用户"
|
|
1586
1586
|
})) : (n(!0), v(se, { key: 2 }, ae(c(G), (o) => (n(), v("div", {
|
|
@@ -1595,7 +1595,7 @@ const ht = (w, t) => {
|
|
|
1595
1595
|
}, null, 8, _a),
|
|
1596
1596
|
e("div", ya, _(o.username), 1)
|
|
1597
1597
|
]),
|
|
1598
|
-
p(
|
|
1598
|
+
p(A, {
|
|
1599
1599
|
type: "primary",
|
|
1600
1600
|
size: "small",
|
|
1601
1601
|
onClick: (te) => c(xe)(o)
|
|
@@ -1624,7 +1624,7 @@ const ht = (w, t) => {
|
|
|
1624
1624
|
e("div", ka, [
|
|
1625
1625
|
e("div", wa, [
|
|
1626
1626
|
e("img", {
|
|
1627
|
-
src: c(
|
|
1627
|
+
src: c(P),
|
|
1628
1628
|
alt: "头像",
|
|
1629
1629
|
class: "chat-settings-avatar"
|
|
1630
1630
|
}, null, 8, Ca),
|
|
@@ -1638,7 +1638,7 @@ const ht = (w, t) => {
|
|
|
1638
1638
|
class: "chat-settings-avatar-icon"
|
|
1639
1639
|
}, {
|
|
1640
1640
|
default: b(() => [
|
|
1641
|
-
p(c(
|
|
1641
|
+
p(c(Rt))
|
|
1642
1642
|
]),
|
|
1643
1643
|
_: 1
|
|
1644
1644
|
})
|
|
@@ -1657,8 +1657,8 @@ const ht = (w, t) => {
|
|
|
1657
1657
|
e("div", xa, "@" + _(c(C)), 1)
|
|
1658
1658
|
])
|
|
1659
1659
|
]),
|
|
1660
|
-
e("div",
|
|
1661
|
-
e("div",
|
|
1660
|
+
e("div", Va, [
|
|
1661
|
+
e("div", Aa, [
|
|
1662
1662
|
e("div", Sa, [
|
|
1663
1663
|
p(u, null, {
|
|
1664
1664
|
default: b(() => [
|
|
@@ -1668,7 +1668,7 @@ const ht = (w, t) => {
|
|
|
1668
1668
|
}),
|
|
1669
1669
|
r[23] || (r[23] = J(" 个人信息 ", -1))
|
|
1670
1670
|
]),
|
|
1671
|
-
j.value ? U("", !0) : (n(),
|
|
1671
|
+
j.value ? U("", !0) : (n(), K(A, {
|
|
1672
1672
|
key: 0,
|
|
1673
1673
|
type: "primary",
|
|
1674
1674
|
size: "small",
|
|
@@ -1684,7 +1684,7 @@ const ht = (w, t) => {
|
|
|
1684
1684
|
e("div", Fa, [
|
|
1685
1685
|
e("div", Ia, [
|
|
1686
1686
|
r[25] || (r[25] = e("label", { class: "chat-settings-form-label" }, "昵称", -1)),
|
|
1687
|
-
j.value ? (n(),
|
|
1687
|
+
j.value ? (n(), K(s, {
|
|
1688
1688
|
key: 0,
|
|
1689
1689
|
modelValue: D.value.nickname,
|
|
1690
1690
|
"onUpdate:modelValue": r[7] || (r[7] = (o) => D.value.nickname = o),
|
|
@@ -1694,7 +1694,7 @@ const ht = (w, t) => {
|
|
|
1694
1694
|
]),
|
|
1695
1695
|
e("div", Ra, [
|
|
1696
1696
|
r[26] || (r[26] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
|
|
1697
|
-
j.value ? (n(),
|
|
1697
|
+
j.value ? (n(), K(s, {
|
|
1698
1698
|
key: 0,
|
|
1699
1699
|
modelValue: D.value.email,
|
|
1700
1700
|
"onUpdate:modelValue": r[8] || (r[8] = (o) => D.value.email = o),
|
|
@@ -1704,7 +1704,7 @@ const ht = (w, t) => {
|
|
|
1704
1704
|
]),
|
|
1705
1705
|
e("div", Ta, [
|
|
1706
1706
|
r[27] || (r[27] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
|
|
1707
|
-
j.value ? (n(),
|
|
1707
|
+
j.value ? (n(), K(s, {
|
|
1708
1708
|
key: 0,
|
|
1709
1709
|
modelValue: D.value.phone,
|
|
1710
1710
|
"onUpdate:modelValue": r[9] || (r[9] = (o) => D.value.phone = o),
|
|
@@ -1714,7 +1714,7 @@ const ht = (w, t) => {
|
|
|
1714
1714
|
]),
|
|
1715
1715
|
e("div", Da, [
|
|
1716
1716
|
r[28] || (r[28] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
|
|
1717
|
-
j.value ? (n(),
|
|
1717
|
+
j.value ? (n(), K(s, {
|
|
1718
1718
|
key: 0,
|
|
1719
1719
|
modelValue: D.value.bio,
|
|
1720
1720
|
"onUpdate:modelValue": r[10] || (r[10] = (o) => D.value.bio = o),
|
|
@@ -1725,7 +1725,7 @@ const ht = (w, t) => {
|
|
|
1725
1725
|
}, null, 8, ["modelValue"])) : (n(), v("div", Ea, _(c(I).bio || "这个人很懒,什么都没写~"), 1))
|
|
1726
1726
|
]),
|
|
1727
1727
|
j.value ? (n(), v("div", qa, [
|
|
1728
|
-
p(
|
|
1728
|
+
p(A, {
|
|
1729
1729
|
size: "default",
|
|
1730
1730
|
onClick: ut
|
|
1731
1731
|
}, {
|
|
@@ -1734,7 +1734,7 @@ const ht = (w, t) => {
|
|
|
1734
1734
|
])]),
|
|
1735
1735
|
_: 1
|
|
1736
1736
|
}),
|
|
1737
|
-
p(
|
|
1737
|
+
p(A, {
|
|
1738
1738
|
type: "primary",
|
|
1739
1739
|
size: "default",
|
|
1740
1740
|
loading: X.value,
|
|
@@ -1752,16 +1752,16 @@ const ht = (w, t) => {
|
|
|
1752
1752
|
]),
|
|
1753
1753
|
_: 1
|
|
1754
1754
|
}, 8, ["modelValue"]),
|
|
1755
|
-
p(
|
|
1755
|
+
p(gt, {
|
|
1756
1756
|
modelValue: l.value,
|
|
1757
1757
|
"onUpdate:modelValue": r[12] || (r[12] = (o) => l.value = o),
|
|
1758
|
-
src:
|
|
1758
|
+
src: V.value,
|
|
1759
1759
|
onConfirm: ct
|
|
1760
1760
|
}, null, 8, ["modelValue", "src"]),
|
|
1761
1761
|
q.value.visible ? (n(), v("div", {
|
|
1762
1762
|
key: 1,
|
|
1763
1763
|
class: "chat-context-menu",
|
|
1764
|
-
style:
|
|
1764
|
+
style: Ut({ left: q.value.x + "px", top: q.value.y + "px" })
|
|
1765
1765
|
}, [
|
|
1766
1766
|
e("div", {
|
|
1767
1767
|
class: "chat-context-menu-item",
|
|
@@ -1771,61 +1771,61 @@ const ht = (w, t) => {
|
|
|
1771
1771
|
]);
|
|
1772
1772
|
};
|
|
1773
1773
|
}
|
|
1774
|
-
},
|
|
1774
|
+
}, Ka = /* @__PURE__ */ ht(Ba, [["__scopeId", "data-v-f5908195"]]), Wa = { class: "chat-container" }, Na = { class: "sidebar-nav" }, Pa = ["src"], Ha = ["onClick"], Oa = {
|
|
1775
1775
|
key: 0,
|
|
1776
1776
|
class: "nav-badge"
|
|
1777
|
-
},
|
|
1777
|
+
}, ja = { class: "content-panel" }, Xa = { class: "search-bar" }, Ya = { class: "content-scroll" }, Ga = { key: 0 }, Ja = ["onClick", "onContextmenu"], Qa = { class: "friend-avatar-wrapper" }, Za = ["src", "alt"], en = {
|
|
1778
1778
|
key: 0,
|
|
1779
1779
|
class: "online-indicator"
|
|
1780
|
-
},
|
|
1780
|
+
}, tn = { class: "friend-info" }, sn = { class: "friend-header" }, an = { class: "friend-name" }, nn = { class: "last-time" }, ln = { class: "friend-preview" }, on = { class: "last-msg" }, rn = {
|
|
1781
1781
|
key: 0,
|
|
1782
1782
|
class: "unread-badge"
|
|
1783
|
-
},
|
|
1783
|
+
}, cn = { key: 1 }, dn = { class: "add-friend-section" }, un = { class: "add-friend-icon" }, vn = ["onClick"], pn = { class: "friend-avatar-wrapper" }, mn = ["src", "alt"], fn = { class: "friend-info" }, hn = { class: "friend-name" }, gn = { key: 2 }, _n = { class: "request-info" }, yn = ["src", "alt"], bn = { class: "request-details" }, kn = { class: "request-username" }, wn = { class: "chat-area" }, Cn = {
|
|
1784
1784
|
key: 0,
|
|
1785
1785
|
class: "friend-profile"
|
|
1786
|
-
},
|
|
1786
|
+
}, Un = ["src", "alt"], $n = { class: "profile-name" }, xn = { class: "profile-status" }, Vn = {
|
|
1787
1787
|
key: 1,
|
|
1788
1788
|
class: "chat-window"
|
|
1789
|
-
}, An = { class: "chat-header" },
|
|
1789
|
+
}, An = { class: "chat-header" }, Sn = { class: "chat-title" }, Fn = { class: "chat-name" }, In = { class: "chat-actions" }, zn = { class: "message-avatar" }, Rn = ["src"], Ln = {
|
|
1790
1790
|
key: 0,
|
|
1791
1791
|
class: "sender-name"
|
|
1792
|
-
},
|
|
1792
|
+
}, Tn = { class: "message-bubble-wrapper" }, Mn = ["onClick"], Dn = ["src", "alt"], En = {
|
|
1793
1793
|
key: 0,
|
|
1794
1794
|
class: "image-size"
|
|
1795
|
-
},
|
|
1795
|
+
}, qn = ["onClick"], Bn = { class: "file-content" }, Kn = { class: "file-icon" }, Wn = { class: "file-info" }, Nn = { class: "file-name" }, Pn = { class: "file-meta" }, Hn = { key: 0 }, On = { class: "input-area" }, jn = {
|
|
1796
1796
|
key: 0,
|
|
1797
1797
|
class: "pending-files"
|
|
1798
|
-
},
|
|
1798
|
+
}, Xn = {
|
|
1799
1799
|
key: 0,
|
|
1800
1800
|
class: "pending-image-wrapper"
|
|
1801
|
-
},
|
|
1801
|
+
}, Yn = ["src", "alt"], Gn = ["onClick"], Jn = {
|
|
1802
1802
|
key: 1,
|
|
1803
1803
|
class: "pending-file-wrapper"
|
|
1804
|
-
},
|
|
1804
|
+
}, Qn = { class: "pending-file-name" }, Zn = ["onClick"], el = {
|
|
1805
1805
|
key: 1,
|
|
1806
1806
|
class: "input-actions"
|
|
1807
|
-
},
|
|
1807
|
+
}, tl = { class: "input-wrapper" }, sl = ["onKeydown"], al = { class: "send-btn-wrapper" }, nl = {
|
|
1808
1808
|
key: 2,
|
|
1809
1809
|
class: "empty-state"
|
|
1810
|
-
},
|
|
1810
|
+
}, ll = { class: "empty-text" }, il = {
|
|
1811
1811
|
key: 0,
|
|
1812
1812
|
class: "detail-panel"
|
|
1813
|
-
},
|
|
1813
|
+
}, ol = { class: "detail-content" }, rl = { class: "detail-profile" }, cl = ["src", "alt"], dl = { class: "detail-name" }, ul = { class: "search-users-wrapper" }, vl = { class: "search-users-input" }, pl = { class: "users-list-scroll" }, ml = { class: "available-user-info" }, fl = ["src", "alt"], hl = { class: "available-user-name" }, gl = { class: "settings-container" }, _l = { class: "settings-avatar-section" }, yl = { class: "settings-avatar-wrapper" }, bl = ["src"], kl = { class: "settings-user-display" }, wl = { class: "settings-nickname" }, Cl = { class: "settings-username" }, Ul = { class: "settings-form-section" }, $l = { class: "settings-form-header" }, xl = { class: "settings-form-title" }, Vl = { class: "settings-form" }, Al = { class: "settings-form-item" }, Sl = {
|
|
1814
1814
|
key: 1,
|
|
1815
1815
|
class: "settings-form-value"
|
|
1816
|
-
},
|
|
1816
|
+
}, Fl = { class: "settings-form-item" }, Il = {
|
|
1817
1817
|
key: 1,
|
|
1818
1818
|
class: "settings-form-value"
|
|
1819
|
-
},
|
|
1819
|
+
}, zl = { class: "settings-form-item" }, Rl = {
|
|
1820
1820
|
key: 1,
|
|
1821
1821
|
class: "settings-form-value"
|
|
1822
|
-
},
|
|
1822
|
+
}, Ll = { class: "settings-form-item" }, Tl = {
|
|
1823
1823
|
key: 1,
|
|
1824
1824
|
class: "settings-form-value bio-value"
|
|
1825
|
-
},
|
|
1825
|
+
}, Ml = {
|
|
1826
1826
|
key: 0,
|
|
1827
1827
|
class: "settings-form-actions"
|
|
1828
|
-
},
|
|
1828
|
+
}, Dl = {
|
|
1829
1829
|
__name: "ChatWindow",
|
|
1830
1830
|
props: {
|
|
1831
1831
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1838,7 +1838,7 @@ const ht = (w, t) => {
|
|
|
1838
1838
|
get: () => a.modelValue,
|
|
1839
1839
|
set: (u) => m("update:modelValue", u)
|
|
1840
1840
|
}), {
|
|
1841
|
-
myUsername:
|
|
1841
|
+
myUsername: P,
|
|
1842
1842
|
myAvatar: I,
|
|
1843
1843
|
userInfo: T,
|
|
1844
1844
|
loadingUserInfo: L,
|
|
@@ -1874,39 +1874,39 @@ const ht = (w, t) => {
|
|
|
1874
1874
|
addFriend: De,
|
|
1875
1875
|
loadFriendApplyList: Ee,
|
|
1876
1876
|
agreeFriend: qe,
|
|
1877
|
-
updateMyAvatar:
|
|
1878
|
-
getUserInfo:
|
|
1879
|
-
updateUserInfo:
|
|
1880
|
-
} =
|
|
1877
|
+
updateMyAvatar: Be,
|
|
1878
|
+
getUserInfo: Ke,
|
|
1879
|
+
updateUserInfo: We
|
|
1880
|
+
} = Tt(a.config), ve = ye(() => {
|
|
1881
1881
|
var s;
|
|
1882
1882
|
const u = [{ id: "chat", icon: Re, badge: 0 }];
|
|
1883
|
-
return a.config.modules.friends && u.push({ id: "friends", icon: Ge, badge: 0 }), a.config.modules.apply && u.push({ id: "apply", icon:
|
|
1884
|
-
}), ee = h("chat"),
|
|
1883
|
+
return a.config.modules.friends && u.push({ id: "friends", icon: Ge, badge: 0 }), a.config.modules.apply && u.push({ id: "apply", icon: $t, badge: ((s = M.value) == null ? void 0 : s.length) || 0 }), u;
|
|
1884
|
+
}), ee = h("chat"), B = h(null), F = h(null), O = h(null), j = h(!1), D = h(!1), X = h({ nickname: "", email: "", phone: "", bio: "" }), ge = h(!1), l = h(!1), d = h(!1), g = h(!1), V = h(null), le = h(""), E = h(null), q = h([]), pe = h({ visible: !1, x: 0, y: 0, chat: null }), Ve = () => {
|
|
1885
1885
|
pe.value.visible = !1;
|
|
1886
1886
|
}, Ze = async () => {
|
|
1887
1887
|
if (!pe.value.chat) return;
|
|
1888
|
-
await ke(pe.value.chat.id, 0) &&
|
|
1889
|
-
},
|
|
1890
|
-
|
|
1888
|
+
await ke(pe.value.chat.id, 0) && B.value === pe.value.chat.id && (B.value = null, F.value = null), Ve();
|
|
1889
|
+
}, Ae = (u) => {
|
|
1890
|
+
B.value = u.id, F.value = u, O.value = null, j.value = !1, ce({
|
|
1891
1891
|
id: u.id,
|
|
1892
1892
|
name: u.name,
|
|
1893
1893
|
avatar: u.avatar,
|
|
1894
1894
|
online: u.online
|
|
1895
1895
|
});
|
|
1896
1896
|
}, et = (u) => {
|
|
1897
|
-
O.value = u,
|
|
1897
|
+
O.value = u, B.value = null, F.value = null;
|
|
1898
1898
|
}, tt = async () => {
|
|
1899
1899
|
if (!O.value) return;
|
|
1900
1900
|
if (await ke(O.value.id)) {
|
|
1901
1901
|
ee.value = "chat", await Qe();
|
|
1902
1902
|
const s = G.value.find((y) => y.id === O.value.id);
|
|
1903
|
-
s &&
|
|
1903
|
+
s && Ae(s), O.value = null;
|
|
1904
1904
|
}
|
|
1905
1905
|
}, st = () => {
|
|
1906
1906
|
l.value = !0;
|
|
1907
1907
|
}, at = () => {
|
|
1908
1908
|
var u;
|
|
1909
|
-
(u =
|
|
1909
|
+
(u = V.value) == null || u.click();
|
|
1910
1910
|
}, nt = () => {
|
|
1911
1911
|
var u;
|
|
1912
1912
|
(u = E.value) == null || u.click();
|
|
@@ -1915,29 +1915,29 @@ const ht = (w, t) => {
|
|
|
1915
1915
|
if (s.length !== 0) {
|
|
1916
1916
|
for (const y of s) {
|
|
1917
1917
|
if (y.size > 50 * 1024 * 1024) {
|
|
1918
|
-
|
|
1918
|
+
N.warning(`文件 ${y.name} 超过50MB,已跳过`);
|
|
1919
1919
|
continue;
|
|
1920
1920
|
}
|
|
1921
|
-
const
|
|
1921
|
+
const A = URL.createObjectURL(y);
|
|
1922
1922
|
q.value.push({
|
|
1923
1923
|
id: Date.now() + Math.random(),
|
|
1924
1924
|
file: y,
|
|
1925
1925
|
name: y.name,
|
|
1926
1926
|
size: y.size,
|
|
1927
1927
|
type: y.type,
|
|
1928
|
-
previewUrl:
|
|
1928
|
+
previewUrl: A,
|
|
1929
1929
|
isImage: y.type.startsWith("image/")
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
1932
|
E.value && (E.value.value = "");
|
|
1933
1933
|
}
|
|
1934
|
-
},
|
|
1934
|
+
}, Ne = (u) => {
|
|
1935
1935
|
const s = q.value[u];
|
|
1936
1936
|
s.previewUrl && URL.revokeObjectURL(s.previewUrl), q.value.splice(u, 1);
|
|
1937
|
-
},
|
|
1937
|
+
}, Pe = (u) => {
|
|
1938
1938
|
if (u === 0) return "0 B";
|
|
1939
|
-
const s = 1024, y = ["B", "KB", "MB", "GB"],
|
|
1940
|
-
return parseFloat((u / Math.pow(s,
|
|
1939
|
+
const s = 1024, y = ["B", "KB", "MB", "GB"], A = Math.floor(Math.log(u) / Math.log(s));
|
|
1940
|
+
return parseFloat((u / Math.pow(s, A)).toFixed(2)) + " " + y[A];
|
|
1941
1941
|
}, He = async () => {
|
|
1942
1942
|
if (!S.value.trim() && q.value.length === 0) return;
|
|
1943
1943
|
const u = [...q.value], s = S.value;
|
|
@@ -1948,12 +1948,12 @@ const ht = (w, t) => {
|
|
|
1948
1948
|
var y;
|
|
1949
1949
|
const s = (y = u.clipboardData) == null ? void 0 : y.items;
|
|
1950
1950
|
if (s) {
|
|
1951
|
-
for (const
|
|
1952
|
-
if (
|
|
1953
|
-
const Y =
|
|
1951
|
+
for (const A of s)
|
|
1952
|
+
if (A.kind === "file") {
|
|
1953
|
+
const Y = A.getAsFile();
|
|
1954
1954
|
if (Y) {
|
|
1955
1955
|
if (Y.size > 50 * 1024 * 1024) {
|
|
1956
|
-
|
|
1956
|
+
N.warning(`文件 ${Y.name} 超过50MB,已跳过`);
|
|
1957
1957
|
continue;
|
|
1958
1958
|
}
|
|
1959
1959
|
const ue = URL.createObjectURL(Y);
|
|
@@ -1971,7 +1971,7 @@ const ht = (w, t) => {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
}, Oe = (u) => {
|
|
1973
1973
|
if (!u) {
|
|
1974
|
-
|
|
1974
|
+
N.warning("文件地址无效");
|
|
1975
1975
|
return;
|
|
1976
1976
|
}
|
|
1977
1977
|
window.open(u, "_blank");
|
|
@@ -1981,31 +1981,31 @@ const ht = (w, t) => {
|
|
|
1981
1981
|
const s = u.target.files[0];
|
|
1982
1982
|
if (!s) return;
|
|
1983
1983
|
if (!s.type.startsWith("image/")) {
|
|
1984
|
-
|
|
1984
|
+
N.error("只能上传图片文件");
|
|
1985
1985
|
return;
|
|
1986
1986
|
}
|
|
1987
1987
|
if (s.size > 5 * 1024 * 1024) {
|
|
1988
|
-
|
|
1988
|
+
N.error("图片大小不能超过 5MB");
|
|
1989
1989
|
return;
|
|
1990
1990
|
}
|
|
1991
1991
|
const y = new FileReader();
|
|
1992
|
-
y.onload = (
|
|
1993
|
-
le.value =
|
|
1992
|
+
y.onload = (A) => {
|
|
1993
|
+
le.value = A.target.result, d.value = !0;
|
|
1994
1994
|
}, y.readAsDataURL(s);
|
|
1995
1995
|
}, ct = async ({ file: u }) => {
|
|
1996
1996
|
if (u) {
|
|
1997
1997
|
g.value = !0;
|
|
1998
1998
|
try {
|
|
1999
|
-
const { ChatApi: s } = await Promise.resolve().then(() =>
|
|
2000
|
-
|
|
1999
|
+
const { ChatApi: s } = await Promise.resolve().then(() => Lt), A = await new s(a.config).uploadAvatar(u, P);
|
|
2000
|
+
A.code === 200 ? (N.success("头像上传成功"), Be(A.data), je()) : N.error(A.msg || "头像上传失败");
|
|
2001
2001
|
} catch (s) {
|
|
2002
|
-
console.error(s),
|
|
2002
|
+
console.error(s), N.error("头像上传失败");
|
|
2003
2003
|
} finally {
|
|
2004
2004
|
g.value = !1;
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
}, je = () => {
|
|
2008
|
-
le.value = "", d.value = !1,
|
|
2008
|
+
le.value = "", d.value = !1, V.value && (V.value.value = "");
|
|
2009
2009
|
}, dt = () => {
|
|
2010
2010
|
X.value = {
|
|
2011
2011
|
nickname: T.value.nickname || "",
|
|
@@ -2018,24 +2018,24 @@ const ht = (w, t) => {
|
|
|
2018
2018
|
}, vt = async () => {
|
|
2019
2019
|
ge.value = !0;
|
|
2020
2020
|
try {
|
|
2021
|
-
await
|
|
2021
|
+
await We(X.value) ? (N.success("保存成功"), D.value = !1) : N.error("保存失败");
|
|
2022
2022
|
} catch (u) {
|
|
2023
|
-
console.error(u),
|
|
2023
|
+
console.error(u), N.error("保存失败");
|
|
2024
2024
|
} finally {
|
|
2025
2025
|
ge.value = !1;
|
|
2026
2026
|
}
|
|
2027
2027
|
}, f = () => {
|
|
2028
2028
|
Ie(), Fe(), j.value = !1, l.value = !1, je(), D.value = !1, m("close");
|
|
2029
2029
|
}, r = async () => {
|
|
2030
|
-
await Promise.all([Ue(), Ee(),
|
|
2030
|
+
await Promise.all([Ue(), Ee(), Ke()]), Me(), G.value.length > 0 && Ae(G.value[0]), m("open");
|
|
2031
2031
|
};
|
|
2032
|
-
return
|
|
2033
|
-
document.addEventListener("click",
|
|
2034
|
-
}),
|
|
2035
|
-
document.removeEventListener("click",
|
|
2032
|
+
return _t(() => {
|
|
2033
|
+
document.addEventListener("click", Ve);
|
|
2034
|
+
}), yt(() => {
|
|
2035
|
+
document.removeEventListener("click", Ve), Fe();
|
|
2036
2036
|
}), (u, s) => {
|
|
2037
|
-
const y = ie("el-icon"),
|
|
2038
|
-
return n(),
|
|
2037
|
+
const y = ie("el-icon"), A = ie("el-input"), Y = ie("el-empty"), ue = ie("el-button"), ze = ie("el-dialog");
|
|
2038
|
+
return n(), K(ze, {
|
|
2039
2039
|
modelValue: C.value,
|
|
2040
2040
|
"onUpdate:modelValue": s[13] || (s[13] = (Se) => C.value = Se),
|
|
2041
2041
|
width: w.width,
|
|
@@ -2048,8 +2048,8 @@ const ht = (w, t) => {
|
|
|
2048
2048
|
default: b(() => {
|
|
2049
2049
|
var Se, o, te;
|
|
2050
2050
|
return [
|
|
2051
|
-
e("div",
|
|
2052
|
-
e("div",
|
|
2051
|
+
e("div", Wa, [
|
|
2052
|
+
e("div", Na, [
|
|
2053
2053
|
e("div", {
|
|
2054
2054
|
class: "sidebar-avatar",
|
|
2055
2055
|
onClick: st
|
|
@@ -2062,7 +2062,7 @@ const ht = (w, t) => {
|
|
|
2062
2062
|
]),
|
|
2063
2063
|
(n(!0), v(se, null, ae(ve.value, (i) => (n(), v("div", {
|
|
2064
2064
|
key: i.id,
|
|
2065
|
-
class:
|
|
2065
|
+
class: W([
|
|
2066
2066
|
"nav-item",
|
|
2067
2067
|
ee.value === i.id ? "nav-item-active" : "nav-item-inactive"
|
|
2068
2068
|
]),
|
|
@@ -2070,12 +2070,12 @@ const ht = (w, t) => {
|
|
|
2070
2070
|
}, [
|
|
2071
2071
|
p(y, { size: 24 }, {
|
|
2072
2072
|
default: b(() => [
|
|
2073
|
-
(n(),
|
|
2073
|
+
(n(), K(bt(i.icon)))
|
|
2074
2074
|
]),
|
|
2075
2075
|
_: 2
|
|
2076
2076
|
}, 1024),
|
|
2077
|
-
i.badge ? (n(), v("span",
|
|
2078
|
-
], 10,
|
|
2077
|
+
i.badge ? (n(), v("span", Oa, _(i.badge > 99 ? "99+" : i.badge), 1)) : U("", !0)
|
|
2078
|
+
], 10, Ha))), 128)),
|
|
2079
2079
|
s[14] || (s[14] = e("div", { class: "nav-spacer" }, null, -1)),
|
|
2080
2080
|
w.config.modules.settings ? (n(), v("div", {
|
|
2081
2081
|
key: 0,
|
|
@@ -2085,65 +2085,65 @@ const ht = (w, t) => {
|
|
|
2085
2085
|
}, [
|
|
2086
2086
|
p(y, { size: 24 }, {
|
|
2087
2087
|
default: b(() => [
|
|
2088
|
-
p(c(
|
|
2088
|
+
p(c(xt))
|
|
2089
2089
|
]),
|
|
2090
2090
|
_: 1
|
|
2091
2091
|
})
|
|
2092
2092
|
])) : U("", !0)
|
|
2093
2093
|
]),
|
|
2094
|
-
e("div",
|
|
2095
|
-
e("div",
|
|
2096
|
-
p(
|
|
2094
|
+
e("div", ja, [
|
|
2095
|
+
e("div", Xa, [
|
|
2096
|
+
p(A, {
|
|
2097
2097
|
modelValue: c(k),
|
|
2098
2098
|
"onUpdate:modelValue": s[1] || (s[1] = (i) => Ce(k) ? k.value = i : null),
|
|
2099
2099
|
placeholder: "搜索",
|
|
2100
2100
|
"prefix-icon": c(Le)
|
|
2101
2101
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2102
2102
|
]),
|
|
2103
|
-
e("div",
|
|
2104
|
-
ee.value === "chat" ? (n(), v("div",
|
|
2103
|
+
e("div", Ya, [
|
|
2104
|
+
ee.value === "chat" ? (n(), v("div", Ga, [
|
|
2105
2105
|
(n(!0), v(se, null, ae(c(G), (i) => (n(), v("div", {
|
|
2106
2106
|
key: i.id,
|
|
2107
|
-
class:
|
|
2107
|
+
class: W([
|
|
2108
2108
|
"chat-item",
|
|
2109
|
-
|
|
2109
|
+
B.value === i.id ? "chat-item-active" : ""
|
|
2110
2110
|
]),
|
|
2111
|
-
onClick: (me) =>
|
|
2111
|
+
onClick: (me) => Ae(i),
|
|
2112
2112
|
onContextmenu: Ye((me) => u.showContextMenu(me, i), ["prevent", "stop"])
|
|
2113
2113
|
}, [
|
|
2114
|
-
e("div",
|
|
2114
|
+
e("div", Qa, [
|
|
2115
2115
|
e("img", {
|
|
2116
2116
|
src: i.avatar,
|
|
2117
2117
|
alt: i.name,
|
|
2118
2118
|
class: "friend-avatar"
|
|
2119
|
-
}, null, 8,
|
|
2120
|
-
i.online ? (n(), v("span",
|
|
2119
|
+
}, null, 8, Za),
|
|
2120
|
+
i.online ? (n(), v("span", en)) : U("", !0)
|
|
2121
2121
|
]),
|
|
2122
|
-
e("div",
|
|
2123
|
-
e("div",
|
|
2124
|
-
e("span",
|
|
2125
|
-
e("span",
|
|
2122
|
+
e("div", tn, [
|
|
2123
|
+
e("div", sn, [
|
|
2124
|
+
e("span", an, _(i.name), 1),
|
|
2125
|
+
e("span", nn, _(c(re)(i.lastTime)), 1)
|
|
2126
2126
|
]),
|
|
2127
|
-
e("div",
|
|
2128
|
-
e("span",
|
|
2129
|
-
i.unread > 0 ? (n(), v("span",
|
|
2127
|
+
e("div", ln, [
|
|
2128
|
+
e("span", on, _(i.lastMsg), 1),
|
|
2129
|
+
i.unread > 0 ? (n(), v("span", rn, _(i.unread > 99 ? "99+" : i.unread), 1)) : U("", !0)
|
|
2130
2130
|
])
|
|
2131
2131
|
])
|
|
2132
|
-
], 42,
|
|
2132
|
+
], 42, Ja))), 128))
|
|
2133
2133
|
])) : U("", !0),
|
|
2134
|
-
ee.value === "friends" && w.config.modules.friends ? (n(), v("div",
|
|
2135
|
-
e("div",
|
|
2134
|
+
ee.value === "friends" && w.config.modules.friends ? (n(), v("div", cn, [
|
|
2135
|
+
e("div", dn, [
|
|
2136
2136
|
e("div", {
|
|
2137
2137
|
class: "add-friend-btn",
|
|
2138
2138
|
onClick: s[2] || (s[2] = (...i) => c(xe) && c(xe)(...i))
|
|
2139
2139
|
}, [
|
|
2140
|
-
e("div",
|
|
2140
|
+
e("div", un, [
|
|
2141
2141
|
p(y, {
|
|
2142
2142
|
class: "text-white",
|
|
2143
2143
|
size: 20
|
|
2144
2144
|
}, {
|
|
2145
2145
|
default: b(() => [
|
|
2146
|
-
p(c(
|
|
2146
|
+
p(c(Vt))
|
|
2147
2147
|
]),
|
|
2148
2148
|
_: 1
|
|
2149
2149
|
})
|
|
@@ -2156,43 +2156,43 @@ const ht = (w, t) => {
|
|
|
2156
2156
|
class: "chat-item",
|
|
2157
2157
|
onClick: (me) => et(i)
|
|
2158
2158
|
}, [
|
|
2159
|
-
e("div",
|
|
2159
|
+
e("div", pn, [
|
|
2160
2160
|
e("img", {
|
|
2161
2161
|
src: i.avatar,
|
|
2162
2162
|
alt: i.name,
|
|
2163
2163
|
class: "friend-avatar"
|
|
2164
|
-
}, null, 8,
|
|
2164
|
+
}, null, 8, mn),
|
|
2165
2165
|
e("span", {
|
|
2166
|
-
class:
|
|
2166
|
+
class: W([
|
|
2167
2167
|
"online-indicator",
|
|
2168
2168
|
i.online ? "online" : "offline"
|
|
2169
2169
|
])
|
|
2170
2170
|
}, null, 2)
|
|
2171
2171
|
]),
|
|
2172
|
-
e("div",
|
|
2173
|
-
e("span",
|
|
2172
|
+
e("div", fn, [
|
|
2173
|
+
e("span", hn, _(i.name), 1)
|
|
2174
2174
|
])
|
|
2175
|
-
], 8,
|
|
2175
|
+
], 8, vn))), 128))
|
|
2176
2176
|
])) : U("", !0),
|
|
2177
|
-
ee.value === "apply" && w.config.modules.apply ? (n(), v("div",
|
|
2178
|
-
c(Z) ? (n(),
|
|
2177
|
+
ee.value === "apply" && w.config.modules.apply ? (n(), v("div", gn, [
|
|
2178
|
+
c(Z) ? (n(), K(Y, {
|
|
2179
2179
|
key: 0,
|
|
2180
2180
|
description: "加载中..."
|
|
2181
|
-
})) : c(M).length === 0 ? (n(),
|
|
2181
|
+
})) : c(M).length === 0 ? (n(), K(Y, {
|
|
2182
2182
|
key: 1,
|
|
2183
2183
|
description: "暂无好友申请"
|
|
2184
2184
|
})) : (n(!0), v(se, { key: 2 }, ae(c(M), (i) => (n(), v("div", {
|
|
2185
2185
|
key: i.applyUser || i.id,
|
|
2186
2186
|
class: "friend-request-item"
|
|
2187
2187
|
}, [
|
|
2188
|
-
e("div",
|
|
2188
|
+
e("div", _n, [
|
|
2189
2189
|
e("img", {
|
|
2190
2190
|
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.applyUser}`,
|
|
2191
2191
|
alt: i.applyUser,
|
|
2192
2192
|
class: "request-avatar"
|
|
2193
|
-
}, null, 8,
|
|
2194
|
-
e("div",
|
|
2195
|
-
e("div",
|
|
2193
|
+
}, null, 8, yn),
|
|
2194
|
+
e("div", bn, [
|
|
2195
|
+
e("div", kn, _(i.applyUser), 1),
|
|
2196
2196
|
s[16] || (s[16] = e("div", { class: "request-desc" }, "请求添加你为好友", -1))
|
|
2197
2197
|
])
|
|
2198
2198
|
]),
|
|
@@ -2210,17 +2210,17 @@ const ht = (w, t) => {
|
|
|
2210
2210
|
])) : U("", !0)
|
|
2211
2211
|
])
|
|
2212
2212
|
]),
|
|
2213
|
-
e("div",
|
|
2214
|
-
O.value && !F.value ? (n(), v("div",
|
|
2213
|
+
e("div", wn, [
|
|
2214
|
+
O.value && !F.value ? (n(), v("div", Cn, [
|
|
2215
2215
|
e("img", {
|
|
2216
2216
|
src: O.value.avatar,
|
|
2217
2217
|
alt: O.value.name,
|
|
2218
2218
|
class: "profile-avatar"
|
|
2219
|
-
}, null, 8,
|
|
2220
|
-
e("div",
|
|
2221
|
-
e("div",
|
|
2219
|
+
}, null, 8, Un),
|
|
2220
|
+
e("div", $n, _(O.value.name), 1),
|
|
2221
|
+
e("div", xn, [
|
|
2222
2222
|
e("span", {
|
|
2223
|
-
class:
|
|
2223
|
+
class: W([
|
|
2224
2224
|
"status-dot",
|
|
2225
2225
|
O.value.online ? "status-online" : "status-offline"
|
|
2226
2226
|
])
|
|
@@ -2245,18 +2245,18 @@ const ht = (w, t) => {
|
|
|
2245
2245
|
_: 1
|
|
2246
2246
|
})
|
|
2247
2247
|
])) : U("", !0),
|
|
2248
|
-
F.value ? (n(), v("div",
|
|
2248
|
+
F.value ? (n(), v("div", Vn, [
|
|
2249
2249
|
e("div", An, [
|
|
2250
|
-
e("div",
|
|
2251
|
-
e("span",
|
|
2250
|
+
e("div", Sn, [
|
|
2251
|
+
e("span", Fn, _(F.value.name), 1),
|
|
2252
2252
|
e("span", {
|
|
2253
|
-
class:
|
|
2253
|
+
class: W([
|
|
2254
2254
|
"status-badge",
|
|
2255
2255
|
F.value.online ? "status-badge-online" : "status-badge-offline"
|
|
2256
2256
|
])
|
|
2257
2257
|
}, _(F.value.online ? "在线" : "离线"), 3)
|
|
2258
2258
|
]),
|
|
2259
|
-
e("div",
|
|
2259
|
+
e("div", In, [
|
|
2260
2260
|
p(y, { class: "action-icon" }, {
|
|
2261
2261
|
default: b(() => [
|
|
2262
2262
|
p(c(Le))
|
|
@@ -2281,34 +2281,34 @@ const ht = (w, t) => {
|
|
|
2281
2281
|
}, [
|
|
2282
2282
|
(n(!0), v(se, null, ae(c(Q), (i, me) => (n(), v("div", {
|
|
2283
2283
|
key: me,
|
|
2284
|
-
class:
|
|
2284
|
+
class: W([
|
|
2285
2285
|
"message-wrapper",
|
|
2286
2286
|
i.isSelf ? "message-self" : "message-other"
|
|
2287
2287
|
])
|
|
2288
2288
|
}, [
|
|
2289
|
-
e("div",
|
|
2289
|
+
e("div", zn, [
|
|
2290
2290
|
e("img", {
|
|
2291
2291
|
src: i.isSelf ? c(I) : F.value.avatar,
|
|
2292
2292
|
class: "avatar-sm"
|
|
2293
|
-
}, null, 8,
|
|
2293
|
+
}, null, 8, Rn)
|
|
2294
2294
|
]),
|
|
2295
2295
|
e("div", {
|
|
2296
|
-
class:
|
|
2296
|
+
class: W([
|
|
2297
2297
|
"message-content-wrapper",
|
|
2298
2298
|
i.isSelf ? "content-self" : "content-other"
|
|
2299
2299
|
])
|
|
2300
2300
|
}, [
|
|
2301
|
-
i.isSelf ? U("", !0) : (n(), v("div",
|
|
2302
|
-
e("div",
|
|
2301
|
+
i.isSelf ? U("", !0) : (n(), v("div", Ln, _(F.value.name), 1)),
|
|
2302
|
+
e("div", Tn, [
|
|
2303
2303
|
i.type === "text" ? (n(), v("div", {
|
|
2304
2304
|
key: 0,
|
|
2305
|
-
class:
|
|
2305
|
+
class: W([
|
|
2306
2306
|
"message-bubble",
|
|
2307
2307
|
i.isSelf ? "bubble-self" : "bubble-other"
|
|
2308
2308
|
])
|
|
2309
2309
|
}, _(i.text), 3)) : i.type === "file" && i.fileType === "image" ? (n(), v("div", {
|
|
2310
2310
|
key: 1,
|
|
2311
|
-
class:
|
|
2311
|
+
class: W([
|
|
2312
2312
|
"message-bubble",
|
|
2313
2313
|
"image-bubble",
|
|
2314
2314
|
i.isSelf ? "bubble-self" : "bubble-other"
|
|
@@ -2320,43 +2320,43 @@ const ht = (w, t) => {
|
|
|
2320
2320
|
alt: i.fileName,
|
|
2321
2321
|
class: "message-image",
|
|
2322
2322
|
onError: ot
|
|
2323
|
-
}, null, 40,
|
|
2324
|
-
i.fileSize ? (n(), v("div",
|
|
2325
|
-
], 10,
|
|
2323
|
+
}, null, 40, Dn),
|
|
2324
|
+
i.fileSize ? (n(), v("div", En, _(Pe(i.fileSize)), 1)) : U("", !0)
|
|
2325
|
+
], 10, Mn)) : i.type === "file" ? (n(), v("div", {
|
|
2326
2326
|
key: 2,
|
|
2327
|
-
class:
|
|
2327
|
+
class: W([
|
|
2328
2328
|
"message-bubble",
|
|
2329
2329
|
"file-bubble",
|
|
2330
2330
|
i.isSelf ? "bubble-self" : "bubble-other"
|
|
2331
2331
|
]),
|
|
2332
2332
|
onClick: (pt) => Oe(i.fileUrl)
|
|
2333
2333
|
}, [
|
|
2334
|
-
e("div",
|
|
2335
|
-
e("div",
|
|
2334
|
+
e("div", Bn, [
|
|
2335
|
+
e("div", Kn, [
|
|
2336
2336
|
p(y, { size: 28 }, {
|
|
2337
2337
|
default: b(() => [
|
|
2338
|
-
p(c(
|
|
2338
|
+
p(c(St))
|
|
2339
2339
|
]),
|
|
2340
2340
|
_: 1
|
|
2341
2341
|
})
|
|
2342
2342
|
]),
|
|
2343
|
-
e("div",
|
|
2344
|
-
e("div",
|
|
2343
|
+
e("div", Wn, [
|
|
2344
|
+
e("div", Nn, _(i.fileName || i.text), 1),
|
|
2345
2345
|
e("div", Pn, [
|
|
2346
2346
|
p(y, { size: 12 }, {
|
|
2347
2347
|
default: b(() => [
|
|
2348
|
-
p(c(
|
|
2348
|
+
p(c(Ft))
|
|
2349
2349
|
]),
|
|
2350
2350
|
_: 1
|
|
2351
2351
|
}),
|
|
2352
2352
|
s[19] || (s[19] = e("span", null, "点击下载", -1)),
|
|
2353
|
-
i.fileSize ? (n(), v("span",
|
|
2353
|
+
i.fileSize ? (n(), v("span", Hn, "· " + _(Pe(i.fileSize)), 1)) : U("", !0)
|
|
2354
2354
|
])
|
|
2355
2355
|
])
|
|
2356
2356
|
])
|
|
2357
|
-
], 10,
|
|
2357
|
+
], 10, qn)) : U("", !0),
|
|
2358
2358
|
e("div", {
|
|
2359
|
-
class:
|
|
2359
|
+
class: W([
|
|
2360
2360
|
"message-time",
|
|
2361
2361
|
i.isSelf ? "time-right" : "time-left"
|
|
2362
2362
|
])
|
|
@@ -2365,38 +2365,38 @@ const ht = (w, t) => {
|
|
|
2365
2365
|
], 2)
|
|
2366
2366
|
], 2))), 128))
|
|
2367
2367
|
], 512),
|
|
2368
|
-
e("div",
|
|
2369
|
-
q.value.length > 0 ? (n(), v("div",
|
|
2368
|
+
e("div", On, [
|
|
2369
|
+
q.value.length > 0 ? (n(), v("div", jn, [
|
|
2370
2370
|
(n(!0), v(se, null, ae(q.value, (i, me) => (n(), v("div", {
|
|
2371
2371
|
key: i.id,
|
|
2372
2372
|
class: "pending-file"
|
|
2373
2373
|
}, [
|
|
2374
|
-
i.isImage ? (n(), v("div",
|
|
2374
|
+
i.isImage ? (n(), v("div", Xn, [
|
|
2375
2375
|
e("img", {
|
|
2376
2376
|
src: i.previewUrl,
|
|
2377
2377
|
alt: i.name,
|
|
2378
2378
|
class: "pending-image"
|
|
2379
|
-
}, null, 8,
|
|
2379
|
+
}, null, 8, Yn),
|
|
2380
2380
|
e("button", {
|
|
2381
|
-
onClick: (pt) =>
|
|
2381
|
+
onClick: (pt) => Ne(me),
|
|
2382
2382
|
class: "remove-file-btn"
|
|
2383
|
-
}, " × ", 8,
|
|
2384
|
-
])) : (n(), v("div",
|
|
2383
|
+
}, " × ", 8, Gn)
|
|
2384
|
+
])) : (n(), v("div", Jn, [
|
|
2385
2385
|
p(y, { class: "pending-file-icon" }, {
|
|
2386
2386
|
default: b(() => [
|
|
2387
2387
|
p(c(Je))
|
|
2388
2388
|
]),
|
|
2389
2389
|
_: 1
|
|
2390
2390
|
}),
|
|
2391
|
-
e("span",
|
|
2391
|
+
e("span", Qn, _(i.name), 1),
|
|
2392
2392
|
e("button", {
|
|
2393
|
-
onClick: (pt) =>
|
|
2393
|
+
onClick: (pt) => Ne(me),
|
|
2394
2394
|
class: "remove-file-btn"
|
|
2395
|
-
}, " × ", 8,
|
|
2395
|
+
}, " × ", 8, Zn)
|
|
2396
2396
|
]))
|
|
2397
2397
|
]))), 128))
|
|
2398
2398
|
])) : U("", !0),
|
|
2399
|
-
w.config.modules.fileUpload ? (n(), v("div",
|
|
2399
|
+
w.config.modules.fileUpload ? (n(), v("div", el, [
|
|
2400
2400
|
p(y, { class: "action-icon" }, {
|
|
2401
2401
|
default: b(() => [
|
|
2402
2402
|
p(c(Re))
|
|
@@ -2414,24 +2414,24 @@ const ht = (w, t) => {
|
|
|
2414
2414
|
}),
|
|
2415
2415
|
p(y, { class: "action-icon" }, {
|
|
2416
2416
|
default: b(() => [
|
|
2417
|
-
p(c(
|
|
2417
|
+
p(c(It))
|
|
2418
2418
|
]),
|
|
2419
2419
|
_: 1
|
|
2420
2420
|
})
|
|
2421
2421
|
])) : U("", !0),
|
|
2422
|
-
e("div",
|
|
2423
|
-
|
|
2422
|
+
e("div", tl, [
|
|
2423
|
+
kt(e("textarea", {
|
|
2424
2424
|
"onUpdate:modelValue": s[4] || (s[4] = (i) => Ce(S) ? S.value = i : null),
|
|
2425
|
-
onKeydown:
|
|
2425
|
+
onKeydown: wt(Ye(He, ["prevent"]), ["enter"]),
|
|
2426
2426
|
onPaste: it,
|
|
2427
2427
|
placeholder: "输入消息或粘贴文件...",
|
|
2428
2428
|
class: "message-input",
|
|
2429
2429
|
rows: "3"
|
|
2430
|
-
}, null, 40,
|
|
2431
|
-
[
|
|
2430
|
+
}, null, 40, sl), [
|
|
2431
|
+
[Ct, c(S)]
|
|
2432
2432
|
])
|
|
2433
2433
|
]),
|
|
2434
|
-
e("div",
|
|
2434
|
+
e("div", al, [
|
|
2435
2435
|
p(ue, {
|
|
2436
2436
|
type: "primary",
|
|
2437
2437
|
disabled: !c(S).trim() && q.value.length === 0,
|
|
@@ -2453,29 +2453,29 @@ const ht = (w, t) => {
|
|
|
2453
2453
|
onChange: lt
|
|
2454
2454
|
}, null, 544)
|
|
2455
2455
|
])
|
|
2456
|
-
])) : O.value ? U("", !0) : (n(), v("div",
|
|
2456
|
+
])) : O.value ? U("", !0) : (n(), v("div", nl, [
|
|
2457
2457
|
p(y, {
|
|
2458
2458
|
size: 64,
|
|
2459
2459
|
class: "empty-icon"
|
|
2460
2460
|
}, {
|
|
2461
2461
|
default: b(() => [
|
|
2462
|
-
p(c(
|
|
2462
|
+
p(c(zt))
|
|
2463
2463
|
]),
|
|
2464
2464
|
_: 1
|
|
2465
2465
|
}),
|
|
2466
|
-
e("div",
|
|
2466
|
+
e("div", ll, _(ee.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
2467
2467
|
]))
|
|
2468
2468
|
]),
|
|
2469
|
-
j.value ? (n(), v("div",
|
|
2469
|
+
j.value ? (n(), v("div", il, [
|
|
2470
2470
|
s[22] || (s[22] = e("div", { class: "detail-header" }, "聊天详情", -1)),
|
|
2471
|
-
e("div",
|
|
2472
|
-
e("div",
|
|
2471
|
+
e("div", ol, [
|
|
2472
|
+
e("div", rl, [
|
|
2473
2473
|
e("img", {
|
|
2474
2474
|
src: (Se = F.value) == null ? void 0 : Se.avatar,
|
|
2475
2475
|
alt: (o = F.value) == null ? void 0 : o.name,
|
|
2476
2476
|
class: "detail-avatar"
|
|
2477
|
-
}, null, 8,
|
|
2478
|
-
e("div",
|
|
2477
|
+
}, null, 8, cl),
|
|
2478
|
+
e("div", dl, _((te = F.value) == null ? void 0 : te.name), 1),
|
|
2479
2479
|
s[21] || (s[21] = e("div", { class: "detail-actions" }, [
|
|
2480
2480
|
e("div", { class: "detail-action-item" }, "查找聊天记录"),
|
|
2481
2481
|
e("div", { class: "detail-action-item" }, "清空聊天记录")
|
|
@@ -2492,9 +2492,9 @@ const ht = (w, t) => {
|
|
|
2492
2492
|
"append-to-body": ""
|
|
2493
2493
|
}, {
|
|
2494
2494
|
default: b(() => [
|
|
2495
|
-
e("div",
|
|
2496
|
-
e("div",
|
|
2497
|
-
p(
|
|
2495
|
+
e("div", ul, [
|
|
2496
|
+
e("div", vl, [
|
|
2497
|
+
p(A, {
|
|
2498
2498
|
modelValue: c(_e),
|
|
2499
2499
|
"onUpdate:modelValue": s[5] || (s[5] = (i) => Ce(_e) ? _e.value = i : null),
|
|
2500
2500
|
placeholder: "搜索用户",
|
|
@@ -2502,24 +2502,24 @@ const ht = (w, t) => {
|
|
|
2502
2502
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2503
2503
|
])
|
|
2504
2504
|
]),
|
|
2505
|
-
e("div",
|
|
2506
|
-
c(R) ? (n(),
|
|
2505
|
+
e("div", pl, [
|
|
2506
|
+
c(R) ? (n(), K(Y, {
|
|
2507
2507
|
key: 0,
|
|
2508
2508
|
description: "加载中..."
|
|
2509
|
-
})) : c(fe).length === 0 ? (n(),
|
|
2509
|
+
})) : c(fe).length === 0 ? (n(), K(Y, {
|
|
2510
2510
|
key: 1,
|
|
2511
2511
|
description: "暂无用户"
|
|
2512
2512
|
})) : (n(!0), v(se, { key: 2 }, ae(c(fe), (i) => (n(), v("div", {
|
|
2513
2513
|
key: i.username,
|
|
2514
2514
|
class: "available-user-item"
|
|
2515
2515
|
}, [
|
|
2516
|
-
e("div",
|
|
2516
|
+
e("div", ml, [
|
|
2517
2517
|
e("img", {
|
|
2518
2518
|
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.username}`,
|
|
2519
2519
|
alt: i.username,
|
|
2520
2520
|
class: "available-user-avatar"
|
|
2521
|
-
}, null, 8,
|
|
2522
|
-
e("div",
|
|
2521
|
+
}, null, 8, fl),
|
|
2522
|
+
e("div", hl, _(i.username), 1)
|
|
2523
2523
|
]),
|
|
2524
2524
|
p(ue, {
|
|
2525
2525
|
type: "primary",
|
|
@@ -2546,14 +2546,14 @@ const ht = (w, t) => {
|
|
|
2546
2546
|
class: "settings-dialog"
|
|
2547
2547
|
}, {
|
|
2548
2548
|
default: b(() => [
|
|
2549
|
-
e("div",
|
|
2550
|
-
e("div",
|
|
2551
|
-
e("div",
|
|
2549
|
+
e("div", gl, [
|
|
2550
|
+
e("div", _l, [
|
|
2551
|
+
e("div", yl, [
|
|
2552
2552
|
e("img", {
|
|
2553
2553
|
src: c(I),
|
|
2554
2554
|
alt: "头像",
|
|
2555
2555
|
class: "settings-avatar"
|
|
2556
|
-
}, null, 8,
|
|
2556
|
+
}, null, 8, bl),
|
|
2557
2557
|
w.config.modules.avatarCrop ? (n(), v("div", {
|
|
2558
2558
|
key: 0,
|
|
2559
2559
|
class: "settings-avatar-edit",
|
|
@@ -2564,28 +2564,28 @@ const ht = (w, t) => {
|
|
|
2564
2564
|
class: "settings-avatar-icon"
|
|
2565
2565
|
}, {
|
|
2566
2566
|
default: b(() => [
|
|
2567
|
-
p(c(
|
|
2567
|
+
p(c(Rt))
|
|
2568
2568
|
]),
|
|
2569
2569
|
_: 1
|
|
2570
2570
|
})
|
|
2571
2571
|
])) : U("", !0),
|
|
2572
2572
|
e("input", {
|
|
2573
2573
|
ref_key: "avatarInputRef",
|
|
2574
|
-
ref:
|
|
2574
|
+
ref: V,
|
|
2575
2575
|
type: "file",
|
|
2576
2576
|
accept: "image/*",
|
|
2577
2577
|
class: "hidden-avatar-input",
|
|
2578
2578
|
onChange: rt
|
|
2579
2579
|
}, null, 544)
|
|
2580
2580
|
]),
|
|
2581
|
-
e("div",
|
|
2582
|
-
e("div",
|
|
2583
|
-
e("div",
|
|
2581
|
+
e("div", kl, [
|
|
2582
|
+
e("div", wl, _(c(T).nickname || c(P)), 1),
|
|
2583
|
+
e("div", Cl, "@" + _(c(P)), 1)
|
|
2584
2584
|
])
|
|
2585
2585
|
]),
|
|
2586
|
-
e("div",
|
|
2587
|
-
e("div",
|
|
2588
|
-
e("div",
|
|
2586
|
+
e("div", Ul, [
|
|
2587
|
+
e("div", $l, [
|
|
2588
|
+
e("div", xl, [
|
|
2589
2589
|
p(y, null, {
|
|
2590
2590
|
default: b(() => [
|
|
2591
2591
|
p(c(Ge))
|
|
@@ -2594,7 +2594,7 @@ const ht = (w, t) => {
|
|
|
2594
2594
|
}),
|
|
2595
2595
|
s[24] || (s[24] = J(" 个人信息 ", -1))
|
|
2596
2596
|
]),
|
|
2597
|
-
D.value ? U("", !0) : (n(),
|
|
2597
|
+
D.value ? U("", !0) : (n(), K(ue, {
|
|
2598
2598
|
key: 0,
|
|
2599
2599
|
type: "primary",
|
|
2600
2600
|
size: "small",
|
|
@@ -2607,40 +2607,40 @@ const ht = (w, t) => {
|
|
|
2607
2607
|
_: 1
|
|
2608
2608
|
}))
|
|
2609
2609
|
]),
|
|
2610
|
-
e("div",
|
|
2610
|
+
e("div", Vl, [
|
|
2611
2611
|
e("div", Al, [
|
|
2612
2612
|
s[26] || (s[26] = e("label", { class: "settings-form-label" }, "昵称", -1)),
|
|
2613
|
-
D.value ? (n(),
|
|
2613
|
+
D.value ? (n(), K(A, {
|
|
2614
2614
|
key: 0,
|
|
2615
2615
|
modelValue: X.value.nickname,
|
|
2616
2616
|
"onUpdate:modelValue": s[7] || (s[7] = (i) => X.value.nickname = i),
|
|
2617
2617
|
placeholder: "请输入昵称",
|
|
2618
2618
|
size: "large"
|
|
2619
|
-
}, null, 8, ["modelValue"])) : (n(), v("div",
|
|
2619
|
+
}, null, 8, ["modelValue"])) : (n(), v("div", Sl, _(c(T).nickname || "未设置"), 1))
|
|
2620
2620
|
]),
|
|
2621
|
-
e("div",
|
|
2621
|
+
e("div", Fl, [
|
|
2622
2622
|
s[27] || (s[27] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
|
|
2623
|
-
D.value ? (n(),
|
|
2623
|
+
D.value ? (n(), K(A, {
|
|
2624
2624
|
key: 0,
|
|
2625
2625
|
modelValue: X.value.email,
|
|
2626
2626
|
"onUpdate:modelValue": s[8] || (s[8] = (i) => X.value.email = i),
|
|
2627
2627
|
placeholder: "请输入邮箱",
|
|
2628
2628
|
size: "large"
|
|
2629
|
-
}, null, 8, ["modelValue"])) : (n(), v("div",
|
|
2629
|
+
}, null, 8, ["modelValue"])) : (n(), v("div", Il, _(c(T).email || "未设置"), 1))
|
|
2630
2630
|
]),
|
|
2631
|
-
e("div",
|
|
2631
|
+
e("div", zl, [
|
|
2632
2632
|
s[28] || (s[28] = e("label", { class: "settings-form-label" }, "手机号", -1)),
|
|
2633
|
-
D.value ? (n(),
|
|
2633
|
+
D.value ? (n(), K(A, {
|
|
2634
2634
|
key: 0,
|
|
2635
2635
|
modelValue: X.value.phone,
|
|
2636
2636
|
"onUpdate:modelValue": s[9] || (s[9] = (i) => X.value.phone = i),
|
|
2637
2637
|
placeholder: "请输入手机号",
|
|
2638
2638
|
size: "large"
|
|
2639
|
-
}, null, 8, ["modelValue"])) : (n(), v("div",
|
|
2639
|
+
}, null, 8, ["modelValue"])) : (n(), v("div", Rl, _(c(T).phone || "未设置"), 1))
|
|
2640
2640
|
]),
|
|
2641
|
-
e("div",
|
|
2641
|
+
e("div", Ll, [
|
|
2642
2642
|
s[29] || (s[29] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
|
|
2643
|
-
D.value ? (n(),
|
|
2643
|
+
D.value ? (n(), K(A, {
|
|
2644
2644
|
key: 0,
|
|
2645
2645
|
modelValue: X.value.bio,
|
|
2646
2646
|
"onUpdate:modelValue": s[10] || (s[10] = (i) => X.value.bio = i),
|
|
@@ -2648,9 +2648,9 @@ const ht = (w, t) => {
|
|
|
2648
2648
|
rows: 4,
|
|
2649
2649
|
placeholder: "介绍一下自己吧...",
|
|
2650
2650
|
size: "large"
|
|
2651
|
-
}, null, 8, ["modelValue"])) : (n(), v("div",
|
|
2651
|
+
}, null, 8, ["modelValue"])) : (n(), v("div", Tl, _(c(T).bio || "这个人很懒,什么都没写~"), 1))
|
|
2652
2652
|
]),
|
|
2653
|
-
D.value ? (n(), v("div",
|
|
2653
|
+
D.value ? (n(), v("div", Ml, [
|
|
2654
2654
|
p(ue, {
|
|
2655
2655
|
size: "default",
|
|
2656
2656
|
onClick: ut
|
|
@@ -2678,7 +2678,7 @@ const ht = (w, t) => {
|
|
|
2678
2678
|
]),
|
|
2679
2679
|
_: 1
|
|
2680
2680
|
}, 8, ["modelValue"]),
|
|
2681
|
-
p(
|
|
2681
|
+
p(gt, {
|
|
2682
2682
|
modelValue: d.value,
|
|
2683
2683
|
"onUpdate:modelValue": s[12] || (s[12] = (i) => d.value = i),
|
|
2684
2684
|
src: le.value,
|
|
@@ -2687,7 +2687,7 @@ const ht = (w, t) => {
|
|
|
2687
2687
|
pe.value.visible ? (n(), v("div", {
|
|
2688
2688
|
key: 0,
|
|
2689
2689
|
class: "context-menu",
|
|
2690
|
-
style:
|
|
2690
|
+
style: Ut({ left: pe.value.x + "px", top: pe.value.y + "px" })
|
|
2691
2691
|
}, [
|
|
2692
2692
|
e("div", {
|
|
2693
2693
|
class: "context-menu-item",
|
|
@@ -2700,7 +2700,7 @@ const ht = (w, t) => {
|
|
|
2700
2700
|
}, 8, ["modelValue", "width"]);
|
|
2701
2701
|
};
|
|
2702
2702
|
}
|
|
2703
|
-
},
|
|
2703
|
+
}, El = /* @__PURE__ */ ht(Dl, [["__scopeId", "data-v-a76a4ef3"]]), ql = {
|
|
2704
2704
|
// API 配置
|
|
2705
2705
|
api: {
|
|
2706
2706
|
baseUrl: "",
|
|
@@ -2763,8 +2763,8 @@ const ht = (w, t) => {
|
|
|
2763
2763
|
allowedTypes: ["*"]
|
|
2764
2764
|
}
|
|
2765
2765
|
};
|
|
2766
|
-
function
|
|
2767
|
-
const t = Mt(
|
|
2766
|
+
function Pl(w = {}) {
|
|
2767
|
+
const t = Mt(ql, w);
|
|
2768
2768
|
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;
|
|
2769
2769
|
}
|
|
2770
2770
|
function Mt(w, t) {
|
|
@@ -2775,18 +2775,18 @@ function Mt(w, t) {
|
|
|
2775
2775
|
}
|
|
2776
2776
|
const Hl = {
|
|
2777
2777
|
install(w) {
|
|
2778
|
-
w.component("ChatPanel",
|
|
2778
|
+
w.component("ChatPanel", Ka), w.component("ChatWindow", El), w.component("AvatarCrop", gt);
|
|
2779
2779
|
}
|
|
2780
2780
|
};
|
|
2781
2781
|
export {
|
|
2782
|
-
|
|
2782
|
+
gt as AvatarCrop,
|
|
2783
2783
|
ft as ChatApi,
|
|
2784
|
-
|
|
2784
|
+
Ka as ChatPanel,
|
|
2785
2785
|
Et as ChatWebSocket,
|
|
2786
|
-
|
|
2786
|
+
El as ChatWindow,
|
|
2787
2787
|
qt as HttpClient,
|
|
2788
2788
|
Hl as VueChatKit,
|
|
2789
|
-
|
|
2789
|
+
Pl as createChatConfig,
|
|
2790
2790
|
Hl as default,
|
|
2791
|
-
|
|
2791
|
+
Tt as useChat
|
|
2792
2792
|
};
|