vue-chat-kit 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-chat-kit.css +1 -1
- package/dist/vue-chat-kit.es.js +1378 -1442
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/ChatPanel.vue +18 -149
package/dist/vue-chat-kit.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as k, nextTick as
|
|
2
|
-
import { ChatDotRound as ht, UserFilled as
|
|
3
|
-
import
|
|
4
|
-
import { ElMessage as
|
|
5
|
-
class
|
|
1
|
+
import { ref as k, nextTick as nt, computed as be, watch as kt, resolveComponent as Ue, openBlock as l, createBlock as Q, withCtx as v, createElementVNode as s, createElementBlock as p, normalizeStyle as Le, Fragment as ue, renderList as ce, withModifiers as Ee, normalizeClass as ve, createVNode as i, createTextVNode as T, toDisplayString as M, createCommentVNode as L, onMounted as Ys, onUnmounted as js, unref as r, resolveDynamicComponent as qs, isRef as xe, withDirectives as Os, withKeys as vt, vModelText as Ps, Transition as Bs } from "vue";
|
|
2
|
+
import { ChatDotRound as ht, UserFilled as ft, Bell as Js, Setting as Qs, Search as gt, Plus as Ye, MoreFilled as Pt, Document as Zs, Download as ea, Folder as Bt, Picture as ta, ChatLineRound as sa, Close as aa, Edit as je, ArrowRight as na, CircleCheck as Jt, Delete as ra, Check as oa, Clock as la, Camera as ia } from "@element-plus/icons-vue";
|
|
3
|
+
import yt from "dayjs";
|
|
4
|
+
import { ElMessage as at } from "element-plus";
|
|
5
|
+
class ua {
|
|
6
6
|
constructor(t, a = {}) {
|
|
7
7
|
this.userId = t, this.wsUrl = a.wsUrl || "", this.socket = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = a.maxReconnectAttempts || 5, this.reconnectDelay = a.reconnectDelay || 3e3, this.handlers = {
|
|
8
8
|
message: [],
|
|
@@ -47,20 +47,20 @@ class ca {
|
|
|
47
47
|
* @param {number} fileSize - 文件大小
|
|
48
48
|
* @param {boolean} isGroup - 是否为群聊消息
|
|
49
49
|
*/
|
|
50
|
-
send(t, a, o = "text",
|
|
50
|
+
send(t, a, o = "text", y = "", E = "", N = 0, ee = !1) {
|
|
51
51
|
if (this.isConnected()) {
|
|
52
|
-
const S = JSON.stringify(
|
|
52
|
+
const S = JSON.stringify(ee ? {
|
|
53
53
|
toGroupId: t,
|
|
54
54
|
msg: a,
|
|
55
55
|
type: o,
|
|
56
|
-
fileUrl:
|
|
56
|
+
fileUrl: y,
|
|
57
57
|
fileName: E,
|
|
58
58
|
fileSize: N
|
|
59
59
|
} : {
|
|
60
60
|
to: t,
|
|
61
61
|
msg: a,
|
|
62
62
|
type: o,
|
|
63
|
-
fileUrl:
|
|
63
|
+
fileUrl: y,
|
|
64
64
|
fileName: E,
|
|
65
65
|
fileSize: N
|
|
66
66
|
});
|
|
@@ -113,12 +113,12 @@ class ca {
|
|
|
113
113
|
return this.socket && this.socket.readyState === WebSocket.OPEN;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
class
|
|
117
|
-
constructor(t, a, o,
|
|
118
|
-
super(t), this.name = "RequestError", this.status = a || 0, this.code = o || 0, this.data =
|
|
116
|
+
class st extends Error {
|
|
117
|
+
constructor(t, a, o, y) {
|
|
118
|
+
super(t), this.name = "RequestError", this.status = a || 0, this.code = o || 0, this.data = y;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class ca {
|
|
122
122
|
constructor(t = {}) {
|
|
123
123
|
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((a) => {
|
|
124
124
|
this.requestInterceptors.push(a);
|
|
@@ -147,7 +147,7 @@ class da {
|
|
|
147
147
|
timeoutPromise(t) {
|
|
148
148
|
return new Promise((a, o) => {
|
|
149
149
|
setTimeout(() => {
|
|
150
|
-
o(new
|
|
150
|
+
o(new st("请求超时", 408, 408));
|
|
151
151
|
}, t);
|
|
152
152
|
});
|
|
153
153
|
}
|
|
@@ -155,46 +155,46 @@ class da {
|
|
|
155
155
|
* 核心请求方法
|
|
156
156
|
*/
|
|
157
157
|
async request(t, a = {}) {
|
|
158
|
-
const { method: o = "GET", headers:
|
|
159
|
-
let
|
|
158
|
+
const { method: o = "GET", headers: y = {}, body: E, params: N } = a;
|
|
159
|
+
let ee = t.startsWith("http") ? t : `${this.baseUrl}${t}`, S = {
|
|
160
160
|
method: o,
|
|
161
|
-
headers: { ...this.headers, ...
|
|
161
|
+
headers: { ...this.headers, ...y },
|
|
162
162
|
body: E,
|
|
163
163
|
params: N
|
|
164
164
|
};
|
|
165
165
|
this.requestInterceptors.forEach((U) => {
|
|
166
166
|
S = U(S);
|
|
167
167
|
});
|
|
168
|
-
const
|
|
168
|
+
const h = {
|
|
169
169
|
method: S.method,
|
|
170
170
|
headers: S.headers,
|
|
171
171
|
credentials: "include"
|
|
172
172
|
};
|
|
173
|
-
if (S.body && o !== "GET" && (S.body instanceof FormData ?
|
|
173
|
+
if (S.body && o !== "GET" && (S.body instanceof FormData ? h.body = S.body : typeof S.body == "object" ? h.body = JSON.stringify(S.body) : h.body = S.body), S.params) {
|
|
174
174
|
const U = new URLSearchParams();
|
|
175
|
-
for (const
|
|
176
|
-
S.params[
|
|
175
|
+
for (const j in S.params)
|
|
176
|
+
S.params[j] !== void 0 && S.params[j] !== null && S.params[j] !== "" && U.append(j, S.params[j]);
|
|
177
177
|
const $ = U.toString();
|
|
178
|
-
$ && (
|
|
178
|
+
$ && (ee += (ee.includes("?") ? "&" : "?") + $);
|
|
179
179
|
}
|
|
180
180
|
try {
|
|
181
181
|
let $ = await Promise.race([
|
|
182
|
-
fetch(
|
|
182
|
+
fetch(ee, h),
|
|
183
183
|
this.timeoutPromise(this.timeout)
|
|
184
184
|
]);
|
|
185
|
-
if (this.responseInterceptors.forEach((
|
|
186
|
-
$ =
|
|
185
|
+
if (this.responseInterceptors.forEach((de) => {
|
|
186
|
+
$ = de($);
|
|
187
187
|
}), !$.ok)
|
|
188
|
-
throw new
|
|
188
|
+
throw new st(
|
|
189
189
|
`HTTP ${$.status}: ${$.statusText}`,
|
|
190
190
|
$.status,
|
|
191
191
|
$.status
|
|
192
192
|
);
|
|
193
|
-
const
|
|
193
|
+
const j = $.headers.get("content-type");
|
|
194
194
|
let x;
|
|
195
|
-
return
|
|
195
|
+
return j && j.includes("application/json") ? x = await $.json() : x = await $.text(), x;
|
|
196
196
|
} catch (U) {
|
|
197
|
-
throw U instanceof
|
|
197
|
+
throw U instanceof st ? U : new st(
|
|
198
198
|
U instanceof Error ? U.message : "网络错误",
|
|
199
199
|
0,
|
|
200
200
|
0
|
|
@@ -215,9 +215,9 @@ class da {
|
|
|
215
215
|
return this.request(t, { ...a, method: "DELETE" });
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
class
|
|
218
|
+
class bt {
|
|
219
219
|
constructor(t, a = null) {
|
|
220
|
-
this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, a ? this.http = a : this.http = new
|
|
220
|
+
this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, a ? this.http = a : this.http = new ca({
|
|
221
221
|
baseUrl: t.api.baseUrl,
|
|
222
222
|
headers: t.headers,
|
|
223
223
|
requestInterceptors: t.requestInterceptors,
|
|
@@ -446,20 +446,20 @@ class kt {
|
|
|
446
446
|
/**
|
|
447
447
|
* 修改群基础信息(群主专用)
|
|
448
448
|
*/
|
|
449
|
-
async updateGroupInfo(t, a, o,
|
|
450
|
-
return this._call("updateGroupInfo", t, a, o,
|
|
449
|
+
async updateGroupInfo(t, a, o, y, E) {
|
|
450
|
+
return this._call("updateGroupInfo", t, a, o, y, E);
|
|
451
451
|
}
|
|
452
|
-
async _updateGroupInfo(t, a, o,
|
|
453
|
-
return this.http.post(this.endpoints.updateGroupInfo, { groupId: t, currentUser: a, groupNickname: o, remark:
|
|
452
|
+
async _updateGroupInfo(t, a, o, y, E) {
|
|
453
|
+
return this.http.post(this.endpoints.updateGroupInfo, { groupId: t, currentUser: a, groupNickname: o, remark: y, notice: E });
|
|
454
454
|
}
|
|
455
455
|
/**
|
|
456
456
|
* 修改群成员专属昵称
|
|
457
457
|
*/
|
|
458
|
-
async updateMemberNick(t, a, o,
|
|
459
|
-
return this._call("updateMemberNick", t, a, o,
|
|
458
|
+
async updateMemberNick(t, a, o, y) {
|
|
459
|
+
return this._call("updateMemberNick", t, a, o, y);
|
|
460
460
|
}
|
|
461
|
-
async _updateMemberNick(t, a, o,
|
|
462
|
-
return this.http.post(this.endpoints.updateMemberNick, { groupId: t, currentUser: a, targetUsername: o, memberNick:
|
|
461
|
+
async _updateMemberNick(t, a, o, y) {
|
|
462
|
+
return this.http.post(this.endpoints.updateMemberNick, { groupId: t, currentUser: a, targetUsername: o, memberNick: y });
|
|
463
463
|
}
|
|
464
464
|
/**
|
|
465
465
|
* 群主解散/删除群聊
|
|
@@ -507,34 +507,34 @@ class kt {
|
|
|
507
507
|
return this.http.post(this.endpoints.readAllGroupMsg, { groupId: t, currentUser: a });
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
const
|
|
510
|
+
const da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
511
511
|
__proto__: null,
|
|
512
|
-
ChatApi:
|
|
513
|
-
default:
|
|
512
|
+
ChatApi: bt,
|
|
513
|
+
default: bt
|
|
514
514
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
515
|
-
function
|
|
516
|
-
const a = new
|
|
515
|
+
function pa(g, t) {
|
|
516
|
+
const a = new bt(g);
|
|
517
517
|
let o = null;
|
|
518
|
-
const
|
|
519
|
-
username:
|
|
520
|
-
nickname:
|
|
521
|
-
email:
|
|
522
|
-
phone:
|
|
523
|
-
bio:
|
|
524
|
-
}),
|
|
518
|
+
const y = g.user.username, E = k(g.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${y}`), N = k({
|
|
519
|
+
username: y,
|
|
520
|
+
nickname: g.user.nickname || "",
|
|
521
|
+
email: g.user.email || "",
|
|
522
|
+
phone: g.user.phone || "",
|
|
523
|
+
bio: g.user.bio || ""
|
|
524
|
+
}), ee = k(!1), S = k(""), h = k(""), U = k(null), $ = (z) => yt(z).format("HH:mm"), j = (z) => {
|
|
525
525
|
if (!z) return "";
|
|
526
|
-
const
|
|
527
|
-
return
|
|
526
|
+
const B = yt(), C = yt(z);
|
|
527
|
+
return B.isSame(C, "day") ? C.format("HH:mm") : B.diff(C, "day") === 1 ? "昨天" : B.diff(C, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][C.day()] : C.format("MM/DD");
|
|
528
528
|
}, x = (z) => {
|
|
529
529
|
if (!z) return !1;
|
|
530
|
-
const
|
|
531
|
-
return
|
|
532
|
-
},
|
|
530
|
+
const B = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], C = z.split(".").pop().toLowerCase();
|
|
531
|
+
return B.includes(C);
|
|
532
|
+
}, de = (z) => {
|
|
533
533
|
if (!z) return "default";
|
|
534
|
-
const
|
|
535
|
-
return ["xls", "xlsx"].includes(
|
|
536
|
-
},
|
|
537
|
-
|
|
534
|
+
const B = z.split(".").pop().toLowerCase();
|
|
535
|
+
return ["xls", "xlsx"].includes(B) ? "excel" : ["pdf"].includes(B) ? "pdf" : ["doc", "docx"].includes(B) ? "docx" : "default";
|
|
536
|
+
}, _e = () => {
|
|
537
|
+
nt(() => {
|
|
538
538
|
U.value && (U.value.scrollTop = U.value.scrollHeight);
|
|
539
539
|
});
|
|
540
540
|
}, D = (z) => {
|
|
@@ -554,243 +554,243 @@ function ma(y, t) {
|
|
|
554
554
|
};
|
|
555
555
|
} catch {
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
557
|
+
const B = z.match(/^\[(.+?)\]:(.+)$/);
|
|
558
|
+
if (B)
|
|
559
559
|
return {
|
|
560
|
-
username:
|
|
561
|
-
content:
|
|
560
|
+
username: B[1],
|
|
561
|
+
content: B[2],
|
|
562
562
|
type: "text"
|
|
563
563
|
};
|
|
564
|
-
} catch (
|
|
565
|
-
console.error("[VueChatKit] 解析消息失败",
|
|
564
|
+
} catch (B) {
|
|
565
|
+
console.error("[VueChatKit] 解析消息失败", B);
|
|
566
566
|
}
|
|
567
567
|
return null;
|
|
568
568
|
}, _ = (z) => {
|
|
569
|
-
const
|
|
570
|
-
o = new
|
|
571
|
-
wsUrl:
|
|
572
|
-
maxReconnectAttempts:
|
|
573
|
-
reconnectDelay:
|
|
569
|
+
const B = `${g.api.websocketUrl}?userId=${y}`;
|
|
570
|
+
o = new ua(y, {
|
|
571
|
+
wsUrl: B,
|
|
572
|
+
maxReconnectAttempts: g.websocket.maxReconnectAttempts,
|
|
573
|
+
reconnectDelay: g.websocket.reconnectDelay
|
|
574
574
|
}), o.on("message", z), o.connect();
|
|
575
575
|
}, he = () => {
|
|
576
576
|
o && (o.close(), o = null);
|
|
577
|
-
},
|
|
577
|
+
}, pe = () => o, fe = async () => {
|
|
578
578
|
try {
|
|
579
|
-
const z = await a.getUserAvatar(
|
|
580
|
-
z.code === 200 && z.data && (E.value = `${
|
|
579
|
+
const z = await a.getUserAvatar(y);
|
|
580
|
+
z.code === 200 && z.data && (E.value = `${g.api.baseUrl}${z.data}`);
|
|
581
581
|
} catch (z) {
|
|
582
582
|
console.warn("[VueChatKit] 加载头像失败", z);
|
|
583
583
|
}
|
|
584
|
-
},
|
|
584
|
+
}, le = (z) => {
|
|
585
585
|
E.value = z;
|
|
586
|
-
},
|
|
586
|
+
}, ne = async (z) => {
|
|
587
587
|
try {
|
|
588
|
-
return (await a.updateUserInfo(
|
|
588
|
+
return (await a.updateUserInfo(y, z)).code === 200 ? (N.value = {
|
|
589
589
|
...N.value,
|
|
590
590
|
...z
|
|
591
591
|
}, !0) : !1;
|
|
592
|
-
} catch (
|
|
593
|
-
return console.error("[VueChatKit] 更新用户信息失败",
|
|
592
|
+
} catch (B) {
|
|
593
|
+
return console.error("[VueChatKit] 更新用户信息失败", B), !1;
|
|
594
594
|
}
|
|
595
595
|
};
|
|
596
|
-
return
|
|
596
|
+
return fe(), {
|
|
597
597
|
// 配置
|
|
598
598
|
api: a,
|
|
599
|
-
config:
|
|
599
|
+
config: g,
|
|
600
600
|
// 状态
|
|
601
|
-
myUsername:
|
|
601
|
+
myUsername: y,
|
|
602
602
|
myAvatar: E,
|
|
603
603
|
userInfo: N,
|
|
604
|
-
loadingUserInfo:
|
|
604
|
+
loadingUserInfo: ee,
|
|
605
605
|
searchText: S,
|
|
606
|
-
inputText:
|
|
606
|
+
inputText: h,
|
|
607
607
|
messagesContainer: U,
|
|
608
608
|
// 工具函数
|
|
609
609
|
formatTime: $,
|
|
610
|
-
formatLastTime:
|
|
610
|
+
formatLastTime: j,
|
|
611
611
|
isImageFile: x,
|
|
612
|
-
getFileIconType:
|
|
613
|
-
scrollToBottom:
|
|
612
|
+
getFileIconType: de,
|
|
613
|
+
scrollToBottom: _e,
|
|
614
614
|
// WebSocket
|
|
615
615
|
parseWsMessage: D,
|
|
616
616
|
initWebSocket: _,
|
|
617
617
|
closeWebSocket: he,
|
|
618
|
-
getSocket:
|
|
618
|
+
getSocket: pe,
|
|
619
619
|
// 用户信息
|
|
620
|
-
initUserAvatar:
|
|
621
|
-
updateMyAvatar:
|
|
622
|
-
updateUserInfo:
|
|
620
|
+
initUserAvatar: fe,
|
|
621
|
+
updateMyAvatar: le,
|
|
622
|
+
updateUserInfo: ne
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
const { api: t, myUsername: a, myAvatar: o, config:
|
|
625
|
+
function ma(g) {
|
|
626
|
+
const { api: t, myUsername: a, myAvatar: o, config: y, scrollToBottom: E, getSocket: N } = g, ee = k([]), S = k([]), h = k([]), U = k(""), $ = k(!1), j = k(""), x = k([]), de = k(!1), _e = k([]), D = k(!1), _ = be(() => {
|
|
627
627
|
let d = S.value;
|
|
628
|
-
if (
|
|
629
|
-
const
|
|
628
|
+
if (g.searchText.value) {
|
|
629
|
+
const f = g.searchText.value.toLowerCase();
|
|
630
630
|
d = d.filter(
|
|
631
|
-
(
|
|
632
|
-
var
|
|
633
|
-
return (
|
|
631
|
+
(G) => {
|
|
632
|
+
var A;
|
|
633
|
+
return (A = G.username) == null ? void 0 : A.toLowerCase().includes(f);
|
|
634
634
|
}
|
|
635
635
|
);
|
|
636
636
|
}
|
|
637
|
-
return d.map((
|
|
638
|
-
id:
|
|
639
|
-
name:
|
|
640
|
-
avatar:
|
|
641
|
-
online:
|
|
642
|
-
lastMsg:
|
|
643
|
-
lastTime:
|
|
644
|
-
unread:
|
|
637
|
+
return d.map((f) => ({
|
|
638
|
+
id: f.username,
|
|
639
|
+
name: f.username,
|
|
640
|
+
avatar: f.avatar ? `${y.api.baseUrl}${f.avatar}` : o.value,
|
|
641
|
+
online: f.online,
|
|
642
|
+
lastMsg: f.lastMsg || "暂无消息",
|
|
643
|
+
lastTime: f.lastTime,
|
|
644
|
+
unread: f.unReadNum || 0
|
|
645
645
|
}));
|
|
646
|
-
}), he =
|
|
647
|
-
let d =
|
|
648
|
-
if (
|
|
649
|
-
const
|
|
646
|
+
}), he = be(() => {
|
|
647
|
+
let d = ee.value;
|
|
648
|
+
if (g.searchText.value) {
|
|
649
|
+
const f = g.searchText.value.toLowerCase();
|
|
650
650
|
d = d.filter(
|
|
651
|
-
(
|
|
652
|
-
var
|
|
653
|
-
return (
|
|
651
|
+
(G) => {
|
|
652
|
+
var A;
|
|
653
|
+
return (A = G.username) == null ? void 0 : A.toLowerCase().includes(f);
|
|
654
654
|
}
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
|
-
return d.map((
|
|
658
|
-
id:
|
|
659
|
-
name:
|
|
660
|
-
avatar:
|
|
661
|
-
online:
|
|
662
|
-
isChatting:
|
|
657
|
+
return d.map((f) => ({
|
|
658
|
+
id: f.username,
|
|
659
|
+
name: f.username,
|
|
660
|
+
avatar: f.avatar ? `${y.api.baseUrl}${f.avatar}` : o.value,
|
|
661
|
+
online: f.online,
|
|
662
|
+
isChatting: f.isChatting
|
|
663
663
|
}));
|
|
664
|
-
}),
|
|
665
|
-
const
|
|
666
|
-
let
|
|
664
|
+
}), pe = be(() => x.value), fe = be(() => _.value.find((d) => d.id === U.value) || null), le = be(() => h.value.map((d) => {
|
|
665
|
+
const f = d.type === "file" || d.fileUrl || d.fileName, G = d.fileName || d.msgContent;
|
|
666
|
+
let A = "";
|
|
667
667
|
if (d.sendUsername !== a) {
|
|
668
|
-
const
|
|
669
|
-
|
|
668
|
+
const H = ee.value.find((Y) => Y.username === d.sendUsername);
|
|
669
|
+
A = H != null && H.avatar ? `${y.api.baseUrl}${H.avatar}` : `https://api.dicebear.com/7.x/avataaars/svg?seed=${d.sendUsername}`;
|
|
670
670
|
} else
|
|
671
|
-
|
|
671
|
+
A = o.value;
|
|
672
672
|
return {
|
|
673
673
|
text: d.msgContent,
|
|
674
674
|
isSelf: d.sendUsername === a,
|
|
675
675
|
time: d.createTime,
|
|
676
676
|
sendUsername: d.sendUsername,
|
|
677
|
-
avatar:
|
|
678
|
-
type:
|
|
679
|
-
fileType:
|
|
677
|
+
avatar: A,
|
|
678
|
+
type: f ? "file" : "text",
|
|
679
|
+
fileType: g.isImageFile(G) ? "image" : g.getFileIconType(G),
|
|
680
680
|
fileUrl: d.fileUrl || "",
|
|
681
|
-
fileName:
|
|
681
|
+
fileName: G,
|
|
682
682
|
fileSize: d.fileSize || 0
|
|
683
683
|
};
|
|
684
|
-
})),
|
|
684
|
+
})), ne = async () => {
|
|
685
685
|
try {
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
for (const
|
|
686
|
+
const f = (await t.getFriends(a)).data || [];
|
|
687
|
+
ee.value = f, S.value = f.filter((G) => G.isChatting === 1);
|
|
688
|
+
for (const G of S.value)
|
|
689
689
|
try {
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
(
|
|
690
|
+
const H = (await t.getHistory(a, G.username)).data || [];
|
|
691
|
+
G.unReadNum = H.filter(
|
|
692
|
+
(Y) => Y.isRead === 0 && Y.sendUsername === G.username
|
|
693
693
|
).length;
|
|
694
694
|
} catch {
|
|
695
|
-
|
|
695
|
+
G.unReadNum = 0;
|
|
696
696
|
}
|
|
697
697
|
} catch (d) {
|
|
698
698
|
console.error("[VueChatKit] 获取好友列表失败", d);
|
|
699
699
|
}
|
|
700
700
|
}, z = async (d) => {
|
|
701
701
|
try {
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
} catch (
|
|
705
|
-
console.error("[VueChatKit] 获取聊天历史失败",
|
|
702
|
+
const f = await t.getHistory(a, d);
|
|
703
|
+
h.value = f.data || [], E();
|
|
704
|
+
} catch (f) {
|
|
705
|
+
console.error("[VueChatKit] 获取聊天历史失败", f);
|
|
706
706
|
}
|
|
707
|
-
},
|
|
707
|
+
}, B = async (d) => {
|
|
708
708
|
try {
|
|
709
|
-
await t.setRead(a, d),
|
|
710
|
-
} catch (
|
|
711
|
-
console.error("[VueChatKit] 标记已读失败",
|
|
709
|
+
await t.setRead(a, d), ne();
|
|
710
|
+
} catch (f) {
|
|
711
|
+
console.error("[VueChatKit] 标记已读失败", f);
|
|
712
712
|
}
|
|
713
713
|
}, C = async (d) => {
|
|
714
|
-
U.value = d.id, await z(d.id), await
|
|
715
|
-
},
|
|
714
|
+
U.value = d.id, await z(d.id), await B(d.id), E();
|
|
715
|
+
}, ge = async (d, f = 1) => {
|
|
716
716
|
try {
|
|
717
|
-
return await t.setChatStatus(a, d,
|
|
718
|
-
} catch (
|
|
719
|
-
return console.error("[VueChatKit] 设置聊天状态失败",
|
|
717
|
+
return await t.setChatStatus(a, d, f), await ne(), !0;
|
|
718
|
+
} catch (G) {
|
|
719
|
+
return console.error("[VueChatKit] 设置聊天状态失败", G), !1;
|
|
720
720
|
}
|
|
721
|
-
},
|
|
721
|
+
}, ie = () => {
|
|
722
722
|
const d = N();
|
|
723
|
-
if (!
|
|
724
|
-
if (d.send(U.value,
|
|
725
|
-
const
|
|
726
|
-
msgContent:
|
|
723
|
+
if (!g.inputText.value.trim() || !U.value || !d) return;
|
|
724
|
+
if (d.send(U.value, g.inputText.value.trim(), "text")) {
|
|
725
|
+
const G = {
|
|
726
|
+
msgContent: g.inputText.value.trim(),
|
|
727
727
|
sendUsername: a,
|
|
728
728
|
receiveUsername: U.value,
|
|
729
729
|
createTime: /* @__PURE__ */ new Date(),
|
|
730
730
|
isRead: 0,
|
|
731
731
|
type: "text"
|
|
732
732
|
};
|
|
733
|
-
|
|
734
|
-
z(U.value),
|
|
733
|
+
h.value.push(G), g.inputText.value = "", E(), setTimeout(() => {
|
|
734
|
+
z(U.value), ne();
|
|
735
735
|
}, 300);
|
|
736
736
|
}
|
|
737
737
|
}, w = async (d) => {
|
|
738
|
-
const
|
|
739
|
-
if (!U.value || !
|
|
738
|
+
const f = N();
|
|
739
|
+
if (!U.value || !f) return !1;
|
|
740
740
|
try {
|
|
741
|
-
const
|
|
742
|
-
if (
|
|
743
|
-
const { fileUrl:
|
|
744
|
-
if (
|
|
741
|
+
const G = await t.uploadFile(d);
|
|
742
|
+
if (G.code === 200 && G.data) {
|
|
743
|
+
const { fileUrl: A, fileName: H } = G.data;
|
|
744
|
+
if (f.send(
|
|
745
745
|
U.value,
|
|
746
|
-
|
|
746
|
+
H,
|
|
747
747
|
"file",
|
|
748
|
-
|
|
749
|
-
|
|
748
|
+
A,
|
|
749
|
+
H,
|
|
750
750
|
d.size
|
|
751
751
|
)) {
|
|
752
|
-
const
|
|
753
|
-
msgContent:
|
|
752
|
+
const re = {
|
|
753
|
+
msgContent: H,
|
|
754
754
|
sendUsername: a,
|
|
755
755
|
receiveUsername: U.value,
|
|
756
756
|
createTime: /* @__PURE__ */ new Date(),
|
|
757
757
|
isRead: 0,
|
|
758
758
|
type: "file",
|
|
759
|
-
fileUrl:
|
|
760
|
-
fileName:
|
|
759
|
+
fileUrl: A,
|
|
760
|
+
fileName: H,
|
|
761
761
|
fileSize: d.size
|
|
762
762
|
};
|
|
763
|
-
return
|
|
763
|
+
return h.value.push(re), E(), !0;
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
766
|
return !1;
|
|
767
|
-
} catch (
|
|
768
|
-
return console.error("[VueChatKit] 发送文件失败",
|
|
767
|
+
} catch (G) {
|
|
768
|
+
return console.error("[VueChatKit] 发送文件失败", G), !1;
|
|
769
769
|
}
|
|
770
|
-
}, V = async (d,
|
|
771
|
-
const
|
|
772
|
-
if (!(!U.value || !
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
775
|
-
msgContent:
|
|
770
|
+
}, V = async (d, f) => {
|
|
771
|
+
const G = N();
|
|
772
|
+
if (!(!U.value || !G)) {
|
|
773
|
+
if (f && f.trim() && G.send(U.value, f.trim(), "text")) {
|
|
774
|
+
const H = {
|
|
775
|
+
msgContent: f.trim(),
|
|
776
776
|
sendUsername: a,
|
|
777
777
|
receiveUsername: U.value,
|
|
778
778
|
createTime: /* @__PURE__ */ new Date(),
|
|
779
779
|
isRead: 0,
|
|
780
780
|
type: "text"
|
|
781
781
|
};
|
|
782
|
-
|
|
782
|
+
h.value.push(H);
|
|
783
783
|
}
|
|
784
|
-
for (const
|
|
785
|
-
const
|
|
786
|
-
await w(
|
|
784
|
+
for (const A of d) {
|
|
785
|
+
const H = A.file || A;
|
|
786
|
+
await w(H);
|
|
787
787
|
}
|
|
788
788
|
setTimeout(() => {
|
|
789
|
-
z(U.value),
|
|
789
|
+
z(U.value), ne();
|
|
790
790
|
}, 300);
|
|
791
791
|
}
|
|
792
|
-
},
|
|
793
|
-
const
|
|
792
|
+
}, Z = (d) => {
|
|
793
|
+
const f = {
|
|
794
794
|
content: d.content,
|
|
795
795
|
username: d.username || d.from || U.value,
|
|
796
796
|
type: d.type || "text",
|
|
@@ -801,9 +801,9 @@ function va(y) {
|
|
|
801
801
|
};
|
|
802
802
|
if (U.value) {
|
|
803
803
|
try {
|
|
804
|
-
let
|
|
804
|
+
let G = {
|
|
805
805
|
msgContent: d.content,
|
|
806
|
-
sendUsername:
|
|
806
|
+
sendUsername: f.username,
|
|
807
807
|
receiveUsername: a,
|
|
808
808
|
createTime: /* @__PURE__ */ new Date(),
|
|
809
809
|
isRead: 0,
|
|
@@ -812,103 +812,103 @@ function va(y) {
|
|
|
812
812
|
fileName: d.fileName || "",
|
|
813
813
|
fileSize: d.fileSize || 0
|
|
814
814
|
};
|
|
815
|
-
|
|
816
|
-
} catch (
|
|
817
|
-
console.error("[VueChatKit] 添加临时消息失败",
|
|
815
|
+
h.value.push(G), E();
|
|
816
|
+
} catch (G) {
|
|
817
|
+
console.error("[VueChatKit] 添加临时消息失败", G);
|
|
818
818
|
}
|
|
819
819
|
z(U.value);
|
|
820
820
|
}
|
|
821
|
-
|
|
822
|
-
},
|
|
823
|
-
const
|
|
824
|
-
|
|
821
|
+
ne();
|
|
822
|
+
}, F = (d, f) => {
|
|
823
|
+
const G = ee.value.find((A) => A.username === d);
|
|
824
|
+
G && (G.online = f);
|
|
825
825
|
}, K = async () => {
|
|
826
|
-
$.value = !0,
|
|
826
|
+
$.value = !0, j.value = "", x.value = [];
|
|
827
827
|
}, I = async (d = "") => {
|
|
828
|
-
|
|
828
|
+
de.value = !0;
|
|
829
829
|
try {
|
|
830
|
-
let
|
|
831
|
-
d ?
|
|
832
|
-
} catch (
|
|
833
|
-
console.error("[VueChatKit] 获取可用用户失败",
|
|
830
|
+
let f;
|
|
831
|
+
d ? f = await t.searchUser(d) : f = await t.getAvailableUsers(a), x.value = (f == null ? void 0 : f.data) || [];
|
|
832
|
+
} catch (f) {
|
|
833
|
+
console.error("[VueChatKit] 获取可用用户失败", f);
|
|
834
834
|
} finally {
|
|
835
|
-
|
|
835
|
+
de.value = !1;
|
|
836
836
|
}
|
|
837
837
|
}, W = async (d) => {
|
|
838
838
|
try {
|
|
839
|
-
await t.addFriend(a, d.username), await
|
|
840
|
-
} catch (
|
|
841
|
-
console.error("[VueChatKit] 添加好友失败",
|
|
839
|
+
await t.addFriend(a, d.username), await ne(), $.value = !1;
|
|
840
|
+
} catch (f) {
|
|
841
|
+
console.error("[VueChatKit] 添加好友失败", f);
|
|
842
842
|
}
|
|
843
|
-
},
|
|
843
|
+
}, te = async () => {
|
|
844
844
|
D.value = !0;
|
|
845
845
|
try {
|
|
846
846
|
const d = await t.getApplyList(a);
|
|
847
|
-
|
|
847
|
+
_e.value = d.data || [];
|
|
848
848
|
} catch (d) {
|
|
849
849
|
console.error("[VueChatKit] 获取好友申请列表失败", d);
|
|
850
850
|
} finally {
|
|
851
851
|
D.value = !1;
|
|
852
852
|
}
|
|
853
|
-
},
|
|
853
|
+
}, se = async (d) => {
|
|
854
854
|
try {
|
|
855
|
-
await t.agreeFriend(d, a), await
|
|
856
|
-
} catch (
|
|
857
|
-
console.error("[VueChatKit] 同意好友申请失败",
|
|
855
|
+
await t.agreeFriend(d, a), await te(), await ne();
|
|
856
|
+
} catch (f) {
|
|
857
|
+
console.error("[VueChatKit] 同意好友申请失败", f);
|
|
858
858
|
}
|
|
859
|
-
},
|
|
860
|
-
U.value = "",
|
|
859
|
+
}, q = () => {
|
|
860
|
+
U.value = "", h.value = [];
|
|
861
861
|
};
|
|
862
|
-
return
|
|
862
|
+
return kt(j, async (d) => {
|
|
863
863
|
await I(d);
|
|
864
864
|
}), {
|
|
865
865
|
// 状态
|
|
866
|
-
friendList:
|
|
866
|
+
friendList: ee,
|
|
867
867
|
chatList: S,
|
|
868
|
-
chatMsgList:
|
|
868
|
+
chatMsgList: h,
|
|
869
869
|
currentSelectName: U,
|
|
870
870
|
filteredUsers: _,
|
|
871
871
|
filteredFriendList: he,
|
|
872
|
-
filteredAvailableUsers:
|
|
873
|
-
currentUser:
|
|
874
|
-
currentMessages:
|
|
872
|
+
filteredAvailableUsers: pe,
|
|
873
|
+
currentUser: fe,
|
|
874
|
+
currentMessages: le,
|
|
875
875
|
addFriendDialogVisible: $,
|
|
876
|
-
addFriendSearchText:
|
|
876
|
+
addFriendSearchText: j,
|
|
877
877
|
availableUsers: x,
|
|
878
|
-
loadingAvailableUsers:
|
|
879
|
-
friendApplyList:
|
|
878
|
+
loadingAvailableUsers: de,
|
|
879
|
+
friendApplyList: _e,
|
|
880
880
|
loadingFriendApply: D,
|
|
881
881
|
// 方法
|
|
882
|
-
getFriendList:
|
|
882
|
+
getFriendList: ne,
|
|
883
883
|
getChatHistory: z,
|
|
884
|
-
markAsRead:
|
|
884
|
+
markAsRead: B,
|
|
885
885
|
selectUser: C,
|
|
886
|
-
setFriendToChatStatus:
|
|
887
|
-
sendMessage:
|
|
886
|
+
setFriendToChatStatus: ge,
|
|
887
|
+
sendMessage: ie,
|
|
888
888
|
sendFile: w,
|
|
889
889
|
sendFilesAndText: V,
|
|
890
|
-
handleFriendWsMessage:
|
|
891
|
-
handleFriendStatusChange:
|
|
890
|
+
handleFriendWsMessage: Z,
|
|
891
|
+
handleFriendStatusChange: F,
|
|
892
892
|
openAddFriendDialog: K,
|
|
893
893
|
loadAvailableUsers: I,
|
|
894
894
|
addFriend: W,
|
|
895
|
-
loadFriendApplyList:
|
|
896
|
-
agreeFriend:
|
|
897
|
-
resetFriendChat:
|
|
895
|
+
loadFriendApplyList: te,
|
|
896
|
+
agreeFriend: se,
|
|
897
|
+
resetFriendChat: q
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
|
-
function
|
|
901
|
-
const { api: t, myUsername: a, myAvatar: o, config:
|
|
900
|
+
function va(g) {
|
|
901
|
+
const { api: t, myUsername: a, myAvatar: o, config: y, scrollToBottom: E, getSocket: N } = g, ee = k("friends"), S = k([]), h = k(null), U = k([]), $ = k([]), j = k({}), x = k(!1), de = k(!1), _e = k(""), D = k(""), _ = k([]), he = k(!1), pe = k([]), fe = k(!1), le = k({
|
|
902
902
|
groupNickname: "",
|
|
903
903
|
remark: "",
|
|
904
904
|
notice: ""
|
|
905
|
-
}),
|
|
905
|
+
}), ne = k({
|
|
906
906
|
targetUsername: "",
|
|
907
907
|
memberNick: ""
|
|
908
|
-
}), z = k(!1),
|
|
908
|
+
}), z = k(!1), B = k(!1), C = k({
|
|
909
909
|
readUserList: [],
|
|
910
910
|
unreadUserList: []
|
|
911
|
-
}),
|
|
911
|
+
}), ge = k(null), ie = k({
|
|
912
912
|
groupNickname: !1,
|
|
913
913
|
remark: !1,
|
|
914
914
|
notice: !1
|
|
@@ -916,23 +916,23 @@ function fa(y) {
|
|
|
916
916
|
groupNickname: "",
|
|
917
917
|
remark: "",
|
|
918
918
|
notice: ""
|
|
919
|
-
}), V =
|
|
919
|
+
}), V = be(() => {
|
|
920
920
|
let u = S.value;
|
|
921
|
-
if (
|
|
922
|
-
const c =
|
|
921
|
+
if (g.searchText.value) {
|
|
922
|
+
const c = g.searchText.value.toLowerCase();
|
|
923
923
|
u = u.filter(
|
|
924
|
-
(
|
|
924
|
+
(R) => R.groupName && R.groupName.toLowerCase().includes(c) || R.remark && R.remark.toLowerCase().includes(c)
|
|
925
925
|
);
|
|
926
926
|
}
|
|
927
927
|
return u.map((c) => {
|
|
928
|
-
const
|
|
929
|
-
username:
|
|
930
|
-
avatar:
|
|
928
|
+
const ae = (j.value[c.groupId] || []).slice(0, 4).map((De) => ({
|
|
929
|
+
username: De.username,
|
|
930
|
+
avatar: De.avatar ? `${y.api.baseUrl}${De.avatar}` : `https://api.dicebear.com/7.x/avataaars/svg?seed=${De.username}`
|
|
931
931
|
}));
|
|
932
|
-
let
|
|
933
|
-
c.lastMsg ?
|
|
934
|
-
let
|
|
935
|
-
c.unReadNum !== void 0 && c.unReadNum !== null ?
|
|
932
|
+
let me = "暂无消息";
|
|
933
|
+
c.lastMsg ? me = c.lastMsg : c.lastMessage ? me = c.lastMessage : c.latestMessage && (me = c.latestMessage);
|
|
934
|
+
let Ie = 0;
|
|
935
|
+
c.unReadNum !== void 0 && c.unReadNum !== null ? Ie = c.unReadNum : c.unreadCount !== void 0 && c.unreadCount !== null ? Ie = c.unreadCount : c.unread !== void 0 && c.unread !== null && (Ie = c.unread);
|
|
936
936
|
let Ge = c.lastTime;
|
|
937
937
|
return !Ge && c.latestTime ? Ge = c.latestTime : !Ge && c.lastMsgTime && (Ge = c.lastMsgTime), {
|
|
938
938
|
id: c.groupId,
|
|
@@ -941,42 +941,42 @@ function fa(y) {
|
|
|
941
941
|
remark: c.remark,
|
|
942
942
|
owner: c.ownerUsername,
|
|
943
943
|
avatar: `https://api.dicebear.com/7.x/avataaars/svg?seed=${c.groupId}`,
|
|
944
|
-
memberAvatars:
|
|
945
|
-
lastMsg:
|
|
944
|
+
memberAvatars: ae,
|
|
945
|
+
lastMsg: me,
|
|
946
946
|
lastTime: Ge,
|
|
947
|
-
unread:
|
|
947
|
+
unread: Ie,
|
|
948
948
|
memberCount: c.memberCount || 0,
|
|
949
949
|
// 保留原始字段用于编辑功能
|
|
950
950
|
notice: c.notice,
|
|
951
951
|
groupNickname: c.groupNickname
|
|
952
952
|
};
|
|
953
953
|
});
|
|
954
|
-
}),
|
|
955
|
-
const c = u.type === "file" || u.fileUrl || u.fileName,
|
|
954
|
+
}), Z = be(() => U.value.map((u) => {
|
|
955
|
+
const c = u.type === "file" || u.fileUrl || u.fileName, R = u.fileName || u.msgContent, ae = $.value.find((Ge) => Ge.username === u.sendUsername), me = (ae == null ? void 0 : ae.memberNick) || u.sendUsername, Ie = ae != null && ae.avatar ? `${y.api.baseUrl}${ae.avatar}` : `https://api.dicebear.com/7.x/avataaars/svg?seed=${u.sendUsername}`;
|
|
956
956
|
return {
|
|
957
957
|
text: u.msgContent,
|
|
958
958
|
isSelf: u.sendUsername === a,
|
|
959
959
|
time: u.createTime,
|
|
960
960
|
sendUsername: u.sendUsername,
|
|
961
|
-
displayName:
|
|
961
|
+
displayName: me,
|
|
962
962
|
// 添加显示名称字段
|
|
963
|
-
avatar:
|
|
963
|
+
avatar: Ie,
|
|
964
964
|
type: c ? "file" : "text",
|
|
965
|
-
fileType:
|
|
965
|
+
fileType: g.isImageFile(R) ? "image" : g.getFileIconType(R),
|
|
966
966
|
fileUrl: u.fileUrl || "",
|
|
967
|
-
fileName:
|
|
967
|
+
fileName: R,
|
|
968
968
|
fileSize: u.fileSize || 0
|
|
969
969
|
};
|
|
970
|
-
})),
|
|
970
|
+
})), F = async () => {
|
|
971
971
|
try {
|
|
972
972
|
const u = await t.getMyGroups(a);
|
|
973
973
|
S.value = u.data || [];
|
|
974
974
|
for (const c of S.value)
|
|
975
975
|
try {
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
} catch (
|
|
979
|
-
console.error(`[VueChatKit] 获取群 ${c.groupId} 成员失败`,
|
|
976
|
+
const R = await t.getGroupMembers(c.groupId, a);
|
|
977
|
+
j.value[c.groupId] = R.data || [];
|
|
978
|
+
} catch (R) {
|
|
979
|
+
console.error(`[VueChatKit] 获取群 ${c.groupId} 成员失败`, R), j.value[c.groupId] = [];
|
|
980
980
|
}
|
|
981
981
|
} catch (u) {
|
|
982
982
|
console.error("[VueChatKit] 获取群聊列表失败", u);
|
|
@@ -996,24 +996,24 @@ function fa(y) {
|
|
|
996
996
|
console.error("[VueChatKit] 获取群成员失败", c);
|
|
997
997
|
}
|
|
998
998
|
}, W = async (u) => {
|
|
999
|
-
await
|
|
1000
|
-
},
|
|
999
|
+
await qe(u.groupId), await F(), h.value = u, await K(u.groupId), await I(u.groupId), E();
|
|
1000
|
+
}, te = async (u) => {
|
|
1001
1001
|
try {
|
|
1002
1002
|
return (await t.getGroupUnreadCount(u, a)).data || 0;
|
|
1003
1003
|
} catch (c) {
|
|
1004
1004
|
return console.error("[VueChatKit] 获取群未读数失败", c), 0;
|
|
1005
1005
|
}
|
|
1006
|
-
},
|
|
1006
|
+
}, se = async (u, c) => {
|
|
1007
1007
|
try {
|
|
1008
|
-
const
|
|
1009
|
-
C.value =
|
|
1010
|
-
} catch (
|
|
1011
|
-
console.error("[VueChatKit] 获取消息已读成员失败",
|
|
1008
|
+
const R = await t.getMsgReadUserList(u, c, a);
|
|
1009
|
+
C.value = R.data || { readUserList: [], unreadUserList: [] }, B.value = !0;
|
|
1010
|
+
} catch (R) {
|
|
1011
|
+
console.error("[VueChatKit] 获取消息已读成员失败", R);
|
|
1012
1012
|
}
|
|
1013
|
-
},
|
|
1013
|
+
}, q = async (u) => {
|
|
1014
1014
|
try {
|
|
1015
1015
|
const c = await t.getGroupInfo(u, a);
|
|
1016
|
-
c.code === 200 && c.data && (
|
|
1016
|
+
c.code === 200 && c.data && (ge.value = c.data, w.value = {
|
|
1017
1017
|
groupNickname: c.data.groupNickname || c.data.groupName || "",
|
|
1018
1018
|
remark: c.data.remark || "",
|
|
1019
1019
|
notice: c.data.notice || ""
|
|
@@ -1022,14 +1022,14 @@ function fa(y) {
|
|
|
1022
1022
|
console.error("[VueChatKit] 获取群详情失败", c);
|
|
1023
1023
|
}
|
|
1024
1024
|
}, d = async (u) => {
|
|
1025
|
-
if (!
|
|
1025
|
+
if (!h.value || !ge.value) return !1;
|
|
1026
1026
|
try {
|
|
1027
1027
|
const c = {
|
|
1028
|
-
groupId:
|
|
1028
|
+
groupId: h.value.groupId,
|
|
1029
1029
|
currentUser: a,
|
|
1030
|
-
groupNickname: u === "groupNickname" ? w.value.groupNickname :
|
|
1031
|
-
remark: u === "remark" ? w.value.remark :
|
|
1032
|
-
notice: u === "notice" ? w.value.notice :
|
|
1030
|
+
groupNickname: u === "groupNickname" ? w.value.groupNickname : ge.value.groupNickname,
|
|
1031
|
+
remark: u === "remark" ? w.value.remark : ge.value.remark,
|
|
1032
|
+
notice: u === "notice" ? w.value.notice : ge.value.notice
|
|
1033
1033
|
};
|
|
1034
1034
|
return (await t._updateGroupInfo(
|
|
1035
1035
|
c.groupId,
|
|
@@ -1037,259 +1037,259 @@ function fa(y) {
|
|
|
1037
1037
|
c.groupNickname,
|
|
1038
1038
|
c.remark,
|
|
1039
1039
|
c.notice
|
|
1040
|
-
)).code === 200 ? (await
|
|
1040
|
+
)).code === 200 ? (await q(h.value.groupId), await F(), !0) : !1;
|
|
1041
1041
|
} catch (c) {
|
|
1042
1042
|
return console.error("[VueChatKit] 修改群信息失败", c), !1;
|
|
1043
1043
|
}
|
|
1044
|
-
},
|
|
1045
|
-
!
|
|
1046
|
-
},
|
|
1047
|
-
|
|
1048
|
-
},
|
|
1044
|
+
}, f = (u) => {
|
|
1045
|
+
!ge.value && h.value && q(h.value.groupId), ie.value[u] = !0;
|
|
1046
|
+
}, G = (u) => {
|
|
1047
|
+
ie.value[u] = !1, ge.value && (w.value[u] = ge.value[u] || "");
|
|
1048
|
+
}, A = async (u) => {
|
|
1049
1049
|
const c = await d(u);
|
|
1050
|
-
return c && (
|
|
1051
|
-
},
|
|
1052
|
-
if (!
|
|
1050
|
+
return c && (ie.value[u] = !1), c;
|
|
1051
|
+
}, H = async () => {
|
|
1052
|
+
if (!h.value) return !1;
|
|
1053
1053
|
try {
|
|
1054
1054
|
return (await t.updateGroupInfo(
|
|
1055
|
-
|
|
1055
|
+
h.value.groupId,
|
|
1056
1056
|
a,
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
)).code === 200 ? (
|
|
1057
|
+
le.value.groupNickname,
|
|
1058
|
+
le.value.remark,
|
|
1059
|
+
le.value.notice
|
|
1060
|
+
)).code === 200 ? (fe.value = !1, await F(), h.value && await q(h.value.groupId), !0) : !1;
|
|
1061
1061
|
} catch (u) {
|
|
1062
1062
|
return console.error("[VueChatKit] 修改群信息失败", u), !1;
|
|
1063
1063
|
}
|
|
1064
|
-
},
|
|
1065
|
-
if (!
|
|
1064
|
+
}, Y = async () => {
|
|
1065
|
+
if (!h.value) return !1;
|
|
1066
1066
|
try {
|
|
1067
1067
|
return (await t.updateMemberNick(
|
|
1068
|
-
|
|
1068
|
+
h.value.groupId,
|
|
1069
1069
|
a,
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
)).code === 200 ? (z.value = !1, await I(
|
|
1070
|
+
ne.value.targetUsername,
|
|
1071
|
+
ne.value.memberNick
|
|
1072
|
+
)).code === 200 ? (z.value = !1, await I(h.value.groupId), !0) : !1;
|
|
1073
1073
|
} catch (u) {
|
|
1074
1074
|
return console.error("[VueChatKit] 修改群成员昵称失败", u), !1;
|
|
1075
1075
|
}
|
|
1076
|
-
},
|
|
1077
|
-
if (!
|
|
1076
|
+
}, re = async () => {
|
|
1077
|
+
if (!h.value) return !1;
|
|
1078
1078
|
try {
|
|
1079
|
-
return (await t.deleteGroup(
|
|
1079
|
+
return (await t.deleteGroup(h.value.groupId, a)).code === 200 ? (h.value = null, U.value = [], de.value = !1, await F(), !0) : !1;
|
|
1080
1080
|
} catch (u) {
|
|
1081
1081
|
return console.error("[VueChatKit] 解散群聊失败", u), !1;
|
|
1082
1082
|
}
|
|
1083
|
-
},
|
|
1084
|
-
if (!
|
|
1083
|
+
}, ye = async (u) => {
|
|
1084
|
+
if (!h.value) return !1;
|
|
1085
1085
|
try {
|
|
1086
1086
|
return (await t.removeGroupMember(
|
|
1087
|
-
|
|
1087
|
+
h.value.groupId,
|
|
1088
1088
|
a,
|
|
1089
1089
|
u
|
|
1090
|
-
)).code === 200 ? (await I(
|
|
1090
|
+
)).code === 200 ? (await I(h.value.groupId), !0) : !1;
|
|
1091
1091
|
} catch (c) {
|
|
1092
1092
|
return console.error("[VueChatKit] 移除成员失败", c), !1;
|
|
1093
1093
|
}
|
|
1094
|
-
},
|
|
1095
|
-
if (!
|
|
1094
|
+
}, Ce = async (u) => {
|
|
1095
|
+
if (!h.value) return !1;
|
|
1096
1096
|
try {
|
|
1097
1097
|
return (await t.transferGroupOwner(
|
|
1098
|
-
|
|
1098
|
+
h.value.groupId,
|
|
1099
1099
|
a,
|
|
1100
1100
|
u
|
|
1101
|
-
)).code === 200 ? (await I(
|
|
1101
|
+
)).code === 200 ? (await I(h.value.groupId), !0) : !1;
|
|
1102
1102
|
} catch (c) {
|
|
1103
1103
|
return console.error("[VueChatKit] 转让群主失败", c), !1;
|
|
1104
1104
|
}
|
|
1105
1105
|
}, Fe = async (u) => {
|
|
1106
|
-
if (!
|
|
1106
|
+
if (!h.value) return !1;
|
|
1107
1107
|
try {
|
|
1108
1108
|
return (await t.readSingleGroupMsg(
|
|
1109
|
-
|
|
1109
|
+
h.value.groupId,
|
|
1110
1110
|
a,
|
|
1111
1111
|
u
|
|
1112
1112
|
)).code === 200;
|
|
1113
1113
|
} catch (c) {
|
|
1114
1114
|
return console.error("[VueChatKit] 标记消息已读失败", c), !1;
|
|
1115
1115
|
}
|
|
1116
|
-
},
|
|
1117
|
-
var
|
|
1118
|
-
const c = u || ((
|
|
1116
|
+
}, qe = async (u) => {
|
|
1117
|
+
var R;
|
|
1118
|
+
const c = u || ((R = h.value) == null ? void 0 : R.groupId);
|
|
1119
1119
|
if (!c) return !1;
|
|
1120
1120
|
try {
|
|
1121
1121
|
return (await t.readAllGroupMsg(c, a)).code === 200;
|
|
1122
|
-
} catch (
|
|
1123
|
-
return console.error("[VueChatKit] 标记全部已读失败",
|
|
1122
|
+
} catch (ae) {
|
|
1123
|
+
return console.error("[VueChatKit] 标记全部已读失败", ae), !1;
|
|
1124
1124
|
}
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
groupNickname:
|
|
1128
|
-
remark:
|
|
1129
|
-
notice:
|
|
1130
|
-
},
|
|
1131
|
-
},
|
|
1132
|
-
|
|
1125
|
+
}, Oe = () => {
|
|
1126
|
+
h.value && (le.value = {
|
|
1127
|
+
groupNickname: h.value.name || "",
|
|
1128
|
+
remark: h.value.remark || "",
|
|
1129
|
+
notice: h.value.notice || ""
|
|
1130
|
+
}, fe.value = !0);
|
|
1131
|
+
}, wt = (u) => {
|
|
1132
|
+
ne.value = {
|
|
1133
1133
|
targetUsername: u.username,
|
|
1134
1134
|
memberNick: u.memberNick || ""
|
|
1135
1135
|
}, z.value = !0;
|
|
1136
|
-
},
|
|
1137
|
-
if (!
|
|
1136
|
+
}, rt = async () => {
|
|
1137
|
+
if (!_e.value.trim())
|
|
1138
1138
|
return console.warn("[VueChatKit] 请输入群名称"), !1;
|
|
1139
1139
|
try {
|
|
1140
1140
|
const u = await t.createGroup({
|
|
1141
|
-
groupName:
|
|
1141
|
+
groupName: _e.value.trim(),
|
|
1142
1142
|
remark: D.value.trim(),
|
|
1143
1143
|
ownerUsername: a
|
|
1144
1144
|
});
|
|
1145
1145
|
if (u.code === 200 && u.data) {
|
|
1146
1146
|
if (_.value.length > 0) {
|
|
1147
|
-
const c = _.value.map((
|
|
1147
|
+
const c = _.value.map((R) => R.id);
|
|
1148
1148
|
await t.inviteGroupMembers(
|
|
1149
1149
|
u.data.groupId || u.data,
|
|
1150
1150
|
a,
|
|
1151
1151
|
c
|
|
1152
1152
|
);
|
|
1153
1153
|
}
|
|
1154
|
-
return
|
|
1154
|
+
return _e.value = "", D.value = "", _.value = [], x.value = !1, await F(), !0;
|
|
1155
1155
|
}
|
|
1156
1156
|
return !1;
|
|
1157
1157
|
} catch (u) {
|
|
1158
1158
|
return console.error("[VueChatKit] 创建群聊失败", u), !1;
|
|
1159
1159
|
}
|
|
1160
|
-
},
|
|
1161
|
-
if (!
|
|
1160
|
+
}, Ct = async () => {
|
|
1161
|
+
if (!h.value || pe.value.length === 0)
|
|
1162
1162
|
return !1;
|
|
1163
1163
|
try {
|
|
1164
|
-
const u =
|
|
1164
|
+
const u = pe.value.map((c) => c.id);
|
|
1165
1165
|
return await t.inviteGroupMembers(
|
|
1166
|
-
|
|
1166
|
+
h.value.groupId,
|
|
1167
1167
|
a,
|
|
1168
1168
|
u
|
|
1169
|
-
),
|
|
1169
|
+
), pe.value = [], he.value = !1, await I(h.value.groupId), !0;
|
|
1170
1170
|
} catch (u) {
|
|
1171
1171
|
return console.error("[VueChatKit] 邀请成员失败", u), !1;
|
|
1172
1172
|
}
|
|
1173
|
-
},
|
|
1174
|
-
if (!
|
|
1173
|
+
}, Pe = async () => {
|
|
1174
|
+
if (!h.value) return !1;
|
|
1175
1175
|
try {
|
|
1176
|
-
return await t.quitGroup(
|
|
1176
|
+
return await t.quitGroup(h.value.groupId, a), h.value = null, U.value = [], de.value = !1, await F(), !0;
|
|
1177
1177
|
} catch (u) {
|
|
1178
1178
|
return console.error("[VueChatKit] 退出群聊失败", u), !1;
|
|
1179
1179
|
}
|
|
1180
|
-
},
|
|
1180
|
+
}, ot = () => {
|
|
1181
1181
|
const u = N();
|
|
1182
|
-
if (!
|
|
1183
|
-
if (u.send(
|
|
1184
|
-
const
|
|
1185
|
-
msgContent:
|
|
1182
|
+
if (!g.inputText.value.trim() || !h.value || !u) return;
|
|
1183
|
+
if (u.send(h.value.groupId, g.inputText.value.trim(), "text", "", "", 0, !0)) {
|
|
1184
|
+
const R = {
|
|
1185
|
+
msgContent: g.inputText.value.trim(),
|
|
1186
1186
|
sendUsername: a,
|
|
1187
|
-
toGroupId:
|
|
1187
|
+
toGroupId: h.value.groupId,
|
|
1188
1188
|
createTime: /* @__PURE__ */ new Date(),
|
|
1189
1189
|
isRead: 0,
|
|
1190
1190
|
type: "text"
|
|
1191
1191
|
};
|
|
1192
|
-
U.value.push(
|
|
1193
|
-
K(
|
|
1192
|
+
U.value.push(R), g.inputText.value = "", E(), setTimeout(() => {
|
|
1193
|
+
K(h.value.groupId), F();
|
|
1194
1194
|
}, 300);
|
|
1195
1195
|
}
|
|
1196
|
-
},
|
|
1196
|
+
}, lt = async (u) => {
|
|
1197
1197
|
const c = N();
|
|
1198
|
-
if (!
|
|
1198
|
+
if (!h.value || !c) return !1;
|
|
1199
1199
|
try {
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
const { fileUrl:
|
|
1200
|
+
const R = await t.uploadFile(u);
|
|
1201
|
+
if (R.code === 200 && R.data) {
|
|
1202
|
+
const { fileUrl: ae, fileName: me } = R.data;
|
|
1203
1203
|
if (c.send(
|
|
1204
|
-
|
|
1205
|
-
|
|
1204
|
+
h.value.groupId,
|
|
1205
|
+
me,
|
|
1206
1206
|
"file",
|
|
1207
|
-
|
|
1208
|
-
|
|
1207
|
+
ae,
|
|
1208
|
+
me,
|
|
1209
1209
|
u.size,
|
|
1210
1210
|
!0
|
|
1211
1211
|
)) {
|
|
1212
1212
|
const Ge = {
|
|
1213
|
-
msgContent:
|
|
1213
|
+
msgContent: me,
|
|
1214
1214
|
sendUsername: a,
|
|
1215
|
-
toGroupId:
|
|
1215
|
+
toGroupId: h.value.groupId,
|
|
1216
1216
|
createTime: /* @__PURE__ */ new Date(),
|
|
1217
1217
|
isRead: 0,
|
|
1218
1218
|
type: "file",
|
|
1219
|
-
fileUrl:
|
|
1220
|
-
fileName:
|
|
1219
|
+
fileUrl: ae,
|
|
1220
|
+
fileName: me,
|
|
1221
1221
|
fileSize: u.size
|
|
1222
1222
|
};
|
|
1223
1223
|
return U.value.push(Ge), E(), !0;
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
return !1;
|
|
1227
|
-
} catch (
|
|
1228
|
-
return console.error("[VueChatKit] 发送群聊文件失败",
|
|
1227
|
+
} catch (R) {
|
|
1228
|
+
return console.error("[VueChatKit] 发送群聊文件失败", R), !1;
|
|
1229
1229
|
}
|
|
1230
1230
|
};
|
|
1231
1231
|
return {
|
|
1232
1232
|
// 状态
|
|
1233
|
-
activeTab:
|
|
1233
|
+
activeTab: ee,
|
|
1234
1234
|
groupList: S,
|
|
1235
|
-
currentSelectGroup:
|
|
1235
|
+
currentSelectGroup: h,
|
|
1236
1236
|
groupMsgList: U,
|
|
1237
1237
|
groupMemberList: $,
|
|
1238
|
-
groupMembersMap:
|
|
1238
|
+
groupMembersMap: j,
|
|
1239
1239
|
createGroupDialogVisible: x,
|
|
1240
|
-
groupDetailVisible:
|
|
1241
|
-
newGroupName:
|
|
1240
|
+
groupDetailVisible: de,
|
|
1241
|
+
newGroupName: _e,
|
|
1242
1242
|
newGroupRemark: D,
|
|
1243
1243
|
selectedMembersForCreate: _,
|
|
1244
1244
|
inviteMemberDialogVisible: he,
|
|
1245
|
-
selectedMembersForInvite:
|
|
1246
|
-
groupInfoVisible:
|
|
1247
|
-
editingGroupInfo:
|
|
1248
|
-
editingMemberNick:
|
|
1245
|
+
selectedMembersForInvite: pe,
|
|
1246
|
+
groupInfoVisible: fe,
|
|
1247
|
+
editingGroupInfo: le,
|
|
1248
|
+
editingMemberNick: ne,
|
|
1249
1249
|
memberNickDialogVisible: z,
|
|
1250
|
-
msgReadUserDialogVisible:
|
|
1250
|
+
msgReadUserDialogVisible: B,
|
|
1251
1251
|
currentMsgReadList: C,
|
|
1252
|
-
currentGroupInfo:
|
|
1253
|
-
editingFields:
|
|
1252
|
+
currentGroupInfo: ge,
|
|
1253
|
+
editingFields: ie,
|
|
1254
1254
|
tempEditValues: w,
|
|
1255
1255
|
// 计算属性
|
|
1256
1256
|
filteredGroupList: V,
|
|
1257
|
-
currentGroupMessages:
|
|
1257
|
+
currentGroupMessages: Z,
|
|
1258
1258
|
// 方法
|
|
1259
|
-
getGroupList:
|
|
1259
|
+
getGroupList: F,
|
|
1260
1260
|
getGroupHistory: K,
|
|
1261
1261
|
getGroupMembers: I,
|
|
1262
1262
|
selectGroup: W,
|
|
1263
|
-
createGroup:
|
|
1264
|
-
inviteGroupMember:
|
|
1265
|
-
quitGroup:
|
|
1266
|
-
sendGroupMessage:
|
|
1267
|
-
sendGroupFile:
|
|
1263
|
+
createGroup: rt,
|
|
1264
|
+
inviteGroupMember: Ct,
|
|
1265
|
+
quitGroup: Pe,
|
|
1266
|
+
sendGroupMessage: ot,
|
|
1267
|
+
sendGroupFile: lt,
|
|
1268
1268
|
sendGroupFilesAndText: async (u, c) => {
|
|
1269
|
-
const
|
|
1270
|
-
if (!(!
|
|
1271
|
-
if (c && c.trim() &&
|
|
1272
|
-
const
|
|
1269
|
+
const R = N();
|
|
1270
|
+
if (!(!h.value || !R)) {
|
|
1271
|
+
if (c && c.trim() && R.send(h.value.groupId, c.trim(), "text", "", "", 0, !0)) {
|
|
1272
|
+
const me = {
|
|
1273
1273
|
msgContent: c.trim(),
|
|
1274
1274
|
sendUsername: a,
|
|
1275
|
-
toGroupId:
|
|
1275
|
+
toGroupId: h.value.groupId,
|
|
1276
1276
|
createTime: /* @__PURE__ */ new Date(),
|
|
1277
1277
|
isRead: 0,
|
|
1278
1278
|
type: "text"
|
|
1279
1279
|
};
|
|
1280
|
-
U.value.push(
|
|
1280
|
+
U.value.push(me);
|
|
1281
1281
|
}
|
|
1282
|
-
for (const
|
|
1283
|
-
const
|
|
1284
|
-
await
|
|
1282
|
+
for (const ae of u) {
|
|
1283
|
+
const me = ae.file || ae;
|
|
1284
|
+
await lt(me);
|
|
1285
1285
|
}
|
|
1286
1286
|
setTimeout(() => {
|
|
1287
|
-
K(
|
|
1287
|
+
K(h.value.groupId), F();
|
|
1288
1288
|
}, 300);
|
|
1289
1289
|
}
|
|
1290
1290
|
},
|
|
1291
1291
|
handleGroupWsMessage: (u) => {
|
|
1292
|
-
if (
|
|
1292
|
+
if (h.value && h.value.groupId === u.toGroupId) {
|
|
1293
1293
|
try {
|
|
1294
1294
|
let c = {
|
|
1295
1295
|
msgContent: u.content,
|
|
@@ -1308,44 +1308,44 @@ function fa(y) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
K(u.toGroupId);
|
|
1310
1310
|
}
|
|
1311
|
-
|
|
1311
|
+
F();
|
|
1312
1312
|
},
|
|
1313
1313
|
switchTab: (u) => {
|
|
1314
|
-
|
|
1314
|
+
ee.value = u, u === "groups" && F();
|
|
1315
1315
|
},
|
|
1316
1316
|
resetGroupChat: () => {
|
|
1317
|
-
|
|
1317
|
+
h.value = null, U.value = [];
|
|
1318
1318
|
},
|
|
1319
|
-
getGroupUnreadCount:
|
|
1320
|
-
getMsgReadUserList:
|
|
1321
|
-
updateGroupInfo:
|
|
1322
|
-
updateMemberNick:
|
|
1323
|
-
deleteGroup:
|
|
1324
|
-
removeGroupMember:
|
|
1325
|
-
transferGroupOwner:
|
|
1319
|
+
getGroupUnreadCount: te,
|
|
1320
|
+
getMsgReadUserList: se,
|
|
1321
|
+
updateGroupInfo: H,
|
|
1322
|
+
updateMemberNick: Y,
|
|
1323
|
+
deleteGroup: re,
|
|
1324
|
+
removeGroupMember: ye,
|
|
1325
|
+
transferGroupOwner: Ce,
|
|
1326
1326
|
readSingleGroupMsg: Fe,
|
|
1327
|
-
readAllGroupMsg:
|
|
1328
|
-
openEditGroupInfo:
|
|
1329
|
-
openEditMemberNick:
|
|
1330
|
-
fetchGroupDetail:
|
|
1327
|
+
readAllGroupMsg: qe,
|
|
1328
|
+
openEditGroupInfo: Oe,
|
|
1329
|
+
openEditMemberNick: wt,
|
|
1330
|
+
fetchGroupDetail: q,
|
|
1331
1331
|
updateSingleGroupField: d,
|
|
1332
|
-
startEditField:
|
|
1333
|
-
cancelEditField:
|
|
1334
|
-
saveEditField:
|
|
1332
|
+
startEditField: f,
|
|
1333
|
+
cancelEditField: G,
|
|
1334
|
+
saveEditField: A
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
|
-
function ha(
|
|
1338
|
-
const a =
|
|
1337
|
+
function ha(g, t) {
|
|
1338
|
+
const a = pa(g), o = ma(a), y = va(a), E = be(() => y.currentSelectGroup.value ? { type: "group", data: y.currentSelectGroup.value } : o.currentSelectName.value && o.currentUser.value ? { type: "friend", data: o.currentUser.value } : null), N = be(() => y.currentSelectGroup.value ? y.currentGroupMessages.value : o.currentMessages.value), ee = (D) => {
|
|
1339
1339
|
if (D.includes("【状态变更】")) {
|
|
1340
|
-
const he = /【状态变更】(.+?) 已(上线|下线)/,
|
|
1341
|
-
if (
|
|
1342
|
-
const
|
|
1343
|
-
o.handleFriendStatusChange(
|
|
1340
|
+
const he = /【状态变更】(.+?) 已(上线|下线)/, pe = D.match(he);
|
|
1341
|
+
if (pe) {
|
|
1342
|
+
const fe = pe[1], le = pe[2] === "上线";
|
|
1343
|
+
o.handleFriendStatusChange(fe, le);
|
|
1344
1344
|
}
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
1347
|
const _ = a.parseWsMessage(D);
|
|
1348
|
-
_ && (_.toGroupId ?
|
|
1348
|
+
_ && (_.toGroupId ? y.handleGroupWsMessage(_) : o.handleFriendWsMessage(_), t && typeof t == "function" && t({
|
|
1349
1349
|
..._,
|
|
1350
1350
|
isGroup: !!_.toGroupId
|
|
1351
1351
|
}));
|
|
@@ -1354,46 +1354,46 @@ function ha(y, t) {
|
|
|
1354
1354
|
// ========== 核心模块 ==========
|
|
1355
1355
|
...a,
|
|
1356
1356
|
initWebSocket: () => {
|
|
1357
|
-
a.initWebSocket(
|
|
1357
|
+
a.initWebSocket(ee);
|
|
1358
1358
|
},
|
|
1359
1359
|
// ========== 私聊模块 ==========
|
|
1360
1360
|
...o,
|
|
1361
1361
|
selectUser: async (D) => {
|
|
1362
|
-
|
|
1362
|
+
y.resetGroupChat(), await o.selectUser(D);
|
|
1363
1363
|
},
|
|
1364
1364
|
// ========== 群聊模块 ==========
|
|
1365
|
-
...
|
|
1365
|
+
...y,
|
|
1366
1366
|
selectGroup: async (D) => {
|
|
1367
|
-
o.resetFriendChat(), await
|
|
1367
|
+
o.resetFriendChat(), await y.selectGroup(D);
|
|
1368
1368
|
},
|
|
1369
1369
|
// ========== 共享计算属性 ==========
|
|
1370
1370
|
currentChatTarget: E,
|
|
1371
1371
|
currentAllMessages: N,
|
|
1372
1372
|
// ========== 整合方法 ==========
|
|
1373
1373
|
switchTab: (D) => {
|
|
1374
|
-
|
|
1374
|
+
y.switchTab(D), D === "apply" && o.loadFriendApplyList();
|
|
1375
1375
|
},
|
|
1376
1376
|
sendMessage: () => {
|
|
1377
|
-
|
|
1377
|
+
y.currentSelectGroup.value ? y.sendGroupMessage() : o.currentSelectName.value && o.sendMessage();
|
|
1378
1378
|
},
|
|
1379
|
-
sendFile: async (D) =>
|
|
1379
|
+
sendFile: async (D) => y.currentSelectGroup.value ? await y.sendGroupFile(D) : o.currentSelectName.value ? await o.sendFile(D) : !1,
|
|
1380
1380
|
sendFilesAndText: async (D, _) => {
|
|
1381
|
-
|
|
1381
|
+
y.currentSelectGroup.value ? await y.sendGroupFilesAndText(D, _) : o.currentSelectName.value && await o.sendFilesAndText(D, _);
|
|
1382
1382
|
},
|
|
1383
1383
|
reset: () => {
|
|
1384
|
-
o.resetFriendChat(),
|
|
1384
|
+
o.resetFriendChat(), y.resetGroupChat(), a.inputText.value = "", a.searchText.value = "";
|
|
1385
1385
|
}
|
|
1386
1386
|
};
|
|
1387
1387
|
}
|
|
1388
|
-
const
|
|
1389
|
-
const a =
|
|
1390
|
-
for (const [o,
|
|
1391
|
-
a[o] =
|
|
1388
|
+
const _t = (g, t) => {
|
|
1389
|
+
const a = g.__vccOpts || g;
|
|
1390
|
+
for (const [o, y] of t)
|
|
1391
|
+
a[o] = y;
|
|
1392
1392
|
return a;
|
|
1393
|
-
},
|
|
1393
|
+
}, fa = { class: "avatar-crop-container" }, ga = {
|
|
1394
1394
|
key: 0,
|
|
1395
1395
|
class: "crop-wrapper"
|
|
1396
|
-
},
|
|
1396
|
+
}, ya = ["src"], ba = ["onMousedown", "onTouchstart"], ka = { class: "preview-wrapper" }, _a = ["width", "height"], wa = { class: "dialog-footer" }, Ca = {
|
|
1397
1397
|
__name: "AvatarCrop",
|
|
1398
1398
|
props: {
|
|
1399
1399
|
modelValue: Boolean,
|
|
@@ -1409,15 +1409,15 @@ const wt = (y, t) => {
|
|
|
1409
1409
|
minSize: { type: Number, default: 50 }
|
|
1410
1410
|
},
|
|
1411
1411
|
emits: ["update:modelValue", "confirm", "cancel", "closed"],
|
|
1412
|
-
setup(
|
|
1413
|
-
const o =
|
|
1412
|
+
setup(g, { expose: t, emit: a }) {
|
|
1413
|
+
const o = g, y = a, E = be({
|
|
1414
1414
|
get: () => o.modelValue,
|
|
1415
|
-
set: (w) =>
|
|
1416
|
-
}), N =
|
|
1415
|
+
set: (w) => y("update:modelValue", w)
|
|
1416
|
+
}), N = be({
|
|
1417
1417
|
get: () => o.src,
|
|
1418
1418
|
set: (w) => {
|
|
1419
1419
|
}
|
|
1420
|
-
}),
|
|
1420
|
+
}), ee = ["nw", "n", "ne", "e", "se", "s", "sw", "w"], S = k(!1), h = k(null), U = k(null), $ = k(null), j = k({
|
|
1421
1421
|
naturalWidth: 0,
|
|
1422
1422
|
naturalHeight: 0,
|
|
1423
1423
|
displayWidth: 0,
|
|
@@ -1429,13 +1429,13 @@ const wt = (y, t) => {
|
|
|
1429
1429
|
y: 0,
|
|
1430
1430
|
size: 150,
|
|
1431
1431
|
minSize: o.minSize
|
|
1432
|
-
}),
|
|
1433
|
-
width: `${
|
|
1434
|
-
height: `${
|
|
1432
|
+
}), de = be(() => ({
|
|
1433
|
+
width: `${j.value.displayWidth}px`,
|
|
1434
|
+
height: `${j.value.displayHeight}px`,
|
|
1435
1435
|
maxWidth: "none",
|
|
1436
1436
|
maxHeight: "none",
|
|
1437
1437
|
display: "block"
|
|
1438
|
-
})),
|
|
1438
|
+
})), _e = be(() => ({
|
|
1439
1439
|
left: `${x.value.x}px`,
|
|
1440
1440
|
top: `${x.value.y}px`,
|
|
1441
1441
|
width: `${x.value.size}px`,
|
|
@@ -1443,97 +1443,97 @@ const wt = (y, t) => {
|
|
|
1443
1443
|
}));
|
|
1444
1444
|
let D = null, _ = null;
|
|
1445
1445
|
const he = () => {
|
|
1446
|
-
|
|
1447
|
-
const w = U.value, V =
|
|
1446
|
+
nt(() => {
|
|
1447
|
+
const w = U.value, V = h.value;
|
|
1448
1448
|
if (!w || !V) return;
|
|
1449
|
-
const
|
|
1450
|
-
let W,
|
|
1451
|
-
K > I ? (W =
|
|
1449
|
+
const Z = V.clientWidth, F = V.clientHeight, K = w.naturalWidth / w.naturalHeight, I = Z / F;
|
|
1450
|
+
let W, te, se, q;
|
|
1451
|
+
K > I ? (W = Z, te = Z / K, se = 0, q = (F - te) / 2) : (te = F, W = F * K, se = (Z - W) / 2, q = 0), j.value = {
|
|
1452
1452
|
naturalWidth: w.naturalWidth,
|
|
1453
1453
|
naturalHeight: w.naturalHeight,
|
|
1454
1454
|
displayWidth: W,
|
|
1455
|
-
displayHeight:
|
|
1456
|
-
offsetX:
|
|
1457
|
-
offsetY:
|
|
1455
|
+
displayHeight: te,
|
|
1456
|
+
offsetX: se,
|
|
1457
|
+
offsetY: q
|
|
1458
1458
|
};
|
|
1459
|
-
const d = Math.min(W,
|
|
1460
|
-
x.value.size = d, x.value.x =
|
|
1459
|
+
const d = Math.min(W, te) * 0.6;
|
|
1460
|
+
x.value.size = d, x.value.x = se + (W - d) / 2, x.value.y = q + (te - d / o.aspectRatio) / 2, pe();
|
|
1461
1461
|
});
|
|
1462
|
-
},
|
|
1462
|
+
}, pe = () => {
|
|
1463
1463
|
const w = $.value, V = U.value;
|
|
1464
1464
|
if (!w || !V) return;
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
},
|
|
1465
|
+
const Z = w.getContext("2d"), { naturalWidth: F, naturalHeight: K, displayWidth: I, displayHeight: W, offsetX: te, offsetY: se } = j.value, q = F / I, d = K / W, f = (x.value.x - te) * q, G = (x.value.y - se) * d, A = x.value.size * q, H = x.value.size / o.aspectRatio * d;
|
|
1466
|
+
Z.clearRect(0, 0, w.width, w.height), Z.drawImage(V, f, G, A, H, 0, 0, w.width, w.height);
|
|
1467
|
+
}, fe = (w) => {
|
|
1468
1468
|
w.preventDefault();
|
|
1469
|
-
const V = w.clientX || w.touches[0].clientX,
|
|
1469
|
+
const V = w.clientX || w.touches[0].clientX, Z = w.clientY || w.touches[0].clientY;
|
|
1470
1470
|
D = {
|
|
1471
1471
|
startX: V,
|
|
1472
|
-
startY:
|
|
1472
|
+
startY: Z,
|
|
1473
1473
|
boxX: x.value.x,
|
|
1474
1474
|
boxY: x.value.y
|
|
1475
1475
|
};
|
|
1476
|
-
const
|
|
1477
|
-
const W = I.clientX || I.touches[0].clientX,
|
|
1478
|
-
x.value.x =
|
|
1476
|
+
const F = (I) => {
|
|
1477
|
+
const W = I.clientX || I.touches[0].clientX, te = I.clientY || I.touches[0].clientY, se = W - D.startX, q = te - D.startY, { offsetX: d, offsetY: f, displayWidth: G, displayHeight: A } = j.value, H = x.value.size / o.aspectRatio, Y = Math.max(d, Math.min(d + G - x.value.size, D.boxX + se)), re = Math.max(f, Math.min(f + A - H, D.boxY + q));
|
|
1478
|
+
x.value.x = Y, x.value.y = re, pe();
|
|
1479
1479
|
}, K = () => {
|
|
1480
|
-
D = null, document.removeEventListener("mousemove",
|
|
1480
|
+
D = null, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", K), document.removeEventListener("touchmove", F), document.removeEventListener("touchend", K);
|
|
1481
1481
|
};
|
|
1482
|
-
document.addEventListener("mousemove",
|
|
1483
|
-
},
|
|
1482
|
+
document.addEventListener("mousemove", F), document.addEventListener("mouseup", K), document.addEventListener("touchmove", F, { passive: !1 }), document.addEventListener("touchend", K);
|
|
1483
|
+
}, le = (w, V) => {
|
|
1484
1484
|
V.preventDefault();
|
|
1485
|
-
const
|
|
1485
|
+
const Z = V.clientX || V.touches[0].clientX, F = V.clientY || V.touches[0].clientY;
|
|
1486
1486
|
_ = {
|
|
1487
1487
|
handle: w,
|
|
1488
|
-
startX:
|
|
1489
|
-
startY:
|
|
1488
|
+
startX: Z,
|
|
1489
|
+
startY: F,
|
|
1490
1490
|
boxX: x.value.x,
|
|
1491
1491
|
boxY: x.value.y,
|
|
1492
1492
|
boxSize: x.value.size
|
|
1493
1493
|
};
|
|
1494
1494
|
const K = (W) => {
|
|
1495
|
-
const
|
|
1496
|
-
let
|
|
1497
|
-
const
|
|
1495
|
+
const te = W.clientX || W.touches[0].clientX, se = W.clientY || W.touches[0].clientY, q = te - _.startX, d = se - _.startY, { offsetX: f, offsetY: G, displayWidth: A, displayHeight: H } = j.value;
|
|
1496
|
+
let Y = _.boxSize, re = _.boxX, ye = _.boxY;
|
|
1497
|
+
const Ce = _.boxSize / o.aspectRatio;
|
|
1498
1498
|
switch (w) {
|
|
1499
1499
|
case "se":
|
|
1500
|
-
|
|
1500
|
+
Y = Math.max(x.value.minSize, Math.min(A - (_.boxX - f), H - (_.boxY - G), _.boxSize + Math.max(q, d)));
|
|
1501
1501
|
break;
|
|
1502
1502
|
case "nw":
|
|
1503
|
-
|
|
1503
|
+
Y = Math.max(x.value.minSize, Math.min(_.boxX - f + _.boxSize, _.boxY - G + Ce, _.boxSize - Math.max(q, d))), re = _.boxX + (_.boxSize - Y), ye = _.boxY + (Ce - Y / o.aspectRatio);
|
|
1504
1504
|
break;
|
|
1505
1505
|
case "ne":
|
|
1506
|
-
|
|
1506
|
+
Y = Math.max(x.value.minSize, Math.min(f + A - _.boxX, _.boxY - G + Ce, _.boxSize + Math.max(q, -d))), ye = _.boxY + (Ce - Y / o.aspectRatio);
|
|
1507
1507
|
break;
|
|
1508
1508
|
case "sw":
|
|
1509
|
-
|
|
1509
|
+
Y = Math.max(x.value.minSize, Math.min(_.boxX - f + _.boxSize, G + H - _.boxY, _.boxSize + Math.max(-q, d))), re = _.boxX + (_.boxSize - Y);
|
|
1510
1510
|
break;
|
|
1511
1511
|
case "n":
|
|
1512
|
-
|
|
1512
|
+
Y = Math.max(x.value.minSize, Math.min(_.boxY - G + Ce, _.boxSize - d)), ye = _.boxY + (Ce - Y / o.aspectRatio);
|
|
1513
1513
|
break;
|
|
1514
1514
|
case "s":
|
|
1515
|
-
|
|
1515
|
+
Y = Math.max(x.value.minSize, Math.min(G + H - _.boxY, _.boxSize + d));
|
|
1516
1516
|
break;
|
|
1517
1517
|
case "w":
|
|
1518
|
-
|
|
1518
|
+
Y = Math.max(x.value.minSize, Math.min(_.boxX - f + _.boxSize, _.boxSize - q)), re = _.boxX + (_.boxSize - Y);
|
|
1519
1519
|
break;
|
|
1520
1520
|
case "e":
|
|
1521
|
-
|
|
1521
|
+
Y = Math.max(x.value.minSize, Math.min(f + A - _.boxX, _.boxSize + q));
|
|
1522
1522
|
break;
|
|
1523
1523
|
}
|
|
1524
|
-
x.value.size =
|
|
1524
|
+
x.value.size = Y, x.value.x = re, x.value.y = ye, pe();
|
|
1525
1525
|
}, I = () => {
|
|
1526
1526
|
_ = null, document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", I), document.removeEventListener("touchmove", K), document.removeEventListener("touchend", I);
|
|
1527
1527
|
};
|
|
1528
1528
|
document.addEventListener("mousemove", K), document.addEventListener("mouseup", I), document.addEventListener("touchmove", K, { passive: !1 }), document.addEventListener("touchend", I);
|
|
1529
|
-
},
|
|
1529
|
+
}, ne = () => {
|
|
1530
1530
|
const w = document.createElement("canvas"), V = U.value;
|
|
1531
1531
|
if (!V) return null;
|
|
1532
|
-
const { naturalWidth:
|
|
1533
|
-
return w.width = o.outputSize, w.height = o.outputSize / o.aspectRatio, w.getContext("2d").drawImage(V, d,
|
|
1532
|
+
const { naturalWidth: Z, naturalHeight: F, displayWidth: K, displayHeight: I, offsetX: W, offsetY: te } = j.value, se = Z / K, q = F / I, d = (x.value.x - W) * se, f = (x.value.y - te) * q, G = x.value.size * se, A = x.value.size / o.aspectRatio * q;
|
|
1533
|
+
return w.width = o.outputSize, w.height = o.outputSize / o.aspectRatio, w.getContext("2d").drawImage(V, d, f, G, A, 0, 0, w.width, w.height), new Promise((Y) => {
|
|
1534
1534
|
w.toBlob(
|
|
1535
|
-
(
|
|
1536
|
-
|
|
1535
|
+
(re) => {
|
|
1536
|
+
Y(new File([re], "avatar.jpg", { type: o.outputType }));
|
|
1537
1537
|
},
|
|
1538
1538
|
o.outputType,
|
|
1539
1539
|
o.outputQuality
|
|
@@ -1542,116 +1542,116 @@ const wt = (y, t) => {
|
|
|
1542
1542
|
}, z = () => {
|
|
1543
1543
|
const w = document.createElement("canvas"), V = U.value;
|
|
1544
1544
|
if (!V) return null;
|
|
1545
|
-
const { naturalWidth:
|
|
1546
|
-
return w.width = o.outputSize, w.height = o.outputSize / o.aspectRatio, w.getContext("2d").drawImage(V, d,
|
|
1547
|
-
},
|
|
1545
|
+
const { naturalWidth: Z, naturalHeight: F, displayWidth: K, displayHeight: I, offsetX: W, offsetY: te } = j.value, se = Z / K, q = F / I, d = (x.value.x - W) * se, f = (x.value.y - te) * q, G = x.value.size * se, A = x.value.size / o.aspectRatio * q;
|
|
1546
|
+
return w.width = o.outputSize, w.height = o.outputSize / o.aspectRatio, w.getContext("2d").drawImage(V, d, f, G, A, 0, 0, w.width, w.height), w.toDataURL(o.outputType, o.outputQuality);
|
|
1547
|
+
}, B = async () => {
|
|
1548
1548
|
if (N.value) {
|
|
1549
1549
|
S.value = !0;
|
|
1550
1550
|
try {
|
|
1551
|
-
const w = await
|
|
1552
|
-
w &&
|
|
1551
|
+
const w = await ne(), V = z();
|
|
1552
|
+
w && y("confirm", { file: w, dataUrl: V });
|
|
1553
1553
|
} catch (w) {
|
|
1554
|
-
console.error(w),
|
|
1554
|
+
console.error(w), at.error("生成图片失败");
|
|
1555
1555
|
} finally {
|
|
1556
1556
|
S.value = !1;
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
}, C = () => {
|
|
1560
|
-
|
|
1561
|
-
},
|
|
1562
|
-
|
|
1563
|
-
},
|
|
1560
|
+
y("cancel"), E.value = !1;
|
|
1561
|
+
}, ge = () => {
|
|
1562
|
+
ie(), y("closed");
|
|
1563
|
+
}, ie = () => {
|
|
1564
1564
|
x.value = { x: 0, y: 0, size: 150, minSize: o.minSize };
|
|
1565
1565
|
};
|
|
1566
|
-
return
|
|
1566
|
+
return kt(
|
|
1567
1567
|
() => o.src,
|
|
1568
1568
|
(w) => {
|
|
1569
|
-
w &&
|
|
1569
|
+
w && nt(() => {
|
|
1570
1570
|
U.value && U.value.complete && he();
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
), t({
|
|
1574
|
-
getCroppedImage:
|
|
1574
|
+
getCroppedImage: ne,
|
|
1575
1575
|
getCroppedImageDataUrl: z,
|
|
1576
|
-
reset:
|
|
1576
|
+
reset: ie
|
|
1577
1577
|
}), (w, V) => {
|
|
1578
|
-
const
|
|
1579
|
-
return l(),
|
|
1578
|
+
const Z = Ue("el-empty"), F = Ue("el-button"), K = Ue("el-dialog");
|
|
1579
|
+
return l(), Q(K, {
|
|
1580
1580
|
modelValue: E.value,
|
|
1581
1581
|
"onUpdate:modelValue": V[0] || (V[0] = (I) => E.value = I),
|
|
1582
1582
|
title: "调整头像",
|
|
1583
|
-
width:
|
|
1583
|
+
width: g.dialogWidth,
|
|
1584
1584
|
"close-on-click-modal": !1,
|
|
1585
|
-
"append-to-body":
|
|
1586
|
-
onClosed:
|
|
1585
|
+
"append-to-body": g.appendToBody,
|
|
1586
|
+
onClosed: ge
|
|
1587
1587
|
}, {
|
|
1588
1588
|
footer: v(() => [
|
|
1589
|
-
s("div",
|
|
1590
|
-
i(
|
|
1589
|
+
s("div", wa, [
|
|
1590
|
+
i(F, { onClick: C }, {
|
|
1591
1591
|
default: v(() => [...V[2] || (V[2] = [
|
|
1592
|
-
|
|
1592
|
+
T("取消", -1)
|
|
1593
1593
|
])]),
|
|
1594
1594
|
_: 1
|
|
1595
1595
|
}),
|
|
1596
|
-
i(
|
|
1596
|
+
i(F, {
|
|
1597
1597
|
type: "primary",
|
|
1598
1598
|
loading: S.value,
|
|
1599
1599
|
disabled: !N.value,
|
|
1600
|
-
onClick:
|
|
1600
|
+
onClick: B
|
|
1601
1601
|
}, {
|
|
1602
1602
|
default: v(() => [...V[3] || (V[3] = [
|
|
1603
|
-
|
|
1603
|
+
T(" 确认 ", -1)
|
|
1604
1604
|
])]),
|
|
1605
1605
|
_: 1
|
|
1606
1606
|
}, 8, ["loading", "disabled"])
|
|
1607
1607
|
])
|
|
1608
1608
|
]),
|
|
1609
1609
|
default: v(() => [
|
|
1610
|
-
s("div",
|
|
1611
|
-
N.value ? (l(),
|
|
1610
|
+
s("div", fa, [
|
|
1611
|
+
N.value ? (l(), p("div", ga, [
|
|
1612
1612
|
s("div", {
|
|
1613
1613
|
ref_key: "cropAreaRef",
|
|
1614
|
-
ref:
|
|
1614
|
+
ref: h,
|
|
1615
1615
|
class: "crop-area",
|
|
1616
|
-
style:
|
|
1616
|
+
style: Le({ height: g.cropAreaHeight })
|
|
1617
1617
|
}, [
|
|
1618
1618
|
s("img", {
|
|
1619
1619
|
src: N.value,
|
|
1620
1620
|
ref_key: "imageRef",
|
|
1621
1621
|
ref: U,
|
|
1622
1622
|
onLoad: he,
|
|
1623
|
-
style:
|
|
1624
|
-
}, null, 44,
|
|
1623
|
+
style: Le(de.value)
|
|
1624
|
+
}, null, 44, ya),
|
|
1625
1625
|
s("div", {
|
|
1626
1626
|
class: "crop-box",
|
|
1627
|
-
style:
|
|
1628
|
-
onMousedown:
|
|
1629
|
-
onTouchstart:
|
|
1627
|
+
style: Le(_e.value),
|
|
1628
|
+
onMousedown: fe,
|
|
1629
|
+
onTouchstart: fe
|
|
1630
1630
|
}, [
|
|
1631
|
-
(l(),
|
|
1631
|
+
(l(), p(ue, null, ce(ee, (I) => s("div", {
|
|
1632
1632
|
key: I,
|
|
1633
|
-
class:
|
|
1634
|
-
onMousedown:
|
|
1635
|
-
onTouchstart:
|
|
1636
|
-
}, null, 42,
|
|
1633
|
+
class: ve(["crop-handle", I]),
|
|
1634
|
+
onMousedown: Ee((W) => le(I, W), ["stop"]),
|
|
1635
|
+
onTouchstart: Ee((W) => le(I, W), ["stop"])
|
|
1636
|
+
}, null, 42, ba)), 64))
|
|
1637
1637
|
], 36)
|
|
1638
1638
|
], 4),
|
|
1639
|
-
s("div",
|
|
1639
|
+
s("div", ka, [
|
|
1640
1640
|
V[1] || (V[1] = s("div", { class: "preview-label" }, "预览", -1)),
|
|
1641
1641
|
s("div", {
|
|
1642
1642
|
class: "preview-box",
|
|
1643
|
-
style:
|
|
1643
|
+
style: Le({ width: g.previewSize + "px", height: g.previewSize + "px" })
|
|
1644
1644
|
}, [
|
|
1645
1645
|
s("canvas", {
|
|
1646
1646
|
ref_key: "previewCanvasRef",
|
|
1647
1647
|
ref: $,
|
|
1648
|
-
width:
|
|
1649
|
-
height:
|
|
1648
|
+
width: g.previewSize,
|
|
1649
|
+
height: g.previewSize,
|
|
1650
1650
|
class: "preview-canvas"
|
|
1651
|
-
}, null, 8,
|
|
1651
|
+
}, null, 8, _a)
|
|
1652
1652
|
], 4)
|
|
1653
1653
|
])
|
|
1654
|
-
])) : (l(), Z
|
|
1654
|
+
])) : (l(), Q(Z, {
|
|
1655
1655
|
key: 1,
|
|
1656
1656
|
description: "请上传图片"
|
|
1657
1657
|
}))
|
|
@@ -1661,7 +1661,7 @@ const wt = (y, t) => {
|
|
|
1661
1661
|
}, 8, ["modelValue", "width", "append-to-body"]);
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
},
|
|
1664
|
+
}, Qt = /* @__PURE__ */ _t(Ca, [["__scopeId", "data-v-594eeaf3"]]), xa = { class: "emoji-header" }, Ua = ["onClick"], Ga = { class: "emoji-body" }, Ma = ["onClick"], Sa = {
|
|
1665
1665
|
__name: "EmojiPicker",
|
|
1666
1666
|
props: {
|
|
1667
1667
|
visible: {
|
|
@@ -1670,8 +1670,8 @@ const wt = (y, t) => {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
},
|
|
1672
1672
|
emits: ["select", "close"],
|
|
1673
|
-
setup(
|
|
1674
|
-
const a = t, o = k(0),
|
|
1673
|
+
setup(g, { emit: t }) {
|
|
1674
|
+
const a = t, o = k(0), y = [
|
|
1675
1675
|
{
|
|
1676
1676
|
id: "emoticons",
|
|
1677
1677
|
icon: "😀",
|
|
@@ -2047,531 +2047,467 @@ const wt = (y, t) => {
|
|
|
2047
2047
|
], E = (N) => {
|
|
2048
2048
|
a("select", N);
|
|
2049
2049
|
};
|
|
2050
|
-
return (N,
|
|
2050
|
+
return (N, ee) => g.visible ? (l(), p("div", {
|
|
2051
2051
|
key: 0,
|
|
2052
2052
|
class: "emoji-picker",
|
|
2053
|
-
onClick:
|
|
2053
|
+
onClick: ee[0] || (ee[0] = Ee(() => {
|
|
2054
2054
|
}, ["stop"]))
|
|
2055
2055
|
}, [
|
|
2056
|
-
s("div",
|
|
2057
|
-
(l(),
|
|
2056
|
+
s("div", xa, [
|
|
2057
|
+
(l(), p(ue, null, ce(y, (S, h) => s("div", {
|
|
2058
2058
|
key: S.id,
|
|
2059
|
-
class:
|
|
2060
|
-
onClick: (U) => o.value =
|
|
2061
|
-
},
|
|
2059
|
+
class: ve(["emoji-category-tab", { active: o.value === h }]),
|
|
2060
|
+
onClick: (U) => o.value = h
|
|
2061
|
+
}, M(S.icon), 11, Ua)), 64))
|
|
2062
2062
|
]),
|
|
2063
2063
|
s("div", Ga, [
|
|
2064
|
-
(l(!0),
|
|
2064
|
+
(l(!0), p(ue, null, ce(y[o.value].emojis, (S) => (l(), p("div", {
|
|
2065
2065
|
key: S,
|
|
2066
2066
|
class: "emoji-item",
|
|
2067
|
-
onClick: (
|
|
2068
|
-
},
|
|
2067
|
+
onClick: (h) => E(S)
|
|
2068
|
+
}, M(S), 9, Ma))), 128))
|
|
2069
2069
|
])
|
|
2070
|
-
])) :
|
|
2070
|
+
])) : L("", !0);
|
|
2071
2071
|
}
|
|
2072
|
-
},
|
|
2072
|
+
}, Va = /* @__PURE__ */ _t(Sa, [["__scopeId", "data-v-6ca53096"]]), Ia = { class: "chat-panel" }, za = { class: "chat-sidebar" }, Fa = ["src"], Aa = ["onClick"], Ta = {
|
|
2073
2073
|
key: 0,
|
|
2074
2074
|
class: "sidebar-nav-badge"
|
|
2075
|
-
},
|
|
2075
|
+
}, Na = { class: "chat-content-panel" }, $a = { class: "chat-search-bar" }, Ra = { class: "chat-content-scroll" }, La = { key: 0 }, Ea = ["onClick", "onContextmenu"], Da = { class: "chat-list-avatar-wrapper" }, Ka = ["src", "alt"], Wa = {
|
|
2076
2076
|
key: 0,
|
|
2077
2077
|
class: "chat-list-online-indicator"
|
|
2078
|
-
},
|
|
2078
|
+
}, Ha = { class: "chat-list-info" }, Xa = { class: "chat-list-header" }, Ya = { class: "chat-list-name" }, ja = { class: "chat-list-time" }, qa = { class: "chat-list-preview" }, Oa = { class: "chat-list-last-msg" }, Pa = {
|
|
2079
2079
|
key: 0,
|
|
2080
2080
|
class: "chat-list-unread"
|
|
2081
|
-
},
|
|
2081
|
+
}, Ba = { key: 1 }, Ja = { class: "add-friend-section" }, Qa = { class: "add-friend-icon" }, Za = ["onClick"], en = { class: "chat-list-avatar-wrapper" }, tn = ["src", "alt"], sn = { class: "chat-list-info" }, an = { class: "chat-list-name" }, nn = { key: 2 }, rn = { class: "friend-request-info" }, on = ["src", "alt"], ln = { class: "friend-request-details" }, un = { class: "friend-request-username" }, cn = { key: 3 }, dn = { class: "add-friend-section" }, pn = { class: "add-friend-icon" }, mn = ["onClick"], vn = { class: "chat-list-avatar-wrapper" }, hn = {
|
|
2082
2082
|
key: 0,
|
|
2083
2083
|
class: "group-avatar-grid"
|
|
2084
|
-
},
|
|
2084
|
+
}, fn = ["src", "alt"], gn = ["src", "alt"], yn = { class: "chat-list-info" }, bn = { class: "chat-list-header" }, kn = { class: "chat-list-name" }, _n = { class: "chat-list-time" }, wn = { class: "chat-list-preview" }, Cn = { class: "chat-list-last-msg" }, xn = {
|
|
2085
2085
|
key: 0,
|
|
2086
2086
|
class: "chat-list-unread"
|
|
2087
|
-
},
|
|
2087
|
+
}, Un = { class: "chat-main-area" }, Gn = {
|
|
2088
2088
|
key: 0,
|
|
2089
2089
|
class: "friend-profile-area"
|
|
2090
|
-
},
|
|
2090
|
+
}, Mn = ["src", "alt"], Sn = { class: "profile-name" }, Vn = { class: "profile-status" }, In = {
|
|
2091
2091
|
key: 1,
|
|
2092
2092
|
class: "chat-window-area"
|
|
2093
|
-
},
|
|
2093
|
+
}, zn = { class: "chat-window-header" }, Fn = { class: "chat-window-title" }, An = { class: "chat-window-name" }, Tn = {
|
|
2094
2094
|
key: 1,
|
|
2095
2095
|
class: "chat-window-status"
|
|
2096
|
-
},
|
|
2096
|
+
}, Nn = { class: "chat-window-actions" }, $n = { class: "message-avatar" }, Rn = ["src"], Ln = {
|
|
2097
2097
|
key: 0,
|
|
2098
2098
|
class: "message-sender-name"
|
|
2099
|
-
},
|
|
2099
|
+
}, En = { class: "message-bubble-wrapper" }, Dn = ["onClick"], Kn = ["src", "alt"], Wn = {
|
|
2100
2100
|
key: 0,
|
|
2101
2101
|
class: "message-image-size"
|
|
2102
|
-
},
|
|
2102
|
+
}, Hn = ["onClick"], Xn = { class: "message-file-content" }, Yn = { class: "message-file-icon" }, jn = { class: "message-file-info" }, qn = { class: "message-file-name" }, On = { class: "message-file-meta" }, Pn = { key: 0 }, Bn = {
|
|
2103
2103
|
key: 0,
|
|
2104
2104
|
class: "pending-files-area"
|
|
2105
|
-
},
|
|
2105
|
+
}, Jn = {
|
|
2106
2106
|
key: 0,
|
|
2107
2107
|
class: "pending-image-wrapper"
|
|
2108
|
-
},
|
|
2108
|
+
}, Qn = ["src", "alt"], Zn = ["onClick"], er = {
|
|
2109
2109
|
key: 1,
|
|
2110
2110
|
class: "pending-file-wrapper"
|
|
2111
|
-
},
|
|
2111
|
+
}, tr = { class: "pending-file-name" }, sr = ["onClick"], ar = {
|
|
2112
2112
|
key: 1,
|
|
2113
2113
|
class: "input-toolbar"
|
|
2114
|
-
},
|
|
2114
|
+
}, nr = { class: "emoji-button-wrapper" }, rr = { class: "input-textarea-wrapper" }, or = ["onKeydown"], lr = { class: "input-send-wrapper" }, ir = {
|
|
2115
2115
|
key: 2,
|
|
2116
2116
|
class: "chat-empty-state"
|
|
2117
|
-
},
|
|
2117
|
+
}, ur = { class: "empty-state-text" }, cr = {
|
|
2118
2118
|
key: 0,
|
|
2119
2119
|
class: "group-sidebar"
|
|
2120
|
-
},
|
|
2120
|
+
}, dr = { class: "group-sidebar-header" }, pr = { class: "group-sidebar-content" }, mr = { class: "group-members-avatar-section" }, vr = { class: "group-members-grid" }, hr = ["onClick"], fr = ["src", "alt"], gr = { class: "group-member-nickname" }, yr = { class: "group-member-add-icon" }, br = { class: "group-member-add-icon" }, kr = { class: "group-settings-section" }, _r = {
|
|
2121
2121
|
key: 0,
|
|
2122
2122
|
class: "group-setting-item"
|
|
2123
|
-
},
|
|
2123
|
+
}, wr = { class: "group-setting-value-wrapper" }, Cr = {
|
|
2124
2124
|
key: 0,
|
|
2125
2125
|
class: "group-edit-wrapper"
|
|
2126
|
-
},
|
|
2126
|
+
}, xr = { class: "group-edit-buttons" }, Ur = {
|
|
2127
2127
|
key: 1,
|
|
2128
2128
|
class: "group-setting-item"
|
|
2129
|
-
}, Gr = { class: "group-setting-value-text" },
|
|
2129
|
+
}, Gr = { class: "group-setting-value-text" }, Mr = {
|
|
2130
2130
|
key: 2,
|
|
2131
2131
|
class: "group-setting-item"
|
|
2132
|
-
},
|
|
2132
|
+
}, Sr = { class: "group-setting-value-wrapper" }, Vr = {
|
|
2133
2133
|
key: 0,
|
|
2134
2134
|
class: "group-edit-wrapper"
|
|
2135
|
-
},
|
|
2135
|
+
}, Ir = { class: "group-edit-buttons" }, zr = { class: "group-setting-value-text" }, Fr = {
|
|
2136
2136
|
key: 3,
|
|
2137
2137
|
class: "group-setting-item"
|
|
2138
|
-
}, Ar = { class: "group-setting-value-text" },
|
|
2138
|
+
}, Ar = { class: "group-setting-value-text" }, Tr = {
|
|
2139
2139
|
key: 4,
|
|
2140
2140
|
class: "group-setting-item"
|
|
2141
|
-
},
|
|
2141
|
+
}, Nr = { class: "group-setting-value-wrapper" }, $r = {
|
|
2142
2142
|
key: 0,
|
|
2143
2143
|
class: "group-edit-wrapper"
|
|
2144
|
-
}, Rr = { class: "group-edit-buttons" },
|
|
2144
|
+
}, Rr = { class: "group-edit-buttons" }, Lr = { class: "group-setting-value-text" }, Er = {
|
|
2145
2145
|
key: 5,
|
|
2146
2146
|
class: "group-setting-item"
|
|
2147
|
-
},
|
|
2147
|
+
}, Dr = { class: "group-setting-value-text" }, Kr = { class: "group-setting-value" }, Wr = { class: "group-setting-value-text" }, Hr = { class: "group-setting-item" }, Xr = { class: "group-setting-item" }, Yr = {
|
|
2148
2148
|
key: 0,
|
|
2149
2149
|
class: "chat-detail-panel"
|
|
2150
|
-
},
|
|
2150
|
+
}, jr = { class: "chat-detail-content" }, qr = { class: "chat-detail-profile" }, Or = ["src", "alt"], Pr = { class: "chat-detail-name" }, Br = { class: "add-friend-search-wrapper" }, Jr = { class: "add-friend-users-list" }, Qr = { class: "add-friend-user-info" }, Zr = ["src", "alt"], eo = { class: "add-friend-user-name" }, to = { class: "create-group-form" }, so = { class: "form-item" }, ao = { class: "form-item" }, no = { class: "form-item" }, ro = { class: "member-selection" }, oo = {
|
|
2151
2151
|
key: 1,
|
|
2152
2152
|
class: "member-list"
|
|
2153
|
-
},
|
|
2153
|
+
}, lo = ["onClick"], io = ["src", "alt"], uo = { class: "member-name" }, co = { class: "group-detail-content" }, po = { class: "group-info-section" }, mo = { class: "group-info-item" }, vo = { class: "info-value" }, ho = { class: "group-info-item" }, fo = { class: "info-value" }, go = { class: "group-info-item" }, yo = { class: "info-value" }, bo = {
|
|
2154
2154
|
key: 0,
|
|
2155
2155
|
class: "group-actions-section"
|
|
2156
|
-
},
|
|
2156
|
+
}, ko = { class: "group-actions-list" }, _o = { class: "group-members-section" }, wo = { class: "section-header" }, Co = { class: "group-members-list" }, xo = ["src", "alt"], Uo = { class: "group-member-info" }, Go = { class: "group-member-name" }, Mo = {
|
|
2157
2157
|
key: 0,
|
|
2158
2158
|
class: "group-member-badge"
|
|
2159
|
-
},
|
|
2159
|
+
}, So = {
|
|
2160
2160
|
key: 0,
|
|
2161
2161
|
class: "group-member-actions"
|
|
2162
|
-
},
|
|
2162
|
+
}, Vo = {
|
|
2163
2163
|
key: 1,
|
|
2164
2164
|
class: "group-member-actions"
|
|
2165
|
-
},
|
|
2165
|
+
}, Io = { class: "msg-read-users-content" }, zo = { class: "read-users-section" }, Fo = { class: "section-title" }, Ao = { class: "users-list" }, To = {
|
|
2166
2166
|
key: 1,
|
|
2167
2167
|
class: "users-tag-list"
|
|
2168
|
-
},
|
|
2168
|
+
}, No = { class: "unread-users-section" }, $o = { class: "section-title" }, Ro = { class: "users-list" }, Lo = {
|
|
2169
2169
|
key: 1,
|
|
2170
2170
|
class: "users-tag-list"
|
|
2171
|
-
},
|
|
2171
|
+
}, Eo = { class: "invite-member-content" }, Do = { class: "invite-member-list" }, Ko = {
|
|
2172
2172
|
key: 1,
|
|
2173
2173
|
class: "member-list"
|
|
2174
|
-
},
|
|
2174
|
+
}, Wo = ["onClick"], Ho = ["src", "alt"], Xo = { class: "member-name" }, Yo = { class: "chat-settings-container" }, jo = { class: "chat-settings-avatar-section" }, qo = { class: "chat-settings-avatar-wrapper" }, Oo = ["src"], Po = { class: "chat-settings-user-display" }, Bo = { class: "chat-settings-nickname" }, Jo = { class: "chat-settings-username" }, Qo = { class: "chat-settings-form-section" }, Zo = { class: "chat-settings-form-header" }, el = { class: "chat-settings-form-title" }, tl = { class: "chat-settings-form" }, sl = { class: "chat-settings-form-item" }, al = {
|
|
2175
2175
|
key: 1,
|
|
2176
2176
|
class: "chat-settings-form-value"
|
|
2177
|
-
},
|
|
2177
|
+
}, nl = { class: "chat-settings-form-item" }, rl = {
|
|
2178
2178
|
key: 1,
|
|
2179
2179
|
class: "chat-settings-form-value"
|
|
2180
|
-
},
|
|
2180
|
+
}, ol = { class: "chat-settings-form-item" }, ll = {
|
|
2181
2181
|
key: 1,
|
|
2182
2182
|
class: "chat-settings-form-value"
|
|
2183
|
-
},
|
|
2183
|
+
}, il = { class: "chat-settings-form-item" }, ul = {
|
|
2184
2184
|
key: 1,
|
|
2185
2185
|
class: "chat-settings-form-value bio-value"
|
|
2186
|
-
},
|
|
2186
|
+
}, cl = {
|
|
2187
2187
|
key: 0,
|
|
2188
2188
|
class: "chat-settings-form-actions"
|
|
2189
|
-
},
|
|
2189
|
+
}, dl = {
|
|
2190
2190
|
__name: "ChatPanel",
|
|
2191
2191
|
props: {
|
|
2192
2192
|
config: { type: Object, required: !0 }
|
|
2193
2193
|
},
|
|
2194
2194
|
emits: ["message", "send", "error", "init"],
|
|
2195
|
-
setup(
|
|
2196
|
-
const a =
|
|
2197
|
-
myUsername:
|
|
2195
|
+
setup(g, { emit: t }) {
|
|
2196
|
+
const a = g, o = t, {
|
|
2197
|
+
myUsername: y,
|
|
2198
2198
|
myAvatar: E,
|
|
2199
2199
|
userInfo: N,
|
|
2200
|
-
loadingUserInfo:
|
|
2200
|
+
loadingUserInfo: ee,
|
|
2201
2201
|
friendList: S,
|
|
2202
|
-
filteredFriendList:
|
|
2202
|
+
filteredFriendList: h,
|
|
2203
2203
|
searchText: U,
|
|
2204
2204
|
inputText: $,
|
|
2205
|
-
messagesContainer:
|
|
2205
|
+
messagesContainer: j,
|
|
2206
2206
|
filteredUsers: x,
|
|
2207
|
-
filteredAvailableUsers:
|
|
2208
|
-
currentUser:
|
|
2207
|
+
filteredAvailableUsers: de,
|
|
2208
|
+
currentUser: _e,
|
|
2209
2209
|
currentMessages: D,
|
|
2210
2210
|
addFriendDialogVisible: _,
|
|
2211
2211
|
addFriendSearchText: he,
|
|
2212
|
-
availableUsers:
|
|
2213
|
-
loadingAvailableUsers:
|
|
2214
|
-
friendApplyList:
|
|
2215
|
-
loadingFriendApply:
|
|
2212
|
+
availableUsers: pe,
|
|
2213
|
+
loadingAvailableUsers: fe,
|
|
2214
|
+
friendApplyList: le,
|
|
2215
|
+
loadingFriendApply: ne,
|
|
2216
2216
|
// ========== 群聊相关 ==========
|
|
2217
2217
|
activeTab: z,
|
|
2218
|
-
groupList:
|
|
2218
|
+
groupList: B,
|
|
2219
2219
|
currentSelectGroup: C,
|
|
2220
|
-
groupMsgList:
|
|
2221
|
-
groupMemberList:
|
|
2220
|
+
groupMsgList: ge,
|
|
2221
|
+
groupMemberList: ie,
|
|
2222
2222
|
createGroupDialogVisible: w,
|
|
2223
2223
|
groupDetailVisible: V,
|
|
2224
|
-
newGroupName:
|
|
2225
|
-
newGroupRemark:
|
|
2224
|
+
newGroupName: Z,
|
|
2225
|
+
newGroupRemark: F,
|
|
2226
2226
|
selectedMembersForCreate: K,
|
|
2227
2227
|
inviteMemberDialogVisible: I,
|
|
2228
2228
|
selectedMembersForInvite: W,
|
|
2229
|
-
filteredGroupList:
|
|
2230
|
-
currentChatTarget:
|
|
2231
|
-
currentGroupMessages:
|
|
2229
|
+
filteredGroupList: te,
|
|
2230
|
+
currentChatTarget: se,
|
|
2231
|
+
currentGroupMessages: q,
|
|
2232
2232
|
currentAllMessages: d,
|
|
2233
|
-
groupInfoVisible:
|
|
2234
|
-
editingGroupInfo:
|
|
2235
|
-
editingMemberNick:
|
|
2236
|
-
memberNickDialogVisible:
|
|
2237
|
-
msgReadUserDialogVisible:
|
|
2238
|
-
currentMsgReadList:
|
|
2239
|
-
currentGroupInfo:
|
|
2240
|
-
editingFields:
|
|
2233
|
+
groupInfoVisible: f,
|
|
2234
|
+
editingGroupInfo: G,
|
|
2235
|
+
editingMemberNick: A,
|
|
2236
|
+
memberNickDialogVisible: H,
|
|
2237
|
+
msgReadUserDialogVisible: Y,
|
|
2238
|
+
currentMsgReadList: re,
|
|
2239
|
+
currentGroupInfo: ye,
|
|
2240
|
+
editingFields: Ce,
|
|
2241
2241
|
tempEditValues: Fe,
|
|
2242
2242
|
// ========== 方法 ==========
|
|
2243
|
-
formatTime:
|
|
2244
|
-
formatLastTime:
|
|
2245
|
-
scrollToBottom:
|
|
2246
|
-
getFriendList:
|
|
2247
|
-
getChatHistory:
|
|
2248
|
-
setFriendToChatStatus:
|
|
2249
|
-
selectUser:
|
|
2250
|
-
sendMessage:
|
|
2251
|
-
sendFile:
|
|
2252
|
-
sendFilesAndText:
|
|
2253
|
-
initWebSocket:
|
|
2243
|
+
formatTime: qe,
|
|
2244
|
+
formatLastTime: Oe,
|
|
2245
|
+
scrollToBottom: wt,
|
|
2246
|
+
getFriendList: rt,
|
|
2247
|
+
getChatHistory: Ct,
|
|
2248
|
+
setFriendToChatStatus: Pe,
|
|
2249
|
+
selectUser: ot,
|
|
2250
|
+
sendMessage: lt,
|
|
2251
|
+
sendFile: es,
|
|
2252
|
+
sendFilesAndText: xt,
|
|
2253
|
+
initWebSocket: Ut,
|
|
2254
2254
|
closeWebSocket: Gt,
|
|
2255
2255
|
reset: u,
|
|
2256
2256
|
openAddFriendDialog: c,
|
|
2257
|
-
addFriend:
|
|
2258
|
-
loadFriendApplyList:
|
|
2259
|
-
agreeFriend:
|
|
2260
|
-
updateMyAvatar:
|
|
2257
|
+
addFriend: R,
|
|
2258
|
+
loadFriendApplyList: ae,
|
|
2259
|
+
agreeFriend: me,
|
|
2260
|
+
updateMyAvatar: Ie,
|
|
2261
2261
|
// ========== 群聊相关方法 ==========
|
|
2262
2262
|
getGroupList: Ge,
|
|
2263
|
-
getGroupHistory:
|
|
2264
|
-
getGroupMembers:
|
|
2265
|
-
selectGroup:
|
|
2266
|
-
createGroup:
|
|
2267
|
-
inviteGroupMember:
|
|
2268
|
-
quitGroup:
|
|
2263
|
+
getGroupHistory: De,
|
|
2264
|
+
getGroupMembers: vl,
|
|
2265
|
+
selectGroup: ts,
|
|
2266
|
+
createGroup: ss,
|
|
2267
|
+
inviteGroupMember: as,
|
|
2268
|
+
quitGroup: ns,
|
|
2269
2269
|
sendGroupMessage: hl,
|
|
2270
|
-
sendGroupFile:
|
|
2271
|
-
sendGroupFilesAndText:
|
|
2272
|
-
switchTab:
|
|
2273
|
-
getGroupUnreadCount:
|
|
2274
|
-
getMsgReadUserList:
|
|
2275
|
-
updateGroupInfo:
|
|
2276
|
-
updateMemberNick:
|
|
2277
|
-
deleteGroup:
|
|
2278
|
-
removeGroupMember:
|
|
2279
|
-
transferGroupOwner:
|
|
2280
|
-
readSingleGroupMsg:
|
|
2281
|
-
readAllGroupMsg:
|
|
2282
|
-
openEditGroupInfo:
|
|
2283
|
-
openEditMemberNick:
|
|
2284
|
-
fetchGroupDetail:
|
|
2285
|
-
updateSingleGroupField:
|
|
2286
|
-
startEditField:
|
|
2287
|
-
cancelEditField:
|
|
2288
|
-
saveEditField:
|
|
2289
|
-
} = ha(a.config, (
|
|
2290
|
-
o("message",
|
|
2291
|
-
}),
|
|
2270
|
+
sendGroupFile: fl,
|
|
2271
|
+
sendGroupFilesAndText: rs,
|
|
2272
|
+
switchTab: gl,
|
|
2273
|
+
getGroupUnreadCount: yl,
|
|
2274
|
+
getMsgReadUserList: bl,
|
|
2275
|
+
updateGroupInfo: os,
|
|
2276
|
+
updateMemberNick: ls,
|
|
2277
|
+
deleteGroup: is,
|
|
2278
|
+
removeGroupMember: us,
|
|
2279
|
+
transferGroupOwner: cs,
|
|
2280
|
+
readSingleGroupMsg: kl,
|
|
2281
|
+
readAllGroupMsg: _l,
|
|
2282
|
+
openEditGroupInfo: ds,
|
|
2283
|
+
openEditMemberNick: Be,
|
|
2284
|
+
fetchGroupDetail: ps,
|
|
2285
|
+
updateSingleGroupField: wl,
|
|
2286
|
+
startEditField: it,
|
|
2287
|
+
cancelEditField: ut,
|
|
2288
|
+
saveEditField: ms
|
|
2289
|
+
} = ha(a.config, (m) => {
|
|
2290
|
+
o("message", m);
|
|
2291
|
+
}), vs = be(() => {
|
|
2292
2292
|
var e;
|
|
2293
|
-
const
|
|
2294
|
-
return a.config.modules.friends &&
|
|
2295
|
-
}), Ae = k("chat"),
|
|
2296
|
-
k(null),
|
|
2297
|
-
|
|
2293
|
+
const m = [{ id: "chat", icon: ht, badge: 0 }];
|
|
2294
|
+
return a.config.modules.friends && m.push({ id: "friends", icon: ft, badge: 0 }), a.config.modules.groups && m.push({ id: "groups", icon: ft, badge: 0 }), a.config.modules.apply && m.push({ id: "apply", icon: Js, badge: ((e = le.value) == null ? void 0 : e.length) || 0 }), m;
|
|
2295
|
+
}), Ae = k("chat"), $e = k(null), we = k(null), ke = k(null), Ke = k(!1), ze = k(!1), Me = k({ nickname: "", email: "", phone: "", bio: "" }), ct = k(!1), Je = k(!1), Qe = k(!1), Mt = k(!1), Ze = k(null), dt = k(""), et = k(null), Se = k([]), Te = k({ visible: !1, x: 0, y: 0, chat: null }), We = k(!1), Re = k(!1), St = k(!1);
|
|
2296
|
+
k(null), kt(Re, (m) => {
|
|
2297
|
+
m && C.value && ps(C.value.groupId);
|
|
2298
2298
|
});
|
|
2299
|
-
const hs =
|
|
2300
|
-
const
|
|
2301
|
-
return (
|
|
2302
|
-
}),
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2305
|
-
},
|
|
2306
|
-
|
|
2307
|
-
},
|
|
2308
|
-
|
|
2309
|
-
},
|
|
2310
|
-
if (!
|
|
2311
|
-
await
|
|
2312
|
-
},
|
|
2313
|
-
|
|
2314
|
-
id:
|
|
2315
|
-
name:
|
|
2316
|
-
avatar:
|
|
2317
|
-
online:
|
|
2299
|
+
const hs = be(() => {
|
|
2300
|
+
const m = ie.value.find((e) => e.username === y);
|
|
2301
|
+
return (m == null ? void 0 : m.memberNick) || "";
|
|
2302
|
+
}), fs = () => {
|
|
2303
|
+
const m = ie.value.find((e) => e.username === y);
|
|
2304
|
+
m && Be(m);
|
|
2305
|
+
}, gs = (m, e) => {
|
|
2306
|
+
m.preventDefault(), m.stopPropagation(), Te.value = { visible: !0, x: m.clientX, y: m.clientY, chat: e };
|
|
2307
|
+
}, pt = () => {
|
|
2308
|
+
Te.value.visible = !1;
|
|
2309
|
+
}, ys = async () => {
|
|
2310
|
+
if (!Te.value.chat) return;
|
|
2311
|
+
await Pe(Te.value.chat.id, 0) && $e.value === Te.value.chat.id && ($e.value = null, we.value = null), pt();
|
|
2312
|
+
}, mt = (m) => {
|
|
2313
|
+
$e.value = m.id, we.value = m, ke.value = null, C.value = null, Ke.value = !1, V.value = !1, ot({
|
|
2314
|
+
id: m.id,
|
|
2315
|
+
name: m.name,
|
|
2316
|
+
avatar: m.avatar,
|
|
2317
|
+
online: m.online
|
|
2318
2318
|
});
|
|
2319
|
-
},
|
|
2320
|
-
|
|
2321
|
-
},
|
|
2322
|
-
C.value =
|
|
2323
|
-
},
|
|
2324
|
-
if (!
|
|
2325
|
-
if (await
|
|
2326
|
-
Ae.value = "chat", await
|
|
2327
|
-
const e = x.value.find((
|
|
2328
|
-
e &&
|
|
2319
|
+
}, bs = (m) => {
|
|
2320
|
+
ke.value = m, $e.value = null, we.value = null, C.value = null;
|
|
2321
|
+
}, ks = (m) => {
|
|
2322
|
+
C.value = m, $e.value = null, we.value = null, ke.value = null, Ke.value = !1, V.value = !1, ts(m);
|
|
2323
|
+
}, _s = async () => {
|
|
2324
|
+
if (!ke.value) return;
|
|
2325
|
+
if (await Pe(ke.value.id)) {
|
|
2326
|
+
Ae.value = "chat", await nt();
|
|
2327
|
+
const e = x.value.find((b) => b.id === ke.value.id);
|
|
2328
|
+
e && mt(e), ke.value = null;
|
|
2329
2329
|
}
|
|
2330
|
+
}, ws = () => {
|
|
2331
|
+
Je.value = !0;
|
|
2330
2332
|
}, Cs = () => {
|
|
2331
|
-
|
|
2333
|
+
var m;
|
|
2334
|
+
(m = Ze.value) == null || m.click();
|
|
2332
2335
|
}, xs = () => {
|
|
2333
|
-
var
|
|
2334
|
-
(
|
|
2335
|
-
}, Us = () => {
|
|
2336
|
-
|
|
2337
|
-
(p = tt.value) == null || p.click();
|
|
2338
|
-
}, Ms = (p) => {
|
|
2339
|
-
const e = Array.from(p.target.files || []);
|
|
2336
|
+
var m;
|
|
2337
|
+
(m = et.value) == null || m.click();
|
|
2338
|
+
}, Us = (m) => {
|
|
2339
|
+
const e = Array.from(m.target.files || []);
|
|
2340
2340
|
if (e.length !== 0) {
|
|
2341
|
-
for (const
|
|
2342
|
-
if (
|
|
2343
|
-
|
|
2341
|
+
for (const b of e) {
|
|
2342
|
+
if (b.size > 50 * 1024 * 1024) {
|
|
2343
|
+
at.warning(`文件 ${b.name} 超过50MB,已跳过`);
|
|
2344
2344
|
continue;
|
|
2345
2345
|
}
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2346
|
+
const J = URL.createObjectURL(b);
|
|
2347
|
+
Se.value.push({
|
|
2348
2348
|
id: Date.now() + Math.random(),
|
|
2349
|
-
file:
|
|
2350
|
-
name:
|
|
2351
|
-
size:
|
|
2352
|
-
type:
|
|
2353
|
-
previewUrl:
|
|
2354
|
-
isImage:
|
|
2349
|
+
file: b,
|
|
2350
|
+
name: b.name,
|
|
2351
|
+
size: b.size,
|
|
2352
|
+
type: b.type,
|
|
2353
|
+
previewUrl: J,
|
|
2354
|
+
isImage: b.type.startsWith("image/")
|
|
2355
2355
|
});
|
|
2356
2356
|
}
|
|
2357
|
-
|
|
2357
|
+
et.value && (et.value.value = "");
|
|
2358
2358
|
}
|
|
2359
|
-
},
|
|
2360
|
-
const e =
|
|
2361
|
-
e.previewUrl && URL.revokeObjectURL(e.previewUrl),
|
|
2362
|
-
},
|
|
2363
|
-
if (
|
|
2364
|
-
const e = 1024,
|
|
2365
|
-
return parseFloat((
|
|
2366
|
-
},
|
|
2367
|
-
if (!$.value.trim() &&
|
|
2368
|
-
const
|
|
2369
|
-
$.value = "",
|
|
2370
|
-
|
|
2371
|
-
}),
|
|
2372
|
-
}, Gs = (
|
|
2373
|
-
var
|
|
2374
|
-
const e = (
|
|
2359
|
+
}, Vt = (m) => {
|
|
2360
|
+
const e = Se.value[m];
|
|
2361
|
+
e.previewUrl && URL.revokeObjectURL(e.previewUrl), Se.value.splice(m, 1);
|
|
2362
|
+
}, It = (m) => {
|
|
2363
|
+
if (m === 0) return "0 B";
|
|
2364
|
+
const e = 1024, b = ["B", "KB", "MB", "GB"], J = Math.floor(Math.log(m) / Math.log(e));
|
|
2365
|
+
return parseFloat((m / Math.pow(e, J)).toFixed(2)) + " " + b[J];
|
|
2366
|
+
}, zt = async () => {
|
|
2367
|
+
if (!$.value.trim() && Se.value.length === 0) return;
|
|
2368
|
+
const m = [...Se.value], e = $.value;
|
|
2369
|
+
$.value = "", Se.value.forEach((b) => {
|
|
2370
|
+
b.previewUrl && URL.revokeObjectURL(b.previewUrl);
|
|
2371
|
+
}), Se.value = [], C.value ? await rs(m, e) : await xt(m, e), o("send", { text: e, files: m });
|
|
2372
|
+
}, Gs = (m) => {
|
|
2373
|
+
var b;
|
|
2374
|
+
const e = (b = m.clipboardData) == null ? void 0 : b.items;
|
|
2375
2375
|
if (e) {
|
|
2376
|
-
for (const
|
|
2377
|
-
if (
|
|
2378
|
-
const
|
|
2379
|
-
if (
|
|
2380
|
-
if (
|
|
2381
|
-
|
|
2376
|
+
for (const J of e)
|
|
2377
|
+
if (J.kind === "file") {
|
|
2378
|
+
const oe = J.getAsFile();
|
|
2379
|
+
if (oe) {
|
|
2380
|
+
if (oe.size > 50 * 1024 * 1024) {
|
|
2381
|
+
at.warning(`文件 ${oe.name} 超过50MB,已跳过`);
|
|
2382
2382
|
continue;
|
|
2383
2383
|
}
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2384
|
+
const X = URL.createObjectURL(oe);
|
|
2385
|
+
Se.value.push({
|
|
2386
2386
|
id: Date.now() + Math.random(),
|
|
2387
|
-
file:
|
|
2388
|
-
name:
|
|
2389
|
-
size:
|
|
2390
|
-
type:
|
|
2391
|
-
previewUrl:
|
|
2392
|
-
isImage:
|
|
2387
|
+
file: oe,
|
|
2388
|
+
name: oe.name,
|
|
2389
|
+
size: oe.size,
|
|
2390
|
+
type: oe.type,
|
|
2391
|
+
previewUrl: X,
|
|
2392
|
+
isImage: oe.type.startsWith("image/")
|
|
2393
2393
|
});
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
}, Ft = (
|
|
2398
|
-
if (!
|
|
2399
|
-
|
|
2397
|
+
}, Ft = (m) => {
|
|
2398
|
+
if (!m) {
|
|
2399
|
+
at.warning("文件地址无效");
|
|
2400
2400
|
return;
|
|
2401
2401
|
}
|
|
2402
|
-
window.open(
|
|
2403
|
-
},
|
|
2404
|
-
console.warn("图片加载失败",
|
|
2405
|
-
},
|
|
2406
|
-
$.value +=
|
|
2407
|
-
},
|
|
2408
|
-
const
|
|
2409
|
-
return
|
|
2410
|
-
},
|
|
2411
|
-
const e = K.value.findIndex((
|
|
2412
|
-
e !== -1 ? K.value.splice(e, 1) : K.value.push(
|
|
2413
|
-
},
|
|
2414
|
-
const e = W.value.findIndex((
|
|
2415
|
-
e !== -1 ? W.value.splice(e, 1) : W.value.push(
|
|
2402
|
+
window.open(m, "_blank");
|
|
2403
|
+
}, Ms = (m) => {
|
|
2404
|
+
console.warn("图片加载失败", m);
|
|
2405
|
+
}, Ss = (m) => {
|
|
2406
|
+
$.value += m, We.value = !1;
|
|
2407
|
+
}, Vs = (m, e) => {
|
|
2408
|
+
const b = {};
|
|
2409
|
+
return m === 1 ? (b.width = "100%", b.height = "100%") : m === 2 ? (b.width = "50%", b.height = "100%") : m === 3 && e === 0 ? (b.width = "100%", b.height = "50%") : (b.width = "50%", b.height = "50%"), b;
|
|
2410
|
+
}, Is = (m) => {
|
|
2411
|
+
const e = K.value.findIndex((b) => b.id === m.id);
|
|
2412
|
+
e !== -1 ? K.value.splice(e, 1) : K.value.push(m);
|
|
2413
|
+
}, zs = (m) => {
|
|
2414
|
+
const e = W.value.findIndex((b) => b.id === m.id);
|
|
2415
|
+
e !== -1 ? W.value.splice(e, 1) : W.value.push(m);
|
|
2416
2416
|
}, Fs = async () => {
|
|
2417
|
-
await
|
|
2417
|
+
await ss();
|
|
2418
2418
|
}, As = async () => {
|
|
2419
|
-
await
|
|
2419
|
+
await as();
|
|
2420
2420
|
}, At = async () => {
|
|
2421
|
-
await
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
}).catch(() => {
|
|
2426
|
-
}) && (await rs() ? X.success("已退出群聊") : X.error("退出失败"));
|
|
2427
|
-
}, Nt = async () => {
|
|
2428
|
-
await at.confirm(
|
|
2429
|
-
"确定要解散该群聊吗?此操作不可恢复!",
|
|
2430
|
-
"警告",
|
|
2431
|
-
{
|
|
2432
|
-
confirmButtonText: "确定",
|
|
2433
|
-
cancelButtonText: "取消",
|
|
2434
|
-
type: "warning"
|
|
2435
|
-
}
|
|
2436
|
-
).catch(() => {
|
|
2437
|
-
}) && (await us() ? (X.success("群聊已解散"), Re.value = !1) : X.error("解散失败"));
|
|
2438
|
-
}, Xe = async (p) => {
|
|
2439
|
-
const e = ElLoading.service({
|
|
2440
|
-
lock: !0,
|
|
2441
|
-
text: "保存中...",
|
|
2442
|
-
background: "rgba(0, 0, 0, 0.7)"
|
|
2443
|
-
});
|
|
2421
|
+
await ns();
|
|
2422
|
+
}, Tt = async () => {
|
|
2423
|
+
await is(), Re.value = !1;
|
|
2424
|
+
}, He = async (m) => {
|
|
2444
2425
|
try {
|
|
2445
|
-
await
|
|
2446
|
-
} catch (
|
|
2447
|
-
console.error("保存失败",
|
|
2448
|
-
} finally {
|
|
2449
|
-
e.close();
|
|
2426
|
+
await ms(m);
|
|
2427
|
+
} catch (e) {
|
|
2428
|
+
console.error("保存失败", e);
|
|
2450
2429
|
}
|
|
2451
|
-
},
|
|
2452
|
-
const p = ElLoading.service({
|
|
2453
|
-
lock: !0,
|
|
2454
|
-
text: "保存中...",
|
|
2455
|
-
background: "rgba(0, 0, 0, 0.7)"
|
|
2456
|
-
});
|
|
2430
|
+
}, Ts = async () => {
|
|
2457
2431
|
try {
|
|
2458
|
-
await
|
|
2459
|
-
} catch (
|
|
2460
|
-
console.error("修改失败",
|
|
2461
|
-
} finally {
|
|
2462
|
-
p.close();
|
|
2432
|
+
await ls() && (H.value = !1);
|
|
2433
|
+
} catch (m) {
|
|
2434
|
+
console.error("修改失败", m);
|
|
2463
2435
|
}
|
|
2464
|
-
},
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
confirmButtonText: "确定",
|
|
2470
|
-
cancelButtonText: "取消",
|
|
2471
|
-
type: "warning"
|
|
2472
|
-
}
|
|
2473
|
-
).catch(() => {
|
|
2474
|
-
})) {
|
|
2475
|
-
const g = ElLoading.service({
|
|
2476
|
-
lock: !0,
|
|
2477
|
-
text: "移除中...",
|
|
2478
|
-
background: "rgba(0, 0, 0, 0.7)"
|
|
2479
|
-
});
|
|
2480
|
-
try {
|
|
2481
|
-
await cs(p) ? X.success("成员已移除") : X.error("移除失败");
|
|
2482
|
-
} catch (H) {
|
|
2483
|
-
console.error("移除失败", H), X.error("移除失败");
|
|
2484
|
-
} finally {
|
|
2485
|
-
g.close();
|
|
2486
|
-
}
|
|
2436
|
+
}, Ns = async (m) => {
|
|
2437
|
+
try {
|
|
2438
|
+
await us(m);
|
|
2439
|
+
} catch (e) {
|
|
2440
|
+
console.error("移除失败", e);
|
|
2487
2441
|
}
|
|
2488
|
-
},
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
confirmButtonText: "确定",
|
|
2494
|
-
cancelButtonText: "取消",
|
|
2495
|
-
type: "warning"
|
|
2496
|
-
}
|
|
2497
|
-
).catch(() => {
|
|
2498
|
-
})) {
|
|
2499
|
-
const g = ElLoading.service({
|
|
2500
|
-
lock: !0,
|
|
2501
|
-
text: "转让中...",
|
|
2502
|
-
background: "rgba(0, 0, 0, 0.7)"
|
|
2503
|
-
});
|
|
2504
|
-
try {
|
|
2505
|
-
await ds(p) ? X.success("群主已转让") : X.error("转让失败");
|
|
2506
|
-
} catch (H) {
|
|
2507
|
-
console.error("转让失败", H), X.error("转让失败");
|
|
2508
|
-
} finally {
|
|
2509
|
-
g.close();
|
|
2510
|
-
}
|
|
2442
|
+
}, $s = async (m) => {
|
|
2443
|
+
try {
|
|
2444
|
+
await cs(m);
|
|
2445
|
+
} catch (e) {
|
|
2446
|
+
console.error("转让失败", e);
|
|
2511
2447
|
}
|
|
2512
2448
|
}, Rs = async () => {
|
|
2513
|
-
await
|
|
2514
|
-
},
|
|
2515
|
-
const e =
|
|
2449
|
+
await os();
|
|
2450
|
+
}, Ls = (m) => {
|
|
2451
|
+
const e = m.target.files[0];
|
|
2516
2452
|
if (!e) return;
|
|
2517
2453
|
if (!e.type.startsWith("image/")) {
|
|
2518
|
-
|
|
2454
|
+
console.error("只能上传图片文件");
|
|
2519
2455
|
return;
|
|
2520
2456
|
}
|
|
2521
2457
|
if (e.size > 5 * 1024 * 1024) {
|
|
2522
|
-
|
|
2458
|
+
console.error("图片大小不能超过 5MB");
|
|
2523
2459
|
return;
|
|
2524
2460
|
}
|
|
2525
|
-
const
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
},
|
|
2529
|
-
},
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2461
|
+
const b = new FileReader();
|
|
2462
|
+
b.onload = (J) => {
|
|
2463
|
+
dt.value = J.target.result, Qe.value = !0;
|
|
2464
|
+
}, b.readAsDataURL(e);
|
|
2465
|
+
}, Es = async ({ file: m }) => {
|
|
2466
|
+
if (m) {
|
|
2467
|
+
Mt.value = !0;
|
|
2532
2468
|
try {
|
|
2533
|
-
const { ChatApi: e } = await Promise.resolve().then(() =>
|
|
2534
|
-
|
|
2469
|
+
const { ChatApi: e } = await Promise.resolve().then(() => da), J = await new e(a.config).uploadAvatar(m, y);
|
|
2470
|
+
J.code === 200 && (Ie(J.data), Ds());
|
|
2535
2471
|
} catch (e) {
|
|
2536
|
-
console.error(e)
|
|
2472
|
+
console.error(e);
|
|
2537
2473
|
} finally {
|
|
2538
|
-
|
|
2474
|
+
Mt.value = !1;
|
|
2539
2475
|
}
|
|
2540
2476
|
}
|
|
2477
|
+
}, Ds = () => {
|
|
2478
|
+
dt.value = "", Qe.value = !1, Ze.value && (Ze.value.value = "");
|
|
2541
2479
|
}, Ks = () => {
|
|
2542
|
-
|
|
2543
|
-
}, Ws = () => {
|
|
2544
|
-
Se.value = {
|
|
2480
|
+
Me.value = {
|
|
2545
2481
|
nickname: N.value.nickname || "",
|
|
2546
2482
|
email: N.value.email || "",
|
|
2547
2483
|
phone: N.value.phone || "",
|
|
2548
2484
|
bio: N.value.bio || ""
|
|
2549
|
-
},
|
|
2550
|
-
},
|
|
2551
|
-
|
|
2552
|
-
},
|
|
2553
|
-
|
|
2485
|
+
}, ze.value = !0;
|
|
2486
|
+
}, Ws = () => {
|
|
2487
|
+
ze.value = !1, Me.value = { nickname: "", email: "", phone: "", bio: "" };
|
|
2488
|
+
}, Hs = async () => {
|
|
2489
|
+
ct.value = !0;
|
|
2554
2490
|
try {
|
|
2555
|
-
await updateUserInfo(
|
|
2556
|
-
} catch (
|
|
2557
|
-
console.error(
|
|
2491
|
+
await updateUserInfo(Me.value) && (ze.value = !1);
|
|
2492
|
+
} catch (m) {
|
|
2493
|
+
console.error(m);
|
|
2558
2494
|
} finally {
|
|
2559
|
-
|
|
2495
|
+
ct.value = !1;
|
|
2560
2496
|
}
|
|
2561
2497
|
};
|
|
2562
|
-
return
|
|
2563
|
-
const
|
|
2564
|
-
a.config.modules.groups &&
|
|
2565
|
-
}),
|
|
2566
|
-
u(), Gt(), document.removeEventListener("click",
|
|
2567
|
-
}), (
|
|
2568
|
-
var Rt,
|
|
2569
|
-
const
|
|
2570
|
-
return l(),
|
|
2571
|
-
s("div",
|
|
2498
|
+
return Ys(async () => {
|
|
2499
|
+
const m = [rt(), ae()];
|
|
2500
|
+
a.config.modules.groups && m.push(Ge()), await Promise.all(m), Ut(), x.value.length > 0 && mt(x.value[0]), o("init"), document.addEventListener("click", pt);
|
|
2501
|
+
}), js(() => {
|
|
2502
|
+
u(), Gt(), document.removeEventListener("click", pt);
|
|
2503
|
+
}), (m, e) => {
|
|
2504
|
+
var Rt, Lt, Et;
|
|
2505
|
+
const b = Ue("el-icon"), J = Ue("el-input"), oe = Ue("el-empty"), X = Ue("el-button"), Xs = Ue("el-switch"), Ne = Ue("el-dialog"), Xe = Ue("el-form-item"), Nt = Ue("el-form"), $t = Ue("el-tag");
|
|
2506
|
+
return l(), p("div", Ia, [
|
|
2507
|
+
s("div", za, [
|
|
2572
2508
|
s("div", {
|
|
2573
2509
|
class: "sidebar-avatar",
|
|
2574
|
-
onClick:
|
|
2510
|
+
onClick: ws
|
|
2575
2511
|
}, [
|
|
2576
2512
|
s("img", {
|
|
2577
2513
|
src: r(E),
|
|
@@ -2579,91 +2515,91 @@ const wt = (y, t) => {
|
|
|
2579
2515
|
class: "sidebar-avatar-img"
|
|
2580
2516
|
}, null, 8, Fa)
|
|
2581
2517
|
]),
|
|
2582
|
-
(l(!0),
|
|
2518
|
+
(l(!0), p(ue, null, ce(vs.value, (n) => (l(), p("div", {
|
|
2583
2519
|
key: n.id,
|
|
2584
|
-
class:
|
|
2520
|
+
class: ve([
|
|
2585
2521
|
"sidebar-nav-item",
|
|
2586
2522
|
Ae.value === n.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
|
|
2587
2523
|
]),
|
|
2588
2524
|
onClick: (O) => Ae.value = n.id
|
|
2589
2525
|
}, [
|
|
2590
|
-
i(
|
|
2526
|
+
i(b, { size: 24 }, {
|
|
2591
2527
|
default: v(() => [
|
|
2592
|
-
(l(),
|
|
2528
|
+
(l(), Q(qs(n.icon)))
|
|
2593
2529
|
]),
|
|
2594
2530
|
_: 2
|
|
2595
2531
|
}, 1024),
|
|
2596
|
-
n.badge ? (l(),
|
|
2532
|
+
n.badge ? (l(), p("span", Ta, M(n.badge > 99 ? "99+" : n.badge), 1)) : L("", !0)
|
|
2597
2533
|
], 10, Aa))), 128)),
|
|
2598
2534
|
e[54] || (e[54] = s("div", { class: "sidebar-spacer" }, null, -1)),
|
|
2599
|
-
|
|
2535
|
+
g.config.modules.settings ? (l(), p("div", {
|
|
2600
2536
|
key: 0,
|
|
2601
2537
|
class: "sidebar-nav-item sidebar-nav-item-inactive",
|
|
2602
|
-
onClick: e[0] || (e[0] = (n) =>
|
|
2538
|
+
onClick: e[0] || (e[0] = (n) => Je.value = !0),
|
|
2603
2539
|
title: "设置"
|
|
2604
2540
|
}, [
|
|
2605
|
-
i(
|
|
2541
|
+
i(b, { size: 24 }, {
|
|
2606
2542
|
default: v(() => [
|
|
2607
|
-
i(r(
|
|
2543
|
+
i(r(Qs))
|
|
2608
2544
|
]),
|
|
2609
2545
|
_: 1
|
|
2610
2546
|
})
|
|
2611
|
-
])) :
|
|
2547
|
+
])) : L("", !0)
|
|
2612
2548
|
]),
|
|
2613
|
-
s("div",
|
|
2614
|
-
s("div",
|
|
2615
|
-
i(
|
|
2549
|
+
s("div", Na, [
|
|
2550
|
+
s("div", $a, [
|
|
2551
|
+
i(J, {
|
|
2616
2552
|
modelValue: r(U),
|
|
2617
|
-
"onUpdate:modelValue": e[1] || (e[1] = (n) =>
|
|
2553
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => xe(U) ? U.value = n : null),
|
|
2618
2554
|
placeholder: "搜索",
|
|
2619
|
-
"prefix-icon": r(
|
|
2555
|
+
"prefix-icon": r(gt),
|
|
2620
2556
|
class: "chat-search-input"
|
|
2621
2557
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
2622
2558
|
]),
|
|
2623
2559
|
s("div", Ra, [
|
|
2624
|
-
Ae.value === "chat" ? (l(),
|
|
2625
|
-
(l(!0),
|
|
2560
|
+
Ae.value === "chat" ? (l(), p("div", La, [
|
|
2561
|
+
(l(!0), p(ue, null, ce(r(x), (n) => (l(), p("div", {
|
|
2626
2562
|
key: n.id,
|
|
2627
|
-
class:
|
|
2563
|
+
class: ve([
|
|
2628
2564
|
"chat-list-item",
|
|
2629
|
-
|
|
2565
|
+
$e.value === n.id ? "chat-list-item-active" : ""
|
|
2630
2566
|
]),
|
|
2631
|
-
onClick: (O) =>
|
|
2632
|
-
onContextmenu:
|
|
2567
|
+
onClick: (O) => mt(n),
|
|
2568
|
+
onContextmenu: Ee((O) => gs(O, n), ["prevent", "stop"])
|
|
2633
2569
|
}, [
|
|
2634
|
-
s("div",
|
|
2570
|
+
s("div", Da, [
|
|
2635
2571
|
s("img", {
|
|
2636
2572
|
src: n.avatar,
|
|
2637
2573
|
alt: n.name,
|
|
2638
2574
|
class: "chat-list-avatar"
|
|
2639
|
-
}, null, 8,
|
|
2640
|
-
n.online ? (l(),
|
|
2575
|
+
}, null, 8, Ka),
|
|
2576
|
+
n.online ? (l(), p("span", Wa)) : L("", !0)
|
|
2641
2577
|
]),
|
|
2642
|
-
s("div",
|
|
2643
|
-
s("div",
|
|
2644
|
-
s("span",
|
|
2645
|
-
s("span",
|
|
2578
|
+
s("div", Ha, [
|
|
2579
|
+
s("div", Xa, [
|
|
2580
|
+
s("span", Ya, M(n.name), 1),
|
|
2581
|
+
s("span", ja, M(r(Oe)(n.lastTime)), 1)
|
|
2646
2582
|
]),
|
|
2647
|
-
s("div",
|
|
2648
|
-
s("span",
|
|
2649
|
-
n.unread > 0 ? (l(),
|
|
2583
|
+
s("div", qa, [
|
|
2584
|
+
s("span", Oa, M(n.lastMsg), 1),
|
|
2585
|
+
n.unread > 0 ? (l(), p("span", Pa, M(n.unread > 99 ? "99+" : n.unread), 1)) : L("", !0)
|
|
2650
2586
|
])
|
|
2651
2587
|
])
|
|
2652
|
-
], 42,
|
|
2653
|
-
])) :
|
|
2654
|
-
Ae.value === "friends" &&
|
|
2655
|
-
s("div",
|
|
2588
|
+
], 42, Ea))), 128))
|
|
2589
|
+
])) : L("", !0),
|
|
2590
|
+
Ae.value === "friends" && g.config.modules.friends ? (l(), p("div", Ba, [
|
|
2591
|
+
s("div", Ja, [
|
|
2656
2592
|
s("div", {
|
|
2657
2593
|
class: "add-friend-btn",
|
|
2658
2594
|
onClick: e[2] || (e[2] = (...n) => r(c) && r(c)(...n))
|
|
2659
2595
|
}, [
|
|
2660
|
-
s("div",
|
|
2661
|
-
i(
|
|
2596
|
+
s("div", Qa, [
|
|
2597
|
+
i(b, {
|
|
2662
2598
|
class: "text-white",
|
|
2663
2599
|
size: 20
|
|
2664
2600
|
}, {
|
|
2665
2601
|
default: v(() => [
|
|
2666
|
-
i(r(
|
|
2602
|
+
i(r(Ye))
|
|
2667
2603
|
]),
|
|
2668
2604
|
_: 1
|
|
2669
2605
|
})
|
|
@@ -2671,76 +2607,76 @@ const wt = (y, t) => {
|
|
|
2671
2607
|
e[55] || (e[55] = s("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
2672
2608
|
])
|
|
2673
2609
|
]),
|
|
2674
|
-
(l(!0),
|
|
2610
|
+
(l(!0), p(ue, null, ce(r(h), (n) => (l(), p("div", {
|
|
2675
2611
|
key: n.id,
|
|
2676
2612
|
class: "chat-list-item",
|
|
2677
|
-
onClick: (O) =>
|
|
2613
|
+
onClick: (O) => bs(n)
|
|
2678
2614
|
}, [
|
|
2679
|
-
s("div",
|
|
2615
|
+
s("div", en, [
|
|
2680
2616
|
s("img", {
|
|
2681
2617
|
src: n.avatar,
|
|
2682
2618
|
alt: n.name,
|
|
2683
2619
|
class: "chat-list-avatar"
|
|
2684
|
-
}, null, 8,
|
|
2620
|
+
}, null, 8, tn),
|
|
2685
2621
|
s("span", {
|
|
2686
|
-
class:
|
|
2622
|
+
class: ve([
|
|
2687
2623
|
"chat-list-online-indicator",
|
|
2688
2624
|
n.online ? "chat-list-online" : "chat-list-offline"
|
|
2689
2625
|
])
|
|
2690
2626
|
}, null, 2)
|
|
2691
2627
|
]),
|
|
2692
|
-
s("div",
|
|
2693
|
-
s("span",
|
|
2628
|
+
s("div", sn, [
|
|
2629
|
+
s("span", an, M(n.name), 1)
|
|
2694
2630
|
])
|
|
2695
|
-
], 8,
|
|
2696
|
-
])) :
|
|
2697
|
-
Ae.value === "apply" &&
|
|
2698
|
-
r(
|
|
2631
|
+
], 8, Za))), 128))
|
|
2632
|
+
])) : L("", !0),
|
|
2633
|
+
Ae.value === "apply" && g.config.modules.apply ? (l(), p("div", nn, [
|
|
2634
|
+
r(ne) ? (l(), Q(oe, {
|
|
2699
2635
|
key: 0,
|
|
2700
2636
|
description: "加载中..."
|
|
2701
|
-
})) : r(
|
|
2637
|
+
})) : r(le).length === 0 ? (l(), Q(oe, {
|
|
2702
2638
|
key: 1,
|
|
2703
2639
|
description: "暂无好友申请"
|
|
2704
|
-
})) : (l(!0),
|
|
2640
|
+
})) : (l(!0), p(ue, { key: 2 }, ce(r(le), (n) => (l(), p("div", {
|
|
2705
2641
|
key: n.applyUser || n.id,
|
|
2706
2642
|
class: "friend-request-item"
|
|
2707
2643
|
}, [
|
|
2708
|
-
s("div",
|
|
2644
|
+
s("div", rn, [
|
|
2709
2645
|
s("img", {
|
|
2710
2646
|
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${n.applyUser}`,
|
|
2711
2647
|
alt: n.applyUser,
|
|
2712
2648
|
class: "friend-request-avatar"
|
|
2713
|
-
}, null, 8,
|
|
2714
|
-
s("div",
|
|
2715
|
-
s("div",
|
|
2649
|
+
}, null, 8, on),
|
|
2650
|
+
s("div", ln, [
|
|
2651
|
+
s("div", un, M(n.applyUser), 1),
|
|
2716
2652
|
e[56] || (e[56] = s("div", { class: "friend-request-desc" }, "请求添加你为好友", -1))
|
|
2717
2653
|
])
|
|
2718
2654
|
]),
|
|
2719
|
-
i(
|
|
2655
|
+
i(X, {
|
|
2720
2656
|
type: "primary",
|
|
2721
2657
|
size: "small",
|
|
2722
|
-
onClick: (O) => r(
|
|
2658
|
+
onClick: (O) => r(me)(n.applyUser)
|
|
2723
2659
|
}, {
|
|
2724
2660
|
default: v(() => [...e[57] || (e[57] = [
|
|
2725
|
-
|
|
2661
|
+
T("同意", -1)
|
|
2726
2662
|
])]),
|
|
2727
2663
|
_: 1
|
|
2728
2664
|
}, 8, ["onClick"])
|
|
2729
2665
|
]))), 128))
|
|
2730
|
-
])) :
|
|
2731
|
-
Ae.value === "groups" &&
|
|
2732
|
-
s("div",
|
|
2666
|
+
])) : L("", !0),
|
|
2667
|
+
Ae.value === "groups" && g.config.modules.groups ? (l(), p("div", cn, [
|
|
2668
|
+
s("div", dn, [
|
|
2733
2669
|
s("div", {
|
|
2734
2670
|
class: "add-friend-btn",
|
|
2735
2671
|
onClick: e[3] || (e[3] = (n) => w.value = !0)
|
|
2736
2672
|
}, [
|
|
2737
|
-
s("div",
|
|
2738
|
-
i(
|
|
2673
|
+
s("div", pn, [
|
|
2674
|
+
i(b, {
|
|
2739
2675
|
class: "text-white",
|
|
2740
2676
|
size: 20
|
|
2741
2677
|
}, {
|
|
2742
2678
|
default: v(() => [
|
|
2743
|
-
i(r(
|
|
2679
|
+
i(r(Ye))
|
|
2744
2680
|
]),
|
|
2745
2681
|
_: 1
|
|
2746
2682
|
})
|
|
@@ -2748,76 +2684,76 @@ const wt = (y, t) => {
|
|
|
2748
2684
|
e[58] || (e[58] = s("span", { class: "add-friend-text" }, "创建群聊", -1))
|
|
2749
2685
|
])
|
|
2750
2686
|
]),
|
|
2751
|
-
(l(!0),
|
|
2687
|
+
(l(!0), p(ue, null, ce(r(te), (n) => {
|
|
2752
2688
|
var O;
|
|
2753
|
-
return l(),
|
|
2689
|
+
return l(), p("div", {
|
|
2754
2690
|
key: n.groupId,
|
|
2755
|
-
class:
|
|
2691
|
+
class: ve([
|
|
2756
2692
|
"chat-list-item",
|
|
2757
2693
|
((O = r(C)) == null ? void 0 : O.groupId) === n.groupId ? "chat-list-item-active" : ""
|
|
2758
2694
|
]),
|
|
2759
|
-
onClick: (
|
|
2695
|
+
onClick: (Ve) => ks(n)
|
|
2760
2696
|
}, [
|
|
2761
|
-
s("div",
|
|
2762
|
-
n.memberAvatars && n.memberAvatars.length > 0 ? (l(),
|
|
2763
|
-
(l(!0),
|
|
2764
|
-
key:
|
|
2697
|
+
s("div", vn, [
|
|
2698
|
+
n.memberAvatars && n.memberAvatars.length > 0 ? (l(), p("div", hn, [
|
|
2699
|
+
(l(!0), p(ue, null, ce(n.memberAvatars, (Ve, tt) => (l(), p("div", {
|
|
2700
|
+
key: Ve.username,
|
|
2765
2701
|
class: "group-avatar-item",
|
|
2766
|
-
style:
|
|
2702
|
+
style: Le(Vs(n.memberAvatars.length, tt))
|
|
2767
2703
|
}, [
|
|
2768
2704
|
s("img", {
|
|
2769
|
-
src:
|
|
2770
|
-
alt:
|
|
2705
|
+
src: Ve.avatar,
|
|
2706
|
+
alt: Ve.username,
|
|
2771
2707
|
class: "group-avatar-img"
|
|
2772
|
-
}, null, 8,
|
|
2708
|
+
}, null, 8, fn)
|
|
2773
2709
|
], 4))), 128))
|
|
2774
|
-
])) : (l(),
|
|
2710
|
+
])) : (l(), p("img", {
|
|
2775
2711
|
key: 1,
|
|
2776
2712
|
src: n.avatar,
|
|
2777
2713
|
alt: n.name,
|
|
2778
2714
|
class: "chat-list-avatar"
|
|
2779
|
-
}, null, 8,
|
|
2715
|
+
}, null, 8, gn))
|
|
2780
2716
|
]),
|
|
2781
|
-
s("div",
|
|
2782
|
-
s("div",
|
|
2783
|
-
s("span",
|
|
2784
|
-
s("span",
|
|
2717
|
+
s("div", yn, [
|
|
2718
|
+
s("div", bn, [
|
|
2719
|
+
s("span", kn, M(n.name), 1),
|
|
2720
|
+
s("span", _n, M(r(Oe)(n.lastTime)), 1)
|
|
2785
2721
|
]),
|
|
2786
|
-
s("div",
|
|
2787
|
-
s("span",
|
|
2788
|
-
n.unread > 0 ? (l(),
|
|
2722
|
+
s("div", wn, [
|
|
2723
|
+
s("span", Cn, M(n.lastMsg), 1),
|
|
2724
|
+
n.unread > 0 ? (l(), p("span", xn, M(n.unread > 99 ? "99+" : n.unread), 1)) : L("", !0)
|
|
2789
2725
|
])
|
|
2790
2726
|
])
|
|
2791
|
-
], 10,
|
|
2727
|
+
], 10, mn);
|
|
2792
2728
|
}), 128))
|
|
2793
|
-
])) :
|
|
2729
|
+
])) : L("", !0)
|
|
2794
2730
|
])
|
|
2795
2731
|
]),
|
|
2796
|
-
s("div",
|
|
2797
|
-
|
|
2732
|
+
s("div", Un, [
|
|
2733
|
+
ke.value && !we.value ? (l(), p("div", Gn, [
|
|
2798
2734
|
s("img", {
|
|
2799
|
-
src:
|
|
2800
|
-
alt:
|
|
2735
|
+
src: ke.value.avatar,
|
|
2736
|
+
alt: ke.value.name,
|
|
2801
2737
|
class: "profile-avatar"
|
|
2802
|
-
}, null, 8,
|
|
2803
|
-
s("div",
|
|
2804
|
-
s("div",
|
|
2738
|
+
}, null, 8, Mn),
|
|
2739
|
+
s("div", Sn, M(ke.value.name), 1),
|
|
2740
|
+
s("div", Vn, [
|
|
2805
2741
|
s("span", {
|
|
2806
|
-
class:
|
|
2742
|
+
class: ve([
|
|
2807
2743
|
"profile-status-dot",
|
|
2808
|
-
|
|
2744
|
+
ke.value.online ? "profile-status-online" : "profile-status-offline"
|
|
2809
2745
|
])
|
|
2810
2746
|
}, null, 2),
|
|
2811
|
-
s("span", null,
|
|
2747
|
+
s("span", null, M(ke.value.online ? "在线" : "离线"), 1)
|
|
2812
2748
|
]),
|
|
2813
|
-
i(
|
|
2749
|
+
i(X, {
|
|
2814
2750
|
type: "primary",
|
|
2815
2751
|
size: "large",
|
|
2816
|
-
onClick:
|
|
2752
|
+
onClick: _s,
|
|
2817
2753
|
class: "profile-start-chat-btn"
|
|
2818
2754
|
}, {
|
|
2819
2755
|
default: v(() => [
|
|
2820
|
-
i(
|
|
2756
|
+
i(b, null, {
|
|
2821
2757
|
default: v(() => [
|
|
2822
2758
|
i(r(ht))
|
|
2823
2759
|
]),
|
|
@@ -2827,43 +2763,43 @@ const wt = (y, t) => {
|
|
|
2827
2763
|
]),
|
|
2828
2764
|
_: 1
|
|
2829
2765
|
})
|
|
2830
|
-
])) :
|
|
2831
|
-
|
|
2832
|
-
s("div",
|
|
2766
|
+
])) : L("", !0),
|
|
2767
|
+
we.value || r(C) ? (l(), p("div", In, [
|
|
2768
|
+
s("div", zn, [
|
|
2833
2769
|
s("div", Fn, [
|
|
2834
|
-
s("span", An,
|
|
2835
|
-
r(C) ?
|
|
2770
|
+
s("span", An, M(r(C) ? r(C).name : we.value.name), 1),
|
|
2771
|
+
r(C) ? L("", !0) : (l(), p("span", {
|
|
2836
2772
|
key: 0,
|
|
2837
|
-
class:
|
|
2773
|
+
class: ve([
|
|
2838
2774
|
"chat-window-status",
|
|
2839
|
-
|
|
2775
|
+
we.value.online ? "chat-window-status-online" : "chat-window-status-offline"
|
|
2840
2776
|
])
|
|
2841
|
-
},
|
|
2842
|
-
r(C) ? (l(),
|
|
2777
|
+
}, M(we.value.online ? "在线" : "离线"), 3)),
|
|
2778
|
+
r(C) ? (l(), p("span", Tn, M(r(ie).length) + " 人 ", 1)) : L("", !0)
|
|
2843
2779
|
]),
|
|
2844
|
-
s("div",
|
|
2845
|
-
i(
|
|
2780
|
+
s("div", Nn, [
|
|
2781
|
+
i(b, { class: "chat-action-icon" }, {
|
|
2846
2782
|
default: v(() => [
|
|
2847
|
-
i(r(
|
|
2783
|
+
i(r(gt))
|
|
2848
2784
|
]),
|
|
2849
2785
|
_: 1
|
|
2850
2786
|
}),
|
|
2851
|
-
r(C) ? (l(),
|
|
2787
|
+
r(C) ? (l(), Q(b, {
|
|
2852
2788
|
key: 0,
|
|
2853
2789
|
class: "chat-action-icon",
|
|
2854
2790
|
onClick: e[4] || (e[4] = (n) => Re.value = !Re.value)
|
|
2855
2791
|
}, {
|
|
2856
2792
|
default: v(() => [
|
|
2857
|
-
i(r(
|
|
2793
|
+
i(r(Pt))
|
|
2858
2794
|
]),
|
|
2859
2795
|
_: 1
|
|
2860
|
-
})) : (l(),
|
|
2796
|
+
})) : (l(), Q(b, {
|
|
2861
2797
|
key: 1,
|
|
2862
2798
|
class: "chat-action-icon",
|
|
2863
|
-
onClick: e[5] || (e[5] = (n) =>
|
|
2799
|
+
onClick: e[5] || (e[5] = (n) => Ke.value = !Ke.value)
|
|
2864
2800
|
}, {
|
|
2865
2801
|
default: v(() => [
|
|
2866
|
-
i(r(
|
|
2802
|
+
i(r(Pt))
|
|
2867
2803
|
]),
|
|
2868
2804
|
_: 1
|
|
2869
2805
|
}))
|
|
@@ -2871,263 +2807,263 @@ const wt = (y, t) => {
|
|
|
2871
2807
|
]),
|
|
2872
2808
|
s("div", {
|
|
2873
2809
|
ref_key: "messagesContainer",
|
|
2874
|
-
ref:
|
|
2810
|
+
ref: j,
|
|
2875
2811
|
class: "chat-messages-container"
|
|
2876
2812
|
}, [
|
|
2877
|
-
(l(!0),
|
|
2813
|
+
(l(!0), p(ue, null, ce(r(C) ? r(q) : r(D), (n, O) => (l(), p("div", {
|
|
2878
2814
|
key: O,
|
|
2879
|
-
class:
|
|
2815
|
+
class: ve([
|
|
2880
2816
|
"message-wrapper",
|
|
2881
2817
|
n.isSelf ? "message-self" : "message-other"
|
|
2882
2818
|
])
|
|
2883
2819
|
}, [
|
|
2884
|
-
s("div",
|
|
2820
|
+
s("div", $n, [
|
|
2885
2821
|
s("img", {
|
|
2886
2822
|
src: n.avatar,
|
|
2887
2823
|
class: "message-avatar-img"
|
|
2888
2824
|
}, null, 8, Rn)
|
|
2889
2825
|
]),
|
|
2890
2826
|
s("div", {
|
|
2891
|
-
class:
|
|
2827
|
+
class: ve([
|
|
2892
2828
|
"message-content",
|
|
2893
2829
|
n.isSelf ? "message-content-self" : "message-content-other"
|
|
2894
2830
|
])
|
|
2895
2831
|
}, [
|
|
2896
|
-
n.isSelf ?
|
|
2897
|
-
s("div",
|
|
2898
|
-
n.type === "text" ? (l(),
|
|
2832
|
+
n.isSelf ? L("", !0) : (l(), p("div", Ln, M(r(C) ? n.displayName || n.sendUsername : we.value.name), 1)),
|
|
2833
|
+
s("div", En, [
|
|
2834
|
+
n.type === "text" ? (l(), p("div", {
|
|
2899
2835
|
key: 0,
|
|
2900
|
-
class:
|
|
2836
|
+
class: ve([
|
|
2901
2837
|
"message-bubble",
|
|
2902
2838
|
n.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
2903
2839
|
])
|
|
2904
|
-
},
|
|
2840
|
+
}, M(n.text), 3)) : n.type === "file" && n.fileType === "image" ? (l(), p("div", {
|
|
2905
2841
|
key: 1,
|
|
2906
|
-
class:
|
|
2842
|
+
class: ve([
|
|
2907
2843
|
"message-bubble",
|
|
2908
2844
|
"message-image-bubble",
|
|
2909
2845
|
n.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
2910
2846
|
]),
|
|
2911
|
-
onClick: (
|
|
2847
|
+
onClick: (Ve) => Ft(n.fileUrl)
|
|
2912
2848
|
}, [
|
|
2913
2849
|
s("img", {
|
|
2914
2850
|
src: n.fileUrl,
|
|
2915
2851
|
alt: n.fileName,
|
|
2916
2852
|
class: "message-image",
|
|
2917
|
-
onError:
|
|
2918
|
-
}, null, 40,
|
|
2919
|
-
n.fileSize ? (l(),
|
|
2920
|
-
], 10,
|
|
2853
|
+
onError: Ms
|
|
2854
|
+
}, null, 40, Kn),
|
|
2855
|
+
n.fileSize ? (l(), p("div", Wn, M(It(n.fileSize)), 1)) : L("", !0)
|
|
2856
|
+
], 10, Dn)) : n.type === "file" ? (l(), p("div", {
|
|
2921
2857
|
key: 2,
|
|
2922
|
-
class:
|
|
2858
|
+
class: ve([
|
|
2923
2859
|
"message-bubble",
|
|
2924
2860
|
"message-file-bubble",
|
|
2925
2861
|
n.isSelf ? "message-bubble-self" : "message-bubble-other"
|
|
2926
2862
|
]),
|
|
2927
|
-
onClick: (
|
|
2863
|
+
onClick: (Ve) => Ft(n.fileUrl)
|
|
2928
2864
|
}, [
|
|
2929
|
-
s("div",
|
|
2930
|
-
s("div",
|
|
2931
|
-
i(
|
|
2865
|
+
s("div", Xn, [
|
|
2866
|
+
s("div", Yn, [
|
|
2867
|
+
i(b, { size: 28 }, {
|
|
2932
2868
|
default: v(() => [
|
|
2933
|
-
i(r(
|
|
2869
|
+
i(r(Zs))
|
|
2934
2870
|
]),
|
|
2935
2871
|
_: 1
|
|
2936
2872
|
})
|
|
2937
2873
|
]),
|
|
2938
|
-
s("div",
|
|
2939
|
-
s("div",
|
|
2940
|
-
s("div",
|
|
2941
|
-
i(
|
|
2874
|
+
s("div", jn, [
|
|
2875
|
+
s("div", qn, M(n.fileName || n.text), 1),
|
|
2876
|
+
s("div", On, [
|
|
2877
|
+
i(b, { size: 12 }, {
|
|
2942
2878
|
default: v(() => [
|
|
2943
|
-
i(r(
|
|
2879
|
+
i(r(ea))
|
|
2944
2880
|
]),
|
|
2945
2881
|
_: 1
|
|
2946
2882
|
}),
|
|
2947
2883
|
e[60] || (e[60] = s("span", null, "点击下载", -1)),
|
|
2948
|
-
n.fileSize ? (l(),
|
|
2884
|
+
n.fileSize ? (l(), p("span", Pn, "· " + M(It(n.fileSize)), 1)) : L("", !0)
|
|
2949
2885
|
])
|
|
2950
2886
|
])
|
|
2951
2887
|
])
|
|
2952
|
-
], 10,
|
|
2888
|
+
], 10, Hn)) : L("", !0),
|
|
2953
2889
|
s("div", {
|
|
2954
|
-
class:
|
|
2890
|
+
class: ve([
|
|
2955
2891
|
"message-time",
|
|
2956
2892
|
n.isSelf ? "message-time-right" : "message-time-left"
|
|
2957
2893
|
])
|
|
2958
|
-
},
|
|
2894
|
+
}, M(r(qe)(n.time)), 3)
|
|
2959
2895
|
])
|
|
2960
2896
|
], 2)
|
|
2961
2897
|
], 2))), 128))
|
|
2962
2898
|
], 512),
|
|
2963
2899
|
s("div", {
|
|
2964
2900
|
class: "chat-input-area",
|
|
2965
|
-
onClick: e[8] || (e[8] = (n) =>
|
|
2901
|
+
onClick: e[8] || (e[8] = (n) => We.value = !1)
|
|
2966
2902
|
}, [
|
|
2967
|
-
|
|
2968
|
-
(l(!0),
|
|
2903
|
+
Se.value.length > 0 ? (l(), p("div", Bn, [
|
|
2904
|
+
(l(!0), p(ue, null, ce(Se.value, (n, O) => (l(), p("div", {
|
|
2969
2905
|
key: n.id,
|
|
2970
2906
|
class: "pending-file-item"
|
|
2971
2907
|
}, [
|
|
2972
|
-
n.isImage ? (l(),
|
|
2908
|
+
n.isImage ? (l(), p("div", Jn, [
|
|
2973
2909
|
s("img", {
|
|
2974
2910
|
src: n.previewUrl,
|
|
2975
2911
|
alt: n.name,
|
|
2976
2912
|
class: "pending-image"
|
|
2977
|
-
}, null, 8,
|
|
2913
|
+
}, null, 8, Qn),
|
|
2978
2914
|
s("button", {
|
|
2979
|
-
onClick: (
|
|
2915
|
+
onClick: (Ve) => Vt(O),
|
|
2980
2916
|
class: "pending-file-remove-btn"
|
|
2981
|
-
}, " × ", 8,
|
|
2982
|
-
])) : (l(),
|
|
2983
|
-
i(
|
|
2917
|
+
}, " × ", 8, Zn)
|
|
2918
|
+
])) : (l(), p("div", er, [
|
|
2919
|
+
i(b, { class: "pending-file-icon" }, {
|
|
2984
2920
|
default: v(() => [
|
|
2985
|
-
i(r(
|
|
2921
|
+
i(r(Bt))
|
|
2986
2922
|
]),
|
|
2987
2923
|
_: 1
|
|
2988
2924
|
}),
|
|
2989
|
-
s("span",
|
|
2925
|
+
s("span", tr, M(n.name), 1),
|
|
2990
2926
|
s("button", {
|
|
2991
|
-
onClick: (
|
|
2927
|
+
onClick: (Ve) => Vt(O),
|
|
2992
2928
|
class: "pending-file-remove-btn"
|
|
2993
|
-
}, " × ", 8,
|
|
2929
|
+
}, " × ", 8, sr)
|
|
2994
2930
|
]))
|
|
2995
2931
|
]))), 128))
|
|
2996
|
-
])) :
|
|
2997
|
-
|
|
2998
|
-
s("div",
|
|
2999
|
-
i(
|
|
2932
|
+
])) : L("", !0),
|
|
2933
|
+
g.config.modules.fileUpload ? (l(), p("div", ar, [
|
|
2934
|
+
s("div", nr, [
|
|
2935
|
+
i(b, {
|
|
3000
2936
|
class: "input-toolbar-icon",
|
|
3001
|
-
onClick: e[6] || (e[6] =
|
|
2937
|
+
onClick: e[6] || (e[6] = Ee((n) => We.value = !We.value, ["stop"]))
|
|
3002
2938
|
}, {
|
|
3003
2939
|
default: v(() => [
|
|
3004
2940
|
i(r(ht))
|
|
3005
2941
|
]),
|
|
3006
2942
|
_: 1
|
|
3007
2943
|
}),
|
|
3008
|
-
i(
|
|
3009
|
-
visible:
|
|
3010
|
-
onSelect:
|
|
2944
|
+
i(Va, {
|
|
2945
|
+
visible: We.value,
|
|
2946
|
+
onSelect: Ss
|
|
3011
2947
|
}, null, 8, ["visible"])
|
|
3012
2948
|
]),
|
|
3013
|
-
i(
|
|
2949
|
+
i(b, {
|
|
3014
2950
|
class: "input-toolbar-icon",
|
|
3015
|
-
onClick:
|
|
2951
|
+
onClick: xs
|
|
3016
2952
|
}, {
|
|
3017
2953
|
default: v(() => [
|
|
3018
|
-
i(r(
|
|
2954
|
+
i(r(Bt))
|
|
3019
2955
|
]),
|
|
3020
2956
|
_: 1
|
|
3021
2957
|
}),
|
|
3022
|
-
i(
|
|
2958
|
+
i(b, { class: "input-toolbar-icon" }, {
|
|
3023
2959
|
default: v(() => [
|
|
3024
|
-
i(r(
|
|
2960
|
+
i(r(ta))
|
|
3025
2961
|
]),
|
|
3026
2962
|
_: 1
|
|
3027
2963
|
})
|
|
3028
|
-
])) :
|
|
3029
|
-
s("div",
|
|
3030
|
-
|
|
3031
|
-
"onUpdate:modelValue": e[7] || (e[7] = (n) =>
|
|
3032
|
-
onKeydown:
|
|
2964
|
+
])) : L("", !0),
|
|
2965
|
+
s("div", rr, [
|
|
2966
|
+
Os(s("textarea", {
|
|
2967
|
+
"onUpdate:modelValue": e[7] || (e[7] = (n) => xe($) ? $.value = n : null),
|
|
2968
|
+
onKeydown: vt(Ee(zt, ["prevent"]), ["enter"]),
|
|
3033
2969
|
onPaste: Gs,
|
|
3034
2970
|
placeholder: "输入消息或粘贴文件...",
|
|
3035
2971
|
class: "message-input-textarea",
|
|
3036
2972
|
rows: "3"
|
|
3037
|
-
}, null, 40,
|
|
3038
|
-
[
|
|
2973
|
+
}, null, 40, or), [
|
|
2974
|
+
[Ps, r($)]
|
|
3039
2975
|
])
|
|
3040
2976
|
]),
|
|
3041
|
-
s("div",
|
|
3042
|
-
i(
|
|
2977
|
+
s("div", lr, [
|
|
2978
|
+
i(X, {
|
|
3043
2979
|
type: "primary",
|
|
3044
|
-
disabled: !r($).trim() &&
|
|
3045
|
-
onClick:
|
|
2980
|
+
disabled: !r($).trim() && Se.value.length === 0,
|
|
2981
|
+
onClick: zt,
|
|
3046
2982
|
class: "send-message-btn"
|
|
3047
2983
|
}, {
|
|
3048
2984
|
default: v(() => [...e[61] || (e[61] = [
|
|
3049
|
-
|
|
2985
|
+
T(" 发送 ", -1)
|
|
3050
2986
|
])]),
|
|
3051
2987
|
_: 1
|
|
3052
2988
|
}, 8, ["disabled"])
|
|
3053
2989
|
]),
|
|
3054
2990
|
s("input", {
|
|
3055
2991
|
ref_key: "fileInputRef",
|
|
3056
|
-
ref:
|
|
2992
|
+
ref: et,
|
|
3057
2993
|
type: "file",
|
|
3058
2994
|
multiple: "",
|
|
3059
2995
|
class: "hidden-file-input",
|
|
3060
|
-
onChange:
|
|
2996
|
+
onChange: Us
|
|
3061
2997
|
}, null, 544)
|
|
3062
2998
|
])
|
|
3063
|
-
])) :
|
|
3064
|
-
i(
|
|
2999
|
+
])) : ke.value ? L("", !0) : (l(), p("div", ir, [
|
|
3000
|
+
i(b, {
|
|
3065
3001
|
size: 64,
|
|
3066
3002
|
class: "empty-state-icon"
|
|
3067
3003
|
}, {
|
|
3068
3004
|
default: v(() => [
|
|
3069
|
-
i(r(
|
|
3005
|
+
i(r(sa))
|
|
3070
3006
|
]),
|
|
3071
3007
|
_: 1
|
|
3072
3008
|
}),
|
|
3073
|
-
s("div",
|
|
3009
|
+
s("div", ur, M(Ae.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
3074
3010
|
]))
|
|
3075
3011
|
]),
|
|
3076
|
-
i(
|
|
3012
|
+
i(Bs, { name: "slide" }, {
|
|
3077
3013
|
default: v(() => {
|
|
3078
|
-
var n, O,
|
|
3014
|
+
var n, O, Ve, tt, Dt, Kt, Wt, Ht, Xt, Yt, jt, qt, Ot;
|
|
3079
3015
|
return [
|
|
3080
|
-
Re.value && r(C) ? (l(),
|
|
3081
|
-
s("div",
|
|
3016
|
+
Re.value && r(C) ? (l(), p("div", cr, [
|
|
3017
|
+
s("div", dr, [
|
|
3082
3018
|
e[62] || (e[62] = s("span", { class: "group-sidebar-title" }, "群聊信息", -1)),
|
|
3083
|
-
i(
|
|
3019
|
+
i(b, {
|
|
3084
3020
|
class: "group-sidebar-close",
|
|
3085
|
-
onClick: e[9] || (e[9] = (
|
|
3021
|
+
onClick: e[9] || (e[9] = (P) => Re.value = !1)
|
|
3086
3022
|
}, {
|
|
3087
3023
|
default: v(() => [
|
|
3088
|
-
i(r(
|
|
3024
|
+
i(r(aa))
|
|
3089
3025
|
]),
|
|
3090
3026
|
_: 1
|
|
3091
3027
|
})
|
|
3092
3028
|
]),
|
|
3093
|
-
s("div",
|
|
3094
|
-
s("div",
|
|
3095
|
-
s("div",
|
|
3096
|
-
(l(!0),
|
|
3097
|
-
key:
|
|
3029
|
+
s("div", pr, [
|
|
3030
|
+
s("div", mr, [
|
|
3031
|
+
s("div", vr, [
|
|
3032
|
+
(l(!0), p(ue, null, ce(r(ie).slice(0, 12), (P) => (l(), p("div", {
|
|
3033
|
+
key: P.username,
|
|
3098
3034
|
class: "group-member-avatar-item",
|
|
3099
|
-
onClick: (
|
|
3035
|
+
onClick: (Cl) => r(Be)(P)
|
|
3100
3036
|
}, [
|
|
3101
3037
|
s("img", {
|
|
3102
|
-
src:
|
|
3103
|
-
alt:
|
|
3038
|
+
src: P.avatar ? `${g.config.api.baseUrl}${P.avatar}` : `https://api.dicebear.com/7.x/avataaars/svg?seed=${P.username}`,
|
|
3039
|
+
alt: P.username,
|
|
3104
3040
|
class: "group-member-avatar-small"
|
|
3105
|
-
}, null, 8,
|
|
3106
|
-
s("span",
|
|
3041
|
+
}, null, 8, fr),
|
|
3042
|
+
s("span", gr, M(P.memberNick || P.username), 1)
|
|
3107
3043
|
], 8, hr))), 128)),
|
|
3108
|
-
r(
|
|
3044
|
+
r(ie).length > 12 ? (l(), p("div", {
|
|
3109
3045
|
key: 0,
|
|
3110
3046
|
class: "group-member-avatar-item",
|
|
3111
|
-
onClick: e[10] || (e[10] = (
|
|
3047
|
+
onClick: e[10] || (e[10] = (P) => I.value = !0)
|
|
3112
3048
|
}, [
|
|
3113
|
-
s("div",
|
|
3114
|
-
i(
|
|
3049
|
+
s("div", yr, [
|
|
3050
|
+
i(b, null, {
|
|
3115
3051
|
default: v(() => [
|
|
3116
|
-
i(r(
|
|
3052
|
+
i(r(Ye))
|
|
3117
3053
|
]),
|
|
3118
3054
|
_: 1
|
|
3119
3055
|
})
|
|
3120
3056
|
]),
|
|
3121
3057
|
e[63] || (e[63] = s("span", { class: "group-member-nickname" }, "邀请", -1))
|
|
3122
|
-
])) : (l(),
|
|
3058
|
+
])) : (l(), p("div", {
|
|
3123
3059
|
key: 1,
|
|
3124
3060
|
class: "group-member-avatar-item",
|
|
3125
|
-
onClick: e[11] || (e[11] = (
|
|
3061
|
+
onClick: e[11] || (e[11] = (P) => I.value = !0)
|
|
3126
3062
|
}, [
|
|
3127
|
-
s("div",
|
|
3128
|
-
i(
|
|
3063
|
+
s("div", br, [
|
|
3064
|
+
i(b, null, {
|
|
3129
3065
|
default: v(() => [
|
|
3130
|
-
i(r(
|
|
3066
|
+
i(r(Ye))
|
|
3131
3067
|
]),
|
|
3132
3068
|
_: 1
|
|
3133
3069
|
})
|
|
@@ -3137,198 +3073,198 @@ const wt = (y, t) => {
|
|
|
3137
3073
|
])
|
|
3138
3074
|
]),
|
|
3139
3075
|
e[84] || (e[84] = s("div", { class: "group-divider" }, null, -1)),
|
|
3140
|
-
s("div",
|
|
3141
|
-
((n = r(C)) == null ? void 0 : n.owner) === r(
|
|
3076
|
+
s("div", kr, [
|
|
3077
|
+
((n = r(C)) == null ? void 0 : n.owner) === r(y) ? (l(), p("div", _r, [
|
|
3142
3078
|
e[67] || (e[67] = s("span", { class: "group-setting-label" }, "群聊名称", -1)),
|
|
3143
|
-
s("div",
|
|
3144
|
-
r(
|
|
3145
|
-
i(
|
|
3079
|
+
s("div", wr, [
|
|
3080
|
+
r(Ce).groupNickname ? (l(), p("div", Cr, [
|
|
3081
|
+
i(J, {
|
|
3146
3082
|
modelValue: r(Fe).groupNickname,
|
|
3147
|
-
"onUpdate:modelValue": e[12] || (e[12] = (
|
|
3083
|
+
"onUpdate:modelValue": e[12] || (e[12] = (P) => r(Fe).groupNickname = P),
|
|
3148
3084
|
placeholder: "请输入群聊名称",
|
|
3149
|
-
onKeyup: e[13] || (e[13] =
|
|
3085
|
+
onKeyup: e[13] || (e[13] = vt((P) => He("groupNickname"), ["enter"])),
|
|
3150
3086
|
class: "group-input-edit"
|
|
3151
3087
|
}, null, 8, ["modelValue"]),
|
|
3152
|
-
s("div",
|
|
3153
|
-
i(
|
|
3088
|
+
s("div", xr, [
|
|
3089
|
+
i(X, {
|
|
3154
3090
|
size: "small",
|
|
3155
|
-
onClick: e[14] || (e[14] = (
|
|
3091
|
+
onClick: e[14] || (e[14] = (P) => r(ut)("groupNickname"))
|
|
3156
3092
|
}, {
|
|
3157
3093
|
default: v(() => [...e[65] || (e[65] = [
|
|
3158
|
-
|
|
3094
|
+
T("取消", -1)
|
|
3159
3095
|
])]),
|
|
3160
3096
|
_: 1
|
|
3161
3097
|
}),
|
|
3162
|
-
i(
|
|
3098
|
+
i(X, {
|
|
3163
3099
|
size: "small",
|
|
3164
3100
|
type: "primary",
|
|
3165
|
-
onClick: e[15] || (e[15] = (
|
|
3101
|
+
onClick: e[15] || (e[15] = (P) => He("groupNickname"))
|
|
3166
3102
|
}, {
|
|
3167
3103
|
default: v(() => [...e[66] || (e[66] = [
|
|
3168
|
-
|
|
3104
|
+
T("保存", -1)
|
|
3169
3105
|
])]),
|
|
3170
3106
|
_: 1
|
|
3171
3107
|
})
|
|
3172
3108
|
])
|
|
3173
|
-
])) : (l(),
|
|
3109
|
+
])) : (l(), p("div", {
|
|
3174
3110
|
key: 1,
|
|
3175
3111
|
class: "group-setting-value",
|
|
3176
|
-
onClick: e[16] || (e[16] = (
|
|
3112
|
+
onClick: e[16] || (e[16] = (P) => r(it)("groupNickname"))
|
|
3177
3113
|
}, [
|
|
3178
|
-
s("span", null,
|
|
3179
|
-
i(
|
|
3114
|
+
s("span", null, M(((O = r(ye)) == null ? void 0 : O.groupNickname) || ((Ve = r(ye)) == null ? void 0 : Ve.groupName) || ((tt = r(C)) == null ? void 0 : tt.name) || ""), 1),
|
|
3115
|
+
i(b, null, {
|
|
3180
3116
|
default: v(() => [
|
|
3181
|
-
i(r(
|
|
3117
|
+
i(r(je))
|
|
3182
3118
|
]),
|
|
3183
3119
|
_: 1
|
|
3184
3120
|
})
|
|
3185
3121
|
]))
|
|
3186
3122
|
])
|
|
3187
|
-
])) : (l(),
|
|
3123
|
+
])) : (l(), p("div", Ur, [
|
|
3188
3124
|
e[68] || (e[68] = s("span", { class: "group-setting-label" }, "群聊名称", -1)),
|
|
3189
|
-
s("span", Gr,
|
|
3125
|
+
s("span", Gr, M(((Dt = r(ye)) == null ? void 0 : Dt.groupNickname) || ((Kt = r(ye)) == null ? void 0 : Kt.groupName) || ((Wt = r(C)) == null ? void 0 : Wt.name) || ""), 1)
|
|
3190
3126
|
])),
|
|
3191
|
-
((
|
|
3127
|
+
((Ht = r(C)) == null ? void 0 : Ht.owner) === r(y) ? (l(), p("div", Mr, [
|
|
3192
3128
|
e[71] || (e[71] = s("span", { class: "group-setting-label" }, "群公告", -1)),
|
|
3193
|
-
s("div",
|
|
3194
|
-
r(
|
|
3195
|
-
i(
|
|
3129
|
+
s("div", Sr, [
|
|
3130
|
+
r(Ce).notice ? (l(), p("div", Vr, [
|
|
3131
|
+
i(J, {
|
|
3196
3132
|
modelValue: r(Fe).notice,
|
|
3197
|
-
"onUpdate:modelValue": e[17] || (e[17] = (
|
|
3133
|
+
"onUpdate:modelValue": e[17] || (e[17] = (P) => r(Fe).notice = P),
|
|
3198
3134
|
type: "textarea",
|
|
3199
3135
|
rows: 3,
|
|
3200
3136
|
placeholder: "请输入群公告",
|
|
3201
3137
|
class: "group-input-edit"
|
|
3202
3138
|
}, null, 8, ["modelValue"]),
|
|
3203
|
-
s("div",
|
|
3204
|
-
i(
|
|
3139
|
+
s("div", Ir, [
|
|
3140
|
+
i(X, {
|
|
3205
3141
|
size: "small",
|
|
3206
|
-
onClick: e[18] || (e[18] = (
|
|
3142
|
+
onClick: e[18] || (e[18] = (P) => r(ut)("notice"))
|
|
3207
3143
|
}, {
|
|
3208
3144
|
default: v(() => [...e[69] || (e[69] = [
|
|
3209
|
-
|
|
3145
|
+
T("取消", -1)
|
|
3210
3146
|
])]),
|
|
3211
3147
|
_: 1
|
|
3212
3148
|
}),
|
|
3213
|
-
i(
|
|
3149
|
+
i(X, {
|
|
3214
3150
|
size: "small",
|
|
3215
3151
|
type: "primary",
|
|
3216
|
-
onClick: e[19] || (e[19] = (
|
|
3152
|
+
onClick: e[19] || (e[19] = (P) => He("notice"))
|
|
3217
3153
|
}, {
|
|
3218
3154
|
default: v(() => [...e[70] || (e[70] = [
|
|
3219
|
-
|
|
3155
|
+
T("保存", -1)
|
|
3220
3156
|
])]),
|
|
3221
3157
|
_: 1
|
|
3222
3158
|
})
|
|
3223
3159
|
])
|
|
3224
|
-
])) : (l(),
|
|
3160
|
+
])) : (l(), p("div", {
|
|
3225
3161
|
key: 1,
|
|
3226
3162
|
class: "group-setting-value",
|
|
3227
|
-
onClick: e[20] || (e[20] = (
|
|
3163
|
+
onClick: e[20] || (e[20] = (P) => r(it)("notice"))
|
|
3228
3164
|
}, [
|
|
3229
|
-
s("span",
|
|
3230
|
-
i(
|
|
3165
|
+
s("span", zr, M(((Xt = r(ye)) == null ? void 0 : Xt.notice) || "暂无公告"), 1),
|
|
3166
|
+
i(b, null, {
|
|
3231
3167
|
default: v(() => [
|
|
3232
|
-
i(r(
|
|
3168
|
+
i(r(je))
|
|
3233
3169
|
]),
|
|
3234
3170
|
_: 1
|
|
3235
3171
|
})
|
|
3236
3172
|
]))
|
|
3237
3173
|
])
|
|
3238
|
-
])) : (l(),
|
|
3174
|
+
])) : (l(), p("div", Fr, [
|
|
3239
3175
|
e[72] || (e[72] = s("span", { class: "group-setting-label" }, "群公告", -1)),
|
|
3240
|
-
s("span", Ar,
|
|
3176
|
+
s("span", Ar, M(((Yt = r(ye)) == null ? void 0 : Yt.notice) || "暂无公告"), 1)
|
|
3241
3177
|
])),
|
|
3242
|
-
((
|
|
3178
|
+
((jt = r(C)) == null ? void 0 : jt.owner) === r(y) ? (l(), p("div", Tr, [
|
|
3243
3179
|
e[75] || (e[75] = s("span", { class: "group-setting-label" }, "备注", -1)),
|
|
3244
|
-
s("div",
|
|
3245
|
-
r(
|
|
3246
|
-
i(
|
|
3180
|
+
s("div", Nr, [
|
|
3181
|
+
r(Ce).remark ? (l(), p("div", $r, [
|
|
3182
|
+
i(J, {
|
|
3247
3183
|
modelValue: r(Fe).remark,
|
|
3248
|
-
"onUpdate:modelValue": e[21] || (e[21] = (
|
|
3184
|
+
"onUpdate:modelValue": e[21] || (e[21] = (P) => r(Fe).remark = P),
|
|
3249
3185
|
placeholder: "请输入备注",
|
|
3250
|
-
onKeyup: e[22] || (e[22] =
|
|
3186
|
+
onKeyup: e[22] || (e[22] = vt((P) => He("remark"), ["enter"])),
|
|
3251
3187
|
class: "group-input-edit"
|
|
3252
3188
|
}, null, 8, ["modelValue"]),
|
|
3253
3189
|
s("div", Rr, [
|
|
3254
|
-
i(
|
|
3190
|
+
i(X, {
|
|
3255
3191
|
size: "small",
|
|
3256
|
-
onClick: e[23] || (e[23] = (
|
|
3192
|
+
onClick: e[23] || (e[23] = (P) => r(ut)("remark"))
|
|
3257
3193
|
}, {
|
|
3258
3194
|
default: v(() => [...e[73] || (e[73] = [
|
|
3259
|
-
|
|
3195
|
+
T("取消", -1)
|
|
3260
3196
|
])]),
|
|
3261
3197
|
_: 1
|
|
3262
3198
|
}),
|
|
3263
|
-
i(
|
|
3199
|
+
i(X, {
|
|
3264
3200
|
size: "small",
|
|
3265
3201
|
type: "primary",
|
|
3266
|
-
onClick: e[24] || (e[24] = (
|
|
3202
|
+
onClick: e[24] || (e[24] = (P) => He("remark"))
|
|
3267
3203
|
}, {
|
|
3268
3204
|
default: v(() => [...e[74] || (e[74] = [
|
|
3269
|
-
|
|
3205
|
+
T("保存", -1)
|
|
3270
3206
|
])]),
|
|
3271
3207
|
_: 1
|
|
3272
3208
|
})
|
|
3273
3209
|
])
|
|
3274
|
-
])) : (l(),
|
|
3210
|
+
])) : (l(), p("div", {
|
|
3275
3211
|
key: 1,
|
|
3276
3212
|
class: "group-setting-value",
|
|
3277
|
-
onClick: e[25] || (e[25] = (
|
|
3213
|
+
onClick: e[25] || (e[25] = (P) => r(it)("remark"))
|
|
3278
3214
|
}, [
|
|
3279
|
-
s("span",
|
|
3280
|
-
i(
|
|
3215
|
+
s("span", Lr, M(((qt = r(ye)) == null ? void 0 : qt.remark) || "群聊的备注仅自己可见"), 1),
|
|
3216
|
+
i(b, null, {
|
|
3281
3217
|
default: v(() => [
|
|
3282
|
-
i(r(
|
|
3218
|
+
i(r(je))
|
|
3283
3219
|
]),
|
|
3284
3220
|
_: 1
|
|
3285
3221
|
})
|
|
3286
3222
|
]))
|
|
3287
3223
|
])
|
|
3288
|
-
])) : (l(),
|
|
3224
|
+
])) : (l(), p("div", Er, [
|
|
3289
3225
|
e[76] || (e[76] = s("span", { class: "group-setting-label" }, "备注", -1)),
|
|
3290
|
-
s("span",
|
|
3226
|
+
s("span", Dr, M(((Ot = r(ye)) == null ? void 0 : Ot.remark) || "群聊的备注仅自己可见"), 1)
|
|
3291
3227
|
])),
|
|
3292
3228
|
s("div", {
|
|
3293
3229
|
class: "group-setting-item",
|
|
3294
|
-
onClick:
|
|
3230
|
+
onClick: fs
|
|
3295
3231
|
}, [
|
|
3296
3232
|
e[77] || (e[77] = s("span", { class: "group-setting-label" }, "我在本群的昵称", -1)),
|
|
3297
|
-
s("div",
|
|
3298
|
-
s("span",
|
|
3299
|
-
i(
|
|
3233
|
+
s("div", Kr, [
|
|
3234
|
+
s("span", Wr, M(hs.value || r(y)), 1),
|
|
3235
|
+
i(b, null, {
|
|
3300
3236
|
default: v(() => [
|
|
3301
|
-
i(r(
|
|
3237
|
+
i(r(je))
|
|
3302
3238
|
]),
|
|
3303
3239
|
_: 1
|
|
3304
3240
|
})
|
|
3305
3241
|
])
|
|
3306
3242
|
]),
|
|
3307
3243
|
e[82] || (e[82] = s("div", { class: "group-divider" }, null, -1)),
|
|
3308
|
-
s("div",
|
|
3244
|
+
s("div", Hr, [
|
|
3309
3245
|
e[78] || (e[78] = s("span", { class: "group-setting-label" }, "查找聊天内容", -1)),
|
|
3310
|
-
i(
|
|
3246
|
+
i(b, null, {
|
|
3311
3247
|
default: v(() => [
|
|
3312
|
-
i(r(
|
|
3248
|
+
i(r(na))
|
|
3313
3249
|
]),
|
|
3314
3250
|
_: 1
|
|
3315
3251
|
})
|
|
3316
3252
|
]),
|
|
3317
|
-
s("div",
|
|
3253
|
+
s("div", Xr, [
|
|
3318
3254
|
e[79] || (e[79] = s("span", { class: "group-setting-label" }, "消息免打扰", -1)),
|
|
3319
|
-
i(
|
|
3320
|
-
modelValue:
|
|
3321
|
-
"onUpdate:modelValue": e[26] || (e[26] = (
|
|
3255
|
+
i(Xs, {
|
|
3256
|
+
modelValue: St.value,
|
|
3257
|
+
"onUpdate:modelValue": e[26] || (e[26] = (P) => St.value = P)
|
|
3322
3258
|
}, null, 8, ["modelValue"])
|
|
3323
3259
|
]),
|
|
3324
3260
|
e[83] || (e[83] = s("div", { class: "group-divider" }, null, -1)),
|
|
3325
|
-
r(C).owner === r(
|
|
3261
|
+
r(C).owner === r(y) ? (l(), p("div", {
|
|
3326
3262
|
key: 6,
|
|
3327
3263
|
class: "group-setting-item danger",
|
|
3328
|
-
onClick:
|
|
3264
|
+
onClick: Tt
|
|
3329
3265
|
}, [...e[80] || (e[80] = [
|
|
3330
3266
|
s("span", { class: "group-setting-label" }, "解散群聊", -1)
|
|
3331
|
-
])])) : (l(),
|
|
3267
|
+
])])) : (l(), p("div", {
|
|
3332
3268
|
key: 7,
|
|
3333
3269
|
class: "group-setting-item danger",
|
|
3334
3270
|
onClick: At
|
|
@@ -3337,71 +3273,71 @@ const wt = (y, t) => {
|
|
|
3337
3273
|
])]))
|
|
3338
3274
|
])
|
|
3339
3275
|
])
|
|
3340
|
-
])) :
|
|
3276
|
+
])) : L("", !0)
|
|
3341
3277
|
];
|
|
3342
3278
|
}),
|
|
3343
3279
|
_: 1
|
|
3344
3280
|
}),
|
|
3345
|
-
|
|
3281
|
+
Ke.value ? (l(), p("div", Yr, [
|
|
3346
3282
|
e[86] || (e[86] = s("div", { class: "chat-detail-header" }, "聊天详情", -1)),
|
|
3347
|
-
s("div",
|
|
3348
|
-
s("div",
|
|
3283
|
+
s("div", jr, [
|
|
3284
|
+
s("div", qr, [
|
|
3349
3285
|
s("img", {
|
|
3350
|
-
src: (Rt =
|
|
3351
|
-
alt: (
|
|
3286
|
+
src: (Rt = we.value) == null ? void 0 : Rt.avatar,
|
|
3287
|
+
alt: (Lt = we.value) == null ? void 0 : Lt.name,
|
|
3352
3288
|
class: "chat-detail-avatar"
|
|
3353
|
-
}, null, 8,
|
|
3354
|
-
s("div",
|
|
3289
|
+
}, null, 8, Or),
|
|
3290
|
+
s("div", Pr, M((Et = we.value) == null ? void 0 : Et.name), 1),
|
|
3355
3291
|
e[85] || (e[85] = s("div", { class: "chat-detail-actions" }, [
|
|
3356
3292
|
s("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
|
|
3357
3293
|
s("div", { class: "chat-detail-action-item" }, "清空聊天记录")
|
|
3358
3294
|
], -1))
|
|
3359
3295
|
])
|
|
3360
3296
|
])
|
|
3361
|
-
])) :
|
|
3362
|
-
i(
|
|
3297
|
+
])) : L("", !0),
|
|
3298
|
+
i(Ne, {
|
|
3363
3299
|
modelValue: r(_),
|
|
3364
|
-
"onUpdate:modelValue": e[28] || (e[28] = (n) =>
|
|
3300
|
+
"onUpdate:modelValue": e[28] || (e[28] = (n) => xe(_) ? _.value = n : null),
|
|
3365
3301
|
title: "添加好友",
|
|
3366
3302
|
width: "500px",
|
|
3367
3303
|
"append-to-body": ""
|
|
3368
3304
|
}, {
|
|
3369
3305
|
default: v(() => [
|
|
3370
|
-
s("div",
|
|
3371
|
-
i(
|
|
3306
|
+
s("div", Br, [
|
|
3307
|
+
i(J, {
|
|
3372
3308
|
modelValue: r(he),
|
|
3373
|
-
"onUpdate:modelValue": e[27] || (e[27] = (n) =>
|
|
3309
|
+
"onUpdate:modelValue": e[27] || (e[27] = (n) => xe(he) ? he.value = n : null),
|
|
3374
3310
|
placeholder: "搜索用户",
|
|
3375
|
-
"prefix-icon": r(
|
|
3311
|
+
"prefix-icon": r(gt),
|
|
3376
3312
|
class: "add-friend-search-input"
|
|
3377
3313
|
}, null, 8, ["modelValue", "prefix-icon"])
|
|
3378
3314
|
]),
|
|
3379
|
-
s("div",
|
|
3380
|
-
r(
|
|
3315
|
+
s("div", Jr, [
|
|
3316
|
+
r(fe) ? (l(), Q(oe, {
|
|
3381
3317
|
key: 0,
|
|
3382
3318
|
description: "加载中..."
|
|
3383
|
-
})) : r(
|
|
3319
|
+
})) : r(de).length === 0 ? (l(), Q(oe, {
|
|
3384
3320
|
key: 1,
|
|
3385
3321
|
description: "暂无用户"
|
|
3386
|
-
})) : (l(!0),
|
|
3322
|
+
})) : (l(!0), p(ue, { key: 2 }, ce(r(de), (n) => (l(), p("div", {
|
|
3387
3323
|
key: n.username,
|
|
3388
3324
|
class: "add-friend-user-item"
|
|
3389
3325
|
}, [
|
|
3390
|
-
s("div",
|
|
3326
|
+
s("div", Qr, [
|
|
3391
3327
|
s("img", {
|
|
3392
3328
|
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,
|
|
3393
3329
|
alt: n.username,
|
|
3394
3330
|
class: "add-friend-user-avatar"
|
|
3395
|
-
}, null, 8,
|
|
3396
|
-
s("div",
|
|
3331
|
+
}, null, 8, Zr),
|
|
3332
|
+
s("div", eo, M(n.username), 1)
|
|
3397
3333
|
]),
|
|
3398
|
-
i(
|
|
3334
|
+
i(X, {
|
|
3399
3335
|
type: "primary",
|
|
3400
3336
|
size: "small",
|
|
3401
|
-
onClick: (O) => r(
|
|
3337
|
+
onClick: (O) => r(R)(n)
|
|
3402
3338
|
}, {
|
|
3403
3339
|
default: v(() => [...e[87] || (e[87] = [
|
|
3404
|
-
|
|
3340
|
+
T("添加", -1)
|
|
3405
3341
|
])]),
|
|
3406
3342
|
_: 1
|
|
3407
3343
|
}, 8, ["onClick"])
|
|
@@ -3410,86 +3346,86 @@ const wt = (y, t) => {
|
|
|
3410
3346
|
]),
|
|
3411
3347
|
_: 1
|
|
3412
3348
|
}, 8, ["modelValue"]),
|
|
3413
|
-
i(
|
|
3349
|
+
i(Ne, {
|
|
3414
3350
|
modelValue: r(w),
|
|
3415
|
-
"onUpdate:modelValue": e[32] || (e[32] = (n) =>
|
|
3351
|
+
"onUpdate:modelValue": e[32] || (e[32] = (n) => xe(w) ? w.value = n : null),
|
|
3416
3352
|
title: "创建群聊",
|
|
3417
3353
|
width: "600px",
|
|
3418
3354
|
"append-to-body": ""
|
|
3419
3355
|
}, {
|
|
3420
3356
|
footer: v(() => [
|
|
3421
|
-
i(
|
|
3357
|
+
i(X, {
|
|
3422
3358
|
onClick: e[31] || (e[31] = (n) => w.value = !1)
|
|
3423
3359
|
}, {
|
|
3424
3360
|
default: v(() => [...e[91] || (e[91] = [
|
|
3425
|
-
|
|
3361
|
+
T("取消", -1)
|
|
3426
3362
|
])]),
|
|
3427
3363
|
_: 1
|
|
3428
3364
|
}),
|
|
3429
|
-
i(
|
|
3365
|
+
i(X, {
|
|
3430
3366
|
type: "primary",
|
|
3431
3367
|
onClick: Fs,
|
|
3432
|
-
disabled: !r(
|
|
3368
|
+
disabled: !r(Z).trim()
|
|
3433
3369
|
}, {
|
|
3434
3370
|
default: v(() => [...e[92] || (e[92] = [
|
|
3435
|
-
|
|
3371
|
+
T("创建", -1)
|
|
3436
3372
|
])]),
|
|
3437
3373
|
_: 1
|
|
3438
3374
|
}, 8, ["disabled"])
|
|
3439
3375
|
]),
|
|
3440
3376
|
default: v(() => [
|
|
3441
|
-
s("div",
|
|
3442
|
-
s("div",
|
|
3377
|
+
s("div", to, [
|
|
3378
|
+
s("div", so, [
|
|
3443
3379
|
e[88] || (e[88] = s("label", { class: "form-label" }, "群名称", -1)),
|
|
3444
|
-
i(
|
|
3445
|
-
modelValue: r(
|
|
3446
|
-
"onUpdate:modelValue": e[29] || (e[29] = (n) =>
|
|
3380
|
+
i(J, {
|
|
3381
|
+
modelValue: r(Z),
|
|
3382
|
+
"onUpdate:modelValue": e[29] || (e[29] = (n) => xe(Z) ? Z.value = n : null),
|
|
3447
3383
|
placeholder: "请输入群名称",
|
|
3448
3384
|
maxlength: "50"
|
|
3449
3385
|
}, null, 8, ["modelValue"])
|
|
3450
3386
|
]),
|
|
3451
|
-
s("div",
|
|
3387
|
+
s("div", ao, [
|
|
3452
3388
|
e[89] || (e[89] = s("label", { class: "form-label" }, "群备注", -1)),
|
|
3453
|
-
i(
|
|
3454
|
-
modelValue: r(
|
|
3455
|
-
"onUpdate:modelValue": e[30] || (e[30] = (n) =>
|
|
3389
|
+
i(J, {
|
|
3390
|
+
modelValue: r(F),
|
|
3391
|
+
"onUpdate:modelValue": e[30] || (e[30] = (n) => xe(F) ? F.value = n : null),
|
|
3456
3392
|
type: "textarea",
|
|
3457
3393
|
placeholder: "请输入群备注(可选)",
|
|
3458
3394
|
rows: 3,
|
|
3459
3395
|
maxlength: "200"
|
|
3460
3396
|
}, null, 8, ["modelValue"])
|
|
3461
3397
|
]),
|
|
3462
|
-
s("div",
|
|
3398
|
+
s("div", no, [
|
|
3463
3399
|
e[90] || (e[90] = s("label", { class: "form-label" }, "选择成员", -1)),
|
|
3464
|
-
s("div",
|
|
3465
|
-
r(
|
|
3400
|
+
s("div", ro, [
|
|
3401
|
+
r(h).length === 0 ? (l(), Q(oe, {
|
|
3466
3402
|
key: 0,
|
|
3467
3403
|
description: "暂无好友可以添加"
|
|
3468
|
-
})) : (l(),
|
|
3469
|
-
(l(!0),
|
|
3404
|
+
})) : (l(), p("div", oo, [
|
|
3405
|
+
(l(!0), p(ue, null, ce(r(h), (n) => (l(), p("div", {
|
|
3470
3406
|
key: n.id,
|
|
3471
|
-
class:
|
|
3407
|
+
class: ve([
|
|
3472
3408
|
"member-item",
|
|
3473
3409
|
r(K).some((O) => O.id === n.id) ? "member-selected" : ""
|
|
3474
3410
|
]),
|
|
3475
|
-
onClick: (O) =>
|
|
3411
|
+
onClick: (O) => Is(n)
|
|
3476
3412
|
}, [
|
|
3477
3413
|
s("img", {
|
|
3478
3414
|
src: n.avatar,
|
|
3479
3415
|
alt: n.name,
|
|
3480
3416
|
class: "member-avatar"
|
|
3481
|
-
}, null, 8,
|
|
3482
|
-
s("span",
|
|
3483
|
-
r(K).some((O) => O.id === n.id) ? (l(),
|
|
3417
|
+
}, null, 8, io),
|
|
3418
|
+
s("span", uo, M(n.name), 1),
|
|
3419
|
+
r(K).some((O) => O.id === n.id) ? (l(), Q(b, {
|
|
3484
3420
|
key: 0,
|
|
3485
3421
|
class: "member-check"
|
|
3486
3422
|
}, {
|
|
3487
3423
|
default: v(() => [
|
|
3488
|
-
i(r(
|
|
3424
|
+
i(r(Jt))
|
|
3489
3425
|
]),
|
|
3490
3426
|
_: 1
|
|
3491
|
-
})) :
|
|
3492
|
-
], 10,
|
|
3427
|
+
})) : L("", !0)
|
|
3428
|
+
], 10, lo))), 128))
|
|
3493
3429
|
]))
|
|
3494
3430
|
])
|
|
3495
3431
|
])
|
|
@@ -3497,112 +3433,112 @@ const wt = (y, t) => {
|
|
|
3497
3433
|
]),
|
|
3498
3434
|
_: 1
|
|
3499
3435
|
}, 8, ["modelValue"]),
|
|
3500
|
-
r(C) ? (l(),
|
|
3436
|
+
r(C) ? (l(), Q(Ne, {
|
|
3501
3437
|
key: 1,
|
|
3502
3438
|
modelValue: r(V),
|
|
3503
|
-
"onUpdate:modelValue": e[35] || (e[35] = (n) =>
|
|
3439
|
+
"onUpdate:modelValue": e[35] || (e[35] = (n) => xe(V) ? V.value = n : null),
|
|
3504
3440
|
title: r(C).name,
|
|
3505
3441
|
width: "500px",
|
|
3506
3442
|
"append-to-body": ""
|
|
3507
3443
|
}, {
|
|
3508
3444
|
footer: v(() => [
|
|
3509
|
-
i(
|
|
3445
|
+
i(X, {
|
|
3510
3446
|
onClick: e[34] || (e[34] = (n) => V.value = !1)
|
|
3511
3447
|
}, {
|
|
3512
3448
|
default: v(() => [...e[105] || (e[105] = [
|
|
3513
|
-
|
|
3449
|
+
T("关闭", -1)
|
|
3514
3450
|
])]),
|
|
3515
3451
|
_: 1
|
|
3516
3452
|
}),
|
|
3517
|
-
i(
|
|
3453
|
+
i(X, {
|
|
3518
3454
|
type: "danger",
|
|
3519
3455
|
onClick: At
|
|
3520
3456
|
}, {
|
|
3521
3457
|
default: v(() => [...e[106] || (e[106] = [
|
|
3522
|
-
|
|
3458
|
+
T("退出群聊", -1)
|
|
3523
3459
|
])]),
|
|
3524
3460
|
_: 1
|
|
3525
3461
|
})
|
|
3526
3462
|
]),
|
|
3527
3463
|
default: v(() => [
|
|
3528
|
-
s("div",
|
|
3529
|
-
s("div",
|
|
3530
|
-
s("div",
|
|
3464
|
+
s("div", co, [
|
|
3465
|
+
s("div", po, [
|
|
3466
|
+
s("div", mo, [
|
|
3531
3467
|
e[93] || (e[93] = s("span", { class: "info-label" }, "群ID", -1)),
|
|
3532
|
-
s("span",
|
|
3468
|
+
s("span", vo, M(r(C).groupId), 1)
|
|
3533
3469
|
]),
|
|
3534
3470
|
s("div", ho, [
|
|
3535
3471
|
e[94] || (e[94] = s("span", { class: "info-label" }, "群主", -1)),
|
|
3536
|
-
s("span",
|
|
3472
|
+
s("span", fo, M(r(C).owner), 1)
|
|
3537
3473
|
]),
|
|
3538
|
-
s("div",
|
|
3474
|
+
s("div", go, [
|
|
3539
3475
|
e[95] || (e[95] = s("span", { class: "info-label" }, "成员数", -1)),
|
|
3540
|
-
s("span",
|
|
3476
|
+
s("span", yo, M(r(ie).length), 1)
|
|
3541
3477
|
])
|
|
3542
3478
|
]),
|
|
3543
|
-
r(C).owner === r(
|
|
3479
|
+
r(C).owner === r(y) ? (l(), p("div", bo, [
|
|
3544
3480
|
e[98] || (e[98] = s("div", { class: "section-header" }, [
|
|
3545
3481
|
s("span", { class: "section-title" }, "群管理")
|
|
3546
3482
|
], -1)),
|
|
3547
|
-
s("div",
|
|
3548
|
-
i(
|
|
3483
|
+
s("div", ko, [
|
|
3484
|
+
i(X, {
|
|
3549
3485
|
type: "primary",
|
|
3550
3486
|
size: "small",
|
|
3551
|
-
onClick: r(
|
|
3487
|
+
onClick: r(ds)
|
|
3552
3488
|
}, {
|
|
3553
3489
|
default: v(() => [
|
|
3554
|
-
i(
|
|
3490
|
+
i(b, null, {
|
|
3555
3491
|
default: v(() => [
|
|
3556
|
-
i(r(
|
|
3492
|
+
i(r(je))
|
|
3557
3493
|
]),
|
|
3558
3494
|
_: 1
|
|
3559
3495
|
}),
|
|
3560
|
-
e[96] || (e[96] =
|
|
3496
|
+
e[96] || (e[96] = T("编辑群信息 ", -1))
|
|
3561
3497
|
]),
|
|
3562
3498
|
_: 1
|
|
3563
3499
|
}, 8, ["onClick"]),
|
|
3564
|
-
i(
|
|
3500
|
+
i(X, {
|
|
3565
3501
|
type: "danger",
|
|
3566
3502
|
size: "small",
|
|
3567
|
-
onClick:
|
|
3503
|
+
onClick: Tt
|
|
3568
3504
|
}, {
|
|
3569
3505
|
default: v(() => [
|
|
3570
|
-
i(
|
|
3506
|
+
i(b, null, {
|
|
3571
3507
|
default: v(() => [
|
|
3572
|
-
i(r(
|
|
3508
|
+
i(r(ra))
|
|
3573
3509
|
]),
|
|
3574
3510
|
_: 1
|
|
3575
3511
|
}),
|
|
3576
|
-
e[97] || (e[97] =
|
|
3512
|
+
e[97] || (e[97] = T("解散群聊 ", -1))
|
|
3577
3513
|
]),
|
|
3578
3514
|
_: 1
|
|
3579
3515
|
})
|
|
3580
3516
|
])
|
|
3581
|
-
])) :
|
|
3582
|
-
s("div",
|
|
3583
|
-
s("div",
|
|
3517
|
+
])) : L("", !0),
|
|
3518
|
+
s("div", _o, [
|
|
3519
|
+
s("div", wo, [
|
|
3584
3520
|
e[100] || (e[100] = s("span", { class: "section-title" }, "群成员", -1)),
|
|
3585
|
-
i(
|
|
3521
|
+
i(X, {
|
|
3586
3522
|
size: "small",
|
|
3587
3523
|
onClick: e[33] || (e[33] = (n) => I.value = !0)
|
|
3588
3524
|
}, {
|
|
3589
3525
|
default: v(() => [
|
|
3590
|
-
i(
|
|
3526
|
+
i(b, null, {
|
|
3591
3527
|
default: v(() => [
|
|
3592
|
-
i(r(
|
|
3528
|
+
i(r(Ye))
|
|
3593
3529
|
]),
|
|
3594
3530
|
_: 1
|
|
3595
3531
|
}),
|
|
3596
|
-
e[99] || (e[99] =
|
|
3532
|
+
e[99] || (e[99] = T("邀请成员 ", -1))
|
|
3597
3533
|
]),
|
|
3598
3534
|
_: 1
|
|
3599
3535
|
})
|
|
3600
3536
|
]),
|
|
3601
|
-
s("div",
|
|
3602
|
-
r(
|
|
3537
|
+
s("div", Co, [
|
|
3538
|
+
r(ie).length === 0 ? (l(), Q(oe, {
|
|
3603
3539
|
key: 0,
|
|
3604
3540
|
description: "暂无成员"
|
|
3605
|
-
})) : (l(!0),
|
|
3541
|
+
})) : (l(!0), p(ue, { key: 1 }, ce(r(ie), (n) => (l(), p("div", {
|
|
3606
3542
|
key: n.id || n.username,
|
|
3607
3543
|
class: "group-member-item"
|
|
3608
3544
|
}, [
|
|
@@ -3610,108 +3546,108 @@ const wt = (y, t) => {
|
|
|
3610
3546
|
src: n.avatar ? `${a.config.api.baseUrl}${n.avatar}` : `https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,
|
|
3611
3547
|
alt: n.username,
|
|
3612
3548
|
class: "group-member-avatar"
|
|
3613
|
-
}, null, 8,
|
|
3614
|
-
s("div",
|
|
3615
|
-
s("span", Go,
|
|
3616
|
-
n.username === r(C).owner ? (l(),
|
|
3549
|
+
}, null, 8, xo),
|
|
3550
|
+
s("div", Uo, [
|
|
3551
|
+
s("span", Go, M(n.memberNick || n.username), 1),
|
|
3552
|
+
n.username === r(C).owner ? (l(), p("span", Mo, "群主")) : L("", !0)
|
|
3617
3553
|
]),
|
|
3618
|
-
r(C).owner === r(
|
|
3619
|
-
i(
|
|
3554
|
+
r(C).owner === r(y) && n.username !== r(y) ? (l(), p("div", So, [
|
|
3555
|
+
i(X, {
|
|
3620
3556
|
size: "small",
|
|
3621
3557
|
link: "",
|
|
3622
|
-
onClick: (O) => r(
|
|
3558
|
+
onClick: (O) => r(Be)(n)
|
|
3623
3559
|
}, {
|
|
3624
3560
|
default: v(() => [...e[101] || (e[101] = [
|
|
3625
|
-
|
|
3561
|
+
T(" 改昵称 ", -1)
|
|
3626
3562
|
])]),
|
|
3627
3563
|
_: 1
|
|
3628
3564
|
}, 8, ["onClick"]),
|
|
3629
|
-
i(
|
|
3565
|
+
i(X, {
|
|
3630
3566
|
size: "small",
|
|
3631
3567
|
link: "",
|
|
3632
3568
|
type: "danger",
|
|
3633
|
-
onClick: (O) =>
|
|
3569
|
+
onClick: (O) => Ns(n.username)
|
|
3634
3570
|
}, {
|
|
3635
3571
|
default: v(() => [...e[102] || (e[102] = [
|
|
3636
|
-
|
|
3572
|
+
T(" 移除 ", -1)
|
|
3637
3573
|
])]),
|
|
3638
3574
|
_: 1
|
|
3639
3575
|
}, 8, ["onClick"]),
|
|
3640
|
-
i(
|
|
3576
|
+
i(X, {
|
|
3641
3577
|
size: "small",
|
|
3642
3578
|
link: "",
|
|
3643
3579
|
type: "warning",
|
|
3644
|
-
onClick: (O) =>
|
|
3580
|
+
onClick: (O) => $s(n.username)
|
|
3645
3581
|
}, {
|
|
3646
3582
|
default: v(() => [...e[103] || (e[103] = [
|
|
3647
|
-
|
|
3583
|
+
T(" 转让 ", -1)
|
|
3648
3584
|
])]),
|
|
3649
3585
|
_: 1
|
|
3650
3586
|
}, 8, ["onClick"])
|
|
3651
|
-
])) : n.username === r(
|
|
3652
|
-
i(
|
|
3587
|
+
])) : n.username === r(y) ? (l(), p("div", Vo, [
|
|
3588
|
+
i(X, {
|
|
3653
3589
|
size: "small",
|
|
3654
3590
|
link: "",
|
|
3655
|
-
onClick: (O) => r(
|
|
3591
|
+
onClick: (O) => r(Be)(n)
|
|
3656
3592
|
}, {
|
|
3657
3593
|
default: v(() => [...e[104] || (e[104] = [
|
|
3658
|
-
|
|
3594
|
+
T(" 改昵称 ", -1)
|
|
3659
3595
|
])]),
|
|
3660
3596
|
_: 1
|
|
3661
3597
|
}, 8, ["onClick"])
|
|
3662
|
-
])) :
|
|
3598
|
+
])) : L("", !0)
|
|
3663
3599
|
]))), 128))
|
|
3664
3600
|
])
|
|
3665
3601
|
])
|
|
3666
3602
|
])
|
|
3667
3603
|
]),
|
|
3668
3604
|
_: 1
|
|
3669
|
-
}, 8, ["modelValue", "title"])) :
|
|
3670
|
-
r(C) ? (l(),
|
|
3605
|
+
}, 8, ["modelValue", "title"])) : L("", !0),
|
|
3606
|
+
r(C) ? (l(), Q(Ne, {
|
|
3671
3607
|
key: 2,
|
|
3672
|
-
modelValue: r(
|
|
3673
|
-
"onUpdate:modelValue": e[40] || (e[40] = (n) =>
|
|
3608
|
+
modelValue: r(f),
|
|
3609
|
+
"onUpdate:modelValue": e[40] || (e[40] = (n) => xe(f) ? f.value = n : null),
|
|
3674
3610
|
title: "编辑群信息",
|
|
3675
3611
|
width: "500px",
|
|
3676
3612
|
"append-to-body": ""
|
|
3677
3613
|
}, {
|
|
3678
3614
|
footer: v(() => [
|
|
3679
|
-
i(
|
|
3680
|
-
onClick: e[39] || (e[39] = (n) =>
|
|
3615
|
+
i(X, {
|
|
3616
|
+
onClick: e[39] || (e[39] = (n) => f.value = !1)
|
|
3681
3617
|
}, {
|
|
3682
3618
|
default: v(() => [...e[107] || (e[107] = [
|
|
3683
|
-
|
|
3619
|
+
T("取消", -1)
|
|
3684
3620
|
])]),
|
|
3685
3621
|
_: 1
|
|
3686
3622
|
}),
|
|
3687
|
-
i(
|
|
3623
|
+
i(X, {
|
|
3688
3624
|
type: "primary",
|
|
3689
3625
|
onClick: Rs
|
|
3690
3626
|
}, {
|
|
3691
3627
|
default: v(() => [...e[108] || (e[108] = [
|
|
3692
|
-
|
|
3628
|
+
T("保存", -1)
|
|
3693
3629
|
])]),
|
|
3694
3630
|
_: 1
|
|
3695
3631
|
})
|
|
3696
3632
|
]),
|
|
3697
3633
|
default: v(() => [
|
|
3698
|
-
i(
|
|
3634
|
+
i(Nt, { "label-width": "80px" }, {
|
|
3699
3635
|
default: v(() => [
|
|
3700
|
-
i(
|
|
3636
|
+
i(Xe, { label: "群名称" }, {
|
|
3701
3637
|
default: v(() => [
|
|
3702
|
-
i(
|
|
3703
|
-
modelValue: r(
|
|
3704
|
-
"onUpdate:modelValue": e[36] || (e[36] = (n) => r(
|
|
3638
|
+
i(J, {
|
|
3639
|
+
modelValue: r(G).groupNickname,
|
|
3640
|
+
"onUpdate:modelValue": e[36] || (e[36] = (n) => r(G).groupNickname = n),
|
|
3705
3641
|
placeholder: "请输入群名称"
|
|
3706
3642
|
}, null, 8, ["modelValue"])
|
|
3707
3643
|
]),
|
|
3708
3644
|
_: 1
|
|
3709
3645
|
}),
|
|
3710
|
-
i(
|
|
3646
|
+
i(Xe, { label: "群备注" }, {
|
|
3711
3647
|
default: v(() => [
|
|
3712
|
-
i(
|
|
3713
|
-
modelValue: r(
|
|
3714
|
-
"onUpdate:modelValue": e[37] || (e[37] = (n) => r(
|
|
3648
|
+
i(J, {
|
|
3649
|
+
modelValue: r(G).remark,
|
|
3650
|
+
"onUpdate:modelValue": e[37] || (e[37] = (n) => r(G).remark = n),
|
|
3715
3651
|
type: "textarea",
|
|
3716
3652
|
rows: 3,
|
|
3717
3653
|
placeholder: "请输入群备注"
|
|
@@ -3719,11 +3655,11 @@ const wt = (y, t) => {
|
|
|
3719
3655
|
]),
|
|
3720
3656
|
_: 1
|
|
3721
3657
|
}),
|
|
3722
|
-
i(
|
|
3658
|
+
i(Xe, { label: "群公告" }, {
|
|
3723
3659
|
default: v(() => [
|
|
3724
|
-
i(
|
|
3725
|
-
modelValue: r(
|
|
3726
|
-
"onUpdate:modelValue": e[38] || (e[38] = (n) => r(
|
|
3660
|
+
i(J, {
|
|
3661
|
+
modelValue: r(G).notice,
|
|
3662
|
+
"onUpdate:modelValue": e[38] || (e[38] = (n) => r(G).notice = n),
|
|
3727
3663
|
type: "textarea",
|
|
3728
3664
|
rows: 3,
|
|
3729
3665
|
placeholder: "请输入群公告"
|
|
@@ -3736,48 +3672,48 @@ const wt = (y, t) => {
|
|
|
3736
3672
|
})
|
|
3737
3673
|
]),
|
|
3738
3674
|
_: 1
|
|
3739
|
-
}, 8, ["modelValue"])) :
|
|
3740
|
-
r(C) ? (l(),
|
|
3675
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
3676
|
+
r(C) ? (l(), Q(Ne, {
|
|
3741
3677
|
key: 3,
|
|
3742
|
-
modelValue: r(
|
|
3743
|
-
"onUpdate:modelValue": e[43] || (e[43] = (n) =>
|
|
3678
|
+
modelValue: r(H),
|
|
3679
|
+
"onUpdate:modelValue": e[43] || (e[43] = (n) => xe(H) ? H.value = n : null),
|
|
3744
3680
|
title: "编辑群昵称",
|
|
3745
3681
|
width: "400px",
|
|
3746
3682
|
"append-to-body": ""
|
|
3747
3683
|
}, {
|
|
3748
3684
|
footer: v(() => [
|
|
3749
|
-
i(
|
|
3750
|
-
onClick: e[42] || (e[42] = (n) =>
|
|
3685
|
+
i(X, {
|
|
3686
|
+
onClick: e[42] || (e[42] = (n) => H.value = !1)
|
|
3751
3687
|
}, {
|
|
3752
3688
|
default: v(() => [...e[109] || (e[109] = [
|
|
3753
|
-
|
|
3689
|
+
T("取消", -1)
|
|
3754
3690
|
])]),
|
|
3755
3691
|
_: 1
|
|
3756
3692
|
}),
|
|
3757
|
-
i(
|
|
3693
|
+
i(X, {
|
|
3758
3694
|
type: "primary",
|
|
3759
|
-
onClick:
|
|
3695
|
+
onClick: Ts
|
|
3760
3696
|
}, {
|
|
3761
3697
|
default: v(() => [...e[110] || (e[110] = [
|
|
3762
|
-
|
|
3698
|
+
T("保存", -1)
|
|
3763
3699
|
])]),
|
|
3764
3700
|
_: 1
|
|
3765
3701
|
})
|
|
3766
3702
|
]),
|
|
3767
3703
|
default: v(() => [
|
|
3768
|
-
i(
|
|
3704
|
+
i(Nt, { "label-width": "80px" }, {
|
|
3769
3705
|
default: v(() => [
|
|
3770
|
-
i(
|
|
3706
|
+
i(Xe, { label: "成员" }, {
|
|
3771
3707
|
default: v(() => [
|
|
3772
|
-
s("span", null,
|
|
3708
|
+
s("span", null, M(r(A).targetUsername), 1)
|
|
3773
3709
|
]),
|
|
3774
3710
|
_: 1
|
|
3775
3711
|
}),
|
|
3776
|
-
i(
|
|
3712
|
+
i(Xe, { label: "群昵称" }, {
|
|
3777
3713
|
default: v(() => [
|
|
3778
|
-
i(
|
|
3779
|
-
modelValue: r(
|
|
3780
|
-
"onUpdate:modelValue": e[41] || (e[41] = (n) => r(
|
|
3714
|
+
i(J, {
|
|
3715
|
+
modelValue: r(A).memberNick,
|
|
3716
|
+
"onUpdate:modelValue": e[41] || (e[41] = (n) => r(A).memberNick = n),
|
|
3781
3717
|
placeholder: "请输入群昵称"
|
|
3782
3718
|
}, null, 8, ["modelValue"])
|
|
3783
3719
|
]),
|
|
@@ -3788,76 +3724,76 @@ const wt = (y, t) => {
|
|
|
3788
3724
|
})
|
|
3789
3725
|
]),
|
|
3790
3726
|
_: 1
|
|
3791
|
-
}, 8, ["modelValue"])) :
|
|
3792
|
-
r(C) ? (l(),
|
|
3727
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
3728
|
+
r(C) ? (l(), Q(Ne, {
|
|
3793
3729
|
key: 4,
|
|
3794
|
-
modelValue: r(
|
|
3795
|
-
"onUpdate:modelValue": e[45] || (e[45] = (n) =>
|
|
3730
|
+
modelValue: r(Y),
|
|
3731
|
+
"onUpdate:modelValue": e[45] || (e[45] = (n) => xe(Y) ? Y.value = n : null),
|
|
3796
3732
|
title: "消息已读状态",
|
|
3797
3733
|
width: "500px",
|
|
3798
3734
|
"append-to-body": ""
|
|
3799
3735
|
}, {
|
|
3800
3736
|
footer: v(() => [
|
|
3801
|
-
i(
|
|
3802
|
-
onClick: e[44] || (e[44] = (n) =>
|
|
3737
|
+
i(X, {
|
|
3738
|
+
onClick: e[44] || (e[44] = (n) => Y.value = !1)
|
|
3803
3739
|
}, {
|
|
3804
3740
|
default: v(() => [...e[111] || (e[111] = [
|
|
3805
|
-
|
|
3741
|
+
T("关闭", -1)
|
|
3806
3742
|
])]),
|
|
3807
3743
|
_: 1
|
|
3808
3744
|
})
|
|
3809
3745
|
]),
|
|
3810
3746
|
default: v(() => [
|
|
3811
|
-
s("div",
|
|
3812
|
-
s("div",
|
|
3747
|
+
s("div", Io, [
|
|
3748
|
+
s("div", zo, [
|
|
3813
3749
|
s("div", Fo, [
|
|
3814
|
-
i(
|
|
3750
|
+
i(b, null, {
|
|
3815
3751
|
default: v(() => [
|
|
3816
|
-
i(r(
|
|
3752
|
+
i(r(oa))
|
|
3817
3753
|
]),
|
|
3818
3754
|
_: 1
|
|
3819
3755
|
}),
|
|
3820
|
-
|
|
3756
|
+
T("已读 (" + M(r(re).readUserList.length) + ") ", 1)
|
|
3821
3757
|
]),
|
|
3822
3758
|
s("div", Ao, [
|
|
3823
|
-
r(
|
|
3759
|
+
r(re).readUserList.length === 0 ? (l(), Q(oe, {
|
|
3824
3760
|
key: 0,
|
|
3825
3761
|
description: "暂无已读成员"
|
|
3826
|
-
})) : (l(),
|
|
3827
|
-
(l(!0),
|
|
3762
|
+
})) : (l(), p("div", To, [
|
|
3763
|
+
(l(!0), p(ue, null, ce(r(re).readUserList, (n) => (l(), Q($t, {
|
|
3828
3764
|
key: n,
|
|
3829
3765
|
class: "user-tag"
|
|
3830
3766
|
}, {
|
|
3831
3767
|
default: v(() => [
|
|
3832
|
-
|
|
3768
|
+
T(M(n), 1)
|
|
3833
3769
|
]),
|
|
3834
3770
|
_: 2
|
|
3835
3771
|
}, 1024))), 128))
|
|
3836
3772
|
]))
|
|
3837
3773
|
])
|
|
3838
3774
|
]),
|
|
3839
|
-
s("div",
|
|
3840
|
-
s("div",
|
|
3841
|
-
i(
|
|
3775
|
+
s("div", No, [
|
|
3776
|
+
s("div", $o, [
|
|
3777
|
+
i(b, null, {
|
|
3842
3778
|
default: v(() => [
|
|
3843
|
-
i(r(
|
|
3779
|
+
i(r(la))
|
|
3844
3780
|
]),
|
|
3845
3781
|
_: 1
|
|
3846
3782
|
}),
|
|
3847
|
-
|
|
3783
|
+
T("未读 (" + M(r(re).unreadUserList.length) + ") ", 1)
|
|
3848
3784
|
]),
|
|
3849
3785
|
s("div", Ro, [
|
|
3850
|
-
r(
|
|
3786
|
+
r(re).unreadUserList.length === 0 ? (l(), Q(oe, {
|
|
3851
3787
|
key: 0,
|
|
3852
3788
|
description: "全部已读"
|
|
3853
|
-
})) : (l(),
|
|
3854
|
-
(l(!0),
|
|
3789
|
+
})) : (l(), p("div", Lo, [
|
|
3790
|
+
(l(!0), p(ue, null, ce(r(re).unreadUserList, (n) => (l(), Q($t, {
|
|
3855
3791
|
key: n,
|
|
3856
3792
|
type: "info",
|
|
3857
3793
|
class: "user-tag"
|
|
3858
3794
|
}, {
|
|
3859
3795
|
default: v(() => [
|
|
3860
|
-
|
|
3796
|
+
T(M(n), 1)
|
|
3861
3797
|
]),
|
|
3862
3798
|
_: 2
|
|
3863
3799
|
}, 1024))), 128))
|
|
@@ -3867,75 +3803,75 @@ const wt = (y, t) => {
|
|
|
3867
3803
|
])
|
|
3868
3804
|
]),
|
|
3869
3805
|
_: 1
|
|
3870
|
-
}, 8, ["modelValue"])) :
|
|
3871
|
-
r(C) ? (l(),
|
|
3806
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
3807
|
+
r(C) ? (l(), Q(Ne, {
|
|
3872
3808
|
key: 5,
|
|
3873
3809
|
modelValue: r(I),
|
|
3874
|
-
"onUpdate:modelValue": e[47] || (e[47] = (n) =>
|
|
3810
|
+
"onUpdate:modelValue": e[47] || (e[47] = (n) => xe(I) ? I.value = n : null),
|
|
3875
3811
|
title: "邀请成员",
|
|
3876
3812
|
width: "500px",
|
|
3877
3813
|
"append-to-body": ""
|
|
3878
3814
|
}, {
|
|
3879
3815
|
footer: v(() => [
|
|
3880
|
-
i(
|
|
3816
|
+
i(X, {
|
|
3881
3817
|
onClick: e[46] || (e[46] = (n) => I.value = !1)
|
|
3882
3818
|
}, {
|
|
3883
3819
|
default: v(() => [...e[112] || (e[112] = [
|
|
3884
|
-
|
|
3820
|
+
T("取消", -1)
|
|
3885
3821
|
])]),
|
|
3886
3822
|
_: 1
|
|
3887
3823
|
}),
|
|
3888
|
-
i(
|
|
3824
|
+
i(X, {
|
|
3889
3825
|
type: "primary",
|
|
3890
3826
|
onClick: As,
|
|
3891
3827
|
disabled: r(W).length === 0
|
|
3892
3828
|
}, {
|
|
3893
3829
|
default: v(() => [
|
|
3894
|
-
|
|
3830
|
+
T(" 邀请 " + M(r(W).length) + " 人 ", 1)
|
|
3895
3831
|
]),
|
|
3896
3832
|
_: 1
|
|
3897
3833
|
}, 8, ["disabled"])
|
|
3898
3834
|
]),
|
|
3899
3835
|
default: v(() => [
|
|
3900
|
-
s("div",
|
|
3901
|
-
s("div",
|
|
3902
|
-
r(
|
|
3836
|
+
s("div", Eo, [
|
|
3837
|
+
s("div", Do, [
|
|
3838
|
+
r(h).length === 0 ? (l(), Q(oe, {
|
|
3903
3839
|
key: 0,
|
|
3904
3840
|
description: "暂无好友可以邀请"
|
|
3905
|
-
})) : (l(),
|
|
3906
|
-
(l(!0),
|
|
3841
|
+
})) : (l(), p("div", Ko, [
|
|
3842
|
+
(l(!0), p(ue, null, ce(r(h), (n) => (l(), p("div", {
|
|
3907
3843
|
key: n.id,
|
|
3908
|
-
class:
|
|
3844
|
+
class: ve([
|
|
3909
3845
|
"member-item",
|
|
3910
3846
|
r(W).some((O) => O.id === n.id) ? "member-selected" : ""
|
|
3911
3847
|
]),
|
|
3912
|
-
onClick: (O) =>
|
|
3848
|
+
onClick: (O) => zs(n)
|
|
3913
3849
|
}, [
|
|
3914
3850
|
s("img", {
|
|
3915
3851
|
src: n.avatar,
|
|
3916
3852
|
alt: n.name,
|
|
3917
3853
|
class: "member-avatar"
|
|
3918
|
-
}, null, 8,
|
|
3919
|
-
s("span",
|
|
3920
|
-
r(W).some((O) => O.id === n.id) ? (l(),
|
|
3854
|
+
}, null, 8, Ho),
|
|
3855
|
+
s("span", Xo, M(n.name), 1),
|
|
3856
|
+
r(W).some((O) => O.id === n.id) ? (l(), Q(b, {
|
|
3921
3857
|
key: 0,
|
|
3922
3858
|
class: "member-check"
|
|
3923
3859
|
}, {
|
|
3924
3860
|
default: v(() => [
|
|
3925
|
-
i(r(
|
|
3861
|
+
i(r(Jt))
|
|
3926
3862
|
]),
|
|
3927
3863
|
_: 1
|
|
3928
|
-
})) :
|
|
3929
|
-
], 10,
|
|
3864
|
+
})) : L("", !0)
|
|
3865
|
+
], 10, Wo))), 128))
|
|
3930
3866
|
]))
|
|
3931
3867
|
])
|
|
3932
3868
|
])
|
|
3933
3869
|
]),
|
|
3934
3870
|
_: 1
|
|
3935
|
-
}, 8, ["modelValue"])) :
|
|
3936
|
-
i(
|
|
3937
|
-
modelValue:
|
|
3938
|
-
"onUpdate:modelValue": e[52] || (e[52] = (n) =>
|
|
3871
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
3872
|
+
i(Ne, {
|
|
3873
|
+
modelValue: Je.value,
|
|
3874
|
+
"onUpdate:modelValue": e[52] || (e[52] = (n) => Je.value = n),
|
|
3939
3875
|
title: "个人设置",
|
|
3940
3876
|
width: "560px",
|
|
3941
3877
|
"close-on-click-modal": !1,
|
|
@@ -3943,158 +3879,158 @@ const wt = (y, t) => {
|
|
|
3943
3879
|
class: "chat-settings-dialog"
|
|
3944
3880
|
}, {
|
|
3945
3881
|
default: v(() => [
|
|
3946
|
-
s("div",
|
|
3947
|
-
s("div",
|
|
3948
|
-
s("div",
|
|
3882
|
+
s("div", Yo, [
|
|
3883
|
+
s("div", jo, [
|
|
3884
|
+
s("div", qo, [
|
|
3949
3885
|
s("img", {
|
|
3950
3886
|
src: r(E),
|
|
3951
3887
|
alt: "头像",
|
|
3952
3888
|
class: "chat-settings-avatar"
|
|
3953
|
-
}, null, 8,
|
|
3954
|
-
|
|
3889
|
+
}, null, 8, Oo),
|
|
3890
|
+
g.config.modules.avatarCrop ? (l(), p("div", {
|
|
3955
3891
|
key: 0,
|
|
3956
3892
|
class: "chat-settings-avatar-edit",
|
|
3957
|
-
onClick:
|
|
3893
|
+
onClick: Cs
|
|
3958
3894
|
}, [
|
|
3959
|
-
i(
|
|
3895
|
+
i(b, {
|
|
3960
3896
|
size: 18,
|
|
3961
3897
|
class: "chat-settings-avatar-icon"
|
|
3962
3898
|
}, {
|
|
3963
3899
|
default: v(() => [
|
|
3964
|
-
i(r(
|
|
3900
|
+
i(r(ia))
|
|
3965
3901
|
]),
|
|
3966
3902
|
_: 1
|
|
3967
3903
|
})
|
|
3968
|
-
])) :
|
|
3904
|
+
])) : L("", !0),
|
|
3969
3905
|
s("input", {
|
|
3970
3906
|
ref_key: "avatarInputRef",
|
|
3971
|
-
ref:
|
|
3907
|
+
ref: Ze,
|
|
3972
3908
|
type: "file",
|
|
3973
3909
|
accept: "image/*",
|
|
3974
3910
|
class: "hidden-avatar-input",
|
|
3975
|
-
onChange:
|
|
3911
|
+
onChange: Ls
|
|
3976
3912
|
}, null, 544)
|
|
3977
3913
|
]),
|
|
3978
|
-
s("div",
|
|
3979
|
-
s("div",
|
|
3980
|
-
s("div",
|
|
3914
|
+
s("div", Po, [
|
|
3915
|
+
s("div", Bo, M(r(N).nickname || r(y)), 1),
|
|
3916
|
+
s("div", Jo, "@" + M(r(y)), 1)
|
|
3981
3917
|
])
|
|
3982
3918
|
]),
|
|
3983
|
-
s("div",
|
|
3984
|
-
s("div",
|
|
3985
|
-
s("div",
|
|
3986
|
-
i(
|
|
3919
|
+
s("div", Qo, [
|
|
3920
|
+
s("div", Zo, [
|
|
3921
|
+
s("div", el, [
|
|
3922
|
+
i(b, null, {
|
|
3987
3923
|
default: v(() => [
|
|
3988
|
-
i(r(
|
|
3924
|
+
i(r(ft))
|
|
3989
3925
|
]),
|
|
3990
3926
|
_: 1
|
|
3991
3927
|
}),
|
|
3992
|
-
e[113] || (e[113] =
|
|
3928
|
+
e[113] || (e[113] = T(" 个人信息 ", -1))
|
|
3993
3929
|
]),
|
|
3994
|
-
|
|
3930
|
+
ze.value ? L("", !0) : (l(), Q(X, {
|
|
3995
3931
|
key: 0,
|
|
3996
3932
|
type: "primary",
|
|
3997
3933
|
size: "small",
|
|
3998
|
-
onClick:
|
|
3934
|
+
onClick: Ks,
|
|
3999
3935
|
class: "chat-settings-edit-btn"
|
|
4000
3936
|
}, {
|
|
4001
3937
|
default: v(() => [...e[114] || (e[114] = [
|
|
4002
|
-
|
|
3938
|
+
T(" 编辑 ", -1)
|
|
4003
3939
|
])]),
|
|
4004
3940
|
_: 1
|
|
4005
3941
|
}))
|
|
4006
3942
|
]),
|
|
4007
|
-
s("div",
|
|
4008
|
-
s("div",
|
|
3943
|
+
s("div", tl, [
|
|
3944
|
+
s("div", sl, [
|
|
4009
3945
|
e[115] || (e[115] = s("label", { class: "chat-settings-form-label" }, "昵称", -1)),
|
|
4010
|
-
|
|
3946
|
+
ze.value ? (l(), Q(J, {
|
|
4011
3947
|
key: 0,
|
|
4012
|
-
modelValue:
|
|
4013
|
-
"onUpdate:modelValue": e[48] || (e[48] = (n) =>
|
|
3948
|
+
modelValue: Me.value.nickname,
|
|
3949
|
+
"onUpdate:modelValue": e[48] || (e[48] = (n) => Me.value.nickname = n),
|
|
4014
3950
|
placeholder: "请输入昵称",
|
|
4015
3951
|
size: "large"
|
|
4016
|
-
}, null, 8, ["modelValue"])) : (l(),
|
|
3952
|
+
}, null, 8, ["modelValue"])) : (l(), p("div", al, M(r(N).nickname || "未设置"), 1))
|
|
4017
3953
|
]),
|
|
4018
|
-
s("div",
|
|
3954
|
+
s("div", nl, [
|
|
4019
3955
|
e[116] || (e[116] = s("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
|
|
4020
|
-
|
|
3956
|
+
ze.value ? (l(), Q(J, {
|
|
4021
3957
|
key: 0,
|
|
4022
|
-
modelValue:
|
|
4023
|
-
"onUpdate:modelValue": e[49] || (e[49] = (n) =>
|
|
3958
|
+
modelValue: Me.value.email,
|
|
3959
|
+
"onUpdate:modelValue": e[49] || (e[49] = (n) => Me.value.email = n),
|
|
4024
3960
|
placeholder: "请输入邮箱",
|
|
4025
3961
|
size: "large"
|
|
4026
|
-
}, null, 8, ["modelValue"])) : (l(),
|
|
3962
|
+
}, null, 8, ["modelValue"])) : (l(), p("div", rl, M(r(N).email || "未设置"), 1))
|
|
4027
3963
|
]),
|
|
4028
|
-
s("div",
|
|
3964
|
+
s("div", ol, [
|
|
4029
3965
|
e[117] || (e[117] = s("label", { class: "chat-settings-form-label" }, "手机号", -1)),
|
|
4030
|
-
|
|
3966
|
+
ze.value ? (l(), Q(J, {
|
|
4031
3967
|
key: 0,
|
|
4032
|
-
modelValue:
|
|
4033
|
-
"onUpdate:modelValue": e[50] || (e[50] = (n) =>
|
|
3968
|
+
modelValue: Me.value.phone,
|
|
3969
|
+
"onUpdate:modelValue": e[50] || (e[50] = (n) => Me.value.phone = n),
|
|
4034
3970
|
placeholder: "请输入手机号",
|
|
4035
3971
|
size: "large"
|
|
4036
|
-
}, null, 8, ["modelValue"])) : (l(),
|
|
3972
|
+
}, null, 8, ["modelValue"])) : (l(), p("div", ll, M(r(N).phone || "未设置"), 1))
|
|
4037
3973
|
]),
|
|
4038
|
-
s("div",
|
|
3974
|
+
s("div", il, [
|
|
4039
3975
|
e[118] || (e[118] = s("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
|
|
4040
|
-
|
|
3976
|
+
ze.value ? (l(), Q(J, {
|
|
4041
3977
|
key: 0,
|
|
4042
|
-
modelValue:
|
|
4043
|
-
"onUpdate:modelValue": e[51] || (e[51] = (n) =>
|
|
3978
|
+
modelValue: Me.value.bio,
|
|
3979
|
+
"onUpdate:modelValue": e[51] || (e[51] = (n) => Me.value.bio = n),
|
|
4044
3980
|
type: "textarea",
|
|
4045
3981
|
rows: 4,
|
|
4046
3982
|
placeholder: "介绍一下自己吧...",
|
|
4047
3983
|
size: "large"
|
|
4048
|
-
}, null, 8, ["modelValue"])) : (l(),
|
|
3984
|
+
}, null, 8, ["modelValue"])) : (l(), p("div", ul, M(r(N).bio || "这个人很懒,什么都没写~"), 1))
|
|
4049
3985
|
]),
|
|
4050
|
-
|
|
4051
|
-
i(
|
|
3986
|
+
ze.value ? (l(), p("div", cl, [
|
|
3987
|
+
i(X, {
|
|
4052
3988
|
size: "default",
|
|
4053
|
-
onClick:
|
|
3989
|
+
onClick: Ws
|
|
4054
3990
|
}, {
|
|
4055
3991
|
default: v(() => [...e[119] || (e[119] = [
|
|
4056
|
-
|
|
3992
|
+
T("取消", -1)
|
|
4057
3993
|
])]),
|
|
4058
3994
|
_: 1
|
|
4059
3995
|
}),
|
|
4060
|
-
i(
|
|
3996
|
+
i(X, {
|
|
4061
3997
|
type: "primary",
|
|
4062
3998
|
size: "default",
|
|
4063
|
-
loading:
|
|
4064
|
-
onClick:
|
|
3999
|
+
loading: ct.value,
|
|
4000
|
+
onClick: Hs
|
|
4065
4001
|
}, {
|
|
4066
4002
|
default: v(() => [...e[120] || (e[120] = [
|
|
4067
|
-
|
|
4003
|
+
T("保存更改", -1)
|
|
4068
4004
|
])]),
|
|
4069
4005
|
_: 1
|
|
4070
4006
|
}, 8, ["loading"])
|
|
4071
|
-
])) :
|
|
4007
|
+
])) : L("", !0)
|
|
4072
4008
|
])
|
|
4073
4009
|
])
|
|
4074
4010
|
])
|
|
4075
4011
|
]),
|
|
4076
4012
|
_: 1
|
|
4077
4013
|
}, 8, ["modelValue"]),
|
|
4078
|
-
i(
|
|
4079
|
-
modelValue:
|
|
4080
|
-
"onUpdate:modelValue": e[53] || (e[53] = (n) =>
|
|
4081
|
-
src:
|
|
4082
|
-
onConfirm:
|
|
4014
|
+
i(Qt, {
|
|
4015
|
+
modelValue: Qe.value,
|
|
4016
|
+
"onUpdate:modelValue": e[53] || (e[53] = (n) => Qe.value = n),
|
|
4017
|
+
src: dt.value,
|
|
4018
|
+
onConfirm: Es
|
|
4083
4019
|
}, null, 8, ["modelValue", "src"]),
|
|
4084
|
-
|
|
4020
|
+
Te.value.visible ? (l(), p("div", {
|
|
4085
4021
|
key: 6,
|
|
4086
4022
|
class: "chat-context-menu",
|
|
4087
|
-
style:
|
|
4023
|
+
style: Le({ left: Te.value.x + "px", top: Te.value.y + "px" })
|
|
4088
4024
|
}, [
|
|
4089
4025
|
s("div", {
|
|
4090
4026
|
class: "chat-context-menu-item",
|
|
4091
|
-
onClick:
|
|
4027
|
+
onClick: ys
|
|
4092
4028
|
}, "删除聊天")
|
|
4093
|
-
], 4)) :
|
|
4029
|
+
], 4)) : L("", !0)
|
|
4094
4030
|
]);
|
|
4095
4031
|
};
|
|
4096
4032
|
}
|
|
4097
|
-
},
|
|
4033
|
+
}, pl = /* @__PURE__ */ _t(dl, [["__scopeId", "data-v-18e78d30"]]), ml = {
|
|
4098
4034
|
// API 配置
|
|
4099
4035
|
api: {
|
|
4100
4036
|
baseUrl: "",
|
|
@@ -4177,29 +4113,29 @@ const wt = (y, t) => {
|
|
|
4177
4113
|
allowedTypes: ["*"]
|
|
4178
4114
|
}
|
|
4179
4115
|
};
|
|
4180
|
-
function
|
|
4181
|
-
const t =
|
|
4116
|
+
function Sl(g = {}) {
|
|
4117
|
+
const t = Zt(ml, g);
|
|
4182
4118
|
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;
|
|
4183
4119
|
}
|
|
4184
|
-
function
|
|
4185
|
-
const a = { ...
|
|
4120
|
+
function Zt(g, t) {
|
|
4121
|
+
const a = { ...g };
|
|
4186
4122
|
for (const o in t)
|
|
4187
|
-
t[o] && typeof t[o] == "object" && !Array.isArray(t[o]) ? a[o] =
|
|
4123
|
+
t[o] && typeof t[o] == "object" && !Array.isArray(t[o]) ? a[o] = Zt(g[o] || {}, t[o]) : a[o] = t[o];
|
|
4188
4124
|
return a;
|
|
4189
4125
|
}
|
|
4190
|
-
const
|
|
4191
|
-
install(
|
|
4192
|
-
|
|
4126
|
+
const Vl = {
|
|
4127
|
+
install(g) {
|
|
4128
|
+
g.component("ChatPanel", pl), g.component("AvatarCrop", Qt);
|
|
4193
4129
|
}
|
|
4194
4130
|
};
|
|
4195
4131
|
export {
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4132
|
+
Qt as AvatarCrop,
|
|
4133
|
+
bt as ChatApi,
|
|
4134
|
+
pl as ChatPanel,
|
|
4135
|
+
ua as ChatWebSocket,
|
|
4136
|
+
ca as HttpClient,
|
|
4137
|
+
Vl as VueChatKit,
|
|
4138
|
+
Sl as createChatConfig,
|
|
4139
|
+
Vl as default,
|
|
4204
4140
|
ha as useChat
|
|
4205
4141
|
};
|