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