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