@huyooo/ui 0.7.3 → 0.7.5

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