@huyooo/ui 0.6.13 → 0.7.0

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.
@@ -0,0 +1,1120 @@
1
+ import { ref as m, defineComponent as N, createBlock as v, openBlock as n, unref as t, withCtx as d, createVNode as $, createCommentVNode as h, createElementBlock as b, normalizeClass as V, createElementVNode as S, renderSlot as T, toDisplayString as w, createTextVNode as k, Fragment as R, renderList as G, createSlots as ee, mergeProps as U, watch as te, computed as J, mergeModels as j, useModel as se, isRef as ae } from "vue";
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ import { Spin as Q, Empty as W, Tag as x, Button as ne, Breadcrumb as E, BreadcrumbItem as B, Modal as ie } from "@arco-design/web-vue";
8
+ import { c as D, g as O } from "./auth-bwwc2iT8.js";
9
+ import { TiptapEditor as oe, TiptapTitle as le } from "@huyooo/vue-tiptap";
10
+ import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
+ import { useIntersectionObserver as re } from "@vueuse/core";
12
+ import { m as P, a as ue, b as de, c as ce } from "./MessageNotifications-CJtKlzc3.js";
13
+ import { Icon as fe } from "@iconify/vue";
14
+ import { u as pe } from "./useAuthkitCreateAndUpdate-Co5wMbv7.js";
15
+ import { M as ge } from "./Menu-BjWB9hre.js";
16
+ function me(e) {
17
+ return D({
18
+ url: `${O.prefixUrl}/restfulApi/messageCenter/changelogNotifications/find`,
19
+ method: "post",
20
+ data: e
21
+ });
22
+ }
23
+ function ve(e) {
24
+ return D({
25
+ url: `${O.prefixUrl}/restfulApi/messageCenter/changelogNotifications/findOne`,
26
+ method: "post",
27
+ data: e
28
+ });
29
+ }
30
+ function H(e, o = {}) {
31
+ const {
32
+ pageSize: s = 10,
33
+ where: u = {}
34
+ } = o, l = m(!0), a = m(""), i = m(!1), r = m(!1), c = m([]), g = m({
35
+ current: 1,
36
+ pageSize: s,
37
+ total: 0
38
+ });
39
+ async function C() {
40
+ if (!i.value) {
41
+ i.value = !0;
42
+ try {
43
+ const {
44
+ data: I
45
+ } = await e({
46
+ current: g.value.current,
47
+ pageSize: g.value.pageSize,
48
+ where: u
49
+ });
50
+ c.value = I.items, g.value.total = I.count, r.value = I.items.length < g.value.pageSize;
51
+ } finally {
52
+ i.value = !1;
53
+ }
54
+ }
55
+ }
56
+ async function y() {
57
+ if (!(i.value || r.value)) {
58
+ g.value.current += 1, i.value = !0;
59
+ try {
60
+ const {
61
+ data: I
62
+ } = await e({
63
+ current: g.value.current,
64
+ pageSize: g.value.pageSize,
65
+ where: u
66
+ });
67
+ c.value = [...c.value, ...I.items], g.value.total = I.count, r.value = I.items.length < g.value.pageSize;
68
+ } finally {
69
+ i.value = !1;
70
+ }
71
+ }
72
+ }
73
+ async function f() {
74
+ g.value.current = 1, r.value = !1, await C();
75
+ }
76
+ function p() {
77
+ l.value = !0, a.value = "";
78
+ }
79
+ function z(I) {
80
+ a.value = I.id, l.value = !1;
81
+ }
82
+ return C(), {
83
+ // 状态
84
+ isList: l,
85
+ detailId: a,
86
+ loading: i,
87
+ finished: r,
88
+ messageList: c,
89
+ pagination: g,
90
+ // 方法
91
+ loadData: C,
92
+ loadMore: y,
93
+ refresh: f,
94
+ toList: p,
95
+ openDetail: z
96
+ };
97
+ }
98
+ const ye = /* @__PURE__ */ N({
99
+ __name: "MessageDetails",
100
+ props: {
101
+ content: {
102
+ type: Object,
103
+ default: null
104
+ },
105
+ title: {
106
+ type: String,
107
+ required: !0
108
+ },
109
+ loading: {
110
+ type: Boolean,
111
+ default: !1
112
+ }
113
+ },
114
+ emits: ["itemClick", "tableOfContentsUpdate", "update:title", "update:content"],
115
+ setup(e, {
116
+ emit: o
117
+ }) {
118
+ const s = m([]), u = e, l = m(!1), a = o, i = m();
119
+ function r(c) {
120
+ s.value = c, a("tableOfContentsUpdate", c);
121
+ }
122
+ return (c, g) => (n(), v(t(Q), {
123
+ loading: u.loading,
124
+ tip: "文档加载中...",
125
+ class: "Spin",
126
+ dot: ""
127
+ }, {
128
+ default: d(() => [$(t(oe), {
129
+ ref_key: "TiptapEditorRef",
130
+ ref: i,
131
+ "model-value": u.content,
132
+ editable: l.value,
133
+ "tiptap-editor-content-class": "tiptapEditorContentClass",
134
+ onTableOfContentsUpdate: r
135
+ }, {
136
+ title: d(() => [$(t(le), {
137
+ "model-value": u.title,
138
+ editable: l.value
139
+ }, null, 8, ["model-value", "editable"])]),
140
+ _: 1
141
+ }, 8, ["model-value", "editable"]), h("", !0)]),
142
+ _: 1
143
+ }, 8, ["loading"]));
144
+ }
145
+ }), F = /* @__PURE__ */ L(ye, [["__scopeId", "data-v-8eec0226"]]), _e = /* @__PURE__ */ N({
146
+ __name: "MessageChangelogNotificationsDetails",
147
+ props: {
148
+ id: {
149
+ type: String,
150
+ required: !0
151
+ }
152
+ },
153
+ setup(e) {
154
+ const o = m(!1), s = m(null), u = m(""), l = e;
155
+ function a() {
156
+ o.value = !0, ve({
157
+ id: l.id
158
+ }).then(({
159
+ data: i
160
+ }) => {
161
+ s.value = i.content, u.value = i.title, o.value = !1;
162
+ }).catch((i) => {
163
+ console.error("获取变更日志详情失败:", i), o.value = !1;
164
+ });
165
+ }
166
+ return a(), (i, r) => (n(), v(F, {
167
+ content: s.value,
168
+ title: u.value,
169
+ loading: o.value
170
+ }, null, 8, ["content", "title", "loading"]));
171
+ }
172
+ }), he = {
173
+ key: 0,
174
+ class: "loading"
175
+ }, be = {
176
+ key: 1,
177
+ class: "none"
178
+ }, ke = /* @__PURE__ */ N({
179
+ __name: "InfiniteLoading",
180
+ props: {
181
+ loading: {
182
+ type: Boolean,
183
+ default: !1
184
+ },
185
+ finished: {
186
+ type: Boolean,
187
+ default: !1
188
+ },
189
+ loadingText: {
190
+ type: String,
191
+ default: "数据加载中..."
192
+ },
193
+ finishedText: {
194
+ type: String,
195
+ default: "亲,没有更多了!"
196
+ },
197
+ showFinishedText: {
198
+ type: Boolean,
199
+ default: !0
200
+ },
201
+ threshold: {
202
+ type: Number,
203
+ default: 0
204
+ }
205
+ },
206
+ emits: ["infinite"],
207
+ setup(e, {
208
+ emit: o
209
+ }) {
210
+ const s = e, u = o, l = m(null);
211
+ return re(l, ([{
212
+ isIntersecting: a
213
+ }]) => {
214
+ a && // 当loading和finished的值都为false时,就通知父组件调用方法继续向后台请求数据
215
+ !s.loading && !s.finished && u("infinite");
216
+ }, {
217
+ threshold: s.threshold
218
+ }), (a, i) => (n(), b("div", {
219
+ ref_key: "container",
220
+ ref: l,
221
+ class: "infinite-loading"
222
+ }, [e.loading ? (n(), b("div", he, [$(t(Q), {
223
+ tip: e.loadingText
224
+ }, null, 8, ["tip"])])) : h("", !0), e.finished && e.showFinishedText ? (n(), b("div", be, [$(t(W), {
225
+ description: e.finishedText
226
+ }, null, 8, ["description"])])) : h("", !0)], 512));
227
+ }
228
+ }), Ce = /* @__PURE__ */ L(ke, [["__scopeId", "data-v-b513f798"]]), $e = {
229
+ class: "message-item__content"
230
+ }, Ne = {
231
+ class: "message-item__header"
232
+ }, Me = {
233
+ class: "message-item__title"
234
+ }, Ae = {
235
+ class: "message-item__tags"
236
+ }, Se = {
237
+ class: "message-item__description"
238
+ }, we = {
239
+ class: "message-item__footer"
240
+ }, Le = {
241
+ class: "message-item__time"
242
+ }, Ie = {
243
+ class: "message-item__actions"
244
+ }, xe = /* @__PURE__ */ N({
245
+ __name: "MessageItem",
246
+ props: {
247
+ item: {},
248
+ showReadStatus: {
249
+ type: Boolean
250
+ },
251
+ showViewButton: {
252
+ type: Boolean
253
+ }
254
+ },
255
+ emits: ["click"],
256
+ setup(e) {
257
+ return (o, s) => (n(), b("div", {
258
+ class: V(["message-item", {
259
+ "message-item--unread": e.showReadStatus && !e.item.read
260
+ }]),
261
+ onClick: s[0] || (s[0] = (u) => o.$emit("click", e.item))
262
+ }, [S("div", $e, [S("div", Ne, [e.showReadStatus ? (n(), b("span", {
263
+ key: 0,
264
+ class: V(["message-item__dot", {
265
+ "message-item__dot--unread": !e.item.read
266
+ }])
267
+ }, null, 2)) : h("", !0), T(o.$slots, "prefix", {
268
+ item: e.item
269
+ }, void 0, !0), S("span", Me, w(e.item.title), 1), S("div", Ae, [e.item.pinned ? (n(), v(t(x), {
270
+ key: 0,
271
+ color: "arcoblue",
272
+ size: "small"
273
+ }, {
274
+ default: d(() => [...s[1] || (s[1] = [k("置顶", -1)])]),
275
+ _: 1
276
+ })) : h("", !0), T(o.$slots, "tags", {
277
+ item: e.item
278
+ }, () => [e.item.priority === "urgent" ? (n(), v(t(x), {
279
+ key: 0,
280
+ color: "red",
281
+ size: "small"
282
+ }, {
283
+ default: d(() => [...s[2] || (s[2] = [k("紧急", -1)])]),
284
+ _: 1
285
+ })) : e.item.priority === "important" ? (n(), v(t(x), {
286
+ key: 1,
287
+ color: "orange",
288
+ size: "small"
289
+ }, {
290
+ default: d(() => [...s[3] || (s[3] = [k("重要", -1)])]),
291
+ _: 1
292
+ })) : e.item.priority === "high" ? (n(), v(t(x), {
293
+ key: 2,
294
+ color: "orange",
295
+ size: "small"
296
+ }, {
297
+ default: d(() => [...s[4] || (s[4] = [k("高", -1)])]),
298
+ _: 1
299
+ })) : h("", !0)], !0)])]), S("div", Se, [T(o.$slots, "description", {
300
+ item: e.item
301
+ }, () => [k(w(e.item.description), 1)], !0)]), S("div", we, [S("span", Le, w(e.item.createAt), 1), T(o.$slots, "footer", {
302
+ item: e.item
303
+ }, void 0, !0)])]), S("div", Ie, [T(o.$slots, "actions", {
304
+ item: e.item
305
+ }, () => [e.showViewButton ? (n(), v(t(ne), {
306
+ key: 0,
307
+ type: "text",
308
+ size: "small"
309
+ }, {
310
+ default: d(() => [...s[5] || (s[5] = [k("查看", -1)])]),
311
+ _: 1
312
+ })) : h("", !0)], !0)])], 2));
313
+ }
314
+ }), Te = /* @__PURE__ */ L(xe, [["__scopeId", "data-v-1cf5087b"]]), ze = {
315
+ class: "message-list"
316
+ }, Be = {
317
+ key: 0,
318
+ class: "message-list__empty"
319
+ }, De = /* @__PURE__ */ N({
320
+ __name: "MessageList",
321
+ props: {
322
+ messageList: {},
323
+ loading: {
324
+ type: Boolean
325
+ },
326
+ finished: {
327
+ type: Boolean
328
+ },
329
+ showReadStatus: {
330
+ type: Boolean
331
+ },
332
+ showViewButton: {
333
+ type: Boolean
334
+ }
335
+ },
336
+ emits: ["itemClick", "loadMore"],
337
+ setup(e, {
338
+ emit: o
339
+ }) {
340
+ const s = e, u = o;
341
+ function l(a) {
342
+ u("itemClick", a);
343
+ }
344
+ return (a, i) => (n(), b("div", ze, [s.messageList.length === 0 && !s.loading ? (n(), b("div", Be, [$(t(W), {
345
+ description: "暂无消息"
346
+ })])) : (n(), b(R, {
347
+ key: 1
348
+ }, [(n(!0), b(R, null, G(s.messageList, (r) => (n(), v(Te, {
349
+ key: r.id,
350
+ item: r,
351
+ "show-read-status": s.showReadStatus,
352
+ "show-view-button": s.showViewButton,
353
+ onClick: (c) => l(r)
354
+ }, ee({
355
+ _: 2
356
+ }, [a.$slots.prefix ? {
357
+ name: "prefix",
358
+ fn: d((c) => [T(a.$slots, "prefix", U({
359
+ ref_for: !0
360
+ }, c), void 0, !0)]),
361
+ key: "0"
362
+ } : void 0, a.$slots.tags ? {
363
+ name: "tags",
364
+ fn: d((c) => [T(a.$slots, "tags", U({
365
+ ref_for: !0
366
+ }, c), void 0, !0)]),
367
+ key: "1"
368
+ } : void 0, a.$slots.description ? {
369
+ name: "description",
370
+ fn: d((c) => [T(a.$slots, "description", U({
371
+ ref_for: !0
372
+ }, c), void 0, !0)]),
373
+ key: "2"
374
+ } : void 0, a.$slots.footer ? {
375
+ name: "footer",
376
+ fn: d((c) => [T(a.$slots, "footer", U({
377
+ ref_for: !0
378
+ }, c), void 0, !0)]),
379
+ key: "3"
380
+ } : void 0, a.$slots.actions ? {
381
+ name: "actions",
382
+ fn: d((c) => [T(a.$slots, "actions", U({
383
+ ref_for: !0
384
+ }, c), void 0, !0)]),
385
+ key: "4"
386
+ } : void 0]), 1032, ["item", "show-read-status", "show-view-button", "onClick"]))), 128)), $(Ce, {
387
+ loading: s.loading,
388
+ finished: s.finished,
389
+ onInfinite: i[0] || (i[0] = (r) => a.$emit("loadMore"))
390
+ }, null, 8, ["loading", "finished"])], 64))]));
391
+ }
392
+ }), K = /* @__PURE__ */ L(De, [["__scopeId", "data-v-991c4730"]]), Oe = {
393
+ class: "message-panel"
394
+ }, Ue = {
395
+ class: "version-prefix"
396
+ }, Ve = {
397
+ key: 0,
398
+ class: "publish-time"
399
+ }, Re = /* @__PURE__ */ N({
400
+ __name: "MessageChangelogNotifications",
401
+ setup(e) {
402
+ const {
403
+ isList: o,
404
+ detailId: s,
405
+ loading: u,
406
+ finished: l,
407
+ messageList: a,
408
+ loadMore: i,
409
+ toList: r,
410
+ openDetail: c
411
+ } = H(me);
412
+ function g(y) {
413
+ return {
414
+ feature: "green",
415
+ improvement: "blue",
416
+ fix: "orange",
417
+ security: "red",
418
+ breaking: "magenta"
419
+ }[y] || "blue";
420
+ }
421
+ function C(y) {
422
+ return {
423
+ feature: "新功能",
424
+ improvement: "优化",
425
+ fix: "修复",
426
+ security: "安全",
427
+ breaking: "重大变更"
428
+ }[y] || "更新";
429
+ }
430
+ return (y, f) => (n(), b("div", Oe, [t(o) ? h("", !0) : (n(), v(t(E), {
431
+ key: 0,
432
+ class: "message-panel__breadcrumb"
433
+ }, {
434
+ default: d(() => [$(t(B), {
435
+ onClick: t(r)
436
+ }, {
437
+ default: d(() => [...f[0] || (f[0] = [k("更新日志", -1)])]),
438
+ _: 1
439
+ }, 8, ["onClick"]), $(t(B), null, {
440
+ default: d(() => [...f[1] || (f[1] = [k("详情", -1)])]),
441
+ _: 1
442
+ })]),
443
+ _: 1
444
+ })), t(o) ? (n(), v(K, {
445
+ key: 1,
446
+ "message-list": t(a),
447
+ loading: t(u),
448
+ finished: t(l),
449
+ onItemClick: t(c),
450
+ onLoadMore: t(i)
451
+ }, {
452
+ prefix: d(({
453
+ item: p
454
+ }) => [S("span", Ue, w(p.version), 1)]),
455
+ tags: d(({
456
+ item: p
457
+ }) => [$(t(x), {
458
+ color: g(p.changeType),
459
+ size: "small"
460
+ }, {
461
+ default: d(() => [k(w(C(p.changeType)), 1)]),
462
+ _: 2
463
+ }, 1032, ["color"])]),
464
+ footer: d(({
465
+ item: p
466
+ }) => [p.publishedAt ? (n(), b("span", Ve, " 发布于 " + w(p.publishedAt), 1)) : h("", !0)]),
467
+ _: 1
468
+ }, 8, ["message-list", "loading", "finished", "onItemClick", "onLoadMore"])) : (n(), v(_e, {
469
+ key: 2,
470
+ id: t(s)
471
+ }, null, 8, ["id"]))]));
472
+ }
473
+ }), Ee = /* @__PURE__ */ L(Re, [["__scopeId", "data-v-20ecca66"]]);
474
+ function Fe(e) {
475
+ return D({
476
+ url: `${O.prefixUrl}/restfulApi/messageCenter/eventNotifications/find`,
477
+ method: "post",
478
+ data: e
479
+ });
480
+ }
481
+ function Ke(e) {
482
+ return D({
483
+ url: `${O.prefixUrl}/restfulApi/messageCenter/eventNotifications/findOne`,
484
+ method: "post",
485
+ data: e
486
+ });
487
+ }
488
+ const qe = /* @__PURE__ */ N({
489
+ __name: "MessageEventNotificationsDetails",
490
+ props: {
491
+ id: {
492
+ type: String,
493
+ required: !0
494
+ }
495
+ },
496
+ setup(e) {
497
+ const o = m(!1), s = m(null), u = m(""), l = e;
498
+ function a() {
499
+ o.value = !0, Ke({
500
+ id: l.id
501
+ }).then(({
502
+ data: i
503
+ }) => {
504
+ s.value = i.content, u.value = i.title, o.value = !1;
505
+ }).catch((i) => {
506
+ console.error("获取事件通知详情失败:", i), o.value = !1;
507
+ });
508
+ }
509
+ return a(), (i, r) => (n(), v(F, {
510
+ content: s.value,
511
+ title: u.value,
512
+ loading: o.value
513
+ }, null, 8, ["content", "title", "loading"]));
514
+ }
515
+ }), He = {
516
+ class: "message-panel"
517
+ }, je = {
518
+ key: 0,
519
+ class: "time-range"
520
+ }, Pe = /* @__PURE__ */ N({
521
+ __name: "MessageEventNotifications",
522
+ setup(e) {
523
+ const {
524
+ isList: o,
525
+ detailId: s,
526
+ loading: u,
527
+ finished: l,
528
+ messageList: a,
529
+ loadMore: i,
530
+ toList: r,
531
+ openDetail: c
532
+ } = H((y) => Fe({
533
+ ...y,
534
+ where: {
535
+ status: "published"
536
+ }
537
+ }));
538
+ function g(y) {
539
+ return {
540
+ upcoming: "blue",
541
+ ongoing: "green",
542
+ ended: "gray",
543
+ published: "arcoblue"
544
+ }[y] || "gray";
545
+ }
546
+ function C(y) {
547
+ return {
548
+ upcoming: "即将开始",
549
+ ongoing: "进行中",
550
+ ended: "已结束",
551
+ published: "已发布"
552
+ }[y] || "未知";
553
+ }
554
+ return (y, f) => (n(), b("div", He, [t(o) ? h("", !0) : (n(), v(t(E), {
555
+ key: 0,
556
+ class: "message-panel__breadcrumb"
557
+ }, {
558
+ default: d(() => [$(t(B), {
559
+ onClick: t(r)
560
+ }, {
561
+ default: d(() => [...f[0] || (f[0] = [k("活动通知", -1)])]),
562
+ _: 1
563
+ }, 8, ["onClick"]), $(t(B), null, {
564
+ default: d(() => [...f[1] || (f[1] = [k("详情", -1)])]),
565
+ _: 1
566
+ })]),
567
+ _: 1
568
+ })), t(o) ? (n(), v(K, {
569
+ key: 1,
570
+ "message-list": t(a),
571
+ loading: t(u),
572
+ finished: t(l),
573
+ onItemClick: t(c),
574
+ onLoadMore: t(i)
575
+ }, {
576
+ tags: d(({
577
+ item: p
578
+ }) => [$(t(x), {
579
+ color: g(p.displayStatus),
580
+ size: "small"
581
+ }, {
582
+ default: d(() => [k(w(C(p.displayStatus)), 1)]),
583
+ _: 2
584
+ }, 1032, ["color"])]),
585
+ footer: d(({
586
+ item: p
587
+ }) => [p.startAt || p.endAt ? (n(), b("span", je, w(p.startAt || "无") + " ~ " + w(p.endAt || "无"), 1)) : h("", !0)]),
588
+ _: 1
589
+ }, 8, ["message-list", "loading", "finished", "onItemClick", "onLoadMore"])) : (n(), v(qe, {
590
+ key: 2,
591
+ id: t(s)
592
+ }, null, 8, ["id"]))]));
593
+ }
594
+ }), Ge = /* @__PURE__ */ L(Pe, [["__scopeId", "data-v-13297e28"]]), Je = {
595
+ style: {
596
+ display: "flex",
597
+ gap: "16px"
598
+ }
599
+ }, Qe = ["onClick"], We = /* @__PURE__ */ N({
600
+ __name: "MessageCustomTabs",
601
+ props: {
602
+ modelValue: {
603
+ type: String,
604
+ default: "1"
605
+ },
606
+ tabs: {
607
+ type: Array,
608
+ default: () => [{
609
+ label: "未读消息",
610
+ key: "1"
611
+ }, {
612
+ label: "已读消息",
613
+ key: "2"
614
+ }]
615
+ }
616
+ },
617
+ emits: ["update:modelValue", "change"],
618
+ setup(e, {
619
+ emit: o
620
+ }) {
621
+ const s = e, u = o;
622
+ function l(a) {
623
+ a !== s.modelValue && (u("update:modelValue", a), u("change", a));
624
+ }
625
+ return (a, i) => (n(), b("div", Je, [(n(!0), b(R, null, G(e.tabs, (r) => (n(), b("span", {
626
+ key: r.key,
627
+ class: V(["custom-tab", [{
628
+ active: e.modelValue === r.key
629
+ }]]),
630
+ onClick: (c) => l(r.key)
631
+ }, w(r.label), 11, Qe))), 128))]));
632
+ }
633
+ }), Xe = /* @__PURE__ */ L(We, [["__scopeId", "data-v-fafcc3ad"]]), Ye = {
634
+ class: "tabs"
635
+ }, Ze = /* @__PURE__ */ N({
636
+ __name: "MessageTabs",
637
+ props: {
638
+ tabs: {
639
+ type: Array,
640
+ required: !0
641
+ },
642
+ messageList: {
643
+ type: Array,
644
+ required: !0
645
+ },
646
+ activeTab: {
647
+ type: String,
648
+ required: !0
649
+ }
650
+ },
651
+ emits: ["update:activeTab", "change", "readAll"],
652
+ setup(e, {
653
+ emit: o
654
+ }) {
655
+ const s = e, u = o, l = m(s.activeTab);
656
+ te(() => s.activeTab, (r) => {
657
+ l.value = r;
658
+ });
659
+ function a(r) {
660
+ l.value = r, u("update:activeTab", r), u("change", r);
661
+ }
662
+ function i() {
663
+ s.messageList.length !== 0 && u("readAll");
664
+ }
665
+ return (r, c) => (n(), b("div", Ye, [$(Xe, {
666
+ modelValue: l.value,
667
+ "onUpdate:modelValue": c[0] || (c[0] = (g) => l.value = g),
668
+ tabs: e.tabs,
669
+ onChange: a
670
+ }, null, 8, ["modelValue", "tabs"]), l.value === "unread" ? (n(), b("div", {
671
+ key: 0,
672
+ class: V(["readAll", {
673
+ disabled: e.messageList.length === 0
674
+ }]),
675
+ onClick: i
676
+ }, [$(t(fe), {
677
+ class: "icon",
678
+ icon: "icon-park-outline:clear"
679
+ }), c[1] || (c[1] = S("span", null, " 全部已读", -1))], 2)) : h("", !0)]));
680
+ }
681
+ }), et = /* @__PURE__ */ L(Ze, [["__scopeId", "data-v-91277265"]]), tt = {
682
+ class: "message-panel"
683
+ }, q = "system", st = /* @__PURE__ */ N({
684
+ __name: "MessageNotifications",
685
+ setup(e) {
686
+ const o = m(!0), s = m(""), u = m(!1), l = m({
687
+ title: "",
688
+ content: null
689
+ }), a = m(!1), i = m(!1), r = m([]), c = m("unread"), g = m({
690
+ current: 1,
691
+ pageSize: 10,
692
+ total: 0
693
+ }), C = [{
694
+ label: "未读消息",
695
+ key: "unread"
696
+ }, {
697
+ label: "已读消息",
698
+ key: "read"
699
+ }], y = J(() => c.value === "read");
700
+ async function f() {
701
+ a.value = !0;
702
+ try {
703
+ const {
704
+ data: M
705
+ } = await P({
706
+ current: g.value.current,
707
+ pageSize: g.value.pageSize,
708
+ where: {
709
+ type: q,
710
+ read: y.value
711
+ }
712
+ });
713
+ r.value = M.items.map((_) => ({
714
+ id: _.id,
715
+ title: _.title,
716
+ description: _.description,
717
+ createAt: _.createAt,
718
+ updateAt: _.updateAt,
719
+ type: _.type,
720
+ priority: _.priority,
721
+ read: _.read ?? !1,
722
+ readAt: _.readAt ?? null
723
+ })), g.value.total = M.count, i.value = M.items.length < g.value.pageSize;
724
+ } finally {
725
+ a.value = !1;
726
+ }
727
+ }
728
+ async function p() {
729
+ if (!(a.value || i.value)) {
730
+ g.value.current += 1, a.value = !0;
731
+ try {
732
+ const {
733
+ data: M
734
+ } = await P({
735
+ current: g.value.current,
736
+ pageSize: g.value.pageSize,
737
+ where: {
738
+ type: q,
739
+ read: y.value
740
+ }
741
+ }), _ = M.items.map((A) => ({
742
+ id: A.id,
743
+ title: A.title,
744
+ description: A.description,
745
+ createAt: A.createAt,
746
+ updateAt: A.updateAt,
747
+ type: A.type,
748
+ priority: A.priority,
749
+ read: A.read ?? !1,
750
+ readAt: A.readAt ?? null
751
+ }));
752
+ r.value = [...r.value, ..._], i.value = M.items.length < g.value.pageSize;
753
+ } finally {
754
+ a.value = !1;
755
+ }
756
+ }
757
+ }
758
+ function z() {
759
+ g.value.current = 1, i.value = !1, f();
760
+ }
761
+ async function I() {
762
+ r.value.length !== 0 && (await ue({
763
+ type: q
764
+ }), f());
765
+ }
766
+ function X() {
767
+ o.value = !0, s.value = "", l.value = {
768
+ title: "",
769
+ content: null
770
+ };
771
+ }
772
+ async function Y(M) {
773
+ u.value = !0;
774
+ try {
775
+ const {
776
+ data: _
777
+ } = await ce({
778
+ id: M
779
+ });
780
+ l.value = {
781
+ title: _.title,
782
+ content: _.content
783
+ };
784
+ } finally {
785
+ u.value = !1;
786
+ }
787
+ }
788
+ async function Z(M) {
789
+ s.value = M.id, o.value = !1, M.read || await de({
790
+ messageId: M.id
791
+ }), Y(M.id);
792
+ }
793
+ return f(), (M, _) => (n(), b("div", tt, [o.value ? h("", !0) : (n(), v(t(E), {
794
+ key: 0,
795
+ class: "message-panel__breadcrumb"
796
+ }, {
797
+ default: d(() => [$(t(B), {
798
+ onClick: X
799
+ }, {
800
+ default: d(() => [..._[1] || (_[1] = [k("消息通知", -1)])]),
801
+ _: 1
802
+ }), $(t(B), null, {
803
+ default: d(() => [..._[2] || (_[2] = [k("详情", -1)])]),
804
+ _: 1
805
+ })]),
806
+ _: 1
807
+ })), o.value ? (n(), v(et, {
808
+ key: 1,
809
+ "active-tab": c.value,
810
+ "onUpdate:activeTab": _[0] || (_[0] = (A) => c.value = A),
811
+ tabs: C,
812
+ "message-list": r.value,
813
+ onChange: z,
814
+ onReadAll: I
815
+ }, null, 8, ["active-tab", "message-list"])) : h("", !0), o.value ? (n(), v(K, {
816
+ key: 2,
817
+ "message-list": r.value,
818
+ loading: a.value,
819
+ finished: i.value,
820
+ "show-read-status": !0,
821
+ "show-view-button": !1,
822
+ onItemClick: Z,
823
+ onLoadMore: p
824
+ }, {
825
+ tags: d(({
826
+ item: A
827
+ }) => [A.priority === "urgent" ? (n(), v(t(x), {
828
+ key: 0,
829
+ color: "red",
830
+ size: "small"
831
+ }, {
832
+ default: d(() => [..._[3] || (_[3] = [k("紧急", -1)])]),
833
+ _: 1
834
+ })) : A.priority === "high" ? (n(), v(t(x), {
835
+ key: 1,
836
+ color: "orange",
837
+ size: "small"
838
+ }, {
839
+ default: d(() => [..._[4] || (_[4] = [k("高", -1)])]),
840
+ _: 1
841
+ })) : h("", !0)]),
842
+ _: 1
843
+ }, 8, ["message-list", "loading", "finished"])) : (n(), v(F, {
844
+ key: 3,
845
+ title: l.value.title,
846
+ content: l.value.content,
847
+ loading: u.value
848
+ }, null, 8, ["title", "content", "loading"]))]));
849
+ }
850
+ }), at = /* @__PURE__ */ L(st, [["__scopeId", "data-v-2fe260dd"]]);
851
+ function nt(e) {
852
+ return D({
853
+ url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/find`,
854
+ method: "post",
855
+ data: e
856
+ });
857
+ }
858
+ function it(e) {
859
+ return D({
860
+ url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/findOne`,
861
+ method: "post",
862
+ data: e
863
+ });
864
+ }
865
+ const ot = /* @__PURE__ */ N({
866
+ __name: "MessageNoticeNotificationsDetails",
867
+ props: {
868
+ id: {
869
+ type: String,
870
+ required: !0
871
+ }
872
+ },
873
+ setup(e) {
874
+ const o = m(!1), s = m(null), u = m(""), l = e;
875
+ function a() {
876
+ o.value = !0, it({
877
+ id: l.id
878
+ }).then(({
879
+ data: i
880
+ }) => {
881
+ s.value = i.content, u.value = i.title, o.value = !1;
882
+ }).catch((i) => {
883
+ console.error("获取通知详情失败:", i), o.value = !1;
884
+ });
885
+ }
886
+ return a(), (i, r) => (n(), v(F, {
887
+ content: s.value,
888
+ title: u.value,
889
+ loading: o.value
890
+ }, null, 8, ["content", "title", "loading"]));
891
+ }
892
+ }), lt = {
893
+ class: "message-panel"
894
+ }, rt = {
895
+ key: 0,
896
+ class: "expire-time"
897
+ }, ut = /* @__PURE__ */ N({
898
+ __name: "MessageNoticeNotifications",
899
+ setup(e) {
900
+ const {
901
+ isList: o,
902
+ detailId: s,
903
+ loading: u,
904
+ finished: l,
905
+ messageList: a,
906
+ loadMore: i,
907
+ toList: r,
908
+ openDetail: c
909
+ } = H((y) => nt({
910
+ ...y,
911
+ where: {
912
+ status: "published"
913
+ }
914
+ }));
915
+ function g(y) {
916
+ return {
917
+ published: "green",
918
+ expired: "gray"
919
+ }[y] || "gray";
920
+ }
921
+ function C(y) {
922
+ return {
923
+ published: "有效",
924
+ expired: "已过期"
925
+ }[y] || "未知";
926
+ }
927
+ return (y, f) => (n(), b("div", lt, [t(o) ? h("", !0) : (n(), v(t(E), {
928
+ key: 0,
929
+ class: "message-panel__breadcrumb"
930
+ }, {
931
+ default: d(() => [$(t(B), {
932
+ onClick: t(r)
933
+ }, {
934
+ default: d(() => [...f[0] || (f[0] = [k("公告通知", -1)])]),
935
+ _: 1
936
+ }, 8, ["onClick"]), $(t(B), null, {
937
+ default: d(() => [...f[1] || (f[1] = [k("详情", -1)])]),
938
+ _: 1
939
+ })]),
940
+ _: 1
941
+ })), t(o) ? (n(), v(K, {
942
+ key: 1,
943
+ "message-list": t(a),
944
+ loading: t(u),
945
+ finished: t(l),
946
+ onItemClick: t(c),
947
+ onLoadMore: t(i)
948
+ }, {
949
+ tags: d(({
950
+ item: p
951
+ }) => [p.priority === "urgent" ? (n(), v(t(x), {
952
+ key: 0,
953
+ color: "red",
954
+ size: "small"
955
+ }, {
956
+ default: d(() => [...f[2] || (f[2] = [k("紧急", -1)])]),
957
+ _: 1
958
+ })) : p.priority === "important" ? (n(), v(t(x), {
959
+ key: 1,
960
+ color: "orange",
961
+ size: "small"
962
+ }, {
963
+ default: d(() => [...f[3] || (f[3] = [k("重要", -1)])]),
964
+ _: 1
965
+ })) : h("", !0), $(t(x), {
966
+ color: g(p.displayStatus),
967
+ size: "small"
968
+ }, {
969
+ default: d(() => [k(w(C(p.displayStatus)), 1)]),
970
+ _: 2
971
+ }, 1032, ["color"])]),
972
+ footer: d(({
973
+ item: p
974
+ }) => [p.expireAt ? (n(), b("span", rt, w(p.displayStatus === "expired" ? "已过期" : `过期时间: ${p.expireAt}`), 1)) : h("", !0)]),
975
+ _: 1
976
+ }, 8, ["message-list", "loading", "finished", "onItemClick", "onLoadMore"])) : (n(), v(ot, {
977
+ key: 2,
978
+ id: t(s)
979
+ }, null, 8, ["id"]))]));
980
+ }
981
+ }), dt = /* @__PURE__ */ L(ut, [["__scopeId", "data-v-7bde4425"]]), ct = {
982
+ class: "content"
983
+ }, ft = {
984
+ class: "left"
985
+ }, pt = /* @__PURE__ */ N({
986
+ __name: "MessageAppMessage",
987
+ props: /* @__PURE__ */ j({
988
+ menus: {
989
+ type: Array,
990
+ required: !0
991
+ }
992
+ }, {
993
+ selectedKeys: {
994
+ default: ["ChangelogNotifications"]
995
+ },
996
+ selectedKeysModifiers: {}
997
+ }),
998
+ emits: /* @__PURE__ */ j(["cancel", "change"], ["update:selectedKeys"]),
999
+ setup(e, {
1000
+ expose: o,
1001
+ emit: s
1002
+ }) {
1003
+ const u = e, l = s, a = se(e, "selectedKeys"), i = J(() => a.value.length !== 0 ? a.value[0] : "");
1004
+ function r() {
1005
+ l("cancel");
1006
+ }
1007
+ function c(f, p) {
1008
+ const z = f.path;
1009
+ a.value = [z], l("change", f, p);
1010
+ }
1011
+ const {
1012
+ changeType: g,
1013
+ show: C
1014
+ } = pe(l);
1015
+ function y(f) {
1016
+ C.value = f, g.value = "编辑";
1017
+ }
1018
+ return o({
1019
+ setData: y
1020
+ }), (f, p) => (n(), v(t(ie), {
1021
+ visible: t(C),
1022
+ "onUpdate:visible": p[1] || (p[1] = (z) => ae(C) ? C.value = z : null),
1023
+ loading: !1,
1024
+ "body-class": "AppMessagebodyClass",
1025
+ "mask-closable": !1,
1026
+ footer: !1,
1027
+ "hide-title": !1,
1028
+ width: "880px",
1029
+ onCancel: r
1030
+ }, {
1031
+ default: d(() => [S("div", ct, [S("div", ft, [$(ge, {
1032
+ "selected-keys": a.value,
1033
+ "onUpdate:selectedKeys": p[0] || (p[0] = (z) => a.value = z),
1034
+ menus: u.menus,
1035
+ onChange: c
1036
+ }, null, 8, ["selected-keys", "menus"])]), t(C) ? (n(), b(R, {
1037
+ key: 0
1038
+ }, [i.value === "ChangelogNotifications" ? (n(), v(Ee, {
1039
+ key: 0
1040
+ })) : h("", !0), i.value === "EventNotifications" ? (n(), v(Ge, {
1041
+ key: 1
1042
+ })) : h("", !0), i.value === "MessageNotifications" ? (n(), v(at, {
1043
+ key: 2
1044
+ })) : h("", !0), i.value === "NoticeNotifications" ? (n(), v(dt, {
1045
+ key: 3
1046
+ })) : h("", !0)], 64)) : h("", !0)])]),
1047
+ _: 1
1048
+ }, 8, ["visible"]));
1049
+ }
1050
+ }), gt = /* @__PURE__ */ L(pt, [["__scopeId", "data-v-8f921467"]]), mt = /* @__PURE__ */ N({
1051
+ __name: "MessageHandle",
1052
+ setup(e, {
1053
+ expose: o
1054
+ }) {
1055
+ const s = m(["ChangelogNotifications"]), u = m(), l = m(Symbol("key"));
1056
+ function a() {
1057
+ u.value.setData(!0);
1058
+ }
1059
+ function i() {
1060
+ l.value = Symbol("key");
1061
+ }
1062
+ function r() {
1063
+ l.value = Symbol("key");
1064
+ }
1065
+ const c = m([{
1066
+ name: "功能变更",
1067
+ path: "ChangelogNotifications",
1068
+ meta: {
1069
+ icon: "mingcute:cube-3d-fill"
1070
+ }
1071
+ }, {
1072
+ name: "活动通知",
1073
+ path: "EventNotifications",
1074
+ meta: {
1075
+ icon: "mingcute:receive-money-fill"
1076
+ }
1077
+ }, {
1078
+ name: "消息通知",
1079
+ path: "MessageNotifications",
1080
+ meta: {
1081
+ icon: "mingcute:message-1-fill"
1082
+ }
1083
+ }, {
1084
+ name: "公告",
1085
+ path: "NoticeNotifications",
1086
+ meta: {
1087
+ icon: "mingcute:announcement-fill"
1088
+ }
1089
+ }]);
1090
+ return o({
1091
+ openNotification: a
1092
+ }), (g, C) => (n(), v(gt, {
1093
+ ref_key: "MessageNotificationsRef",
1094
+ ref: u,
1095
+ key: l.value,
1096
+ "selected-keys": s.value,
1097
+ "onUpdate:selectedKeys": C[0] || (C[0] = (y) => s.value = y),
1098
+ menus: c.value,
1099
+ title: "消息中心",
1100
+ onConfirm: r,
1101
+ onCancel: i
1102
+ }, null, 8, ["selected-keys", "menus"]));
1103
+ }
1104
+ }), xt = /* @__PURE__ */ L(mt, [["__scopeId", "data-v-dd5fd3b4"]]);
1105
+ export {
1106
+ gt as A,
1107
+ Ee as C,
1108
+ F as D,
1109
+ Ge as E,
1110
+ Ce as I,
1111
+ xt as M,
1112
+ dt as N,
1113
+ _e as _,
1114
+ Xe as a,
1115
+ qe as b,
1116
+ K as c,
1117
+ at as d,
1118
+ et as e,
1119
+ ot as f
1120
+ };