@qiqb/message-domain 0.0.0-stage → 0.1.4

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.
Files changed (57) hide show
  1. package/README.md +220 -2
  2. package/build/components/DefaultMessageReminderRenderer.d.ts +10 -0
  3. package/build/components/DefaultMessageReminderRenderer.js +29 -0
  4. package/build/components/MessageNavigation.d.ts +7 -0
  5. package/build/components/MessageNavigation.js +192 -0
  6. package/build/components/MessageReminderDisplay.d.ts +21 -0
  7. package/build/components/MessageReminderDisplay.js +353 -0
  8. package/build/components/MessageWorkspace.d.ts +16 -0
  9. package/build/components/MessageWorkspace.js +26 -0
  10. package/build/components/message-navigation.less +89 -0
  11. package/build/components/message-reminder-display.less +367 -0
  12. package/build/components/message-workspace.less +150 -0
  13. package/build/index.d.ts +20 -0
  14. package/build/index.js +17 -0
  15. package/build/pages/inbox/InboxPage.d.ts +2 -0
  16. package/build/pages/inbox/InboxPage.js +265 -0
  17. package/build/pages/inbox/inbox.less +430 -0
  18. package/build/pages/subscription/PersonalSubscriptionPage.d.ts +1 -0
  19. package/build/pages/subscription/PersonalSubscriptionPage.js +6 -0
  20. package/build/pages/subscription/RoleSubscriptionPage.d.ts +1 -0
  21. package/build/pages/subscription/RoleSubscriptionPage.js +5 -0
  22. package/build/pages/subscription/SubscriptionForm.d.ts +16 -0
  23. package/build/pages/subscription/SubscriptionForm.js +111 -0
  24. package/build/pages/subscription/SubscriptionPage.d.ts +5 -0
  25. package/build/pages/subscription/SubscriptionPage.js +273 -0
  26. package/build/pages/subscription/subscription-form.less +341 -0
  27. package/build/pages/subscription/subscription.less +250 -0
  28. package/build/pages/topic/TopicPage.d.ts +1 -0
  29. package/build/pages/topic/TopicPage.js +291 -0
  30. package/build/routes.cjs +38 -0
  31. package/build/routes.d.cts +22 -0
  32. package/build/routes.d.ts +22 -0
  33. package/build/routes.js +34 -0
  34. package/build/runtime/MessageReminderLayout.d.ts +14 -0
  35. package/build/runtime/MessageReminderLayout.js +25 -0
  36. package/build/runtime/MessageReminders.d.ts +16 -0
  37. package/build/runtime/MessageReminders.js +364 -0
  38. package/build/runtime/index.d.ts +79 -0
  39. package/build/runtime/index.js +105 -0
  40. package/build/runtime/message-reminder-layout.less +40 -0
  41. package/build/runtime/messageRealtime.d.ts +15 -0
  42. package/build/runtime/messageRealtime.js +99 -0
  43. package/build/runtime/reminderEvents.d.ts +18 -0
  44. package/build/runtime/reminderEvents.js +53 -0
  45. package/build/runtime/reminderOwnership.d.ts +35 -0
  46. package/build/runtime/reminderOwnership.js +135 -0
  47. package/build/runtime/reminderPresentation.d.ts +34 -0
  48. package/build/runtime/reminderPresentation.js +57 -0
  49. package/build/runtime/reminderQuery.d.ts +18 -0
  50. package/build/runtime/reminderQuery.js +33 -0
  51. package/build/runtime/reminderQueue.d.ts +25 -0
  52. package/build/runtime/reminderQueue.js +88 -0
  53. package/build/services/MessageController.d.ts +108 -0
  54. package/build/services/MessageController.js +42 -0
  55. package/build/types/index.d.ts +12 -0
  56. package/build/types/index.js +1 -0
  57. package/package.json +96 -4
@@ -0,0 +1,265 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ArrowRightOutlined, CheckOutlined, InboxOutlined, ReadOutlined, ReloadOutlined, } from '@ant-design/icons';
3
+ import { Button, Drawer, Grid, Pagination, Segmented, Select, Skeleton, Space, Tag, } from 'antd';
4
+ import { useCallback, useEffect, useRef, useState } from 'react';
5
+ import MessageWorkspace, { useMessageTheme, } from '../../components/MessageWorkspace.js';
6
+ import { getMessageDomainRuntime, navigate, useLocation } from '../../runtime/index.js';
7
+ import { dispatchMessageReceiptRead, subscribeMessageReceiptRead, } from '../../runtime/reminderEvents.js';
8
+ import { getInboxMessage, getMessageTopics, getUnreadMessageCount, isInternalMessagePath, markInboxMessageRead, pageInboxMessages, showMessageError, } from '../../services/MessageController.js';
9
+ import './inbox.less';
10
+ const receiptId = (record) => record.receiptId || record.id;
11
+ function isExpired(record) {
12
+ return (!!record.expiresAt && new Date(record.expiresAt).getTime() <= Date.now());
13
+ }
14
+ /** 只强调发布时保存的重要/严重级别,历史消息不额外占用普通级别标签。 */
15
+ function messageLevelTag(record) {
16
+ if (record.messageLevel === 'SEVERE')
17
+ return _jsx(Tag, { color: "error", children: "\u4E25\u91CD" });
18
+ if (record.messageLevel === 'IMPORTANT')
19
+ return _jsx(Tag, { color: "warning", children: "\u91CD\u8981" });
20
+ return null;
21
+ }
22
+ /** 服务端本地时间不附带时区,按浏览器本地时间展示;无效值保留原文便于识别。 */
23
+ function formatTime(value, short = false) {
24
+ if (!value)
25
+ return '—';
26
+ const date = new Date(value.replace(' ', 'T'));
27
+ if (Number.isNaN(date.getTime()))
28
+ return value;
29
+ return date.toLocaleString('zh-CN', {
30
+ ...(short ? {} : { year: 'numeric' }),
31
+ month: '2-digit',
32
+ day: '2-digit',
33
+ hour: '2-digit',
34
+ minute: '2-digit',
35
+ hour12: false,
36
+ });
37
+ }
38
+ export default function InboxPage() {
39
+ const location = useLocation();
40
+ const confirmedReadAt = useRef(new Map());
41
+ const screens = Grid.useBreakpoint();
42
+ const compact = screens.md === false;
43
+ const messageTheme = useMessageTheme();
44
+ const mounted = useRef(true);
45
+ const readRequests = useRef(new Map());
46
+ const listVersion = useRef(0);
47
+ const detailVersion = useRef(0);
48
+ const countVersion = useRef(0);
49
+ const [query, setQuery] = useState({ current: 1, pageSize: 10 });
50
+ const [refreshKey, setRefreshKey] = useState(0);
51
+ const [records, setRecords] = useState([]);
52
+ const [topics, setTopics] = useState([]);
53
+ const [total, setTotal] = useState(0);
54
+ const [loading, setLoading] = useState(true);
55
+ const [listFailed, setListFailed] = useState(false);
56
+ const [unreadCount, setUnreadCount] = useState();
57
+ const [countLoading, setCountLoading] = useState(false);
58
+ const [detailId, setDetailId] = useState();
59
+ const [detail, setDetail] = useState();
60
+ const [detailLoading, setDetailLoading] = useState(false);
61
+ const [detailFailed, setDetailFailed] = useState(false);
62
+ const [busyIds, setBusyIds] = useState([]);
63
+ const topicName = (record) => topics.find((topic) => topic.code === record.topicCode)?.name ||
64
+ record.topicName ||
65
+ record.topicCode;
66
+ const refreshCount = useCallback(async () => {
67
+ if (!mounted.current)
68
+ return;
69
+ const version = ++countVersion.current;
70
+ setCountLoading(true);
71
+ try {
72
+ const { data } = await getUnreadMessageCount();
73
+ if (version === countVersion.current)
74
+ setUnreadCount(data?.count || 0);
75
+ }
76
+ catch (error) {
77
+ if (version === countVersion.current)
78
+ showMessageError(error, '加载未读数量失败');
79
+ }
80
+ finally {
81
+ if (version === countVersion.current)
82
+ setCountLoading(false);
83
+ }
84
+ }, []);
85
+ useEffect(() => {
86
+ void refreshCount();
87
+ }, [refreshCount]);
88
+ useEffect(() => {
89
+ let cancelled = false;
90
+ void getMessageTopics()
91
+ .then(({ data }) => {
92
+ if (!cancelled)
93
+ setTopics(data || []);
94
+ })
95
+ .catch((error) => {
96
+ if (!cancelled)
97
+ showMessageError(error, '加载消息主题失败');
98
+ });
99
+ return () => {
100
+ cancelled = true;
101
+ };
102
+ }, []);
103
+ useEffect(() => {
104
+ const version = ++listVersion.current;
105
+ setLoading(true);
106
+ setListFailed(false);
107
+ void pageInboxMessages({ ...query })
108
+ .then(({ data }) => {
109
+ if (version !== listVersion.current)
110
+ return;
111
+ const resultTotal = data?.total || 0;
112
+ // 未读列表中的最后一条被阅读后,退回有效页,避免留在空白分页上。
113
+ if (query.current > 1 &&
114
+ (query.current - 1) * query.pageSize >= resultTotal) {
115
+ setQuery((current) => ({
116
+ ...current,
117
+ current: Math.max(1, Math.ceil(resultTotal / current.pageSize)),
118
+ }));
119
+ return;
120
+ }
121
+ setRecords(data?.records || []);
122
+ setTotal(resultTotal);
123
+ })
124
+ .catch((error) => {
125
+ if (version !== listVersion.current)
126
+ return;
127
+ setListFailed(true);
128
+ showMessageError(error, '加载我的消息失败');
129
+ })
130
+ .finally(() => {
131
+ if (version === listVersion.current)
132
+ setLoading(false);
133
+ });
134
+ return () => {
135
+ ++listVersion.current;
136
+ };
137
+ }, [query, refreshKey]);
138
+ useEffect(() => {
139
+ mounted.current = true;
140
+ return () => {
141
+ // 页面卸载后不再让迟到的详情/数量请求回写状态。
142
+ mounted.current = false;
143
+ ++detailVersion.current;
144
+ ++countVersion.current;
145
+ };
146
+ }, []);
147
+ const refresh = () => {
148
+ setRefreshKey((value) => value + 1);
149
+ void refreshCount();
150
+ };
151
+ const markRead = (record) => {
152
+ if (!mounted.current)
153
+ return Promise.resolve();
154
+ const id = receiptId(record);
155
+ // 慢网下反复打开同一消息时共享在途确认;不同消息仍可独立阅读。
156
+ const pending = readRequests.current.get(id);
157
+ if (pending)
158
+ return pending;
159
+ setBusyIds((current) => [...current, id]);
160
+ const operation = (async () => {
161
+ try {
162
+ await markInboxMessageRead(id);
163
+ // 已发出的确认正常完成;页面离开后不再补发查询或提示上一页的错误。
164
+ if (!mounted.current)
165
+ return;
166
+ // 统一广播成功确认;全局提醒和本页列表同步,出现提醒本身不会调用这里。
167
+ dispatchMessageReceiptRead(id);
168
+ }
169
+ catch (error) {
170
+ if (mounted.current)
171
+ showMessageError(error, '标记已读失败,请重试');
172
+ }
173
+ finally {
174
+ readRequests.current.delete(id);
175
+ if (mounted.current)
176
+ setBusyIds((current) => current.filter((value) => value !== id));
177
+ }
178
+ })();
179
+ readRequests.current.set(id, operation);
180
+ return operation;
181
+ };
182
+ const loadDetail = async (id) => {
183
+ const version = ++detailVersion.current;
184
+ setDetailId(id);
185
+ setDetail(undefined);
186
+ setDetailLoading(true);
187
+ setDetailFailed(false);
188
+ try {
189
+ const { data } = await getInboxMessage(id);
190
+ if (version !== detailVersion.current)
191
+ return;
192
+ if (!data)
193
+ throw new Error('消息详情不存在');
194
+ // 迟到的旧详情不能覆盖已经完成的阅读确认,尤其是从全局提醒跳转的同一消息。
195
+ const confirmed = confirmedReadAt.current.get(id);
196
+ if (confirmed)
197
+ data.readAt = confirmed;
198
+ setDetail(data);
199
+ // 用户明确打开并且详情加载成功后,才确认阅读;切换筛选不会自动阅读消息。
200
+ if (!data.readAt)
201
+ await markRead(data);
202
+ }
203
+ catch (error) {
204
+ if (version === detailVersion.current) {
205
+ setDetailFailed(true);
206
+ showMessageError(error, '加载消息详情失败');
207
+ }
208
+ }
209
+ finally {
210
+ if (version === detailVersion.current)
211
+ setDetailLoading(false);
212
+ }
213
+ };
214
+ useEffect(() => {
215
+ const onRead = ({ id, readAt }) => {
216
+ confirmedReadAt.current.set(id, readAt);
217
+ setDetail((current) => current && receiptId(current) === id ? { ...current, readAt } : current);
218
+ setRecords((current) => current.map((record) => receiptId(record) === id ? { ...record, readAt } : record));
219
+ setRefreshKey((value) => value + 1);
220
+ void refreshCount();
221
+ };
222
+ return subscribeMessageReceiptRead(onRead);
223
+ }, [refreshCount]);
224
+ useEffect(() => {
225
+ const id = new URLSearchParams(location.search).get(getMessageDomainRuntime().receiptQueryParam);
226
+ if (id)
227
+ void loadDetail(id);
228
+ // URL 定位来自全局提醒;只有地址变化才加载,普通列表状态更新不能反复读取详情。
229
+ }, [location.search]);
230
+ const reader = (_jsx("section", { className: "qiqb-inbox-reader", "aria-label": "\u6D88\u606F\u8BE6\u60C5", "aria-busy": detailLoading, children: detailLoading && !detail ? (_jsx("div", { className: "qiqb-inbox-reader-body", children: _jsx(Skeleton, { active: true, title: { width: '60%' }, paragraph: { rows: 8 } }) })) : detail ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "qiqb-inbox-reader-top", children: [_jsxs("div", { className: "qiqb-inbox-reader-heading", children: [_jsxs("h2", { className: "qiqb-inbox-reader-title", children: [detail.title, ' ', _jsx("span", { className: "qiqb-inbox-reader-topic", children: topicName(detail) })] }), (isInternalMessagePath(detail.targetPath) || !detail.readAt) && (_jsxs(Space, { className: "qiqb-inbox-reader-actions", size: 8, wrap: true, children: [isInternalMessagePath(detail.targetPath) && (_jsx(Button, { type: "primary", size: "small", icon: _jsx(ArrowRightOutlined, {}), onClick: () => navigate(detail.targetPath), children: "\u67E5\u770B\u76F8\u5173\u4E1A\u52A1" })), !detail.readAt && (_jsx(Button, { size: "small", icon: _jsx(CheckOutlined, {}), loading: busyIds.includes(receiptId(detail)), onClick: () => void markRead(detail), children: "\u6807\u8BB0\u5DF2\u8BFB" }))] }))] }), _jsxs("div", { className: "qiqb-inbox-reader-info", children: [_jsxs(Space, { size: [8, 4], wrap: true, children: [messageLevelTag(detail), _jsx("span", { children: detail.sourceSystem.toUpperCase() }), _jsxs("span", { children: ["\u6536\u5230\u4E8E ", formatTime(detail.createTime)] })] }), _jsxs("span", { className: "qiqb-inbox-read-state", children: [detail.readAt ? (_jsxs(_Fragment, { children: [_jsx(CheckOutlined, {}), " \u5DF2\u8BFB"] })) : ('未读'), isExpired(detail) && _jsx(Tag, { children: "\u5DF2\u8FC7\u671F" })] })] })] }), _jsxs("div", { className: "qiqb-inbox-reader-body", children: [_jsx("div", { className: "qiqb-inbox-message-content", children: detail.content }), _jsxs("dl", { className: "qiqb-inbox-detail-meta", children: [_jsxs("div", { children: [_jsx("dt", { children: "\u53D1\u751F\u65F6\u95F4" }), _jsx("dd", { children: formatTime(detail.occurredAt) })] }), detail.businessType && (_jsxs("div", { children: [_jsx("dt", { children: "\u4E1A\u52A1\u7C7B\u578B" }), _jsx("dd", { children: detail.businessType })] })), detail.businessId && (_jsxs("div", { children: [_jsx("dt", { children: "\u4E1A\u52A1\u7F16\u53F7" }), _jsx("dd", { children: detail.businessId })] })), detail.expiresAt && (_jsxs("div", { children: [_jsx("dt", { children: "\u6709\u6548\u671F\u81F3" }), _jsx("dd", { children: formatTime(detail.expiresAt) })] }))] })] })] })) : (_jsxs("div", { className: "qiqb-message-state qiqb-inbox-reader-placeholder", children: [_jsx("span", { className: "qiqb-message-state-icon", children: _jsx(ReadOutlined, {}) }), _jsx("h3", { children: detailFailed ? '暂时无法打开这条消息' : '选择一条消息开始阅读' }), _jsx("p", { children: detailFailed
231
+ ? '消息详情加载失败,请重试。'
232
+ : '在左侧查看消息,阅读详情或前往相关业务。' }), detailFailed && detailId && (_jsx(Button, { onClick: () => void loadDetail(detailId), children: "\u91CD\u65B0\u52A0\u8F7D" }))] })) }));
233
+ return (_jsxs(MessageWorkspace, { title: "\u6211\u7684\u6D88\u606F", description: "\u96C6\u4E2D\u67E5\u770B\u4E1A\u52A1\u63D0\u9192\uFF0C\u53CA\u65F6\u8DDF\u8FDB\u4E0E\u4F60\u76F8\u5173\u7684\u6D88\u606F\u3002", icon: _jsx(InboxOutlined, {}), className: "qiqb-inbox-workspace", children: [_jsxs("div", { className: "qiqb-message-surface", children: [_jsxs("div", { className: "qiqb-message-toolbar qiqb-inbox-toolbar", children: [_jsxs("div", { className: "qiqb-inbox-filters", children: [_jsx(Segmented, { "aria-label": "\u7B5B\u9009\u9605\u8BFB\u72B6\u6001", value: query.unread === undefined
234
+ ? 'ALL'
235
+ : query.unread
236
+ ? 'UNREAD'
237
+ : 'READ', options: [
238
+ { label: '全部消息', value: 'ALL' },
239
+ { label: '未读', value: 'UNREAD' },
240
+ { label: '已读', value: 'READ' },
241
+ ], onChange: (value) => setQuery((current) => ({
242
+ ...current,
243
+ current: 1,
244
+ unread: value === 'ALL' ? undefined : value === 'UNREAD',
245
+ })) }), _jsx(Select, { className: "qiqb-message-filter-select", "aria-label": "\u7B5B\u9009\u6D88\u606F\u4E3B\u9898", placeholder: "\u5168\u90E8\u6D88\u606F\u4E3B\u9898", allowClear: true, showSearch: true, optionFilterProp: "label", value: query.topicCode, options: topics.map((topic) => ({
246
+ value: topic.code,
247
+ label: topic.name,
248
+ })), onChange: (topicCode) => setQuery((current) => ({ ...current, current: 1, topicCode })) })] }), _jsxs("div", { className: "qiqb-inbox-toolbar-summary", children: [_jsx("span", { className: "qiqb-message-caption", "aria-live": "polite", children: listFailed ? '加载失败' : '共 ' + total + ' 条' }), _jsxs("span", { className: "qiqb-inbox-unread-summary", children: ["\u672A\u8BFB", ' ', _jsx("strong", { "aria-live": "polite", children: unreadCount === undefined ? '—' : unreadCount })] }), _jsx(Button, { size: "small", icon: _jsx(ReloadOutlined, {}), loading: loading || countLoading, onClick: refresh, children: "\u5237\u65B0" })] })] }), _jsxs("div", { className: "qiqb-inbox-layout", children: [_jsxs("section", { className: "qiqb-inbox-list", "aria-label": "\u6D88\u606F\u5217\u8868", "aria-busy": loading, children: [_jsx("div", { className: "qiqb-inbox-list-body", children: loading ? (_jsx("div", { className: "qiqb-inbox-list-skeleton", children: [0, 1, 2].map((key) => (_jsx(Skeleton, { active: true, title: true, paragraph: { rows: 2 } }, key))) })) : listFailed ? (_jsxs("div", { className: "qiqb-message-state", children: [_jsx("span", { className: "qiqb-message-state-icon", children: _jsx(InboxOutlined, {}) }), _jsx("h3", { children: "\u6D88\u606F\u52A0\u8F7D\u5931\u8D25" }), _jsx("p", { children: "\u8BF7\u91CD\u65B0\u52A0\u8F7D\u540E\u7EE7\u7EED\u67E5\u770B\u3002" }), _jsx(Button, { onClick: refresh, children: "\u91CD\u65B0\u52A0\u8F7D" })] })) : records.length ? (records.map((record) => (_jsxs("button", { type: "button", className: [
249
+ 'qiqb-inbox-item',
250
+ receiptId(record) === detailId ? 'is-selected' : '',
251
+ !record.readAt ? 'is-unread' : '',
252
+ ].join(' '), "aria-pressed": receiptId(record) === detailId, onClick: () => void loadDetail(receiptId(record)), children: [_jsxs("span", { className: "qiqb-inbox-item-heading", children: [_jsxs("span", { className: "qiqb-inbox-item-title-group", children: [_jsxs("span", { className: "qiqb-inbox-item-title", title: record.title, children: [!record.readAt && (_jsx("span", { className: "qiqb-inbox-unread-dot", "aria-label": "\u672A\u8BFB" })), record.title] }), _jsx("span", { className: "qiqb-inbox-item-topic", title: topicName(record), children: topicName(record) })] }), _jsx("time", { children: formatTime(record.createTime, true) })] }), _jsx("span", { className: "qiqb-inbox-item-preview", children: record.content || '点击查看消息详情' }), _jsxs("span", { className: "qiqb-inbox-item-footer", children: [_jsxs("span", { className: "qiqb-inbox-item-meta", children: [messageLevelTag(record), _jsx("span", { className: "qiqb-inbox-item-source", children: record.sourceSystem.toUpperCase() }), record.businessId && (_jsx("span", { className: "qiqb-inbox-item-business", title: '业务编号:' + record.businessId, children: record.businessId }))] }), _jsx("span", { className: "qiqb-inbox-item-state", children: isExpired(record)
253
+ ? '已过期'
254
+ : record.readAt
255
+ ? '已读'
256
+ : '未读' })] })] }, receiptId(record))))) : (_jsxs("div", { className: "qiqb-message-state", children: [_jsx("span", { className: "qiqb-message-state-icon", children: _jsx(InboxOutlined, {}) }), _jsx("h3", { children: query.unread === true
257
+ ? '未读消息已处理完'
258
+ : '这里还没有消息' }), _jsx("p", { children: query.topicCode || query.unread !== undefined
259
+ ? '试试切换阅读状态或消息主题。'
260
+ : '订阅感兴趣的主题后,新的消息会出现在这里。' })] })) }), total > 0 && !listFailed && (_jsx("div", { className: "qiqb-inbox-pagination", children: _jsx(Pagination, { size: "small", simple: true, current: query.current, pageSize: query.pageSize, total: total, showSizeChanger: false, onChange: (current) => setQuery((previous) => ({ ...previous, current })) }) }))] }), !compact && reader] })] }), _jsx(Drawer, { title: "\u9605\u8BFB\u6D88\u606F", open: compact && !!detailId, width: "100%", rootClassName: "qiqb-inbox-mobile", rootStyle: messageTheme, styles: { body: { padding: 0 } }, onClose: () => {
261
+ setDetailId(undefined);
262
+ ++detailVersion.current;
263
+ setDetailLoading(false);
264
+ }, children: _jsx("div", { className: "qiqb-message", children: reader }) })] }));
265
+ }
@@ -0,0 +1,430 @@
1
+ /* 收件箱单独收紧页头,其他消息管理页面继续使用领域默认间距。 */
2
+ .qiqb-inbox-workspace {
3
+ .qiqb-message-heading {
4
+ gap: 12px;
5
+ margin-bottom: 12px;
6
+ }
7
+
8
+ .qiqb-message-heading-main {
9
+ gap: 10px;
10
+
11
+ h1 {
12
+ font-size: 20px;
13
+ }
14
+
15
+ p {
16
+ margin-top: 0;
17
+ font-size: 12px;
18
+ }
19
+ }
20
+
21
+ .qiqb-message-heading-icon {
22
+ flex-basis: 36px;
23
+ width: 36px;
24
+ height: 36px;
25
+ border-radius: 10px;
26
+ font-size: 18px;
27
+ }
28
+ }
29
+
30
+ .qiqb-message {
31
+ .qiqb-inbox-toolbar {
32
+ gap: 10px 16px;
33
+ padding: 10px 16px;
34
+ }
35
+
36
+ .qiqb-inbox-filters,
37
+ .qiqb-inbox-toolbar-summary {
38
+ display: flex;
39
+ align-items: center;
40
+ flex-wrap: wrap;
41
+ gap: 10px;
42
+ min-width: 0;
43
+ }
44
+
45
+ .qiqb-inbox-toolbar-summary {
46
+ margin-left: auto;
47
+ }
48
+
49
+ .qiqb-inbox-unread-summary {
50
+ display: inline-flex;
51
+ align-items: center;
52
+ gap: 6px;
53
+ color: var(--message-muted);
54
+ font-size: 12px;
55
+
56
+ strong {
57
+ min-width: 22px;
58
+ padding: 1px 6px;
59
+ color: var(--message-primary);
60
+ background: var(--message-primary-bg);
61
+ border-radius: 4px;
62
+ font-weight: 500;
63
+ font-variant-numeric: tabular-nums;
64
+ text-align: center;
65
+ }
66
+ }
67
+
68
+ .qiqb-inbox-layout {
69
+ display: grid;
70
+ /* 宽屏限制摘要列宽,把主要空间留给正文;小桌面仍保证标题可读。 */
71
+ grid-template-columns: minmax(300px, min(38%, 480px)) minmax(0, 1fr);
72
+ height: clamp(400px, calc(100vh - 216px), 780px);
73
+ }
74
+
75
+ .qiqb-inbox-list {
76
+ display: flex;
77
+ min-width: 0;
78
+ min-height: 0;
79
+ flex-direction: column;
80
+ border-right: 1px solid var(--message-border);
81
+ }
82
+
83
+ .qiqb-inbox-list-body {
84
+ flex: 1;
85
+ min-height: 0;
86
+ overflow: auto;
87
+ scrollbar-width: thin;
88
+ }
89
+
90
+ .qiqb-inbox-list-skeleton {
91
+ padding: 16px;
92
+
93
+ > div + div {
94
+ margin-top: 20px;
95
+ }
96
+ }
97
+
98
+ .qiqb-inbox-item {
99
+ display: flex;
100
+ width: 100%;
101
+ min-width: 0;
102
+ flex-direction: column;
103
+ gap: 5px;
104
+ padding: 11px 16px 11px 13px;
105
+ color: var(--message-text);
106
+ background: transparent;
107
+ border: 0;
108
+ border-bottom: 1px solid var(--message-border);
109
+ border-left: 3px solid transparent;
110
+ font: inherit;
111
+ text-align: left;
112
+ cursor: pointer;
113
+ transition: background 0.16s ease, border-color 0.16s ease;
114
+
115
+ &:hover {
116
+ background: var(--message-fill);
117
+ }
118
+
119
+ &:focus-visible {
120
+ outline: 2px solid var(--message-primary);
121
+ outline-offset: -3px;
122
+ }
123
+
124
+ &.is-selected {
125
+ background: var(--message-primary-bg);
126
+ border-left-color: var(--message-primary);
127
+ }
128
+
129
+ &.is-unread .qiqb-inbox-item-title {
130
+ font-weight: 600;
131
+ }
132
+ }
133
+
134
+ .qiqb-inbox-item-heading,
135
+ .qiqb-inbox-item-footer {
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: space-between;
139
+ gap: 12px;
140
+ min-width: 0;
141
+ color: var(--message-muted);
142
+ font-size: 12px;
143
+ line-height: 20px;
144
+
145
+ time {
146
+ flex-shrink: 0;
147
+ font-size: 11px;
148
+ font-variant-numeric: tabular-nums;
149
+ }
150
+ }
151
+
152
+ .qiqb-inbox-item-title-group {
153
+ display: flex;
154
+ flex: 1;
155
+ align-items: baseline;
156
+ gap: 8px;
157
+ min-width: 0;
158
+ overflow: hidden;
159
+ }
160
+
161
+ .qiqb-inbox-item-title {
162
+ display: block;
163
+ flex: 0 1 auto;
164
+ min-width: 0;
165
+ overflow: hidden;
166
+ color: var(--message-text);
167
+ font-size: 14px;
168
+ line-height: 22px;
169
+ text-overflow: ellipsis;
170
+ white-space: nowrap;
171
+ }
172
+
173
+ .qiqb-inbox-unread-dot {
174
+ display: inline-block;
175
+ width: 6px;
176
+ height: 6px;
177
+ margin: 0 7px 2px 0;
178
+ background: var(--message-primary);
179
+ border-radius: 50%;
180
+ }
181
+
182
+ .qiqb-inbox-item-preview {
183
+ display: block;
184
+ overflow: hidden;
185
+ color: var(--message-muted);
186
+ font-size: 13px;
187
+ line-height: 20px;
188
+ text-overflow: ellipsis;
189
+ white-space: nowrap;
190
+ }
191
+
192
+ /* 级别、来源与编号共享一行;长业务字段只在列表省略,详情保留完整值。 */
193
+ .qiqb-inbox-item-meta {
194
+ display: flex;
195
+ flex: 1;
196
+ align-items: center;
197
+ gap: 8px;
198
+ min-width: 0;
199
+ overflow: hidden;
200
+
201
+ .ant-tag {
202
+ flex-shrink: 0;
203
+ margin: 0;
204
+ padding-inline: 4px;
205
+ font-size: 11px;
206
+ line-height: 18px;
207
+ }
208
+ }
209
+
210
+ .qiqb-inbox-item-topic,
211
+ .qiqb-inbox-item-source,
212
+ .qiqb-inbox-item-business {
213
+ min-width: 0;
214
+ overflow: hidden;
215
+ text-overflow: ellipsis;
216
+ white-space: nowrap;
217
+ }
218
+
219
+ .qiqb-inbox-item-topic {
220
+ /* 附加主题最多占标题区域约三分之一,避免长主题挤掉消息标题。 */
221
+ flex: 0 0 auto;
222
+ max-width: 35%;
223
+ color: var(--message-muted);
224
+ font-size: 12px;
225
+ }
226
+
227
+ .qiqb-inbox-item-source,
228
+ .qiqb-inbox-item-business {
229
+ padding-left: 8px;
230
+ border-left: 1px solid var(--message-border);
231
+ line-height: 14px;
232
+ }
233
+
234
+ .qiqb-inbox-item-source {
235
+ /* 编号过长时仍保留来源系统,方便识别消息来自哪个业务。 */
236
+ flex-shrink: 0;
237
+ max-width: 28%;
238
+
239
+ /* 普通消息没有级别标签,来源位于首项时不显示多余的分隔线。 */
240
+ &:first-child {
241
+ padding-left: 0;
242
+ border-left: 0;
243
+ }
244
+ }
245
+
246
+ .qiqb-inbox-item-state {
247
+ flex-shrink: 0;
248
+ font-size: 11px;
249
+ }
250
+
251
+ .qiqb-inbox-pagination {
252
+ display: flex;
253
+ flex-shrink: 0;
254
+ justify-content: center;
255
+ padding: 10px 12px;
256
+ border-top: 1px solid var(--message-border);
257
+ }
258
+
259
+ .qiqb-inbox-reader {
260
+ display: flex;
261
+ min-width: 0;
262
+ min-height: 0;
263
+ flex-direction: column;
264
+ /* 标题、主题和正文共同滚动,长标题不会挤掉正文的阅读空间。 */
265
+ overflow: auto;
266
+ background: var(--message-surface);
267
+ scrollbar-width: thin;
268
+ }
269
+
270
+ .qiqb-inbox-reader-top {
271
+ flex-shrink: 0;
272
+ padding: 16px 22px;
273
+ border-bottom: 1px solid var(--message-border);
274
+
275
+ .ant-tag {
276
+ max-width: 100%;
277
+ margin-inline-end: 0;
278
+ white-space: normal;
279
+ overflow-wrap: anywhere;
280
+ }
281
+ }
282
+
283
+ .qiqb-inbox-reader-heading,
284
+ .qiqb-inbox-reader-info {
285
+ display: flex;
286
+ align-items: center;
287
+ justify-content: space-between;
288
+ flex-wrap: wrap;
289
+ gap: 8px 12px;
290
+ min-width: 0;
291
+ }
292
+
293
+ .qiqb-inbox-reader-title {
294
+ display: block;
295
+ flex: 1;
296
+ min-width: 160px;
297
+ margin: 0;
298
+ color: var(--message-text);
299
+ font-size: 18px;
300
+ font-weight: 600;
301
+ line-height: 1.5;
302
+ overflow-wrap: anywhere;
303
+ }
304
+
305
+ .qiqb-inbox-reader-topic {
306
+ margin-left: 10px;
307
+ color: var(--message-muted);
308
+ font-size: 12px;
309
+ font-weight: 400;
310
+ }
311
+
312
+ .qiqb-inbox-reader-actions {
313
+ flex-shrink: 0;
314
+ }
315
+
316
+ .qiqb-inbox-reader-info {
317
+ margin-top: 8px;
318
+ color: var(--message-muted);
319
+ font-size: 12px;
320
+ line-height: 22px;
321
+
322
+ > .ant-space {
323
+ flex: 1;
324
+ min-width: 0;
325
+ overflow-wrap: anywhere;
326
+ }
327
+ }
328
+
329
+ .qiqb-inbox-read-state {
330
+ display: inline-flex;
331
+ align-items: center;
332
+ flex-shrink: 0;
333
+ gap: 6px;
334
+ color: var(--message-muted);
335
+ font-size: 12px;
336
+ }
337
+
338
+ .qiqb-inbox-reader-body {
339
+ flex: 1;
340
+ flex-shrink: 0;
341
+ padding: 20px 22px;
342
+ }
343
+
344
+ .qiqb-inbox-message-content {
345
+ font-size: 14px;
346
+ line-height: 1.8;
347
+ white-space: pre-wrap;
348
+ overflow-wrap: anywhere;
349
+ }
350
+
351
+ .qiqb-inbox-detail-meta {
352
+ display: grid;
353
+ grid-template-columns: repeat(2, minmax(0, 1fr));
354
+ gap: 10px 24px;
355
+ margin: 20px 0 0;
356
+ padding-top: 16px;
357
+ border-top: 1px solid var(--message-border);
358
+ font-size: 12px;
359
+ line-height: 20px;
360
+
361
+ > div {
362
+ display: flex;
363
+ gap: 12px;
364
+ min-width: 0;
365
+ }
366
+
367
+ dt {
368
+ flex-shrink: 0;
369
+ color: var(--message-muted);
370
+ }
371
+
372
+ dd {
373
+ min-width: 0;
374
+ margin: 0;
375
+ color: var(--message-text);
376
+ overflow-wrap: anywhere;
377
+ }
378
+ }
379
+
380
+ .qiqb-inbox-reader-placeholder {
381
+ flex: 1;
382
+ min-height: 0;
383
+ }
384
+
385
+ @media (max-width: 991px) {
386
+ .qiqb-inbox-detail-meta {
387
+ grid-template-columns: minmax(0, 1fr);
388
+ }
389
+ }
390
+
391
+ @media (max-width: 767px) {
392
+ .qiqb-inbox-filters {
393
+ width: 100%;
394
+
395
+ .qiqb-message-filter-select {
396
+ flex: 1;
397
+ width: auto;
398
+ min-width: 140px;
399
+ }
400
+ }
401
+
402
+ .qiqb-inbox-layout {
403
+ grid-template-columns: minmax(0, 1fr);
404
+ height: auto;
405
+ min-height: 360px;
406
+ }
407
+
408
+ .qiqb-inbox-list-body {
409
+ max-height: 65vh;
410
+ }
411
+
412
+ .qiqb-inbox-list {
413
+ border-right: 0;
414
+ }
415
+
416
+ .qiqb-inbox-reader-body {
417
+ padding: 16px;
418
+ }
419
+
420
+ .qiqb-inbox-reader-top {
421
+ padding: 14px 16px;
422
+ }
423
+ }
424
+
425
+ @media (prefers-reduced-motion: reduce) {
426
+ .qiqb-inbox-item {
427
+ transition: none;
428
+ }
429
+ }
430
+ }
@@ -0,0 +1 @@
1
+ export default function PersonalSubscriptionPage(): import("react").JSX.Element;