@qiqb/message-domain 0.1.3 → 0.2.0
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/README.md +16 -3
- package/build/components/MessageReminderDisplay.js +2 -2
- package/build/components/MessageWorkspace.d.ts +3 -1
- package/build/components/MessageWorkspace.js +2 -2
- package/build/pages/inbox/InboxPage.js +26 -18
- package/build/pages/inbox/inbox.less +228 -91
- package/build/pages/subscription/SubscriptionForm.js +7 -6
- package/build/pages/subscription/SubscriptionPage.js +2 -2
- package/build/pages/subscription/subscription-form.less +0 -45
- package/build/pages/subscription/subscription.less +2 -2
- package/build/pages/topic/TopicPage.js +19 -14
- package/build/routes.cjs +4 -4
- package/build/routes.js +4 -4
- package/build/services/MessageController.d.ts +3 -9
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
包输出 ESM JavaScript、TypeScript 声明和 LESS;不依赖 Umi/Max、宿主 `.umi`、`@prokeeper-bip/shared` 或平台管理页面包。React、React DOM、Ant Design、Pro Components 和图标是 peerDependencies,由消费宿主安装和提供主题。宿主需支持导入包内 LESS,页面和组件已自行引用对应样式。
|
|
6
6
|
|
|
7
|
+
## 从 0.1.4 升级到 0.2.0
|
|
8
|
+
|
|
9
|
+
本次发布包含公开类型和权限码调整,宿主应配合当前消息服务接口升级:
|
|
10
|
+
|
|
11
|
+
- 移除运行时配置和 `MessageTopic` 的 `sourceSystem`;`InboxMessage.sourceSystem` 改为可选且允许 `null`,展示时需处理空来源。
|
|
12
|
+
- 移除 `MessageCondition`、`MessageSubscription.conditions` 和 `SubscriptionMetadata.operators`,订阅覆盖主题全部消息,只配置通知渠道。
|
|
13
|
+
- 页面和管理按钮权限码统一使用 `QiqbPlatformMessage` 前缀,宿主授权数据需同步;已有菜单仍通过菜单管理更新,内置初始化不覆盖人工修改。
|
|
14
|
+
|
|
15
|
+
安装指定版本:`pnpm add @qiqb/message-domain@0.2.0`。默认路由继续使用 `/p/message/*`,运行时注入、提醒 renderer 和双模式路由入口沿用现有接入方式。
|
|
16
|
+
|
|
7
17
|
## 运行时装配
|
|
8
18
|
|
|
9
19
|
宿主启动时、消息页面和组件挂载前调用一次配置。注入函数中可以使用宿主的 React hook;不要在挂载后更换 hook 实现。
|
|
@@ -27,6 +37,8 @@ configureMessageDomainRuntime({
|
|
|
27
37
|
|
|
28
38
|
`request` 由宿主继续处理 token、超时及鉴权。默认 fetch 只提供同源 JSON 请求,适合无框架预览;正式接入应注入现有请求层。页面使用 `WebResp<T> { success, message?, data? }` 与 `PageInfo<T> { total, records?, current?, size? }`。消息领域自行提示业务失败,传入 `skipErrorHandler: true`,避免宿主重复弹出相同错误。
|
|
29
39
|
|
|
40
|
+
消息主题不配置来源系统,新增、编辑、列表和订阅选项均不包含该字段,也无需宿主注入。消息本身的 `sourceSystem` 仍由发布方可选传入,原样保存,不传时为空;默认展示在空值时不补来源标签。
|
|
41
|
+
|
|
30
42
|
### 可选实时订阅
|
|
31
43
|
|
|
32
44
|
消息包不依赖 Socket.IO 客户端。宿主安装并配置独立 `@qiqb/socketio-domain` 后,将同账户共享连接的
|
|
@@ -59,9 +71,9 @@ HTTP 刷新,同时每 60 秒完整对账;断线或未注入实时能力时
|
|
|
59
71
|
业务已读。后台页面暂停查询,恢复可见立即补查;卸载、退出或换账号释放当前订阅租约,不断开其他
|
|
60
72
|
业务模块共享的连接。
|
|
61
73
|
|
|
62
|
-
默认权限项目为 `qiqb_platform`,按钮授权显式传递该项目编码,不随当前导航项目漂移。缺少 `useAccess` 时主题及角色管理操作默认不可用;角色订阅的列表查询及写操作统一要求 `
|
|
74
|
+
默认权限项目为 `qiqb_platform`,按钮授权显式传递该项目编码,不随当前导航项目漂移。缺少 `useAccess` 时主题及角色管理操作默认不可用;角色订阅的列表查询及写操作统一要求 `QiqbPlatformMessageRoleSubscriptionManageBtn`。我的订阅由服务端绑定当前账号,只提供查询、筛选和启停;新增、编辑、删除由主题策略与角色配置维护。页面入口和后端接口权限继续由宿主及服务端校验,按钮隐藏不能替代服务端鉴权。
|
|
63
75
|
|
|
64
|
-
主题使用 `subscriptionMode` 指定订阅策略,默认 `ALL_ACCOUNTS`(全量账户订阅),创建时为有效账户绑定订阅;`ROLE`(角色订阅)主题通过角色配置,在账户绑定角色时生成我的订阅。模式选项由 `/topic/subscription_modes` 动态返回,支持服务端扩展。主题的“同步订阅”调用 `/topic/sync_subscriptions` 补齐账户订阅,复用 `
|
|
76
|
+
主题使用 `subscriptionMode` 指定订阅策略,默认 `ALL_ACCOUNTS`(全量账户订阅),创建时为有效账户绑定订阅;`ROLE`(角色订阅)主题通过角色配置,在账户绑定角色时生成我的订阅。模式选项由 `/topic/subscription_modes` 动态返回,支持服务端扩展。主题的“同步订阅”调用 `/topic/sync_subscriptions` 补齐账户订阅,复用 `QiqbPlatformMessageTopicSaveBtn` 权限并显示新增数量。订阅覆盖主题全部消息,前端类型与请求已移除过滤条件字段(`conditions`、`metadata.operators`);角色订阅默认使用站内消息渠道,编辑时主题与角色均不可修改(服务端同样拒绝)。删除主题不再要求先删除角色配置,主题删除提交后由服务端按订阅模式解除订阅(角色模式先解除角色订阅再解除个人订阅,其它模式解除个人订阅),删除确认框会提示该影响。
|
|
65
77
|
|
|
66
78
|
## 路由
|
|
67
79
|
|
|
@@ -203,12 +215,13 @@ cd frontend
|
|
|
203
215
|
corepack pnpm --filter @qiqb/message-domain lint
|
|
204
216
|
corepack pnpm --filter @qiqb/message-domain test:reminders
|
|
205
217
|
corepack pnpm --filter @qiqb/message-domain test:runtime
|
|
218
|
+
corepack pnpm --filter @qiqb/message-domain test:topics
|
|
206
219
|
corepack pnpm --filter @qiqb/message-domain test:presentation
|
|
207
220
|
corepack pnpm build:message-domain
|
|
208
221
|
corepack pnpm --filter @qiqb/message-domain test:routes
|
|
209
222
|
corepack pnpm pack:message-domain
|
|
210
223
|
```
|
|
211
224
|
|
|
212
|
-
打包到 `/private/tmp/qiqb-message-domain-0.
|
|
225
|
+
打包到 `/private/tmp/qiqb-message-domain-0.2.0.tgz`,可通过 `pnpm add /private/tmp/qiqb-message-domain-0.2.0.tgz` 在消费仓库安装验证。构建仅清理本包 `build/`,输出 ESM 的相对 `.js` 导入、界面 `.d.ts`、独立路由 `.cjs`/`.d.cts` 和按源路径复制的 `.less`。包内容只包含 `build/`、README 和 package.json,不包含源代码、测试、依赖缓存或宿主生成文件。
|
|
213
226
|
|
|
214
227
|
`publish:message-domain` 与包内 `publish:official` 默认发布到 npm 官方仓库,使用公开 scoped 包;`publish:private/publish:local/publish:nexus` 保留为显式私服入口。它们不会在 build/pack 时自动执行;只有明确要发布时再运行。验证和打包不启动宿主应用、不部署后端、不远程发布。
|
|
@@ -345,9 +345,9 @@ export default function MessageReminderDisplay({ messages, carouselTarget, onDis
|
|
|
345
345
|
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
346
346
|
setCarouselFocused(false);
|
|
347
347
|
}
|
|
348
|
-
}, children: _jsx(Alert, { className: "qiqb-message-reminder-carousel", type: levelType(messageLevel(carouselMessage)), banner: true, showIcon: true, icon: _jsx(LevelIcon, { level: messageLevel(carouselMessage) }), message: _jsxs("div", { className: "qiqb-message-reminder-carousel-content", children: [_jsx("span", { className: "qiqb-message-reminder-carousel-level", children: levelLabels[messageLevel(carouselMessage)] }), _jsxs("div", { className: "qiqb-message-reminder-carousel-viewport", "aria-live": "polite", "aria-atomic": "true", children: [_jsx("div", { className: "qiqb-message-reminder-carousel-message is-current", children: renderCarouselContent(carouselMessage) }, receiptId(carouselMessage)), departingCarousel && (_jsx("div", { className: "qiqb-message-reminder-carousel-message is-departing", "aria-hidden": "true", children: renderCarouselContent(departingCarousel) }, `departing:${receiptId(departingCarousel)}`))] })] }), action: _jsxs("div", { className: "qiqb-message-reminder-carousel-actions", children: [_jsx(Button, { className: "qiqb-message-reminder-carousel-view", type: "text", size: "small", loading: confirmingIds.includes(receiptId(carouselMessage)), disabled: confirmingIds.includes(receiptId(carouselMessage)), onClick: () => onOpen(carouselMessage), children: "\u67E5\u770B" }), carousel.length > 1 && (_jsxs("div", { className: "qiqb-message-reminder-carousel-navigation", "aria-label": "\u5207\u6362\u6D88\u606F", children: [_jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0A\u4E00\u6761\u63D0\u9192", icon: _jsx(LeftOutlined, {}), onClick: () => changeCarousel(-1) }), _jsxs("span", { className: "qiqb-message-reminder-counter", children: [carouselIndex + 1, " / ", carousel.length] }), _jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0B\u4E00\u6761\u63D0\u9192", icon: _jsx(RightOutlined, {}), onClick: () => changeCarousel(1) })] })), _jsx(Button, { className: "qiqb-message-reminder-carousel-close", type: "text", size: "small", "aria-label": "\u5173\u95ED\u5F53\u524D\u8F6E\u64AD\u63D0\u9192", icon: _jsx(CloseOutlined, {}), onClick: () => onDismiss(receiptId(carouselMessage)) })] }) }) }) }), carouselTarget), createPortal(_jsxs("div", { className: "qiqb-message-reminders", style: themeStyle, children: [floatingMessage && (_jsx("section", { className: "qiqb-message-reminder-floating-stack", "aria-label": "\u6D6E\u52A8\u6D88\u606F\u63D0\u9192", hidden: hasFullscreen, children: _jsxs(Card, { className: "qiqb-message-reminder-floating-card", size: "small", "data-level": messageLevel(floatingMessage), title: _jsxs(_Fragment, { children: [_jsx(BellOutlined, {}), " \u6D88\u606F\u63D0\u9192"] }), extra: _jsx(Button, { type: "text", size: "small", "aria-label": `关闭提醒:${floatingMessage.title}`, icon: _jsx(CloseOutlined, {}), onClick: () => onDismiss(receiptId(floatingMessage)) }), children: [_jsxs("article", { role: "status", "aria-live": "polite", children: [_jsxs("div", { className: "qiqb-message-reminder-floating-header", children: [_jsxs(Tag, { color: levelTagColor(messageLevel(floatingMessage)), children: [_jsx(LevelIcon, { level: messageLevel(floatingMessage) }), ' ', levelLabels[messageLevel(floatingMessage)]] }), _jsx("h3", { children: floatingMessage.title })] }), _jsx("p", { className: "qiqb-message-reminder-floating-summary", children: floatingMessage.content })] }, visibleFloatingId), _jsxs("div", { className: "qiqb-message-reminder-floating-footer", children: [_jsx("span", { children: floatingMessage.sourceSystem
|
|
348
|
+
}, children: _jsx(Alert, { className: "qiqb-message-reminder-carousel", type: levelType(messageLevel(carouselMessage)), banner: true, showIcon: true, icon: _jsx(LevelIcon, { level: messageLevel(carouselMessage) }), message: _jsxs("div", { className: "qiqb-message-reminder-carousel-content", children: [_jsx("span", { className: "qiqb-message-reminder-carousel-level", children: levelLabels[messageLevel(carouselMessage)] }), _jsxs("div", { className: "qiqb-message-reminder-carousel-viewport", "aria-live": "polite", "aria-atomic": "true", children: [_jsx("div", { className: "qiqb-message-reminder-carousel-message is-current", children: renderCarouselContent(carouselMessage) }, receiptId(carouselMessage)), departingCarousel && (_jsx("div", { className: "qiqb-message-reminder-carousel-message is-departing", "aria-hidden": "true", children: renderCarouselContent(departingCarousel) }, `departing:${receiptId(departingCarousel)}`))] })] }), action: _jsxs("div", { className: "qiqb-message-reminder-carousel-actions", children: [_jsx(Button, { className: "qiqb-message-reminder-carousel-view", type: "text", size: "small", loading: confirmingIds.includes(receiptId(carouselMessage)), disabled: confirmingIds.includes(receiptId(carouselMessage)), onClick: () => onOpen(carouselMessage), children: "\u67E5\u770B" }), carousel.length > 1 && (_jsxs("div", { className: "qiqb-message-reminder-carousel-navigation", "aria-label": "\u5207\u6362\u6D88\u606F", children: [_jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0A\u4E00\u6761\u63D0\u9192", icon: _jsx(LeftOutlined, {}), onClick: () => changeCarousel(-1) }), _jsxs("span", { className: "qiqb-message-reminder-counter", children: [carouselIndex + 1, " / ", carousel.length] }), _jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0B\u4E00\u6761\u63D0\u9192", icon: _jsx(RightOutlined, {}), onClick: () => changeCarousel(1) })] })), _jsx(Button, { className: "qiqb-message-reminder-carousel-close", type: "text", size: "small", "aria-label": "\u5173\u95ED\u5F53\u524D\u8F6E\u64AD\u63D0\u9192", icon: _jsx(CloseOutlined, {}), onClick: () => onDismiss(receiptId(carouselMessage)) })] }) }) }) }), carouselTarget), createPortal(_jsxs("div", { className: "qiqb-message-reminders", style: themeStyle, children: [floatingMessage && (_jsx("section", { className: "qiqb-message-reminder-floating-stack", "aria-label": "\u6D6E\u52A8\u6D88\u606F\u63D0\u9192", hidden: hasFullscreen, children: _jsxs(Card, { className: "qiqb-message-reminder-floating-card", size: "small", "data-level": messageLevel(floatingMessage), title: _jsxs(_Fragment, { children: [_jsx(BellOutlined, {}), " \u6D88\u606F\u63D0\u9192"] }), extra: _jsx(Button, { type: "text", size: "small", "aria-label": `关闭提醒:${floatingMessage.title}`, icon: _jsx(CloseOutlined, {}), onClick: () => onDismiss(receiptId(floatingMessage)) }), children: [_jsxs("article", { role: "status", "aria-live": "polite", children: [_jsxs("div", { className: "qiqb-message-reminder-floating-header", children: [_jsxs(Tag, { color: levelTagColor(messageLevel(floatingMessage)), children: [_jsx(LevelIcon, { level: messageLevel(floatingMessage) }), ' ', levelLabels[messageLevel(floatingMessage)]] }), _jsx("h3", { children: floatingMessage.title })] }), _jsx("p", { className: "qiqb-message-reminder-floating-summary", children: floatingMessage.content })] }, visibleFloatingId), _jsxs("div", { className: "qiqb-message-reminder-floating-footer", children: [floatingMessage.sourceSystem && (_jsx("span", { children: floatingMessage.sourceSystem })), _jsx(Button, { type: "link", size: "small", loading: confirmingIds.includes(receiptId(floatingMessage)), disabled: confirmingIds.includes(receiptId(floatingMessage)), onClick: () => onOpen(floatingMessage), children: "\u67E5\u770B\u6D88\u606F" })] }), floating.length > 1 && (_jsxs("div", { className: "qiqb-message-reminder-floating-navigation", "aria-label": "\u5207\u6362\u6D6E\u52A8\u6D88\u606F", children: [_jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0A\u4E00\u6761\u6D6E\u52A8\u63D0\u9192", icon: _jsx(LeftOutlined, {}), onClick: () => changeFloating(-1) }), _jsxs("span", { className: "qiqb-message-reminder-counter", children: [floatingIndex + 1, " / ", floating.length] }), _jsx(Button, { type: "text", size: "small", "aria-label": "\u4E0B\u4E00\u6761\u6D6E\u52A8\u63D0\u9192", icon: _jsx(RightOutlined, {}), onClick: () => changeFloating(1) })] }))] }) })), _jsx(Modal, { open: hasFullscreen, centered: true, width: 640, rootClassName: "qiqb-message-reminders",
|
|
349
349
|
// Ant Design 5 读取 rootStyle,6 的语义样式以 styles.root 为准。
|
|
350
350
|
rootStyle: themeStyle, styles: { root: themeStyle }, className: "qiqb-message-reminder-fullscreen", zIndex: token.zIndexPopupBase + 100,
|
|
351
351
|
// 正式全屏不能用关闭、遮罩或 Escape 绕过阅读确认。
|
|
352
|
-
closable: false, maskClosable: false, keyboard: false, "aria-describedby": bodyId, title: fullscreenMessage && (_jsxs("div", { className: "qiqb-message-reminder-fullscreen-header", children: [_jsx(BellOutlined, {}), " \u6D88\u606F\u63D0\u9192", _jsx(Tag, { color: levelTagColor(messageLevel(fullscreenMessage)), children: levelLabels[messageLevel(fullscreenMessage)] }), _jsxs("span", { className: "qiqb-message-reminder-fullscreen-count", children: ["\u5F85\u786E\u8BA4 ", fullscreen.length, " \u6761"] })] })), footer: fullscreenMessage ? (_jsxs("div", { className: "qiqb-message-reminder-fullscreen-footer", children: [_jsx("span", { children: "\u786E\u8BA4\u4EC5\u8868\u793A\u4F60\u5DF2\u9605\u8BFB\u8FD9\u6761\u6D88\u606F\u3002" }), _jsxs("div", { children: [_jsx(Button, { loading: confirmingIds.includes(receiptId(fullscreenMessage)), disabled: confirmBusy, onClick: () => onOpen(fullscreenMessage), children: "\u67E5\u770B\u8BE6\u60C5" }), _jsx(Button, { type: "primary", loading: confirmBusy, onClick: () => void confirm(), children: "\u6211\u5DF2\u77E5\u6653" })] })] })) : null, children: fullscreenMessage && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "qiqb-message-reminder-fullscreen-scroll", tabIndex: 0, role: "document", children: [_jsx("h2", { children: fullscreenMessage.title }), _jsxs("div", { className: "qiqb-message-reminder-fullscreen-meta", children: [_jsxs("span", { children: ["\u6765\u6E90\uFF1A", fullscreenMessage.sourceSystem
|
|
352
|
+
closable: false, maskClosable: false, keyboard: false, "aria-describedby": bodyId, title: fullscreenMessage && (_jsxs("div", { className: "qiqb-message-reminder-fullscreen-header", children: [_jsx(BellOutlined, {}), " \u6D88\u606F\u63D0\u9192", _jsx(Tag, { color: levelTagColor(messageLevel(fullscreenMessage)), children: levelLabels[messageLevel(fullscreenMessage)] }), _jsxs("span", { className: "qiqb-message-reminder-fullscreen-count", children: ["\u5F85\u786E\u8BA4 ", fullscreen.length, " \u6761"] })] })), footer: fullscreenMessage ? (_jsxs("div", { className: "qiqb-message-reminder-fullscreen-footer", children: [_jsx("span", { children: "\u786E\u8BA4\u4EC5\u8868\u793A\u4F60\u5DF2\u9605\u8BFB\u8FD9\u6761\u6D88\u606F\u3002" }), _jsxs("div", { children: [_jsx(Button, { loading: confirmingIds.includes(receiptId(fullscreenMessage)), disabled: confirmBusy, onClick: () => onOpen(fullscreenMessage), children: "\u67E5\u770B\u8BE6\u60C5" }), _jsx(Button, { type: "primary", loading: confirmBusy, onClick: () => void confirm(), children: "\u6211\u5DF2\u77E5\u6653" })] })] })) : null, children: fullscreenMessage && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "qiqb-message-reminder-fullscreen-scroll", tabIndex: 0, role: "document", children: [_jsx("h2", { children: fullscreenMessage.title }), _jsxs("div", { className: "qiqb-message-reminder-fullscreen-meta", children: [fullscreenMessage.sourceSystem && (_jsxs("span", { children: ["\u6765\u6E90\uFF1A", fullscreenMessage.sourceSystem] })), _jsxs("span", { children: ["\u65F6\u95F4\uFF1A", displayTime(fullscreenMessage)] })] }), _jsx("div", { className: "qiqb-message-reminder-fullscreen-body", id: bodyId, children: fullscreenMessage.content })] }), (confirmError || localConfirmError) && (_jsx(Alert, { className: "qiqb-message-reminder-confirm-error", type: "error", showIcon: true, message: confirmError || localConfirmError }))] })) })] }), portalTarget)] }));
|
|
353
353
|
}
|
|
@@ -7,8 +7,10 @@ interface Props {
|
|
|
7
7
|
description: string;
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
extra?: ReactNode;
|
|
10
|
+
/** 页面可在领域主题下调整自身布局,不影响主题/订阅等其他消息页面。 */
|
|
11
|
+
className?: string;
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
}
|
|
12
14
|
/** 只在消息领域内统一页面框架,避免把订阅语义放进跨领域 shared 包。 */
|
|
13
|
-
export default function MessageWorkspace({ title, description, icon, extra, children, }: Props): import("react").JSX.Element;
|
|
15
|
+
export default function MessageWorkspace({ title, description, icon, extra, className, children, }: Props): import("react").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -20,7 +20,7 @@ export function useMessageTheme() {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
/** 只在消息领域内统一页面框架,避免把订阅语义放进跨领域 shared 包。 */
|
|
23
|
-
export default function MessageWorkspace({ title, description, icon = _jsx(BellOutlined, {}), extra, children, }) {
|
|
23
|
+
export default function MessageWorkspace({ title, description, icon = _jsx(BellOutlined, {}), extra, className, children, }) {
|
|
24
24
|
const messageTheme = useMessageTheme();
|
|
25
|
-
return (_jsx(PageContainer, { pageHeaderRender: false, className: "qiqb-message-page", children: _jsxs("div", { className:
|
|
25
|
+
return (_jsx(PageContainer, { pageHeaderRender: false, className: "qiqb-message-page", children: _jsxs("div", { className: ['qiqb-message', className].filter(Boolean).join(' '), style: messageTheme, children: [_jsxs("header", { className: "qiqb-message-heading", children: [_jsxs("div", { className: "qiqb-message-heading-main", children: [_jsx("div", { className: "qiqb-message-heading-icon", "aria-hidden": true, children: icon }), _jsxs("div", { children: [_jsx("h1", { children: title }), _jsx("p", { children: description })] })] }), extra && _jsx("div", { className: "qiqb-message-heading-actions", children: extra })] }), children] }) }));
|
|
26
26
|
}
|
|
@@ -11,6 +11,14 @@ const receiptId = (record) => record.receiptId || record.id;
|
|
|
11
11
|
function isExpired(record) {
|
|
12
12
|
return (!!record.expiresAt && new Date(record.expiresAt).getTime() <= Date.now());
|
|
13
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
|
+
}
|
|
14
22
|
/** 服务端本地时间不附带时区,按浏览器本地时间展示;无效值保留原文便于识别。 */
|
|
15
23
|
function formatTime(value, short = false) {
|
|
16
24
|
if (!value)
|
|
@@ -219,29 +227,29 @@ export default function InboxPage() {
|
|
|
219
227
|
void loadDetail(id);
|
|
220
228
|
// URL 定位来自全局提醒;只有地址变化才加载,普通列表状态更新不能反复读取详情。
|
|
221
229
|
}, [location.search]);
|
|
222
|
-
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(
|
|
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), detail.sourceSystem && _jsx("span", { children: detail.sourceSystem }), _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
|
|
223
231
|
? '消息详情加载失败,请重试。'
|
|
224
232
|
: '在左侧查看消息,阅读详情或前往相关业务。' }), detailFailed && detailId && (_jsx(Button, { onClick: () => void loadDetail(detailId), children: "\u91CD\u65B0\u52A0\u8F7D" }))] })) }));
|
|
225
|
-
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, {}),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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: [
|
|
241
249
|
'qiqb-inbox-item',
|
|
242
250
|
receiptId(record) === detailId ? 'is-selected' : '',
|
|
243
251
|
!record.readAt ? 'is-unread' : '',
|
|
244
|
-
].join(' '), "aria-pressed": receiptId(record) === detailId, onClick: () => void loadDetail(receiptId(record)), children: [_jsxs("span", { className: "qiqb-inbox-item-heading", children: [
|
|
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), record.sourceSystem && (_jsx("span", { className: "qiqb-inbox-item-source", children: record.sourceSystem })), 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)
|
|
245
253
|
? '已过期'
|
|
246
254
|
: record.readAt
|
|
247
255
|
? '已读'
|
|
@@ -1,30 +1,75 @@
|
|
|
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
|
+
|
|
1
30
|
.qiqb-message {
|
|
2
|
-
.qiqb-inbox-
|
|
31
|
+
.qiqb-inbox-toolbar {
|
|
32
|
+
gap: 10px 16px;
|
|
33
|
+
padding: 10px 16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.qiqb-inbox-filters,
|
|
37
|
+
.qiqb-inbox-toolbar-summary {
|
|
3
38
|
display: flex;
|
|
4
39
|
align-items: center;
|
|
5
|
-
|
|
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;
|
|
6
53
|
color: var(--message-muted);
|
|
7
|
-
font-size:
|
|
54
|
+
font-size: 12px;
|
|
8
55
|
|
|
9
56
|
strong {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
justify-content: center;
|
|
13
|
-
min-width: 30px;
|
|
14
|
-
height: 28px;
|
|
15
|
-
padding: 0 8px;
|
|
57
|
+
min-width: 22px;
|
|
58
|
+
padding: 1px 6px;
|
|
16
59
|
color: var(--message-primary);
|
|
17
60
|
background: var(--message-primary-bg);
|
|
18
|
-
border-radius:
|
|
19
|
-
font-
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
font-weight: 500;
|
|
20
63
|
font-variant-numeric: tabular-nums;
|
|
64
|
+
text-align: center;
|
|
21
65
|
}
|
|
22
66
|
}
|
|
23
67
|
|
|
24
68
|
.qiqb-inbox-layout {
|
|
25
69
|
display: grid;
|
|
26
|
-
|
|
27
|
-
|
|
70
|
+
/* 宽屏限制摘要列宽,把主要空间留给正文;小桌面仍保证标题可读。 */
|
|
71
|
+
grid-template-columns: minmax(300px, min(38%, 480px)) minmax(0, 1fr);
|
|
72
|
+
height: clamp(400px, calc(100vh - 216px), 780px);
|
|
28
73
|
}
|
|
29
74
|
|
|
30
75
|
.qiqb-inbox-list {
|
|
@@ -35,17 +80,6 @@
|
|
|
35
80
|
border-right: 1px solid var(--message-border);
|
|
36
81
|
}
|
|
37
82
|
|
|
38
|
-
.qiqb-inbox-list-heading {
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-shrink: 0;
|
|
41
|
-
justify-content: space-between;
|
|
42
|
-
gap: 12px;
|
|
43
|
-
padding: 15px 20px;
|
|
44
|
-
font-size: 13px;
|
|
45
|
-
font-weight: 500;
|
|
46
|
-
border-bottom: 1px solid var(--message-border);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
83
|
.qiqb-inbox-list-body {
|
|
50
84
|
flex: 1;
|
|
51
85
|
min-height: 0;
|
|
@@ -54,10 +88,10 @@
|
|
|
54
88
|
}
|
|
55
89
|
|
|
56
90
|
.qiqb-inbox-list-skeleton {
|
|
57
|
-
padding:
|
|
91
|
+
padding: 16px;
|
|
58
92
|
|
|
59
93
|
> div + div {
|
|
60
|
-
margin-top:
|
|
94
|
+
margin-top: 20px;
|
|
61
95
|
}
|
|
62
96
|
}
|
|
63
97
|
|
|
@@ -66,8 +100,8 @@
|
|
|
66
100
|
width: 100%;
|
|
67
101
|
min-width: 0;
|
|
68
102
|
flex-direction: column;
|
|
69
|
-
gap:
|
|
70
|
-
padding:
|
|
103
|
+
gap: 5px;
|
|
104
|
+
padding: 11px 16px 11px 13px;
|
|
71
105
|
color: var(--message-text);
|
|
72
106
|
background: transparent;
|
|
73
107
|
border: 0;
|
|
@@ -103,28 +137,35 @@
|
|
|
103
137
|
align-items: center;
|
|
104
138
|
justify-content: space-between;
|
|
105
139
|
gap: 12px;
|
|
140
|
+
min-width: 0;
|
|
106
141
|
color: var(--message-muted);
|
|
107
|
-
font-size:
|
|
108
|
-
line-height:
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
line-height: 20px;
|
|
109
144
|
|
|
110
145
|
time {
|
|
111
146
|
flex-shrink: 0;
|
|
147
|
+
font-size: 11px;
|
|
112
148
|
font-variant-numeric: tabular-nums;
|
|
113
149
|
}
|
|
114
150
|
}
|
|
115
151
|
|
|
116
|
-
.qiqb-inbox-item-
|
|
152
|
+
.qiqb-inbox-item-title-group {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex: 1;
|
|
155
|
+
align-items: baseline;
|
|
156
|
+
gap: 8px;
|
|
157
|
+
min-width: 0;
|
|
117
158
|
overflow: hidden;
|
|
118
|
-
color: var(--message-primary);
|
|
119
|
-
text-overflow: ellipsis;
|
|
120
|
-
white-space: nowrap;
|
|
121
159
|
}
|
|
122
160
|
|
|
123
161
|
.qiqb-inbox-item-title {
|
|
124
162
|
display: block;
|
|
163
|
+
flex: 0 1 auto;
|
|
164
|
+
min-width: 0;
|
|
125
165
|
overflow: hidden;
|
|
166
|
+
color: var(--message-text);
|
|
126
167
|
font-size: 14px;
|
|
127
|
-
line-height:
|
|
168
|
+
line-height: 22px;
|
|
128
169
|
text-overflow: ellipsis;
|
|
129
170
|
white-space: nowrap;
|
|
130
171
|
}
|
|
@@ -139,27 +180,79 @@
|
|
|
139
180
|
}
|
|
140
181
|
|
|
141
182
|
.qiqb-inbox-item-preview {
|
|
142
|
-
display:
|
|
183
|
+
display: block;
|
|
143
184
|
overflow: hidden;
|
|
144
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);
|
|
145
224
|
font-size: 12px;
|
|
146
|
-
line-height: 1.8;
|
|
147
|
-
overflow-wrap: anywhere;
|
|
148
|
-
-webkit-line-clamp: 2;
|
|
149
|
-
-webkit-box-orient: vertical;
|
|
150
225
|
}
|
|
151
226
|
|
|
152
|
-
.qiqb-inbox-item-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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;
|
|
156
249
|
}
|
|
157
250
|
|
|
158
251
|
.qiqb-inbox-pagination {
|
|
159
252
|
display: flex;
|
|
160
253
|
flex-shrink: 0;
|
|
161
254
|
justify-content: center;
|
|
162
|
-
padding:
|
|
255
|
+
padding: 10px 12px;
|
|
163
256
|
border-top: 1px solid var(--message-border);
|
|
164
257
|
}
|
|
165
258
|
|
|
@@ -168,58 +261,89 @@
|
|
|
168
261
|
min-width: 0;
|
|
169
262
|
min-height: 0;
|
|
170
263
|
flex-direction: column;
|
|
264
|
+
/* 标题、主题和正文共同滚动,长标题不会挤掉正文的阅读空间。 */
|
|
265
|
+
overflow: auto;
|
|
171
266
|
background: var(--message-surface);
|
|
267
|
+
scrollbar-width: thin;
|
|
172
268
|
}
|
|
173
269
|
|
|
174
270
|
.qiqb-inbox-reader-top {
|
|
175
|
-
display: flex;
|
|
176
271
|
flex-shrink: 0;
|
|
177
|
-
|
|
178
|
-
justify-content: space-between;
|
|
179
|
-
flex-wrap: wrap;
|
|
180
|
-
gap: 12px;
|
|
181
|
-
padding: 18px 28px;
|
|
272
|
+
padding: 16px 22px;
|
|
182
273
|
border-bottom: 1px solid var(--message-border);
|
|
183
274
|
|
|
184
275
|
.ant-tag {
|
|
276
|
+
max-width: 100%;
|
|
185
277
|
margin-inline-end: 0;
|
|
278
|
+
white-space: normal;
|
|
279
|
+
overflow-wrap: anywhere;
|
|
186
280
|
}
|
|
187
281
|
}
|
|
188
282
|
|
|
189
|
-
.qiqb-inbox-
|
|
190
|
-
|
|
283
|
+
.qiqb-inbox-reader-heading,
|
|
284
|
+
.qiqb-inbox-reader-info {
|
|
285
|
+
display: flex;
|
|
191
286
|
align-items: center;
|
|
192
|
-
|
|
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;
|
|
193
307
|
color: var(--message-muted);
|
|
194
308
|
font-size: 12px;
|
|
309
|
+
font-weight: 400;
|
|
195
310
|
}
|
|
196
311
|
|
|
197
|
-
.qiqb-inbox-reader-
|
|
198
|
-
flex:
|
|
199
|
-
|
|
200
|
-
overflow: auto;
|
|
201
|
-
padding: 28px 32px;
|
|
312
|
+
.qiqb-inbox-reader-actions {
|
|
313
|
+
flex-shrink: 0;
|
|
314
|
+
}
|
|
202
315
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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;
|
|
208
325
|
overflow-wrap: anywhere;
|
|
209
326
|
}
|
|
210
327
|
}
|
|
211
328
|
|
|
212
|
-
.qiqb-inbox-
|
|
213
|
-
|
|
329
|
+
.qiqb-inbox-read-state {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
flex-shrink: 0;
|
|
333
|
+
gap: 6px;
|
|
214
334
|
color: var(--message-muted);
|
|
215
335
|
font-size: 12px;
|
|
216
336
|
}
|
|
217
337
|
|
|
338
|
+
.qiqb-inbox-reader-body {
|
|
339
|
+
flex: 1;
|
|
340
|
+
flex-shrink: 0;
|
|
341
|
+
padding: 20px 22px;
|
|
342
|
+
}
|
|
343
|
+
|
|
218
344
|
.qiqb-inbox-message-content {
|
|
219
|
-
min-height: 160px;
|
|
220
|
-
margin: 30px 0;
|
|
221
345
|
font-size: 14px;
|
|
222
|
-
line-height:
|
|
346
|
+
line-height: 1.8;
|
|
223
347
|
white-space: pre-wrap;
|
|
224
348
|
overflow-wrap: anywhere;
|
|
225
349
|
}
|
|
@@ -227,40 +351,58 @@
|
|
|
227
351
|
.qiqb-inbox-detail-meta {
|
|
228
352
|
display: grid;
|
|
229
353
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
230
|
-
gap:
|
|
231
|
-
margin: 0;
|
|
232
|
-
padding:
|
|
233
|
-
|
|
234
|
-
border-radius: 8px;
|
|
354
|
+
gap: 10px 24px;
|
|
355
|
+
margin: 20px 0 0;
|
|
356
|
+
padding-top: 16px;
|
|
357
|
+
border-top: 1px solid var(--message-border);
|
|
235
358
|
font-size: 12px;
|
|
359
|
+
line-height: 20px;
|
|
360
|
+
|
|
361
|
+
> div {
|
|
362
|
+
display: flex;
|
|
363
|
+
gap: 12px;
|
|
364
|
+
min-width: 0;
|
|
365
|
+
}
|
|
236
366
|
|
|
237
367
|
dt {
|
|
238
|
-
|
|
368
|
+
flex-shrink: 0;
|
|
239
369
|
color: var(--message-muted);
|
|
240
370
|
}
|
|
241
371
|
|
|
242
372
|
dd {
|
|
373
|
+
min-width: 0;
|
|
243
374
|
margin: 0;
|
|
375
|
+
color: var(--message-text);
|
|
244
376
|
overflow-wrap: anywhere;
|
|
245
377
|
}
|
|
246
378
|
}
|
|
247
379
|
|
|
248
|
-
.qiqb-inbox-reader-footer {
|
|
249
|
-
flex-shrink: 0;
|
|
250
|
-
padding: 18px 32px;
|
|
251
|
-
border-top: 1px solid var(--message-border);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
380
|
.qiqb-inbox-reader-placeholder {
|
|
255
381
|
flex: 1;
|
|
256
|
-
min-height:
|
|
382
|
+
min-height: 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@media (max-width: 991px) {
|
|
386
|
+
.qiqb-inbox-detail-meta {
|
|
387
|
+
grid-template-columns: minmax(0, 1fr);
|
|
388
|
+
}
|
|
257
389
|
}
|
|
258
390
|
|
|
259
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
|
+
|
|
260
402
|
.qiqb-inbox-layout {
|
|
261
403
|
grid-template-columns: minmax(0, 1fr);
|
|
262
404
|
height: auto;
|
|
263
|
-
min-height:
|
|
405
|
+
min-height: 360px;
|
|
264
406
|
}
|
|
265
407
|
|
|
266
408
|
.qiqb-inbox-list-body {
|
|
@@ -272,16 +414,11 @@
|
|
|
272
414
|
}
|
|
273
415
|
|
|
274
416
|
.qiqb-inbox-reader-body {
|
|
275
|
-
padding:
|
|
417
|
+
padding: 16px;
|
|
276
418
|
}
|
|
277
419
|
|
|
278
|
-
.qiqb-inbox-reader-top
|
|
279
|
-
|
|
280
|
-
padding: 16px 20px;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.qiqb-inbox-detail-meta {
|
|
284
|
-
grid-template-columns: minmax(0, 1fr);
|
|
420
|
+
.qiqb-inbox-reader-top {
|
|
421
|
+
padding: 14px 16px;
|
|
285
422
|
}
|
|
286
423
|
}
|
|
287
424
|
|
|
@@ -25,7 +25,7 @@ export default function SubscriptionForm({ scope, open, record, topics, roles, m
|
|
|
25
25
|
if (!open)
|
|
26
26
|
return;
|
|
27
27
|
form.resetFields();
|
|
28
|
-
form.setFieldsValue(record || { enabled: true,
|
|
28
|
+
form.setFieldsValue(record || { enabled: true, channels: ['IN_APP'] });
|
|
29
29
|
}, [open, record, form]);
|
|
30
30
|
const save = async () => {
|
|
31
31
|
if (!canManage ||
|
|
@@ -44,13 +44,12 @@ export default function SubscriptionForm({ scope, open, record, topics, roles, m
|
|
|
44
44
|
await saveMessageSubscription({
|
|
45
45
|
id: record?.id,
|
|
46
46
|
name: values.name,
|
|
47
|
-
|
|
47
|
+
// 编辑时主题不可修改(服务端同样拒绝),始终提交原主题。
|
|
48
|
+
topicCode: record?.topicCode ?? values.topicCode,
|
|
48
49
|
// 个人订阅由主题策略生成,本表单只配置角色与主题的绑定关系。
|
|
49
50
|
subjectType: 'ROLE',
|
|
50
51
|
subjectId: values.subjectId,
|
|
51
52
|
enabled: values.enabled,
|
|
52
|
-
// 页面已取消过滤条件,保存时显式清空历史条件,统一接收主题全部消息。
|
|
53
|
-
conditions: [],
|
|
54
53
|
// 本期固定使用站内消息,界面无需让用户选择唯一可用的渠道。
|
|
55
54
|
channels: ['IN_APP'],
|
|
56
55
|
});
|
|
@@ -92,11 +91,13 @@ export default function SubscriptionForm({ scope, open, record, topics, roles, m
|
|
|
92
91
|
throw new Error('请选择角色订阅模式的主题');
|
|
93
92
|
},
|
|
94
93
|
},
|
|
95
|
-
], children: _jsx(Select, { loading: loading, showSearch: true,
|
|
94
|
+
], children: _jsx(Select, { loading: loading, showSearch: true,
|
|
95
|
+
// 订阅创建后主题固定,改挂主题需删除后重新创建。
|
|
96
|
+
disabled: !!record?.id, optionFilterProp: "label", placeholder: "\u9009\u62E9\u4F60\u5173\u6CE8\u7684\u6D88\u606F\u4E3B\u9898", options: topics.map((item) => ({
|
|
96
97
|
label: `${item.name}(${item.code})`,
|
|
97
98
|
value: item.code,
|
|
98
99
|
disabled: !item.enabled || item.subscriptionMode !== 'ROLE',
|
|
99
|
-
})) }) }), topic && (_jsxs("div", { className: "qiqb-subscription-drawer__topic-info", children: [_jsx(BellOutlined, {}), _jsxs("div", { children: [_jsx("strong", { children: topic.name }),
|
|
100
|
+
})) }) }), topic && (_jsxs("div", { className: "qiqb-subscription-drawer__topic-info", children: [_jsx(BellOutlined, {}), _jsxs("div", { children: [_jsx("strong", { children: topic.name }), topic.description && _jsx("p", { children: topic.description })] })] })), roleScope ? (_jsx(Form.Item, { name: "subjectId", label: "\u8BA2\u9605\u89D2\u8272", extra: record
|
|
100
101
|
? '角色归属已固定。如需更换角色,请新建订阅。'
|
|
101
102
|
: '账户绑定该角色时,会自动生成对应的个人订阅。', rules: [{ required: true, message: '请选择订阅角色' }], children: _jsx(Select
|
|
102
103
|
// 订阅主体创建后不能转移,避免编辑规则时改变既有规则归属。
|
|
@@ -17,7 +17,7 @@ export default function SubscriptionPage({ scope, }) {
|
|
|
17
17
|
const roleScope = scope === 'ROLE';
|
|
18
18
|
// 个人只调整自己的订阅启停;角色入口查询及所有写操作统一受管理权限保护。
|
|
19
19
|
const canManage = !roleScope ||
|
|
20
|
-
access.verifyElementPermission('
|
|
20
|
+
access.verifyElementPermission('QiqbPlatformMessageRoleSubscriptionManageBtn');
|
|
21
21
|
const canConfigure = roleScope && canManage;
|
|
22
22
|
const [topics, setTopics] = useState([]);
|
|
23
23
|
const [roles, setRoles] = useState([]);
|
|
@@ -245,7 +245,7 @@ export default function SubscriptionPage({ scope, }) {
|
|
|
245
245
|
const disabled = !canManage || !!busyId || recordsLoading || optionsLoading;
|
|
246
246
|
return (_jsxs("article", { className: "qiqb-message-subscription-card", children: [_jsxs("div", { className: "qiqb-message-subscription-card-header", children: [_jsx("span", { className: "qiqb-message-subscription-topic-icon", children: _jsx(BellOutlined, {}) }), _jsxs("div", { className: "qiqb-message-subscription-heading", children: [_jsx("h3", { children: record.name }), _jsx("div", { className: "qiqb-message-subscription-topic", children: topicName })] }), _jsxs("div", { className: "qiqb-message-subscription-state", children: [_jsx("span", { className: record.enabled
|
|
247
247
|
? 'qiqb-message-subscription-status is-enabled'
|
|
248
|
-
: 'qiqb-message-subscription-status', children: record.enabled ? '已启用' : '已停用' }), _jsx(Switch, { size: "small", "aria-label": `${record.name}启用状态`, checked: record.enabled, disabled: disabled, loading: busyId === record.id, onChange: (enabled) => void changeEnabled(record, enabled) })] })] }), roleScope && (_jsxs("div", { className: "qiqb-message-subscription-role", children: [_jsx(TeamOutlined, {}), _jsx("span", { children: roleName })] })), _jsxs("div", { className: "qiqb-message-subscription-
|
|
248
|
+
: 'qiqb-message-subscription-status', children: record.enabled ? '已启用' : '已停用' }), _jsx(Switch, { size: "small", "aria-label": `${record.name}启用状态`, checked: record.enabled, disabled: disabled, loading: busyId === record.id, onChange: (enabled) => void changeEnabled(record, enabled) })] })] }), roleScope && (_jsxs("div", { className: "qiqb-message-subscription-role", children: [_jsx(TeamOutlined, {}), _jsx("span", { children: roleName })] })), _jsxs("div", { className: "qiqb-message-subscription-scope", children: [_jsx("div", { className: "qiqb-message-subscription-scope-label", children: "\u63A5\u6536\u8303\u56F4" }), _jsx("div", { className: "qiqb-message-subscription-all", children: "\u8BE5\u4E3B\u9898\u4E0B\u7684\u5168\u90E8\u6D88\u606F" })] }), _jsxs("div", { className: "qiqb-message-subscription-card-footer", children: [_jsxs("div", { className: "qiqb-message-subscription-channels", children: [_jsx(MessageOutlined, {}), _jsx("span", { children: (record.channels || [])
|
|
249
249
|
.map((channel) => metadata?.channels.find((item) => item.code === channel)?.name ||
|
|
250
250
|
(channel === 'IN_APP' ? '站内消息' : channel))
|
|
251
251
|
.join('、') || '未设置渠道' })] }), canConfigure && (_jsxs(Space, { size: 0, children: [_jsx(Button, { type: "text", size: "small", icon: _jsx(EditOutlined, {}), disabled: disabled ||
|
|
@@ -189,47 +189,6 @@
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
&__condition {
|
|
193
|
-
padding: 15px 16px 0;
|
|
194
|
-
margin-bottom: 12px;
|
|
195
|
-
background: var(--message-fill);
|
|
196
|
-
border: 1px solid var(--message-border);
|
|
197
|
-
border-radius: 10px;
|
|
198
|
-
|
|
199
|
-
> .ant-form-item {
|
|
200
|
-
margin-bottom: 17px;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&__condition-heading {
|
|
205
|
-
display: flex;
|
|
206
|
-
align-items: center;
|
|
207
|
-
justify-content: space-between;
|
|
208
|
-
margin-bottom: 14px;
|
|
209
|
-
|
|
210
|
-
strong {
|
|
211
|
-
color: var(--message-muted);
|
|
212
|
-
font-size: 11px;
|
|
213
|
-
font-weight: 600;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
&__condition-fields {
|
|
218
|
-
display: grid;
|
|
219
|
-
grid-template-columns: minmax(0, 1fr) 150px;
|
|
220
|
-
gap: 12px;
|
|
221
|
-
.ant-form-item {
|
|
222
|
-
min-width: 0;
|
|
223
|
-
margin-bottom: 14px;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&__add-condition {
|
|
228
|
-
height: 38px;
|
|
229
|
-
border-color: var(--message-border);
|
|
230
|
-
color: var(--message-primary);
|
|
231
|
-
background: transparent;
|
|
232
|
-
}
|
|
233
192
|
&__hint {
|
|
234
193
|
margin: 10px 0 0;
|
|
235
194
|
color: var(--message-muted);
|
|
@@ -326,10 +285,6 @@
|
|
|
326
285
|
.ant-drawer-footer {
|
|
327
286
|
padding: 15px 18px;
|
|
328
287
|
}
|
|
329
|
-
&__condition-fields {
|
|
330
|
-
grid-template-columns: minmax(0, 1fr);
|
|
331
|
-
gap: 0;
|
|
332
|
-
}
|
|
333
288
|
&__footer > span {
|
|
334
289
|
max-width: 110px;
|
|
335
290
|
line-height: 1.5;
|
|
@@ -137,12 +137,12 @@
|
|
|
137
137
|
overflow-wrap: anywhere;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
.qiqb-message-subscription-
|
|
140
|
+
.qiqb-message-subscription-scope {
|
|
141
141
|
flex: 1;
|
|
142
142
|
padding: 22px 0;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.qiqb-message-subscription-
|
|
145
|
+
.qiqb-message-subscription-scope-label {
|
|
146
146
|
margin-bottom: 10px;
|
|
147
147
|
color: var(--message-muted);
|
|
148
148
|
font-size: 12px;
|
|
@@ -37,8 +37,8 @@ export default function TopicPage() {
|
|
|
37
37
|
const modesVersion = useRef(0);
|
|
38
38
|
const syncId = useRef();
|
|
39
39
|
const mounted = useRef(true);
|
|
40
|
-
const canSave = access.verifyElementPermission('
|
|
41
|
-
const canRemove = access.verifyElementPermission('
|
|
40
|
+
const canSave = access.verifyElementPermission('QiqbPlatformMessageTopicSaveBtn');
|
|
41
|
+
const canRemove = access.verifyElementPermission('QiqbPlatformMessageTopicRemoveBtn');
|
|
42
42
|
const loadSubscriptionModes = useCallback(async () => {
|
|
43
43
|
const version = ++modesVersion.current;
|
|
44
44
|
setModesLoading(true);
|
|
@@ -73,9 +73,10 @@ export default function TopicPage() {
|
|
|
73
73
|
setEditing(record);
|
|
74
74
|
form.resetFields();
|
|
75
75
|
form.setFieldsValue({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
code: record?.code,
|
|
77
|
+
name: record?.name,
|
|
78
|
+
enabled: record ? record.enabled : true,
|
|
79
|
+
description: record?.description,
|
|
79
80
|
subscriptionMode: record?.subscriptionMode || 'ALL_ACCOUNTS',
|
|
80
81
|
// 编辑历史主题时显式回填默认值,避免缺字段导致表单空选或保存丢失默认配置。
|
|
81
82
|
reminderMode: record?.reminderMode || 'FLOATING',
|
|
@@ -93,7 +94,11 @@ export default function TopicPage() {
|
|
|
93
94
|
setSaving(true);
|
|
94
95
|
try {
|
|
95
96
|
await saveMessageTopic({
|
|
96
|
-
|
|
97
|
+
// 只提交当前主题配置,避免旧响应中的已移除字段随编辑请求回传。
|
|
98
|
+
code: values.code,
|
|
99
|
+
name: values.name,
|
|
100
|
+
enabled: values.enabled,
|
|
101
|
+
description: values.description,
|
|
97
102
|
id: editing?.id,
|
|
98
103
|
reminderMode: values.reminderMode || 'FLOATING',
|
|
99
104
|
messageLevel: values.messageLevel || 'NORMAL',
|
|
@@ -157,7 +162,6 @@ export default function TopicPage() {
|
|
|
157
162
|
messageId: previewId,
|
|
158
163
|
topicCode: values.code?.trim() || 'PREVIEW_TOPIC',
|
|
159
164
|
topicName,
|
|
160
|
-
sourceSystem: values.sourceSystem?.trim() || 'Platform',
|
|
161
165
|
title: `提醒预览 · ${topicName}`,
|
|
162
166
|
content: `这是一条${messageLevelLabels[messageLevel]}级别的示例消息,采用${reminderModeLabels[reminderMode]}展示。预览不会保存配置、发布消息或改变收件状态。`,
|
|
163
167
|
createTime: now,
|
|
@@ -169,7 +173,6 @@ export default function TopicPage() {
|
|
|
169
173
|
const columns = [
|
|
170
174
|
{ title: '主题编码', dataIndex: 'code', copyable: true, width: 190 },
|
|
171
175
|
{ title: '主题名称', dataIndex: 'name', width: 190 },
|
|
172
|
-
{ title: '来源系统', dataIndex: 'sourceSystem', width: 130 },
|
|
173
176
|
{
|
|
174
177
|
title: '提醒方式',
|
|
175
178
|
dataIndex: 'reminderMode',
|
|
@@ -213,7 +216,9 @@ export default function TopicPage() {
|
|
|
213
216
|
title: '操作',
|
|
214
217
|
valueType: 'option',
|
|
215
218
|
width: 260,
|
|
216
|
-
render: (_, record) => (_jsxs(Space, { children: [canSave && _jsx("a", { onClick: () => editTopic(record), children: "\u7F16\u8F91" }), canSave && (_jsx(Button, { size: "small", type: "link", icon: _jsx(SyncOutlined, {}), loading: syncingId === record.id, disabled: !!syncingId || removingId === record.id, onClick: () => void syncSubscriptions(record), children: "\u540C\u6B65\u8BA2\u9605" })), canRemove && (_jsx(Popconfirm, { title: "\u5220\u9664\u8BE5\u6D88\u606F\u4E3B\u9898\uFF1F",
|
|
219
|
+
render: (_, record) => (_jsxs(Space, { children: [canSave && _jsx("a", { onClick: () => editTopic(record), children: "\u7F16\u8F91" }), canSave && (_jsx(Button, { size: "small", type: "link", icon: _jsx(SyncOutlined, {}), loading: syncingId === record.id, disabled: !!syncingId || removingId === record.id, onClick: () => void syncSubscriptions(record), children: "\u540C\u6B65\u8BA2\u9605" })), canRemove && (_jsx(Popconfirm, { title: "\u5220\u9664\u8BE5\u6D88\u606F\u4E3B\u9898\uFF1F",
|
|
220
|
+
// 服务端删除主题后会清理其全部订阅(个人订阅与角色订阅),确认前明确提示影响范围。
|
|
221
|
+
description: "\u5C06\u540C\u65F6\u5220\u9664\u8BE5\u4E3B\u9898\u4E0B\u7684\u5168\u90E8\u4E2A\u4EBA\u8BA2\u9605\u4E0E\u89D2\u8272\u8BA2\u9605\uFF0C\u5DF2\u53D1\u5E03\u6D88\u606F\u4E0D\u53D7\u5F71\u54CD\u3002", onConfirm: async () => {
|
|
217
222
|
setRemovingId(record.id);
|
|
218
223
|
try {
|
|
219
224
|
await removeMessageTopic(record.id);
|
|
@@ -231,7 +236,7 @@ export default function TopicPage() {
|
|
|
231
236
|
];
|
|
232
237
|
return (_jsxs(PageContainer, { title: "\u6D88\u606F\u4E3B\u9898", children: [modesFailed && (_jsx(Alert, { type: "error", showIcon: true, message: "\u8BA2\u9605\u6A21\u5F0F\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u540E\u4FDD\u5B58\u4E3B\u9898\u3002", action: _jsx(Button, { size: "small", onClick: () => void loadSubscriptionModes(), children: "\u91CD\u8BD5" }) })), _jsx(ProTable, { rowKey: "id", actionRef: actionRef, columns: columns,
|
|
233
238
|
// 列表保留主题管理字段,窄屏通过横向滚动展示,避免压缩新增配置的中文标签。
|
|
234
|
-
scroll: { x:
|
|
239
|
+
scroll: { x: 1310 }, pagination: { defaultPageSize: 20, showSizeChanger: true }, toolBarRender: () => canSave
|
|
235
240
|
? [
|
|
236
241
|
_jsx(Button, { type: "primary", icon: _jsx(PlusOutlined, {}), onClick: () => editTopic(), children: "\u65B0\u589E\u4E3B\u9898" }, "create"),
|
|
237
242
|
]
|
|
@@ -256,13 +261,13 @@ export default function TopicPage() {
|
|
|
256
261
|
} }), _jsx(Modal, { title: editing ? '编辑消息主题' : '新增消息主题', open: open, width: 680, onCancel: () => {
|
|
257
262
|
if (!saving)
|
|
258
263
|
setOpen(false);
|
|
259
|
-
}, onOk: save, confirmLoading: saving, okButtonProps: {
|
|
264
|
+
}, onOk: save, confirmLoading: saving, okButtonProps: {
|
|
265
|
+
disabled: !canSave || modesLoading || modesFailed,
|
|
266
|
+
}, cancelButtonProps: { disabled: saving }, destroyOnHidden: true, children: _jsxs(Form, { form: form, layout: "vertical", children: [_jsx(Form.Item, { name: "code", label: "\u4E3B\u9898\u7F16\u7801", rules: [
|
|
260
267
|
{ required: true, whitespace: true, message: '请输入主题编码' },
|
|
261
268
|
], children: _jsx(Input, { disabled: !!editing, placeholder: "\u4F8B\u5982 ERP_APPROVAL_NOTICE", maxLength: 64 }) }), _jsx(Form.Item, { name: "name", label: "\u4E3B\u9898\u540D\u79F0", rules: [
|
|
262
269
|
{ required: true, whitespace: true, message: '请输入主题名称' },
|
|
263
|
-
], children: _jsx(Input, { maxLength: 128 }) }), _jsx(Form.Item, { name: "
|
|
264
|
-
{ required: true, whitespace: true, message: '请输入来源系统' },
|
|
265
|
-
], children: _jsx(Input, { disabled: !!editing, placeholder: "\u4F8B\u5982 ERP\u3001OA\u3001CRM", maxLength: 64 }) }), _jsx(Form.Item, { name: "enabled", label: "\u542F\u7528", valuePropName: "checked", children: _jsx(Switch, {}) }), _jsx(Form.Item, { name: "subscriptionMode", label: "\u8BA2\u9605\u6A21\u5F0F", extra: "\u5168\u91CF\u8D26\u6237\u8BA2\u9605\u4F1A\u5728\u521B\u5EFA\u4E3B\u9898\u65F6\u7ED1\u5B9A\u6709\u6548\u8D26\u6237\uFF1B\u89D2\u8272\u8BA2\u9605\u7531\u89D2\u8272\u914D\u7F6E\u4E0E\u8D26\u6237\u7ED1\u5B9A\u5173\u7CFB\u786E\u5B9A\u3002\u540C\u6B65\u8BA2\u9605\u53EF\u8865\u9F50\u6211\u7684\u8BA2\u9605\u3002", rules: [{ required: true, message: '请选择订阅模式' }], children: _jsx(Select, { loading: modesLoading, disabled: modesLoading || modesFailed, options: subscriptionModes.map((item) => ({
|
|
270
|
+
], children: _jsx(Input, { maxLength: 128 }) }), _jsx(Form.Item, { name: "enabled", label: "\u542F\u7528", valuePropName: "checked", children: _jsx(Switch, {}) }), _jsx(Form.Item, { name: "subscriptionMode", label: "\u8BA2\u9605\u6A21\u5F0F", extra: "\u5168\u91CF\u8D26\u6237\u8BA2\u9605\u4F1A\u5728\u521B\u5EFA\u4E3B\u9898\u65F6\u7ED1\u5B9A\u6709\u6548\u8D26\u6237\uFF1B\u89D2\u8272\u8BA2\u9605\u7531\u89D2\u8272\u914D\u7F6E\u4E0E\u8D26\u6237\u7ED1\u5B9A\u5173\u7CFB\u786E\u5B9A\u3002\u540C\u6B65\u8BA2\u9605\u53EF\u8865\u9F50\u6211\u7684\u8BA2\u9605\u3002", rules: [{ required: true, message: '请选择订阅模式' }], children: _jsx(Select, { loading: modesLoading, disabled: modesLoading || modesFailed, options: subscriptionModes.map((item) => ({
|
|
266
271
|
value: item.code,
|
|
267
272
|
label: item.name,
|
|
268
273
|
})) }) }), _jsxs(Row, { gutter: 16, children: [_jsx(Col, { xs: 24, sm: 12, children: _jsx(Form.Item, { name: "reminderMode", label: "\u63D0\u9192\u65B9\u5F0F", children: _jsx(Select, { options: Object.entries(reminderModeLabels).map(([value, label]) => ({
|
package/build/routes.cjs
CHANGED
|
@@ -12,25 +12,25 @@ function createMessageRoutes({ projectCode = exports.MESSAGE_PROJECT_CODE, baseP
|
|
|
12
12
|
{
|
|
13
13
|
name: '消息主题',
|
|
14
14
|
path: `${base}/topics`,
|
|
15
|
-
permissionCode: '
|
|
15
|
+
permissionCode: 'QiqbPlatformMessageTopicPage',
|
|
16
16
|
component: '@qiqb/message-domain/pages/topic/TopicPage',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: '我的订阅',
|
|
20
20
|
path: `${base}/my-subscriptions`,
|
|
21
|
-
permissionCode: '
|
|
21
|
+
permissionCode: 'QiqbPlatformMessageSubscriptionPage',
|
|
22
22
|
component: '@qiqb/message-domain/pages/subscription/PersonalSubscriptionPage',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
name: '角色订阅',
|
|
26
26
|
path: `${base}/role-subscriptions`,
|
|
27
|
-
permissionCode: '
|
|
27
|
+
permissionCode: 'QiqbPlatformMessageRoleSubscriptionPage',
|
|
28
28
|
component: '@qiqb/message-domain/pages/subscription/RoleSubscriptionPage',
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
name: '我的消息',
|
|
32
32
|
path: `${base}/inbox`,
|
|
33
|
-
permissionCode: '
|
|
33
|
+
permissionCode: 'QiqbPlatformMessageInboxPage',
|
|
34
34
|
component: '@qiqb/message-domain/pages/inbox/InboxPage',
|
|
35
35
|
},
|
|
36
36
|
].map((route) => ({ ...route, projectCode, hideInMenu: true }));
|
package/build/routes.js
CHANGED
|
@@ -8,25 +8,25 @@ export function createMessageRoutes({ projectCode = MESSAGE_PROJECT_CODE, basePa
|
|
|
8
8
|
{
|
|
9
9
|
name: '消息主题',
|
|
10
10
|
path: `${base}/topics`,
|
|
11
|
-
permissionCode: '
|
|
11
|
+
permissionCode: 'QiqbPlatformMessageTopicPage',
|
|
12
12
|
component: '@qiqb/message-domain/pages/topic/TopicPage',
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
name: '我的订阅',
|
|
16
16
|
path: `${base}/my-subscriptions`,
|
|
17
|
-
permissionCode: '
|
|
17
|
+
permissionCode: 'QiqbPlatformMessageSubscriptionPage',
|
|
18
18
|
component: '@qiqb/message-domain/pages/subscription/PersonalSubscriptionPage',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: '角色订阅',
|
|
22
22
|
path: `${base}/role-subscriptions`,
|
|
23
|
-
permissionCode: '
|
|
23
|
+
permissionCode: 'QiqbPlatformMessageRoleSubscriptionPage',
|
|
24
24
|
component: '@qiqb/message-domain/pages/subscription/RoleSubscriptionPage',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: '我的消息',
|
|
28
28
|
path: `${base}/inbox`,
|
|
29
|
-
permissionCode: '
|
|
29
|
+
permissionCode: 'QiqbPlatformMessageInboxPage',
|
|
30
30
|
component: '@qiqb/message-domain/pages/inbox/InboxPage',
|
|
31
31
|
},
|
|
32
32
|
].map((route) => ({ ...route, projectCode, hideInMenu: true }));
|
|
@@ -6,7 +6,6 @@ export interface MessageTopic {
|
|
|
6
6
|
id: string;
|
|
7
7
|
code: string;
|
|
8
8
|
name: string;
|
|
9
|
-
sourceSystem: string;
|
|
10
9
|
enabled: boolean;
|
|
11
10
|
/** 模式由服务端注册并返回选项,保留 string 以支持宿主扩展订阅策略。 */
|
|
12
11
|
subscriptionMode: string;
|
|
@@ -16,11 +15,6 @@ export interface MessageTopic {
|
|
|
16
15
|
messageLevel?: MessageLevel;
|
|
17
16
|
description?: string;
|
|
18
17
|
}
|
|
19
|
-
export interface MessageCondition {
|
|
20
|
-
field: string;
|
|
21
|
-
operator: string;
|
|
22
|
-
values: string[];
|
|
23
|
-
}
|
|
24
18
|
export type SubscriptionScope = 'PERSONAL' | 'ROLE';
|
|
25
19
|
export interface MessageSubscription {
|
|
26
20
|
id: string;
|
|
@@ -31,7 +25,7 @@ export interface MessageSubscription {
|
|
|
31
25
|
subjectId?: string;
|
|
32
26
|
subjectName?: string;
|
|
33
27
|
enabled: boolean;
|
|
34
|
-
|
|
28
|
+
/** 订阅总是覆盖主题全部消息,只选择通知渠道。 */
|
|
35
29
|
channels: string[];
|
|
36
30
|
}
|
|
37
31
|
export interface MessageOption {
|
|
@@ -46,7 +40,6 @@ export interface MessageRole {
|
|
|
46
40
|
}
|
|
47
41
|
export interface SubscriptionMetadata {
|
|
48
42
|
subjectTypes: MessageOption[];
|
|
49
|
-
operators: MessageOption[];
|
|
50
43
|
channels: MessageOption[];
|
|
51
44
|
}
|
|
52
45
|
export interface InboxMessage {
|
|
@@ -56,7 +49,8 @@ export interface InboxMessage {
|
|
|
56
49
|
messageId: string;
|
|
57
50
|
topicCode: string;
|
|
58
51
|
topicName?: string;
|
|
59
|
-
|
|
52
|
+
/** 发布方传入的可选来源;主题不配置来源,未传时保持为空。 */
|
|
53
|
+
sourceSystem?: string | null;
|
|
60
54
|
title: string;
|
|
61
55
|
content: string;
|
|
62
56
|
businessId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qiqb/message-domain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "与宿主框架无关的 QIQB 消息主题、订阅、收件箱与全局提醒领域包",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.less"
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "node scripts/build.mjs",
|
|
61
61
|
"lint": "tsc -p tsconfig.json --noEmit",
|
|
62
|
+
"prepack": "npm run build",
|
|
62
63
|
"pack:local": "npm pack --pack-destination /private/tmp",
|
|
63
64
|
"publish:local": "node ../scripts/publish-platform-domain.mjs --package message-domain --target local",
|
|
64
65
|
"publish:nexus": "node ../scripts/publish-platform-domain.mjs --package message-domain --target nexus",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"test:reminders": "node scripts/reminder-regression.cjs",
|
|
67
68
|
"test:routes": "node scripts/routes-entry-regression.cjs",
|
|
68
69
|
"test:runtime": "node scripts/runtime-regression.cjs",
|
|
70
|
+
"test:topics": "node scripts/topic-regression.cjs",
|
|
69
71
|
"test:presentation": "node scripts/presentation-regression.cjs",
|
|
70
72
|
"test:display": "node scripts/display-regression.cjs",
|
|
71
73
|
"test:navigation": "node scripts/navigation-regression.cjs",
|
|
@@ -91,7 +93,6 @@
|
|
|
91
93
|
"react-dom": ">=18.0.0 <20.0.0"
|
|
92
94
|
},
|
|
93
95
|
"publishConfig": {
|
|
94
|
-
"access": "public"
|
|
95
|
-
"registry": "https://registry.npmjs.org/"
|
|
96
|
+
"access": "public"
|
|
96
97
|
}
|
|
97
98
|
}
|