vue-chat-kit 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/vue-chat-kit.css +1 -1
- package/dist/vue-chat-kit.es.js +1751 -1345
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/ChatPanel.vue +73 -28
- package/src/components/ChatWindow.vue +83 -33
- package/src/components/EmojiPicker.vue +197 -0
- package/src/composables/useChat.js +0 -17
- package/src/config/index.js +0 -2
- package/src/core/adapter-example.js +0 -20
- package/src/core/api.js +0 -13
package/dist/vue-chat-kit.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ChatDotRound as
|
|
3
|
-
import
|
|
4
|
-
import { ElMessage as
|
|
5
|
-
class
|
|
1
|
+
import { ref as g, computed as ke, watch as _t, nextTick as Ke, resolveComponent as ye, openBlock as a, createBlock as Z, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as He, Fragment as de, renderList as ue, withModifiers as Fe, normalizeClass as K, createVNode as m, createTextVNode as me, toDisplayString as y, createCommentVNode as S, onMounted as bt, onUnmounted as kt, unref as u, resolveDynamicComponent as wt, isRef as Re, withDirectives as Ct, withKeys as xt, vModelText as Ut } from "vue";
|
|
2
|
+
import { ChatDotRound as Xe, UserFilled as Je, Bell as $t, Setting as St, Search as Ye, Plus as zt, MoreFilled as At, Document as Ft, Download as Vt, Folder as Qe, Picture as Rt, ChatLineRound as Mt, Camera as It } from "@element-plus/icons-vue";
|
|
3
|
+
import ft from "dayjs";
|
|
4
|
+
import { ElMessage as ee } from "element-plus";
|
|
5
|
+
class Wt {
|
|
6
6
|
constructor(t, n = {}) {
|
|
7
7
|
this.userId = t, this.wsUrl = n.wsUrl || "", this.socket = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = n.maxReconnectAttempts || 5, this.reconnectDelay = n.reconnectDelay || 3e3, this.handlers = {
|
|
8
8
|
message: [],
|
|
@@ -40,17 +40,17 @@ class Dt {
|
|
|
40
40
|
/**
|
|
41
41
|
* 发送消息
|
|
42
42
|
*/
|
|
43
|
-
send(t, n, v = "text", $ = "",
|
|
43
|
+
send(t, n, v = "text", $ = "", O = "", H = 0) {
|
|
44
44
|
if (this.isConnected()) {
|
|
45
|
-
const
|
|
45
|
+
const G = JSON.stringify({
|
|
46
46
|
to: t,
|
|
47
47
|
msg: n,
|
|
48
48
|
type: v,
|
|
49
49
|
fileUrl: $,
|
|
50
|
-
fileName:
|
|
50
|
+
fileName: O,
|
|
51
51
|
fileSize: H
|
|
52
52
|
});
|
|
53
|
-
return this.socket.send(
|
|
53
|
+
return this.socket.send(G), !0;
|
|
54
54
|
}
|
|
55
55
|
return console.warn("[VueChatKit] WebSocket 连接未建立,无法发送消息"), !1;
|
|
56
56
|
}
|
|
@@ -99,12 +99,12 @@ class Dt {
|
|
|
99
99
|
return this.socket && this.socket.readyState === WebSocket.OPEN;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
102
|
+
class Ge extends Error {
|
|
103
103
|
constructor(t, n, v, $) {
|
|
104
104
|
super(t), this.name = "RequestError", this.status = n || 0, this.code = v || 0, this.data = $;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class jt {
|
|
108
108
|
constructor(t = {}) {
|
|
109
109
|
this.baseUrl = t.baseUrl || "", this.timeout = t.timeout || 1e4, this.headers = t.headers || {}, this.requestInterceptors = [], this.responseInterceptors = [], t.requestInterceptors && Array.isArray(t.requestInterceptors) && t.requestInterceptors.forEach((n) => {
|
|
110
110
|
this.requestInterceptors.push(n);
|
|
@@ -133,7 +133,7 @@ class Wt {
|
|
|
133
133
|
timeoutPromise(t) {
|
|
134
134
|
return new Promise((n, v) => {
|
|
135
135
|
setTimeout(() => {
|
|
136
|
-
v(new
|
|
136
|
+
v(new Ge("请求超时", 408, 408));
|
|
137
137
|
}, t);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -141,47 +141,47 @@ class Wt {
|
|
|
141
141
|
* 核心请求方法
|
|
142
142
|
*/
|
|
143
143
|
async request(t, n = {}) {
|
|
144
|
-
const { method: v = "GET", headers: $ = {}, body:
|
|
145
|
-
let
|
|
144
|
+
const { method: v = "GET", headers: $ = {}, body: O, params: H } = n;
|
|
145
|
+
let G = t.startsWith("http") ? t : `${this.baseUrl}${t}`, V = {
|
|
146
146
|
method: v,
|
|
147
147
|
headers: { ...this.headers, ...$ },
|
|
148
|
-
body:
|
|
148
|
+
body: O,
|
|
149
149
|
params: H
|
|
150
150
|
};
|
|
151
|
-
this.requestInterceptors.forEach((
|
|
152
|
-
|
|
151
|
+
this.requestInterceptors.forEach((R) => {
|
|
152
|
+
V = R(V);
|
|
153
153
|
});
|
|
154
|
-
const
|
|
155
|
-
method:
|
|
156
|
-
headers:
|
|
154
|
+
const ie = {
|
|
155
|
+
method: V.method,
|
|
156
|
+
headers: V.headers,
|
|
157
157
|
credentials: "include"
|
|
158
158
|
};
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
for (const A in
|
|
162
|
-
|
|
163
|
-
const U =
|
|
164
|
-
U && (
|
|
159
|
+
if (V.body && v !== "GET" && (V.body instanceof FormData ? ie.body = V.body : typeof V.body == "object" ? ie.body = JSON.stringify(V.body) : ie.body = V.body), V.params) {
|
|
160
|
+
const R = new URLSearchParams();
|
|
161
|
+
for (const A in V.params)
|
|
162
|
+
V.params[A] !== void 0 && V.params[A] !== null && V.params[A] !== "" && R.append(A, V.params[A]);
|
|
163
|
+
const U = R.toString();
|
|
164
|
+
U && (G += (G.includes("?") ? "&" : "?") + U);
|
|
165
165
|
}
|
|
166
166
|
try {
|
|
167
167
|
let U = await Promise.race([
|
|
168
|
-
fetch(
|
|
168
|
+
fetch(G, ie),
|
|
169
169
|
this.timeoutPromise(this.timeout)
|
|
170
170
|
]);
|
|
171
|
-
if (this.responseInterceptors.forEach((
|
|
172
|
-
U =
|
|
171
|
+
if (this.responseInterceptors.forEach((ve) => {
|
|
172
|
+
U = ve(U);
|
|
173
173
|
}), !U.ok)
|
|
174
|
-
throw new
|
|
174
|
+
throw new Ge(
|
|
175
175
|
`HTTP ${U.status}: ${U.statusText}`,
|
|
176
176
|
U.status,
|
|
177
177
|
U.status
|
|
178
178
|
);
|
|
179
179
|
const A = U.headers.get("content-type");
|
|
180
|
-
let
|
|
181
|
-
return A && A.includes("application/json") ?
|
|
182
|
-
} catch (
|
|
183
|
-
throw
|
|
184
|
-
|
|
180
|
+
let f;
|
|
181
|
+
return A && A.includes("application/json") ? f = await U.json() : f = await U.text(), f;
|
|
182
|
+
} catch (R) {
|
|
183
|
+
throw R instanceof Ge ? R : new Ge(
|
|
184
|
+
R instanceof Error ? R.message : "网络错误",
|
|
185
185
|
0,
|
|
186
186
|
0
|
|
187
187
|
);
|
|
@@ -201,9 +201,9 @@ class Wt {
|
|
|
201
201
|
return this.request(t, { ...n, method: "DELETE" });
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
class
|
|
204
|
+
class gt {
|
|
205
205
|
constructor(t, n = null) {
|
|
206
|
-
this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new
|
|
206
|
+
this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new jt({
|
|
207
207
|
baseUrl: t.api.baseUrl,
|
|
208
208
|
headers: t.headers,
|
|
209
209
|
requestInterceptors: t.requestInterceptors,
|
|
@@ -310,16 +310,6 @@ class ft {
|
|
|
310
310
|
const n = new FormData();
|
|
311
311
|
return n.append("file", t), this.http.post(this.endpoints.uploadFile, n);
|
|
312
312
|
}
|
|
313
|
-
// ========== 用户相关 ==========
|
|
314
|
-
/**
|
|
315
|
-
* 获取用户信息
|
|
316
|
-
*/
|
|
317
|
-
async getUserInfo(t) {
|
|
318
|
-
return this._call("getUserInfo", t);
|
|
319
|
-
}
|
|
320
|
-
async _getUserInfo(t) {
|
|
321
|
-
return this.http.get(this.endpoints.getUserInfo, { username: t });
|
|
322
|
-
}
|
|
323
313
|
/**
|
|
324
314
|
* 更新用户信息
|
|
325
315
|
*/
|
|
@@ -351,393 +341,379 @@ class ft {
|
|
|
351
341
|
}
|
|
352
342
|
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
353
343
|
__proto__: null,
|
|
354
|
-
ChatApi:
|
|
355
|
-
default:
|
|
344
|
+
ChatApi: gt,
|
|
345
|
+
default: gt
|
|
356
346
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
357
|
-
function Tt(
|
|
358
|
-
const n = new
|
|
347
|
+
function Tt(w, t) {
|
|
348
|
+
const n = new gt(w);
|
|
359
349
|
let v = null;
|
|
360
|
-
const $ =
|
|
350
|
+
const $ = w.user.username, O = g(w.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${$}`), H = g({
|
|
361
351
|
username: $,
|
|
362
|
-
nickname:
|
|
363
|
-
email:
|
|
364
|
-
phone:
|
|
365
|
-
bio:
|
|
366
|
-
}),
|
|
367
|
-
let
|
|
352
|
+
nickname: w.user.nickname || "",
|
|
353
|
+
email: w.user.email || "",
|
|
354
|
+
phone: w.user.phone || "",
|
|
355
|
+
bio: w.user.bio || ""
|
|
356
|
+
}), G = g(!1), V = g([]), ie = g([]), R = g([]), U = g(""), A = g(""), f = g(""), ve = g(null), Se = g(!1), ge = g(""), x = g([]), he = g(!1), we = g([]), ze = g(!1), Ce = ke(() => {
|
|
357
|
+
let c = ie.value;
|
|
368
358
|
if (A.value) {
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
(
|
|
372
|
-
var
|
|
373
|
-
return (
|
|
359
|
+
const r = A.value.toLowerCase();
|
|
360
|
+
c = c.filter(
|
|
361
|
+
(_) => {
|
|
362
|
+
var I;
|
|
363
|
+
return (I = _.username) == null ? void 0 : I.toLowerCase().includes(r);
|
|
374
364
|
}
|
|
375
365
|
);
|
|
376
366
|
}
|
|
377
|
-
return
|
|
378
|
-
id:
|
|
379
|
-
name:
|
|
380
|
-
avatar:
|
|
381
|
-
online:
|
|
382
|
-
lastMsg:
|
|
383
|
-
lastTime:
|
|
384
|
-
unread:
|
|
367
|
+
return c.map((r) => ({
|
|
368
|
+
id: r.username,
|
|
369
|
+
name: r.username,
|
|
370
|
+
avatar: r.avatar || O.value,
|
|
371
|
+
online: r.online,
|
|
372
|
+
lastMsg: r.lastMsg || "暂无消息",
|
|
373
|
+
lastTime: r.lastTime,
|
|
374
|
+
unread: r.unReadNum || 0
|
|
385
375
|
}));
|
|
386
|
-
}),
|
|
387
|
-
let
|
|
376
|
+
}), Ue = ke(() => {
|
|
377
|
+
let c = V.value;
|
|
388
378
|
if (A.value) {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
(
|
|
392
|
-
var
|
|
393
|
-
return (
|
|
379
|
+
const r = A.value.toLowerCase();
|
|
380
|
+
c = c.filter(
|
|
381
|
+
(_) => {
|
|
382
|
+
var I;
|
|
383
|
+
return (I = _.username) == null ? void 0 : I.toLowerCase().includes(r);
|
|
394
384
|
}
|
|
395
385
|
);
|
|
396
386
|
}
|
|
397
|
-
return
|
|
398
|
-
id:
|
|
399
|
-
name:
|
|
400
|
-
avatar:
|
|
401
|
-
online:
|
|
402
|
-
isChatting:
|
|
387
|
+
return c.map((r) => ({
|
|
388
|
+
id: r.username,
|
|
389
|
+
name: r.username,
|
|
390
|
+
avatar: r.avatar || O.value,
|
|
391
|
+
online: r.online,
|
|
392
|
+
isChatting: r.isChatting
|
|
403
393
|
}));
|
|
404
|
-
}),
|
|
405
|
-
const
|
|
394
|
+
}), Ve = ke(() => x.value), Me = ke(() => Ce.value.find((c) => c.id === U.value) || null), De = ke(() => R.value.map((c) => {
|
|
395
|
+
const r = c.type === "file" || c.fileUrl || c.fileName, _ = c.fileName || c.msgContent;
|
|
406
396
|
return {
|
|
407
|
-
text:
|
|
408
|
-
isSelf:
|
|
409
|
-
time:
|
|
410
|
-
sendUsername:
|
|
411
|
-
type:
|
|
412
|
-
fileType:
|
|
413
|
-
fileUrl:
|
|
414
|
-
fileName:
|
|
415
|
-
fileSize:
|
|
397
|
+
text: c.msgContent,
|
|
398
|
+
isSelf: c.sendUsername === $,
|
|
399
|
+
time: c.createTime,
|
|
400
|
+
sendUsername: c.sendUsername,
|
|
401
|
+
type: r ? "file" : "text",
|
|
402
|
+
fileType: C(_) ? "image" : z(_),
|
|
403
|
+
fileUrl: c.fileUrl || "",
|
|
404
|
+
fileName: _,
|
|
405
|
+
fileSize: c.fileSize || 0
|
|
416
406
|
};
|
|
417
|
-
})), We = (
|
|
418
|
-
if (!
|
|
419
|
-
const
|
|
420
|
-
return
|
|
421
|
-
},
|
|
422
|
-
if (!
|
|
423
|
-
const
|
|
424
|
-
return
|
|
425
|
-
}, z = (
|
|
426
|
-
if (!
|
|
427
|
-
const
|
|
428
|
-
return ["xls", "xlsx"].includes(
|
|
429
|
-
},
|
|
430
|
-
|
|
431
|
-
|
|
407
|
+
})), We = (c) => ft(c).format("HH:mm"), Ie = (c) => {
|
|
408
|
+
if (!c) return "";
|
|
409
|
+
const r = ft(), _ = ft(c);
|
|
410
|
+
return r.isSame(_, "day") ? _.format("HH:mm") : r.diff(_, "day") === 1 ? "昨天" : r.diff(_, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][_.day()] : _.format("MM/DD");
|
|
411
|
+
}, C = (c) => {
|
|
412
|
+
if (!c) return !1;
|
|
413
|
+
const r = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], _ = c.split(".").pop().toLowerCase();
|
|
414
|
+
return r.includes(_);
|
|
415
|
+
}, z = (c) => {
|
|
416
|
+
if (!c) return "default";
|
|
417
|
+
const r = c.split(".").pop().toLowerCase();
|
|
418
|
+
return ["xls", "xlsx"].includes(r) ? "excel" : ["pdf"].includes(r) ? "pdf" : ["doc", "docx"].includes(r) ? "docx" : "default";
|
|
419
|
+
}, q = () => {
|
|
420
|
+
Ke(() => {
|
|
421
|
+
ve.value && (ve.value.scrollTop = ve.value.scrollHeight);
|
|
432
422
|
});
|
|
433
|
-
},
|
|
423
|
+
}, L = async () => {
|
|
434
424
|
try {
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
for (const
|
|
425
|
+
const r = (await n.getFriends($)).data || [];
|
|
426
|
+
V.value = r, ie.value = r.filter((_) => _.isChatting === 1);
|
|
427
|
+
for (const _ of ie.value)
|
|
438
428
|
try {
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
(
|
|
429
|
+
const ae = (await n.getHistory($, _.username)).data || [];
|
|
430
|
+
_.unReadNum = ae.filter(
|
|
431
|
+
(B) => B.isRead === 0 && B.sendUsername === _.username
|
|
442
432
|
).length;
|
|
443
433
|
} catch {
|
|
444
|
-
|
|
434
|
+
_.unReadNum = 0;
|
|
445
435
|
}
|
|
446
|
-
} catch (
|
|
447
|
-
console.error("[VueChatKit] 获取好友列表失败",
|
|
436
|
+
} catch (c) {
|
|
437
|
+
console.error("[VueChatKit] 获取好友列表失败", c);
|
|
448
438
|
}
|
|
449
|
-
},
|
|
439
|
+
}, E = async (c) => {
|
|
450
440
|
try {
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
} catch (
|
|
454
|
-
console.error("[VueChatKit] 获取聊天历史失败",
|
|
441
|
+
const r = await n.getHistory($, c);
|
|
442
|
+
R.value = r.data || [], q();
|
|
443
|
+
} catch (r) {
|
|
444
|
+
console.error("[VueChatKit] 获取聊天历史失败", r);
|
|
455
445
|
}
|
|
456
|
-
},
|
|
446
|
+
}, D = async (c) => {
|
|
457
447
|
try {
|
|
458
|
-
await n.setRead($,
|
|
459
|
-
} catch (
|
|
460
|
-
console.error("[VueChatKit] 标记已读失败",
|
|
448
|
+
await n.setRead($, c), L();
|
|
449
|
+
} catch (r) {
|
|
450
|
+
console.error("[VueChatKit] 标记已读失败", r);
|
|
461
451
|
}
|
|
462
|
-
},
|
|
463
|
-
U.value =
|
|
464
|
-
},
|
|
452
|
+
}, X = async (c) => {
|
|
453
|
+
U.value = c.id, await E(c.id), await D(c.id), q();
|
|
454
|
+
}, J = async (c, r = 1) => {
|
|
465
455
|
try {
|
|
466
|
-
return await n.setChatStatus($,
|
|
467
|
-
} catch (
|
|
468
|
-
return console.error("[VueChatKit] 设置聊天状态失败",
|
|
456
|
+
return await n.setChatStatus($, c, r), await L(), !0;
|
|
457
|
+
} catch (_) {
|
|
458
|
+
return console.error("[VueChatKit] 设置聊天状态失败", _), !1;
|
|
469
459
|
}
|
|
470
|
-
},
|
|
471
|
-
if (!
|
|
472
|
-
if (v.send(U.value,
|
|
473
|
-
const
|
|
474
|
-
msgContent:
|
|
460
|
+
}, Q = () => {
|
|
461
|
+
if (!f.value.trim() || !U.value || !v) return;
|
|
462
|
+
if (v.send(U.value, f.value.trim(), "text")) {
|
|
463
|
+
const r = {
|
|
464
|
+
msgContent: f.value.trim(),
|
|
475
465
|
sendUsername: $,
|
|
476
466
|
receiveUsername: U.value,
|
|
477
467
|
createTime: /* @__PURE__ */ new Date(),
|
|
478
468
|
isRead: 0,
|
|
479
469
|
type: "text"
|
|
480
470
|
};
|
|
481
|
-
|
|
482
|
-
|
|
471
|
+
R.value.push(r), f.value = "", q(), setTimeout(() => {
|
|
472
|
+
E(U.value), L();
|
|
483
473
|
}, 300);
|
|
484
474
|
}
|
|
485
|
-
},
|
|
475
|
+
}, W = async (c) => {
|
|
486
476
|
if (!U.value || !v) return !1;
|
|
487
477
|
try {
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
const { fileUrl:
|
|
478
|
+
const r = await n.uploadFile(c);
|
|
479
|
+
if (r.code === 200 && r.data) {
|
|
480
|
+
const { fileUrl: _, fileName: I } = r.data;
|
|
491
481
|
if (v.send(
|
|
492
482
|
U.value,
|
|
493
|
-
|
|
483
|
+
I,
|
|
494
484
|
"file",
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
485
|
+
_,
|
|
486
|
+
I,
|
|
487
|
+
c.size
|
|
498
488
|
)) {
|
|
499
|
-
const
|
|
500
|
-
msgContent:
|
|
489
|
+
const B = {
|
|
490
|
+
msgContent: I,
|
|
501
491
|
sendUsername: $,
|
|
502
492
|
receiveUsername: U.value,
|
|
503
493
|
createTime: /* @__PURE__ */ new Date(),
|
|
504
494
|
isRead: 0,
|
|
505
495
|
type: "file",
|
|
506
|
-
fileUrl:
|
|
507
|
-
fileName:
|
|
508
|
-
fileSize:
|
|
496
|
+
fileUrl: _,
|
|
497
|
+
fileName: I,
|
|
498
|
+
fileSize: c.size
|
|
509
499
|
};
|
|
510
|
-
return
|
|
500
|
+
return R.value.push(B), q(), !0;
|
|
511
501
|
}
|
|
512
502
|
}
|
|
513
503
|
return !1;
|
|
514
|
-
} catch (
|
|
515
|
-
return console.error("[VueChatKit] 发送文件失败",
|
|
504
|
+
} catch (r) {
|
|
505
|
+
return console.error("[VueChatKit] 发送文件失败", r), !1;
|
|
516
506
|
}
|
|
517
|
-
},
|
|
507
|
+
}, N = async (c, r) => {
|
|
518
508
|
if (!(!U.value || !v)) {
|
|
519
|
-
if (
|
|
520
|
-
const
|
|
521
|
-
msgContent:
|
|
509
|
+
if (r && r.trim() && v.send(U.value, r.trim(), "text")) {
|
|
510
|
+
const I = {
|
|
511
|
+
msgContent: r.trim(),
|
|
522
512
|
sendUsername: $,
|
|
523
513
|
receiveUsername: U.value,
|
|
524
514
|
createTime: /* @__PURE__ */ new Date(),
|
|
525
515
|
isRead: 0,
|
|
526
516
|
type: "text"
|
|
527
517
|
};
|
|
528
|
-
|
|
518
|
+
R.value.push(I);
|
|
529
519
|
}
|
|
530
|
-
for (const
|
|
531
|
-
const
|
|
532
|
-
await
|
|
520
|
+
for (const _ of c) {
|
|
521
|
+
const I = _.file || _;
|
|
522
|
+
await W(I);
|
|
533
523
|
}
|
|
534
524
|
setTimeout(() => {
|
|
535
|
-
|
|
525
|
+
E(U.value), L();
|
|
536
526
|
}, 300);
|
|
537
527
|
}
|
|
538
|
-
}, te = (
|
|
528
|
+
}, te = (c) => {
|
|
539
529
|
try {
|
|
540
530
|
try {
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
531
|
+
const _ = JSON.parse(c);
|
|
532
|
+
if (_.to || _.msg)
|
|
543
533
|
return {
|
|
544
|
-
to:
|
|
545
|
-
content:
|
|
546
|
-
type:
|
|
547
|
-
fileUrl:
|
|
548
|
-
fileName:
|
|
549
|
-
fileSize:
|
|
534
|
+
to: _.to,
|
|
535
|
+
content: _.msg,
|
|
536
|
+
type: _.type || "text",
|
|
537
|
+
fileUrl: _.fileUrl || "",
|
|
538
|
+
fileName: _.fileName || "",
|
|
539
|
+
fileSize: _.fileSize || 0
|
|
550
540
|
};
|
|
551
541
|
} catch {
|
|
552
542
|
}
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
543
|
+
const r = c.match(/^\[(.+?)\]:(.+)$/);
|
|
544
|
+
if (r)
|
|
555
545
|
return {
|
|
556
|
-
username:
|
|
557
|
-
content:
|
|
546
|
+
username: r[1],
|
|
547
|
+
content: r[2],
|
|
558
548
|
type: "text"
|
|
559
549
|
};
|
|
560
|
-
} catch (
|
|
561
|
-
console.error("[VueChatKit] 解析消息失败",
|
|
550
|
+
} catch (r) {
|
|
551
|
+
console.error("[VueChatKit] 解析消息失败", r);
|
|
562
552
|
}
|
|
563
553
|
return null;
|
|
564
|
-
},
|
|
565
|
-
if (
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
569
|
-
|
|
554
|
+
}, ne = (c) => {
|
|
555
|
+
if (c.includes("【状态变更】")) {
|
|
556
|
+
const _ = /【状态变更】(.+?) 已(上线|下线)/, I = c.match(_);
|
|
557
|
+
if (I) {
|
|
558
|
+
const ae = I[1], B = I[2] === "上线", pe = V.value.find((Ae) => Ae.username === ae);
|
|
559
|
+
pe && (pe.online = B);
|
|
570
560
|
}
|
|
571
561
|
return;
|
|
572
562
|
}
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
576
|
-
content:
|
|
577
|
-
username:
|
|
578
|
-
type:
|
|
579
|
-
fileUrl:
|
|
580
|
-
fileName:
|
|
581
|
-
fileSize:
|
|
563
|
+
const r = te(c);
|
|
564
|
+
if (r) {
|
|
565
|
+
const _ = {
|
|
566
|
+
content: r.content,
|
|
567
|
+
username: r.username || U.value,
|
|
568
|
+
type: r.type || "text",
|
|
569
|
+
fileUrl: r.fileUrl || "",
|
|
570
|
+
fileName: r.fileName || "",
|
|
571
|
+
fileSize: r.fileSize || 0,
|
|
582
572
|
timestamp: /* @__PURE__ */ new Date()
|
|
583
573
|
};
|
|
584
574
|
if (U.value) {
|
|
585
575
|
try {
|
|
586
|
-
let
|
|
587
|
-
msgContent:
|
|
588
|
-
sendUsername:
|
|
576
|
+
let I = {
|
|
577
|
+
msgContent: r.content,
|
|
578
|
+
sendUsername: _.username,
|
|
589
579
|
receiveUsername: $,
|
|
590
580
|
createTime: /* @__PURE__ */ new Date(),
|
|
591
581
|
isRead: 0,
|
|
592
|
-
type:
|
|
593
|
-
fileUrl:
|
|
594
|
-
fileName:
|
|
595
|
-
fileSize:
|
|
582
|
+
type: r.type || "text",
|
|
583
|
+
fileUrl: r.fileUrl || "",
|
|
584
|
+
fileName: r.fileName || "",
|
|
585
|
+
fileSize: r.fileSize || 0
|
|
596
586
|
};
|
|
597
|
-
|
|
598
|
-
} catch (
|
|
599
|
-
console.error("[VueChatKit] 添加临时消息失败",
|
|
587
|
+
R.value.push(I), q();
|
|
588
|
+
} catch (I) {
|
|
589
|
+
console.error("[VueChatKit] 添加临时消息失败", I);
|
|
600
590
|
}
|
|
601
|
-
|
|
591
|
+
E(U.value);
|
|
602
592
|
}
|
|
603
|
-
|
|
593
|
+
L(), t && typeof t == "function" && t(_);
|
|
604
594
|
}
|
|
605
|
-
},
|
|
606
|
-
const
|
|
607
|
-
v = new
|
|
608
|
-
wsUrl:
|
|
609
|
-
maxReconnectAttempts:
|
|
610
|
-
reconnectDelay:
|
|
611
|
-
}), v.on("message",
|
|
612
|
-
},
|
|
595
|
+
}, le = () => {
|
|
596
|
+
const c = `${w.api.websocketUrl}?userId=${$}`;
|
|
597
|
+
v = new Wt($, {
|
|
598
|
+
wsUrl: c,
|
|
599
|
+
maxReconnectAttempts: w.websocket.maxReconnectAttempts,
|
|
600
|
+
reconnectDelay: w.websocket.reconnectDelay
|
|
601
|
+
}), v.on("message", ne), v.connect();
|
|
602
|
+
}, se = () => {
|
|
613
603
|
v && (v.close(), v = null);
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
},
|
|
617
|
-
|
|
604
|
+
}, F = async () => {
|
|
605
|
+
Se.value = !0, ge.value = "", x.value = [];
|
|
606
|
+
}, T = async (c = "") => {
|
|
607
|
+
he.value = !0;
|
|
618
608
|
try {
|
|
619
|
-
let
|
|
620
|
-
|
|
621
|
-
} catch (
|
|
622
|
-
console.error("[VueChatKit] 获取可用用户失败",
|
|
609
|
+
let r;
|
|
610
|
+
c ? r = await n.searchUser(c) : r = await n.getAvailableUsers($), x.value = (r == null ? void 0 : r.data) || [];
|
|
611
|
+
} catch (r) {
|
|
612
|
+
console.error("[VueChatKit] 获取可用用户失败", r);
|
|
623
613
|
} finally {
|
|
624
|
-
|
|
614
|
+
he.value = !1;
|
|
625
615
|
}
|
|
626
|
-
},
|
|
616
|
+
}, M = async (c) => {
|
|
627
617
|
try {
|
|
628
|
-
await n.addFriend($,
|
|
629
|
-
} catch (
|
|
630
|
-
console.error("[VueChatKit] 添加好友失败",
|
|
631
|
-
}
|
|
632
|
-
}, D = async () => {
|
|
633
|
-
Ve.value = !0;
|
|
634
|
-
try {
|
|
635
|
-
const i = await n.getApplyList($);
|
|
636
|
-
Ce.value = i.data || [];
|
|
637
|
-
} catch (i) {
|
|
638
|
-
console.error("[VueChatKit] 获取好友申请列表失败", i);
|
|
639
|
-
} finally {
|
|
640
|
-
Ve.value = !1;
|
|
618
|
+
await n.addFriend($, c.username), await L(), Se.value = !1;
|
|
619
|
+
} catch (r) {
|
|
620
|
+
console.error("[VueChatKit] 添加好友失败", r);
|
|
641
621
|
}
|
|
642
|
-
},
|
|
622
|
+
}, Y = async () => {
|
|
623
|
+
ze.value = !0;
|
|
643
624
|
try {
|
|
644
|
-
await n.
|
|
625
|
+
const c = await n.getApplyList($);
|
|
626
|
+
we.value = c.data || [];
|
|
645
627
|
} catch (c) {
|
|
646
|
-
console.error("[VueChatKit]
|
|
628
|
+
console.error("[VueChatKit] 获取好友申请列表失败", c);
|
|
629
|
+
} finally {
|
|
630
|
+
ze.value = !1;
|
|
647
631
|
}
|
|
648
|
-
},
|
|
632
|
+
}, oe = async (c) => {
|
|
649
633
|
try {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
console.warn("[VueChatKit] 加载头像失败", i);
|
|
634
|
+
await n.agreeFriend(c, $), await Y(), await L();
|
|
635
|
+
} catch (r) {
|
|
636
|
+
console.error("[VueChatKit] 同意好友申请失败", r);
|
|
654
637
|
}
|
|
655
|
-
},
|
|
656
|
-
ee.value = i;
|
|
657
|
-
}, K = async () => {
|
|
658
|
-
Z.value = !0;
|
|
638
|
+
}, P = async () => {
|
|
659
639
|
try {
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
});
|
|
665
|
-
} catch (i) {
|
|
666
|
-
console.error("[VueChatKit] 获取用户信息失败", i);
|
|
667
|
-
} finally {
|
|
668
|
-
Z.value = !1;
|
|
640
|
+
const c = await n.getUserAvatar($);
|
|
641
|
+
c.code === 200 && c.data && (O.value = c.data);
|
|
642
|
+
} catch (c) {
|
|
643
|
+
console.warn("[VueChatKit] 加载头像失败", c);
|
|
669
644
|
}
|
|
670
|
-
},
|
|
645
|
+
}, re = (c) => {
|
|
646
|
+
O.value = c;
|
|
647
|
+
}, $e = async (c) => {
|
|
671
648
|
try {
|
|
672
|
-
return (await n.updateUserInfo($,
|
|
649
|
+
return (await n.updateUserInfo($, c)).code === 200 ? (H.value = {
|
|
673
650
|
...H.value,
|
|
674
|
-
...
|
|
651
|
+
...c
|
|
675
652
|
}, !0) : !1;
|
|
676
|
-
} catch (
|
|
677
|
-
return console.error("[VueChatKit] 更新用户信息失败",
|
|
653
|
+
} catch (r) {
|
|
654
|
+
return console.error("[VueChatKit] 更新用户信息失败", r), !1;
|
|
678
655
|
}
|
|
679
|
-
},
|
|
680
|
-
U.value = "",
|
|
656
|
+
}, _e = () => {
|
|
657
|
+
U.value = "", R.value = [], f.value = "", A.value = "";
|
|
681
658
|
};
|
|
682
|
-
return
|
|
683
|
-
await
|
|
659
|
+
return P(), _t(ge, async (c) => {
|
|
660
|
+
await T(c);
|
|
684
661
|
}), {
|
|
685
662
|
// 状态
|
|
686
663
|
myUsername: $,
|
|
687
|
-
myAvatar:
|
|
664
|
+
myAvatar: O,
|
|
688
665
|
userInfo: H,
|
|
689
|
-
loadingUserInfo:
|
|
690
|
-
friendList:
|
|
691
|
-
chatList:
|
|
692
|
-
filteredFriendList:
|
|
693
|
-
chatMsgList:
|
|
666
|
+
loadingUserInfo: G,
|
|
667
|
+
friendList: V,
|
|
668
|
+
chatList: ie,
|
|
669
|
+
filteredFriendList: Ue,
|
|
670
|
+
chatMsgList: R,
|
|
694
671
|
currentSelectName: U,
|
|
695
672
|
searchText: A,
|
|
696
|
-
inputText:
|
|
697
|
-
messagesContainer:
|
|
698
|
-
filteredUsers:
|
|
699
|
-
filteredAvailableUsers:
|
|
700
|
-
currentUser:
|
|
673
|
+
inputText: f,
|
|
674
|
+
messagesContainer: ve,
|
|
675
|
+
filteredUsers: Ce,
|
|
676
|
+
filteredAvailableUsers: Ve,
|
|
677
|
+
currentUser: Me,
|
|
701
678
|
currentMessages: De,
|
|
702
|
-
addFriendDialogVisible:
|
|
703
|
-
addFriendSearchText:
|
|
704
|
-
availableUsers:
|
|
705
|
-
loadingAvailableUsers:
|
|
706
|
-
friendApplyList:
|
|
707
|
-
loadingFriendApply:
|
|
679
|
+
addFriendDialogVisible: Se,
|
|
680
|
+
addFriendSearchText: ge,
|
|
681
|
+
availableUsers: x,
|
|
682
|
+
loadingAvailableUsers: he,
|
|
683
|
+
friendApplyList: we,
|
|
684
|
+
loadingFriendApply: ze,
|
|
708
685
|
// 方法
|
|
709
686
|
formatTime: We,
|
|
710
|
-
formatLastTime:
|
|
711
|
-
scrollToBottom:
|
|
712
|
-
getFriendList:
|
|
713
|
-
getChatHistory:
|
|
714
|
-
setFriendToChatStatus:
|
|
715
|
-
selectUser:
|
|
716
|
-
sendMessage:
|
|
717
|
-
sendFile:
|
|
718
|
-
sendFilesAndText:
|
|
719
|
-
initWebSocket:
|
|
720
|
-
closeWebSocket:
|
|
721
|
-
reset:
|
|
722
|
-
openAddFriendDialog:
|
|
723
|
-
loadAvailableUsers:
|
|
724
|
-
addFriend:
|
|
725
|
-
loadFriendApplyList:
|
|
726
|
-
agreeFriend:
|
|
727
|
-
updateMyAvatar:
|
|
728
|
-
|
|
729
|
-
updateUserInfo: oe
|
|
687
|
+
formatLastTime: Ie,
|
|
688
|
+
scrollToBottom: q,
|
|
689
|
+
getFriendList: L,
|
|
690
|
+
getChatHistory: E,
|
|
691
|
+
setFriendToChatStatus: J,
|
|
692
|
+
selectUser: X,
|
|
693
|
+
sendMessage: Q,
|
|
694
|
+
sendFile: W,
|
|
695
|
+
sendFilesAndText: N,
|
|
696
|
+
initWebSocket: le,
|
|
697
|
+
closeWebSocket: se,
|
|
698
|
+
reset: _e,
|
|
699
|
+
openAddFriendDialog: F,
|
|
700
|
+
loadAvailableUsers: T,
|
|
701
|
+
addFriend: M,
|
|
702
|
+
loadFriendApplyList: Y,
|
|
703
|
+
agreeFriend: oe,
|
|
704
|
+
updateMyAvatar: re,
|
|
705
|
+
updateUserInfo: $e
|
|
730
706
|
};
|
|
731
707
|
}
|
|
732
|
-
const
|
|
733
|
-
const n =
|
|
708
|
+
const Ze = (w, t) => {
|
|
709
|
+
const n = w.__vccOpts || w;
|
|
734
710
|
for (const [v, $] of t)
|
|
735
711
|
n[v] = $;
|
|
736
712
|
return n;
|
|
737
713
|
}, Ht = { class: "avatar-crop-container" }, Xt = {
|
|
738
714
|
key: 0,
|
|
739
715
|
class: "crop-wrapper"
|
|
740
|
-
}, Yt = ["src"], qt = ["onMousedown", "onTouchstart"], Bt = { class: "preview-wrapper" },
|
|
716
|
+
}, Yt = ["src"], qt = ["onMousedown", "onTouchstart"], Bt = { class: "preview-wrapper" }, Nt = ["width", "height"], Pt = { class: "dialog-footer" }, Kt = {
|
|
741
717
|
__name: "AvatarCrop",
|
|
742
718
|
props: {
|
|
743
719
|
modelValue: Boolean,
|
|
@@ -753,198 +729,198 @@ const gt = (x, t) => {
|
|
|
753
729
|
minSize: { type: Number, default: 50 }
|
|
754
730
|
},
|
|
755
731
|
emits: ["update:modelValue", "confirm", "cancel", "closed"],
|
|
756
|
-
setup(
|
|
757
|
-
const v =
|
|
732
|
+
setup(w, { expose: t, emit: n }) {
|
|
733
|
+
const v = w, $ = n, O = ke({
|
|
758
734
|
get: () => v.modelValue,
|
|
759
|
-
set: (
|
|
760
|
-
}), H =
|
|
735
|
+
set: (C) => $("update:modelValue", C)
|
|
736
|
+
}), H = ke({
|
|
761
737
|
get: () => v.src,
|
|
762
|
-
set: (
|
|
738
|
+
set: (C) => {
|
|
763
739
|
}
|
|
764
|
-
}),
|
|
740
|
+
}), G = ["nw", "n", "ne", "e", "se", "s", "sw", "w"], V = g(!1), ie = g(null), R = g(null), U = g(null), A = g({
|
|
765
741
|
naturalWidth: 0,
|
|
766
742
|
naturalHeight: 0,
|
|
767
743
|
displayWidth: 0,
|
|
768
744
|
displayHeight: 0,
|
|
769
745
|
offsetX: 0,
|
|
770
746
|
offsetY: 0
|
|
771
|
-
}),
|
|
747
|
+
}), f = g({
|
|
772
748
|
x: 0,
|
|
773
749
|
y: 0,
|
|
774
750
|
size: 150,
|
|
775
751
|
minSize: v.minSize
|
|
776
|
-
}),
|
|
752
|
+
}), ve = ke(() => ({
|
|
777
753
|
width: `${A.value.displayWidth}px`,
|
|
778
754
|
height: `${A.value.displayHeight}px`,
|
|
779
755
|
maxWidth: "none",
|
|
780
756
|
maxHeight: "none",
|
|
781
757
|
display: "block"
|
|
782
|
-
})),
|
|
783
|
-
left: `${
|
|
784
|
-
top: `${
|
|
785
|
-
width: `${
|
|
786
|
-
height: `${
|
|
758
|
+
})), Se = ke(() => ({
|
|
759
|
+
left: `${f.value.x}px`,
|
|
760
|
+
top: `${f.value.y}px`,
|
|
761
|
+
width: `${f.value.size}px`,
|
|
762
|
+
height: `${f.value.size / v.aspectRatio}px`
|
|
787
763
|
}));
|
|
788
|
-
let
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
if (!
|
|
793
|
-
const
|
|
794
|
-
let
|
|
795
|
-
|
|
796
|
-
naturalWidth:
|
|
797
|
-
naturalHeight:
|
|
798
|
-
displayWidth:
|
|
799
|
-
displayHeight:
|
|
800
|
-
offsetX:
|
|
801
|
-
offsetY:
|
|
764
|
+
let ge = null, x = null;
|
|
765
|
+
const he = () => {
|
|
766
|
+
Ke(() => {
|
|
767
|
+
const C = R.value, z = ie.value;
|
|
768
|
+
if (!C || !z) return;
|
|
769
|
+
const q = z.clientWidth, L = z.clientHeight, E = C.naturalWidth / C.naturalHeight, D = q / L;
|
|
770
|
+
let X, J, Q, W;
|
|
771
|
+
E > D ? (X = q, J = q / E, Q = 0, W = (L - J) / 2) : (J = L, X = L * E, Q = (q - X) / 2, W = 0), A.value = {
|
|
772
|
+
naturalWidth: C.naturalWidth,
|
|
773
|
+
naturalHeight: C.naturalHeight,
|
|
774
|
+
displayWidth: X,
|
|
775
|
+
displayHeight: J,
|
|
776
|
+
offsetX: Q,
|
|
777
|
+
offsetY: W
|
|
802
778
|
};
|
|
803
|
-
const
|
|
804
|
-
|
|
779
|
+
const N = Math.min(X, J) * 0.6;
|
|
780
|
+
f.value.size = N, f.value.x = Q + (X - N) / 2, f.value.y = W + (J - N / v.aspectRatio) / 2, we();
|
|
805
781
|
});
|
|
806
|
-
},
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
},
|
|
812
|
-
|
|
813
|
-
const z =
|
|
814
|
-
|
|
782
|
+
}, we = () => {
|
|
783
|
+
const C = U.value, z = R.value;
|
|
784
|
+
if (!C || !z) return;
|
|
785
|
+
const q = C.getContext("2d"), { naturalWidth: L, naturalHeight: E, displayWidth: D, displayHeight: X, offsetX: J, offsetY: Q } = A.value, W = L / D, N = E / X, te = (f.value.x - J) * W, ne = (f.value.y - Q) * N, le = f.value.size * W, se = f.value.size / v.aspectRatio * N;
|
|
786
|
+
q.clearRect(0, 0, C.width, C.height), q.drawImage(z, te, ne, le, se, 0, 0, C.width, C.height);
|
|
787
|
+
}, ze = (C) => {
|
|
788
|
+
C.preventDefault();
|
|
789
|
+
const z = C.clientX || C.touches[0].clientX, q = C.clientY || C.touches[0].clientY;
|
|
790
|
+
ge = {
|
|
815
791
|
startX: z,
|
|
816
|
-
startY:
|
|
817
|
-
boxX:
|
|
818
|
-
boxY:
|
|
792
|
+
startY: q,
|
|
793
|
+
boxX: f.value.x,
|
|
794
|
+
boxY: f.value.y
|
|
819
795
|
};
|
|
820
|
-
const
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
},
|
|
824
|
-
|
|
796
|
+
const L = (D) => {
|
|
797
|
+
const X = D.clientX || D.touches[0].clientX, J = D.clientY || D.touches[0].clientY, Q = X - ge.startX, W = J - ge.startY, { offsetX: N, offsetY: te, displayWidth: ne, displayHeight: le } = A.value, se = f.value.size / v.aspectRatio, F = Math.max(N, Math.min(N + ne - f.value.size, ge.boxX + Q)), T = Math.max(te, Math.min(te + le - se, ge.boxY + W));
|
|
798
|
+
f.value.x = F, f.value.y = T, we();
|
|
799
|
+
}, E = () => {
|
|
800
|
+
ge = null, document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", E), document.removeEventListener("touchmove", L), document.removeEventListener("touchend", E);
|
|
825
801
|
};
|
|
826
|
-
document.addEventListener("mousemove",
|
|
827
|
-
},
|
|
802
|
+
document.addEventListener("mousemove", L), document.addEventListener("mouseup", E), document.addEventListener("touchmove", L, { passive: !1 }), document.addEventListener("touchend", E);
|
|
803
|
+
}, Ce = (C, z) => {
|
|
828
804
|
z.preventDefault();
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
handle:
|
|
832
|
-
startX:
|
|
833
|
-
startY:
|
|
834
|
-
boxX:
|
|
835
|
-
boxY:
|
|
836
|
-
boxSize:
|
|
805
|
+
const q = z.clientX || z.touches[0].clientX, L = z.clientY || z.touches[0].clientY;
|
|
806
|
+
x = {
|
|
807
|
+
handle: C,
|
|
808
|
+
startX: q,
|
|
809
|
+
startY: L,
|
|
810
|
+
boxX: f.value.x,
|
|
811
|
+
boxY: f.value.y,
|
|
812
|
+
boxSize: f.value.size
|
|
837
813
|
};
|
|
838
|
-
const
|
|
839
|
-
const
|
|
840
|
-
let
|
|
841
|
-
const
|
|
842
|
-
switch (
|
|
814
|
+
const E = (X) => {
|
|
815
|
+
const J = X.clientX || X.touches[0].clientX, Q = X.clientY || X.touches[0].clientY, W = J - x.startX, N = Q - x.startY, { offsetX: te, offsetY: ne, displayWidth: le, displayHeight: se } = A.value;
|
|
816
|
+
let F = x.boxSize, T = x.boxX, M = x.boxY;
|
|
817
|
+
const Y = x.boxSize / v.aspectRatio;
|
|
818
|
+
switch (C) {
|
|
843
819
|
case "se":
|
|
844
|
-
|
|
820
|
+
F = Math.max(f.value.minSize, Math.min(le - (x.boxX - te), se - (x.boxY - ne), x.boxSize + Math.max(W, N)));
|
|
845
821
|
break;
|
|
846
822
|
case "nw":
|
|
847
|
-
|
|
823
|
+
F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, x.boxY - ne + Y, x.boxSize - Math.max(W, N))), T = x.boxX + (x.boxSize - F), M = x.boxY + (Y - F / v.aspectRatio);
|
|
848
824
|
break;
|
|
849
825
|
case "ne":
|
|
850
|
-
|
|
826
|
+
F = Math.max(f.value.minSize, Math.min(te + le - x.boxX, x.boxY - ne + Y, x.boxSize + Math.max(W, -N))), M = x.boxY + (Y - F / v.aspectRatio);
|
|
851
827
|
break;
|
|
852
828
|
case "sw":
|
|
853
|
-
|
|
829
|
+
F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, ne + se - x.boxY, x.boxSize + Math.max(-W, N))), T = x.boxX + (x.boxSize - F);
|
|
854
830
|
break;
|
|
855
831
|
case "n":
|
|
856
|
-
|
|
832
|
+
F = Math.max(f.value.minSize, Math.min(x.boxY - ne + Y, x.boxSize - N)), M = x.boxY + (Y - F / v.aspectRatio);
|
|
857
833
|
break;
|
|
858
834
|
case "s":
|
|
859
|
-
|
|
835
|
+
F = Math.max(f.value.minSize, Math.min(ne + se - x.boxY, x.boxSize + N));
|
|
860
836
|
break;
|
|
861
837
|
case "w":
|
|
862
|
-
|
|
838
|
+
F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, x.boxSize - W)), T = x.boxX + (x.boxSize - F);
|
|
863
839
|
break;
|
|
864
840
|
case "e":
|
|
865
|
-
|
|
841
|
+
F = Math.max(f.value.minSize, Math.min(te + le - x.boxX, x.boxSize + W));
|
|
866
842
|
break;
|
|
867
843
|
}
|
|
868
|
-
|
|
869
|
-
},
|
|
870
|
-
|
|
844
|
+
f.value.size = F, f.value.x = T, f.value.y = M, we();
|
|
845
|
+
}, D = () => {
|
|
846
|
+
x = null, document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("touchmove", E), document.removeEventListener("touchend", D);
|
|
871
847
|
};
|
|
872
|
-
document.addEventListener("mousemove",
|
|
873
|
-
},
|
|
874
|
-
const
|
|
848
|
+
document.addEventListener("mousemove", E), document.addEventListener("mouseup", D), document.addEventListener("touchmove", E, { passive: !1 }), document.addEventListener("touchend", D);
|
|
849
|
+
}, Ue = () => {
|
|
850
|
+
const C = document.createElement("canvas"), z = R.value;
|
|
875
851
|
if (!z) return null;
|
|
876
|
-
const { naturalWidth:
|
|
877
|
-
return
|
|
878
|
-
|
|
879
|
-
(
|
|
880
|
-
|
|
852
|
+
const { naturalWidth: q, naturalHeight: L, displayWidth: E, displayHeight: D, offsetX: X, offsetY: J } = A.value, Q = q / E, W = L / D, N = (f.value.x - X) * Q, te = (f.value.y - J) * W, ne = f.value.size * Q, le = f.value.size / v.aspectRatio * W;
|
|
853
|
+
return C.width = v.outputSize, C.height = v.outputSize / v.aspectRatio, C.getContext("2d").drawImage(z, N, te, ne, le, 0, 0, C.width, C.height), new Promise((F) => {
|
|
854
|
+
C.toBlob(
|
|
855
|
+
(T) => {
|
|
856
|
+
F(new File([T], "avatar.jpg", { type: v.outputType }));
|
|
881
857
|
},
|
|
882
858
|
v.outputType,
|
|
883
859
|
v.outputQuality
|
|
884
860
|
);
|
|
885
861
|
});
|
|
886
|
-
},
|
|
887
|
-
const
|
|
862
|
+
}, Ve = () => {
|
|
863
|
+
const C = document.createElement("canvas"), z = R.value;
|
|
888
864
|
if (!z) return null;
|
|
889
|
-
const { naturalWidth:
|
|
890
|
-
return
|
|
891
|
-
},
|
|
865
|
+
const { naturalWidth: q, naturalHeight: L, displayWidth: E, displayHeight: D, offsetX: X, offsetY: J } = A.value, Q = q / E, W = L / D, N = (f.value.x - X) * Q, te = (f.value.y - J) * W, ne = f.value.size * Q, le = f.value.size / v.aspectRatio * W;
|
|
866
|
+
return C.width = v.outputSize, C.height = v.outputSize / v.aspectRatio, C.getContext("2d").drawImage(z, N, te, ne, le, 0, 0, C.width, C.height), C.toDataURL(v.outputType, v.outputQuality);
|
|
867
|
+
}, Me = async () => {
|
|
892
868
|
if (H.value) {
|
|
893
|
-
|
|
869
|
+
V.value = !0;
|
|
894
870
|
try {
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
} catch (
|
|
898
|
-
console.error(
|
|
871
|
+
const C = await Ue(), z = Ve();
|
|
872
|
+
C && $("confirm", { file: C, dataUrl: z });
|
|
873
|
+
} catch (C) {
|
|
874
|
+
console.error(C), ee.error("生成图片失败");
|
|
899
875
|
} finally {
|
|
900
|
-
|
|
876
|
+
V.value = !1;
|
|
901
877
|
}
|
|
902
878
|
}
|
|
903
879
|
}, De = () => {
|
|
904
|
-
$("cancel"),
|
|
880
|
+
$("cancel"), O.value = !1;
|
|
905
881
|
}, We = () => {
|
|
906
|
-
|
|
907
|
-
},
|
|
908
|
-
|
|
882
|
+
Ie(), $("closed");
|
|
883
|
+
}, Ie = () => {
|
|
884
|
+
f.value = { x: 0, y: 0, size: 150, minSize: v.minSize };
|
|
909
885
|
};
|
|
910
886
|
return _t(
|
|
911
887
|
() => v.src,
|
|
912
|
-
(
|
|
913
|
-
|
|
914
|
-
|
|
888
|
+
(C) => {
|
|
889
|
+
C && Ke(() => {
|
|
890
|
+
R.value && R.value.complete && he();
|
|
915
891
|
});
|
|
916
892
|
}
|
|
917
893
|
), t({
|
|
918
|
-
getCroppedImage:
|
|
919
|
-
getCroppedImageDataUrl:
|
|
920
|
-
reset:
|
|
921
|
-
}), (
|
|
922
|
-
const
|
|
923
|
-
return a(),
|
|
924
|
-
modelValue:
|
|
925
|
-
"onUpdate:modelValue": z[0] || (z[0] = (
|
|
894
|
+
getCroppedImage: Ue,
|
|
895
|
+
getCroppedImageDataUrl: Ve,
|
|
896
|
+
reset: Ie
|
|
897
|
+
}), (C, z) => {
|
|
898
|
+
const q = ye("el-empty"), L = ye("el-button"), E = ye("el-dialog");
|
|
899
|
+
return a(), Z(E, {
|
|
900
|
+
modelValue: O.value,
|
|
901
|
+
"onUpdate:modelValue": z[0] || (z[0] = (D) => O.value = D),
|
|
926
902
|
title: "调整头像",
|
|
927
|
-
width:
|
|
903
|
+
width: w.dialogWidth,
|
|
928
904
|
"close-on-click-modal": !1,
|
|
929
|
-
"append-to-body":
|
|
905
|
+
"append-to-body": w.appendToBody,
|
|
930
906
|
onClosed: We
|
|
931
907
|
}, {
|
|
932
908
|
footer: k(() => [
|
|
933
|
-
e("div",
|
|
934
|
-
m(
|
|
909
|
+
e("div", Pt, [
|
|
910
|
+
m(L, { onClick: De }, {
|
|
935
911
|
default: k(() => [...z[2] || (z[2] = [
|
|
936
|
-
|
|
912
|
+
me("取消", -1)
|
|
937
913
|
])]),
|
|
938
914
|
_: 1
|
|
939
915
|
}),
|
|
940
|
-
m(
|
|
916
|
+
m(L, {
|
|
941
917
|
type: "primary",
|
|
942
|
-
loading:
|
|
918
|
+
loading: V.value,
|
|
943
919
|
disabled: !H.value,
|
|
944
|
-
onClick:
|
|
920
|
+
onClick: Me
|
|
945
921
|
}, {
|
|
946
922
|
default: k(() => [...z[3] || (z[3] = [
|
|
947
|
-
|
|
923
|
+
me(" 确认 ", -1)
|
|
948
924
|
])]),
|
|
949
925
|
_: 1
|
|
950
926
|
}, 8, ["loading", "disabled"])
|
|
@@ -955,28 +931,28 @@ const gt = (x, t) => {
|
|
|
955
931
|
H.value ? (a(), p("div", Xt, [
|
|
956
932
|
e("div", {
|
|
957
933
|
ref_key: "cropAreaRef",
|
|
958
|
-
ref:
|
|
934
|
+
ref: ie,
|
|
959
935
|
class: "crop-area",
|
|
960
|
-
style:
|
|
936
|
+
style: He({ height: w.cropAreaHeight })
|
|
961
937
|
}, [
|
|
962
938
|
e("img", {
|
|
963
939
|
src: H.value,
|
|
964
940
|
ref_key: "imageRef",
|
|
965
|
-
ref:
|
|
966
|
-
onLoad:
|
|
967
|
-
style:
|
|
941
|
+
ref: R,
|
|
942
|
+
onLoad: he,
|
|
943
|
+
style: He(ve.value)
|
|
968
944
|
}, null, 44, Yt),
|
|
969
945
|
e("div", {
|
|
970
946
|
class: "crop-box",
|
|
971
|
-
style:
|
|
972
|
-
onMousedown:
|
|
973
|
-
onTouchstart:
|
|
947
|
+
style: He(Se.value),
|
|
948
|
+
onMousedown: ze,
|
|
949
|
+
onTouchstart: ze
|
|
974
950
|
}, [
|
|
975
|
-
(a(), p(
|
|
976
|
-
key:
|
|
977
|
-
class:
|
|
978
|
-
onMousedown:
|
|
979
|
-
onTouchstart:
|
|
951
|
+
(a(), p(de, null, ue(G, (D) => e("div", {
|
|
952
|
+
key: D,
|
|
953
|
+
class: K(["crop-handle", D]),
|
|
954
|
+
onMousedown: Fe((X) => Ce(D, X), ["stop"]),
|
|
955
|
+
onTouchstart: Fe((X) => Ce(D, X), ["stop"])
|
|
980
956
|
}, null, 42, qt)), 64))
|
|
981
957
|
], 36)
|
|
982
958
|
], 4),
|
|
@@ -984,18 +960,18 @@ const gt = (x, t) => {
|
|
|
984
960
|
z[1] || (z[1] = e("div", { class: "preview-label" }, "预览", -1)),
|
|
985
961
|
e("div", {
|
|
986
962
|
class: "preview-box",
|
|
987
|
-
style:
|
|
963
|
+
style: He({ width: w.previewSize + "px", height: w.previewSize + "px" })
|
|
988
964
|
}, [
|
|
989
965
|
e("canvas", {
|
|
990
966
|
ref_key: "previewCanvasRef",
|
|
991
967
|
ref: U,
|
|
992
|
-
width:
|
|
993
|
-
height:
|
|
968
|
+
width: w.previewSize,
|
|
969
|
+
height: w.previewSize,
|
|
994
970
|
class: "preview-canvas"
|
|
995
|
-
}, null, 8,
|
|
971
|
+
}, null, 8, Nt)
|
|
996
972
|
], 4)
|
|
997
973
|
])
|
|
998
|
-
])) : (a(),
|
|
974
|
+
])) : (a(), Z(q, {
|
|
999
975
|
key: 1,
|
|
1000
976
|
description: "请上传图片"
|
|
1001
977
|
}))
|
|
@@ -1005,422 +981,830 @@ const gt = (x, t) => {
|
|
|
1005
981
|
}, 8, ["modelValue", "width", "append-to-body"]);
|
|
1006
982
|
};
|
|
1007
983
|
}
|
|
1008
|
-
}, yt = /* @__PURE__ */
|
|
984
|
+
}, yt = /* @__PURE__ */ Ze(Kt, [["__scopeId", "data-v-594eeaf3"]]), Ot = { class: "emoji-header" }, Gt = ["onClick"], Jt = { class: "emoji-body" }, Qt = ["onClick"], Zt = {
|
|
985
|
+
__name: "EmojiPicker",
|
|
986
|
+
props: {
|
|
987
|
+
visible: {
|
|
988
|
+
type: Boolean,
|
|
989
|
+
default: !1
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
emits: ["select", "close"],
|
|
993
|
+
setup(w, { emit: t }) {
|
|
994
|
+
const n = t, v = g(0), $ = [
|
|
995
|
+
{
|
|
996
|
+
id: "emoticons",
|
|
997
|
+
icon: "😀",
|
|
998
|
+
name: "表情",
|
|
999
|
+
emojis: [
|
|
1000
|
+
"😀",
|
|
1001
|
+
"😃",
|
|
1002
|
+
"😄",
|
|
1003
|
+
"😁",
|
|
1004
|
+
"😆",
|
|
1005
|
+
"😅",
|
|
1006
|
+
"🤣",
|
|
1007
|
+
"😂",
|
|
1008
|
+
"🙂",
|
|
1009
|
+
"🙃",
|
|
1010
|
+
"😉",
|
|
1011
|
+
"😊",
|
|
1012
|
+
"😇",
|
|
1013
|
+
"🥰",
|
|
1014
|
+
"😍",
|
|
1015
|
+
"🤩",
|
|
1016
|
+
"😘",
|
|
1017
|
+
"😗",
|
|
1018
|
+
"😚",
|
|
1019
|
+
"😋",
|
|
1020
|
+
"😛",
|
|
1021
|
+
"😜",
|
|
1022
|
+
"🤪",
|
|
1023
|
+
"😝",
|
|
1024
|
+
"🤑",
|
|
1025
|
+
"🤗",
|
|
1026
|
+
"🤭",
|
|
1027
|
+
"🤫",
|
|
1028
|
+
"🤔",
|
|
1029
|
+
"🤐",
|
|
1030
|
+
"🤨",
|
|
1031
|
+
"😐",
|
|
1032
|
+
"😑",
|
|
1033
|
+
"😶",
|
|
1034
|
+
"😏",
|
|
1035
|
+
"😒",
|
|
1036
|
+
"🙄",
|
|
1037
|
+
"😬",
|
|
1038
|
+
"🤥",
|
|
1039
|
+
"😌",
|
|
1040
|
+
"😔",
|
|
1041
|
+
"😪",
|
|
1042
|
+
"🤤",
|
|
1043
|
+
"😴",
|
|
1044
|
+
"😷",
|
|
1045
|
+
"🤒",
|
|
1046
|
+
"🤕",
|
|
1047
|
+
"🤢",
|
|
1048
|
+
"🤮",
|
|
1049
|
+
"🤧",
|
|
1050
|
+
"🥵",
|
|
1051
|
+
"🥶",
|
|
1052
|
+
"🥴",
|
|
1053
|
+
"😵",
|
|
1054
|
+
"🤯",
|
|
1055
|
+
"🤠",
|
|
1056
|
+
"🥳",
|
|
1057
|
+
"😎",
|
|
1058
|
+
"🤓",
|
|
1059
|
+
"🧐",
|
|
1060
|
+
"😕",
|
|
1061
|
+
"😟",
|
|
1062
|
+
"🙁",
|
|
1063
|
+
"☹️",
|
|
1064
|
+
"😮",
|
|
1065
|
+
"😯",
|
|
1066
|
+
"😲",
|
|
1067
|
+
"😳",
|
|
1068
|
+
"🥺",
|
|
1069
|
+
"😦",
|
|
1070
|
+
"😧",
|
|
1071
|
+
"😨",
|
|
1072
|
+
"😰",
|
|
1073
|
+
"😥",
|
|
1074
|
+
"😢",
|
|
1075
|
+
"😭",
|
|
1076
|
+
"😱",
|
|
1077
|
+
"😖",
|
|
1078
|
+
"😣",
|
|
1079
|
+
"😞"
|
|
1080
|
+
]
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
id: "gestures",
|
|
1084
|
+
icon: "👋",
|
|
1085
|
+
name: "手势",
|
|
1086
|
+
emojis: [
|
|
1087
|
+
"👋",
|
|
1088
|
+
"🤚",
|
|
1089
|
+
"🖐️",
|
|
1090
|
+
"✋",
|
|
1091
|
+
"🖖",
|
|
1092
|
+
"👌",
|
|
1093
|
+
"🤌",
|
|
1094
|
+
"🤏",
|
|
1095
|
+
"✌️",
|
|
1096
|
+
"🤞",
|
|
1097
|
+
"🤟",
|
|
1098
|
+
"🤘",
|
|
1099
|
+
"🤙",
|
|
1100
|
+
"👈",
|
|
1101
|
+
"👉",
|
|
1102
|
+
"👆",
|
|
1103
|
+
"🖕",
|
|
1104
|
+
"👇",
|
|
1105
|
+
"☝️",
|
|
1106
|
+
"👍",
|
|
1107
|
+
"👎",
|
|
1108
|
+
"✊",
|
|
1109
|
+
"👊",
|
|
1110
|
+
"🤛",
|
|
1111
|
+
"🤜",
|
|
1112
|
+
"👏",
|
|
1113
|
+
"🙌",
|
|
1114
|
+
"👐",
|
|
1115
|
+
"🤲",
|
|
1116
|
+
"🤝",
|
|
1117
|
+
"🙏",
|
|
1118
|
+
"🤚🏻",
|
|
1119
|
+
"🖐🏻",
|
|
1120
|
+
"✋🏻",
|
|
1121
|
+
"🖖🏻",
|
|
1122
|
+
"👌🏻",
|
|
1123
|
+
"🤌🏻",
|
|
1124
|
+
"🤏🏻",
|
|
1125
|
+
"✌🏻",
|
|
1126
|
+
"🤞🏻",
|
|
1127
|
+
"🤟🏻",
|
|
1128
|
+
"🤘🏻",
|
|
1129
|
+
"🤙🏻",
|
|
1130
|
+
"👈🏻",
|
|
1131
|
+
"👉🏻",
|
|
1132
|
+
"👆🏻",
|
|
1133
|
+
"🖕🏻",
|
|
1134
|
+
"👇🏻",
|
|
1135
|
+
"☝🏻",
|
|
1136
|
+
"👍🏻"
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
id: "animals",
|
|
1141
|
+
icon: "🐶",
|
|
1142
|
+
name: "动物",
|
|
1143
|
+
emojis: [
|
|
1144
|
+
"🐶",
|
|
1145
|
+
"🐱",
|
|
1146
|
+
"🐭",
|
|
1147
|
+
"🐹",
|
|
1148
|
+
"🐰",
|
|
1149
|
+
"🦊",
|
|
1150
|
+
"🐻",
|
|
1151
|
+
"🐼",
|
|
1152
|
+
"🐨",
|
|
1153
|
+
"🐯",
|
|
1154
|
+
"🦁",
|
|
1155
|
+
"🐮",
|
|
1156
|
+
"🐷",
|
|
1157
|
+
"🐸",
|
|
1158
|
+
"🐵",
|
|
1159
|
+
"🙈",
|
|
1160
|
+
"🙉",
|
|
1161
|
+
"🙊",
|
|
1162
|
+
"🐒",
|
|
1163
|
+
"🐔",
|
|
1164
|
+
"🐧",
|
|
1165
|
+
"🐦",
|
|
1166
|
+
"🐤",
|
|
1167
|
+
"🐣",
|
|
1168
|
+
"🐥",
|
|
1169
|
+
"🦆",
|
|
1170
|
+
"🦅",
|
|
1171
|
+
"🦉",
|
|
1172
|
+
"🦇",
|
|
1173
|
+
"🐺",
|
|
1174
|
+
"🐗",
|
|
1175
|
+
"🐴",
|
|
1176
|
+
"🦄",
|
|
1177
|
+
"🐝",
|
|
1178
|
+
"🐛",
|
|
1179
|
+
"🦋",
|
|
1180
|
+
"🐌",
|
|
1181
|
+
"🐞",
|
|
1182
|
+
"🐜",
|
|
1183
|
+
"🦟",
|
|
1184
|
+
"🦗",
|
|
1185
|
+
"🕷️",
|
|
1186
|
+
"🦂",
|
|
1187
|
+
"🐢",
|
|
1188
|
+
"🐍",
|
|
1189
|
+
"🦎",
|
|
1190
|
+
"🦖",
|
|
1191
|
+
"🦕",
|
|
1192
|
+
"🐙",
|
|
1193
|
+
"🦑"
|
|
1194
|
+
]
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
id: "food",
|
|
1198
|
+
icon: "🍎",
|
|
1199
|
+
name: "食物",
|
|
1200
|
+
emojis: [
|
|
1201
|
+
"🍎",
|
|
1202
|
+
"🍊",
|
|
1203
|
+
"🍋",
|
|
1204
|
+
"🍌",
|
|
1205
|
+
"🍉",
|
|
1206
|
+
"🍇",
|
|
1207
|
+
"🍓",
|
|
1208
|
+
"🍈",
|
|
1209
|
+
"🍒",
|
|
1210
|
+
"🍑",
|
|
1211
|
+
"🥭",
|
|
1212
|
+
"🍍",
|
|
1213
|
+
"🥥",
|
|
1214
|
+
"🥝",
|
|
1215
|
+
"🍅",
|
|
1216
|
+
"🍆",
|
|
1217
|
+
"🥑",
|
|
1218
|
+
"🥦",
|
|
1219
|
+
"🥬",
|
|
1220
|
+
"🥒",
|
|
1221
|
+
"🌶️",
|
|
1222
|
+
"🌽",
|
|
1223
|
+
"🥕",
|
|
1224
|
+
"🧄",
|
|
1225
|
+
"🧅",
|
|
1226
|
+
"🥔",
|
|
1227
|
+
"🍠",
|
|
1228
|
+
"🥐",
|
|
1229
|
+
"🥯",
|
|
1230
|
+
"🍞",
|
|
1231
|
+
"🥖",
|
|
1232
|
+
"🥨",
|
|
1233
|
+
"🧀",
|
|
1234
|
+
"🥚",
|
|
1235
|
+
"🍳",
|
|
1236
|
+
"🧈",
|
|
1237
|
+
"🥞",
|
|
1238
|
+
"🧇",
|
|
1239
|
+
"🥓",
|
|
1240
|
+
"🥩",
|
|
1241
|
+
"🍗",
|
|
1242
|
+
"🍖",
|
|
1243
|
+
"🌭",
|
|
1244
|
+
"🍔",
|
|
1245
|
+
"🍟",
|
|
1246
|
+
"🍕",
|
|
1247
|
+
"🥪",
|
|
1248
|
+
"🥙",
|
|
1249
|
+
"🧆",
|
|
1250
|
+
"🌮"
|
|
1251
|
+
]
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
id: "objects",
|
|
1255
|
+
icon: "⌚",
|
|
1256
|
+
name: "物品",
|
|
1257
|
+
emojis: [
|
|
1258
|
+
"⌚",
|
|
1259
|
+
"📱",
|
|
1260
|
+
"📲",
|
|
1261
|
+
"💻",
|
|
1262
|
+
"⌨️",
|
|
1263
|
+
"🖥️",
|
|
1264
|
+
"🖨️",
|
|
1265
|
+
"🖱️",
|
|
1266
|
+
"🖲️",
|
|
1267
|
+
"🕹️",
|
|
1268
|
+
"🗜️",
|
|
1269
|
+
"💽",
|
|
1270
|
+
"💾",
|
|
1271
|
+
"💿",
|
|
1272
|
+
"📀",
|
|
1273
|
+
"🧮",
|
|
1274
|
+
"🎥",
|
|
1275
|
+
"🎞️",
|
|
1276
|
+
"📽️",
|
|
1277
|
+
"🎬",
|
|
1278
|
+
"📺",
|
|
1279
|
+
"📷",
|
|
1280
|
+
"📸",
|
|
1281
|
+
"📹",
|
|
1282
|
+
"📼",
|
|
1283
|
+
"🔍",
|
|
1284
|
+
"🔎",
|
|
1285
|
+
"🕯️",
|
|
1286
|
+
"💡",
|
|
1287
|
+
"🔦",
|
|
1288
|
+
"🏮",
|
|
1289
|
+
"📔",
|
|
1290
|
+
"📕",
|
|
1291
|
+
"📖",
|
|
1292
|
+
"📗",
|
|
1293
|
+
"📘",
|
|
1294
|
+
"📙",
|
|
1295
|
+
"📚",
|
|
1296
|
+
"📓",
|
|
1297
|
+
"📒",
|
|
1298
|
+
"📃",
|
|
1299
|
+
"📜",
|
|
1300
|
+
"📄",
|
|
1301
|
+
"📰",
|
|
1302
|
+
"🗞️",
|
|
1303
|
+
"📑",
|
|
1304
|
+
"🔖",
|
|
1305
|
+
"🏷️",
|
|
1306
|
+
"💰",
|
|
1307
|
+
"🪙"
|
|
1308
|
+
]
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
id: "nature",
|
|
1312
|
+
icon: "☀️",
|
|
1313
|
+
name: "自然",
|
|
1314
|
+
emojis: [
|
|
1315
|
+
"☀️",
|
|
1316
|
+
"🌤️",
|
|
1317
|
+
"⛅",
|
|
1318
|
+
"🌥️",
|
|
1319
|
+
"☁️",
|
|
1320
|
+
"🌦️",
|
|
1321
|
+
"🌧️",
|
|
1322
|
+
"⛈️",
|
|
1323
|
+
"🌩️",
|
|
1324
|
+
"🌨️",
|
|
1325
|
+
"❄️",
|
|
1326
|
+
"☃️",
|
|
1327
|
+
"⛄",
|
|
1328
|
+
"🌬️",
|
|
1329
|
+
"💨",
|
|
1330
|
+
"🌪️",
|
|
1331
|
+
"🌫️",
|
|
1332
|
+
"🌊",
|
|
1333
|
+
"💧",
|
|
1334
|
+
"💦",
|
|
1335
|
+
"☔",
|
|
1336
|
+
"☂️",
|
|
1337
|
+
"🌱",
|
|
1338
|
+
"🌲",
|
|
1339
|
+
"🌳",
|
|
1340
|
+
"🌴",
|
|
1341
|
+
"🌵",
|
|
1342
|
+
"🌷",
|
|
1343
|
+
"🌹",
|
|
1344
|
+
"🥀",
|
|
1345
|
+
"🌺",
|
|
1346
|
+
"🌸",
|
|
1347
|
+
"🌼",
|
|
1348
|
+
"🌻",
|
|
1349
|
+
"🌞",
|
|
1350
|
+
"⭐",
|
|
1351
|
+
"🌟",
|
|
1352
|
+
"✨",
|
|
1353
|
+
"💫",
|
|
1354
|
+
"🌙",
|
|
1355
|
+
"🌚",
|
|
1356
|
+
"🌛",
|
|
1357
|
+
"🌜",
|
|
1358
|
+
"🌝",
|
|
1359
|
+
"🪐",
|
|
1360
|
+
"🌍",
|
|
1361
|
+
"🌎",
|
|
1362
|
+
"🌏",
|
|
1363
|
+
"⛱️",
|
|
1364
|
+
"🏖️"
|
|
1365
|
+
]
|
|
1366
|
+
}
|
|
1367
|
+
], O = (H) => {
|
|
1368
|
+
n("select", H);
|
|
1369
|
+
};
|
|
1370
|
+
return (H, G) => w.visible ? (a(), p("div", {
|
|
1371
|
+
key: 0,
|
|
1372
|
+
class: "emoji-picker",
|
|
1373
|
+
onClick: G[0] || (G[0] = Fe(() => {
|
|
1374
|
+
}, ["stop"]))
|
|
1375
|
+
}, [
|
|
1376
|
+
e("div", Ot, [
|
|
1377
|
+
(a(), p(de, null, ue($, (V, ie) => e("div", {
|
|
1378
|
+
key: V.id,
|
|
1379
|
+
class: K(["emoji-category-tab", { active: v.value === ie }]),
|
|
1380
|
+
onClick: (R) => v.value = ie
|
|
1381
|
+
}, y(V.icon), 11, Gt)), 64))
|
|
1382
|
+
]),
|
|
1383
|
+
e("div", Jt, [
|
|
1384
|
+
(a(!0), p(de, null, ue($[v.value].emojis, (V) => (a(), p("div", {
|
|
1385
|
+
key: V,
|
|
1386
|
+
class: "emoji-item",
|
|
1387
|
+
onClick: (ie) => O(V)
|
|
1388
|
+
}, y(V), 9, Qt))), 128))
|
|
1389
|
+
])
|
|
1390
|
+
])) : S("", !0);
|
|
1391
|
+
}
|
|
1392
|
+
}, Et = /* @__PURE__ */ Ze(Zt, [["__scopeId", "data-v-6ca53096"]]), es = { class: "chat-panel" }, ts = { class: "chat-sidebar" }, ss = ["src"], as = ["onClick"], ns = {
|
|
1009
1393
|
key: 0,
|
|
1010
1394
|
class: "sidebar-nav-badge"
|
|
1011
|
-
},
|
|
1395
|
+
}, is = { class: "chat-content-panel" }, ls = { class: "chat-search-bar" }, os = { class: "chat-content-scroll" }, rs = { key: 0 }, cs = ["onClick", "onContextmenu"], ds = { class: "chat-list-avatar-wrapper" }, us = ["src", "alt"], vs = {
|
|
1012
1396
|
key: 0,
|
|
1013
1397
|
class: "chat-list-online-indicator"
|
|
1014
|
-
},
|
|
1398
|
+
}, ps = { class: "chat-list-info" }, ms = { class: "chat-list-header" }, hs = { class: "chat-list-name" }, fs = { class: "chat-list-time" }, gs = { class: "chat-list-preview" }, ys = { class: "chat-list-last-msg" }, _s = {
|
|
1015
1399
|
key: 0,
|
|
1016
1400
|
class: "chat-list-unread"
|
|
1017
|
-
},
|
|
1401
|
+
}, bs = { key: 1 }, ks = { class: "add-friend-section" }, ws = { class: "add-friend-icon" }, Cs = ["onClick"], xs = { class: "chat-list-avatar-wrapper" }, Us = ["src", "alt"], $s = { class: "chat-list-info" }, Ss = { class: "chat-list-name" }, zs = { key: 2 }, As = { class: "friend-request-info" }, Fs = ["src", "alt"], Vs = { class: "friend-request-details" }, Rs = { class: "friend-request-username" }, Ms = { class: "chat-main-area" }, Is = {
|
|
1018
1402
|
key: 0,
|
|
1019
1403
|
class: "friend-profile-area"
|
|
1020
|
-
},
|
|
1404
|
+
}, Ls = ["src", "alt"], Ts = { class: "profile-name" }, Es = { class: "profile-status" }, Ds = {
|
|
1021
1405
|
key: 1,
|
|
1022
1406
|
class: "chat-window-area"
|
|
1023
|
-
},
|
|
1407
|
+
}, Ws = { class: "chat-window-header" }, js = { class: "chat-window-title" }, Hs = { class: "chat-window-name" }, Xs = { class: "chat-window-actions" }, Ys = { class: "message-avatar" }, qs = ["src"], Bs = {
|
|
1024
1408
|
key: 0,
|
|
1025
1409
|
class: "message-sender-name"
|
|
1026
|
-
},
|
|
1410
|
+
}, Ns = { class: "message-bubble-wrapper" }, Ps = ["onClick"], Ks = ["src", "alt"], Os = {
|
|
1027
1411
|
key: 0,
|
|
1028
1412
|
class: "message-image-size"
|
|
1029
|
-
},
|
|
1413
|
+
}, Gs = ["onClick"], Js = { class: "message-file-content" }, Qs = { class: "message-file-icon" }, Zs = { class: "message-file-info" }, ea = { class: "message-file-name" }, ta = { class: "message-file-meta" }, sa = { key: 0 }, aa = {
|
|
1030
1414
|
key: 0,
|
|
1031
1415
|
class: "pending-files-area"
|
|
1032
|
-
},
|
|
1416
|
+
}, na = {
|
|
1033
1417
|
key: 0,
|
|
1034
1418
|
class: "pending-image-wrapper"
|
|
1035
|
-
},
|
|
1419
|
+
}, ia = ["src", "alt"], la = ["onClick"], oa = {
|
|
1036
1420
|
key: 1,
|
|
1037
1421
|
class: "pending-file-wrapper"
|
|
1038
|
-
},
|
|
1422
|
+
}, ra = { class: "pending-file-name" }, ca = ["onClick"], da = {
|
|
1039
1423
|
key: 1,
|
|
1040
1424
|
class: "input-toolbar"
|
|
1041
|
-
},
|
|
1425
|
+
}, ua = { class: "emoji-button-wrapper" }, va = { class: "input-textarea-wrapper" }, pa = ["onKeydown"], ma = { class: "input-send-wrapper" }, ha = {
|
|
1042
1426
|
key: 2,
|
|
1043
1427
|
class: "chat-empty-state"
|
|
1044
|
-
},
|
|
1428
|
+
}, fa = { class: "empty-state-text" }, ga = {
|
|
1045
1429
|
key: 0,
|
|
1046
1430
|
class: "chat-detail-panel"
|
|
1047
|
-
},
|
|
1431
|
+
}, ya = { class: "chat-detail-content" }, _a = { class: "chat-detail-profile" }, ba = ["src", "alt"], ka = { class: "chat-detail-name" }, wa = { class: "add-friend-search-wrapper" }, Ca = { class: "add-friend-users-list" }, xa = { class: "add-friend-user-info" }, Ua = ["src", "alt"], $a = { class: "add-friend-user-name" }, Sa = { class: "chat-settings-container" }, za = { class: "chat-settings-avatar-section" }, Aa = { class: "chat-settings-avatar-wrapper" }, Fa = ["src"], Va = { class: "chat-settings-user-display" }, Ra = { class: "chat-settings-nickname" }, Ma = { class: "chat-settings-username" }, Ia = { class: "chat-settings-form-section" }, La = { class: "chat-settings-form-header" }, Ta = { class: "chat-settings-form-title" }, Ea = { class: "chat-settings-form" }, Da = { class: "chat-settings-form-item" }, Wa = {
|
|
1048
1432
|
key: 1,
|
|
1049
1433
|
class: "chat-settings-form-value"
|
|
1050
|
-
},
|
|
1434
|
+
}, ja = { class: "chat-settings-form-item" }, Ha = {
|
|
1051
1435
|
key: 1,
|
|
1052
1436
|
class: "chat-settings-form-value"
|
|
1053
|
-
},
|
|
1437
|
+
}, Xa = { class: "chat-settings-form-item" }, Ya = {
|
|
1054
1438
|
key: 1,
|
|
1055
1439
|
class: "chat-settings-form-value"
|
|
1056
|
-
},
|
|
1440
|
+
}, qa = { class: "chat-settings-form-item" }, Ba = {
|
|
1057
1441
|
key: 1,
|
|
1058
1442
|
class: "chat-settings-form-value bio-value"
|
|
1059
|
-
},
|
|
1443
|
+
}, Na = {
|
|
1060
1444
|
key: 0,
|
|
1061
1445
|
class: "chat-settings-form-actions"
|
|
1062
|
-
},
|
|
1446
|
+
}, Pa = {
|
|
1063
1447
|
__name: "ChatPanel",
|
|
1064
1448
|
props: {
|
|
1065
1449
|
config: { type: Object, required: !0 }
|
|
1066
1450
|
},
|
|
1067
1451
|
emits: ["message", "send", "error", "init"],
|
|
1068
|
-
setup(
|
|
1069
|
-
const n =
|
|
1452
|
+
setup(w, { emit: t }) {
|
|
1453
|
+
const n = w, v = t, {
|
|
1070
1454
|
myUsername: $,
|
|
1071
|
-
myAvatar:
|
|
1455
|
+
myAvatar: O,
|
|
1072
1456
|
userInfo: H,
|
|
1073
|
-
loadingUserInfo:
|
|
1074
|
-
friendList:
|
|
1075
|
-
filteredFriendList:
|
|
1076
|
-
searchText:
|
|
1457
|
+
loadingUserInfo: G,
|
|
1458
|
+
friendList: V,
|
|
1459
|
+
filteredFriendList: ie,
|
|
1460
|
+
searchText: R,
|
|
1077
1461
|
inputText: U,
|
|
1078
1462
|
messagesContainer: A,
|
|
1079
|
-
filteredUsers:
|
|
1080
|
-
filteredAvailableUsers:
|
|
1081
|
-
currentUser:
|
|
1082
|
-
currentMessages:
|
|
1083
|
-
addFriendDialogVisible:
|
|
1084
|
-
addFriendSearchText:
|
|
1085
|
-
availableUsers:
|
|
1086
|
-
loadingAvailableUsers:
|
|
1087
|
-
friendApplyList:
|
|
1088
|
-
loadingFriendApply:
|
|
1089
|
-
formatTime:
|
|
1090
|
-
formatLastTime:
|
|
1463
|
+
filteredUsers: f,
|
|
1464
|
+
filteredAvailableUsers: ve,
|
|
1465
|
+
currentUser: Se,
|
|
1466
|
+
currentMessages: ge,
|
|
1467
|
+
addFriendDialogVisible: x,
|
|
1468
|
+
addFriendSearchText: he,
|
|
1469
|
+
availableUsers: we,
|
|
1470
|
+
loadingAvailableUsers: ze,
|
|
1471
|
+
friendApplyList: Ce,
|
|
1472
|
+
loadingFriendApply: Ue,
|
|
1473
|
+
formatTime: Ve,
|
|
1474
|
+
formatLastTime: Me,
|
|
1091
1475
|
scrollToBottom: De,
|
|
1092
1476
|
getFriendList: We,
|
|
1093
|
-
getChatHistory:
|
|
1094
|
-
setFriendToChatStatus:
|
|
1477
|
+
getChatHistory: Ie,
|
|
1478
|
+
setFriendToChatStatus: C,
|
|
1095
1479
|
selectUser: z,
|
|
1096
|
-
sendMessage:
|
|
1097
|
-
sendFile:
|
|
1098
|
-
sendFilesAndText:
|
|
1099
|
-
initWebSocket:
|
|
1100
|
-
closeWebSocket:
|
|
1101
|
-
reset:
|
|
1102
|
-
openAddFriendDialog:
|
|
1103
|
-
addFriend:
|
|
1104
|
-
loadFriendApplyList:
|
|
1480
|
+
sendMessage: q,
|
|
1481
|
+
sendFile: L,
|
|
1482
|
+
sendFilesAndText: E,
|
|
1483
|
+
initWebSocket: D,
|
|
1484
|
+
closeWebSocket: X,
|
|
1485
|
+
reset: J,
|
|
1486
|
+
openAddFriendDialog: Q,
|
|
1487
|
+
addFriend: W,
|
|
1488
|
+
loadFriendApplyList: N,
|
|
1105
1489
|
agreeFriend: te,
|
|
1106
|
-
updateMyAvatar:
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
} =
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
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 };
|
|
1490
|
+
updateMyAvatar: ne
|
|
1491
|
+
} = Tt(n.config, (h) => {
|
|
1492
|
+
v("message", h);
|
|
1493
|
+
}), le = ke(() => {
|
|
1494
|
+
var o;
|
|
1495
|
+
const h = [{ id: "chat", icon: Xe, badge: 0 }];
|
|
1496
|
+
return n.config.modules.friends && h.push({ id: "friends", icon: Je, badge: 0 }), n.config.modules.apply && h.push({ id: "apply", icon: $t, badge: ((o = Ce.value) == null ? void 0 : o.length) || 0 }), h;
|
|
1497
|
+
}), se = g("chat"), F = g(null), T = g(null), M = g(null), Y = g(!1), oe = g(!1), P = g({ nickname: "", email: "", phone: "", bio: "" }), re = g(!1), $e = g(!1), _e = g(!1), c = g(!1), r = g(null), _ = g(""), I = g(null), ae = g([]), B = g({ visible: !1, x: 0, y: 0, chat: null }), pe = g(!1), Ae = (h, o) => {
|
|
1498
|
+
h.preventDefault(), h.stopPropagation(), B.value = { visible: !0, x: h.clientX, y: h.clientY, chat: o };
|
|
1117
1499
|
}, Le = () => {
|
|
1118
|
-
|
|
1500
|
+
B.value.visible = !1;
|
|
1119
1501
|
}, et = async () => {
|
|
1120
|
-
if (!
|
|
1121
|
-
await
|
|
1122
|
-
}, Te = (
|
|
1123
|
-
|
|
1124
|
-
id:
|
|
1125
|
-
name:
|
|
1126
|
-
avatar:
|
|
1127
|
-
online:
|
|
1502
|
+
if (!B.value.chat) return;
|
|
1503
|
+
await C(B.value.chat.id, 0) && F.value === B.value.chat.id && (F.value = null, T.value = null), Le();
|
|
1504
|
+
}, Te = (h) => {
|
|
1505
|
+
F.value = h.id, T.value = h, M.value = null, Y.value = !1, z({
|
|
1506
|
+
id: h.id,
|
|
1507
|
+
name: h.name,
|
|
1508
|
+
avatar: h.avatar,
|
|
1509
|
+
online: h.online
|
|
1128
1510
|
});
|
|
1129
|
-
}, tt = (
|
|
1130
|
-
|
|
1511
|
+
}, tt = (h) => {
|
|
1512
|
+
M.value = h, F.value = null, T.value = null;
|
|
1131
1513
|
}, st = async () => {
|
|
1132
|
-
if (!
|
|
1133
|
-
if (await
|
|
1134
|
-
se.value = "chat", await
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1514
|
+
if (!M.value) return;
|
|
1515
|
+
if (await C(M.value.id)) {
|
|
1516
|
+
se.value = "chat", await Ke();
|
|
1517
|
+
const o = f.value.find((d) => d.id === M.value.id);
|
|
1518
|
+
o && Te(o), M.value = null;
|
|
1137
1519
|
}
|
|
1138
1520
|
}, at = () => {
|
|
1139
|
-
|
|
1521
|
+
$e.value = !0;
|
|
1140
1522
|
}, nt = () => {
|
|
1141
|
-
var
|
|
1142
|
-
(
|
|
1523
|
+
var h;
|
|
1524
|
+
(h = r.value) == null || h.click();
|
|
1143
1525
|
}, it = () => {
|
|
1144
|
-
var
|
|
1145
|
-
(
|
|
1146
|
-
}, lt = (
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1149
|
-
for (const
|
|
1150
|
-
if (
|
|
1151
|
-
|
|
1526
|
+
var h;
|
|
1527
|
+
(h = I.value) == null || h.click();
|
|
1528
|
+
}, lt = (h) => {
|
|
1529
|
+
const o = Array.from(h.target.files || []);
|
|
1530
|
+
if (o.length !== 0) {
|
|
1531
|
+
for (const d of o) {
|
|
1532
|
+
if (d.size > 50 * 1024 * 1024) {
|
|
1533
|
+
ee.warning(`文件 ${d.name} 超过50MB,已跳过`);
|
|
1152
1534
|
continue;
|
|
1153
1535
|
}
|
|
1154
|
-
const s = URL.createObjectURL(
|
|
1155
|
-
|
|
1536
|
+
const s = URL.createObjectURL(d);
|
|
1537
|
+
ae.value.push({
|
|
1156
1538
|
id: Date.now() + Math.random(),
|
|
1157
|
-
file:
|
|
1158
|
-
name:
|
|
1159
|
-
size:
|
|
1160
|
-
type:
|
|
1539
|
+
file: d,
|
|
1540
|
+
name: d.name,
|
|
1541
|
+
size: d.size,
|
|
1542
|
+
type: d.type,
|
|
1161
1543
|
previewUrl: s,
|
|
1162
|
-
isImage:
|
|
1544
|
+
isImage: d.type.startsWith("image/")
|
|
1163
1545
|
});
|
|
1164
1546
|
}
|
|
1165
|
-
|
|
1547
|
+
I.value && (I.value.value = "");
|
|
1166
1548
|
}
|
|
1167
|
-
},
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
},
|
|
1171
|
-
if (
|
|
1172
|
-
const
|
|
1173
|
-
return parseFloat((
|
|
1174
|
-
},
|
|
1175
|
-
if (!U.value.trim() &&
|
|
1176
|
-
const
|
|
1177
|
-
U.value = "",
|
|
1178
|
-
|
|
1179
|
-
}),
|
|
1180
|
-
}, ot = (
|
|
1181
|
-
var
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
for (const s of
|
|
1549
|
+
}, qe = (h) => {
|
|
1550
|
+
const o = ae.value[h];
|
|
1551
|
+
o.previewUrl && URL.revokeObjectURL(o.previewUrl), ae.value.splice(h, 1);
|
|
1552
|
+
}, Be = (h) => {
|
|
1553
|
+
if (h === 0) return "0 B";
|
|
1554
|
+
const o = 1024, d = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(h) / Math.log(o));
|
|
1555
|
+
return parseFloat((h / Math.pow(o, s)).toFixed(2)) + " " + d[s];
|
|
1556
|
+
}, Ne = async () => {
|
|
1557
|
+
if (!U.value.trim() && ae.value.length === 0) return;
|
|
1558
|
+
const h = [...ae.value], o = U.value;
|
|
1559
|
+
U.value = "", ae.value.forEach((d) => {
|
|
1560
|
+
d.previewUrl && URL.revokeObjectURL(d.previewUrl);
|
|
1561
|
+
}), ae.value = [], await E(h, o), v("send", { text: o, files: h });
|
|
1562
|
+
}, ot = (h) => {
|
|
1563
|
+
var d;
|
|
1564
|
+
const o = (d = h.clipboardData) == null ? void 0 : d.items;
|
|
1565
|
+
if (o) {
|
|
1566
|
+
for (const s of o)
|
|
1185
1567
|
if (s.kind === "file") {
|
|
1186
1568
|
const b = s.getAsFile();
|
|
1187
1569
|
if (b) {
|
|
1188
1570
|
if (b.size > 50 * 1024 * 1024) {
|
|
1189
|
-
|
|
1571
|
+
ee.warning(`文件 ${b.name} 超过50MB,已跳过`);
|
|
1190
1572
|
continue;
|
|
1191
1573
|
}
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1574
|
+
const j = URL.createObjectURL(b);
|
|
1575
|
+
ae.value.push({
|
|
1194
1576
|
id: Date.now() + Math.random(),
|
|
1195
1577
|
file: b,
|
|
1196
1578
|
name: b.name,
|
|
1197
1579
|
size: b.size,
|
|
1198
1580
|
type: b.type,
|
|
1199
|
-
previewUrl:
|
|
1581
|
+
previewUrl: j,
|
|
1200
1582
|
isImage: b.type.startsWith("image/")
|
|
1201
1583
|
});
|
|
1202
1584
|
}
|
|
1203
1585
|
}
|
|
1204
1586
|
}
|
|
1205
|
-
},
|
|
1206
|
-
if (!
|
|
1207
|
-
|
|
1587
|
+
}, Pe = (h) => {
|
|
1588
|
+
if (!h) {
|
|
1589
|
+
ee.warning("文件地址无效");
|
|
1208
1590
|
return;
|
|
1209
1591
|
}
|
|
1210
|
-
window.open(
|
|
1211
|
-
}, rt = (
|
|
1212
|
-
console.warn("图片加载失败",
|
|
1213
|
-
}, ct = (
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1592
|
+
window.open(h, "_blank");
|
|
1593
|
+
}, rt = (h) => {
|
|
1594
|
+
console.warn("图片加载失败", h);
|
|
1595
|
+
}, ct = (h) => {
|
|
1596
|
+
U.value += h, pe.value = !1;
|
|
1597
|
+
}, dt = (h) => {
|
|
1598
|
+
const o = h.target.files[0];
|
|
1599
|
+
if (!o) return;
|
|
1600
|
+
if (!o.type.startsWith("image/")) {
|
|
1601
|
+
ee.error("只能上传图片文件");
|
|
1218
1602
|
return;
|
|
1219
1603
|
}
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1604
|
+
if (o.size > 5 * 1024 * 1024) {
|
|
1605
|
+
ee.error("图片大小不能超过 5MB");
|
|
1222
1606
|
return;
|
|
1223
1607
|
}
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
},
|
|
1228
|
-
},
|
|
1229
|
-
if (
|
|
1608
|
+
const d = new FileReader();
|
|
1609
|
+
d.onload = (s) => {
|
|
1610
|
+
_.value = s.target.result, _e.value = !0;
|
|
1611
|
+
}, d.readAsDataURL(o);
|
|
1612
|
+
}, ut = async ({ file: h }) => {
|
|
1613
|
+
if (h) {
|
|
1230
1614
|
c.value = !0;
|
|
1231
1615
|
try {
|
|
1232
|
-
const { ChatApi:
|
|
1233
|
-
s.code === 200 ? (
|
|
1234
|
-
} catch (
|
|
1235
|
-
console.error(
|
|
1616
|
+
const { ChatApi: o } = await Promise.resolve().then(() => Lt), s = await new o(n.config).uploadAvatar(h, $);
|
|
1617
|
+
s.code === 200 ? (ee.success("头像上传成功"), ne(s.data), Oe()) : ee.error(s.msg || "头像上传失败");
|
|
1618
|
+
} catch (o) {
|
|
1619
|
+
console.error(o), ee.error("头像上传失败");
|
|
1236
1620
|
} finally {
|
|
1237
1621
|
c.value = !1;
|
|
1238
1622
|
}
|
|
1239
1623
|
}
|
|
1240
|
-
},
|
|
1241
|
-
|
|
1242
|
-
},
|
|
1243
|
-
|
|
1624
|
+
}, Oe = () => {
|
|
1625
|
+
_.value = "", _e.value = !1, r.value && (r.value.value = "");
|
|
1626
|
+
}, vt = () => {
|
|
1627
|
+
P.value = {
|
|
1244
1628
|
nickname: H.value.nickname || "",
|
|
1245
1629
|
email: H.value.email || "",
|
|
1246
1630
|
phone: H.value.phone || "",
|
|
1247
1631
|
bio: H.value.bio || ""
|
|
1248
|
-
},
|
|
1249
|
-
},
|
|
1250
|
-
|
|
1251
|
-
},
|
|
1252
|
-
|
|
1632
|
+
}, oe.value = !0;
|
|
1633
|
+
}, pt = () => {
|
|
1634
|
+
oe.value = !1, P.value = { nickname: "", email: "", phone: "", bio: "" };
|
|
1635
|
+
}, mt = async () => {
|
|
1636
|
+
re.value = !0;
|
|
1253
1637
|
try {
|
|
1254
|
-
await
|
|
1255
|
-
} catch (
|
|
1256
|
-
console.error(
|
|
1638
|
+
await updateUserInfo(P.value) ? (ee.success("保存成功"), oe.value = !1) : ee.error("保存失败");
|
|
1639
|
+
} catch (h) {
|
|
1640
|
+
console.error(h), ee.error("保存失败");
|
|
1257
1641
|
} finally {
|
|
1258
|
-
|
|
1642
|
+
re.value = !1;
|
|
1259
1643
|
}
|
|
1260
1644
|
};
|
|
1261
1645
|
return bt(async () => {
|
|
1262
|
-
await Promise.all([We(),
|
|
1646
|
+
await Promise.all([We(), N()]), D(), f.value.length > 0 && Te(f.value[0]), v("init"), document.addEventListener("click", Le);
|
|
1263
1647
|
}), kt(() => {
|
|
1264
|
-
|
|
1265
|
-
}), (
|
|
1266
|
-
var
|
|
1267
|
-
const
|
|
1268
|
-
return a(), p("div",
|
|
1269
|
-
e("div",
|
|
1648
|
+
J(), X(), document.removeEventListener("click", Le);
|
|
1649
|
+
}), (h, o) => {
|
|
1650
|
+
var be, je, Ee;
|
|
1651
|
+
const d = ye("el-icon"), s = ye("el-input"), b = ye("el-empty"), j = ye("el-button"), ce = ye("el-dialog");
|
|
1652
|
+
return a(), p("div", es, [
|
|
1653
|
+
e("div", ts, [
|
|
1270
1654
|
e("div", {
|
|
1271
1655
|
class: "sidebar-avatar",
|
|
1272
1656
|
onClick: at
|
|
1273
1657
|
}, [
|
|
1274
1658
|
e("img", {
|
|
1275
|
-
src:
|
|
1659
|
+
src: u(O),
|
|
1276
1660
|
alt: "头像",
|
|
1277
1661
|
class: "sidebar-avatar-img"
|
|
1278
|
-
}, null, 8,
|
|
1662
|
+
}, null, 8, ss)
|
|
1279
1663
|
]),
|
|
1280
|
-
(a(!0), p(
|
|
1281
|
-
key:
|
|
1282
|
-
class:
|
|
1664
|
+
(a(!0), p(de, null, ue(le.value, (l) => (a(), p("div", {
|
|
1665
|
+
key: l.id,
|
|
1666
|
+
class: K([
|
|
1283
1667
|
"sidebar-nav-item",
|
|
1284
|
-
se.value ===
|
|
1668
|
+
se.value === l.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
|
|
1285
1669
|
]),
|
|
1286
|
-
onClick: (
|
|
1670
|
+
onClick: (fe) => se.value = l.id
|
|
1287
1671
|
}, [
|
|
1288
|
-
m(
|
|
1672
|
+
m(d, { size: 24 }, {
|
|
1289
1673
|
default: k(() => [
|
|
1290
|
-
(a(),
|
|
1674
|
+
(a(), Z(wt(l.icon)))
|
|
1291
1675
|
]),
|
|
1292
1676
|
_: 2
|
|
1293
1677
|
}, 1024),
|
|
1294
|
-
|
|
1295
|
-
], 10,
|
|
1296
|
-
|
|
1297
|
-
|
|
1678
|
+
l.badge ? (a(), p("span", ns, y(l.badge > 99 ? "99+" : l.badge), 1)) : S("", !0)
|
|
1679
|
+
], 10, as))), 128)),
|
|
1680
|
+
o[15] || (o[15] = e("div", { class: "sidebar-spacer" }, null, -1)),
|
|
1681
|
+
w.config.modules.settings ? (a(), p("div", {
|
|
1298
1682
|
key: 0,
|
|
1299
1683
|
class: "sidebar-nav-item sidebar-nav-item-inactive",
|
|
1300
|
-
onClick:
|
|
1684
|
+
onClick: o[0] || (o[0] = (l) => $e.value = !0),
|
|
1301
1685
|
title: "设置"
|
|
1302
1686
|
}, [
|
|
1303
|
-
m(
|
|
1687
|
+
m(d, { size: 24 }, {
|
|
1304
1688
|
default: k(() => [
|
|
1305
|
-
m(
|
|
1689
|
+
m(u(St))
|
|
1306
1690
|
]),
|
|
1307
1691
|
_: 1
|
|
1308
1692
|
})
|
|
1309
1693
|
])) : S("", !0)
|
|
1310
1694
|
]),
|
|
1311
|
-
e("div",
|
|
1312
|
-
e("div",
|
|
1695
|
+
e("div", is, [
|
|
1696
|
+
e("div", ls, [
|
|
1313
1697
|
m(s, {
|
|
1314
|
-
modelValue:
|
|
1315
|
-
"onUpdate:modelValue":
|
|
1698
|
+
modelValue: u(R),
|
|
1699
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => Re(R) ? R.value = l : null),
|
|
1316
1700
|
placeholder: "搜索",
|
|
1317
|
-
"prefix-icon":
|
|
1701
|
+
"prefix-icon": u(Ye),
|
|
1318
1702
|
class: "chat-search-input"
|
|
1319
1703
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1320
1704
|
]),
|
|
1321
|
-
e("div",
|
|
1322
|
-
se.value === "chat" ? (a(), p("div",
|
|
1323
|
-
(a(!0), p(
|
|
1324
|
-
key:
|
|
1325
|
-
class:
|
|
1705
|
+
e("div", os, [
|
|
1706
|
+
se.value === "chat" ? (a(), p("div", rs, [
|
|
1707
|
+
(a(!0), p(de, null, ue(u(f), (l) => (a(), p("div", {
|
|
1708
|
+
key: l.id,
|
|
1709
|
+
class: K([
|
|
1326
1710
|
"chat-list-item",
|
|
1327
|
-
|
|
1711
|
+
F.value === l.id ? "chat-list-item-active" : ""
|
|
1328
1712
|
]),
|
|
1329
|
-
onClick: (
|
|
1330
|
-
onContextmenu:
|
|
1713
|
+
onClick: (fe) => Te(l),
|
|
1714
|
+
onContextmenu: Fe((fe) => Ae(fe, l), ["prevent", "stop"])
|
|
1331
1715
|
}, [
|
|
1332
|
-
e("div",
|
|
1716
|
+
e("div", ds, [
|
|
1333
1717
|
e("img", {
|
|
1334
|
-
src:
|
|
1335
|
-
alt:
|
|
1718
|
+
src: l.avatar,
|
|
1719
|
+
alt: l.name,
|
|
1336
1720
|
class: "chat-list-avatar"
|
|
1337
|
-
}, null, 8,
|
|
1338
|
-
|
|
1721
|
+
}, null, 8, us),
|
|
1722
|
+
l.online ? (a(), p("span", vs)) : S("", !0)
|
|
1339
1723
|
]),
|
|
1340
|
-
e("div",
|
|
1341
|
-
e("div",
|
|
1342
|
-
e("span",
|
|
1343
|
-
e("span",
|
|
1724
|
+
e("div", ps, [
|
|
1725
|
+
e("div", ms, [
|
|
1726
|
+
e("span", hs, y(l.name), 1),
|
|
1727
|
+
e("span", fs, y(u(Me)(l.lastTime)), 1)
|
|
1344
1728
|
]),
|
|
1345
|
-
e("div",
|
|
1346
|
-
e("span",
|
|
1347
|
-
|
|
1729
|
+
e("div", gs, [
|
|
1730
|
+
e("span", ys, y(l.lastMsg), 1),
|
|
1731
|
+
l.unread > 0 ? (a(), p("span", _s, y(l.unread > 99 ? "99+" : l.unread), 1)) : S("", !0)
|
|
1348
1732
|
])
|
|
1349
1733
|
])
|
|
1350
|
-
], 42,
|
|
1734
|
+
], 42, cs))), 128))
|
|
1351
1735
|
])) : S("", !0),
|
|
1352
|
-
se.value === "friends" &&
|
|
1353
|
-
e("div",
|
|
1736
|
+
se.value === "friends" && w.config.modules.friends ? (a(), p("div", bs, [
|
|
1737
|
+
e("div", ks, [
|
|
1354
1738
|
e("div", {
|
|
1355
1739
|
class: "add-friend-btn",
|
|
1356
|
-
onClick:
|
|
1740
|
+
onClick: o[2] || (o[2] = (...l) => u(Q) && u(Q)(...l))
|
|
1357
1741
|
}, [
|
|
1358
|
-
e("div",
|
|
1359
|
-
m(
|
|
1742
|
+
e("div", ws, [
|
|
1743
|
+
m(d, {
|
|
1360
1744
|
class: "text-white",
|
|
1361
1745
|
size: 20
|
|
1362
1746
|
}, {
|
|
1363
1747
|
default: k(() => [
|
|
1364
|
-
m(
|
|
1748
|
+
m(u(zt))
|
|
1365
1749
|
]),
|
|
1366
1750
|
_: 1
|
|
1367
1751
|
})
|
|
1368
1752
|
]),
|
|
1369
|
-
|
|
1753
|
+
o[16] || (o[16] = e("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
1370
1754
|
])
|
|
1371
1755
|
]),
|
|
1372
|
-
(a(!0), p(
|
|
1373
|
-
key:
|
|
1756
|
+
(a(!0), p(de, null, ue(u(ie), (l) => (a(), p("div", {
|
|
1757
|
+
key: l.id,
|
|
1374
1758
|
class: "chat-list-item",
|
|
1375
|
-
onClick: (
|
|
1759
|
+
onClick: (fe) => tt(l)
|
|
1376
1760
|
}, [
|
|
1377
|
-
e("div",
|
|
1761
|
+
e("div", xs, [
|
|
1378
1762
|
e("img", {
|
|
1379
|
-
src:
|
|
1380
|
-
alt:
|
|
1763
|
+
src: l.avatar,
|
|
1764
|
+
alt: l.name,
|
|
1381
1765
|
class: "chat-list-avatar"
|
|
1382
|
-
}, null, 8,
|
|
1766
|
+
}, null, 8, Us),
|
|
1383
1767
|
e("span", {
|
|
1384
|
-
class:
|
|
1768
|
+
class: K([
|
|
1385
1769
|
"chat-list-online-indicator",
|
|
1386
|
-
|
|
1770
|
+
l.online ? "chat-list-online" : "chat-list-offline"
|
|
1387
1771
|
])
|
|
1388
1772
|
}, null, 2)
|
|
1389
1773
|
]),
|
|
1390
|
-
e("div",
|
|
1391
|
-
e("span",
|
|
1774
|
+
e("div", $s, [
|
|
1775
|
+
e("span", Ss, y(l.name), 1)
|
|
1392
1776
|
])
|
|
1393
|
-
], 8,
|
|
1777
|
+
], 8, Cs))), 128))
|
|
1394
1778
|
])) : S("", !0),
|
|
1395
|
-
se.value === "apply" &&
|
|
1396
|
-
|
|
1779
|
+
se.value === "apply" && w.config.modules.apply ? (a(), p("div", zs, [
|
|
1780
|
+
u(Ue) ? (a(), Z(b, {
|
|
1397
1781
|
key: 0,
|
|
1398
1782
|
description: "加载中..."
|
|
1399
|
-
})) :
|
|
1783
|
+
})) : u(Ce).length === 0 ? (a(), Z(b, {
|
|
1400
1784
|
key: 1,
|
|
1401
1785
|
description: "暂无好友申请"
|
|
1402
|
-
})) : (a(!0), p(
|
|
1403
|
-
key:
|
|
1786
|
+
})) : (a(!0), p(de, { key: 2 }, ue(u(Ce), (l) => (a(), p("div", {
|
|
1787
|
+
key: l.applyUser || l.id,
|
|
1404
1788
|
class: "friend-request-item"
|
|
1405
1789
|
}, [
|
|
1406
|
-
e("div",
|
|
1790
|
+
e("div", As, [
|
|
1407
1791
|
e("img", {
|
|
1408
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${
|
|
1409
|
-
alt:
|
|
1792
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.applyUser}`,
|
|
1793
|
+
alt: l.applyUser,
|
|
1410
1794
|
class: "friend-request-avatar"
|
|
1411
|
-
}, null, 8,
|
|
1412
|
-
e("div",
|
|
1413
|
-
e("div",
|
|
1414
|
-
|
|
1795
|
+
}, null, 8, Fs),
|
|
1796
|
+
e("div", Vs, [
|
|
1797
|
+
e("div", Rs, y(l.applyUser), 1),
|
|
1798
|
+
o[17] || (o[17] = e("div", { class: "friend-request-desc" }, "请求添加你为好友", -1))
|
|
1415
1799
|
])
|
|
1416
1800
|
]),
|
|
1417
|
-
m(
|
|
1801
|
+
m(j, {
|
|
1418
1802
|
type: "primary",
|
|
1419
1803
|
size: "small",
|
|
1420
|
-
onClick: (
|
|
1804
|
+
onClick: (fe) => u(te)(l.applyUser)
|
|
1421
1805
|
}, {
|
|
1422
|
-
default: k(() => [...
|
|
1423
|
-
|
|
1806
|
+
default: k(() => [...o[18] || (o[18] = [
|
|
1807
|
+
me("同意", -1)
|
|
1424
1808
|
])]),
|
|
1425
1809
|
_: 1
|
|
1426
1810
|
}, 8, ["onClick"])
|
|
@@ -1428,65 +1812,65 @@ const gt = (x, t) => {
|
|
|
1428
1812
|
])) : S("", !0)
|
|
1429
1813
|
])
|
|
1430
1814
|
]),
|
|
1431
|
-
e("div",
|
|
1432
|
-
|
|
1815
|
+
e("div", Ms, [
|
|
1816
|
+
M.value && !T.value ? (a(), p("div", Is, [
|
|
1433
1817
|
e("img", {
|
|
1434
|
-
src:
|
|
1435
|
-
alt:
|
|
1818
|
+
src: M.value.avatar,
|
|
1819
|
+
alt: M.value.name,
|
|
1436
1820
|
class: "profile-avatar"
|
|
1437
|
-
}, null, 8,
|
|
1438
|
-
e("div",
|
|
1439
|
-
e("div",
|
|
1821
|
+
}, null, 8, Ls),
|
|
1822
|
+
e("div", Ts, y(M.value.name), 1),
|
|
1823
|
+
e("div", Es, [
|
|
1440
1824
|
e("span", {
|
|
1441
|
-
class:
|
|
1825
|
+
class: K([
|
|
1442
1826
|
"profile-status-dot",
|
|
1443
|
-
|
|
1827
|
+
M.value.online ? "profile-status-online" : "profile-status-offline"
|
|
1444
1828
|
])
|
|
1445
1829
|
}, null, 2),
|
|
1446
|
-
e("span", null, y(
|
|
1830
|
+
e("span", null, y(M.value.online ? "在线" : "离线"), 1)
|
|
1447
1831
|
]),
|
|
1448
|
-
m(
|
|
1832
|
+
m(j, {
|
|
1449
1833
|
type: "primary",
|
|
1450
1834
|
size: "large",
|
|
1451
1835
|
onClick: st,
|
|
1452
1836
|
class: "profile-start-chat-btn"
|
|
1453
1837
|
}, {
|
|
1454
1838
|
default: k(() => [
|
|
1455
|
-
m(
|
|
1839
|
+
m(d, null, {
|
|
1456
1840
|
default: k(() => [
|
|
1457
|
-
m(
|
|
1841
|
+
m(u(Xe))
|
|
1458
1842
|
]),
|
|
1459
1843
|
_: 1
|
|
1460
1844
|
}),
|
|
1461
|
-
|
|
1845
|
+
o[19] || (o[19] = e("span", null, "发消息", -1))
|
|
1462
1846
|
]),
|
|
1463
1847
|
_: 1
|
|
1464
1848
|
})
|
|
1465
1849
|
])) : S("", !0),
|
|
1466
|
-
|
|
1467
|
-
e("div",
|
|
1468
|
-
e("div",
|
|
1469
|
-
e("span",
|
|
1850
|
+
T.value ? (a(), p("div", Ds, [
|
|
1851
|
+
e("div", Ws, [
|
|
1852
|
+
e("div", js, [
|
|
1853
|
+
e("span", Hs, y(T.value.name), 1),
|
|
1470
1854
|
e("span", {
|
|
1471
|
-
class:
|
|
1855
|
+
class: K([
|
|
1472
1856
|
"chat-window-status",
|
|
1473
|
-
|
|
1857
|
+
T.value.online ? "chat-window-status-online" : "chat-window-status-offline"
|
|
1474
1858
|
])
|
|
1475
|
-
}, y(
|
|
1859
|
+
}, y(T.value.online ? "在线" : "离线"), 3)
|
|
1476
1860
|
]),
|
|
1477
|
-
e("div",
|
|
1478
|
-
m(
|
|
1861
|
+
e("div", Xs, [
|
|
1862
|
+
m(d, { class: "chat-action-icon" }, {
|
|
1479
1863
|
default: k(() => [
|
|
1480
|
-
m(
|
|
1864
|
+
m(u(Ye))
|
|
1481
1865
|
]),
|
|
1482
1866
|
_: 1
|
|
1483
1867
|
}),
|
|
1484
|
-
m(
|
|
1868
|
+
m(d, {
|
|
1485
1869
|
class: "chat-action-icon",
|
|
1486
|
-
onClick:
|
|
1870
|
+
onClick: o[3] || (o[3] = (l) => Y.value = !Y.value)
|
|
1487
1871
|
}, {
|
|
1488
1872
|
default: k(() => [
|
|
1489
|
-
m(
|
|
1873
|
+
m(u(At))
|
|
1490
1874
|
]),
|
|
1491
1875
|
_: 1
|
|
1492
1876
|
})
|
|
@@ -1497,253 +1881,265 @@ const gt = (x, t) => {
|
|
|
1497
1881
|
ref: A,
|
|
1498
1882
|
class: "chat-messages-container"
|
|
1499
1883
|
}, [
|
|
1500
|
-
(a(!0), p(
|
|
1501
|
-
key:
|
|
1502
|
-
class:
|
|
1884
|
+
(a(!0), p(de, null, ue(u(ge), (l, fe) => (a(), p("div", {
|
|
1885
|
+
key: fe,
|
|
1886
|
+
class: K([
|
|
1503
1887
|
"message-wrapper",
|
|
1504
|
-
|
|
1888
|
+
l.isSelf ? "message-self" : "message-other"
|
|
1505
1889
|
])
|
|
1506
1890
|
}, [
|
|
1507
|
-
e("div",
|
|
1891
|
+
e("div", Ys, [
|
|
1508
1892
|
e("img", {
|
|
1509
|
-
src:
|
|
1893
|
+
src: l.isSelf ? u(O) : T.value.avatar,
|
|
1510
1894
|
class: "message-avatar-img"
|
|
1511
|
-
}, null, 8,
|
|
1895
|
+
}, null, 8, qs)
|
|
1512
1896
|
]),
|
|
1513
1897
|
e("div", {
|
|
1514
|
-
class:
|
|
1898
|
+
class: K([
|
|
1515
1899
|
"message-content",
|
|
1516
|
-
|
|
1900
|
+
l.isSelf ? "message-content-self" : "message-content-other"
|
|
1517
1901
|
])
|
|
1518
1902
|
}, [
|
|
1519
|
-
|
|
1520
|
-
e("div",
|
|
1521
|
-
|
|
1903
|
+
l.isSelf ? S("", !0) : (a(), p("div", Bs, y(T.value.name), 1)),
|
|
1904
|
+
e("div", Ns, [
|
|
1905
|
+
l.type === "text" ? (a(), p("div", {
|
|
1522
1906
|
key: 0,
|
|
1523
|
-
class:
|
|
1907
|
+
class: K([
|
|
1524
1908
|
"message-bubble",
|
|
1525
|
-
|
|
1909
|
+
l.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
1526
1910
|
])
|
|
1527
|
-
}, y(
|
|
1911
|
+
}, y(l.text), 3)) : l.type === "file" && l.fileType === "image" ? (a(), p("div", {
|
|
1528
1912
|
key: 1,
|
|
1529
|
-
class:
|
|
1913
|
+
class: K([
|
|
1530
1914
|
"message-bubble",
|
|
1531
1915
|
"message-image-bubble",
|
|
1532
|
-
|
|
1916
|
+
l.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
1533
1917
|
]),
|
|
1534
|
-
onClick: (
|
|
1918
|
+
onClick: (i) => Pe(l.fileUrl)
|
|
1535
1919
|
}, [
|
|
1536
1920
|
e("img", {
|
|
1537
|
-
src:
|
|
1538
|
-
alt:
|
|
1921
|
+
src: l.fileUrl,
|
|
1922
|
+
alt: l.fileName,
|
|
1539
1923
|
class: "message-image",
|
|
1540
1924
|
onError: rt
|
|
1541
|
-
}, null, 40,
|
|
1542
|
-
|
|
1543
|
-
], 10,
|
|
1925
|
+
}, null, 40, Ks),
|
|
1926
|
+
l.fileSize ? (a(), p("div", Os, y(Be(l.fileSize)), 1)) : S("", !0)
|
|
1927
|
+
], 10, Ps)) : l.type === "file" ? (a(), p("div", {
|
|
1544
1928
|
key: 2,
|
|
1545
|
-
class:
|
|
1929
|
+
class: K([
|
|
1546
1930
|
"message-bubble",
|
|
1547
1931
|
"message-file-bubble",
|
|
1548
|
-
|
|
1932
|
+
l.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
1549
1933
|
]),
|
|
1550
|
-
onClick: (
|
|
1934
|
+
onClick: (i) => Pe(l.fileUrl)
|
|
1551
1935
|
}, [
|
|
1552
|
-
e("div",
|
|
1553
|
-
e("div",
|
|
1554
|
-
m(
|
|
1936
|
+
e("div", Js, [
|
|
1937
|
+
e("div", Qs, [
|
|
1938
|
+
m(d, { size: 28 }, {
|
|
1555
1939
|
default: k(() => [
|
|
1556
|
-
m(
|
|
1940
|
+
m(u(Ft))
|
|
1557
1941
|
]),
|
|
1558
1942
|
_: 1
|
|
1559
1943
|
})
|
|
1560
1944
|
]),
|
|
1561
|
-
e("div",
|
|
1562
|
-
e("div",
|
|
1563
|
-
e("div",
|
|
1564
|
-
m(
|
|
1945
|
+
e("div", Zs, [
|
|
1946
|
+
e("div", ea, y(l.fileName || l.text), 1),
|
|
1947
|
+
e("div", ta, [
|
|
1948
|
+
m(d, { size: 12 }, {
|
|
1565
1949
|
default: k(() => [
|
|
1566
|
-
m(
|
|
1950
|
+
m(u(Vt))
|
|
1567
1951
|
]),
|
|
1568
1952
|
_: 1
|
|
1569
1953
|
}),
|
|
1570
|
-
|
|
1571
|
-
|
|
1954
|
+
o[20] || (o[20] = e("span", null, "点击下载", -1)),
|
|
1955
|
+
l.fileSize ? (a(), p("span", sa, "· " + y(Be(l.fileSize)), 1)) : S("", !0)
|
|
1572
1956
|
])
|
|
1573
1957
|
])
|
|
1574
1958
|
])
|
|
1575
|
-
], 10,
|
|
1959
|
+
], 10, Gs)) : S("", !0),
|
|
1576
1960
|
e("div", {
|
|
1577
|
-
class:
|
|
1961
|
+
class: K([
|
|
1578
1962
|
"message-time",
|
|
1579
|
-
|
|
1963
|
+
l.isSelf ? "message-time-right" : "message-time-left"
|
|
1580
1964
|
])
|
|
1581
|
-
}, y(
|
|
1965
|
+
}, y(u(Ve)(l.time)), 3)
|
|
1582
1966
|
])
|
|
1583
1967
|
], 2)
|
|
1584
1968
|
], 2))), 128))
|
|
1585
1969
|
], 512),
|
|
1586
|
-
e("div",
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1970
|
+
e("div", {
|
|
1971
|
+
class: "chat-input-area",
|
|
1972
|
+
onClick: o[6] || (o[6] = (l) => pe.value = !1)
|
|
1973
|
+
}, [
|
|
1974
|
+
ae.value.length > 0 ? (a(), p("div", aa, [
|
|
1975
|
+
(a(!0), p(de, null, ue(ae.value, (l, fe) => (a(), p("div", {
|
|
1976
|
+
key: l.id,
|
|
1590
1977
|
class: "pending-file-item"
|
|
1591
1978
|
}, [
|
|
1592
|
-
|
|
1979
|
+
l.isImage ? (a(), p("div", na, [
|
|
1593
1980
|
e("img", {
|
|
1594
|
-
src:
|
|
1595
|
-
alt:
|
|
1981
|
+
src: l.previewUrl,
|
|
1982
|
+
alt: l.name,
|
|
1596
1983
|
class: "pending-image"
|
|
1597
|
-
}, null, 8,
|
|
1984
|
+
}, null, 8, ia),
|
|
1598
1985
|
e("button", {
|
|
1599
|
-
onClick: (
|
|
1986
|
+
onClick: (i) => qe(fe),
|
|
1600
1987
|
class: "pending-file-remove-btn"
|
|
1601
|
-
}, " × ", 8,
|
|
1602
|
-
])) : (a(), p("div",
|
|
1603
|
-
m(
|
|
1988
|
+
}, " × ", 8, la)
|
|
1989
|
+
])) : (a(), p("div", oa, [
|
|
1990
|
+
m(d, { class: "pending-file-icon" }, {
|
|
1604
1991
|
default: k(() => [
|
|
1605
|
-
m(
|
|
1992
|
+
m(u(Qe))
|
|
1606
1993
|
]),
|
|
1607
1994
|
_: 1
|
|
1608
1995
|
}),
|
|
1609
|
-
e("span",
|
|
1996
|
+
e("span", ra, y(l.name), 1),
|
|
1610
1997
|
e("button", {
|
|
1611
|
-
onClick: (
|
|
1998
|
+
onClick: (i) => qe(fe),
|
|
1612
1999
|
class: "pending-file-remove-btn"
|
|
1613
|
-
}, " × ", 8,
|
|
2000
|
+
}, " × ", 8, ca)
|
|
1614
2001
|
]))
|
|
1615
2002
|
]))), 128))
|
|
1616
2003
|
])) : S("", !0),
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
2004
|
+
w.config.modules.fileUpload ? (a(), p("div", da, [
|
|
2005
|
+
e("div", ua, [
|
|
2006
|
+
m(d, {
|
|
2007
|
+
class: "input-toolbar-icon",
|
|
2008
|
+
onClick: o[4] || (o[4] = Fe((l) => pe.value = !pe.value, ["stop"]))
|
|
2009
|
+
}, {
|
|
2010
|
+
default: k(() => [
|
|
2011
|
+
m(u(Xe))
|
|
2012
|
+
]),
|
|
2013
|
+
_: 1
|
|
2014
|
+
}),
|
|
2015
|
+
m(Et, {
|
|
2016
|
+
visible: pe.value,
|
|
2017
|
+
onSelect: ct
|
|
2018
|
+
}, null, 8, ["visible"])
|
|
2019
|
+
]),
|
|
2020
|
+
m(d, {
|
|
1625
2021
|
class: "input-toolbar-icon",
|
|
1626
2022
|
onClick: it
|
|
1627
2023
|
}, {
|
|
1628
2024
|
default: k(() => [
|
|
1629
|
-
m(
|
|
2025
|
+
m(u(Qe))
|
|
1630
2026
|
]),
|
|
1631
2027
|
_: 1
|
|
1632
2028
|
}),
|
|
1633
|
-
m(
|
|
2029
|
+
m(d, { class: "input-toolbar-icon" }, {
|
|
1634
2030
|
default: k(() => [
|
|
1635
|
-
m(
|
|
2031
|
+
m(u(Rt))
|
|
1636
2032
|
]),
|
|
1637
2033
|
_: 1
|
|
1638
2034
|
})
|
|
1639
2035
|
])) : S("", !0),
|
|
1640
|
-
e("div",
|
|
2036
|
+
e("div", va, [
|
|
1641
2037
|
Ct(e("textarea", {
|
|
1642
|
-
"onUpdate:modelValue":
|
|
1643
|
-
onKeydown: xt(
|
|
2038
|
+
"onUpdate:modelValue": o[5] || (o[5] = (l) => Re(U) ? U.value = l : null),
|
|
2039
|
+
onKeydown: xt(Fe(Ne, ["prevent"]), ["enter"]),
|
|
1644
2040
|
onPaste: ot,
|
|
1645
2041
|
placeholder: "输入消息或粘贴文件...",
|
|
1646
2042
|
class: "message-input-textarea",
|
|
1647
2043
|
rows: "3"
|
|
1648
|
-
}, null, 40,
|
|
1649
|
-
[Ut,
|
|
2044
|
+
}, null, 40, pa), [
|
|
2045
|
+
[Ut, u(U)]
|
|
1650
2046
|
])
|
|
1651
2047
|
]),
|
|
1652
|
-
e("div",
|
|
1653
|
-
m(
|
|
2048
|
+
e("div", ma, [
|
|
2049
|
+
m(j, {
|
|
1654
2050
|
type: "primary",
|
|
1655
|
-
disabled: !
|
|
1656
|
-
onClick:
|
|
2051
|
+
disabled: !u(U).trim() && ae.value.length === 0,
|
|
2052
|
+
onClick: Ne,
|
|
1657
2053
|
class: "send-message-btn"
|
|
1658
2054
|
}, {
|
|
1659
|
-
default: k(() => [...
|
|
1660
|
-
|
|
2055
|
+
default: k(() => [...o[21] || (o[21] = [
|
|
2056
|
+
me(" 发送 ", -1)
|
|
1661
2057
|
])]),
|
|
1662
2058
|
_: 1
|
|
1663
2059
|
}, 8, ["disabled"])
|
|
1664
2060
|
]),
|
|
1665
2061
|
e("input", {
|
|
1666
2062
|
ref_key: "fileInputRef",
|
|
1667
|
-
ref:
|
|
2063
|
+
ref: I,
|
|
1668
2064
|
type: "file",
|
|
1669
2065
|
multiple: "",
|
|
1670
2066
|
class: "hidden-file-input",
|
|
1671
2067
|
onChange: lt
|
|
1672
2068
|
}, null, 544)
|
|
1673
2069
|
])
|
|
1674
|
-
])) :
|
|
1675
|
-
m(
|
|
2070
|
+
])) : M.value ? S("", !0) : (a(), p("div", ha, [
|
|
2071
|
+
m(d, {
|
|
1676
2072
|
size: 64,
|
|
1677
2073
|
class: "empty-state-icon"
|
|
1678
2074
|
}, {
|
|
1679
2075
|
default: k(() => [
|
|
1680
|
-
m(
|
|
2076
|
+
m(u(Mt))
|
|
1681
2077
|
]),
|
|
1682
2078
|
_: 1
|
|
1683
2079
|
}),
|
|
1684
|
-
e("div",
|
|
2080
|
+
e("div", fa, y(se.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
1685
2081
|
]))
|
|
1686
2082
|
]),
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
e("div",
|
|
1690
|
-
e("div",
|
|
2083
|
+
Y.value ? (a(), p("div", ga, [
|
|
2084
|
+
o[23] || (o[23] = e("div", { class: "chat-detail-header" }, "聊天详情", -1)),
|
|
2085
|
+
e("div", ya, [
|
|
2086
|
+
e("div", _a, [
|
|
1691
2087
|
e("img", {
|
|
1692
|
-
src: (
|
|
1693
|
-
alt: (
|
|
2088
|
+
src: (be = T.value) == null ? void 0 : be.avatar,
|
|
2089
|
+
alt: (je = T.value) == null ? void 0 : je.name,
|
|
1694
2090
|
class: "chat-detail-avatar"
|
|
1695
|
-
}, null, 8,
|
|
1696
|
-
e("div",
|
|
1697
|
-
|
|
2091
|
+
}, null, 8, ba),
|
|
2092
|
+
e("div", ka, y((Ee = T.value) == null ? void 0 : Ee.name), 1),
|
|
2093
|
+
o[22] || (o[22] = e("div", { class: "chat-detail-actions" }, [
|
|
1698
2094
|
e("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
|
|
1699
2095
|
e("div", { class: "chat-detail-action-item" }, "清空聊天记录")
|
|
1700
2096
|
], -1))
|
|
1701
2097
|
])
|
|
1702
2098
|
])
|
|
1703
2099
|
])) : S("", !0),
|
|
1704
|
-
m(
|
|
1705
|
-
modelValue:
|
|
1706
|
-
"onUpdate:modelValue":
|
|
2100
|
+
m(ce, {
|
|
2101
|
+
modelValue: u(x),
|
|
2102
|
+
"onUpdate:modelValue": o[8] || (o[8] = (l) => Re(x) ? x.value = l : null),
|
|
1707
2103
|
title: "添加好友",
|
|
1708
2104
|
width: "500px",
|
|
1709
2105
|
"append-to-body": ""
|
|
1710
2106
|
}, {
|
|
1711
2107
|
default: k(() => [
|
|
1712
|
-
e("div",
|
|
2108
|
+
e("div", wa, [
|
|
1713
2109
|
m(s, {
|
|
1714
|
-
modelValue:
|
|
1715
|
-
"onUpdate:modelValue":
|
|
2110
|
+
modelValue: u(he),
|
|
2111
|
+
"onUpdate:modelValue": o[7] || (o[7] = (l) => Re(he) ? he.value = l : null),
|
|
1716
2112
|
placeholder: "搜索用户",
|
|
1717
|
-
"prefix-icon":
|
|
2113
|
+
"prefix-icon": u(Ye),
|
|
1718
2114
|
class: "add-friend-search-input"
|
|
1719
2115
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1720
2116
|
]),
|
|
1721
|
-
e("div",
|
|
1722
|
-
|
|
2117
|
+
e("div", Ca, [
|
|
2118
|
+
u(ze) ? (a(), Z(b, {
|
|
1723
2119
|
key: 0,
|
|
1724
2120
|
description: "加载中..."
|
|
1725
|
-
})) :
|
|
2121
|
+
})) : u(ve).length === 0 ? (a(), Z(b, {
|
|
1726
2122
|
key: 1,
|
|
1727
2123
|
description: "暂无用户"
|
|
1728
|
-
})) : (a(!0), p(
|
|
1729
|
-
key:
|
|
2124
|
+
})) : (a(!0), p(de, { key: 2 }, ue(u(ve), (l) => (a(), p("div", {
|
|
2125
|
+
key: l.username,
|
|
1730
2126
|
class: "add-friend-user-item"
|
|
1731
2127
|
}, [
|
|
1732
|
-
e("div",
|
|
2128
|
+
e("div", xa, [
|
|
1733
2129
|
e("img", {
|
|
1734
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${
|
|
1735
|
-
alt:
|
|
2130
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.username}`,
|
|
2131
|
+
alt: l.username,
|
|
1736
2132
|
class: "add-friend-user-avatar"
|
|
1737
|
-
}, null, 8,
|
|
1738
|
-
e("div",
|
|
2133
|
+
}, null, 8, Ua),
|
|
2134
|
+
e("div", $a, y(l.username), 1)
|
|
1739
2135
|
]),
|
|
1740
|
-
m(
|
|
2136
|
+
m(j, {
|
|
1741
2137
|
type: "primary",
|
|
1742
2138
|
size: "small",
|
|
1743
|
-
onClick: (
|
|
2139
|
+
onClick: (fe) => u(W)(l)
|
|
1744
2140
|
}, {
|
|
1745
|
-
default: k(() => [...
|
|
1746
|
-
|
|
2141
|
+
default: k(() => [...o[24] || (o[24] = [
|
|
2142
|
+
me("添加", -1)
|
|
1747
2143
|
])]),
|
|
1748
2144
|
_: 1
|
|
1749
2145
|
}, 8, ["onClick"])
|
|
@@ -1752,9 +2148,9 @@ const gt = (x, t) => {
|
|
|
1752
2148
|
]),
|
|
1753
2149
|
_: 1
|
|
1754
2150
|
}, 8, ["modelValue"]),
|
|
1755
|
-
m(
|
|
1756
|
-
modelValue:
|
|
1757
|
-
"onUpdate:modelValue":
|
|
2151
|
+
m(ce, {
|
|
2152
|
+
modelValue: $e.value,
|
|
2153
|
+
"onUpdate:modelValue": o[13] || (o[13] = (l) => $e.value = l),
|
|
1758
2154
|
title: "个人设置",
|
|
1759
2155
|
width: "560px",
|
|
1760
2156
|
"close-on-click-modal": !1,
|
|
@@ -1762,128 +2158,128 @@ const gt = (x, t) => {
|
|
|
1762
2158
|
class: "chat-settings-dialog"
|
|
1763
2159
|
}, {
|
|
1764
2160
|
default: k(() => [
|
|
1765
|
-
e("div",
|
|
1766
|
-
e("div",
|
|
1767
|
-
e("div",
|
|
2161
|
+
e("div", Sa, [
|
|
2162
|
+
e("div", za, [
|
|
2163
|
+
e("div", Aa, [
|
|
1768
2164
|
e("img", {
|
|
1769
|
-
src:
|
|
2165
|
+
src: u(O),
|
|
1770
2166
|
alt: "头像",
|
|
1771
2167
|
class: "chat-settings-avatar"
|
|
1772
|
-
}, null, 8,
|
|
1773
|
-
|
|
2168
|
+
}, null, 8, Fa),
|
|
2169
|
+
w.config.modules.avatarCrop ? (a(), p("div", {
|
|
1774
2170
|
key: 0,
|
|
1775
2171
|
class: "chat-settings-avatar-edit",
|
|
1776
2172
|
onClick: nt
|
|
1777
2173
|
}, [
|
|
1778
|
-
m(
|
|
2174
|
+
m(d, {
|
|
1779
2175
|
size: 18,
|
|
1780
2176
|
class: "chat-settings-avatar-icon"
|
|
1781
2177
|
}, {
|
|
1782
2178
|
default: k(() => [
|
|
1783
|
-
m(
|
|
2179
|
+
m(u(It))
|
|
1784
2180
|
]),
|
|
1785
2181
|
_: 1
|
|
1786
2182
|
})
|
|
1787
2183
|
])) : S("", !0),
|
|
1788
2184
|
e("input", {
|
|
1789
2185
|
ref_key: "avatarInputRef",
|
|
1790
|
-
ref:
|
|
2186
|
+
ref: r,
|
|
1791
2187
|
type: "file",
|
|
1792
2188
|
accept: "image/*",
|
|
1793
2189
|
class: "hidden-avatar-input",
|
|
1794
|
-
onChange:
|
|
2190
|
+
onChange: dt
|
|
1795
2191
|
}, null, 544)
|
|
1796
2192
|
]),
|
|
1797
|
-
e("div",
|
|
1798
|
-
e("div",
|
|
1799
|
-
e("div",
|
|
2193
|
+
e("div", Va, [
|
|
2194
|
+
e("div", Ra, y(u(H).nickname || u($)), 1),
|
|
2195
|
+
e("div", Ma, "@" + y(u($)), 1)
|
|
1800
2196
|
])
|
|
1801
2197
|
]),
|
|
1802
|
-
e("div",
|
|
1803
|
-
e("div",
|
|
1804
|
-
e("div",
|
|
1805
|
-
m(
|
|
2198
|
+
e("div", Ia, [
|
|
2199
|
+
e("div", La, [
|
|
2200
|
+
e("div", Ta, [
|
|
2201
|
+
m(d, null, {
|
|
1806
2202
|
default: k(() => [
|
|
1807
|
-
m(
|
|
2203
|
+
m(u(Je))
|
|
1808
2204
|
]),
|
|
1809
2205
|
_: 1
|
|
1810
2206
|
}),
|
|
1811
|
-
|
|
2207
|
+
o[25] || (o[25] = me(" 个人信息 ", -1))
|
|
1812
2208
|
]),
|
|
1813
|
-
|
|
2209
|
+
oe.value ? S("", !0) : (a(), Z(j, {
|
|
1814
2210
|
key: 0,
|
|
1815
2211
|
type: "primary",
|
|
1816
2212
|
size: "small",
|
|
1817
|
-
onClick:
|
|
2213
|
+
onClick: vt,
|
|
1818
2214
|
class: "chat-settings-edit-btn"
|
|
1819
2215
|
}, {
|
|
1820
|
-
default: k(() => [...
|
|
1821
|
-
|
|
2216
|
+
default: k(() => [...o[26] || (o[26] = [
|
|
2217
|
+
me(" 编辑 ", -1)
|
|
1822
2218
|
])]),
|
|
1823
2219
|
_: 1
|
|
1824
2220
|
}))
|
|
1825
2221
|
]),
|
|
1826
|
-
e("div",
|
|
1827
|
-
e("div",
|
|
1828
|
-
|
|
1829
|
-
|
|
2222
|
+
e("div", Ea, [
|
|
2223
|
+
e("div", Da, [
|
|
2224
|
+
o[27] || (o[27] = e("label", { class: "chat-settings-form-label" }, "昵称", -1)),
|
|
2225
|
+
oe.value ? (a(), Z(s, {
|
|
1830
2226
|
key: 0,
|
|
1831
|
-
modelValue:
|
|
1832
|
-
"onUpdate:modelValue":
|
|
2227
|
+
modelValue: P.value.nickname,
|
|
2228
|
+
"onUpdate:modelValue": o[9] || (o[9] = (l) => P.value.nickname = l),
|
|
1833
2229
|
placeholder: "请输入昵称",
|
|
1834
2230
|
size: "large"
|
|
1835
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
2231
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(u(H).nickname || "未设置"), 1))
|
|
1836
2232
|
]),
|
|
1837
|
-
e("div",
|
|
1838
|
-
|
|
1839
|
-
|
|
2233
|
+
e("div", ja, [
|
|
2234
|
+
o[28] || (o[28] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
|
|
2235
|
+
oe.value ? (a(), Z(s, {
|
|
1840
2236
|
key: 0,
|
|
1841
|
-
modelValue:
|
|
1842
|
-
"onUpdate:modelValue":
|
|
2237
|
+
modelValue: P.value.email,
|
|
2238
|
+
"onUpdate:modelValue": o[10] || (o[10] = (l) => P.value.email = l),
|
|
1843
2239
|
placeholder: "请输入邮箱",
|
|
1844
2240
|
size: "large"
|
|
1845
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
2241
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ha, y(u(H).email || "未设置"), 1))
|
|
1846
2242
|
]),
|
|
1847
|
-
e("div",
|
|
1848
|
-
|
|
1849
|
-
|
|
2243
|
+
e("div", Xa, [
|
|
2244
|
+
o[29] || (o[29] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
|
|
2245
|
+
oe.value ? (a(), Z(s, {
|
|
1850
2246
|
key: 0,
|
|
1851
|
-
modelValue:
|
|
1852
|
-
"onUpdate:modelValue":
|
|
2247
|
+
modelValue: P.value.phone,
|
|
2248
|
+
"onUpdate:modelValue": o[11] || (o[11] = (l) => P.value.phone = l),
|
|
1853
2249
|
placeholder: "请输入手机号",
|
|
1854
2250
|
size: "large"
|
|
1855
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
2251
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ya, y(u(H).phone || "未设置"), 1))
|
|
1856
2252
|
]),
|
|
1857
|
-
e("div",
|
|
1858
|
-
|
|
1859
|
-
|
|
2253
|
+
e("div", qa, [
|
|
2254
|
+
o[30] || (o[30] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
|
|
2255
|
+
oe.value ? (a(), Z(s, {
|
|
1860
2256
|
key: 0,
|
|
1861
|
-
modelValue:
|
|
1862
|
-
"onUpdate:modelValue":
|
|
2257
|
+
modelValue: P.value.bio,
|
|
2258
|
+
"onUpdate:modelValue": o[12] || (o[12] = (l) => P.value.bio = l),
|
|
1863
2259
|
type: "textarea",
|
|
1864
2260
|
rows: 4,
|
|
1865
2261
|
placeholder: "介绍一下自己吧...",
|
|
1866
2262
|
size: "large"
|
|
1867
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
2263
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ba, y(u(H).bio || "这个人很懒,什么都没写~"), 1))
|
|
1868
2264
|
]),
|
|
1869
|
-
|
|
1870
|
-
m(
|
|
2265
|
+
oe.value ? (a(), p("div", Na, [
|
|
2266
|
+
m(j, {
|
|
1871
2267
|
size: "default",
|
|
1872
|
-
onClick:
|
|
2268
|
+
onClick: pt
|
|
1873
2269
|
}, {
|
|
1874
|
-
default: k(() => [...
|
|
1875
|
-
|
|
2270
|
+
default: k(() => [...o[31] || (o[31] = [
|
|
2271
|
+
me("取消", -1)
|
|
1876
2272
|
])]),
|
|
1877
2273
|
_: 1
|
|
1878
2274
|
}),
|
|
1879
|
-
m(
|
|
2275
|
+
m(j, {
|
|
1880
2276
|
type: "primary",
|
|
1881
2277
|
size: "default",
|
|
1882
|
-
loading:
|
|
1883
|
-
onClick:
|
|
2278
|
+
loading: re.value,
|
|
2279
|
+
onClick: mt
|
|
1884
2280
|
}, {
|
|
1885
|
-
default: k(() => [...
|
|
1886
|
-
|
|
2281
|
+
default: k(() => [...o[32] || (o[32] = [
|
|
2282
|
+
me("保存更改", -1)
|
|
1887
2283
|
])]),
|
|
1888
2284
|
_: 1
|
|
1889
2285
|
}, 8, ["loading"])
|
|
@@ -1895,15 +2291,15 @@ const gt = (x, t) => {
|
|
|
1895
2291
|
_: 1
|
|
1896
2292
|
}, 8, ["modelValue"]),
|
|
1897
2293
|
m(yt, {
|
|
1898
|
-
modelValue:
|
|
1899
|
-
"onUpdate:modelValue":
|
|
1900
|
-
src:
|
|
1901
|
-
onConfirm:
|
|
2294
|
+
modelValue: _e.value,
|
|
2295
|
+
"onUpdate:modelValue": o[14] || (o[14] = (l) => _e.value = l),
|
|
2296
|
+
src: _.value,
|
|
2297
|
+
onConfirm: ut
|
|
1902
2298
|
}, null, 8, ["modelValue", "src"]),
|
|
1903
|
-
|
|
2299
|
+
B.value.visible ? (a(), p("div", {
|
|
1904
2300
|
key: 1,
|
|
1905
2301
|
class: "chat-context-menu",
|
|
1906
|
-
style:
|
|
2302
|
+
style: He({ left: B.value.x + "px", top: B.value.y + "px" })
|
|
1907
2303
|
}, [
|
|
1908
2304
|
e("div", {
|
|
1909
2305
|
class: "chat-context-menu-item",
|
|
@@ -1913,61 +2309,61 @@ const gt = (x, t) => {
|
|
|
1913
2309
|
]);
|
|
1914
2310
|
};
|
|
1915
2311
|
}
|
|
1916
|
-
},
|
|
2312
|
+
}, Ka = /* @__PURE__ */ Ze(Pa, [["__scopeId", "data-v-4f950e86"]]), Oa = { class: "chat-container" }, Ga = { class: "sidebar-nav" }, Ja = ["src"], Qa = ["onClick"], Za = {
|
|
1917
2313
|
key: 0,
|
|
1918
2314
|
class: "nav-badge"
|
|
1919
|
-
},
|
|
2315
|
+
}, en = { class: "content-panel" }, tn = { class: "search-bar" }, sn = { class: "content-scroll" }, an = { key: 0 }, nn = ["onClick", "onContextmenu"], ln = { class: "friend-avatar-wrapper" }, on = ["src", "alt"], rn = {
|
|
1920
2316
|
key: 0,
|
|
1921
2317
|
class: "online-indicator"
|
|
1922
|
-
},
|
|
2318
|
+
}, cn = { class: "friend-info" }, dn = { class: "friend-header" }, un = { class: "friend-name" }, vn = { class: "last-time" }, pn = { class: "friend-preview" }, mn = { class: "last-msg" }, hn = {
|
|
1923
2319
|
key: 0,
|
|
1924
2320
|
class: "unread-badge"
|
|
1925
|
-
},
|
|
2321
|
+
}, fn = { key: 1 }, gn = { class: "add-friend-section" }, yn = { class: "add-friend-icon" }, _n = ["onClick"], bn = { class: "friend-avatar-wrapper" }, kn = ["src", "alt"], wn = { class: "friend-info" }, Cn = { class: "friend-name" }, xn = { key: 2 }, Un = { class: "request-info" }, $n = ["src", "alt"], Sn = { class: "request-details" }, zn = { class: "request-username" }, An = { class: "chat-area" }, Fn = {
|
|
1926
2322
|
key: 0,
|
|
1927
2323
|
class: "friend-profile"
|
|
1928
|
-
},
|
|
2324
|
+
}, Vn = ["src", "alt"], Rn = { class: "profile-name" }, Mn = { class: "profile-status" }, In = {
|
|
1929
2325
|
key: 1,
|
|
1930
2326
|
class: "chat-window"
|
|
1931
|
-
},
|
|
2327
|
+
}, Ln = { class: "chat-header" }, Tn = { class: "chat-title" }, En = { class: "chat-name" }, Dn = { class: "chat-actions" }, Wn = { class: "message-avatar" }, jn = ["src"], Hn = {
|
|
1932
2328
|
key: 0,
|
|
1933
2329
|
class: "sender-name"
|
|
1934
|
-
},
|
|
2330
|
+
}, Xn = { class: "message-bubble-wrapper" }, Yn = ["onClick"], qn = ["src", "alt"], Bn = {
|
|
1935
2331
|
key: 0,
|
|
1936
2332
|
class: "image-size"
|
|
1937
|
-
},
|
|
2333
|
+
}, Nn = ["onClick"], Pn = { class: "file-content" }, Kn = { class: "file-icon" }, On = { class: "file-info" }, Gn = { class: "file-name" }, Jn = { class: "file-meta" }, Qn = { key: 0 }, Zn = {
|
|
1938
2334
|
key: 0,
|
|
1939
2335
|
class: "pending-files"
|
|
1940
|
-
},
|
|
2336
|
+
}, ei = {
|
|
1941
2337
|
key: 0,
|
|
1942
2338
|
class: "pending-image-wrapper"
|
|
1943
|
-
},
|
|
2339
|
+
}, ti = ["src", "alt"], si = ["onClick"], ai = {
|
|
1944
2340
|
key: 1,
|
|
1945
2341
|
class: "pending-file-wrapper"
|
|
1946
|
-
},
|
|
2342
|
+
}, ni = { class: "pending-file-name" }, ii = ["onClick"], li = {
|
|
1947
2343
|
key: 1,
|
|
1948
2344
|
class: "input-actions"
|
|
1949
|
-
},
|
|
2345
|
+
}, oi = { class: "emoji-button-wrapper" }, ri = { class: "input-wrapper" }, ci = ["onKeydown"], di = { class: "send-btn-wrapper" }, ui = {
|
|
1950
2346
|
key: 2,
|
|
1951
2347
|
class: "empty-state"
|
|
1952
|
-
},
|
|
2348
|
+
}, vi = { class: "empty-text" }, pi = {
|
|
1953
2349
|
key: 0,
|
|
1954
2350
|
class: "detail-panel"
|
|
1955
|
-
},
|
|
2351
|
+
}, mi = { class: "detail-content" }, hi = { class: "detail-profile" }, fi = ["src", "alt"], gi = { class: "detail-name" }, yi = { class: "search-users-wrapper" }, _i = { class: "search-users-input" }, bi = { class: "users-list-scroll" }, ki = { class: "available-user-info" }, wi = ["src", "alt"], Ci = { class: "available-user-name" }, xi = { class: "settings-container" }, Ui = { class: "settings-avatar-section" }, $i = { class: "settings-avatar-wrapper" }, Si = ["src"], zi = { class: "settings-user-display" }, Ai = { class: "settings-nickname" }, Fi = { class: "settings-username" }, Vi = { class: "settings-form-section" }, Ri = { class: "settings-form-header" }, Mi = { class: "settings-form-title" }, Ii = { class: "settings-form" }, Li = { class: "settings-form-item" }, Ti = {
|
|
1956
2352
|
key: 1,
|
|
1957
2353
|
class: "settings-form-value"
|
|
1958
|
-
},
|
|
2354
|
+
}, Ei = { class: "settings-form-item" }, Di = {
|
|
1959
2355
|
key: 1,
|
|
1960
2356
|
class: "settings-form-value"
|
|
1961
|
-
},
|
|
2357
|
+
}, Wi = { class: "settings-form-item" }, ji = {
|
|
1962
2358
|
key: 1,
|
|
1963
2359
|
class: "settings-form-value"
|
|
1964
|
-
},
|
|
2360
|
+
}, Hi = { class: "settings-form-item" }, Xi = {
|
|
1965
2361
|
key: 1,
|
|
1966
2362
|
class: "settings-form-value bio-value"
|
|
1967
|
-
},
|
|
2363
|
+
}, Yi = {
|
|
1968
2364
|
key: 0,
|
|
1969
2365
|
class: "settings-form-actions"
|
|
1970
|
-
},
|
|
2366
|
+
}, qi = {
|
|
1971
2367
|
__name: "ChatWindow",
|
|
1972
2368
|
props: {
|
|
1973
2369
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1975,376 +2371,376 @@ const gt = (x, t) => {
|
|
|
1975
2371
|
width: { type: [String, Number], default: "1100px" }
|
|
1976
2372
|
},
|
|
1977
2373
|
emits: ["update:modelValue", "open", "close", "message", "send", "error"],
|
|
1978
|
-
setup(
|
|
1979
|
-
const n =
|
|
2374
|
+
setup(w, { emit: t }) {
|
|
2375
|
+
const n = w, v = t, $ = ke({
|
|
1980
2376
|
get: () => n.modelValue,
|
|
1981
|
-
set: (
|
|
2377
|
+
set: (d) => v("update:modelValue", d)
|
|
1982
2378
|
}), {
|
|
1983
|
-
myUsername:
|
|
2379
|
+
myUsername: O,
|
|
1984
2380
|
myAvatar: H,
|
|
1985
|
-
userInfo:
|
|
1986
|
-
loadingUserInfo:
|
|
1987
|
-
friendList:
|
|
1988
|
-
filteredFriendList:
|
|
2381
|
+
userInfo: G,
|
|
2382
|
+
loadingUserInfo: V,
|
|
2383
|
+
friendList: ie,
|
|
2384
|
+
filteredFriendList: R,
|
|
1989
2385
|
searchText: U,
|
|
1990
2386
|
inputText: A,
|
|
1991
|
-
messagesContainer:
|
|
1992
|
-
filteredUsers:
|
|
1993
|
-
filteredAvailableUsers:
|
|
1994
|
-
currentUser:
|
|
1995
|
-
currentMessages:
|
|
1996
|
-
addFriendDialogVisible:
|
|
1997
|
-
addFriendSearchText:
|
|
1998
|
-
availableUsers:
|
|
1999
|
-
loadingAvailableUsers:
|
|
2000
|
-
friendApplyList:
|
|
2001
|
-
loadingFriendApply:
|
|
2002
|
-
formatTime:
|
|
2387
|
+
messagesContainer: f,
|
|
2388
|
+
filteredUsers: ve,
|
|
2389
|
+
filteredAvailableUsers: Se,
|
|
2390
|
+
currentUser: ge,
|
|
2391
|
+
currentMessages: x,
|
|
2392
|
+
addFriendDialogVisible: he,
|
|
2393
|
+
addFriendSearchText: we,
|
|
2394
|
+
availableUsers: ze,
|
|
2395
|
+
loadingAvailableUsers: Ce,
|
|
2396
|
+
friendApplyList: Ue,
|
|
2397
|
+
loadingFriendApply: Ve,
|
|
2398
|
+
formatTime: Me,
|
|
2003
2399
|
formatLastTime: De,
|
|
2004
2400
|
scrollToBottom: We,
|
|
2005
|
-
getFriendList:
|
|
2006
|
-
getChatHistory:
|
|
2401
|
+
getFriendList: Ie,
|
|
2402
|
+
getChatHistory: C,
|
|
2007
2403
|
setFriendToChatStatus: z,
|
|
2008
|
-
selectUser:
|
|
2009
|
-
sendMessage:
|
|
2010
|
-
sendFile:
|
|
2011
|
-
sendFilesAndText:
|
|
2012
|
-
initWebSocket:
|
|
2013
|
-
closeWebSocket:
|
|
2014
|
-
reset:
|
|
2015
|
-
openAddFriendDialog:
|
|
2016
|
-
addFriend:
|
|
2404
|
+
selectUser: q,
|
|
2405
|
+
sendMessage: L,
|
|
2406
|
+
sendFile: E,
|
|
2407
|
+
sendFilesAndText: D,
|
|
2408
|
+
initWebSocket: X,
|
|
2409
|
+
closeWebSocket: J,
|
|
2410
|
+
reset: Q,
|
|
2411
|
+
openAddFriendDialog: W,
|
|
2412
|
+
addFriend: N,
|
|
2017
2413
|
loadFriendApplyList: te,
|
|
2018
|
-
agreeFriend:
|
|
2019
|
-
updateMyAvatar:
|
|
2020
|
-
|
|
2021
|
-
updateUserInfo: B
|
|
2022
|
-
} = Tt(n.config), se = we(() => {
|
|
2414
|
+
agreeFriend: ne,
|
|
2415
|
+
updateMyAvatar: le
|
|
2416
|
+
} = Tt(n.config), se = ke(() => {
|
|
2023
2417
|
var s;
|
|
2024
|
-
const
|
|
2025
|
-
return n.config.modules.friends &&
|
|
2026
|
-
}),
|
|
2027
|
-
|
|
2418
|
+
const d = [{ id: "chat", icon: Xe, badge: 0 }];
|
|
2419
|
+
return n.config.modules.friends && d.push({ id: "friends", icon: Je, badge: 0 }), n.config.modules.apply && d.push({ id: "apply", icon: $t, badge: ((s = Ue.value) == null ? void 0 : s.length) || 0 }), d;
|
|
2420
|
+
}), F = g("chat"), T = g(null), M = g(null), Y = g(null), oe = g(!1), P = g(!1), re = g({ nickname: "", email: "", phone: "", bio: "" }), $e = g(!1), _e = g(!1), c = g(!1), r = g(!1), _ = g(null), I = g(""), ae = g(null), B = g([]), pe = g({ visible: !1, x: 0, y: 0, chat: null }), Ae = g(!1), Le = () => {
|
|
2421
|
+
pe.value.visible = !1;
|
|
2028
2422
|
}, et = async () => {
|
|
2029
|
-
if (!
|
|
2030
|
-
await z(
|
|
2031
|
-
}, Te = (
|
|
2032
|
-
|
|
2033
|
-
id:
|
|
2034
|
-
name:
|
|
2035
|
-
avatar:
|
|
2036
|
-
online:
|
|
2423
|
+
if (!pe.value.chat) return;
|
|
2424
|
+
await z(pe.value.chat.id, 0) && T.value === pe.value.chat.id && (T.value = null, M.value = null), Le();
|
|
2425
|
+
}, Te = (d) => {
|
|
2426
|
+
T.value = d.id, M.value = d, Y.value = null, oe.value = !1, q({
|
|
2427
|
+
id: d.id,
|
|
2428
|
+
name: d.name,
|
|
2429
|
+
avatar: d.avatar,
|
|
2430
|
+
online: d.online
|
|
2037
2431
|
});
|
|
2038
|
-
}, tt = (
|
|
2039
|
-
|
|
2432
|
+
}, tt = (d) => {
|
|
2433
|
+
Y.value = d, T.value = null, M.value = null;
|
|
2040
2434
|
}, st = async () => {
|
|
2041
|
-
if (!
|
|
2042
|
-
if (await z(
|
|
2043
|
-
|
|
2044
|
-
const s =
|
|
2045
|
-
s && Te(s),
|
|
2435
|
+
if (!Y.value) return;
|
|
2436
|
+
if (await z(Y.value.id)) {
|
|
2437
|
+
F.value = "chat", await Ke();
|
|
2438
|
+
const s = ve.value.find((b) => b.id === Y.value.id);
|
|
2439
|
+
s && Te(s), Y.value = null;
|
|
2046
2440
|
}
|
|
2047
2441
|
}, at = () => {
|
|
2048
|
-
|
|
2442
|
+
_e.value = !0;
|
|
2049
2443
|
}, nt = () => {
|
|
2050
|
-
var
|
|
2051
|
-
(
|
|
2444
|
+
var d;
|
|
2445
|
+
(d = _.value) == null || d.click();
|
|
2052
2446
|
}, it = () => {
|
|
2053
|
-
var
|
|
2054
|
-
(
|
|
2055
|
-
}, lt = (
|
|
2056
|
-
const s = Array.from(
|
|
2447
|
+
var d;
|
|
2448
|
+
(d = ae.value) == null || d.click();
|
|
2449
|
+
}, lt = (d) => {
|
|
2450
|
+
const s = Array.from(d.target.files || []);
|
|
2057
2451
|
if (s.length !== 0) {
|
|
2058
2452
|
for (const b of s) {
|
|
2059
2453
|
if (b.size > 50 * 1024 * 1024) {
|
|
2060
|
-
|
|
2454
|
+
ee.warning(`文件 ${b.name} 超过50MB,已跳过`);
|
|
2061
2455
|
continue;
|
|
2062
2456
|
}
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2457
|
+
const j = URL.createObjectURL(b);
|
|
2458
|
+
B.value.push({
|
|
2065
2459
|
id: Date.now() + Math.random(),
|
|
2066
2460
|
file: b,
|
|
2067
2461
|
name: b.name,
|
|
2068
2462
|
size: b.size,
|
|
2069
2463
|
type: b.type,
|
|
2070
|
-
previewUrl:
|
|
2464
|
+
previewUrl: j,
|
|
2071
2465
|
isImage: b.type.startsWith("image/")
|
|
2072
2466
|
});
|
|
2073
2467
|
}
|
|
2074
|
-
|
|
2468
|
+
ae.value && (ae.value.value = "");
|
|
2075
2469
|
}
|
|
2076
|
-
},
|
|
2077
|
-
const s =
|
|
2078
|
-
s.previewUrl && URL.revokeObjectURL(s.previewUrl),
|
|
2079
|
-
},
|
|
2080
|
-
if (
|
|
2081
|
-
const s = 1024, b = ["B", "KB", "MB", "GB"],
|
|
2082
|
-
return parseFloat((
|
|
2083
|
-
},
|
|
2084
|
-
if (!A.value.trim() &&
|
|
2085
|
-
const
|
|
2086
|
-
A.value = "",
|
|
2470
|
+
}, qe = (d) => {
|
|
2471
|
+
const s = B.value[d];
|
|
2472
|
+
s.previewUrl && URL.revokeObjectURL(s.previewUrl), B.value.splice(d, 1);
|
|
2473
|
+
}, Be = (d) => {
|
|
2474
|
+
if (d === 0) return "0 B";
|
|
2475
|
+
const s = 1024, b = ["B", "KB", "MB", "GB"], j = Math.floor(Math.log(d) / Math.log(s));
|
|
2476
|
+
return parseFloat((d / Math.pow(s, j)).toFixed(2)) + " " + b[j];
|
|
2477
|
+
}, Ne = async () => {
|
|
2478
|
+
if (!A.value.trim() && B.value.length === 0) return;
|
|
2479
|
+
const d = [...B.value], s = A.value;
|
|
2480
|
+
A.value = "", B.value.forEach((b) => {
|
|
2087
2481
|
b.previewUrl && URL.revokeObjectURL(b.previewUrl);
|
|
2088
|
-
}),
|
|
2089
|
-
}, ot = (
|
|
2482
|
+
}), B.value = [], await D(d, s), v("send", { text: s, files: d });
|
|
2483
|
+
}, ot = (d) => {
|
|
2090
2484
|
var b;
|
|
2091
|
-
const s = (b =
|
|
2485
|
+
const s = (b = d.clipboardData) == null ? void 0 : b.items;
|
|
2092
2486
|
if (s) {
|
|
2093
|
-
for (const
|
|
2094
|
-
if (
|
|
2095
|
-
const
|
|
2096
|
-
if (
|
|
2097
|
-
if (
|
|
2098
|
-
|
|
2487
|
+
for (const j of s)
|
|
2488
|
+
if (j.kind === "file") {
|
|
2489
|
+
const ce = j.getAsFile();
|
|
2490
|
+
if (ce) {
|
|
2491
|
+
if (ce.size > 50 * 1024 * 1024) {
|
|
2492
|
+
ee.warning(`文件 ${ce.name} 超过50MB,已跳过`);
|
|
2099
2493
|
continue;
|
|
2100
2494
|
}
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2495
|
+
const be = URL.createObjectURL(ce);
|
|
2496
|
+
B.value.push({
|
|
2103
2497
|
id: Date.now() + Math.random(),
|
|
2104
|
-
file:
|
|
2105
|
-
name:
|
|
2106
|
-
size:
|
|
2107
|
-
type:
|
|
2108
|
-
previewUrl:
|
|
2109
|
-
isImage:
|
|
2498
|
+
file: ce,
|
|
2499
|
+
name: ce.name,
|
|
2500
|
+
size: ce.size,
|
|
2501
|
+
type: ce.type,
|
|
2502
|
+
previewUrl: be,
|
|
2503
|
+
isImage: ce.type.startsWith("image/")
|
|
2110
2504
|
});
|
|
2111
2505
|
}
|
|
2112
2506
|
}
|
|
2113
2507
|
}
|
|
2114
|
-
},
|
|
2115
|
-
if (!
|
|
2116
|
-
|
|
2508
|
+
}, Pe = (d) => {
|
|
2509
|
+
if (!d) {
|
|
2510
|
+
ee.warning("文件地址无效");
|
|
2117
2511
|
return;
|
|
2118
2512
|
}
|
|
2119
|
-
window.open(
|
|
2120
|
-
}, rt = (
|
|
2121
|
-
console.warn("图片加载失败",
|
|
2122
|
-
}, ct = (
|
|
2123
|
-
|
|
2513
|
+
window.open(d, "_blank");
|
|
2514
|
+
}, rt = (d) => {
|
|
2515
|
+
console.warn("图片加载失败", d);
|
|
2516
|
+
}, ct = (d) => {
|
|
2517
|
+
A.value += d, Ae.value = !1;
|
|
2518
|
+
}, dt = (d) => {
|
|
2519
|
+
const s = d.target.files[0];
|
|
2124
2520
|
if (!s) return;
|
|
2125
2521
|
if (!s.type.startsWith("image/")) {
|
|
2126
|
-
|
|
2522
|
+
ee.error("只能上传图片文件");
|
|
2127
2523
|
return;
|
|
2128
2524
|
}
|
|
2129
2525
|
if (s.size > 5 * 1024 * 1024) {
|
|
2130
|
-
|
|
2526
|
+
ee.error("图片大小不能超过 5MB");
|
|
2131
2527
|
return;
|
|
2132
2528
|
}
|
|
2133
2529
|
const b = new FileReader();
|
|
2134
|
-
b.onload = (
|
|
2135
|
-
|
|
2530
|
+
b.onload = (j) => {
|
|
2531
|
+
I.value = j.target.result, c.value = !0;
|
|
2136
2532
|
}, b.readAsDataURL(s);
|
|
2137
|
-
},
|
|
2138
|
-
if (
|
|
2139
|
-
|
|
2533
|
+
}, ut = async ({ file: d }) => {
|
|
2534
|
+
if (d) {
|
|
2535
|
+
r.value = !0;
|
|
2140
2536
|
try {
|
|
2141
|
-
const { ChatApi: s } = await Promise.resolve().then(() => Lt),
|
|
2142
|
-
|
|
2537
|
+
const { ChatApi: s } = await Promise.resolve().then(() => Lt), j = await new s(n.config).uploadAvatar(d, O);
|
|
2538
|
+
j.code === 200 ? (ee.success("头像上传成功"), le(j.data), Oe()) : ee.error(j.msg || "头像上传失败");
|
|
2143
2539
|
} catch (s) {
|
|
2144
|
-
console.error(s),
|
|
2540
|
+
console.error(s), ee.error("头像上传失败");
|
|
2145
2541
|
} finally {
|
|
2146
|
-
|
|
2542
|
+
r.value = !1;
|
|
2147
2543
|
}
|
|
2148
2544
|
}
|
|
2149
|
-
},
|
|
2150
|
-
|
|
2151
|
-
}, ut = () => {
|
|
2152
|
-
oe.value = {
|
|
2153
|
-
nickname: Z.value.nickname || "",
|
|
2154
|
-
email: Z.value.email || "",
|
|
2155
|
-
phone: Z.value.phone || "",
|
|
2156
|
-
bio: Z.value.bio || ""
|
|
2157
|
-
}, K.value = !0;
|
|
2545
|
+
}, Oe = () => {
|
|
2546
|
+
I.value = "", c.value = !1, _.value && (_.value.value = "");
|
|
2158
2547
|
}, vt = () => {
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2548
|
+
re.value = {
|
|
2549
|
+
nickname: G.value.nickname || "",
|
|
2550
|
+
email: G.value.email || "",
|
|
2551
|
+
phone: G.value.phone || "",
|
|
2552
|
+
bio: G.value.bio || ""
|
|
2553
|
+
}, P.value = !0;
|
|
2554
|
+
}, pt = () => {
|
|
2555
|
+
P.value = !1, re.value = { nickname: "", email: "", phone: "", bio: "" };
|
|
2556
|
+
}, mt = async () => {
|
|
2557
|
+
$e.value = !0;
|
|
2162
2558
|
try {
|
|
2163
|
-
await
|
|
2164
|
-
} catch (
|
|
2165
|
-
console.error(
|
|
2559
|
+
await updateUserInfo(re.value) ? (ee.success("保存成功"), P.value = !1) : ee.error("保存失败");
|
|
2560
|
+
} catch (d) {
|
|
2561
|
+
console.error(d), ee.error("保存失败");
|
|
2166
2562
|
} finally {
|
|
2167
|
-
|
|
2563
|
+
$e.value = !1;
|
|
2168
2564
|
}
|
|
2169
|
-
},
|
|
2170
|
-
|
|
2171
|
-
},
|
|
2172
|
-
await Promise.all([
|
|
2565
|
+
}, h = () => {
|
|
2566
|
+
Q(), J(), oe.value = !1, _e.value = !1, Oe(), P.value = !1, v("close");
|
|
2567
|
+
}, o = async () => {
|
|
2568
|
+
await Promise.all([Ie(), te()]), X(), ve.value.length > 0 && Te(ve.value[0]), v("open");
|
|
2173
2569
|
};
|
|
2174
2570
|
return bt(() => {
|
|
2175
2571
|
document.addEventListener("click", Le);
|
|
2176
2572
|
}), kt(() => {
|
|
2177
|
-
document.removeEventListener("click", Le),
|
|
2178
|
-
}), (
|
|
2179
|
-
const b =
|
|
2180
|
-
return a(),
|
|
2573
|
+
document.removeEventListener("click", Le), J();
|
|
2574
|
+
}), (d, s) => {
|
|
2575
|
+
const b = ye("el-icon"), j = ye("el-input"), ce = ye("el-empty"), be = ye("el-button"), je = ye("el-dialog");
|
|
2576
|
+
return a(), Z(je, {
|
|
2181
2577
|
modelValue: $.value,
|
|
2182
|
-
"onUpdate:modelValue": s[
|
|
2183
|
-
width:
|
|
2578
|
+
"onUpdate:modelValue": s[15] || (s[15] = (Ee) => $.value = Ee),
|
|
2579
|
+
width: w.width,
|
|
2184
2580
|
"close-on-click-modal": !1,
|
|
2185
2581
|
class: "chat-dialog",
|
|
2186
2582
|
"append-to-body": "",
|
|
2187
|
-
onClosed:
|
|
2188
|
-
onOpen:
|
|
2583
|
+
onClosed: h,
|
|
2584
|
+
onOpen: o
|
|
2189
2585
|
}, {
|
|
2190
2586
|
default: k(() => {
|
|
2191
|
-
var Ee,
|
|
2587
|
+
var Ee, l, fe;
|
|
2192
2588
|
return [
|
|
2193
|
-
e("div",
|
|
2194
|
-
e("div",
|
|
2589
|
+
e("div", Oa, [
|
|
2590
|
+
e("div", Ga, [
|
|
2195
2591
|
e("div", {
|
|
2196
2592
|
class: "sidebar-avatar",
|
|
2197
2593
|
onClick: at
|
|
2198
2594
|
}, [
|
|
2199
2595
|
e("img", {
|
|
2200
|
-
src:
|
|
2596
|
+
src: u(H),
|
|
2201
2597
|
alt: "头像",
|
|
2202
2598
|
class: "avatar-img"
|
|
2203
|
-
}, null, 8,
|
|
2599
|
+
}, null, 8, Ja)
|
|
2204
2600
|
]),
|
|
2205
|
-
(a(!0), p(
|
|
2206
|
-
key:
|
|
2207
|
-
class:
|
|
2601
|
+
(a(!0), p(de, null, ue(se.value, (i) => (a(), p("div", {
|
|
2602
|
+
key: i.id,
|
|
2603
|
+
class: K([
|
|
2208
2604
|
"nav-item",
|
|
2209
|
-
|
|
2605
|
+
F.value === i.id ? "nav-item-active" : "nav-item-inactive"
|
|
2210
2606
|
]),
|
|
2211
|
-
onClick: (
|
|
2607
|
+
onClick: (xe) => F.value = i.id
|
|
2212
2608
|
}, [
|
|
2213
2609
|
m(b, { size: 24 }, {
|
|
2214
2610
|
default: k(() => [
|
|
2215
|
-
(a(),
|
|
2611
|
+
(a(), Z(wt(i.icon)))
|
|
2216
2612
|
]),
|
|
2217
2613
|
_: 2
|
|
2218
2614
|
}, 1024),
|
|
2219
|
-
|
|
2220
|
-
], 10,
|
|
2221
|
-
s[
|
|
2222
|
-
|
|
2615
|
+
i.badge ? (a(), p("span", Za, y(i.badge > 99 ? "99+" : i.badge), 1)) : S("", !0)
|
|
2616
|
+
], 10, Qa))), 128)),
|
|
2617
|
+
s[16] || (s[16] = e("div", { class: "nav-spacer" }, null, -1)),
|
|
2618
|
+
w.config.modules.settings ? (a(), p("div", {
|
|
2223
2619
|
key: 0,
|
|
2224
2620
|
class: "nav-item nav-item-inactive",
|
|
2225
|
-
onClick: s[0] || (s[0] = (
|
|
2621
|
+
onClick: s[0] || (s[0] = (i) => _e.value = !0),
|
|
2226
2622
|
title: "设置"
|
|
2227
2623
|
}, [
|
|
2228
2624
|
m(b, { size: 24 }, {
|
|
2229
2625
|
default: k(() => [
|
|
2230
|
-
m(
|
|
2626
|
+
m(u(St))
|
|
2231
2627
|
]),
|
|
2232
2628
|
_: 1
|
|
2233
2629
|
})
|
|
2234
2630
|
])) : S("", !0)
|
|
2235
2631
|
]),
|
|
2236
|
-
e("div",
|
|
2237
|
-
e("div",
|
|
2238
|
-
m(
|
|
2239
|
-
modelValue:
|
|
2240
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
2632
|
+
e("div", en, [
|
|
2633
|
+
e("div", tn, [
|
|
2634
|
+
m(j, {
|
|
2635
|
+
modelValue: u(U),
|
|
2636
|
+
"onUpdate:modelValue": s[1] || (s[1] = (i) => Re(U) ? U.value = i : null),
|
|
2241
2637
|
placeholder: "搜索",
|
|
2242
|
-
"prefix-icon":
|
|
2638
|
+
"prefix-icon": u(Ye)
|
|
2243
2639
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2244
2640
|
]),
|
|
2245
|
-
e("div",
|
|
2246
|
-
|
|
2247
|
-
(a(!0), p(
|
|
2248
|
-
key:
|
|
2249
|
-
class:
|
|
2641
|
+
e("div", sn, [
|
|
2642
|
+
F.value === "chat" ? (a(), p("div", an, [
|
|
2643
|
+
(a(!0), p(de, null, ue(u(ve), (i) => (a(), p("div", {
|
|
2644
|
+
key: i.id,
|
|
2645
|
+
class: K([
|
|
2250
2646
|
"chat-item",
|
|
2251
|
-
|
|
2647
|
+
T.value === i.id ? "chat-item-active" : ""
|
|
2252
2648
|
]),
|
|
2253
|
-
onClick: (
|
|
2254
|
-
onContextmenu:
|
|
2649
|
+
onClick: (xe) => Te(i),
|
|
2650
|
+
onContextmenu: Fe((xe) => d.showContextMenu(xe, i), ["prevent", "stop"])
|
|
2255
2651
|
}, [
|
|
2256
|
-
e("div",
|
|
2652
|
+
e("div", ln, [
|
|
2257
2653
|
e("img", {
|
|
2258
|
-
src:
|
|
2259
|
-
alt:
|
|
2654
|
+
src: i.avatar,
|
|
2655
|
+
alt: i.name,
|
|
2260
2656
|
class: "friend-avatar"
|
|
2261
|
-
}, null, 8,
|
|
2262
|
-
|
|
2657
|
+
}, null, 8, on),
|
|
2658
|
+
i.online ? (a(), p("span", rn)) : S("", !0)
|
|
2263
2659
|
]),
|
|
2264
|
-
e("div",
|
|
2265
|
-
e("div",
|
|
2266
|
-
e("span",
|
|
2267
|
-
e("span",
|
|
2660
|
+
e("div", cn, [
|
|
2661
|
+
e("div", dn, [
|
|
2662
|
+
e("span", un, y(i.name), 1),
|
|
2663
|
+
e("span", vn, y(u(De)(i.lastTime)), 1)
|
|
2268
2664
|
]),
|
|
2269
|
-
e("div",
|
|
2270
|
-
e("span",
|
|
2271
|
-
|
|
2665
|
+
e("div", pn, [
|
|
2666
|
+
e("span", mn, y(i.lastMsg), 1),
|
|
2667
|
+
i.unread > 0 ? (a(), p("span", hn, y(i.unread > 99 ? "99+" : i.unread), 1)) : S("", !0)
|
|
2272
2668
|
])
|
|
2273
2669
|
])
|
|
2274
|
-
], 42,
|
|
2670
|
+
], 42, nn))), 128))
|
|
2275
2671
|
])) : S("", !0),
|
|
2276
|
-
|
|
2277
|
-
e("div",
|
|
2672
|
+
F.value === "friends" && w.config.modules.friends ? (a(), p("div", fn, [
|
|
2673
|
+
e("div", gn, [
|
|
2278
2674
|
e("div", {
|
|
2279
2675
|
class: "add-friend-btn",
|
|
2280
|
-
onClick: s[2] || (s[2] = (...
|
|
2676
|
+
onClick: s[2] || (s[2] = (...i) => u(W) && u(W)(...i))
|
|
2281
2677
|
}, [
|
|
2282
|
-
e("div",
|
|
2678
|
+
e("div", yn, [
|
|
2283
2679
|
m(b, {
|
|
2284
2680
|
class: "text-white",
|
|
2285
2681
|
size: 20
|
|
2286
2682
|
}, {
|
|
2287
2683
|
default: k(() => [
|
|
2288
|
-
m(
|
|
2684
|
+
m(u(zt))
|
|
2289
2685
|
]),
|
|
2290
2686
|
_: 1
|
|
2291
2687
|
})
|
|
2292
2688
|
]),
|
|
2293
|
-
s[
|
|
2689
|
+
s[17] || (s[17] = e("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
2294
2690
|
])
|
|
2295
2691
|
]),
|
|
2296
|
-
(a(!0), p(
|
|
2297
|
-
key:
|
|
2692
|
+
(a(!0), p(de, null, ue(u(R), (i) => (a(), p("div", {
|
|
2693
|
+
key: i.id,
|
|
2298
2694
|
class: "chat-item",
|
|
2299
|
-
onClick: (
|
|
2695
|
+
onClick: (xe) => tt(i)
|
|
2300
2696
|
}, [
|
|
2301
|
-
e("div",
|
|
2697
|
+
e("div", bn, [
|
|
2302
2698
|
e("img", {
|
|
2303
|
-
src:
|
|
2304
|
-
alt:
|
|
2699
|
+
src: i.avatar,
|
|
2700
|
+
alt: i.name,
|
|
2305
2701
|
class: "friend-avatar"
|
|
2306
|
-
}, null, 8,
|
|
2702
|
+
}, null, 8, kn),
|
|
2307
2703
|
e("span", {
|
|
2308
|
-
class:
|
|
2704
|
+
class: K([
|
|
2309
2705
|
"online-indicator",
|
|
2310
|
-
|
|
2706
|
+
i.online ? "online" : "offline"
|
|
2311
2707
|
])
|
|
2312
2708
|
}, null, 2)
|
|
2313
2709
|
]),
|
|
2314
|
-
e("div",
|
|
2315
|
-
e("span",
|
|
2710
|
+
e("div", wn, [
|
|
2711
|
+
e("span", Cn, y(i.name), 1)
|
|
2316
2712
|
])
|
|
2317
|
-
], 8,
|
|
2713
|
+
], 8, _n))), 128))
|
|
2318
2714
|
])) : S("", !0),
|
|
2319
|
-
|
|
2320
|
-
|
|
2715
|
+
F.value === "apply" && w.config.modules.apply ? (a(), p("div", xn, [
|
|
2716
|
+
u(Ve) ? (a(), Z(ce, {
|
|
2321
2717
|
key: 0,
|
|
2322
2718
|
description: "加载中..."
|
|
2323
|
-
})) :
|
|
2719
|
+
})) : u(Ue).length === 0 ? (a(), Z(ce, {
|
|
2324
2720
|
key: 1,
|
|
2325
2721
|
description: "暂无好友申请"
|
|
2326
|
-
})) : (a(!0), p(
|
|
2327
|
-
key:
|
|
2722
|
+
})) : (a(!0), p(de, { key: 2 }, ue(u(Ue), (i) => (a(), p("div", {
|
|
2723
|
+
key: i.applyUser || i.id,
|
|
2328
2724
|
class: "friend-request-item"
|
|
2329
2725
|
}, [
|
|
2330
|
-
e("div",
|
|
2726
|
+
e("div", Un, [
|
|
2331
2727
|
e("img", {
|
|
2332
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${
|
|
2333
|
-
alt:
|
|
2728
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.applyUser}`,
|
|
2729
|
+
alt: i.applyUser,
|
|
2334
2730
|
class: "request-avatar"
|
|
2335
|
-
}, null, 8,
|
|
2336
|
-
e("div",
|
|
2337
|
-
e("div",
|
|
2338
|
-
s[
|
|
2731
|
+
}, null, 8, $n),
|
|
2732
|
+
e("div", Sn, [
|
|
2733
|
+
e("div", zn, y(i.applyUser), 1),
|
|
2734
|
+
s[18] || (s[18] = e("div", { class: "request-desc" }, "请求添加你为好友", -1))
|
|
2339
2735
|
])
|
|
2340
2736
|
]),
|
|
2341
|
-
m(
|
|
2737
|
+
m(be, {
|
|
2342
2738
|
type: "primary",
|
|
2343
2739
|
size: "small",
|
|
2344
|
-
onClick: (
|
|
2740
|
+
onClick: (xe) => u(ne)(i.applyUser)
|
|
2345
2741
|
}, {
|
|
2346
|
-
default: k(() => [...s[
|
|
2347
|
-
|
|
2742
|
+
default: k(() => [...s[19] || (s[19] = [
|
|
2743
|
+
me("同意", -1)
|
|
2348
2744
|
])]),
|
|
2349
2745
|
_: 1
|
|
2350
2746
|
}, 8, ["onClick"])
|
|
@@ -2352,24 +2748,24 @@ const gt = (x, t) => {
|
|
|
2352
2748
|
])) : S("", !0)
|
|
2353
2749
|
])
|
|
2354
2750
|
]),
|
|
2355
|
-
e("div",
|
|
2356
|
-
|
|
2751
|
+
e("div", An, [
|
|
2752
|
+
Y.value && !M.value ? (a(), p("div", Fn, [
|
|
2357
2753
|
e("img", {
|
|
2358
|
-
src:
|
|
2359
|
-
alt:
|
|
2754
|
+
src: Y.value.avatar,
|
|
2755
|
+
alt: Y.value.name,
|
|
2360
2756
|
class: "profile-avatar"
|
|
2361
|
-
}, null, 8,
|
|
2362
|
-
e("div",
|
|
2363
|
-
e("div",
|
|
2757
|
+
}, null, 8, Vn),
|
|
2758
|
+
e("div", Rn, y(Y.value.name), 1),
|
|
2759
|
+
e("div", Mn, [
|
|
2364
2760
|
e("span", {
|
|
2365
|
-
class:
|
|
2761
|
+
class: K([
|
|
2366
2762
|
"status-dot",
|
|
2367
|
-
|
|
2763
|
+
Y.value.online ? "status-online" : "status-offline"
|
|
2368
2764
|
])
|
|
2369
2765
|
}, null, 2),
|
|
2370
|
-
e("span", null, y(
|
|
2766
|
+
e("span", null, y(Y.value.online ? "在线" : "离线"), 1)
|
|
2371
2767
|
]),
|
|
2372
|
-
m(
|
|
2768
|
+
m(be, {
|
|
2373
2769
|
type: "primary",
|
|
2374
2770
|
size: "large",
|
|
2375
2771
|
onClick: st,
|
|
@@ -2378,39 +2774,39 @@ const gt = (x, t) => {
|
|
|
2378
2774
|
default: k(() => [
|
|
2379
2775
|
m(b, null, {
|
|
2380
2776
|
default: k(() => [
|
|
2381
|
-
m(
|
|
2777
|
+
m(u(Xe))
|
|
2382
2778
|
]),
|
|
2383
2779
|
_: 1
|
|
2384
2780
|
}),
|
|
2385
|
-
s[
|
|
2781
|
+
s[20] || (s[20] = e("span", null, "发消息", -1))
|
|
2386
2782
|
]),
|
|
2387
2783
|
_: 1
|
|
2388
2784
|
})
|
|
2389
2785
|
])) : S("", !0),
|
|
2390
|
-
|
|
2391
|
-
e("div",
|
|
2392
|
-
e("div",
|
|
2393
|
-
e("span",
|
|
2786
|
+
M.value ? (a(), p("div", In, [
|
|
2787
|
+
e("div", Ln, [
|
|
2788
|
+
e("div", Tn, [
|
|
2789
|
+
e("span", En, y(M.value.name), 1),
|
|
2394
2790
|
e("span", {
|
|
2395
|
-
class:
|
|
2791
|
+
class: K([
|
|
2396
2792
|
"status-badge",
|
|
2397
|
-
|
|
2793
|
+
M.value.online ? "status-badge-online" : "status-badge-offline"
|
|
2398
2794
|
])
|
|
2399
|
-
}, y(
|
|
2795
|
+
}, y(M.value.online ? "在线" : "离线"), 3)
|
|
2400
2796
|
]),
|
|
2401
|
-
e("div",
|
|
2797
|
+
e("div", Dn, [
|
|
2402
2798
|
m(b, { class: "action-icon" }, {
|
|
2403
2799
|
default: k(() => [
|
|
2404
|
-
m(
|
|
2800
|
+
m(u(Ye))
|
|
2405
2801
|
]),
|
|
2406
2802
|
_: 1
|
|
2407
2803
|
}),
|
|
2408
2804
|
m(b, {
|
|
2409
2805
|
class: "action-icon",
|
|
2410
|
-
onClick: s[3] || (s[3] = (
|
|
2806
|
+
onClick: s[3] || (s[3] = (i) => oe.value = !oe.value)
|
|
2411
2807
|
}, {
|
|
2412
2808
|
default: k(() => [
|
|
2413
|
-
m(
|
|
2809
|
+
m(u(At))
|
|
2414
2810
|
]),
|
|
2415
2811
|
_: 1
|
|
2416
2812
|
})
|
|
@@ -2418,207 +2814,219 @@ const gt = (x, t) => {
|
|
|
2418
2814
|
]),
|
|
2419
2815
|
e("div", {
|
|
2420
2816
|
ref_key: "messagesContainer",
|
|
2421
|
-
ref:
|
|
2817
|
+
ref: f,
|
|
2422
2818
|
class: "messages-container"
|
|
2423
2819
|
}, [
|
|
2424
|
-
(a(!0), p(
|
|
2425
|
-
key:
|
|
2426
|
-
class:
|
|
2820
|
+
(a(!0), p(de, null, ue(u(x), (i, xe) => (a(), p("div", {
|
|
2821
|
+
key: xe,
|
|
2822
|
+
class: K([
|
|
2427
2823
|
"message-wrapper",
|
|
2428
|
-
|
|
2824
|
+
i.isSelf ? "message-self" : "message-other"
|
|
2429
2825
|
])
|
|
2430
2826
|
}, [
|
|
2431
|
-
e("div",
|
|
2827
|
+
e("div", Wn, [
|
|
2432
2828
|
e("img", {
|
|
2433
|
-
src:
|
|
2829
|
+
src: i.isSelf ? u(H) : M.value.avatar,
|
|
2434
2830
|
class: "avatar-sm"
|
|
2435
|
-
}, null, 8,
|
|
2831
|
+
}, null, 8, jn)
|
|
2436
2832
|
]),
|
|
2437
2833
|
e("div", {
|
|
2438
|
-
class:
|
|
2834
|
+
class: K([
|
|
2439
2835
|
"message-content-wrapper",
|
|
2440
|
-
|
|
2836
|
+
i.isSelf ? "content-self" : "content-other"
|
|
2441
2837
|
])
|
|
2442
2838
|
}, [
|
|
2443
|
-
|
|
2444
|
-
e("div",
|
|
2445
|
-
|
|
2839
|
+
i.isSelf ? S("", !0) : (a(), p("div", Hn, y(M.value.name), 1)),
|
|
2840
|
+
e("div", Xn, [
|
|
2841
|
+
i.type === "text" ? (a(), p("div", {
|
|
2446
2842
|
key: 0,
|
|
2447
|
-
class:
|
|
2843
|
+
class: K([
|
|
2448
2844
|
"message-bubble",
|
|
2449
|
-
|
|
2845
|
+
i.isSelf ? "bubble-self" : "bubble-other"
|
|
2450
2846
|
])
|
|
2451
|
-
}, y(
|
|
2847
|
+
}, y(i.text), 3)) : i.type === "file" && i.fileType === "image" ? (a(), p("div", {
|
|
2452
2848
|
key: 1,
|
|
2453
|
-
class:
|
|
2849
|
+
class: K([
|
|
2454
2850
|
"message-bubble",
|
|
2455
2851
|
"image-bubble",
|
|
2456
|
-
|
|
2852
|
+
i.isSelf ? "bubble-self" : "bubble-other"
|
|
2457
2853
|
]),
|
|
2458
|
-
onClick: (
|
|
2854
|
+
onClick: (ht) => Pe(i.fileUrl)
|
|
2459
2855
|
}, [
|
|
2460
2856
|
e("img", {
|
|
2461
|
-
src:
|
|
2462
|
-
alt:
|
|
2857
|
+
src: i.fileUrl,
|
|
2858
|
+
alt: i.fileName,
|
|
2463
2859
|
class: "message-image",
|
|
2464
2860
|
onError: rt
|
|
2465
|
-
}, null, 40,
|
|
2466
|
-
|
|
2467
|
-
], 10,
|
|
2861
|
+
}, null, 40, qn),
|
|
2862
|
+
i.fileSize ? (a(), p("div", Bn, y(Be(i.fileSize)), 1)) : S("", !0)
|
|
2863
|
+
], 10, Yn)) : i.type === "file" ? (a(), p("div", {
|
|
2468
2864
|
key: 2,
|
|
2469
|
-
class:
|
|
2865
|
+
class: K([
|
|
2470
2866
|
"message-bubble",
|
|
2471
2867
|
"file-bubble",
|
|
2472
|
-
|
|
2868
|
+
i.isSelf ? "bubble-self" : "bubble-other"
|
|
2473
2869
|
]),
|
|
2474
|
-
onClick: (
|
|
2870
|
+
onClick: (ht) => Pe(i.fileUrl)
|
|
2475
2871
|
}, [
|
|
2476
|
-
e("div",
|
|
2477
|
-
e("div",
|
|
2872
|
+
e("div", Pn, [
|
|
2873
|
+
e("div", Kn, [
|
|
2478
2874
|
m(b, { size: 28 }, {
|
|
2479
2875
|
default: k(() => [
|
|
2480
|
-
m(
|
|
2876
|
+
m(u(Ft))
|
|
2481
2877
|
]),
|
|
2482
2878
|
_: 1
|
|
2483
2879
|
})
|
|
2484
2880
|
]),
|
|
2485
|
-
e("div",
|
|
2486
|
-
e("div",
|
|
2487
|
-
e("div",
|
|
2881
|
+
e("div", On, [
|
|
2882
|
+
e("div", Gn, y(i.fileName || i.text), 1),
|
|
2883
|
+
e("div", Jn, [
|
|
2488
2884
|
m(b, { size: 12 }, {
|
|
2489
2885
|
default: k(() => [
|
|
2490
|
-
m(
|
|
2886
|
+
m(u(Vt))
|
|
2491
2887
|
]),
|
|
2492
2888
|
_: 1
|
|
2493
2889
|
}),
|
|
2494
|
-
s[
|
|
2495
|
-
|
|
2890
|
+
s[21] || (s[21] = e("span", null, "点击下载", -1)),
|
|
2891
|
+
i.fileSize ? (a(), p("span", Qn, "· " + y(Be(i.fileSize)), 1)) : S("", !0)
|
|
2496
2892
|
])
|
|
2497
2893
|
])
|
|
2498
2894
|
])
|
|
2499
|
-
], 10,
|
|
2895
|
+
], 10, Nn)) : S("", !0),
|
|
2500
2896
|
e("div", {
|
|
2501
|
-
class:
|
|
2897
|
+
class: K([
|
|
2502
2898
|
"message-time",
|
|
2503
|
-
|
|
2899
|
+
i.isSelf ? "time-right" : "time-left"
|
|
2504
2900
|
])
|
|
2505
|
-
}, y(
|
|
2901
|
+
}, y(u(Me)(i.time)), 3)
|
|
2506
2902
|
])
|
|
2507
2903
|
], 2)
|
|
2508
2904
|
], 2))), 128))
|
|
2509
2905
|
], 512),
|
|
2510
|
-
e("div",
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2906
|
+
e("div", {
|
|
2907
|
+
class: "input-area",
|
|
2908
|
+
onClick: s[6] || (s[6] = (i) => Ae.value = !1)
|
|
2909
|
+
}, [
|
|
2910
|
+
B.value.length > 0 ? (a(), p("div", Zn, [
|
|
2911
|
+
(a(!0), p(de, null, ue(B.value, (i, xe) => (a(), p("div", {
|
|
2912
|
+
key: i.id,
|
|
2514
2913
|
class: "pending-file"
|
|
2515
2914
|
}, [
|
|
2516
|
-
|
|
2915
|
+
i.isImage ? (a(), p("div", ei, [
|
|
2517
2916
|
e("img", {
|
|
2518
|
-
src:
|
|
2519
|
-
alt:
|
|
2917
|
+
src: i.previewUrl,
|
|
2918
|
+
alt: i.name,
|
|
2520
2919
|
class: "pending-image"
|
|
2521
|
-
}, null, 8,
|
|
2920
|
+
}, null, 8, ti),
|
|
2522
2921
|
e("button", {
|
|
2523
|
-
onClick: (
|
|
2922
|
+
onClick: (ht) => qe(xe),
|
|
2524
2923
|
class: "remove-file-btn"
|
|
2525
|
-
}, " × ", 8,
|
|
2526
|
-
])) : (a(), p("div",
|
|
2924
|
+
}, " × ", 8, si)
|
|
2925
|
+
])) : (a(), p("div", ai, [
|
|
2527
2926
|
m(b, { class: "pending-file-icon" }, {
|
|
2528
2927
|
default: k(() => [
|
|
2529
|
-
m(
|
|
2928
|
+
m(u(Qe))
|
|
2530
2929
|
]),
|
|
2531
2930
|
_: 1
|
|
2532
2931
|
}),
|
|
2533
|
-
e("span",
|
|
2932
|
+
e("span", ni, y(i.name), 1),
|
|
2534
2933
|
e("button", {
|
|
2535
|
-
onClick: (
|
|
2934
|
+
onClick: (ht) => qe(xe),
|
|
2536
2935
|
class: "remove-file-btn"
|
|
2537
|
-
}, " × ", 8,
|
|
2936
|
+
}, " × ", 8, ii)
|
|
2538
2937
|
]))
|
|
2539
2938
|
]))), 128))
|
|
2540
2939
|
])) : S("", !0),
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2940
|
+
w.config.modules.fileUpload ? (a(), p("div", li, [
|
|
2941
|
+
e("div", oi, [
|
|
2942
|
+
m(b, {
|
|
2943
|
+
class: "action-icon",
|
|
2944
|
+
onClick: s[4] || (s[4] = Fe((i) => Ae.value = !Ae.value, ["stop"]))
|
|
2945
|
+
}, {
|
|
2946
|
+
default: k(() => [
|
|
2947
|
+
m(u(Xe))
|
|
2948
|
+
]),
|
|
2949
|
+
_: 1
|
|
2950
|
+
}),
|
|
2951
|
+
m(Et, {
|
|
2952
|
+
visible: Ae.value,
|
|
2953
|
+
onSelect: ct
|
|
2954
|
+
}, null, 8, ["visible"])
|
|
2955
|
+
]),
|
|
2548
2956
|
m(b, {
|
|
2549
2957
|
class: "action-icon",
|
|
2550
2958
|
onClick: it
|
|
2551
2959
|
}, {
|
|
2552
2960
|
default: k(() => [
|
|
2553
|
-
m(
|
|
2961
|
+
m(u(Qe))
|
|
2554
2962
|
]),
|
|
2555
2963
|
_: 1
|
|
2556
2964
|
}),
|
|
2557
2965
|
m(b, { class: "action-icon" }, {
|
|
2558
2966
|
default: k(() => [
|
|
2559
|
-
m(
|
|
2967
|
+
m(u(Rt))
|
|
2560
2968
|
]),
|
|
2561
2969
|
_: 1
|
|
2562
2970
|
})
|
|
2563
2971
|
])) : S("", !0),
|
|
2564
|
-
e("div",
|
|
2972
|
+
e("div", ri, [
|
|
2565
2973
|
Ct(e("textarea", {
|
|
2566
|
-
"onUpdate:modelValue": s[
|
|
2567
|
-
onKeydown: xt(
|
|
2974
|
+
"onUpdate:modelValue": s[5] || (s[5] = (i) => Re(A) ? A.value = i : null),
|
|
2975
|
+
onKeydown: xt(Fe(Ne, ["prevent"]), ["enter"]),
|
|
2568
2976
|
onPaste: ot,
|
|
2569
2977
|
placeholder: "输入消息或粘贴文件...",
|
|
2570
2978
|
class: "message-input",
|
|
2571
2979
|
rows: "3"
|
|
2572
|
-
}, null, 40,
|
|
2573
|
-
[Ut,
|
|
2980
|
+
}, null, 40, ci), [
|
|
2981
|
+
[Ut, u(A)]
|
|
2574
2982
|
])
|
|
2575
2983
|
]),
|
|
2576
|
-
e("div",
|
|
2577
|
-
m(
|
|
2984
|
+
e("div", di, [
|
|
2985
|
+
m(be, {
|
|
2578
2986
|
type: "primary",
|
|
2579
|
-
disabled: !
|
|
2580
|
-
onClick:
|
|
2987
|
+
disabled: !u(A).trim() && B.value.length === 0,
|
|
2988
|
+
onClick: Ne,
|
|
2581
2989
|
class: "send-btn"
|
|
2582
2990
|
}, {
|
|
2583
|
-
default: k(() => [...s[
|
|
2584
|
-
|
|
2991
|
+
default: k(() => [...s[22] || (s[22] = [
|
|
2992
|
+
me(" 发送 ", -1)
|
|
2585
2993
|
])]),
|
|
2586
2994
|
_: 1
|
|
2587
2995
|
}, 8, ["disabled"])
|
|
2588
2996
|
]),
|
|
2589
2997
|
e("input", {
|
|
2590
2998
|
ref_key: "fileInputRef",
|
|
2591
|
-
ref:
|
|
2999
|
+
ref: ae,
|
|
2592
3000
|
type: "file",
|
|
2593
3001
|
multiple: "",
|
|
2594
3002
|
class: "hidden-file-input",
|
|
2595
3003
|
onChange: lt
|
|
2596
3004
|
}, null, 544)
|
|
2597
3005
|
])
|
|
2598
|
-
])) :
|
|
3006
|
+
])) : Y.value ? S("", !0) : (a(), p("div", ui, [
|
|
2599
3007
|
m(b, {
|
|
2600
3008
|
size: 64,
|
|
2601
3009
|
class: "empty-icon"
|
|
2602
3010
|
}, {
|
|
2603
3011
|
default: k(() => [
|
|
2604
|
-
m(
|
|
3012
|
+
m(u(Mt))
|
|
2605
3013
|
]),
|
|
2606
3014
|
_: 1
|
|
2607
3015
|
}),
|
|
2608
|
-
e("div",
|
|
3016
|
+
e("div", vi, y(F.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
2609
3017
|
]))
|
|
2610
3018
|
]),
|
|
2611
|
-
|
|
2612
|
-
s[
|
|
2613
|
-
e("div",
|
|
2614
|
-
e("div",
|
|
3019
|
+
oe.value ? (a(), p("div", pi, [
|
|
3020
|
+
s[24] || (s[24] = e("div", { class: "detail-header" }, "聊天详情", -1)),
|
|
3021
|
+
e("div", mi, [
|
|
3022
|
+
e("div", hi, [
|
|
2615
3023
|
e("img", {
|
|
2616
|
-
src: (Ee =
|
|
2617
|
-
alt: (
|
|
3024
|
+
src: (Ee = M.value) == null ? void 0 : Ee.avatar,
|
|
3025
|
+
alt: (l = M.value) == null ? void 0 : l.name,
|
|
2618
3026
|
class: "detail-avatar"
|
|
2619
|
-
}, null, 8,
|
|
2620
|
-
e("div",
|
|
2621
|
-
s[
|
|
3027
|
+
}, null, 8, fi),
|
|
3028
|
+
e("div", gi, y((fe = M.value) == null ? void 0 : fe.name), 1),
|
|
3029
|
+
s[23] || (s[23] = e("div", { class: "detail-actions" }, [
|
|
2622
3030
|
e("div", { class: "detail-action-item" }, "查找聊天记录"),
|
|
2623
3031
|
e("div", { class: "detail-action-item" }, "清空聊天记录")
|
|
2624
3032
|
], -1))
|
|
@@ -2626,50 +3034,50 @@ const gt = (x, t) => {
|
|
|
2626
3034
|
])
|
|
2627
3035
|
])) : S("", !0)
|
|
2628
3036
|
]),
|
|
2629
|
-
m(
|
|
2630
|
-
modelValue:
|
|
2631
|
-
"onUpdate:modelValue": s[
|
|
3037
|
+
m(je, {
|
|
3038
|
+
modelValue: u(he),
|
|
3039
|
+
"onUpdate:modelValue": s[8] || (s[8] = (i) => Re(he) ? he.value = i : null),
|
|
2632
3040
|
title: "添加好友",
|
|
2633
3041
|
width: "500px",
|
|
2634
3042
|
"append-to-body": ""
|
|
2635
3043
|
}, {
|
|
2636
3044
|
default: k(() => [
|
|
2637
|
-
e("div",
|
|
2638
|
-
e("div",
|
|
2639
|
-
m(
|
|
2640
|
-
modelValue:
|
|
2641
|
-
"onUpdate:modelValue": s[
|
|
3045
|
+
e("div", yi, [
|
|
3046
|
+
e("div", _i, [
|
|
3047
|
+
m(j, {
|
|
3048
|
+
modelValue: u(we),
|
|
3049
|
+
"onUpdate:modelValue": s[7] || (s[7] = (i) => Re(we) ? we.value = i : null),
|
|
2642
3050
|
placeholder: "搜索用户",
|
|
2643
|
-
"prefix-icon":
|
|
3051
|
+
"prefix-icon": u(Ye)
|
|
2644
3052
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2645
3053
|
])
|
|
2646
3054
|
]),
|
|
2647
|
-
e("div",
|
|
2648
|
-
|
|
3055
|
+
e("div", bi, [
|
|
3056
|
+
u(Ce) ? (a(), Z(ce, {
|
|
2649
3057
|
key: 0,
|
|
2650
3058
|
description: "加载中..."
|
|
2651
|
-
})) :
|
|
3059
|
+
})) : u(Se).length === 0 ? (a(), Z(ce, {
|
|
2652
3060
|
key: 1,
|
|
2653
3061
|
description: "暂无用户"
|
|
2654
|
-
})) : (a(!0), p(
|
|
2655
|
-
key:
|
|
3062
|
+
})) : (a(!0), p(de, { key: 2 }, ue(u(Se), (i) => (a(), p("div", {
|
|
3063
|
+
key: i.username,
|
|
2656
3064
|
class: "available-user-item"
|
|
2657
3065
|
}, [
|
|
2658
|
-
e("div",
|
|
3066
|
+
e("div", ki, [
|
|
2659
3067
|
e("img", {
|
|
2660
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${
|
|
2661
|
-
alt:
|
|
3068
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.username}`,
|
|
3069
|
+
alt: i.username,
|
|
2662
3070
|
class: "available-user-avatar"
|
|
2663
|
-
}, null, 8,
|
|
2664
|
-
e("div",
|
|
3071
|
+
}, null, 8, wi),
|
|
3072
|
+
e("div", Ci, y(i.username), 1)
|
|
2665
3073
|
]),
|
|
2666
|
-
m(
|
|
3074
|
+
m(be, {
|
|
2667
3075
|
type: "primary",
|
|
2668
3076
|
size: "small",
|
|
2669
|
-
onClick: (
|
|
3077
|
+
onClick: (xe) => u(N)(i)
|
|
2670
3078
|
}, {
|
|
2671
|
-
default: k(() => [...s[
|
|
2672
|
-
|
|
3079
|
+
default: k(() => [...s[25] || (s[25] = [
|
|
3080
|
+
me("添加", -1)
|
|
2673
3081
|
])]),
|
|
2674
3082
|
_: 1
|
|
2675
3083
|
}, 8, ["onClick"])
|
|
@@ -2678,9 +3086,9 @@ const gt = (x, t) => {
|
|
|
2678
3086
|
]),
|
|
2679
3087
|
_: 1
|
|
2680
3088
|
}, 8, ["modelValue"]),
|
|
2681
|
-
m(
|
|
2682
|
-
modelValue:
|
|
2683
|
-
"onUpdate:modelValue": s[
|
|
3089
|
+
m(je, {
|
|
3090
|
+
modelValue: _e.value,
|
|
3091
|
+
"onUpdate:modelValue": s[13] || (s[13] = (i) => _e.value = i),
|
|
2684
3092
|
title: "个人设置",
|
|
2685
3093
|
width: "560px",
|
|
2686
3094
|
"close-on-click-modal": !1,
|
|
@@ -2688,15 +3096,15 @@ const gt = (x, t) => {
|
|
|
2688
3096
|
class: "settings-dialog"
|
|
2689
3097
|
}, {
|
|
2690
3098
|
default: k(() => [
|
|
2691
|
-
e("div",
|
|
2692
|
-
e("div",
|
|
2693
|
-
e("div",
|
|
3099
|
+
e("div", xi, [
|
|
3100
|
+
e("div", Ui, [
|
|
3101
|
+
e("div", $i, [
|
|
2694
3102
|
e("img", {
|
|
2695
|
-
src:
|
|
3103
|
+
src: u(H),
|
|
2696
3104
|
alt: "头像",
|
|
2697
3105
|
class: "settings-avatar"
|
|
2698
|
-
}, null, 8,
|
|
2699
|
-
|
|
3106
|
+
}, null, 8, Si),
|
|
3107
|
+
w.config.modules.avatarCrop ? (a(), p("div", {
|
|
2700
3108
|
key: 0,
|
|
2701
3109
|
class: "settings-avatar-edit",
|
|
2702
3110
|
onClick: nt
|
|
@@ -2706,110 +3114,110 @@ const gt = (x, t) => {
|
|
|
2706
3114
|
class: "settings-avatar-icon"
|
|
2707
3115
|
}, {
|
|
2708
3116
|
default: k(() => [
|
|
2709
|
-
m(
|
|
3117
|
+
m(u(It))
|
|
2710
3118
|
]),
|
|
2711
3119
|
_: 1
|
|
2712
3120
|
})
|
|
2713
3121
|
])) : S("", !0),
|
|
2714
3122
|
e("input", {
|
|
2715
3123
|
ref_key: "avatarInputRef",
|
|
2716
|
-
ref:
|
|
3124
|
+
ref: _,
|
|
2717
3125
|
type: "file",
|
|
2718
3126
|
accept: "image/*",
|
|
2719
3127
|
class: "hidden-avatar-input",
|
|
2720
|
-
onChange:
|
|
3128
|
+
onChange: dt
|
|
2721
3129
|
}, null, 544)
|
|
2722
3130
|
]),
|
|
2723
|
-
e("div",
|
|
2724
|
-
e("div",
|
|
2725
|
-
e("div",
|
|
3131
|
+
e("div", zi, [
|
|
3132
|
+
e("div", Ai, y(u(G).nickname || u(O)), 1),
|
|
3133
|
+
e("div", Fi, "@" + y(u(O)), 1)
|
|
2726
3134
|
])
|
|
2727
3135
|
]),
|
|
2728
|
-
e("div",
|
|
2729
|
-
e("div",
|
|
2730
|
-
e("div",
|
|
3136
|
+
e("div", Vi, [
|
|
3137
|
+
e("div", Ri, [
|
|
3138
|
+
e("div", Mi, [
|
|
2731
3139
|
m(b, null, {
|
|
2732
3140
|
default: k(() => [
|
|
2733
|
-
m(
|
|
3141
|
+
m(u(Je))
|
|
2734
3142
|
]),
|
|
2735
3143
|
_: 1
|
|
2736
3144
|
}),
|
|
2737
|
-
s[
|
|
3145
|
+
s[26] || (s[26] = me(" 个人信息 ", -1))
|
|
2738
3146
|
]),
|
|
2739
|
-
|
|
3147
|
+
P.value ? S("", !0) : (a(), Z(be, {
|
|
2740
3148
|
key: 0,
|
|
2741
3149
|
type: "primary",
|
|
2742
3150
|
size: "small",
|
|
2743
|
-
onClick:
|
|
3151
|
+
onClick: vt,
|
|
2744
3152
|
class: "settings-edit-btn"
|
|
2745
3153
|
}, {
|
|
2746
|
-
default: k(() => [...s[
|
|
2747
|
-
|
|
3154
|
+
default: k(() => [...s[27] || (s[27] = [
|
|
3155
|
+
me(" 编辑 ", -1)
|
|
2748
3156
|
])]),
|
|
2749
3157
|
_: 1
|
|
2750
3158
|
}))
|
|
2751
3159
|
]),
|
|
2752
|
-
e("div",
|
|
2753
|
-
e("div",
|
|
2754
|
-
s[
|
|
2755
|
-
|
|
3160
|
+
e("div", Ii, [
|
|
3161
|
+
e("div", Li, [
|
|
3162
|
+
s[28] || (s[28] = e("label", { class: "settings-form-label" }, "昵称", -1)),
|
|
3163
|
+
P.value ? (a(), Z(j, {
|
|
2756
3164
|
key: 0,
|
|
2757
|
-
modelValue:
|
|
2758
|
-
"onUpdate:modelValue": s[
|
|
3165
|
+
modelValue: re.value.nickname,
|
|
3166
|
+
"onUpdate:modelValue": s[9] || (s[9] = (i) => re.value.nickname = i),
|
|
2759
3167
|
placeholder: "请输入昵称",
|
|
2760
3168
|
size: "large"
|
|
2761
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
3169
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(u(G).nickname || "未设置"), 1))
|
|
2762
3170
|
]),
|
|
2763
|
-
e("div",
|
|
2764
|
-
s[
|
|
2765
|
-
|
|
3171
|
+
e("div", Ei, [
|
|
3172
|
+
s[29] || (s[29] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
|
|
3173
|
+
P.value ? (a(), Z(j, {
|
|
2766
3174
|
key: 0,
|
|
2767
|
-
modelValue:
|
|
2768
|
-
"onUpdate:modelValue": s[
|
|
3175
|
+
modelValue: re.value.email,
|
|
3176
|
+
"onUpdate:modelValue": s[10] || (s[10] = (i) => re.value.email = i),
|
|
2769
3177
|
placeholder: "请输入邮箱",
|
|
2770
3178
|
size: "large"
|
|
2771
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
3179
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Di, y(u(G).email || "未设置"), 1))
|
|
2772
3180
|
]),
|
|
2773
|
-
e("div",
|
|
2774
|
-
s[
|
|
2775
|
-
|
|
3181
|
+
e("div", Wi, [
|
|
3182
|
+
s[30] || (s[30] = e("label", { class: "settings-form-label" }, "手机号", -1)),
|
|
3183
|
+
P.value ? (a(), Z(j, {
|
|
2776
3184
|
key: 0,
|
|
2777
|
-
modelValue:
|
|
2778
|
-
"onUpdate:modelValue": s[
|
|
3185
|
+
modelValue: re.value.phone,
|
|
3186
|
+
"onUpdate:modelValue": s[11] || (s[11] = (i) => re.value.phone = i),
|
|
2779
3187
|
placeholder: "请输入手机号",
|
|
2780
3188
|
size: "large"
|
|
2781
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
3189
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", ji, y(u(G).phone || "未设置"), 1))
|
|
2782
3190
|
]),
|
|
2783
|
-
e("div",
|
|
2784
|
-
s[
|
|
2785
|
-
|
|
3191
|
+
e("div", Hi, [
|
|
3192
|
+
s[31] || (s[31] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
|
|
3193
|
+
P.value ? (a(), Z(j, {
|
|
2786
3194
|
key: 0,
|
|
2787
|
-
modelValue:
|
|
2788
|
-
"onUpdate:modelValue": s[
|
|
3195
|
+
modelValue: re.value.bio,
|
|
3196
|
+
"onUpdate:modelValue": s[12] || (s[12] = (i) => re.value.bio = i),
|
|
2789
3197
|
type: "textarea",
|
|
2790
3198
|
rows: 4,
|
|
2791
3199
|
placeholder: "介绍一下自己吧...",
|
|
2792
3200
|
size: "large"
|
|
2793
|
-
}, null, 8, ["modelValue"])) : (a(), p("div",
|
|
3201
|
+
}, null, 8, ["modelValue"])) : (a(), p("div", Xi, y(u(G).bio || "这个人很懒,什么都没写~"), 1))
|
|
2794
3202
|
]),
|
|
2795
|
-
|
|
2796
|
-
m(
|
|
3203
|
+
P.value ? (a(), p("div", Yi, [
|
|
3204
|
+
m(be, {
|
|
2797
3205
|
size: "default",
|
|
2798
|
-
onClick:
|
|
3206
|
+
onClick: pt
|
|
2799
3207
|
}, {
|
|
2800
|
-
default: k(() => [...s[
|
|
2801
|
-
|
|
3208
|
+
default: k(() => [...s[32] || (s[32] = [
|
|
3209
|
+
me("取消", -1)
|
|
2802
3210
|
])]),
|
|
2803
3211
|
_: 1
|
|
2804
3212
|
}),
|
|
2805
|
-
m(
|
|
3213
|
+
m(be, {
|
|
2806
3214
|
type: "primary",
|
|
2807
3215
|
size: "default",
|
|
2808
|
-
loading:
|
|
2809
|
-
onClick:
|
|
3216
|
+
loading: $e.value,
|
|
3217
|
+
onClick: mt
|
|
2810
3218
|
}, {
|
|
2811
|
-
default: k(() => [...s[
|
|
2812
|
-
|
|
3219
|
+
default: k(() => [...s[33] || (s[33] = [
|
|
3220
|
+
me("保存更改", -1)
|
|
2813
3221
|
])]),
|
|
2814
3222
|
_: 1
|
|
2815
3223
|
}, 8, ["loading"])
|
|
@@ -2822,14 +3230,14 @@ const gt = (x, t) => {
|
|
|
2822
3230
|
}, 8, ["modelValue"]),
|
|
2823
3231
|
m(yt, {
|
|
2824
3232
|
modelValue: c.value,
|
|
2825
|
-
"onUpdate:modelValue": s[
|
|
2826
|
-
src:
|
|
2827
|
-
onConfirm:
|
|
3233
|
+
"onUpdate:modelValue": s[14] || (s[14] = (i) => c.value = i),
|
|
3234
|
+
src: I.value,
|
|
3235
|
+
onConfirm: ut
|
|
2828
3236
|
}, null, 8, ["modelValue", "src"]),
|
|
2829
|
-
|
|
3237
|
+
pe.value.visible ? (a(), p("div", {
|
|
2830
3238
|
key: 0,
|
|
2831
3239
|
class: "context-menu",
|
|
2832
|
-
style:
|
|
3240
|
+
style: He({ left: pe.value.x + "px", top: pe.value.y + "px" })
|
|
2833
3241
|
}, [
|
|
2834
3242
|
e("div", {
|
|
2835
3243
|
class: "context-menu-item",
|
|
@@ -2842,7 +3250,7 @@ const gt = (x, t) => {
|
|
|
2842
3250
|
}, 8, ["modelValue", "width"]);
|
|
2843
3251
|
};
|
|
2844
3252
|
}
|
|
2845
|
-
},
|
|
3253
|
+
}, Bi = /* @__PURE__ */ Ze(qi, [["__scopeId", "data-v-b69ff046"]]), Ni = {
|
|
2846
3254
|
// API 配置
|
|
2847
3255
|
api: {
|
|
2848
3256
|
baseUrl: "",
|
|
@@ -2858,8 +3266,6 @@ const gt = (x, t) => {
|
|
|
2858
3266
|
setChatStatus: "/chart/friend/chat/status",
|
|
2859
3267
|
getAvailableUsers: "/chart/user/canAddFriend",
|
|
2860
3268
|
searchUser: "/chart/user/search",
|
|
2861
|
-
getUserInfo: "/user/info",
|
|
2862
|
-
updateUserInfo: "/user/info",
|
|
2863
3269
|
getUserAvatar: "/user/getAvatar",
|
|
2864
3270
|
uploadAvatar: "/user/uploadAvatar"
|
|
2865
3271
|
},
|
|
@@ -2906,30 +3312,30 @@ const gt = (x, t) => {
|
|
|
2906
3312
|
allowedTypes: ["*"]
|
|
2907
3313
|
}
|
|
2908
3314
|
};
|
|
2909
|
-
function
|
|
2910
|
-
const t =
|
|
3315
|
+
function Ji(w = {}) {
|
|
3316
|
+
const t = Dt(Ni, w);
|
|
2911
3317
|
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;
|
|
2912
3318
|
}
|
|
2913
|
-
function
|
|
2914
|
-
const n = { ...
|
|
3319
|
+
function Dt(w, t) {
|
|
3320
|
+
const n = { ...w };
|
|
2915
3321
|
for (const v in t)
|
|
2916
|
-
t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] =
|
|
3322
|
+
t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Dt(w[v] || {}, t[v]) : n[v] = t[v];
|
|
2917
3323
|
return n;
|
|
2918
3324
|
}
|
|
2919
|
-
const
|
|
2920
|
-
install(
|
|
2921
|
-
|
|
3325
|
+
const Qi = {
|
|
3326
|
+
install(w) {
|
|
3327
|
+
w.component("ChatPanel", Ka), w.component("ChatWindow", Bi), w.component("AvatarCrop", yt);
|
|
2922
3328
|
}
|
|
2923
3329
|
};
|
|
2924
3330
|
export {
|
|
2925
3331
|
yt as AvatarCrop,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
3332
|
+
gt as ChatApi,
|
|
3333
|
+
Ka as ChatPanel,
|
|
3334
|
+
Wt as ChatWebSocket,
|
|
3335
|
+
Bi as ChatWindow,
|
|
3336
|
+
jt as HttpClient,
|
|
3337
|
+
Qi as VueChatKit,
|
|
3338
|
+
Ji as createChatConfig,
|
|
3339
|
+
Qi as default,
|
|
2934
3340
|
Tt as useChat
|
|
2935
3341
|
};
|