@huyooo/ui 0.7.4 → 0.7.6
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.
- package/dist/MessageHandle-CdBq2aDG.js +1231 -0
- package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-JL-A5Mot.js +143 -0
- package/dist/{UserAccountMenu-p5U7UNro.js → UserAccountMenu-B8HuXICE.js} +1 -1
- package/dist/{WidthContainer-Cg_13I5r.js → WidthContainer-BMroU2bt.js} +1 -1
- package/dist/api/Message/NoticeNotifications.d.ts +21 -1
- package/dist/common.js +1 -1
- package/dist/index.js +9 -9
- package/dist/message.js +7 -7
- package/dist/style.css +1 -1
- package/dist/user.js +1 -1
- package/package.json +1 -1
- package/dist/MessageHandle-Bn5JXhlv.js +0 -1130
- package/dist/MessageMenu-_RZJ9Mbi.js +0 -114
|
@@ -0,0 +1,1231 @@
|
|
|
1
|
+
import { ref as p, defineComponent as x, createBlock as _, openBlock as s, unref as i, withCtx as f, createVNode as $, createCommentVNode as A, createElementBlock as b, normalizeClass as K, createElementVNode as L, renderSlot as D, toDisplayString as T, createTextVNode as w, 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 _e } from "./Menu-BjWB9hre.js";
|
|
16
|
+
function he(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 S() {
|
|
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 k() {
|
|
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 y() {
|
|
74
|
+
c.value.current = 1, n.value = !1, await S();
|
|
75
|
+
}
|
|
76
|
+
function h() {
|
|
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 C = u.value.find((v) => v.id === M);
|
|
84
|
+
C && C.read !== void 0 && (C.read = !0);
|
|
85
|
+
}
|
|
86
|
+
function E(M) {
|
|
87
|
+
const C = u.value.find((v) => v.id === M);
|
|
88
|
+
C && C.read !== void 0 && (C.read = !1);
|
|
89
|
+
}
|
|
90
|
+
return S(), {
|
|
91
|
+
// 状态
|
|
92
|
+
isList: r,
|
|
93
|
+
detailId: t,
|
|
94
|
+
loading: o,
|
|
95
|
+
finished: n,
|
|
96
|
+
messageList: u,
|
|
97
|
+
pagination: c,
|
|
98
|
+
// 方法
|
|
99
|
+
loadData: S,
|
|
100
|
+
loadMore: k,
|
|
101
|
+
refresh: y,
|
|
102
|
+
toList: h,
|
|
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(), _(i(ee), {
|
|
133
|
+
loading: d.loading,
|
|
134
|
+
tip: "文档加载中...",
|
|
135
|
+
class: "Spin",
|
|
136
|
+
dot: ""
|
|
137
|
+
}, {
|
|
138
|
+
default: f(() => [$(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(() => [$(i(ce), {
|
|
147
|
+
"model-value": d.title,
|
|
148
|
+
editable: r.value
|
|
149
|
+
}, null, 8, ["model-value", "editable"])]),
|
|
150
|
+
_: 1
|
|
151
|
+
}, 8, ["model-value", "editable"]), A("", !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(), _(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(), b("div", {
|
|
229
|
+
ref_key: "container",
|
|
230
|
+
ref: r,
|
|
231
|
+
class: "infinite-loading"
|
|
232
|
+
}, [e.loading ? (s(), b("div", Ae, [$(i(ee), {
|
|
233
|
+
tip: e.loadingText
|
|
234
|
+
}, null, 8, ["tip"])])) : A("", !0), e.finished && e.showFinishedText ? (s(), b("div", $e, [$(i(te), {
|
|
235
|
+
description: e.finishedText
|
|
236
|
+
}, null, 8, ["description"])])) : A("", !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(), b("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(), b("span", {
|
|
273
|
+
key: 0,
|
|
274
|
+
class: K(["message-item__dot", {
|
|
275
|
+
"message-item__dot--unread": !e.item.read
|
|
276
|
+
}])
|
|
277
|
+
}, null, 2)) : A("", !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(), _(i(B), {
|
|
280
|
+
key: 0,
|
|
281
|
+
color: "arcoblue",
|
|
282
|
+
size: "small"
|
|
283
|
+
}, {
|
|
284
|
+
default: f(() => [...a[1] || (a[1] = [w("置顶", -1)])]),
|
|
285
|
+
_: 1
|
|
286
|
+
})) : A("", !0), D(l.$slots, "tags", {
|
|
287
|
+
item: e.item
|
|
288
|
+
}, () => [e.item.priority === "urgent" ? (s(), _(i(B), {
|
|
289
|
+
key: 0,
|
|
290
|
+
color: "red",
|
|
291
|
+
size: "small"
|
|
292
|
+
}, {
|
|
293
|
+
default: f(() => [...a[2] || (a[2] = [w("紧急", -1)])]),
|
|
294
|
+
_: 1
|
|
295
|
+
})) : e.item.priority === "important" ? (s(), _(i(B), {
|
|
296
|
+
key: 1,
|
|
297
|
+
color: "orange",
|
|
298
|
+
size: "small"
|
|
299
|
+
}, {
|
|
300
|
+
default: f(() => [...a[3] || (a[3] = [w("重要", -1)])]),
|
|
301
|
+
_: 1
|
|
302
|
+
})) : e.item.priority === "high" ? (s(), _(i(B), {
|
|
303
|
+
key: 2,
|
|
304
|
+
color: "orange",
|
|
305
|
+
size: "small"
|
|
306
|
+
}, {
|
|
307
|
+
default: f(() => [...a[4] || (a[4] = [w("高", -1)])]),
|
|
308
|
+
_: 1
|
|
309
|
+
})) : A("", !0)], !0)])]), L("div", Te, [D(l.$slots, "description", {
|
|
310
|
+
item: e.item
|
|
311
|
+
}, () => [w(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(), _(i(re), {
|
|
316
|
+
key: 0,
|
|
317
|
+
type: "text",
|
|
318
|
+
size: "small"
|
|
319
|
+
}, {
|
|
320
|
+
default: f(() => [...a[5] || (a[5] = [w("查看", -1)])]),
|
|
321
|
+
_: 1
|
|
322
|
+
})) : A("", !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(), b("div", Ue, [a.messageList.length === 0 && !a.loading ? (s(), b("div", Oe, [$(i(te), {
|
|
355
|
+
description: "暂无消息"
|
|
356
|
+
})])) : (s(), b(H, {
|
|
357
|
+
key: 1
|
|
358
|
+
}, [(s(!0), b(H, null, Z(a.messageList, (n) => (s(), _(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)), $(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 = {
|
|
410
|
+
key: 2,
|
|
411
|
+
class: "message-panel__detail"
|
|
412
|
+
}, He = /* @__PURE__ */ x({
|
|
413
|
+
__name: "MessageChangelogNotifications",
|
|
414
|
+
setup(e) {
|
|
415
|
+
const {
|
|
416
|
+
isList: l,
|
|
417
|
+
detailId: a,
|
|
418
|
+
loading: d,
|
|
419
|
+
finished: r,
|
|
420
|
+
messageList: t,
|
|
421
|
+
loadMore: o,
|
|
422
|
+
toList: n,
|
|
423
|
+
openDetail: u
|
|
424
|
+
} = ae(he);
|
|
425
|
+
function c(k) {
|
|
426
|
+
return {
|
|
427
|
+
feature: "green",
|
|
428
|
+
improvement: "blue",
|
|
429
|
+
fix: "orange",
|
|
430
|
+
security: "red",
|
|
431
|
+
breaking: "magenta"
|
|
432
|
+
}[k] || "blue";
|
|
433
|
+
}
|
|
434
|
+
function S(k) {
|
|
435
|
+
return {
|
|
436
|
+
feature: "新功能",
|
|
437
|
+
improvement: "优化",
|
|
438
|
+
fix: "修复",
|
|
439
|
+
security: "安全",
|
|
440
|
+
breaking: "重大变更"
|
|
441
|
+
}[k] || "更新";
|
|
442
|
+
}
|
|
443
|
+
return (k, y) => (s(), b("div", Ee, [i(l) ? A("", !0) : (s(), _(i(j), {
|
|
444
|
+
key: 0,
|
|
445
|
+
class: "message-panel__breadcrumb"
|
|
446
|
+
}, {
|
|
447
|
+
default: f(() => [$(i(R), {
|
|
448
|
+
onClick: i(n)
|
|
449
|
+
}, {
|
|
450
|
+
default: f(() => [...y[0] || (y[0] = [w("更新日志", -1)])]),
|
|
451
|
+
_: 1
|
|
452
|
+
}, 8, ["onClick"]), $(i(R), null, {
|
|
453
|
+
default: f(() => [...y[1] || (y[1] = [w("详情", -1)])]),
|
|
454
|
+
_: 1
|
|
455
|
+
})]),
|
|
456
|
+
_: 1
|
|
457
|
+
})), i(l) ? (s(), _(G, {
|
|
458
|
+
key: 1,
|
|
459
|
+
"message-list": i(t),
|
|
460
|
+
loading: i(d),
|
|
461
|
+
finished: i(r),
|
|
462
|
+
onItemClick: i(u),
|
|
463
|
+
onLoadMore: i(o)
|
|
464
|
+
}, {
|
|
465
|
+
prefix: f(({
|
|
466
|
+
item: h
|
|
467
|
+
}) => [L("span", qe, T(h.version), 1)]),
|
|
468
|
+
tags: f(({
|
|
469
|
+
item: h
|
|
470
|
+
}) => [$(i(B), {
|
|
471
|
+
color: c(h.changeType),
|
|
472
|
+
size: "small"
|
|
473
|
+
}, {
|
|
474
|
+
default: f(() => [w(T(S(h.changeType)), 1)]),
|
|
475
|
+
_: 2
|
|
476
|
+
}, 1032, ["color"])]),
|
|
477
|
+
footer: f(({
|
|
478
|
+
item: h
|
|
479
|
+
}) => [h.publishedAt ? (s(), b("span", Fe, " 发布于 " + T(h.publishedAt), 1)) : A("", !0)]),
|
|
480
|
+
_: 1
|
|
481
|
+
}, 8, ["message-list", "loading", "finished", "onItemClick", "onLoadMore"])) : (s(), b("div", Ke, [$(Ce, {
|
|
482
|
+
id: i(a)
|
|
483
|
+
}, null, 8, ["id"])]))]));
|
|
484
|
+
}
|
|
485
|
+
}), je = /* @__PURE__ */ I(He, [["__scopeId", "data-v-b50402cc"]]);
|
|
486
|
+
function Pe(e) {
|
|
487
|
+
return U({
|
|
488
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/eventNotifications/find`,
|
|
489
|
+
method: "post",
|
|
490
|
+
data: e
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function Ge(e) {
|
|
494
|
+
return U({
|
|
495
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/eventNotifications/findOne`,
|
|
496
|
+
method: "post",
|
|
497
|
+
data: e
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
const Je = /* @__PURE__ */ x({
|
|
501
|
+
__name: "MessageEventNotificationsDetails",
|
|
502
|
+
props: {
|
|
503
|
+
id: {
|
|
504
|
+
type: String,
|
|
505
|
+
required: !0
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
setup(e) {
|
|
509
|
+
const l = p(!1), a = p(null), d = p(""), r = e;
|
|
510
|
+
function t() {
|
|
511
|
+
l.value = !0, Ge({
|
|
512
|
+
id: r.id
|
|
513
|
+
}).then(({
|
|
514
|
+
data: o
|
|
515
|
+
}) => {
|
|
516
|
+
a.value = o.content, d.value = o.title, l.value = !1;
|
|
517
|
+
}).catch((o) => {
|
|
518
|
+
console.error("获取事件通知详情失败:", o), l.value = !1;
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
return t(), (o, n) => (s(), _(P, {
|
|
522
|
+
content: a.value,
|
|
523
|
+
title: d.value,
|
|
524
|
+
loading: l.value
|
|
525
|
+
}, null, 8, ["content", "title", "loading"]));
|
|
526
|
+
}
|
|
527
|
+
}), Qe = {
|
|
528
|
+
class: "message-panel"
|
|
529
|
+
}, We = {
|
|
530
|
+
key: 0,
|
|
531
|
+
class: "time-range"
|
|
532
|
+
}, Xe = {
|
|
533
|
+
key: 2,
|
|
534
|
+
class: "message-panel__detail"
|
|
535
|
+
}, Ye = /* @__PURE__ */ x({
|
|
536
|
+
__name: "MessageEventNotifications",
|
|
537
|
+
setup(e) {
|
|
538
|
+
const {
|
|
539
|
+
isList: l,
|
|
540
|
+
detailId: a,
|
|
541
|
+
loading: d,
|
|
542
|
+
finished: r,
|
|
543
|
+
messageList: t,
|
|
544
|
+
loadMore: o,
|
|
545
|
+
toList: n,
|
|
546
|
+
openDetail: u
|
|
547
|
+
} = ae((k) => Pe({
|
|
548
|
+
...k,
|
|
549
|
+
where: {
|
|
550
|
+
status: "published"
|
|
551
|
+
}
|
|
552
|
+
}));
|
|
553
|
+
function c(k) {
|
|
554
|
+
return {
|
|
555
|
+
upcoming: "blue",
|
|
556
|
+
ongoing: "green",
|
|
557
|
+
ended: "gray",
|
|
558
|
+
published: "arcoblue"
|
|
559
|
+
}[k] || "gray";
|
|
560
|
+
}
|
|
561
|
+
function S(k) {
|
|
562
|
+
return {
|
|
563
|
+
upcoming: "即将开始",
|
|
564
|
+
ongoing: "进行中",
|
|
565
|
+
ended: "已结束",
|
|
566
|
+
published: "已发布"
|
|
567
|
+
}[k] || "未知";
|
|
568
|
+
}
|
|
569
|
+
return (k, y) => (s(), b("div", Qe, [i(l) ? A("", !0) : (s(), _(i(j), {
|
|
570
|
+
key: 0,
|
|
571
|
+
class: "message-panel__breadcrumb"
|
|
572
|
+
}, {
|
|
573
|
+
default: f(() => [$(i(R), {
|
|
574
|
+
onClick: i(n)
|
|
575
|
+
}, {
|
|
576
|
+
default: f(() => [...y[0] || (y[0] = [w("活动通知", -1)])]),
|
|
577
|
+
_: 1
|
|
578
|
+
}, 8, ["onClick"]), $(i(R), null, {
|
|
579
|
+
default: f(() => [...y[1] || (y[1] = [w("详情", -1)])]),
|
|
580
|
+
_: 1
|
|
581
|
+
})]),
|
|
582
|
+
_: 1
|
|
583
|
+
})), i(l) ? (s(), _(G, {
|
|
584
|
+
key: 1,
|
|
585
|
+
"message-list": i(t),
|
|
586
|
+
loading: i(d),
|
|
587
|
+
finished: i(r),
|
|
588
|
+
onItemClick: i(u),
|
|
589
|
+
onLoadMore: i(o)
|
|
590
|
+
}, {
|
|
591
|
+
tags: f(({
|
|
592
|
+
item: h
|
|
593
|
+
}) => [$(i(B), {
|
|
594
|
+
color: c(h.displayStatus),
|
|
595
|
+
size: "small"
|
|
596
|
+
}, {
|
|
597
|
+
default: f(() => [w(T(S(h.displayStatus)), 1)]),
|
|
598
|
+
_: 2
|
|
599
|
+
}, 1032, ["color"])]),
|
|
600
|
+
footer: f(({
|
|
601
|
+
item: h
|
|
602
|
+
}) => [h.startAt || h.endAt ? (s(), b("span", We, T(h.startAt || "无") + " ~ " + T(h.endAt || "无"), 1)) : A("", !0)]),
|
|
603
|
+
_: 1
|
|
604
|
+
}, 8, ["message-list", "loading", "finished", "onItemClick", "onLoadMore"])) : (s(), b("div", Xe, [$(Je, {
|
|
605
|
+
id: i(a)
|
|
606
|
+
}, null, 8, ["id"])]))]));
|
|
607
|
+
}
|
|
608
|
+
}), Ze = /* @__PURE__ */ I(Ye, [["__scopeId", "data-v-ec35e6c3"]]), et = {
|
|
609
|
+
style: {
|
|
610
|
+
display: "flex",
|
|
611
|
+
gap: "16px"
|
|
612
|
+
}
|
|
613
|
+
}, tt = ["onClick"], at = /* @__PURE__ */ x({
|
|
614
|
+
__name: "MessageCustomTabs",
|
|
615
|
+
props: {
|
|
616
|
+
modelValue: {
|
|
617
|
+
type: String,
|
|
618
|
+
default: "1"
|
|
619
|
+
},
|
|
620
|
+
tabs: {
|
|
621
|
+
type: Array,
|
|
622
|
+
default: () => [{
|
|
623
|
+
label: "未读消息",
|
|
624
|
+
key: "1"
|
|
625
|
+
}, {
|
|
626
|
+
label: "已读消息",
|
|
627
|
+
key: "2"
|
|
628
|
+
}]
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
emits: ["update:modelValue", "change"],
|
|
632
|
+
setup(e, {
|
|
633
|
+
emit: l
|
|
634
|
+
}) {
|
|
635
|
+
const a = e, d = l;
|
|
636
|
+
function r(t) {
|
|
637
|
+
t !== a.modelValue && (d("update:modelValue", t), d("change", t));
|
|
638
|
+
}
|
|
639
|
+
return (t, o) => (s(), b("div", et, [(s(!0), b(H, null, Z(e.tabs, (n) => (s(), b("span", {
|
|
640
|
+
key: n.key,
|
|
641
|
+
class: K(["custom-tab", [{
|
|
642
|
+
active: e.modelValue === n.key
|
|
643
|
+
}]]),
|
|
644
|
+
onClick: (u) => r(n.key)
|
|
645
|
+
}, T(n.label), 11, tt))), 128))]));
|
|
646
|
+
}
|
|
647
|
+
}), st = /* @__PURE__ */ I(at, [["__scopeId", "data-v-fafcc3ad"]]), nt = {
|
|
648
|
+
class: "tabs"
|
|
649
|
+
}, it = /* @__PURE__ */ x({
|
|
650
|
+
__name: "MessageTabs",
|
|
651
|
+
props: {
|
|
652
|
+
tabs: {
|
|
653
|
+
type: Array,
|
|
654
|
+
required: !0
|
|
655
|
+
},
|
|
656
|
+
messageList: {
|
|
657
|
+
type: Array,
|
|
658
|
+
required: !0
|
|
659
|
+
},
|
|
660
|
+
activeTab: {
|
|
661
|
+
type: String,
|
|
662
|
+
required: !0
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
emits: ["update:activeTab", "change", "readAll"],
|
|
666
|
+
setup(e, {
|
|
667
|
+
emit: l
|
|
668
|
+
}) {
|
|
669
|
+
const a = e, d = l, r = p(a.activeTab);
|
|
670
|
+
ie(() => a.activeTab, (n) => {
|
|
671
|
+
r.value = n;
|
|
672
|
+
});
|
|
673
|
+
function t(n) {
|
|
674
|
+
r.value = n, d("update:activeTab", n), d("change", n);
|
|
675
|
+
}
|
|
676
|
+
function o() {
|
|
677
|
+
a.messageList.length !== 0 && d("readAll");
|
|
678
|
+
}
|
|
679
|
+
return (n, u) => (s(), b("div", nt, [$(st, {
|
|
680
|
+
modelValue: r.value,
|
|
681
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
682
|
+
tabs: e.tabs,
|
|
683
|
+
onChange: t
|
|
684
|
+
}, null, 8, ["modelValue", "tabs"]), r.value === "unread" ? (s(), b("div", {
|
|
685
|
+
key: 0,
|
|
686
|
+
class: K(["readAll", {
|
|
687
|
+
disabled: e.messageList.length === 0
|
|
688
|
+
}]),
|
|
689
|
+
onClick: o
|
|
690
|
+
}, [$(i(me), {
|
|
691
|
+
class: "icon",
|
|
692
|
+
icon: "icon-park-outline:clear"
|
|
693
|
+
}), u[1] || (u[1] = L("span", null, " 全部已读", -1))], 2)) : A("", !0)]));
|
|
694
|
+
}
|
|
695
|
+
}), se = /* @__PURE__ */ I(it, [["__scopeId", "data-v-47f7fce5"]]), ot = {
|
|
696
|
+
class: "message-panel"
|
|
697
|
+
}, lt = {
|
|
698
|
+
key: 3,
|
|
699
|
+
class: "message-panel__detail"
|
|
700
|
+
}, J = "system", rt = /* @__PURE__ */ x({
|
|
701
|
+
__name: "MessageNotifications",
|
|
702
|
+
setup(e) {
|
|
703
|
+
const l = p(!0), a = p(""), d = p(!1), r = p({
|
|
704
|
+
title: "",
|
|
705
|
+
content: null
|
|
706
|
+
}), t = p(!1), o = p(!1), n = p([]), u = p("unread"), c = p({
|
|
707
|
+
current: 1,
|
|
708
|
+
pageSize: 10,
|
|
709
|
+
total: 0
|
|
710
|
+
}), S = [{
|
|
711
|
+
label: "未读消息",
|
|
712
|
+
key: "unread"
|
|
713
|
+
}, {
|
|
714
|
+
label: "已读消息",
|
|
715
|
+
key: "read"
|
|
716
|
+
}], k = Q(() => u.value === "read");
|
|
717
|
+
async function y() {
|
|
718
|
+
t.value = !0;
|
|
719
|
+
try {
|
|
720
|
+
const {
|
|
721
|
+
data: C
|
|
722
|
+
} = await X({
|
|
723
|
+
current: c.value.current,
|
|
724
|
+
pageSize: c.value.pageSize,
|
|
725
|
+
where: {
|
|
726
|
+
type: J,
|
|
727
|
+
read: k.value
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
n.value = C.items.map((v) => ({
|
|
731
|
+
id: v.id,
|
|
732
|
+
title: v.title,
|
|
733
|
+
description: v.description,
|
|
734
|
+
createAt: v.createAt,
|
|
735
|
+
updateAt: v.updateAt,
|
|
736
|
+
type: v.type,
|
|
737
|
+
priority: v.priority,
|
|
738
|
+
read: v.read ?? !1,
|
|
739
|
+
readAt: v.readAt ?? null
|
|
740
|
+
})), c.value.total = C.count, o.value = C.items.length < c.value.pageSize;
|
|
741
|
+
} finally {
|
|
742
|
+
t.value = !1;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
async function h() {
|
|
746
|
+
if (!(t.value || o.value)) {
|
|
747
|
+
c.value.current += 1, t.value = !0;
|
|
748
|
+
try {
|
|
749
|
+
const {
|
|
750
|
+
data: C
|
|
751
|
+
} = await X({
|
|
752
|
+
current: c.value.current,
|
|
753
|
+
pageSize: c.value.pageSize,
|
|
754
|
+
where: {
|
|
755
|
+
type: J,
|
|
756
|
+
read: k.value
|
|
757
|
+
}
|
|
758
|
+
}), v = C.items.map((g) => ({
|
|
759
|
+
id: g.id,
|
|
760
|
+
title: g.title,
|
|
761
|
+
description: g.description,
|
|
762
|
+
createAt: g.createAt,
|
|
763
|
+
updateAt: g.updateAt,
|
|
764
|
+
type: g.type,
|
|
765
|
+
priority: g.priority,
|
|
766
|
+
read: g.read ?? !1,
|
|
767
|
+
readAt: g.readAt ?? null
|
|
768
|
+
}));
|
|
769
|
+
n.value = [...n.value, ...v], o.value = C.items.length < c.value.pageSize;
|
|
770
|
+
} finally {
|
|
771
|
+
t.value = !1;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
function z() {
|
|
776
|
+
c.value.current = 1, o.value = !1, y();
|
|
777
|
+
}
|
|
778
|
+
async function V() {
|
|
779
|
+
n.value.length !== 0 && (await pe({
|
|
780
|
+
type: J
|
|
781
|
+
}), y());
|
|
782
|
+
}
|
|
783
|
+
function E() {
|
|
784
|
+
l.value = !0, a.value = "", r.value = {
|
|
785
|
+
title: "",
|
|
786
|
+
content: null
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
async function M(C) {
|
|
790
|
+
d.value = !0;
|
|
791
|
+
try {
|
|
792
|
+
const {
|
|
793
|
+
data: v
|
|
794
|
+
} = await ve({
|
|
795
|
+
id: C
|
|
796
|
+
});
|
|
797
|
+
r.value = {
|
|
798
|
+
title: v.title,
|
|
799
|
+
content: v.content
|
|
800
|
+
};
|
|
801
|
+
} finally {
|
|
802
|
+
d.value = !1;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
async function q(C) {
|
|
806
|
+
a.value = C.id, l.value = !1, C.read || (await ge({
|
|
807
|
+
messageId: C.id
|
|
808
|
+
}), k.value || (n.value = n.value.filter((v) => v.id !== C.id))), M(C.id);
|
|
809
|
+
}
|
|
810
|
+
return y(), (C, v) => (s(), b("div", ot, [l.value ? A("", !0) : (s(), _(i(j), {
|
|
811
|
+
key: 0,
|
|
812
|
+
class: "message-panel__breadcrumb"
|
|
813
|
+
}, {
|
|
814
|
+
default: f(() => [$(i(R), {
|
|
815
|
+
onClick: E
|
|
816
|
+
}, {
|
|
817
|
+
default: f(() => [...v[1] || (v[1] = [w("消息通知", -1)])]),
|
|
818
|
+
_: 1
|
|
819
|
+
}), $(i(R), null, {
|
|
820
|
+
default: f(() => [...v[2] || (v[2] = [w("详情", -1)])]),
|
|
821
|
+
_: 1
|
|
822
|
+
})]),
|
|
823
|
+
_: 1
|
|
824
|
+
})), l.value ? (s(), _(se, {
|
|
825
|
+
key: 1,
|
|
826
|
+
"active-tab": u.value,
|
|
827
|
+
"onUpdate:activeTab": v[0] || (v[0] = (g) => u.value = g),
|
|
828
|
+
tabs: S,
|
|
829
|
+
"message-list": n.value,
|
|
830
|
+
onChange: z,
|
|
831
|
+
onReadAll: V
|
|
832
|
+
}, null, 8, ["active-tab", "message-list"])) : A("", !0), l.value ? (s(), _(G, {
|
|
833
|
+
key: 2,
|
|
834
|
+
"message-list": n.value,
|
|
835
|
+
loading: t.value,
|
|
836
|
+
finished: o.value,
|
|
837
|
+
"show-read-status": !0,
|
|
838
|
+
"show-view-button": !1,
|
|
839
|
+
onItemClick: q,
|
|
840
|
+
onLoadMore: h
|
|
841
|
+
}, {
|
|
842
|
+
tags: f(({
|
|
843
|
+
item: g
|
|
844
|
+
}) => [g.priority === "urgent" ? (s(), _(i(B), {
|
|
845
|
+
key: 0,
|
|
846
|
+
color: "red",
|
|
847
|
+
size: "small"
|
|
848
|
+
}, {
|
|
849
|
+
default: f(() => [...v[3] || (v[3] = [w("紧急", -1)])]),
|
|
850
|
+
_: 1
|
|
851
|
+
})) : g.priority === "high" ? (s(), _(i(B), {
|
|
852
|
+
key: 1,
|
|
853
|
+
color: "orange",
|
|
854
|
+
size: "small"
|
|
855
|
+
}, {
|
|
856
|
+
default: f(() => [...v[4] || (v[4] = [w("高", -1)])]),
|
|
857
|
+
_: 1
|
|
858
|
+
})) : A("", !0)]),
|
|
859
|
+
_: 1
|
|
860
|
+
}, 8, ["message-list", "loading", "finished"])) : (s(), b("div", lt, [$(P, {
|
|
861
|
+
title: r.value.title,
|
|
862
|
+
content: r.value.content,
|
|
863
|
+
loading: d.value
|
|
864
|
+
}, null, 8, ["title", "content", "loading"])]))]));
|
|
865
|
+
}
|
|
866
|
+
}), ut = /* @__PURE__ */ I(rt, [["__scopeId", "data-v-118e16b5"]]);
|
|
867
|
+
function dt(e) {
|
|
868
|
+
return U({
|
|
869
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/findOne`,
|
|
870
|
+
method: "post",
|
|
871
|
+
data: e
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
function Y(e) {
|
|
875
|
+
return U({
|
|
876
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/own`,
|
|
877
|
+
method: "post",
|
|
878
|
+
data: e
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
function ct(e) {
|
|
882
|
+
return U({
|
|
883
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/read`,
|
|
884
|
+
method: "post",
|
|
885
|
+
data: e
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
function ft() {
|
|
889
|
+
return U({
|
|
890
|
+
url: `${O.prefixUrl}/restfulApi/messageCenter/noticeNotifications/readAll`,
|
|
891
|
+
method: "post",
|
|
892
|
+
data: {}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
const pt = {
|
|
896
|
+
class: "message-panel"
|
|
897
|
+
}, gt = {
|
|
898
|
+
key: 0,
|
|
899
|
+
class: "expire-time"
|
|
900
|
+
}, vt = {
|
|
901
|
+
key: 3,
|
|
902
|
+
class: "message-panel__detail"
|
|
903
|
+
}, mt = /* @__PURE__ */ x({
|
|
904
|
+
__name: "MessageNoticeNotifications",
|
|
905
|
+
setup(e) {
|
|
906
|
+
const l = p(!0), a = p(""), d = p(!1), r = p({
|
|
907
|
+
title: "",
|
|
908
|
+
content: null
|
|
909
|
+
}), t = p(!1), o = p(!1), n = p([]), u = p("unread"), c = p({
|
|
910
|
+
current: 1,
|
|
911
|
+
pageSize: 10,
|
|
912
|
+
total: 0
|
|
913
|
+
}), S = [{
|
|
914
|
+
label: "未读公告",
|
|
915
|
+
key: "unread"
|
|
916
|
+
}, {
|
|
917
|
+
label: "已读公告",
|
|
918
|
+
key: "read"
|
|
919
|
+
}], k = Q(() => u.value === "read");
|
|
920
|
+
async function y() {
|
|
921
|
+
t.value = !0;
|
|
922
|
+
try {
|
|
923
|
+
const {
|
|
924
|
+
data: g
|
|
925
|
+
} = await Y({
|
|
926
|
+
current: c.value.current,
|
|
927
|
+
pageSize: c.value.pageSize,
|
|
928
|
+
where: {
|
|
929
|
+
read: k.value
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
n.value = g.items.map((m) => ({
|
|
933
|
+
id: m.id,
|
|
934
|
+
title: m.title,
|
|
935
|
+
description: m.description,
|
|
936
|
+
createAt: m.createAt,
|
|
937
|
+
updateAt: m.updateAt,
|
|
938
|
+
pinned: m.pinned,
|
|
939
|
+
priority: m.priority,
|
|
940
|
+
displayStatus: m.displayStatus,
|
|
941
|
+
expireAt: m.expireAt,
|
|
942
|
+
requireConfirm: m.requireConfirm,
|
|
943
|
+
read: m.read ?? !1,
|
|
944
|
+
readAt: m.readAt ?? null
|
|
945
|
+
})), c.value.total = g.count, o.value = g.items.length < c.value.pageSize;
|
|
946
|
+
} finally {
|
|
947
|
+
t.value = !1;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
async function h() {
|
|
951
|
+
if (!(t.value || o.value)) {
|
|
952
|
+
c.value.current += 1, t.value = !0;
|
|
953
|
+
try {
|
|
954
|
+
const {
|
|
955
|
+
data: g
|
|
956
|
+
} = await Y({
|
|
957
|
+
current: c.value.current,
|
|
958
|
+
pageSize: c.value.pageSize,
|
|
959
|
+
where: {
|
|
960
|
+
read: k.value
|
|
961
|
+
}
|
|
962
|
+
}), m = g.items.map((N) => ({
|
|
963
|
+
id: N.id,
|
|
964
|
+
title: N.title,
|
|
965
|
+
description: N.description,
|
|
966
|
+
createAt: N.createAt,
|
|
967
|
+
updateAt: N.updateAt,
|
|
968
|
+
pinned: N.pinned,
|
|
969
|
+
priority: N.priority,
|
|
970
|
+
displayStatus: N.displayStatus,
|
|
971
|
+
expireAt: N.expireAt,
|
|
972
|
+
requireConfirm: N.requireConfirm,
|
|
973
|
+
read: N.read ?? !1,
|
|
974
|
+
readAt: N.readAt ?? null
|
|
975
|
+
}));
|
|
976
|
+
n.value = [...n.value, ...m], o.value = g.items.length < c.value.pageSize;
|
|
977
|
+
} finally {
|
|
978
|
+
t.value = !1;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
function z() {
|
|
983
|
+
c.value.current = 1, o.value = !1, y();
|
|
984
|
+
}
|
|
985
|
+
async function V() {
|
|
986
|
+
n.value.length !== 0 && (await ft(), y());
|
|
987
|
+
}
|
|
988
|
+
function E() {
|
|
989
|
+
l.value = !0, a.value = "", r.value = {
|
|
990
|
+
title: "",
|
|
991
|
+
content: null
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
async function M(g) {
|
|
995
|
+
d.value = !0;
|
|
996
|
+
try {
|
|
997
|
+
const {
|
|
998
|
+
data: m
|
|
999
|
+
} = await dt({
|
|
1000
|
+
id: g
|
|
1001
|
+
});
|
|
1002
|
+
r.value = {
|
|
1003
|
+
title: m.title,
|
|
1004
|
+
content: m.content
|
|
1005
|
+
};
|
|
1006
|
+
} finally {
|
|
1007
|
+
d.value = !1;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
async function q(g) {
|
|
1011
|
+
a.value = g.id, l.value = !1, g.read || (await ct({
|
|
1012
|
+
noticeId: g.id
|
|
1013
|
+
}), k.value || (n.value = n.value.filter((m) => m.id !== g.id))), M(g.id);
|
|
1014
|
+
}
|
|
1015
|
+
function C(g) {
|
|
1016
|
+
return {
|
|
1017
|
+
published: "green",
|
|
1018
|
+
expired: "gray"
|
|
1019
|
+
}[g] || "gray";
|
|
1020
|
+
}
|
|
1021
|
+
function v(g) {
|
|
1022
|
+
return {
|
|
1023
|
+
published: "有效",
|
|
1024
|
+
expired: "已过期"
|
|
1025
|
+
}[g] || "未知";
|
|
1026
|
+
}
|
|
1027
|
+
return y(), (g, m) => (s(), b("div", pt, [l.value ? A("", !0) : (s(), _(i(j), {
|
|
1028
|
+
key: 0,
|
|
1029
|
+
class: "message-panel__breadcrumb"
|
|
1030
|
+
}, {
|
|
1031
|
+
default: f(() => [$(i(R), {
|
|
1032
|
+
onClick: E
|
|
1033
|
+
}, {
|
|
1034
|
+
default: f(() => [...m[1] || (m[1] = [w("公告通知", -1)])]),
|
|
1035
|
+
_: 1
|
|
1036
|
+
}), $(i(R), null, {
|
|
1037
|
+
default: f(() => [...m[2] || (m[2] = [w("详情", -1)])]),
|
|
1038
|
+
_: 1
|
|
1039
|
+
})]),
|
|
1040
|
+
_: 1
|
|
1041
|
+
})), l.value ? (s(), _(se, {
|
|
1042
|
+
key: 1,
|
|
1043
|
+
"active-tab": u.value,
|
|
1044
|
+
"onUpdate:activeTab": m[0] || (m[0] = (N) => u.value = N),
|
|
1045
|
+
tabs: S,
|
|
1046
|
+
"message-list": n.value,
|
|
1047
|
+
onChange: z,
|
|
1048
|
+
onReadAll: V
|
|
1049
|
+
}, null, 8, ["active-tab", "message-list"])) : A("", !0), l.value ? (s(), _(G, {
|
|
1050
|
+
key: 2,
|
|
1051
|
+
"message-list": n.value,
|
|
1052
|
+
loading: t.value,
|
|
1053
|
+
finished: o.value,
|
|
1054
|
+
"show-read-status": !0,
|
|
1055
|
+
"show-view-button": !1,
|
|
1056
|
+
onItemClick: q,
|
|
1057
|
+
onLoadMore: h
|
|
1058
|
+
}, {
|
|
1059
|
+
tags: f(({
|
|
1060
|
+
item: N
|
|
1061
|
+
}) => [N.priority === "urgent" ? (s(), _(i(B), {
|
|
1062
|
+
key: 0,
|
|
1063
|
+
color: "red",
|
|
1064
|
+
size: "small"
|
|
1065
|
+
}, {
|
|
1066
|
+
default: f(() => [...m[3] || (m[3] = [w("紧急", -1)])]),
|
|
1067
|
+
_: 1
|
|
1068
|
+
})) : N.priority === "important" ? (s(), _(i(B), {
|
|
1069
|
+
key: 1,
|
|
1070
|
+
color: "orange",
|
|
1071
|
+
size: "small"
|
|
1072
|
+
}, {
|
|
1073
|
+
default: f(() => [...m[4] || (m[4] = [w("重要", -1)])]),
|
|
1074
|
+
_: 1
|
|
1075
|
+
})) : A("", !0), $(i(B), {
|
|
1076
|
+
color: C(N.displayStatus),
|
|
1077
|
+
size: "small"
|
|
1078
|
+
}, {
|
|
1079
|
+
default: f(() => [w(T(v(N.displayStatus)), 1)]),
|
|
1080
|
+
_: 2
|
|
1081
|
+
}, 1032, ["color"])]),
|
|
1082
|
+
footer: f(({
|
|
1083
|
+
item: N
|
|
1084
|
+
}) => [N.expireAt ? (s(), b("span", gt, T(N.displayStatus === "expired" ? "已过期" : `过期时间: ${N.expireAt}`), 1)) : A("", !0)]),
|
|
1085
|
+
_: 1
|
|
1086
|
+
}, 8, ["message-list", "loading", "finished"])) : (s(), b("div", vt, [$(P, {
|
|
1087
|
+
title: r.value.title,
|
|
1088
|
+
content: r.value.content,
|
|
1089
|
+
loading: d.value
|
|
1090
|
+
}, null, 8, ["title", "content", "loading"])]))]));
|
|
1091
|
+
}
|
|
1092
|
+
}), yt = /* @__PURE__ */ I(mt, [["__scopeId", "data-v-cbd2a754"]]), _t = {
|
|
1093
|
+
class: "content"
|
|
1094
|
+
}, ht = {
|
|
1095
|
+
class: "left"
|
|
1096
|
+
}, bt = /* @__PURE__ */ x({
|
|
1097
|
+
__name: "MessageAppMessage",
|
|
1098
|
+
props: /* @__PURE__ */ W({
|
|
1099
|
+
menus: {
|
|
1100
|
+
type: Array,
|
|
1101
|
+
required: !0
|
|
1102
|
+
}
|
|
1103
|
+
}, {
|
|
1104
|
+
selectedKeys: {
|
|
1105
|
+
default: ["ChangelogNotifications"]
|
|
1106
|
+
},
|
|
1107
|
+
selectedKeysModifiers: {}
|
|
1108
|
+
}),
|
|
1109
|
+
emits: /* @__PURE__ */ W(["cancel", "change"], ["update:selectedKeys"]),
|
|
1110
|
+
setup(e, {
|
|
1111
|
+
expose: l,
|
|
1112
|
+
emit: a
|
|
1113
|
+
}) {
|
|
1114
|
+
const d = e, r = a, t = oe(e, "selectedKeys"), o = Q(() => t.value.length !== 0 ? t.value[0] : "");
|
|
1115
|
+
function n() {
|
|
1116
|
+
r("cancel");
|
|
1117
|
+
}
|
|
1118
|
+
function u(y, h) {
|
|
1119
|
+
const z = y.path;
|
|
1120
|
+
t.value = [z], r("change", y, h);
|
|
1121
|
+
}
|
|
1122
|
+
const {
|
|
1123
|
+
changeType: c,
|
|
1124
|
+
show: S
|
|
1125
|
+
} = ye(r);
|
|
1126
|
+
function k(y) {
|
|
1127
|
+
S.value = y, c.value = "编辑";
|
|
1128
|
+
}
|
|
1129
|
+
return l({
|
|
1130
|
+
setData: k
|
|
1131
|
+
}), (y, h) => (s(), _(i(ue), {
|
|
1132
|
+
visible: i(S),
|
|
1133
|
+
"onUpdate:visible": h[1] || (h[1] = (z) => le(S) ? S.value = z : null),
|
|
1134
|
+
loading: !1,
|
|
1135
|
+
"body-class": "AppMessagebodyClass",
|
|
1136
|
+
"mask-closable": !1,
|
|
1137
|
+
footer: !1,
|
|
1138
|
+
"hide-title": !1,
|
|
1139
|
+
width: "880px",
|
|
1140
|
+
onCancel: n
|
|
1141
|
+
}, {
|
|
1142
|
+
default: f(() => [L("div", _t, [L("div", ht, [$(_e, {
|
|
1143
|
+
"selected-keys": t.value,
|
|
1144
|
+
"onUpdate:selectedKeys": h[0] || (h[0] = (z) => t.value = z),
|
|
1145
|
+
menus: d.menus,
|
|
1146
|
+
onChange: u
|
|
1147
|
+
}, null, 8, ["selected-keys", "menus"])]), i(S) ? (s(), b(H, {
|
|
1148
|
+
key: 0
|
|
1149
|
+
}, [o.value === "ChangelogNotifications" ? (s(), _(je, {
|
|
1150
|
+
key: 0
|
|
1151
|
+
})) : A("", !0), o.value === "EventNotifications" ? (s(), _(Ze, {
|
|
1152
|
+
key: 1
|
|
1153
|
+
})) : A("", !0), o.value === "MessageNotifications" ? (s(), _(ut, {
|
|
1154
|
+
key: 2
|
|
1155
|
+
})) : A("", !0), o.value === "NoticeNotifications" ? (s(), _(yt, {
|
|
1156
|
+
key: 3
|
|
1157
|
+
})) : A("", !0)], 64)) : A("", !0)])]),
|
|
1158
|
+
_: 1
|
|
1159
|
+
}, 8, ["visible"]));
|
|
1160
|
+
}
|
|
1161
|
+
}), kt = /* @__PURE__ */ I(bt, [["__scopeId", "data-v-8f921467"]]), Ct = /* @__PURE__ */ x({
|
|
1162
|
+
__name: "MessageHandle",
|
|
1163
|
+
setup(e, {
|
|
1164
|
+
expose: l
|
|
1165
|
+
}) {
|
|
1166
|
+
const a = p(["ChangelogNotifications"]), d = p(), r = p(Symbol("key"));
|
|
1167
|
+
function t() {
|
|
1168
|
+
d.value.setData(!0);
|
|
1169
|
+
}
|
|
1170
|
+
function o() {
|
|
1171
|
+
r.value = Symbol("key");
|
|
1172
|
+
}
|
|
1173
|
+
function n() {
|
|
1174
|
+
r.value = Symbol("key");
|
|
1175
|
+
}
|
|
1176
|
+
const u = p([{
|
|
1177
|
+
name: "功能变更",
|
|
1178
|
+
path: "ChangelogNotifications",
|
|
1179
|
+
meta: {
|
|
1180
|
+
icon: "mingcute:cube-3d-fill"
|
|
1181
|
+
}
|
|
1182
|
+
}, {
|
|
1183
|
+
name: "活动通知",
|
|
1184
|
+
path: "EventNotifications",
|
|
1185
|
+
meta: {
|
|
1186
|
+
icon: "mingcute:receive-money-fill"
|
|
1187
|
+
}
|
|
1188
|
+
}, {
|
|
1189
|
+
name: "消息通知",
|
|
1190
|
+
path: "MessageNotifications",
|
|
1191
|
+
meta: {
|
|
1192
|
+
icon: "mingcute:message-1-fill"
|
|
1193
|
+
}
|
|
1194
|
+
}, {
|
|
1195
|
+
name: "公告",
|
|
1196
|
+
path: "NoticeNotifications",
|
|
1197
|
+
meta: {
|
|
1198
|
+
icon: "mingcute:announcement-fill"
|
|
1199
|
+
}
|
|
1200
|
+
}]);
|
|
1201
|
+
return l({
|
|
1202
|
+
openNotification: t
|
|
1203
|
+
}), (c, S) => (s(), _(kt, {
|
|
1204
|
+
ref_key: "MessageNotificationsRef",
|
|
1205
|
+
ref: d,
|
|
1206
|
+
key: r.value,
|
|
1207
|
+
"selected-keys": a.value,
|
|
1208
|
+
"onUpdate:selectedKeys": S[0] || (S[0] = (k) => a.value = k),
|
|
1209
|
+
menus: u.value,
|
|
1210
|
+
title: "消息中心",
|
|
1211
|
+
onConfirm: n,
|
|
1212
|
+
onCancel: o
|
|
1213
|
+
}, null, 8, ["selected-keys", "menus"]));
|
|
1214
|
+
}
|
|
1215
|
+
}), Ot = /* @__PURE__ */ I(Ct, [["__scopeId", "data-v-dd5fd3b4"]]);
|
|
1216
|
+
export {
|
|
1217
|
+
kt as A,
|
|
1218
|
+
je as C,
|
|
1219
|
+
P as D,
|
|
1220
|
+
Ze as E,
|
|
1221
|
+
we as I,
|
|
1222
|
+
Ot as M,
|
|
1223
|
+
yt as N,
|
|
1224
|
+
Ce as _,
|
|
1225
|
+
st as a,
|
|
1226
|
+
Je as b,
|
|
1227
|
+
G as c,
|
|
1228
|
+
ut as d,
|
|
1229
|
+
se as e,
|
|
1230
|
+
dt as n
|
|
1231
|
+
};
|