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