@huyooo/ui 0.6.12 → 0.6.14

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