@robot-admin/naive-ui-components 0.14.3 → 0.16.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/CHANGELOG.md +35 -0
- package/README.md +130 -741
- package/README_EN.md +137 -678
- package/dist/C_ActionBar.css +57 -58
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +232 -238
- package/dist/C_AntV2.cjs +2 -2
- package/dist/C_AntV2.js +2 -2
- package/dist/C_AudioPlayer.css +9 -9
- package/dist/C_AvatarGroup.css +5 -6
- package/dist/C_Barcode.css +1 -1
- package/dist/C_Breadcrumb.css +15 -18
- package/dist/C_Breadcrumb2.cjs +1 -1
- package/dist/C_Breadcrumb2.js +1 -1
- package/dist/C_Captcha.css +46 -49
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +5 -6
- package/dist/C_Chat.css +8 -8
- package/dist/C_City.css +2 -2
- package/dist/C_Code.css +9 -9
- package/dist/C_CollapsePanel.css +9 -9
- package/dist/C_ContextMenu.css +31 -31
- package/dist/C_Cron.css +271 -274
- package/dist/C_Date.css +1 -1
- package/dist/C_Draggable.css +10 -11
- package/dist/C_Editor.css +2 -2
- package/dist/C_FilePreview.css +423 -423
- package/dist/C_Form.base.css +608 -602
- package/dist/C_Form.cjs +1 -1
- package/dist/C_Form.css +610 -604
- package/dist/C_Form.d.cts +2 -2
- package/dist/C_Form.d.ts +2 -2
- package/dist/C_Form.js +1 -1
- package/dist/C_FormModal.cjs +1 -1
- package/dist/C_FormModal.css +12 -17
- package/dist/C_FormModal.js +1 -1
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +53 -55
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_FormulaEditor.css +204 -205
- package/dist/C_FullCalendar.css +13 -15
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- package/dist/C_GlobalSearch.css +11 -12
- package/dist/C_Guide.css +10 -10
- package/dist/C_Icon.css +7 -8
- package/dist/C_ImageCropper.css +69 -69
- package/dist/C_Language.css +8 -8
- package/dist/C_Loading.css +22 -25
- package/dist/C_Loading2.cjs +1 -1
- package/dist/C_Loading2.js +1 -1
- package/dist/C_Login.css +130 -135
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Map.css +22 -23
- package/dist/C_Markdown.css +6 -7
- package/dist/C_Menu.css +2 -5
- package/dist/C_Menu2.cjs +1 -1
- package/dist/C_Menu2.js +1 -1
- package/dist/C_NotificationCenter.css +316 -281
- package/dist/C_NotificationCenter.d.cts +2 -2
- package/dist/C_NotificationCenter.d.ts +2 -2
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_OrgChart.css +8 -8
- package/dist/C_PageLoading.css +34 -39
- package/dist/C_QRCode.css +5 -6
- package/dist/C_Signature.css +5 -6
- package/dist/C_Skeleton.css +2 -2
- package/dist/C_SplitPane.css +2 -2
- package/dist/C_Steps.css +5 -6
- package/dist/C_Table.base.css +1090 -879
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +1096 -885
- package/dist/C_Table.d.cts +1 -1
- package/dist/C_Table.d.ts +1 -1
- package/dist/C_Table.js +1 -1
- package/dist/C_Tabs.css +5 -6
- package/dist/C_TagsView.css +60 -63
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Theme.css +7 -8
- package/dist/C_Time.css +1 -1
- package/dist/C_Timeline.css +8 -8
- package/dist/C_Transfer.css +10 -11
- package/dist/C_Tree.css +16 -17
- package/dist/C_Upload.css +156 -157
- package/dist/C_VideoPlayer.css +267 -267
- package/dist/C_VtableGantt.css +2 -2
- package/dist/C_WaterFall.css +2 -2
- package/dist/C_WorkFlow.css +466 -470
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -0
- package/dist/Card.js +1 -0
- package/dist/Custom.cjs +1 -0
- package/dist/Custom.js +1 -0
- package/dist/Dynamic.cjs +1 -0
- package/dist/Dynamic.js +1 -0
- package/dist/Steps.cjs +1 -0
- package/dist/Steps.js +1 -0
- package/dist/Tabs.cjs +1 -0
- package/dist/Tabs.js +1 -0
- package/dist/cascader.cjs +1 -0
- package/dist/cascader.js +1 -0
- package/dist/color-picker.cjs +1 -0
- package/dist/color-picker.js +1 -0
- package/dist/constants3.d.cts +71 -117
- package/dist/constants3.d.ts +71 -117
- package/dist/constants4.d.cts +3 -3
- package/dist/constants4.d.ts +3 -3
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.cjs +1 -0
- package/dist/context.js +1 -0
- package/dist/contracts.d.cts +24 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/createPageLoading.cjs +1 -1
- package/dist/createPageLoading.js +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.cts +9 -9
- package/dist/data.d.ts +9 -9
- package/dist/data.js +1 -1
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.js +1 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +5 -5
- package/dist/index.vue.d.ts +5 -5
- package/dist/index10.vue.d.cts +5 -5
- package/dist/index10.vue.d.ts +3 -3
- package/dist/index11.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +2 -2
- package/dist/index12.vue.d.cts +2 -2
- package/dist/index12.vue.d.ts +1 -1
- package/dist/index13.vue.d.cts +1 -1
- package/dist/index14.vue.d.ts +9 -9
- package/dist/index15.vue.d.cts +9 -9
- package/dist/index15.vue.d.ts +1 -1
- package/dist/index16.vue.d.cts +1 -1
- package/dist/index18.vue.d.ts +4 -4
- package/dist/index19.vue.d.cts +4 -4
- package/dist/index19.vue.d.ts +2 -9
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +1 -1
- package/dist/index21.vue.d.cts +2 -2
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +1 -1
- package/dist/index22.vue.d.ts +1 -1
- package/dist/index23.vue.d.cts +1 -1
- package/dist/index23.vue.d.ts +1 -1
- package/dist/index25.vue.d.cts +4 -4
- package/dist/index25.vue.d.ts +4 -4
- package/dist/index26.vue.d.cts +1 -1
- package/dist/index26.vue.d.ts +1 -1
- package/dist/index27.vue.d.cts +5 -5
- package/dist/index27.vue.d.ts +5 -5
- package/dist/index28.vue.d.cts +3 -3
- package/dist/index28.vue.d.ts +3 -3
- package/dist/index3.vue.d.cts +3 -3
- package/dist/index3.vue.d.ts +3 -3
- package/dist/index4.vue.d.cts +2 -9
- package/dist/index6.vue.d.ts +4 -4
- package/dist/index7.vue.d.cts +4 -4
- package/dist/index8.vue.d.ts +3 -3
- package/dist/index9.vue.d.cts +3 -3
- package/dist/index9.vue.d.ts +5 -5
- package/dist/mapUtils.d.cts +5 -5
- package/dist/mapUtils.d.ts +5 -5
- package/dist/presets.d.cts +8 -2
- package/dist/presets.d.ts +8 -2
- package/dist/rate.cjs +1 -0
- package/dist/rate.js +1 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +1 -0
- package/dist/style.css +10725 -10722
- package/dist/time-picker.cjs +1 -0
- package/dist/time-picker.js +1 -0
- package/dist/upload.cjs +1 -0
- package/dist/upload.js +1 -0
- package/dist/useActionTask.cjs +1 -0
- package/dist/useActionTask.js +1 -0
- package/dist/useCalendarEvents.d.cts +2 -2
- package/dist/useCalendarEvents.d.ts +2 -2
- package/dist/useCollapsePanel.d.cts +5 -5
- package/dist/useCollapsePanel.d.ts +5 -5
- package/dist/useComponentLocale.cjs +1 -0
- package/dist/useComponentLocale.js +1 -0
- package/dist/useCropperCore.d.cts +8 -8
- package/dist/useCropperCore.d.ts +8 -8
- package/dist/useDraggableLayout.d.cts +9 -9
- package/dist/useDraggableLayout.d.ts +9 -9
- package/dist/useDynamicFormState.cjs +1 -0
- package/dist/useDynamicFormState.d.cts +64 -40
- package/dist/useDynamicFormState.d.ts +64 -40
- package/dist/useDynamicFormState.js +1 -0
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useQRCode.d.cts +2 -2
- package/dist/useQRCode.d.ts +2 -2
- package/dist/useSearchState.d.cts +14 -724
- package/dist/useSearchState.d.ts +14 -833
- package/dist/useSignatureHistory.d.cts +3 -3
- package/dist/useSignatureHistory.d.ts +3 -3
- package/dist/useSplitResize.d.cts +5 -5
- package/dist/useSplitResize.d.ts +5 -5
- package/dist/useTableQuery.cjs +3 -3
- package/dist/useTableQuery.d.cts +66 -33
- package/dist/useTableQuery.d.ts +66 -33
- package/dist/useTableQuery.js +3 -3
- package/dist/useTimeSelection.d.cts +2 -2
- package/dist/useTimeSelection.d.ts +2 -2
- package/dist/useTreeOperations.d.cts +7 -7
- package/dist/useTreeOperations.d.ts +7 -7
- package/dist/useWorkflowValidation.d.cts +5 -5
- package/dist/useWorkflowValidation.d.ts +5 -5
- package/dist/verification.d.cts +1 -1
- package/dist/verification.d.ts +1 -1
- package/docs/architecture.en.md +83 -0
- package/docs/architecture.md +83 -0
- package/docs/assets/README.md +47 -0
- package/docs/assets/naive-ui-components-banner.png +0 -0
- package/docs/assets/naive-ui-components-banner.svg +69 -0
- package/docs/assets/naive-ui-components-logo.png +0 -0
- package/docs/assets/naive-ui-components-logo.svg +22 -0
- package/docs/components.en.md +118 -0
- package/docs/components.md +118 -0
- package/docs/engineering.en.md +132 -0
- package/docs/engineering.md +133 -0
- package/docs/guides/notification-center.md +95 -0
- package/docs/guides/usage.en.md +638 -0
- package/docs/guides/usage.md +699 -0
- package/docs/performance-0.15.0.md +20 -0
- package/docs/security-scan-2026-10-06.md +11 -0
- package/docs/security-scan-2026-10-18.md +16 -0
- package/package.json +29 -11
- package/dist/C_Form2.cjs +0 -1
- package/dist/C_Form2.js +0 -1
- package/dist/config.cjs +0 -1
- package/dist/config.d.cts +0 -33
- package/dist/config.d.ts +0 -33
- package/dist/config.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { CATEGORY_MAP, CATEGORY_TABS, _default as C_NotificationCenter, type ClearNotificationsFn, DEFAULT_MAX_BADGE_COUNT, DEFAULT_PAGE_SIZE, DEFAULT_POLLING_INTERVAL, DEFAULT_STORAGE_KEY, DEFAULT_WS_HEARTBEAT_INTERVAL, DEFAULT_WS_HEARTBEAT_MESSAGE, DEFAULT_WS_MAX_RECONNECT, DEFAULT_WS_RECONNECT_INTERVAL, type DeleteNotificationFn, type FetchNotificationsFn, MOCK_MESSAGES, type MarkAllReadFn, type MarkAsReadFn, type NotificationCategory, type NotificationCenterEmits, type NotificationCenterExpose, type NotificationCenterProps, type NotificationMessage, type NotificationPriority, type NotificationSender, type NotificationStatus, type NotificationWSConfig, PRIORITY_MAP, type WSConnectionStatus, type WSNotificationPayload, useNotificationCore, useNotificationFormat, useNotificationWS };
|
|
1
|
+
import { A as NotificationPriority, C as NotificationCategory, D as NotificationCenterProps, E as NotificationCenterExpose, F as WSConnectionStatus, I as WSNotificationPayload, M as NotificationStatus, N as NotificationUnreadByCategory, O as NotificationDataMode, P as NotificationWSConfig, S as MarkAsReadFn, T as NotificationCenterEmits, _ as ClearNotificationsFn, a as DEFAULT_POLLING_INTERVAL, b as FetchNotificationsResult, c as DEFAULT_WS_HEARTBEAT_MESSAGE, d as MOCK_MESSAGES, f as PRIORITY_MAP, g as _default, h as useNotificationCore, i as DEFAULT_PAGE_SIZE, j as NotificationSender, k as NotificationMessage, l as DEFAULT_WS_MAX_RECONNECT, m as useNotificationFormat, n as CATEGORY_TABS, o as DEFAULT_STORAGE_KEY, p as useNotificationWS, r as DEFAULT_MAX_BADGE_COUNT, s as DEFAULT_WS_HEARTBEAT_INTERVAL, t as CATEGORY_MAP, u as DEFAULT_WS_RECONNECT_INTERVAL, v as DeleteNotificationFn, w as NotificationCenterController, x as MarkAllReadFn, y as FetchNotificationsFn } from "./constants3.cjs";
|
|
2
|
+
export { CATEGORY_MAP, CATEGORY_TABS, _default as C_NotificationCenter, type ClearNotificationsFn, DEFAULT_MAX_BADGE_COUNT, DEFAULT_PAGE_SIZE, DEFAULT_POLLING_INTERVAL, DEFAULT_STORAGE_KEY, DEFAULT_WS_HEARTBEAT_INTERVAL, DEFAULT_WS_HEARTBEAT_MESSAGE, DEFAULT_WS_MAX_RECONNECT, DEFAULT_WS_RECONNECT_INTERVAL, type DeleteNotificationFn, type FetchNotificationsFn, type FetchNotificationsResult, MOCK_MESSAGES, type MarkAllReadFn, type MarkAsReadFn, type NotificationCategory, type NotificationCenterController, type NotificationCenterEmits, type NotificationCenterExpose, type NotificationCenterProps, type NotificationDataMode, type NotificationMessage, type NotificationPriority, type NotificationSender, type NotificationStatus, type NotificationUnreadByCategory, type NotificationWSConfig, PRIORITY_MAP, type WSConnectionStatus, type WSNotificationPayload, useNotificationCore, useNotificationFormat, useNotificationWS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { CATEGORY_MAP, CATEGORY_TABS, _default as C_NotificationCenter, type ClearNotificationsFn, DEFAULT_MAX_BADGE_COUNT, DEFAULT_PAGE_SIZE, DEFAULT_POLLING_INTERVAL, DEFAULT_STORAGE_KEY, DEFAULT_WS_HEARTBEAT_INTERVAL, DEFAULT_WS_HEARTBEAT_MESSAGE, DEFAULT_WS_MAX_RECONNECT, DEFAULT_WS_RECONNECT_INTERVAL, type DeleteNotificationFn, type FetchNotificationsFn, MOCK_MESSAGES, type MarkAllReadFn, type MarkAsReadFn, type NotificationCategory, type NotificationCenterEmits, type NotificationCenterExpose, type NotificationCenterProps, type NotificationMessage, type NotificationPriority, type NotificationSender, type NotificationStatus, type NotificationWSConfig, PRIORITY_MAP, type WSConnectionStatus, type WSNotificationPayload, useNotificationCore, useNotificationFormat, useNotificationWS };
|
|
1
|
+
import { A as NotificationPriority, C as NotificationCategory, D as NotificationCenterProps, E as NotificationCenterExpose, F as WSConnectionStatus, I as WSNotificationPayload, M as NotificationStatus, N as NotificationUnreadByCategory, O as NotificationDataMode, P as NotificationWSConfig, S as MarkAsReadFn, T as NotificationCenterEmits, _ as ClearNotificationsFn, a as DEFAULT_POLLING_INTERVAL, b as FetchNotificationsResult, c as DEFAULT_WS_HEARTBEAT_MESSAGE, d as MOCK_MESSAGES, f as PRIORITY_MAP, g as _default, h as useNotificationCore, i as DEFAULT_PAGE_SIZE, j as NotificationSender, k as NotificationMessage, l as DEFAULT_WS_MAX_RECONNECT, m as useNotificationFormat, n as CATEGORY_TABS, o as DEFAULT_STORAGE_KEY, p as useNotificationWS, r as DEFAULT_MAX_BADGE_COUNT, s as DEFAULT_WS_HEARTBEAT_INTERVAL, t as CATEGORY_MAP, u as DEFAULT_WS_RECONNECT_INTERVAL, v as DeleteNotificationFn, w as NotificationCenterController, x as MarkAllReadFn, y as FetchNotificationsFn } from "./constants3.js";
|
|
2
|
+
export { CATEGORY_MAP, CATEGORY_TABS, _default as C_NotificationCenter, type ClearNotificationsFn, DEFAULT_MAX_BADGE_COUNT, DEFAULT_PAGE_SIZE, DEFAULT_POLLING_INTERVAL, DEFAULT_STORAGE_KEY, DEFAULT_WS_HEARTBEAT_INTERVAL, DEFAULT_WS_HEARTBEAT_MESSAGE, DEFAULT_WS_MAX_RECONNECT, DEFAULT_WS_RECONNECT_INTERVAL, type DeleteNotificationFn, type FetchNotificationsFn, type FetchNotificationsResult, MOCK_MESSAGES, type MarkAllReadFn, type MarkAsReadFn, type NotificationCategory, type NotificationCenterController, type NotificationCenterEmits, type NotificationCenterExpose, type NotificationCenterProps, type NotificationDataMode, type NotificationMessage, type NotificationPriority, type NotificationSender, type NotificationStatus, type NotificationUnreadByCategory, type NotificationWSConfig, PRIORITY_MAP, type WSConnectionStatus, type WSNotificationPayload, useNotificationCore, useNotificationFormat, useNotificationWS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./html.cjs`),r=require(`./storage.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o=6e4,s=`notification_center`,c=3e3,l=3e4,u=`ping`,d={system:{label:`系统通知`,icon:`mdi:cog-outline`,color:`info`},business:{label:`业务消息`,icon:`mdi:briefcase-outline`,color:`success`},alarm:{label:`告警预警`,icon:`mdi:alert-outline`,color:`warning`}},f=[{key:`all`,label:`全部`},{key:`system`,label:`系统通知`},{key:`business`,label:`业务消息`},{key:`alarm`,label:`告警预警`}],p={low:{label:`低`,type:`default`},normal:{label:`普通`,type:`info`},high:{label:`重要`,type:`warning`},urgent:{label:`紧急`,type:`error`}},m=[{id:`msg-001`,title:`系统维护通知`,summary:`系统将于今晚 22:00-23:00 进行例行维护升级,届时部分功能可能暂时不可用。`,content:`<p>尊敬的用户:</p><p>为了提升系统性能和稳定性,我们计划于 <strong>2026年2月27日 22:00-23:00</strong> 对系统进行例行维护升级。</p><p>维护期间,以下功能可能暂时不可用:</p><ul><li>报表导出</li><li>数据同步</li><li>定时任务</li></ul><p>请提前保存好未完成的工作,感谢您的理解与支持!</p>`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-15*6e4).toISOString(),sender:{name:`系统管理员`,avatar:``}},{id:`msg-002`,title:`审批流程待处理`,summary:`张三提交的《Q1 季度预算申请》需要您审批,请尽快处理。`,category:`business`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-30*6e4).toISOString(),sender:{name:`张三`,avatar:``},actionUrl:`/workflow/approval`,actionText:`去审批`},{id:`msg-003`,title:`服务器 CPU 使用率告警`,summary:`生产环境节点 prod-node-03 CPU 使用率持续超过 90%,已触发告警阈值。`,category:`alarm`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-2*6e4).toISOString(),sender:{name:`监控中心`},actionUrl:`/monitor/server`,actionText:`查看详情`},{id:`msg-004`,title:`新版本发布 v1.14.0`,summary:`系统已升级至 v1.14.0,新增通知中心、工作流增强等多项功能。`,category:`system`,priority:`normal`,status:`unread`,timestamp:new Date(Date.now()-3*36e5).toISOString(),sender:{name:`系统管理员`}},{id:`msg-005`,title:`项目交付提醒`,summary:`「Robot Admin 二期」项目交付截止日期为 3月15日,当前进度 78%。`,category:`business`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-8*36e5).toISOString(),sender:{name:`项目管理系统`}},{id:`msg-006`,title:`数据库连接池告警`,summary:`数据库连接池使用率达到 85%,建议关注并适时扩容。`,category:`alarm`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-12*36e5).toISOString(),sender:{name:`监控中心`}},{id:`msg-007`,title:`周报提交提醒`,summary:`本周周报提交截止时间为周五 18:00,请及时提交。`,category:`business`,priority:`normal`,status:`read`,timestamp:new Date(Date.now()-24*36e5).toISOString(),sender:{name:`OA 系统`}},{id:`msg-008`,title:`账号安全提醒`,summary:`检测到您的账号在新设备上登录,如非本人操作请及时修改密码。`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-45*6e4).toISOString(),sender:{name:`安全中心`}}];function h(e,t){let n=(0,i.ref)(`disconnected`),r=null,a=0,o=null,s=null,d=null,f=0;function p(e){n.value=e,t?.(e)}function m(e){d=e,a=0,h(e)}function h(e){let t=++f;x();let n=g(e);p(`connecting`);try{r=new WebSocket(n)}catch{p(`disconnected`),v(e);return}let i=r;i.addEventListener(`open`,()=>{t!==f||i!==r||(p(`connected`),a=0,y(e))}),i.addEventListener(`message`,e=>{t!==f||i!==r||_(e.data)}),i.addEventListener(`close`,()=>{t!==f||i!==r||(r=null,b(),p(`disconnected`),e.autoReconnect!==!1&&v(e))}),i.addEventListener(`error`,()=>{})}function g(e){let t=e.getToken?.();if(t){let n=e.url.includes(`?`)?`&`:`?`;return`${e.url}${n}token=${encodeURIComponent(t)}`}return e.url}function _(t){if(typeof t==`string`&&t!==`pong`)try{let n=JSON.parse(t);n&&typeof n==`object`&&[`new_message`,`read_sync`,`count_update`].includes(String(n.type))&&`data`in n&&e(n)}catch{}}function v(e){if(d!==e||o)return;let t=Math.max(0,Math.trunc(e.maxReconnectAttempts??5));if(a>=t)return;a++,p(`reconnecting`);let n=Math.max(0,e.reconnectInterval??c),r=Math.min(6e4,n*2**(a-1)),i=f;o=setTimeout(()=>{o=null,!(i!==f||d!==e)&&h(e)},r)}function y(e){b();let t=e.heartbeatInterval??l;if(t<=0)return;let n=e.heartbeatMessage??u;s=setInterval(()=>{if(r?.readyState===WebSocket.OPEN)try{r.send(n)}catch{r.close()}},t)}function b(){s&&=(clearInterval(s),null)}function x(){b(),o&&=(clearTimeout(o),null),r&&=(r.close(),null)}function S(){d=null,f++,a=0,x(),p(`disconnected`)}function C(){d&&(a=0,h(d))}return(0,i.onBeforeUnmount)(()=>{d=null,f++,x()}),{status:(0,i.readonly)(n),connect:m,disconnect:S,reconnect:C}}function g(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.title==`string`&&typeof t.summary==`string`&&typeof t.timestamp==`string`&&[`system`,`business`,`alarm`].includes(String(t.category))&&[`low`,`normal`,`high`,`urgent`].includes(String(t.priority))&&[`read`,`unread`,`archived`].includes(String(t.status))}function _(e,t={}){let n=(0,i.ref)([]),a=(0,i.ref)(`all`),c=(0,i.ref)(!1),l=(0,i.ref)(0),u=(0,i.ref)(1),d=(0,i.ref)(null),f=(0,i.ref)(!1),p=(0,i.ref)(`disconnected`),_=0,v=(0,i.computed)(()=>n.value.filter(e=>e.status===`unread`).length),y=(0,i.computed)(()=>{let e={system:0,business:0,alarm:0};for(let t of n.value)t.status===`unread`&&t.category in e&&e[t.category]++;return e}),b=(0,i.computed)(()=>a.value===`all`?n.value:n.value.filter(e=>e.category===a.value)),x=(0,i.computed)(()=>n.value.length<l.value),S=(0,i.computed)(()=>e.storageKey??s);function C(){if(e.fetchNotifications)return;let t=r.t(S.value);if(Array.isArray(t?.readIds)){let e=new Set(t.readIds.filter(e=>typeof e==`string`));for(let t of n.value)e.has(t.id)&&t.status!==`archived`&&(t.status=`read`)}}let w=null;function T(){e.fetchNotifications||(w&&clearTimeout(w),w=setTimeout(()=>{let e=n.value.filter(e=>e.status===`read`).map(e=>e.id);r.i(S.value,{readIds:e,lastFetchTime:Date.now()}),w=null},300))}async function E(t=!1){let r=++_;t&&(u.value=1),c.value=!0;try{if(e.fetchNotifications){let i=a.value===`all`?void 0:a.value,o=e.pageSize??20,s=await e.fetchNotifications({category:i,page:u.value,pageSize:o});if(r!==_)return;let c=Array.isArray(s.list)?s.list.map(e=>({...e})):[];if(t)n.value=c;else{let e=new Set(n.value.map(e=>e.id));n.value.push(...c.filter(t=>!e.has(t.id)))}l.value=Math.max(n.value.length,Number(s.total)||0)}else D();r===_&&C()}catch(t){throw r===_&&e.onError?.(t,`fetch`),t}finally{r===_&&(c.value=!1)}}function D(){n.value=m.map(e=>({...e})),l.value=m.length}async function O(){if(!x.value||c.value)return;let e=u.value;u.value++;try{await E()}catch(t){throw u.value=e,t}}async function k(t){let r=new Set(t),i=new Map(n.value.filter(e=>r.has(e.id)).map(e=>[e.id,e.status]));for(let e of n.value)r.has(e.id)&&(e.status=`read`);if(T(),e.markAsRead)try{await e.markAsRead(t)}catch(t){for(let e of n.value){let t=i.get(e.id);t&&(e.status=t)}throw T(),e.onError?.(t,`mark-as-read`),t}}async function A(t){let r=t?n.value.filter(e=>e.category===t&&e.status===`unread`):n.value.filter(e=>e.status===`unread`);for(let e of r)e.status=`read`;if(T(),e.markAllRead)try{await e.markAllRead(t)}catch(t){for(let e of r)e.status=`unread`;throw T(),e.onError?.(t,`mark-all-as-read`),t}}async function j(t){let r=new Set(t),i=[...n.value],a=l.value;if(n.value=n.value.filter(e=>!r.has(e.id)),l.value=Math.max(0,l.value-(i.length-n.value.length)),T(),e.deleteNotification)try{await e.deleteNotification(t)}catch(t){throw n.value=i,l.value=a,T(),e.onError?.(t,`delete`),t}}async function M(t){let r=[...n.value],i=l.value;if(t?n.value=n.value.filter(e=>e.category!==t):n.value=[],l.value=n.value.length,T(),e.clearNotifications)try{await e.clearNotifications(t)}catch(t){throw n.value=r,l.value=i,T(),e.onError?.(t,`clear`),t}}function N(e){switch(e.type){case`new_message`:{let r=e.data;if(!g(r))return;n.value.some(e=>e.id===r.id)||(n.value.unshift(r),l.value++,T(),t.onNewMessage?.(r),L(r));break}case`read_sync`:{if(!Array.isArray(e.data))return;let t=e.data.filter(g),r=new Set(t.map(e=>e.id));for(let e of n.value)r.has(e.id)&&(e.status=`read`);T();break}case`count_update`:break}}function P(e){p.value=e,t.onWSStatusChange?.(e)}let{connect:F,disconnect:I}=h(N,P);function L(t){e.desktopNotification&&(typeof window>`u`||!(`Notification`in window)||Notification.permission===`granted`&&z(t))}async function R(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:Notification.requestPermission()}function z(e){let t=new Notification(e.title,{body:e.summary,icon:e.sender?.avatar||`/robot-avatar.png`,tag:e.id});t.addEventListener(`click`,()=>{window.focus(),U(e),t.close()}),setTimeout(()=>t.close(),5e3)}let B=null;function V(){H();let t=e.pollingInterval??o;t<=0||(B=setInterval(()=>{c.value||E(!0).catch(()=>void 0)},t))}function H(){B&&=(clearInterval(B),null)}function U(e){d.value=e,e.status===`unread`&&k([e.id]).catch(()=>void 0)}function W(){d.value=null}function G(t){a.value=t,d.value=null,e.fetchNotifications&&E(!0).catch(()=>void 0)}function K(){E(!0).catch(()=>void 0),V(),e.wsConfig&&F(e.wsConfig)}function q(){_++,H(),I(),w&&=(clearTimeout(w),null)}return(0,i.onMounted)(K),(0,i.onBeforeUnmount)(q),{messages:n,activeCategory:a,loading:c,total:l,page:u,selectedMessage:d,popoverVisible:f,wsStatus:p,unreadCount:v,unreadByCategory:y,filteredMessages:b,hasMore:x,fetchMessages:E,loadMore:O,markAsRead:k,markAllAsRead:A,deleteMessages:j,clearMessages:M,selectMessage:U,clearSelection:W,switchCategory:G,requestDesktopPermission:R,connectWS:F,disconnectWS:I}}const v={class:`notification-badge`},y=[`aria-label`],b={key:0,class:`notification-badge__count`},x={key:0,class:`notification-badge__pulse`},S=(0,i.defineComponent)({__name:`NotificationBadge`,props:{count:{default:0},maxCount:{default:99},hasUrgent:{type:Boolean,default:!1}},emits:[`click`],setup(t){let n=t,r=(0,i.computed)(()=>n.count>n.maxCount?`${n.maxCount}+`:String(n.count));return(n,o)=>{let s=a.NTooltip;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,v,[(0,i.createVNode)(s,{trigger:`hover`,placement:`bottom`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`button`,{type:`button`,class:`notification-badge__trigger`,"aria-label":`消息通知${t.count>0?`(${t.count} 条未读)`:``}`,onClick:o[0]||=e=>n.$emit(`click`)},[(0,i.createVNode)(e.t,{name:`mdi:bell-outline`,size:18,class:`notification-badge__icon`}),(0,i.createCommentVNode)(` 未读角标 `),(0,i.createVNode)(i.Transition,{name:`badge-bounce`},{default:(0,i.withCtx)(()=>[t.count>0?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,b,(0,i.toDisplayString)(r.value),1)):(0,i.createCommentVNode)(`v-if`,!0)]),_:1}),(0,i.createCommentVNode)(` 脉冲动画(有紧急消息时) `),t.hasUrgent?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,x)):(0,i.createCommentVNode)(`v-if`,!0)],8,y)]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` 消息通知`+(0,i.toDisplayString)(t.count>0?`(${t.count} 条未读)`:``),1)]),_:1})])}}});var C=t.t(S,[[`__scopeId`,`data-v-51516250`]]);const w=6e4,T=36e5,E=864e5,D=7*E,O=30*E;365*E;let k=null;function A(){return k||=j(),k}function j(){function e(e){let r=new Date(e),i=Date.now()-r.getTime();if(i<0||i<w)return`刚刚`;if(i<T)return`${Math.floor(i/w)}分钟前`;if(i<E)return`${Math.floor(i/T)}小时前`;let a=new Date;return a.setHours(0,0,0,0),r>=new Date(a.getTime()-E)&&r<a?`昨天 ${n(r.getHours())}:${n(r.getMinutes())}`:i<D?`${Math.floor(i/E)}天前`:i<O?`${Math.floor(i/D)}周前`:i<31536e6?`${Math.floor(i/O)}个月前`:t(r)}function t(e){return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}`}function n(e){return e<10?`0${e}`:String(e)}return{formatRelativeTime:e,formatFullDate:t}}const M={class:`notification-item__indicator`},N={class:`notification-item__avatar`},P={class:`notification-item__body`},F={class:`notification-item__header`},I={class:`notification-item__title`},L={class:`notification-item__summary`},R={class:`notification-item__meta`},z={class:`notification-item__time`},B={key:0,class:`notification-item__sender`},V=(0,i.defineComponent)({__name:`NotificationItem`,props:{message:{}},emits:[`click`,`read`,`delete`],setup(t){let n=t,{formatRelativeTime:r}=A(),o=(0,i.computed)(()=>d[n.message.category]?.icon??`mdi:bell-outline`),s=(0,i.computed)(()=>p[n.message.priority]??p.normal),c=(0,i.computed)(()=>r(n.message.timestamp));return(n,r)=>{let l=a.NAvatar,u=a.NTag,d=a.NTooltip;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:(0,i.normalizeClass)([`notification-item`,{"notification-item--unread":t.message.status===`unread`,"notification-item--urgent":t.message.priority===`urgent`}]),onClick:r[3]||=e=>n.$emit(`click`,t.message)},[(0,i.createCommentVNode)(` 未读指示点 `),(0,i.createElementVNode)(`div`,M,[t.message.status===`unread`?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:0,class:(0,i.normalizeClass)([`notification-item__dot`,`notification-item__dot--${t.message.priority}`])},null,2)):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createCommentVNode)(` 头像 `),(0,i.createElementVNode)(`div`,N,[t.message.sender?.avatar?((0,i.openBlock)(),(0,i.createBlock)(l,{key:0,src:t.message.sender.avatar,size:36,round:``},null,8,[`src`])):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:(0,i.normalizeClass)([`notification-item__avatar-placeholder`,`notification-item__avatar-placeholder--${t.message.category}`])},[(0,i.createVNode)(e.t,{name:o.value,size:16},null,8,[`name`])],2))]),(0,i.createCommentVNode)(` 内容 `),(0,i.createElementVNode)(`div`,P,[(0,i.createElementVNode)(`div`,F,[(0,i.createElementVNode)(`span`,I,(0,i.toDisplayString)(t.message.title),1),t.message.priority===`urgent`||t.message.priority===`high`?((0,i.openBlock)(),(0,i.createBlock)(u,{key:0,type:s.value.type,size:`tiny`,bordered:!1,round:``},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(s.value.label),1)]),_:1},8,[`type`])):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createElementVNode)(`div`,L,(0,i.toDisplayString)(t.message.summary),1),(0,i.createElementVNode)(`div`,R,[(0,i.createElementVNode)(`span`,z,(0,i.toDisplayString)(c.value),1),t.message.sender?.name?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,B,(0,i.toDisplayString)(t.message.sender.name),1)):(0,i.createCommentVNode)(`v-if`,!0)])]),(0,i.createCommentVNode)(` 操作区 `),(0,i.createElementVNode)(`div`,{class:`notification-item__actions`,onClick:r[2]||=(0,i.withModifiers)(()=>{},[`stop`])},[t.message.status===`unread`?((0,i.openBlock)(),(0,i.createBlock)(d,{key:0,trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,{class:`notification-item__action`,onClick:r[0]||=e=>n.$emit(`read`,t.message.id)},[(0,i.createVNode)(e.t,{name:`mdi:check`,size:16})])]),default:(0,i.withCtx)(()=>[r[4]||=(0,i.createTextVNode)(` 标记已读 `,-1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createVNode)(d,{trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,{class:`notification-item__action`,onClick:r[1]||=e=>n.$emit(`delete`,t.message.id)},[(0,i.createVNode)(e.t,{name:`mdi:delete-outline`,size:16})])]),default:(0,i.withCtx)(()=>[r[5]||=(0,i.createTextVNode)(` 删除 `,-1)]),_:1})])],2)}}});var H=t.t(V,[[`__scopeId`,`data-v-2f1c8e96`]]);const U={class:`notification-list`},W={class:`notification-list__tabs`},G=[`onClick`],K={key:0,class:`notification-list__tab-count`},q={key:0,class:`notification-list__toolbar`},ee={class:`notification-list__skeleton-text`},J={class:`notification-list__items`},Y={class:`notification-list__empty`},X=(0,i.defineComponent)({__name:`NotificationList`,props:{messages:{},activeCategory:{},unreadByCategory:{},unreadCount:{},loading:{type:Boolean},hasMore:{type:Boolean},scrollHeight:{default:420}},emits:[`switchCategory`,`itemClick`,`read`,`delete`,`markAllRead`,`clear`,`loadMore`],setup(t){let n=t,r=(0,i.computed)(()=>n.activeCategory===`all`?n.unreadCount:n.unreadByCategory[n.activeCategory]??0);function o(e){return e===`all`?n.unreadCount:n.unreadByCategory[e]??0}return(n,s)=>{let c=a.NButton,l=a.NSkeleton,u=a.NSpin,d=a.NScrollbar;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,U,[(0,i.createCommentVNode)(` 分类 Tab `),(0,i.createElementVNode)(`div`,W,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(f),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:e.key,class:(0,i.normalizeClass)([`notification-list__tab`,{"notification-list__tab--active":t.activeCategory===e.key}]),onClick:t=>n.$emit(`switchCategory`,e.key)},[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(e.label),1),o(e.key)>0?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,K,(0,i.toDisplayString)(o(e.key)),1)):(0,i.createCommentVNode)(`v-if`,!0)],10,G))),128))]),(0,i.createCommentVNode)(` 操作栏 `),t.messages.length>0?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,q,[(0,i.createVNode)(c,{text:``,size:`tiny`,disabled:r.value===0,onClick:s[0]||=e=>n.$emit(`markAllRead`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:check-all`,size:14})]),default:(0,i.withCtx)(()=>[s[6]||=(0,i.createTextVNode)(` 全部已读 `,-1)]),_:1},8,[`disabled`]),(0,i.createVNode)(c,{text:``,size:`tiny`,onClick:s[1]||=e=>n.$emit(`clear`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:delete-sweep-outline`,size:14})]),default:(0,i.withCtx)(()=>[s[7]||=(0,i.createTextVNode)(` 清空 `,-1)]),_:1})])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createCommentVNode)(` 消息列表 `),(0,i.createVNode)(d,{class:`notification-list__scroll`,style:(0,i.normalizeStyle)({maxHeight:`${t.scrollHeight}px`})},{default:(0,i.withCtx)(()=>[t.loading&&t.messages.length===0?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createCommentVNode)(` 骨架屏 `),((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(4,e=>(0,i.createElementVNode)(`div`,{key:e,class:`notification-list__skeleton`},[(0,i.createVNode)(l,{circle:``,width:36,height:36}),(0,i.createElementVNode)(`div`,ee,[(0,i.createVNode)(l,{text:``,width:`60%`,height:14}),(0,i.createVNode)(l,{text:``,width:`90%`,height:12}),(0,i.createVNode)(l,{text:``,width:`40%`,height:10})])])),64))],64)):t.messages.length>0?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createElementVNode)(`div`,J,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(t.messages,e=>((0,i.openBlock)(),(0,i.createBlock)(H,{key:e.id,message:e,onClick:s[2]||=e=>n.$emit(`itemClick`,e),onRead:s[3]||=e=>n.$emit(`read`,e),onDelete:s[4]||=e=>n.$emit(`delete`,e)},null,8,[`message`]))),128))]),(0,i.createCommentVNode)(` 加载更多 `),t.hasMore?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`notification-list__load-more`,onClick:s[5]||=e=>n.$emit(`loadMore`)},[t.loading?((0,i.openBlock)(),(0,i.createBlock)(u,{key:0,size:14})):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(t.loading?`加载中...`:`加载更多`),1)])):(0,i.createCommentVNode)(`v-if`,!0)],64)):((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:2},[(0,i.createCommentVNode)(` 空状态 `),(0,i.createElementVNode)(`div`,Y,[(0,i.createVNode)(e.t,{name:`mdi:bell-off-outline`,size:48,class:`notification-list__empty-icon`}),s[8]||=(0,i.createElementVNode)(`span`,{class:`notification-list__empty-text`},`暂无消息`,-1)])],2112))]),_:1},8,[`style`])])}}});var Z=t.t(X,[[`__scopeId`,`data-v-d366768f`]]);function Q(e){return e.includes(`\\`)||e.startsWith(`//`)||Array.from(e).some(e=>e.charCodeAt(0)<32)}function te(e){let t=e?.trim();if(!t||Q(t))return null;if(/^https?:\/\//i.test(t))try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?null:{kind:`external`,url:e.href}}catch{return null}return/^[a-z][a-z\d+.-]*:/i.test(t)?null:{kind:`internal`,url:t}}const ne={class:`notification-detail`},re={class:`notification-detail__back`},ie={class:`notification-detail__header`},ae={class:`notification-detail__title`},oe={class:`notification-detail__meta`},se={class:`notification-detail__time`},ce={key:0,class:`notification-detail__sender`},le=[`innerHTML`],ue={key:1,class:`notification-detail__body`},$={key:0,class:`notification-detail__footer`},de=(0,i.defineComponent)({__name:`NotificationDetail`,props:{message:{},scrollHeight:{default:320}},emits:[`back`,`action`,`navigate`],setup(t,{emit:r}){let o=t,s=r,{formatRelativeTime:c}=A(),l=(0,i.computed)(()=>d[o.message.category]??d.system),u=(0,i.computed)(()=>p[o.message.priority]??p.normal),f=(0,i.computed)(()=>c(o.message.timestamp)),m=(0,i.computed)(()=>n.t(o.message.content||``));function h(){let e=te(o.message.actionUrl);e&&(s(`action`,e.url),e.kind===`external`?window.open(e.url,`_blank`,`noopener,noreferrer`):s(`navigate`,e.url))}return(n,r)=>{let o=a.NButton,s=a.NTag,c=a.NAvatar,d=a.NScrollbar;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,ne,[(0,i.createCommentVNode)(` 返回栏 `),(0,i.createElementVNode)(`div`,re,[(0,i.createVNode)(o,{text:``,size:`small`,onClick:r[0]||=e=>n.$emit(`back`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:arrow-left`,size:16})]),default:(0,i.withCtx)(()=>[r[1]||=(0,i.createTextVNode)(` 返回列表 `,-1)]),_:1})]),(0,i.createCommentVNode)(` 消息头部 `),(0,i.createElementVNode)(`div`,ie,[(0,i.createElementVNode)(`h3`,ae,(0,i.toDisplayString)(t.message.title),1),(0,i.createElementVNode)(`div`,oe,[(0,i.createVNode)(s,{type:l.value.color,size:`tiny`,bordered:!1,round:``},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:l.value.icon,size:12},null,8,[`name`])]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` `+(0,i.toDisplayString)(l.value.label),1)]),_:1},8,[`type`]),t.message.priority===`urgent`||t.message.priority===`high`?((0,i.openBlock)(),(0,i.createBlock)(s,{key:0,type:u.value.type,size:`tiny`,bordered:!1,round:``},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(u.value.label),1)]),_:1},8,[`type`])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,se,(0,i.toDisplayString)(f.value),1)]),t.message.sender?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,ce,[t.message.sender.avatar?((0,i.openBlock)(),(0,i.createBlock)(c,{key:0,src:t.message.sender.avatar,size:20,round:``},null,8,[`src`])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(t.message.sender.name),1)])):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createCommentVNode)(` 消息内容 `),(0,i.createVNode)(d,{class:`notification-detail__content`,style:(0,i.normalizeStyle)({maxHeight:`${t.scrollHeight}px`})},{default:(0,i.withCtx)(()=>[t.message.content?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`notification-detail__body`,innerHTML:m.value},null,8,le)):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,ue,(0,i.toDisplayString)(t.message.summary),1))]),_:1},8,[`style`]),(0,i.createCommentVNode)(` 操作区 `),t.message.actionUrl?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,$,[(0,i.createVNode)(o,{type:`primary`,size:`small`,onClick:h},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:arrow-right`,size:16})]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(t.message.actionText||`查看详情`)+` `,1)]),_:1})])):(0,i.createCommentVNode)(`v-if`,!0)])}}});var fe=t.t(de,[[`__scopeId`,`data-v-8e02b6cd`]]);const pe={class:`c-notification-center`},me={class:`c-notification-center__panel`},he={class:`c-notification-center__header`},ge={class:`c-notification-center__header-extra`},_e=(0,i.defineComponent)({name:`C_NotificationCenter`,__name:`index`,props:{fetchNotifications:{},markAsRead:{},markAllRead:{},deleteNotification:{},clearNotifications:{},wsConfig:{},desktopNotification:{type:Boolean,default:!1},maxBadgeCount:{default:99},pollingInterval:{default:6e4},pageSize:{default:20},storageKey:{default:`notification_center`},onError:{}},emits:[`itemClick`,`read`,`allRead`,`delete`,`unreadChange`,`wsStatusChange`,`newMessage`,`navigate`],setup(e,{expose:t,emit:n}){let r=e,o=n,s=_(r,{onNewMessage:e=>o(`newMessage`,e),onWSStatusChange:e=>o(`wsStatusChange`,e)}),c=(0,i.computed)(()=>s.messages.value.some(e=>e.status===`unread`&&e.priority===`urgent`)),l=(0,i.computed)(()=>({connected:`已连接`,connecting:`连接中...`,disconnected:`未连接`,reconnecting:`重连中...`})[s.wsStatus.value]??`未知`);(0,i.watch)(()=>s.unreadCount.value,e=>{o(`unreadChange`,e)});function u(){s.popoverVisible.value=!s.popoverVisible.value}function d(e){s.selectMessage(e),o(`itemClick`,e)}async function f(e){try{await s.markAsRead([e]),o(`read`,[e])}catch{}}async function p(e){try{await s.deleteMessages([e]),o(`delete`,[e])}catch{}}async function m(){let e=s.activeCategory.value===`all`?void 0:s.activeCategory.value;try{await s.markAllAsRead(e),o(`allRead`,e)}catch{}}async function h(){let e=s.activeCategory.value===`all`?void 0:s.activeCategory.value;try{await s.clearMessages(e)}catch{}}function g(){s.popoverVisible.value=!1}function v(){s.clearSelection()}return t({refresh:()=>s.fetchMessages(!0),connectWS:()=>{r.wsConfig&&s.connectWS(r.wsConfig)},disconnectWS:s.disconnectWS,getUnreadCount:()=>s.unreadCount.value,getMessages:()=>s.messages.value.map(e=>({...e})),markRead:e=>s.markAsRead(e),markAllAsRead:e=>s.markAllAsRead(e),requestDesktopPermission:s.requestDesktopPermission}),(e,t)=>{let n=a.NTooltip,_=a.NPopover;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,pe,[(0,i.createVNode)(_,{show:(0,i.unref)(s).popoverVisible.value,"onUpdate:show":t[1]||=e=>(0,i.unref)(s).popoverVisible.value=e,width:420,trigger:`manual`,placement:`bottom-end`,"show-arrow":!1,"content-class":`c-notification-center__popover`,onAfterLeave:v},{trigger:(0,i.withCtx)(()=>[(0,i.createVNode)(C,{count:(0,i.unref)(s).unreadCount.value,"max-count":r.maxBadgeCount,"has-urgent":c.value,onClick:u},null,8,[`count`,`max-count`,`has-urgent`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,me,[(0,i.createCommentVNode)(` 头部标题 `),(0,i.createElementVNode)(`div`,he,[t[2]||=(0,i.createElementVNode)(`span`,{class:`c-notification-center__title`},`消息中心`,-1),(0,i.createElementVNode)(`div`,ge,[(0,i.createCommentVNode)(` WebSocket 连接状态 `),r.wsConfig?((0,i.openBlock)(),(0,i.createBlock)(n,{key:0,trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)([`c-notification-center__ws-dot`,`c-notification-center__ws-dot--${(0,i.unref)(s).wsStatus.value}`])},null,2)]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` `+(0,i.toDisplayString)(l.value),1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0)])]),(0,i.createCommentVNode)(` 列表 / 详情切换 `),(0,i.createVNode)(i.Transition,{name:`slide-fade`,mode:`out-in`},{default:(0,i.withCtx)(()=>[(0,i.unref)(s).selectedMessage.value?((0,i.openBlock)(),(0,i.createBlock)(fe,{key:(0,i.unref)(s).selectedMessage.value.id,message:(0,i.unref)(s).selectedMessage.value,onBack:(0,i.unref)(s).clearSelection,onAction:g,onNavigate:t[0]||=e=>o(`navigate`,e)},null,8,[`message`,`onBack`])):((0,i.openBlock)(),(0,i.createBlock)(Z,{key:1,messages:(0,i.unref)(s).filteredMessages.value,"active-category":(0,i.unref)(s).activeCategory.value,"unread-by-category":(0,i.unref)(s).unreadByCategory.value,"unread-count":(0,i.unref)(s).unreadCount.value,loading:(0,i.unref)(s).loading.value,"has-more":(0,i.unref)(s).hasMore.value,onSwitchCategory:(0,i.unref)(s).switchCategory,onItemClick:d,onRead:f,onDelete:p,onMarkAllRead:m,onClear:h,onLoadMore:(0,i.unref)(s).loadMore},null,8,[`messages`,`active-category`,`unread-by-category`,`unread-count`,`loading`,`has-more`,`onSwitchCategory`,`onLoadMore`]))]),_:1})])]),_:1},8,[`show`])])}}});var ve=t.t(_e,[[`__scopeId`,`data-v-a06c4b3a`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return 20}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return 5}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return 99}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return s}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./html.cjs`),r=require(`./storage.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o=6e4,s=`notification_center`,c=3e3,l=3e4,u=`ping`,d={system:{label:`系统通知`,icon:`mdi:cog-outline`,color:`info`},business:{label:`业务消息`,icon:`mdi:briefcase-outline`,color:`success`},alarm:{label:`告警预警`,icon:`mdi:alert-outline`,color:`warning`}},f=[{key:`all`,label:`全部`},{key:`system`,label:`系统通知`},{key:`business`,label:`业务消息`},{key:`alarm`,label:`告警预警`}],p={low:{label:`低`,type:`default`},normal:{label:`普通`,type:`info`},high:{label:`重要`,type:`warning`},urgent:{label:`紧急`,type:`error`}},m=[{id:`msg-001`,title:`系统维护通知`,summary:`系统将于今晚 22:00-23:00 进行例行维护升级,届时部分功能可能暂时不可用。`,content:`<p>尊敬的用户:</p><p>为了提升系统性能和稳定性,我们计划于 <strong>2026年2月27日 22:00-23:00</strong> 对系统进行例行维护升级。</p><p>维护期间,以下功能可能暂时不可用:</p><ul><li>报表导出</li><li>数据同步</li><li>定时任务</li></ul><p>请提前保存好未完成的工作,感谢您的理解与支持!</p>`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-15*6e4).toISOString(),sender:{name:`系统管理员`,avatar:``}},{id:`msg-002`,title:`审批流程待处理`,summary:`张三提交的《Q1 季度预算申请》需要您审批,请尽快处理。`,category:`business`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-30*6e4).toISOString(),sender:{name:`张三`,avatar:``},actionUrl:`/workflow/approval`,actionText:`去审批`},{id:`msg-003`,title:`服务器 CPU 使用率告警`,summary:`生产环境节点 prod-node-03 CPU 使用率持续超过 90%,已触发告警阈值。`,category:`alarm`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-2*6e4).toISOString(),sender:{name:`监控中心`},actionUrl:`/monitor/server`,actionText:`查看详情`},{id:`msg-004`,title:`新版本发布 v1.14.0`,summary:`系统已升级至 v1.14.0,新增通知中心、工作流增强等多项功能。`,category:`system`,priority:`normal`,status:`unread`,timestamp:new Date(Date.now()-3*36e5).toISOString(),sender:{name:`系统管理员`}},{id:`msg-005`,title:`项目交付提醒`,summary:`「Robot Admin 二期」项目交付截止日期为 3月15日,当前进度 78%。`,category:`business`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-8*36e5).toISOString(),sender:{name:`项目管理系统`}},{id:`msg-006`,title:`数据库连接池告警`,summary:`数据库连接池使用率达到 85%,建议关注并适时扩容。`,category:`alarm`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-12*36e5).toISOString(),sender:{name:`监控中心`}},{id:`msg-007`,title:`周报提交提醒`,summary:`本周周报提交截止时间为周五 18:00,请及时提交。`,category:`business`,priority:`normal`,status:`read`,timestamp:new Date(Date.now()-24*36e5).toISOString(),sender:{name:`OA 系统`}},{id:`msg-008`,title:`账号安全提醒`,summary:`检测到您的账号在新设备上登录,如非本人操作请及时修改密码。`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-45*6e4).toISOString(),sender:{name:`安全中心`}}];function h(e,t){let n=(0,i.ref)(`disconnected`),r=null,a=0,o=null,s=null,d=null,f=null,p=0;function m(e){n.value=e,t?.(e)}function h(e){f=e,a=0,g(e)}function g(e){let t=++p;S(),m(`connecting`);try{r=new WebSocket(_(e))}catch{m(`disconnected`),e.autoReconnect!==!1&&y(e);return}let n=r;n.addEventListener(`open`,()=>{t!==p||n!==r||(m(`connected`),a=0,b(e))}),n.addEventListener(`message`,e=>{t!==p||n!==r||v(e.data)}),n.addEventListener(`close`,()=>{t!==p||n!==r||(r=null,x(),m(`disconnected`),e.autoReconnect!==!1&&y(e))}),n.addEventListener(`error`,()=>{})}function _(e){let t=e.getToken?.();if(t){let n=e.url.includes(`?`)?`&`:`?`;return`${e.url}${n}token=${encodeURIComponent(t)}`}return e.url}function v(t){if(typeof t==`string`){if(t===`pong`){d&&clearTimeout(d),d=null;return}try{let n=JSON.parse(t);n&&typeof n==`object`&&[`new_message`,`read_sync`,`count_update`].includes(String(n.type))&&`data`in n&&e(n)}catch{}}}function y(e){if(f!==e||o)return;let t=Math.max(0,Math.trunc(e.maxReconnectAttempts??5));if(a>=t)return;a++,m(`reconnecting`);let n=Math.max(0,e.reconnectInterval??c),r=Math.min(6e4,n*2**(a-1)),i=p;o=setTimeout(()=>{o=null,!(i!==p||f!==e)&&g(e)},r)}function b(e){x();let t=e.heartbeatInterval??l;if(t<=0)return;let n=e.heartbeatMessage??u;s=setInterval(()=>{if(r?.readyState===WebSocket.OPEN&&!d)try{r.send(n);let t=e.heartbeatTimeout??0;if(t>0){let e=r;d=setTimeout(()=>{d=null,e===r&&e.close()},t)}}catch{r.close()}},t)}function x(){d&&clearTimeout(d),d=null,s&&=(clearInterval(s),null)}function S(){x(),o&&=(clearTimeout(o),null),r&&=(r.close(),null)}function C(){f=null,p++,a=0,S(),m(`disconnected`)}function w(){f&&(a=0,g(f))}return(0,i.getCurrentScope)()&&(0,i.onScopeDispose)(C),{status:(0,i.readonly)(n),connect:h,disconnect:C,reconnect:w}}const g=[`system`,`business`,`alarm`],_=()=>({list:[],known:new Map,total:0,unread:0,categories:{},statisticsVersion:0,queryCategory:`all`});function v(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.title==`string`&&typeof t.summary==`string`&&typeof t.timestamp==`string`&&Number.isFinite(Date.parse(t.timestamp))&&g.includes(t.category)&&[`low`,`normal`,`high`,`urgent`].includes(String(t.priority))&&[`read`,`unread`,`archived`].includes(String(t.status))}function y(e){return{...e,...e.sender?{sender:{...e.sender}}:{},...e.extra?{extra:{...e.extra}}:{}}}function b(e){let t={system:0,business:0,alarm:0};for(let n of e)n.status===`unread`&&t[n.category]++;return t}function x(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function S(e){let t={};if(e&&typeof e==`object`)for(let n of g){let r=e[n];x(r)&&(t[n]=r)}return t}function C(e,t,n){let r=new Map(e);for(let e of t)n?r.delete(e.id):e.status===`unread`&&r.set(e.id,{...e,status:`read`});return r}function w(e,t,n){if(t.kind!==`delete`&&t.kind!==`clear`)return e.total;let r=e.queryCategory===t.queryCategory?t.unknownTotal:0;return Math.max(0,e.total-n-r)}function T(e,t){let n=new Set(t.ids),r=[...e.known.values()].filter(e=>n.has(e.id)),i=e.list.filter(e=>n.has(e.id)),a=r.filter(e=>e.status===`unread`),o=t.kind===`delete`||t.kind===`clear`,s=o?e.list.filter(e=>!n.has(e.id)):e.list.map(e=>n.has(e.id)&&e.status===`unread`?{...e,status:`read`}:e),c={...e.categories},l=C(e.known,r,o),u=e.statisticsVersion===t.statisticsVersion;for(let e of g){let n=c[e];if(n===void 0||!u)continue;let r=a.filter(t=>t.category===e).length;c[e]=Math.max(0,n-r-(t.unknownCategories[e]??0))}return{list:s,known:l,total:w(e,t,i.length),unread:u?Math.max(0,e.unread-a.length-t.unknownUnread):e.unread,categories:c,statisticsVersion:e.statisticsVersion,queryCategory:e.queryCategory}}function ee(e,t,n,r){if(!Array.isArray(e?.list)||!e.list.every(v)||!x(e.total)||!x(e.unreadCount))throw Error(`消息接口返回的数据或统计无效`);let i=new Map,a=new Map(t.known);if(!n)for(let e of t.list)i.set(e.id,e);for(let t of e.list){let e=y(t);i.set(t.id,e),a.set(t.id,e)}return{list:[...i.values()],known:a,total:e.total,unread:e.unreadCount,categories:S(e.unreadByCategory),statisticsVersion:t.statisticsVersion,queryCategory:r}}function te(e,t,n){let r=b(t),i={},a=n?[n]:g;for(let t of a){let n=e.categories[t];n!==void 0&&(i[t]=Math.max(0,n-r[t]))}let o=n?e.categories[n]:e.unread;return{unknownCategories:i,unknownUnread:o===void 0?0:Math.max(0,o-t.filter(e=>e.status===`unread`).length)}}function E(e,t={}){let n=(0,i.computed)(()=>e.dataMode??(e.fetchNotifications?`remote`:`demo`)),a=(0,i.shallowRef)(_()),c=(0,i.shallowRef)([]),l=(0,i.computed)(()=>c.value.reduce(T,a.value)),u=(0,i.computed)(()=>l.value.list),d=(0,i.ref)(`all`),f=(0,i.ref)(!1),p=(0,i.ref)(1),g=(0,i.ref)(null),C=(0,i.ref)(!1),w=(0,i.ref)(`disconnected`),E=(0,i.ref)(null),ne=(0,i.computed)(()=>l.value.unread),re=(0,i.computed)(()=>l.value.categories),D=(0,i.computed)(()=>d.value===`all`?u.value:u.value.filter(e=>e.category===d.value)),O=(0,i.computed)(()=>n.value===`demo`?D.value.length:l.value.total),ie=(0,i.computed)(()=>n.value===`remote`&&D.value.length<O.value),ae=(0,i.computed)(()=>c.value.length>0),oe=(0,i.computed)(()=>[...new Set(c.value.flatMap(e=>e.ids))]),k=0,A=0,se=0,j=0,M=!1,N=!1,P=[],F=null,I=!1,L,R=new Set;function z(t,n){E.value=t instanceof Error?t.message:`消息操作失败,请重试`,e.onError?.(t,n)}function B(){E.value=null}function V(e){let t=new Set([...e.list.map(e=>e.id),...c.value.flatMap(e=>e.ids)]),n=new Map,r=0;for(let[i,a]of[...e.known].reverse()){let e=t.has(i);(e||r<256)&&(n.set(i,a),e||r++)}return{...e,known:new Map([...n].reverse())}}function H(e){let t=b(e);return{list:e,known:new Map(e.map(e=>[e.id,e])),total:e.length,unread:Object.values(t).reduce((e,t)=>e+t,0),categories:t,statisticsVersion:0,queryCategory:`all`}}function ce(){let t=r.t(e.storageKey??s);if(t?.version===2&&Array.isArray(t.messages)){a.value=H(t.messages.filter(v).map(y));return}let n=new Set(Array.isArray(t?.readIds)?t.readIds:[]);a.value=H(m.map(e=>({...y(e),status:n.has(e.id)?`read`:e.status})))}function U(){n.value===`demo`&&r.i(e.storageKey??s,{version:2,messages:a.value.list.map(y)})}function W(e){let t=++A;f.value&&P.push({...e,version:t})}function le(e){return n.value===`demo`||d.value===`all`||d.value===e.category}function ue(e,t,n=!1){if(e.list.some(e=>e.id===t.id)||!n&&e.known.has(t.id))return e;let r=le(t),i={...e.categories};return t.status===`unread`&&i[t.category]!==void 0&&i[t.category]++,{list:r?[y(t),...e.list]:e.list,known:new Map([...e.known,[t.id,y(t)]]),total:e.total+(r?1:0),unread:e.unread+(t.status===`unread`?1:0),categories:i,statisticsVersion:e.statisticsVersion,queryCategory:e.queryCategory}}function de(e,t){return`operation`in t?T(e,{...t.operation,statisticsVersion:e.statisticsVersion}):`message`in t?ue(e,t.message,!0):{...e,unread:t.counts.unreadCount,categories:{...e.categories,...S(t.counts.unreadByCategory)},statisticsVersion:e.statisticsVersion+1}}function G(e,t){return!N&&t===j&&e===k}async function fe(t,n){if(!e.fetchNotifications)throw Error(`远程消息模式未配置 fetchNotifications`);return e.fetchNotifications({category:n===`all`?void 0:n,page:t,pageSize:e.pageSize??20})}function pe(e,t){let n=e;for(let e of P)e.version>t&&(n=de(n,e));return n}async function K(e,t){let r=++k,i=A,o=d.value,s=j;f.value=!0,B();try{if(n.value===`demo`){ce(),p.value=1;return}let c=await fe(e,o);if(!G(r,s))return;a.value=V(pe(ee(c,a.value,t,o),i)),p.value=e}catch(n){throw G(r,s)&&(L=()=>K(e,t),z(n,`fetch`)),n}finally{G(r,s)&&(f.value=!1,P=[])}}async function q(e=!1){await K(e?1:p.value,e)}async function me(){f.value||!ie.value||await K(p.value+1,!1)}function J(e,t,n){let r={id:++se,kind:e,ids:[...new Set(t)],category:n,unknownUnread:0,unknownCategories:{},unknownTotal:0,statisticsVersion:a.value.statisticsVersion,queryCategory:d.value};if(e!==`read-all`&&e!==`clear`)return r;let i=[...a.value.known.values()].filter(e=>!n||e.category===n);Object.assign(r,te(a.value,i,n));let o=!n||d.value===n;return e===`clear`&&o&&(r.unknownTotal=Math.max(0,a.value.total-a.value.list.filter(e=>!n||e.category===n).length)),r}async function Y(e,t,r){if(B(),n.value===`remote`&&!t){let n=Error(`远程消息模式未配置 `+r+` 接口`);throw L=()=>Y(e,t,r),z(n,r),n}let i=j;c.value=[...c.value,e];try{if(n.value===`remote`&&await t(),N||i!==j){let e=Error(`消息作用域已失效`);throw e.name=`AbortError`,e}a.value=T(a.value,e),W({operation:e}),U()}catch(n){throw!N&&i===j&&(L=()=>Y(e,t,r),z(n,r)),n}finally{i===j&&(c.value=c.value.filter(t=>t.id!==e.id),a.value=V(a.value))}}async function he(t){await Y(J(`read`,t),e.markAsRead?()=>e.markAsRead(t):void 0,`mark-as-read`)}async function ge(t){await Y(J(`read-all`,[...a.value.known.values()].filter(e=>!t||e.category===t).map(e=>e.id),t),e.markAllRead?()=>e.markAllRead(t):void 0,`mark-all-as-read`)}async function _e(t){await Y(J(`delete`,t),e.deleteNotification?()=>e.deleteNotification(t):void 0,`delete`),g.value&&t.includes(g.value.id)&&Z()}async function ve(t){await Y(J(`clear`,[...a.value.known.values()].filter(e=>!t||e.category===t).map(e=>e.id),t),e.clearNotifications?()=>e.clearNotifications(t):void 0,`clear`),g.value&&(!t||g.value.category===t)&&Z()}let X=new Set;function ye(e){if(!v(e))return;let n=e;X.has(n.id)||a.value.known.has(n.id)||(X.add(n.id),X.size>2e3&&X.delete(X.values().next().value),a.value=ue(a.value,n),W({message:y(n)}),U(),t.onNewMessage?.(n),De(n))}function be(e){if(!Array.isArray(e))return;let t=J(`read`,e.filter(v).map(e=>e.id));a.value=T(a.value,t),W({operation:t}),U()}function xe(e){if(e&&typeof e==`object`&&`unreadCount`in e&&x(e.unreadCount)){let t=e;a.value=de(a.value,{version:0,counts:t}),W({counts:t})}}function Se(e){if(!N)switch(e.type){case`new_message`:ye(e.data);break;case`read_sync`:be(e.data);break;case`count_update`:xe(e.data);break}}function Ce(e){w.value=e,t.onWSStatusChange?.(e),e===`connected`&&(I&&n.value===`remote`&&q(!0).catch(()=>void 0),I=!0)}let we=h(Se,Ce);function Te(t=e.wsConfig){t&&we.connect(t)}function Ee(){we.disconnect()}function De(t){if(!e.desktopNotification||typeof window>`u`||!(`Notification`in window)||Notification.permission!==`granted`)return;let n=new Notification(t.title,{body:t.summary,icon:t.sender?.avatar,tag:t.id});n.addEventListener(`click`,()=>{window.focus(),ke(t),n.close()});let r=setTimeout(()=>{n.close(),R.delete(r)},5e3);R.add(r)}async function Oe(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:Notification.requestPermission()}function ke(e){g.value=e,e.status===`unread`&&he([e.id]).catch(()=>void 0)}function Z(){g.value=null}function Ae(e){d.value!==e&&(d.value=e,Z(),n.value===`remote`&&(a.value={...a.value,list:[],total:0,queryCategory:e},p.value=1,q(!0).catch(()=>void 0)))}function Q(){if(M)return;M=!0,N=!1,q(!0).catch(()=>void 0);let t=e.pollingInterval??o;n.value===`remote`&&t>0&&(F=setInterval(()=>{f.value||q(!0).catch(()=>void 0)},t)),Te()}function $(){M=!1,N=!0,j++,k++,f.value=!1,c.value=[],P=[],L=void 0,X.clear(),I=!1,F&&clearInterval(F),F=null;for(let e of R)clearTimeout(e);R.clear(),Ee()}async function je(){L?await L():await q(!0)}return(0,i.getCurrentScope)()&&(0,i.onScopeDispose)($),e.autoStart!==!1&&((0,i.getCurrentInstance)()?(0,i.onMounted)(Q):Q()),(0,i.watch)(u,e=>{let t=g.value?.id;t&&(g.value=e.find(e=>e.id===t)??null)}),(0,i.watch)(()=>[n.value,e.storageKey],()=>{let e=M;$(),a.value=_(),d.value=`all`,g.value=null,C.value=!1,E.value=null,e&&Q()}),{messages:u,activeCategory:d,loading:f,total:O,page:p,selectedMessage:g,popoverVisible:C,wsStatus:w,unreadCount:ne,unreadByCategory:re,filteredMessages:D,hasMore:ie,error:E,busy:ae,pendingIds:oe,fetchMessages:q,loadMore:me,markAsRead:he,markAllAsRead:ge,deleteMessages:_e,clearMessages:ve,selectMessage:ke,clearSelection:Z,switchCategory:Ae,clearError:B,retry:je,requestDesktopPermission:Oe,connectWS:Te,disconnectWS:Ee,initialize:Q,dispose:$}}const ne={class:`notification-badge`},re=[`aria-label`],D={key:0,class:`notification-badge__count`},O={key:0,class:`notification-badge__pulse`},ie=(0,i.defineComponent)({__name:`NotificationBadge`,props:{count:{default:0},maxCount:{default:99},hasUrgent:{type:Boolean,default:!1}},emits:[`click`],setup(t){let n=t,r=(0,i.computed)(()=>n.count>n.maxCount?`${n.maxCount}+`:String(n.count));return(n,o)=>{let s=a.NTooltip;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,ne,[(0,i.createVNode)(s,{trigger:`hover`,placement:`bottom`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`button`,{type:`button`,class:`notification-badge__trigger`,"aria-label":`消息通知${t.count>0?`(${t.count} 条未读)`:``}`,onClick:o[0]||=e=>n.$emit(`click`)},[(0,i.createVNode)(e.t,{name:`mdi:bell-outline`,size:18,class:`notification-badge__icon`}),(0,i.createCommentVNode)(` 未读角标 `),(0,i.createVNode)(i.Transition,{name:`badge-bounce`},{default:(0,i.withCtx)(()=>[t.count>0?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,D,(0,i.toDisplayString)(r.value),1)):(0,i.createCommentVNode)(`v-if`,!0)]),_:1}),(0,i.createCommentVNode)(` 脉冲动画(有紧急消息时) `),t.hasUrgent?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,O)):(0,i.createCommentVNode)(`v-if`,!0)],8,re)]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` 消息通知`+(0,i.toDisplayString)(t.count>0?`(${t.count} 条未读)`:``),1)]),_:1})])}}});var ae=t.t(ie,[[`__scopeId`,`data-v-51516250`]]);const oe=6e4,k=36e5,A=864e5,se=7*A,j=30*A;365*A;let M=null;function N(){return M||=P(),M}function P(){function e(e){let r=new Date(e),i=Date.now()-r.getTime();if(i<0||i<oe)return`刚刚`;if(i<k)return`${Math.floor(i/oe)}分钟前`;if(i<A)return`${Math.floor(i/k)}小时前`;let a=new Date;return a.setHours(0,0,0,0),r>=new Date(a.getTime()-A)&&r<a?`昨天 ${n(r.getHours())}:${n(r.getMinutes())}`:i<se?`${Math.floor(i/A)}天前`:i<j?`${Math.floor(i/se)}周前`:i<31536e6?`${Math.floor(i/j)}个月前`:t(r)}function t(e){return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}`}function n(e){return e<10?`0${e}`:String(e)}return{formatRelativeTime:e,formatFullDate:t}}const F={class:`notification-item__indicator`},I={class:`notification-item__avatar`},L={class:`notification-item__body`},R={class:`notification-item__header`},z={class:`notification-item__title`},B={class:`notification-item__summary`},V={class:`notification-item__meta`},H={class:`notification-item__time`},ce={key:0,class:`notification-item__sender`},U=[`disabled`],W=[`disabled`],le=(0,i.defineComponent)({__name:`NotificationItem`,props:{message:{},busy:{type:Boolean}},emits:[`click`,`read`,`delete`],setup(t){let n=t,{formatRelativeTime:r}=N(),o=(0,i.computed)(()=>d[n.message.category]?.icon??`mdi:bell-outline`),s=(0,i.computed)(()=>p[n.message.priority]??p.normal),c=(0,i.computed)(()=>r(n.message.timestamp));return(n,r)=>{let l=a.NAvatar,u=a.NTag,d=a.NTooltip;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:(0,i.normalizeClass)([`notification-item`,{"notification-item--unread":t.message.status===`unread`,"notification-item--urgent":t.message.priority===`urgent`}]),onClick:r[3]||=e=>n.$emit(`click`,t.message)},[(0,i.createCommentVNode)(` 未读指示点 `),(0,i.createElementVNode)(`div`,F,[t.message.status===`unread`?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:0,class:(0,i.normalizeClass)([`notification-item__dot`,`notification-item__dot--${t.message.priority}`])},null,2)):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createCommentVNode)(` 头像 `),(0,i.createElementVNode)(`div`,I,[t.message.sender?.avatar?((0,i.openBlock)(),(0,i.createBlock)(l,{key:0,src:t.message.sender.avatar,size:36,round:``},null,8,[`src`])):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:(0,i.normalizeClass)([`notification-item__avatar-placeholder`,`notification-item__avatar-placeholder--${t.message.category}`])},[(0,i.createVNode)(e.t,{name:o.value,size:16},null,8,[`name`])],2))]),(0,i.createCommentVNode)(` 内容 `),(0,i.createElementVNode)(`div`,L,[(0,i.createElementVNode)(`div`,R,[(0,i.createElementVNode)(`span`,z,(0,i.toDisplayString)(t.message.title),1),t.message.priority===`urgent`||t.message.priority===`high`?((0,i.openBlock)(),(0,i.createBlock)(u,{key:0,type:s.value.type,size:`tiny`,bordered:!1,round:``},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(s.value.label),1)]),_:1},8,[`type`])):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createElementVNode)(`div`,B,(0,i.toDisplayString)(t.message.summary),1),(0,i.createElementVNode)(`div`,V,[(0,i.createElementVNode)(`span`,H,(0,i.toDisplayString)(c.value),1),t.message.sender?.name?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,ce,(0,i.toDisplayString)(t.message.sender.name),1)):(0,i.createCommentVNode)(`v-if`,!0)])]),(0,i.createCommentVNode)(` 操作区 `),(0,i.createElementVNode)(`div`,{class:`notification-item__actions`,onClick:r[2]||=(0,i.withModifiers)(()=>{},[`stop`])},[t.message.status===`unread`?((0,i.openBlock)(),(0,i.createBlock)(d,{key:0,trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`button`,{class:`notification-item__action`,type:`button`,disabled:t.busy,"aria-label":`标记已读`,onClick:r[0]||=e=>n.$emit(`read`,t.message.id)},[(0,i.createVNode)(e.t,{name:`mdi:check`,size:16})],8,U)]),default:(0,i.withCtx)(()=>[r[4]||=(0,i.createTextVNode)(` 标记已读 `,-1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createVNode)(d,{trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`button`,{class:`notification-item__action`,type:`button`,disabled:t.busy,"aria-label":`删除消息`,onClick:r[1]||=e=>n.$emit(`delete`,t.message.id)},[(0,i.createVNode)(e.t,{name:`mdi:delete-outline`,size:16})],8,W)]),default:(0,i.withCtx)(()=>[r[5]||=(0,i.createTextVNode)(` 删除 `,-1)]),_:1})])],2)}}});var ue=t.t(le,[[`__scopeId`,`data-v-8a4522f3`]]);const de={class:`notification-list`},G={class:`notification-list__tabs`},fe=[`aria-pressed`,`onClick`],pe={key:0,class:`notification-list__tab-count`},K={key:0,class:`notification-list__toolbar`},q={class:`notification-list__skeleton-text`},me={class:`notification-list__items`},J=[`disabled`],Y={class:`notification-list__empty`},he=(0,i.defineComponent)({__name:`NotificationList`,props:{messages:{},activeCategory:{},unreadByCategory:{},busy:{type:Boolean,default:!1},pendingIds:{default:()=>[]},unreadCount:{},loading:{type:Boolean},hasMore:{type:Boolean},scrollHeight:{default:420}},emits:[`switchCategory`,`itemClick`,`read`,`delete`,`markAllRead`,`clear`,`loadMore`],setup(t){let n=t,r=(0,i.computed)(()=>n.activeCategory===`all`?n.unreadCount:n.unreadByCategory[n.activeCategory]);function o(e){return e===`all`?n.unreadCount:n.unreadByCategory[e]??0}return(n,s)=>{let c=a.NButton,l=a.NSkeleton,u=a.NSpin,d=a.NScrollbar;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,de,[(0,i.createCommentVNode)(` 分类 Tab `),(0,i.createElementVNode)(`div`,G,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(f),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`button`,{key:e.key,class:(0,i.normalizeClass)([`notification-list__tab`,{"notification-list__tab--active":t.activeCategory===e.key}]),type:`button`,"aria-pressed":t.activeCategory===e.key,onClick:t=>n.$emit(`switchCategory`,e.key)},[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(e.label),1),o(e.key)>0?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,pe,(0,i.toDisplayString)(o(e.key)),1)):(0,i.createCommentVNode)(`v-if`,!0)],10,fe))),128))]),(0,i.createCommentVNode)(` 操作栏 `),t.messages.length>0?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,K,[(0,i.createVNode)(c,{text:``,size:`tiny`,disabled:t.busy||r.value!==void 0&&r.value===0,loading:t.busy,onClick:s[0]||=e=>n.$emit(`markAllRead`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:check-all`,size:14})]),default:(0,i.withCtx)(()=>[s[6]||=(0,i.createTextVNode)(` 全部已读 `,-1)]),_:1},8,[`disabled`,`loading`]),(0,i.createVNode)(c,{text:``,size:`tiny`,disabled:t.busy,onClick:s[1]||=e=>n.$emit(`clear`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:delete-sweep-outline`,size:14})]),default:(0,i.withCtx)(()=>[s[7]||=(0,i.createTextVNode)(` 清空 `,-1)]),_:1},8,[`disabled`])])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createCommentVNode)(` 消息列表 `),(0,i.createVNode)(d,{class:`notification-list__scroll`,style:(0,i.normalizeStyle)({maxHeight:`${t.scrollHeight}px`})},{default:(0,i.withCtx)(()=>[t.loading&&t.messages.length===0?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createCommentVNode)(` 骨架屏 `),((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(4,e=>(0,i.createElementVNode)(`div`,{key:e,class:`notification-list__skeleton`},[(0,i.createVNode)(l,{circle:``,width:36,height:36}),(0,i.createElementVNode)(`div`,q,[(0,i.createVNode)(l,{text:``,width:`60%`,height:14}),(0,i.createVNode)(l,{text:``,width:`90%`,height:12}),(0,i.createVNode)(l,{text:``,width:`40%`,height:10})])])),64))],64)):t.messages.length>0?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createElementVNode)(`div`,me,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(t.messages,e=>((0,i.openBlock)(),(0,i.createBlock)(ue,{key:e.id,message:e,busy:t.busy||t.pendingIds.includes(e.id),onClick:s[2]||=e=>n.$emit(`itemClick`,e),onRead:s[3]||=e=>n.$emit(`read`,e),onDelete:s[4]||=e=>n.$emit(`delete`,e)},null,8,[`message`,`busy`]))),128))]),(0,i.createCommentVNode)(` 加载更多 `),t.hasMore?((0,i.openBlock)(),(0,i.createElementBlock)(`button`,{key:0,class:`notification-list__load-more`,type:`button`,disabled:t.loading,onClick:s[5]||=e=>n.$emit(`loadMore`)},[t.loading?((0,i.openBlock)(),(0,i.createBlock)(u,{key:0,size:14})):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(t.loading?`加载中...`:`加载更多`),1)],8,J)):(0,i.createCommentVNode)(`v-if`,!0)],64)):((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:2},[(0,i.createCommentVNode)(` 空状态 `),(0,i.createElementVNode)(`div`,Y,[(0,i.createVNode)(e.t,{name:`mdi:bell-off-outline`,size:48,class:`notification-list__empty-icon`}),s[8]||=(0,i.createElementVNode)(`span`,{class:`notification-list__empty-text`},`暂无消息`,-1)])],2112))]),_:1},8,[`style`])])}}});var ge=t.t(he,[[`__scopeId`,`data-v-63a2d867`]]);function _e(e){return e.includes(`\\`)||e.startsWith(`//`)||Array.from(e).some(e=>e.charCodeAt(0)<32)}function ve(e){let t=e?.trim();if(!t||_e(t))return null;if(/^https?:\/\//i.test(t))try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?null:{kind:`external`,url:e.href}}catch{return null}return/^[a-z][a-z\d+.-]*:/i.test(t)?null:{kind:`internal`,url:t}}const X={class:`notification-detail`},ye={class:`notification-detail__back`},be={class:`notification-detail__header`},xe={class:`notification-detail__title`},Se={class:`notification-detail__meta`},Ce={class:`notification-detail__time`},we={key:0,class:`notification-detail__sender`},Te=[`innerHTML`],Ee={key:1,class:`notification-detail__body`},De={key:0,class:`notification-detail__footer`},Oe=(0,i.defineComponent)({__name:`NotificationDetail`,props:{message:{},scrollHeight:{default:320}},emits:[`back`,`action`,`navigate`],setup(t,{emit:r}){let o=t,s=r,{formatRelativeTime:c}=N(),l=(0,i.computed)(()=>d[o.message.category]??d.system),u=(0,i.computed)(()=>p[o.message.priority]??p.normal),f=(0,i.computed)(()=>c(o.message.timestamp)),m=(0,i.computed)(()=>n.t(o.message.content||``));function h(){let e=ve(o.message.actionUrl);e&&(s(`action`,e.url),e.kind===`external`?window.open(e.url,`_blank`,`noopener,noreferrer`):s(`navigate`,e.url))}return(n,r)=>{let o=a.NButton,s=a.NTag,c=a.NAvatar,d=a.NScrollbar;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,X,[(0,i.createCommentVNode)(` 返回栏 `),(0,i.createElementVNode)(`div`,ye,[(0,i.createVNode)(o,{text:``,size:`small`,onClick:r[0]||=e=>n.$emit(`back`)},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:arrow-left`,size:16})]),default:(0,i.withCtx)(()=>[r[1]||=(0,i.createTextVNode)(` 返回列表 `,-1)]),_:1})]),(0,i.createCommentVNode)(` 消息头部 `),(0,i.createElementVNode)(`div`,be,[(0,i.createElementVNode)(`h3`,xe,(0,i.toDisplayString)(t.message.title),1),(0,i.createElementVNode)(`div`,Se,[(0,i.createVNode)(s,{type:l.value.color,size:`tiny`,bordered:!1,round:``},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:l.value.icon,size:12},null,8,[`name`])]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` `+(0,i.toDisplayString)(l.value.label),1)]),_:1},8,[`type`]),t.message.priority===`urgent`||t.message.priority===`high`?((0,i.openBlock)(),(0,i.createBlock)(s,{key:0,type:u.value.type,size:`tiny`,bordered:!1,round:``},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(u.value.label),1)]),_:1},8,[`type`])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,Ce,(0,i.toDisplayString)(f.value),1)]),t.message.sender?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,we,[t.message.sender.avatar?((0,i.openBlock)(),(0,i.createBlock)(c,{key:0,src:t.message.sender.avatar,size:20,round:``},null,8,[`src`])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(t.message.sender.name),1)])):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.createCommentVNode)(` 消息内容 `),(0,i.createVNode)(d,{class:`notification-detail__content`,style:(0,i.normalizeStyle)({maxHeight:`${t.scrollHeight}px`})},{default:(0,i.withCtx)(()=>[t.message.content?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`notification-detail__body`,innerHTML:m.value},null,8,Te)):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,Ee,(0,i.toDisplayString)(t.message.summary),1))]),_:1},8,[`style`]),(0,i.createCommentVNode)(` 操作区 `),t.message.actionUrl?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,De,[(0,i.createVNode)(o,{type:`primary`,size:`small`,onClick:h},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(e.t,{name:`mdi:arrow-right`,size:16})]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(t.message.actionText||`查看详情`)+` `,1)]),_:1})])):(0,i.createCommentVNode)(`v-if`,!0)])}}});var ke=t.t(Oe,[[`__scopeId`,`data-v-8e02b6cd`]]);const Z={class:`c-notification-center`},Ae={class:`c-notification-center__panel`},Q={class:`c-notification-center__header`},$={class:`c-notification-center__header-extra`},je={key:0,class:`c-notification-center__error`,role:`alert`},Me={class:`c-notification-center__footer`},Ne=(0,i.defineComponent)({name:`C_NotificationCenter`,__name:`index`,props:{dataMode:{},controller:{},autoStart:{type:Boolean,default:!0},fetchNotifications:{},markAsRead:{},markAllRead:{},deleteNotification:{},clearNotifications:{},wsConfig:{},desktopNotification:{type:Boolean,default:!1},maxBadgeCount:{default:99},pollingInterval:{default:6e4},pageSize:{default:20},storageKey:{default:`notification_center`},onError:{}},emits:[`itemClick`,`read`,`allRead`,`delete`,`unreadChange`,`wsStatusChange`,`newMessage`,`navigate`,`viewAll`],setup(e,{expose:t,emit:n}){let r=e,o=n,s=r.controller??E(r,{onNewMessage:e=>o(`newMessage`,e),onWSStatusChange:e=>o(`wsStatusChange`,e)}),c=(0,i.computed)(()=>s.messages.value.some(e=>e.status===`unread`&&e.priority===`urgent`)),l=(0,i.computed)(()=>({connected:`已连接`,connecting:`连接中...`,disconnected:`未连接`,reconnecting:`重连中...`})[s.wsStatus.value]??`未知`);(0,i.watch)(()=>s.unreadCount.value,e=>{o(`unreadChange`,e)});function u(){s.popoverVisible.value=!s.popoverVisible.value}async function d(){try{s.retry?await s.retry():await s.fetchMessages(!0)}catch{}}async function f(){try{await s.loadMore()}catch{}}function p(){s.popoverVisible.value=!1,o(`viewAll`)}function m(e){s.selectMessage(e),o(`itemClick`,e)}async function h(e){try{await s.markAsRead([e]),o(`read`,[e])}catch{}}async function g(e){try{await s.deleteMessages([e]),o(`delete`,[e])}catch{}}async function _(){let e=s.activeCategory.value===`all`?void 0:s.activeCategory.value;try{await s.markAllAsRead(e),o(`allRead`,e)}catch{}}async function v(){let e=s.activeCategory.value===`all`?void 0:s.activeCategory.value;try{await s.clearMessages(e)}catch{}}function y(){s.popoverVisible.value=!1}function b(){s.clearSelection()}return t({refresh:()=>s.fetchMessages(!0),connectWS:()=>{r.wsConfig&&s.connectWS(r.wsConfig)},disconnectWS:s.disconnectWS,getUnreadCount:()=>s.unreadCount.value,getMessages:()=>s.messages.value.map(e=>({...e})),markRead:e=>s.markAsRead(e),markAllAsRead:e=>s.markAllAsRead(e),requestDesktopPermission:s.requestDesktopPermission}),(e,t)=>{let n=a.NTooltip,x=a.NButton,S=a.NPopover;return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,Z,[(0,i.createVNode)(S,{show:(0,i.unref)(s).popoverVisible.value,"onUpdate:show":t[1]||=e=>(0,i.unref)(s).popoverVisible.value=e,width:420,trigger:`manual`,placement:`bottom-end`,"show-arrow":!1,"content-class":`c-notification-center__popover`,onAfterLeave:b},{trigger:(0,i.withCtx)(()=>[(0,i.createVNode)(ae,{count:(0,i.unref)(s).unreadCount.value,"max-count":r.maxBadgeCount,"has-urgent":c.value,onClick:u},null,8,[`count`,`max-count`,`has-urgent`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,Ae,[(0,i.createCommentVNode)(` 头部标题 `),(0,i.createElementVNode)(`div`,Q,[t[2]||=(0,i.createElementVNode)(`span`,{class:`c-notification-center__title`},`消息中心`,-1),(0,i.createElementVNode)(`div`,$,[(0,i.createCommentVNode)(` WebSocket 连接状态 `),r.wsConfig||(0,i.unref)(s).wsStatus.value!==`disconnected`?((0,i.openBlock)(),(0,i.createBlock)(n,{key:0,trigger:`hover`,placement:`top`},{trigger:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)([`c-notification-center__ws-dot`,`c-notification-center__ws-dot--${(0,i.unref)(s).wsStatus.value}`])},null,2)]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` `+(0,i.toDisplayString)(l.value),1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0)])]),(0,i.unref)(s).error.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,je,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(s).error.value),1),(0,i.createVNode)(x,{size:`tiny`,loading:(0,i.unref)(s).loading.value,onClick:d},{default:(0,i.withCtx)(()=>[...t[3]||=[(0,i.createTextVNode)(`重试`,-1)]]),_:1},8,[`loading`])])):(0,i.createCommentVNode)(`v-if`,!0),(0,i.createCommentVNode)(` 列表 / 详情切换 `),(0,i.createVNode)(i.Transition,{name:`slide-fade`,mode:`out-in`},{default:(0,i.withCtx)(()=>[(0,i.unref)(s).selectedMessage.value?((0,i.openBlock)(),(0,i.createBlock)(ke,{key:(0,i.unref)(s).selectedMessage.value.id,message:(0,i.unref)(s).selectedMessage.value,onBack:(0,i.unref)(s).clearSelection,onAction:y,onNavigate:t[0]||=e=>o(`navigate`,e)},null,8,[`message`,`onBack`])):((0,i.openBlock)(),(0,i.createBlock)(ge,{key:1,messages:(0,i.unref)(s).filteredMessages.value,"active-category":(0,i.unref)(s).activeCategory.value,"unread-by-category":(0,i.unref)(s).unreadByCategory.value,"unread-count":(0,i.unref)(s).unreadCount.value,loading:(0,i.unref)(s).loading.value,"has-more":(0,i.unref)(s).hasMore.value,busy:(0,i.unref)(s).busy.value,"pending-ids":(0,i.unref)(s).pendingIds.value,onSwitchCategory:(0,i.unref)(s).switchCategory,onItemClick:m,onRead:h,onDelete:g,onMarkAllRead:_,onClear:v,onLoadMore:f},null,8,[`messages`,`active-category`,`unread-by-category`,`unread-count`,`loading`,`has-more`,`busy`,`pending-ids`,`onSwitchCategory`]))]),_:1}),(0,i.createElementVNode)(`div`,Me,[(0,i.createVNode)(x,{text:``,type:`primary`,size:`small`,onClick:p},{default:(0,i.withCtx)(()=>[...t[4]||=[(0,i.createTextVNode)(`查看全部消息`,-1)]]),_:1})])])]),_:1},8,[`show`])])}}});var Pe=t.t(Ne,[[`__scopeId`,`data-v-21f127ad`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return 20}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return 5}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return 99}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return s}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{t as n}from"./html.js";import{i as r,t as i}from"./storage.js";import{Fragment as a,Transition as o,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,defineComponent as m,normalizeClass as h,normalizeStyle as g,onBeforeUnmount as _,onMounted as v,openBlock as y,readonly as b,ref as x,renderList as S,resolveComponent as C,toDisplayString as w,unref as T,watch as E,withCtx as D,withModifiers as O}from"vue";import{NAvatar as k,NButton as A,NPopover as ee,NScrollbar as j,NSkeleton as M,NSpin as N,NTag as P,NTooltip as F}from"naive-ui";const I=99,L=20,R=6e4,z=`notification_center`,B=3e3,V=5,H=3e4,U=`ping`,W={system:{label:`系统通知`,icon:`mdi:cog-outline`,color:`info`},business:{label:`业务消息`,icon:`mdi:briefcase-outline`,color:`success`},alarm:{label:`告警预警`,icon:`mdi:alert-outline`,color:`warning`}},G=[{key:`all`,label:`全部`},{key:`system`,label:`系统通知`},{key:`business`,label:`业务消息`},{key:`alarm`,label:`告警预警`}],K={low:{label:`低`,type:`default`},normal:{label:`普通`,type:`info`},high:{label:`重要`,type:`warning`},urgent:{label:`紧急`,type:`error`}},q=[{id:`msg-001`,title:`系统维护通知`,summary:`系统将于今晚 22:00-23:00 进行例行维护升级,届时部分功能可能暂时不可用。`,content:`<p>尊敬的用户:</p><p>为了提升系统性能和稳定性,我们计划于 <strong>2026年2月27日 22:00-23:00</strong> 对系统进行例行维护升级。</p><p>维护期间,以下功能可能暂时不可用:</p><ul><li>报表导出</li><li>数据同步</li><li>定时任务</li></ul><p>请提前保存好未完成的工作,感谢您的理解与支持!</p>`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-15*6e4).toISOString(),sender:{name:`系统管理员`,avatar:``}},{id:`msg-002`,title:`审批流程待处理`,summary:`张三提交的《Q1 季度预算申请》需要您审批,请尽快处理。`,category:`business`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-30*6e4).toISOString(),sender:{name:`张三`,avatar:``},actionUrl:`/workflow/approval`,actionText:`去审批`},{id:`msg-003`,title:`服务器 CPU 使用率告警`,summary:`生产环境节点 prod-node-03 CPU 使用率持续超过 90%,已触发告警阈值。`,category:`alarm`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-2*6e4).toISOString(),sender:{name:`监控中心`},actionUrl:`/monitor/server`,actionText:`查看详情`},{id:`msg-004`,title:`新版本发布 v1.14.0`,summary:`系统已升级至 v1.14.0,新增通知中心、工作流增强等多项功能。`,category:`system`,priority:`normal`,status:`unread`,timestamp:new Date(Date.now()-3*36e5).toISOString(),sender:{name:`系统管理员`}},{id:`msg-005`,title:`项目交付提醒`,summary:`「Robot Admin 二期」项目交付截止日期为 3月15日,当前进度 78%。`,category:`business`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-8*36e5).toISOString(),sender:{name:`项目管理系统`}},{id:`msg-006`,title:`数据库连接池告警`,summary:`数据库连接池使用率达到 85%,建议关注并适时扩容。`,category:`alarm`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-12*36e5).toISOString(),sender:{name:`监控中心`}},{id:`msg-007`,title:`周报提交提醒`,summary:`本周周报提交截止时间为周五 18:00,请及时提交。`,category:`business`,priority:`normal`,status:`read`,timestamp:new Date(Date.now()-24*36e5).toISOString(),sender:{name:`OA 系统`}},{id:`msg-008`,title:`账号安全提醒`,summary:`检测到您的账号在新设备上登录,如非本人操作请及时修改密码。`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-45*6e4).toISOString(),sender:{name:`安全中心`}}];function J(e,t){let n=x(`disconnected`),r=null,i=0,a=null,o=null,s=null,c=0;function l(e){n.value=e,t?.(e)}function u(e){s=e,i=0,d(e)}function d(e){let t=++c;v();let n=f(e);l(`connecting`);try{r=new WebSocket(n)}catch{l(`disconnected`),m(e);return}let a=r;a.addEventListener(`open`,()=>{t!==c||a!==r||(l(`connected`),i=0,h(e))}),a.addEventListener(`message`,e=>{t!==c||a!==r||p(e.data)}),a.addEventListener(`close`,()=>{t!==c||a!==r||(r=null,g(),l(`disconnected`),e.autoReconnect!==!1&&m(e))}),a.addEventListener(`error`,()=>{})}function f(e){let t=e.getToken?.();if(t){let n=e.url.includes(`?`)?`&`:`?`;return`${e.url}${n}token=${encodeURIComponent(t)}`}return e.url}function p(t){if(typeof t==`string`&&t!==`pong`)try{let n=JSON.parse(t);n&&typeof n==`object`&&[`new_message`,`read_sync`,`count_update`].includes(String(n.type))&&`data`in n&&e(n)}catch{}}function m(e){if(s!==e||a)return;let t=Math.max(0,Math.trunc(e.maxReconnectAttempts??5));if(i>=t)return;i++,l(`reconnecting`);let n=Math.max(0,e.reconnectInterval??B),r=Math.min(6e4,n*2**(i-1)),o=c;a=setTimeout(()=>{a=null,!(o!==c||s!==e)&&d(e)},r)}function h(e){g();let t=e.heartbeatInterval??H;if(t<=0)return;let n=e.heartbeatMessage??U;o=setInterval(()=>{if(r?.readyState===WebSocket.OPEN)try{r.send(n)}catch{r.close()}},t)}function g(){o&&=(clearInterval(o),null)}function v(){g(),a&&=(clearTimeout(a),null),r&&=(r.close(),null)}function y(){s=null,c++,i=0,v(),l(`disconnected`)}function S(){s&&(i=0,d(s))}return _(()=>{s=null,c++,v()}),{status:b(n),connect:u,disconnect:y,reconnect:S}}function Y(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.title==`string`&&typeof t.summary==`string`&&typeof t.timestamp==`string`&&[`system`,`business`,`alarm`].includes(String(t.category))&&[`low`,`normal`,`high`,`urgent`].includes(String(t.priority))&&[`read`,`unread`,`archived`].includes(String(t.status))}function X(e,t={}){let n=x([]),a=x(`all`),o=x(!1),c=x(0),l=x(1),u=x(null),d=x(!1),f=x(`disconnected`),p=0,m=s(()=>n.value.filter(e=>e.status===`unread`).length),h=s(()=>{let e={system:0,business:0,alarm:0};for(let t of n.value)t.status===`unread`&&t.category in e&&e[t.category]++;return e}),g=s(()=>a.value===`all`?n.value:n.value.filter(e=>e.category===a.value)),y=s(()=>n.value.length<c.value),b=s(()=>e.storageKey??z);function S(){if(e.fetchNotifications)return;let t=i(b.value);if(Array.isArray(t?.readIds)){let e=new Set(t.readIds.filter(e=>typeof e==`string`));for(let t of n.value)e.has(t.id)&&t.status!==`archived`&&(t.status=`read`)}}let C=null;function w(){e.fetchNotifications||(C&&clearTimeout(C),C=setTimeout(()=>{let e=n.value.filter(e=>e.status===`read`).map(e=>e.id);r(b.value,{readIds:e,lastFetchTime:Date.now()}),C=null},300))}async function T(t=!1){let r=++p;t&&(l.value=1),o.value=!0;try{if(e.fetchNotifications){let i=a.value===`all`?void 0:a.value,o=e.pageSize??20,s=await e.fetchNotifications({category:i,page:l.value,pageSize:o});if(r!==p)return;let u=Array.isArray(s.list)?s.list.map(e=>({...e})):[];if(t)n.value=u;else{let e=new Set(n.value.map(e=>e.id));n.value.push(...u.filter(t=>!e.has(t.id)))}c.value=Math.max(n.value.length,Number(s.total)||0)}else E();r===p&&S()}catch(t){throw r===p&&e.onError?.(t,`fetch`),t}finally{r===p&&(o.value=!1)}}function E(){n.value=q.map(e=>({...e})),c.value=q.length}async function D(){if(!y.value||o.value)return;let e=l.value;l.value++;try{await T()}catch(t){throw l.value=e,t}}async function O(t){let r=new Set(t),i=new Map(n.value.filter(e=>r.has(e.id)).map(e=>[e.id,e.status]));for(let e of n.value)r.has(e.id)&&(e.status=`read`);if(w(),e.markAsRead)try{await e.markAsRead(t)}catch(t){for(let e of n.value){let t=i.get(e.id);t&&(e.status=t)}throw w(),e.onError?.(t,`mark-as-read`),t}}async function k(t){let r=t?n.value.filter(e=>e.category===t&&e.status===`unread`):n.value.filter(e=>e.status===`unread`);for(let e of r)e.status=`read`;if(w(),e.markAllRead)try{await e.markAllRead(t)}catch(t){for(let e of r)e.status=`unread`;throw w(),e.onError?.(t,`mark-all-as-read`),t}}async function A(t){let r=new Set(t),i=[...n.value],a=c.value;if(n.value=n.value.filter(e=>!r.has(e.id)),c.value=Math.max(0,c.value-(i.length-n.value.length)),w(),e.deleteNotification)try{await e.deleteNotification(t)}catch(t){throw n.value=i,c.value=a,w(),e.onError?.(t,`delete`),t}}async function ee(t){let r=[...n.value],i=c.value;if(t?n.value=n.value.filter(e=>e.category!==t):n.value=[],c.value=n.value.length,w(),e.clearNotifications)try{await e.clearNotifications(t)}catch(t){throw n.value=r,c.value=i,w(),e.onError?.(t,`clear`),t}}function j(e){switch(e.type){case`new_message`:{let r=e.data;if(!Y(r))return;n.value.some(e=>e.id===r.id)||(n.value.unshift(r),c.value++,w(),t.onNewMessage?.(r),F(r));break}case`read_sync`:{if(!Array.isArray(e.data))return;let t=e.data.filter(Y),r=new Set(t.map(e=>e.id));for(let e of n.value)r.has(e.id)&&(e.status=`read`);w();break}case`count_update`:break}}function M(e){f.value=e,t.onWSStatusChange?.(e)}let{connect:N,disconnect:P}=J(j,M);function F(t){e.desktopNotification&&(typeof window>`u`||!(`Notification`in window)||Notification.permission===`granted`&&L(t))}async function I(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:Notification.requestPermission()}function L(e){let t=new Notification(e.title,{body:e.summary,icon:e.sender?.avatar||`/robot-avatar.png`,tag:e.id});t.addEventListener(`click`,()=>{window.focus(),U(e),t.close()}),setTimeout(()=>t.close(),5e3)}let B=null;function V(){H();let t=e.pollingInterval??R;t<=0||(B=setInterval(()=>{o.value||T(!0).catch(()=>void 0)},t))}function H(){B&&=(clearInterval(B),null)}function U(e){u.value=e,e.status===`unread`&&O([e.id]).catch(()=>void 0)}function W(){u.value=null}function G(t){a.value=t,u.value=null,e.fetchNotifications&&T(!0).catch(()=>void 0)}function K(){T(!0).catch(()=>void 0),V(),e.wsConfig&&N(e.wsConfig)}function X(){p++,H(),P(),C&&=(clearTimeout(C),null)}return v(K),_(X),{messages:n,activeCategory:a,loading:o,total:c,page:l,selectedMessage:u,popoverVisible:d,wsStatus:f,unreadCount:m,unreadByCategory:h,filteredMessages:g,hasMore:y,fetchMessages:T,loadMore:D,markAsRead:O,markAllAsRead:k,deleteMessages:A,clearMessages:ee,selectMessage:U,clearSelection:W,switchCategory:G,requestDesktopPermission:I,connectWS:N,disconnectWS:P}}const te={class:`notification-badge`},ne=[`aria-label`],re={key:0,class:`notification-badge__count`},ie={key:0,class:`notification-badge__pulse`};var ae=t(m({__name:`NotificationBadge`,props:{count:{default:0},maxCount:{default:99},hasUrgent:{type:Boolean,default:!1}},emits:[`click`],setup(t){let n=t,r=s(()=>n.count>n.maxCount?`${n.maxCount}+`:String(n.count));return(n,i)=>{let a=F;return y(),u(`div`,te,[p(a,{trigger:`hover`,placement:`bottom`},{trigger:D(()=>[d(`button`,{type:`button`,class:`notification-badge__trigger`,"aria-label":`消息通知${t.count>0?`(${t.count} 条未读)`:``}`,onClick:i[0]||=e=>n.$emit(`click`)},[p(e,{name:`mdi:bell-outline`,size:18,class:`notification-badge__icon`}),l(` 未读角标 `),p(o,{name:`badge-bounce`},{default:D(()=>[t.count>0?(y(),u(`span`,re,w(r.value),1)):l(`v-if`,!0)]),_:1}),l(` 脉冲动画(有紧急消息时) `),t.hasUrgent?(y(),u(`span`,ie)):l(`v-if`,!0)],8,ne)]),default:D(()=>[f(` 消息通知`+w(t.count>0?`(${t.count} 条未读)`:``),1)]),_:1})])}}}),[[`__scopeId`,`data-v-51516250`]]);const Z=6e4,oe=36e5,Q=864e5,se=7*Q,ce=30*Q;365*Q;let le=null;function $(){return le||=ue(),le}function ue(){function e(e){let r=new Date(e),i=Date.now()-r.getTime();if(i<0||i<Z)return`刚刚`;if(i<oe)return`${Math.floor(i/Z)}分钟前`;if(i<Q)return`${Math.floor(i/oe)}小时前`;let a=new Date;return a.setHours(0,0,0,0),r>=new Date(a.getTime()-Q)&&r<a?`昨天 ${n(r.getHours())}:${n(r.getMinutes())}`:i<se?`${Math.floor(i/Q)}天前`:i<ce?`${Math.floor(i/se)}周前`:i<31536e6?`${Math.floor(i/ce)}个月前`:t(r)}function t(e){return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}`}function n(e){return e<10?`0${e}`:String(e)}return{formatRelativeTime:e,formatFullDate:t}}const de={class:`notification-item__indicator`},fe={class:`notification-item__avatar`},pe={class:`notification-item__body`},me={class:`notification-item__header`},he={class:`notification-item__title`},ge={class:`notification-item__summary`},_e={class:`notification-item__meta`},ve={class:`notification-item__time`},ye={key:0,class:`notification-item__sender`};var be=t(m({__name:`NotificationItem`,props:{message:{}},emits:[`click`,`read`,`delete`],setup(t){let n=t,{formatRelativeTime:r}=$(),i=s(()=>W[n.message.category]?.icon??`mdi:bell-outline`),a=s(()=>K[n.message.priority]??K.normal),o=s(()=>r(n.message.timestamp));return(n,r)=>{let s=k,m=P,g=F;return y(),u(`div`,{class:h([`notification-item`,{"notification-item--unread":t.message.status===`unread`,"notification-item--urgent":t.message.priority===`urgent`}]),onClick:r[3]||=e=>n.$emit(`click`,t.message)},[l(` 未读指示点 `),d(`div`,de,[t.message.status===`unread`?(y(),u(`span`,{key:0,class:h([`notification-item__dot`,`notification-item__dot--${t.message.priority}`])},null,2)):l(`v-if`,!0)]),l(` 头像 `),d(`div`,fe,[t.message.sender?.avatar?(y(),c(s,{key:0,src:t.message.sender.avatar,size:36,round:``},null,8,[`src`])):(y(),u(`div`,{key:1,class:h([`notification-item__avatar-placeholder`,`notification-item__avatar-placeholder--${t.message.category}`])},[p(e,{name:i.value,size:16},null,8,[`name`])],2))]),l(` 内容 `),d(`div`,pe,[d(`div`,me,[d(`span`,he,w(t.message.title),1),t.message.priority===`urgent`||t.message.priority===`high`?(y(),c(m,{key:0,type:a.value.type,size:`tiny`,bordered:!1,round:``},{default:D(()=>[f(w(a.value.label),1)]),_:1},8,[`type`])):l(`v-if`,!0)]),d(`div`,ge,w(t.message.summary),1),d(`div`,_e,[d(`span`,ve,w(o.value),1),t.message.sender?.name?(y(),u(`span`,ye,w(t.message.sender.name),1)):l(`v-if`,!0)])]),l(` 操作区 `),d(`div`,{class:`notification-item__actions`,onClick:r[2]||=O(()=>{},[`stop`])},[t.message.status===`unread`?(y(),c(g,{key:0,trigger:`hover`,placement:`top`},{trigger:D(()=>[d(`span`,{class:`notification-item__action`,onClick:r[0]||=e=>n.$emit(`read`,t.message.id)},[p(e,{name:`mdi:check`,size:16})])]),default:D(()=>[r[4]||=f(` 标记已读 `,-1)]),_:1})):l(`v-if`,!0),p(g,{trigger:`hover`,placement:`top`},{trigger:D(()=>[d(`span`,{class:`notification-item__action`,onClick:r[1]||=e=>n.$emit(`delete`,t.message.id)},[p(e,{name:`mdi:delete-outline`,size:16})])]),default:D(()=>[r[5]||=f(` 删除 `,-1)]),_:1})])],2)}}}),[[`__scopeId`,`data-v-2f1c8e96`]]);const xe={class:`notification-list`},Se={class:`notification-list__tabs`},Ce=[`onClick`],we={key:0,class:`notification-list__tab-count`},Te={key:0,class:`notification-list__toolbar`},Ee={class:`notification-list__skeleton-text`},De={class:`notification-list__items`},Oe={class:`notification-list__empty`};var ke=t(m({__name:`NotificationList`,props:{messages:{},activeCategory:{},unreadByCategory:{},unreadCount:{},loading:{type:Boolean},hasMore:{type:Boolean},scrollHeight:{default:420}},emits:[`switchCategory`,`itemClick`,`read`,`delete`,`markAllRead`,`clear`,`loadMore`],setup(t){let n=t,r=s(()=>n.activeCategory===`all`?n.unreadCount:n.unreadByCategory[n.activeCategory]??0);function i(e){return e===`all`?n.unreadCount:n.unreadByCategory[e]??0}return(n,o)=>{let s=A,m=M,_=N,v=j;return y(),u(`div`,xe,[l(` 分类 Tab `),d(`div`,Se,[(y(!0),u(a,null,S(T(G),e=>(y(),u(`div`,{key:e.key,class:h([`notification-list__tab`,{"notification-list__tab--active":t.activeCategory===e.key}]),onClick:t=>n.$emit(`switchCategory`,e.key)},[d(`span`,null,w(e.label),1),i(e.key)>0?(y(),u(`span`,we,w(i(e.key)),1)):l(`v-if`,!0)],10,Ce))),128))]),l(` 操作栏 `),t.messages.length>0?(y(),u(`div`,Te,[p(s,{text:``,size:`tiny`,disabled:r.value===0,onClick:o[0]||=e=>n.$emit(`markAllRead`)},{icon:D(()=>[p(e,{name:`mdi:check-all`,size:14})]),default:D(()=>[o[6]||=f(` 全部已读 `,-1)]),_:1},8,[`disabled`]),p(s,{text:``,size:`tiny`,onClick:o[1]||=e=>n.$emit(`clear`)},{icon:D(()=>[p(e,{name:`mdi:delete-sweep-outline`,size:14})]),default:D(()=>[o[7]||=f(` 清空 `,-1)]),_:1})])):l(`v-if`,!0),l(` 消息列表 `),p(v,{class:`notification-list__scroll`,style:g({maxHeight:`${t.scrollHeight}px`})},{default:D(()=>[t.loading&&t.messages.length===0?(y(),u(a,{key:0},[l(` 骨架屏 `),(y(),u(a,null,S(4,e=>d(`div`,{key:e,class:`notification-list__skeleton`},[p(m,{circle:``,width:36,height:36}),d(`div`,Ee,[p(m,{text:``,width:`60%`,height:14}),p(m,{text:``,width:`90%`,height:12}),p(m,{text:``,width:`40%`,height:10})])])),64))],64)):t.messages.length>0?(y(),u(a,{key:1},[d(`div`,De,[(y(!0),u(a,null,S(t.messages,e=>(y(),c(be,{key:e.id,message:e,onClick:o[2]||=e=>n.$emit(`itemClick`,e),onRead:o[3]||=e=>n.$emit(`read`,e),onDelete:o[4]||=e=>n.$emit(`delete`,e)},null,8,[`message`]))),128))]),l(` 加载更多 `),t.hasMore?(y(),u(`div`,{key:0,class:`notification-list__load-more`,onClick:o[5]||=e=>n.$emit(`loadMore`)},[t.loading?(y(),c(_,{key:0,size:14})):l(`v-if`,!0),d(`span`,null,w(t.loading?`加载中...`:`加载更多`),1)])):l(`v-if`,!0)],64)):(y(),u(a,{key:2},[l(` 空状态 `),d(`div`,Oe,[p(e,{name:`mdi:bell-off-outline`,size:48,class:`notification-list__empty-icon`}),o[8]||=d(`span`,{class:`notification-list__empty-text`},`暂无消息`,-1)])],2112))]),_:1},8,[`style`])])}}}),[[`__scopeId`,`data-v-d366768f`]]);function Ae(e){return e.includes(`\\`)||e.startsWith(`//`)||Array.from(e).some(e=>e.charCodeAt(0)<32)}function je(e){let t=e?.trim();if(!t||Ae(t))return null;if(/^https?:\/\//i.test(t))try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?null:{kind:`external`,url:e.href}}catch{return null}return/^[a-z][a-z\d+.-]*:/i.test(t)?null:{kind:`internal`,url:t}}const Me={class:`notification-detail`},Ne={class:`notification-detail__back`},Pe={class:`notification-detail__header`},Fe={class:`notification-detail__title`},Ie={class:`notification-detail__meta`},Le={class:`notification-detail__time`},Re={key:0,class:`notification-detail__sender`},ze=[`innerHTML`],Be={key:1,class:`notification-detail__body`},Ve={key:0,class:`notification-detail__footer`};var He=t(m({__name:`NotificationDetail`,props:{message:{},scrollHeight:{default:320}},emits:[`back`,`action`,`navigate`],setup(t,{emit:r}){let i=t,a=r,{formatRelativeTime:o}=$(),m=s(()=>W[i.message.category]??W.system),h=s(()=>K[i.message.priority]??K.normal),_=s(()=>o(i.message.timestamp)),v=s(()=>n(i.message.content||``));function b(){let e=je(i.message.actionUrl);e&&(a(`action`,e.url),e.kind===`external`?window.open(e.url,`_blank`,`noopener,noreferrer`):a(`navigate`,e.url))}return(n,r)=>{let i=A,a=P,o=k,s=j;return y(),u(`div`,Me,[l(` 返回栏 `),d(`div`,Ne,[p(i,{text:``,size:`small`,onClick:r[0]||=e=>n.$emit(`back`)},{icon:D(()=>[p(e,{name:`mdi:arrow-left`,size:16})]),default:D(()=>[r[1]||=f(` 返回列表 `,-1)]),_:1})]),l(` 消息头部 `),d(`div`,Pe,[d(`h3`,Fe,w(t.message.title),1),d(`div`,Ie,[p(a,{type:m.value.color,size:`tiny`,bordered:!1,round:``},{icon:D(()=>[p(e,{name:m.value.icon,size:12},null,8,[`name`])]),default:D(()=>[f(` `+w(m.value.label),1)]),_:1},8,[`type`]),t.message.priority===`urgent`||t.message.priority===`high`?(y(),c(a,{key:0,type:h.value.type,size:`tiny`,bordered:!1,round:``},{default:D(()=>[f(w(h.value.label),1)]),_:1},8,[`type`])):l(`v-if`,!0),d(`span`,Le,w(_.value),1)]),t.message.sender?(y(),u(`div`,Re,[t.message.sender.avatar?(y(),c(o,{key:0,src:t.message.sender.avatar,size:20,round:``},null,8,[`src`])):l(`v-if`,!0),d(`span`,null,w(t.message.sender.name),1)])):l(`v-if`,!0)]),l(` 消息内容 `),p(s,{class:`notification-detail__content`,style:g({maxHeight:`${t.scrollHeight}px`})},{default:D(()=>[t.message.content?(y(),u(`div`,{key:0,class:`notification-detail__body`,innerHTML:v.value},null,8,ze)):(y(),u(`div`,Be,w(t.message.summary),1))]),_:1},8,[`style`]),l(` 操作区 `),t.message.actionUrl?(y(),u(`div`,Ve,[p(i,{type:`primary`,size:`small`,onClick:b},{icon:D(()=>[p(e,{name:`mdi:arrow-right`,size:16})]),default:D(()=>[f(w(t.message.actionText||`查看详情`)+` `,1)]),_:1})])):l(`v-if`,!0)])}}}),[[`__scopeId`,`data-v-8e02b6cd`]]);const Ue={class:`c-notification-center`},We={class:`c-notification-center__panel`},Ge={class:`c-notification-center__header`},Ke={class:`c-notification-center__header-extra`};var qe=t(m({name:`C_NotificationCenter`,__name:`index`,props:{fetchNotifications:{},markAsRead:{},markAllRead:{},deleteNotification:{},clearNotifications:{},wsConfig:{},desktopNotification:{type:Boolean,default:!1},maxBadgeCount:{default:99},pollingInterval:{default:6e4},pageSize:{default:20},storageKey:{default:`notification_center`},onError:{}},emits:[`itemClick`,`read`,`allRead`,`delete`,`unreadChange`,`wsStatusChange`,`newMessage`,`navigate`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=X(r,{onNewMessage:e=>i(`newMessage`,e),onWSStatusChange:e=>i(`wsStatusChange`,e)}),m=s(()=>a.messages.value.some(e=>e.status===`unread`&&e.priority===`urgent`)),g=s(()=>({connected:`已连接`,connecting:`连接中...`,disconnected:`未连接`,reconnecting:`重连中...`})[a.wsStatus.value]??`未知`);E(()=>a.unreadCount.value,e=>{i(`unreadChange`,e)});function _(){a.popoverVisible.value=!a.popoverVisible.value}function v(e){a.selectMessage(e),i(`itemClick`,e)}async function b(e){try{await a.markAsRead([e]),i(`read`,[e])}catch{}}async function x(e){try{await a.deleteMessages([e]),i(`delete`,[e])}catch{}}async function S(){let e=a.activeCategory.value===`all`?void 0:a.activeCategory.value;try{await a.markAllAsRead(e),i(`allRead`,e)}catch{}}async function C(){let e=a.activeCategory.value===`all`?void 0:a.activeCategory.value;try{await a.clearMessages(e)}catch{}}function O(){a.popoverVisible.value=!1}function k(){a.clearSelection()}return t({refresh:()=>a.fetchMessages(!0),connectWS:()=>{r.wsConfig&&a.connectWS(r.wsConfig)},disconnectWS:a.disconnectWS,getUnreadCount:()=>a.unreadCount.value,getMessages:()=>a.messages.value.map(e=>({...e})),markRead:e=>a.markAsRead(e),markAllAsRead:e=>a.markAllAsRead(e),requestDesktopPermission:a.requestDesktopPermission}),(e,t)=>{let n=F,s=ee;return y(),u(`div`,Ue,[p(s,{show:T(a).popoverVisible.value,"onUpdate:show":t[1]||=e=>T(a).popoverVisible.value=e,width:420,trigger:`manual`,placement:`bottom-end`,"show-arrow":!1,"content-class":`c-notification-center__popover`,onAfterLeave:k},{trigger:D(()=>[p(ae,{count:T(a).unreadCount.value,"max-count":r.maxBadgeCount,"has-urgent":m.value,onClick:_},null,8,[`count`,`max-count`,`has-urgent`])]),default:D(()=>[d(`div`,We,[l(` 头部标题 `),d(`div`,Ge,[t[2]||=d(`span`,{class:`c-notification-center__title`},`消息中心`,-1),d(`div`,Ke,[l(` WebSocket 连接状态 `),r.wsConfig?(y(),c(n,{key:0,trigger:`hover`,placement:`top`},{trigger:D(()=>[d(`span`,{class:h([`c-notification-center__ws-dot`,`c-notification-center__ws-dot--${T(a).wsStatus.value}`])},null,2)]),default:D(()=>[f(` `+w(g.value),1)]),_:1})):l(`v-if`,!0)])]),l(` 列表 / 详情切换 `),p(o,{name:`slide-fade`,mode:`out-in`},{default:D(()=>[T(a).selectedMessage.value?(y(),c(He,{key:T(a).selectedMessage.value.id,message:T(a).selectedMessage.value,onBack:T(a).clearSelection,onAction:O,onNavigate:t[0]||=e=>i(`navigate`,e)},null,8,[`message`,`onBack`])):(y(),c(ke,{key:1,messages:T(a).filteredMessages.value,"active-category":T(a).activeCategory.value,"unread-by-category":T(a).unreadByCategory.value,"unread-count":T(a).unreadCount.value,loading:T(a).loading.value,"has-more":T(a).hasMore.value,onSwitchCategory:T(a).switchCategory,onItemClick:v,onRead:b,onDelete:x,onMarkAllRead:S,onClear:C,onLoadMore:T(a).loadMore},null,8,[`messages`,`active-category`,`unread-by-category`,`unread-count`,`loading`,`has-more`,`onSwitchCategory`,`onLoadMore`]))]),_:1})])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-a06c4b3a`]]);export{W as a,L as c,H as d,U as f,K as g,q as h,J as i,R as l,B as m,$ as n,G as o,V as p,X as r,I as s,qe as t,z as u};
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{t as n}from"./html.js";import{i as r,t as i}from"./storage.js";import{Fragment as a,Transition as o,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,defineComponent as m,getCurrentInstance as h,getCurrentScope as g,normalizeClass as _,normalizeStyle as v,onMounted as y,onScopeDispose as ee,openBlock as b,readonly as te,ref as x,renderList as S,resolveComponent as ne,shallowRef as re,toDisplayString as C,unref as w,watch as ie,withCtx as T,withModifiers as E}from"vue";import{NAvatar as D,NButton as ae,NPopover as O,NScrollbar as k,NSkeleton as A,NSpin as j,NTag as M,NTooltip as N}from"naive-ui";const P=99,F=20,oe=6e4,se=`notification_center`,I=3e3,L=5,R=3e4,z=`ping`,B={system:{label:`系统通知`,icon:`mdi:cog-outline`,color:`info`},business:{label:`业务消息`,icon:`mdi:briefcase-outline`,color:`success`},alarm:{label:`告警预警`,icon:`mdi:alert-outline`,color:`warning`}},V=[{key:`all`,label:`全部`},{key:`system`,label:`系统通知`},{key:`business`,label:`业务消息`},{key:`alarm`,label:`告警预警`}],H={low:{label:`低`,type:`default`},normal:{label:`普通`,type:`info`},high:{label:`重要`,type:`warning`},urgent:{label:`紧急`,type:`error`}},ce=[{id:`msg-001`,title:`系统维护通知`,summary:`系统将于今晚 22:00-23:00 进行例行维护升级,届时部分功能可能暂时不可用。`,content:`<p>尊敬的用户:</p><p>为了提升系统性能和稳定性,我们计划于 <strong>2026年2月27日 22:00-23:00</strong> 对系统进行例行维护升级。</p><p>维护期间,以下功能可能暂时不可用:</p><ul><li>报表导出</li><li>数据同步</li><li>定时任务</li></ul><p>请提前保存好未完成的工作,感谢您的理解与支持!</p>`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-15*6e4).toISOString(),sender:{name:`系统管理员`,avatar:``}},{id:`msg-002`,title:`审批流程待处理`,summary:`张三提交的《Q1 季度预算申请》需要您审批,请尽快处理。`,category:`business`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-30*6e4).toISOString(),sender:{name:`张三`,avatar:``},actionUrl:`/workflow/approval`,actionText:`去审批`},{id:`msg-003`,title:`服务器 CPU 使用率告警`,summary:`生产环境节点 prod-node-03 CPU 使用率持续超过 90%,已触发告警阈值。`,category:`alarm`,priority:`urgent`,status:`unread`,timestamp:new Date(Date.now()-2*6e4).toISOString(),sender:{name:`监控中心`},actionUrl:`/monitor/server`,actionText:`查看详情`},{id:`msg-004`,title:`新版本发布 v1.14.0`,summary:`系统已升级至 v1.14.0,新增通知中心、工作流增强等多项功能。`,category:`system`,priority:`normal`,status:`unread`,timestamp:new Date(Date.now()-3*36e5).toISOString(),sender:{name:`系统管理员`}},{id:`msg-005`,title:`项目交付提醒`,summary:`「Robot Admin 二期」项目交付截止日期为 3月15日,当前进度 78%。`,category:`business`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-8*36e5).toISOString(),sender:{name:`项目管理系统`}},{id:`msg-006`,title:`数据库连接池告警`,summary:`数据库连接池使用率达到 85%,建议关注并适时扩容。`,category:`alarm`,priority:`high`,status:`read`,timestamp:new Date(Date.now()-12*36e5).toISOString(),sender:{name:`监控中心`}},{id:`msg-007`,title:`周报提交提醒`,summary:`本周周报提交截止时间为周五 18:00,请及时提交。`,category:`business`,priority:`normal`,status:`read`,timestamp:new Date(Date.now()-24*36e5).toISOString(),sender:{name:`OA 系统`}},{id:`msg-008`,title:`账号安全提醒`,summary:`检测到您的账号在新设备上登录,如非本人操作请及时修改密码。`,category:`system`,priority:`high`,status:`unread`,timestamp:new Date(Date.now()-45*6e4).toISOString(),sender:{name:`安全中心`}}];function le(e,t){let n=x(`disconnected`),r=null,i=0,a=null,o=null,s=null,c=null,l=0;function u(e){n.value=e,t?.(e)}function d(e){c=e,i=0,f(e)}function f(e){let t=++l;y(),u(`connecting`);try{r=new WebSocket(p(e))}catch{u(`disconnected`),e.autoReconnect!==!1&&h(e);return}let n=r;n.addEventListener(`open`,()=>{t!==l||n!==r||(u(`connected`),i=0,_(e))}),n.addEventListener(`message`,e=>{t!==l||n!==r||m(e.data)}),n.addEventListener(`close`,()=>{t!==l||n!==r||(r=null,v(),u(`disconnected`),e.autoReconnect!==!1&&h(e))}),n.addEventListener(`error`,()=>{})}function p(e){let t=e.getToken?.();if(t){let n=e.url.includes(`?`)?`&`:`?`;return`${e.url}${n}token=${encodeURIComponent(t)}`}return e.url}function m(t){if(typeof t==`string`){if(t===`pong`){s&&clearTimeout(s),s=null;return}try{let n=JSON.parse(t);n&&typeof n==`object`&&[`new_message`,`read_sync`,`count_update`].includes(String(n.type))&&`data`in n&&e(n)}catch{}}}function h(e){if(c!==e||a)return;let t=Math.max(0,Math.trunc(e.maxReconnectAttempts??5));if(i>=t)return;i++,u(`reconnecting`);let n=Math.max(0,e.reconnectInterval??I),r=Math.min(6e4,n*2**(i-1)),o=l;a=setTimeout(()=>{a=null,!(o!==l||c!==e)&&f(e)},r)}function _(e){v();let t=e.heartbeatInterval??R;if(t<=0)return;let n=e.heartbeatMessage??z;o=setInterval(()=>{if(r?.readyState===WebSocket.OPEN&&!s)try{r.send(n);let t=e.heartbeatTimeout??0;if(t>0){let e=r;s=setTimeout(()=>{s=null,e===r&&e.close()},t)}}catch{r.close()}},t)}function v(){s&&clearTimeout(s),s=null,o&&=(clearInterval(o),null)}function y(){v(),a&&=(clearTimeout(a),null),r&&=(r.close(),null)}function b(){c=null,l++,i=0,y(),u(`disconnected`)}function S(){c&&(i=0,f(c))}return g()&&ee(b),{status:te(n),connect:d,disconnect:b,reconnect:S}}const U=[`system`,`business`,`alarm`],ue=()=>({list:[],known:new Map,total:0,unread:0,categories:{},statisticsVersion:0,queryCategory:`all`});function W(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.title==`string`&&typeof t.summary==`string`&&typeof t.timestamp==`string`&&Number.isFinite(Date.parse(t.timestamp))&&U.includes(t.category)&&[`low`,`normal`,`high`,`urgent`].includes(String(t.priority))&&[`read`,`unread`,`archived`].includes(String(t.status))}function G(e){return{...e,...e.sender?{sender:{...e.sender}}:{},...e.extra?{extra:{...e.extra}}:{}}}function de(e){let t={system:0,business:0,alarm:0};for(let n of e)n.status===`unread`&&t[n.category]++;return t}function fe(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function pe(e){let t={};if(e&&typeof e==`object`)for(let n of U){let r=e[n];fe(r)&&(t[n]=r)}return t}function me(e,t,n){let r=new Map(e);for(let e of t)n?r.delete(e.id):e.status===`unread`&&r.set(e.id,{...e,status:`read`});return r}function he(e,t,n){if(t.kind!==`delete`&&t.kind!==`clear`)return e.total;let r=e.queryCategory===t.queryCategory?t.unknownTotal:0;return Math.max(0,e.total-n-r)}function ge(e,t){let n=new Set(t.ids),r=[...e.known.values()].filter(e=>n.has(e.id)),i=e.list.filter(e=>n.has(e.id)),a=r.filter(e=>e.status===`unread`),o=t.kind===`delete`||t.kind===`clear`,s=o?e.list.filter(e=>!n.has(e.id)):e.list.map(e=>n.has(e.id)&&e.status===`unread`?{...e,status:`read`}:e),c={...e.categories},l=me(e.known,r,o),u=e.statisticsVersion===t.statisticsVersion;for(let e of U){let n=c[e];if(n===void 0||!u)continue;let r=a.filter(t=>t.category===e).length;c[e]=Math.max(0,n-r-(t.unknownCategories[e]??0))}return{list:s,known:l,total:he(e,t,i.length),unread:u?Math.max(0,e.unread-a.length-t.unknownUnread):e.unread,categories:c,statisticsVersion:e.statisticsVersion,queryCategory:e.queryCategory}}function _e(e,t,n,r){if(!Array.isArray(e?.list)||!e.list.every(W)||!fe(e.total)||!fe(e.unreadCount))throw Error(`消息接口返回的数据或统计无效`);let i=new Map,a=new Map(t.known);if(!n)for(let e of t.list)i.set(e.id,e);for(let t of e.list){let e=G(t);i.set(t.id,e),a.set(t.id,e)}return{list:[...i.values()],known:a,total:e.total,unread:e.unreadCount,categories:pe(e.unreadByCategory),statisticsVersion:t.statisticsVersion,queryCategory:r}}function ve(e,t,n){let r=de(t),i={},a=n?[n]:U;for(let t of a){let n=e.categories[t];n!==void 0&&(i[t]=Math.max(0,n-r[t]))}let o=n?e.categories[n]:e.unread;return{unknownCategories:i,unknownUnread:o===void 0?0:Math.max(0,o-t.filter(e=>e.status===`unread`).length)}}function K(e,t={}){let n=s(()=>e.dataMode??(e.fetchNotifications?`remote`:`demo`)),a=re(ue()),o=re([]),c=s(()=>o.value.reduce(ge,a.value)),l=s(()=>c.value.list),u=x(`all`),d=x(!1),f=x(1),p=x(null),m=x(!1),_=x(`disconnected`),v=x(null),b=s(()=>c.value.unread),te=s(()=>c.value.categories),S=s(()=>u.value===`all`?l.value:l.value.filter(e=>e.category===u.value)),ne=s(()=>n.value===`demo`?S.value.length:c.value.total),C=s(()=>n.value===`remote`&&S.value.length<ne.value),w=s(()=>o.value.length>0),T=s(()=>[...new Set(o.value.flatMap(e=>e.ids))]),E=0,D=0,ae=0,O=0,k=!1,A=!1,j=[],M=null,N=!1,P,F=new Set;function I(t,n){v.value=t instanceof Error?t.message:`消息操作失败,请重试`,e.onError?.(t,n)}function L(){v.value=null}function R(e){let t=new Set([...e.list.map(e=>e.id),...o.value.flatMap(e=>e.ids)]),n=new Map,r=0;for(let[i,a]of[...e.known].reverse()){let e=t.has(i);(e||r<256)&&(n.set(i,a),e||r++)}return{...e,known:new Map([...n].reverse())}}function z(e){let t=de(e);return{list:e,known:new Map(e.map(e=>[e.id,e])),total:e.length,unread:Object.values(t).reduce((e,t)=>e+t,0),categories:t,statisticsVersion:0,queryCategory:`all`}}function B(){let t=i(e.storageKey??se);if(t?.version===2&&Array.isArray(t.messages)){a.value=z(t.messages.filter(W).map(G));return}let n=new Set(Array.isArray(t?.readIds)?t.readIds:[]);a.value=z(ce.map(e=>({...G(e),status:n.has(e.id)?`read`:e.status})))}function V(){n.value===`demo`&&r(e.storageKey??se,{version:2,messages:a.value.list.map(G)})}function H(e){let t=++D;d.value&&j.push({...e,version:t})}function U(e){return n.value===`demo`||u.value===`all`||u.value===e.category}function me(e,t,n=!1){if(e.list.some(e=>e.id===t.id)||!n&&e.known.has(t.id))return e;let r=U(t),i={...e.categories};return t.status===`unread`&&i[t.category]!==void 0&&i[t.category]++,{list:r?[G(t),...e.list]:e.list,known:new Map([...e.known,[t.id,G(t)]]),total:e.total+(r?1:0),unread:e.unread+(t.status===`unread`?1:0),categories:i,statisticsVersion:e.statisticsVersion,queryCategory:e.queryCategory}}function he(e,t){return`operation`in t?ge(e,{...t.operation,statisticsVersion:e.statisticsVersion}):`message`in t?me(e,t.message,!0):{...e,unread:t.counts.unreadCount,categories:{...e.categories,...pe(t.counts.unreadByCategory)},statisticsVersion:e.statisticsVersion+1}}function K(e,t){return!A&&t===O&&e===E}async function ye(t,n){if(!e.fetchNotifications)throw Error(`远程消息模式未配置 fetchNotifications`);return e.fetchNotifications({category:n===`all`?void 0:n,page:t,pageSize:e.pageSize??20})}function be(e,t){let n=e;for(let e of j)e.version>t&&(n=he(n,e));return n}async function xe(e,t){let r=++E,i=D,o=u.value,s=O;d.value=!0,L();try{if(n.value===`demo`){B(),f.value=1;return}let c=await ye(e,o);if(!K(r,s))return;a.value=R(be(_e(c,a.value,t,o),i)),f.value=e}catch(n){throw K(r,s)&&(P=()=>xe(e,t),I(n,`fetch`)),n}finally{K(r,s)&&(d.value=!1,j=[])}}async function q(e=!1){await xe(e?1:f.value,e)}async function Se(){d.value||!C.value||await xe(f.value+1,!1)}function J(e,t,n){let r={id:++ae,kind:e,ids:[...new Set(t)],category:n,unknownUnread:0,unknownCategories:{},unknownTotal:0,statisticsVersion:a.value.statisticsVersion,queryCategory:u.value};if(e!==`read-all`&&e!==`clear`)return r;let i=[...a.value.known.values()].filter(e=>!n||e.category===n);Object.assign(r,ve(a.value,i,n));let o=!n||u.value===n;return e===`clear`&&o&&(r.unknownTotal=Math.max(0,a.value.total-a.value.list.filter(e=>!n||e.category===n).length)),r}async function Y(e,t,r){if(L(),n.value===`remote`&&!t){let n=Error(`远程消息模式未配置 `+r+` 接口`);throw P=()=>Y(e,t,r),I(n,r),n}let i=O;o.value=[...o.value,e];try{if(n.value===`remote`&&await t(),A||i!==O){let e=Error(`消息作用域已失效`);throw e.name=`AbortError`,e}a.value=ge(a.value,e),H({operation:e}),V()}catch(n){throw!A&&i===O&&(P=()=>Y(e,t,r),I(n,r)),n}finally{i===O&&(o.value=o.value.filter(t=>t.id!==e.id),a.value=R(a.value))}}async function X(t){await Y(J(`read`,t),e.markAsRead?()=>e.markAsRead(t):void 0,`mark-as-read`)}async function Ce(t){await Y(J(`read-all`,[...a.value.known.values()].filter(e=>!t||e.category===t).map(e=>e.id),t),e.markAllRead?()=>e.markAllRead(t):void 0,`mark-all-as-read`)}async function we(t){await Y(J(`delete`,t),e.deleteNotification?()=>e.deleteNotification(t):void 0,`delete`),p.value&&t.includes(p.value.id)&&Q()}async function Te(t){await Y(J(`clear`,[...a.value.known.values()].filter(e=>!t||e.category===t).map(e=>e.id),t),e.clearNotifications?()=>e.clearNotifications(t):void 0,`clear`),p.value&&(!t||p.value.category===t)&&Q()}let Z=new Set;function Ee(e){if(!W(e))return;let n=e;Z.has(n.id)||a.value.known.has(n.id)||(Z.add(n.id),Z.size>2e3&&Z.delete(Z.values().next().value),a.value=me(a.value,n),H({message:G(n)}),V(),t.onNewMessage?.(n),Pe(n))}function De(e){if(!Array.isArray(e))return;let t=J(`read`,e.filter(W).map(e=>e.id));a.value=ge(a.value,t),H({operation:t}),V()}function Oe(e){if(e&&typeof e==`object`&&`unreadCount`in e&&fe(e.unreadCount)){let t=e;a.value=he(a.value,{version:0,counts:t}),H({counts:t})}}function ke(e){if(!A)switch(e.type){case`new_message`:Ee(e.data);break;case`read_sync`:De(e.data);break;case`count_update`:Oe(e.data);break}}function Ae(e){_.value=e,t.onWSStatusChange?.(e),e===`connected`&&(N&&n.value===`remote`&&q(!0).catch(()=>void 0),N=!0)}let je=le(ke,Ae);function Me(t=e.wsConfig){t&&je.connect(t)}function Ne(){je.disconnect()}function Pe(t){if(!e.desktopNotification||typeof window>`u`||!(`Notification`in window)||Notification.permission!==`granted`)return;let n=new Notification(t.title,{body:t.summary,icon:t.sender?.avatar,tag:t.id});n.addEventListener(`click`,()=>{window.focus(),Ie(t),n.close()});let r=setTimeout(()=>{n.close(),F.delete(r)},5e3);F.add(r)}async function Fe(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:Notification.requestPermission()}function Ie(e){p.value=e,e.status===`unread`&&X([e.id]).catch(()=>void 0)}function Q(){p.value=null}function Le(e){u.value!==e&&(u.value=e,Q(),n.value===`remote`&&(a.value={...a.value,list:[],total:0,queryCategory:e},f.value=1,q(!0).catch(()=>void 0)))}function $(){if(k)return;k=!0,A=!1,q(!0).catch(()=>void 0);let t=e.pollingInterval??oe;n.value===`remote`&&t>0&&(M=setInterval(()=>{d.value||q(!0).catch(()=>void 0)},t)),Me()}function Re(){k=!1,A=!0,O++,E++,d.value=!1,o.value=[],j=[],P=void 0,Z.clear(),N=!1,M&&clearInterval(M),M=null;for(let e of F)clearTimeout(e);F.clear(),Ne()}async function ze(){P?await P():await q(!0)}return g()&&ee(Re),e.autoStart!==!1&&(h()?y($):$()),ie(l,e=>{let t=p.value?.id;t&&(p.value=e.find(e=>e.id===t)??null)}),ie(()=>[n.value,e.storageKey],()=>{let e=k;Re(),a.value=ue(),u.value=`all`,p.value=null,m.value=!1,v.value=null,e&&$()}),{messages:l,activeCategory:u,loading:d,total:ne,page:f,selectedMessage:p,popoverVisible:m,wsStatus:_,unreadCount:b,unreadByCategory:te,filteredMessages:S,hasMore:C,error:v,busy:w,pendingIds:T,fetchMessages:q,loadMore:Se,markAsRead:X,markAllAsRead:Ce,deleteMessages:we,clearMessages:Te,selectMessage:Ie,clearSelection:Q,switchCategory:Le,clearError:L,retry:ze,requestDesktopPermission:Fe,connectWS:Me,disconnectWS:Ne,initialize:$,dispose:Re}}const ye={class:`notification-badge`},be=[`aria-label`],xe={key:0,class:`notification-badge__count`},q={key:0,class:`notification-badge__pulse`};var Se=t(m({__name:`NotificationBadge`,props:{count:{default:0},maxCount:{default:99},hasUrgent:{type:Boolean,default:!1}},emits:[`click`],setup(t){let n=t,r=s(()=>n.count>n.maxCount?`${n.maxCount}+`:String(n.count));return(n,i)=>{let a=N;return b(),u(`div`,ye,[p(a,{trigger:`hover`,placement:`bottom`},{trigger:T(()=>[d(`button`,{type:`button`,class:`notification-badge__trigger`,"aria-label":`消息通知${t.count>0?`(${t.count} 条未读)`:``}`,onClick:i[0]||=e=>n.$emit(`click`)},[p(e,{name:`mdi:bell-outline`,size:18,class:`notification-badge__icon`}),l(` 未读角标 `),p(o,{name:`badge-bounce`},{default:T(()=>[t.count>0?(b(),u(`span`,xe,C(r.value),1)):l(`v-if`,!0)]),_:1}),l(` 脉冲动画(有紧急消息时) `),t.hasUrgent?(b(),u(`span`,q)):l(`v-if`,!0)],8,be)]),default:T(()=>[f(` 消息通知`+C(t.count>0?`(${t.count} 条未读)`:``),1)]),_:1})])}}}),[[`__scopeId`,`data-v-51516250`]]);const J=6e4,Y=36e5,X=864e5,Ce=7*X,we=30*X;365*X;let Te=null;function Z(){return Te||=Ee(),Te}function Ee(){function e(e){let r=new Date(e),i=Date.now()-r.getTime();if(i<0||i<J)return`刚刚`;if(i<Y)return`${Math.floor(i/J)}分钟前`;if(i<X)return`${Math.floor(i/Y)}小时前`;let a=new Date;return a.setHours(0,0,0,0),r>=new Date(a.getTime()-X)&&r<a?`昨天 ${n(r.getHours())}:${n(r.getMinutes())}`:i<Ce?`${Math.floor(i/X)}天前`:i<we?`${Math.floor(i/Ce)}周前`:i<31536e6?`${Math.floor(i/we)}个月前`:t(r)}function t(e){return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}`}function n(e){return e<10?`0${e}`:String(e)}return{formatRelativeTime:e,formatFullDate:t}}const De={class:`notification-item__indicator`},Oe={class:`notification-item__avatar`},ke={class:`notification-item__body`},Ae={class:`notification-item__header`},je={class:`notification-item__title`},Me={class:`notification-item__summary`},Ne={class:`notification-item__meta`},Pe={class:`notification-item__time`},Fe={key:0,class:`notification-item__sender`},Ie=[`disabled`],Q=[`disabled`];var Le=t(m({__name:`NotificationItem`,props:{message:{},busy:{type:Boolean}},emits:[`click`,`read`,`delete`],setup(t){let n=t,{formatRelativeTime:r}=Z(),i=s(()=>B[n.message.category]?.icon??`mdi:bell-outline`),a=s(()=>H[n.message.priority]??H.normal),o=s(()=>r(n.message.timestamp));return(n,r)=>{let s=D,m=M,h=N;return b(),u(`div`,{class:_([`notification-item`,{"notification-item--unread":t.message.status===`unread`,"notification-item--urgent":t.message.priority===`urgent`}]),onClick:r[3]||=e=>n.$emit(`click`,t.message)},[l(` 未读指示点 `),d(`div`,De,[t.message.status===`unread`?(b(),u(`span`,{key:0,class:_([`notification-item__dot`,`notification-item__dot--${t.message.priority}`])},null,2)):l(`v-if`,!0)]),l(` 头像 `),d(`div`,Oe,[t.message.sender?.avatar?(b(),c(s,{key:0,src:t.message.sender.avatar,size:36,round:``},null,8,[`src`])):(b(),u(`div`,{key:1,class:_([`notification-item__avatar-placeholder`,`notification-item__avatar-placeholder--${t.message.category}`])},[p(e,{name:i.value,size:16},null,8,[`name`])],2))]),l(` 内容 `),d(`div`,ke,[d(`div`,Ae,[d(`span`,je,C(t.message.title),1),t.message.priority===`urgent`||t.message.priority===`high`?(b(),c(m,{key:0,type:a.value.type,size:`tiny`,bordered:!1,round:``},{default:T(()=>[f(C(a.value.label),1)]),_:1},8,[`type`])):l(`v-if`,!0)]),d(`div`,Me,C(t.message.summary),1),d(`div`,Ne,[d(`span`,Pe,C(o.value),1),t.message.sender?.name?(b(),u(`span`,Fe,C(t.message.sender.name),1)):l(`v-if`,!0)])]),l(` 操作区 `),d(`div`,{class:`notification-item__actions`,onClick:r[2]||=E(()=>{},[`stop`])},[t.message.status===`unread`?(b(),c(h,{key:0,trigger:`hover`,placement:`top`},{trigger:T(()=>[d(`button`,{class:`notification-item__action`,type:`button`,disabled:t.busy,"aria-label":`标记已读`,onClick:r[0]||=e=>n.$emit(`read`,t.message.id)},[p(e,{name:`mdi:check`,size:16})],8,Ie)]),default:T(()=>[r[4]||=f(` 标记已读 `,-1)]),_:1})):l(`v-if`,!0),p(h,{trigger:`hover`,placement:`top`},{trigger:T(()=>[d(`button`,{class:`notification-item__action`,type:`button`,disabled:t.busy,"aria-label":`删除消息`,onClick:r[1]||=e=>n.$emit(`delete`,t.message.id)},[p(e,{name:`mdi:delete-outline`,size:16})],8,Q)]),default:T(()=>[r[5]||=f(` 删除 `,-1)]),_:1})])],2)}}}),[[`__scopeId`,`data-v-8a4522f3`]]);const $={class:`notification-list`},Re={class:`notification-list__tabs`},ze=[`aria-pressed`,`onClick`],Be={key:0,class:`notification-list__tab-count`},Ve={key:0,class:`notification-list__toolbar`},He={class:`notification-list__skeleton-text`},Ue={class:`notification-list__items`},We=[`disabled`],Ge={class:`notification-list__empty`};var Ke=t(m({__name:`NotificationList`,props:{messages:{},activeCategory:{},unreadByCategory:{},busy:{type:Boolean,default:!1},pendingIds:{default:()=>[]},unreadCount:{},loading:{type:Boolean},hasMore:{type:Boolean},scrollHeight:{default:420}},emits:[`switchCategory`,`itemClick`,`read`,`delete`,`markAllRead`,`clear`,`loadMore`],setup(t){let n=t,r=s(()=>n.activeCategory===`all`?n.unreadCount:n.unreadByCategory[n.activeCategory]);function i(e){return e===`all`?n.unreadCount:n.unreadByCategory[e]??0}return(n,o)=>{let s=ae,m=A,h=j,g=k;return b(),u(`div`,$,[l(` 分类 Tab `),d(`div`,Re,[(b(!0),u(a,null,S(w(V),e=>(b(),u(`button`,{key:e.key,class:_([`notification-list__tab`,{"notification-list__tab--active":t.activeCategory===e.key}]),type:`button`,"aria-pressed":t.activeCategory===e.key,onClick:t=>n.$emit(`switchCategory`,e.key)},[d(`span`,null,C(e.label),1),i(e.key)>0?(b(),u(`span`,Be,C(i(e.key)),1)):l(`v-if`,!0)],10,ze))),128))]),l(` 操作栏 `),t.messages.length>0?(b(),u(`div`,Ve,[p(s,{text:``,size:`tiny`,disabled:t.busy||r.value!==void 0&&r.value===0,loading:t.busy,onClick:o[0]||=e=>n.$emit(`markAllRead`)},{icon:T(()=>[p(e,{name:`mdi:check-all`,size:14})]),default:T(()=>[o[6]||=f(` 全部已读 `,-1)]),_:1},8,[`disabled`,`loading`]),p(s,{text:``,size:`tiny`,disabled:t.busy,onClick:o[1]||=e=>n.$emit(`clear`)},{icon:T(()=>[p(e,{name:`mdi:delete-sweep-outline`,size:14})]),default:T(()=>[o[7]||=f(` 清空 `,-1)]),_:1},8,[`disabled`])])):l(`v-if`,!0),l(` 消息列表 `),p(g,{class:`notification-list__scroll`,style:v({maxHeight:`${t.scrollHeight}px`})},{default:T(()=>[t.loading&&t.messages.length===0?(b(),u(a,{key:0},[l(` 骨架屏 `),(b(),u(a,null,S(4,e=>d(`div`,{key:e,class:`notification-list__skeleton`},[p(m,{circle:``,width:36,height:36}),d(`div`,He,[p(m,{text:``,width:`60%`,height:14}),p(m,{text:``,width:`90%`,height:12}),p(m,{text:``,width:`40%`,height:10})])])),64))],64)):t.messages.length>0?(b(),u(a,{key:1},[d(`div`,Ue,[(b(!0),u(a,null,S(t.messages,e=>(b(),c(Le,{key:e.id,message:e,busy:t.busy||t.pendingIds.includes(e.id),onClick:o[2]||=e=>n.$emit(`itemClick`,e),onRead:o[3]||=e=>n.$emit(`read`,e),onDelete:o[4]||=e=>n.$emit(`delete`,e)},null,8,[`message`,`busy`]))),128))]),l(` 加载更多 `),t.hasMore?(b(),u(`button`,{key:0,class:`notification-list__load-more`,type:`button`,disabled:t.loading,onClick:o[5]||=e=>n.$emit(`loadMore`)},[t.loading?(b(),c(h,{key:0,size:14})):l(`v-if`,!0),d(`span`,null,C(t.loading?`加载中...`:`加载更多`),1)],8,We)):l(`v-if`,!0)],64)):(b(),u(a,{key:2},[l(` 空状态 `),d(`div`,Ge,[p(e,{name:`mdi:bell-off-outline`,size:48,class:`notification-list__empty-icon`}),o[8]||=d(`span`,{class:`notification-list__empty-text`},`暂无消息`,-1)])],2112))]),_:1},8,[`style`])])}}}),[[`__scopeId`,`data-v-63a2d867`]]);function qe(e){return e.includes(`\\`)||e.startsWith(`//`)||Array.from(e).some(e=>e.charCodeAt(0)<32)}function Je(e){let t=e?.trim();if(!t||qe(t))return null;if(/^https?:\/\//i.test(t))try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?null:{kind:`external`,url:e.href}}catch{return null}return/^[a-z][a-z\d+.-]*:/i.test(t)?null:{kind:`internal`,url:t}}const Ye={class:`notification-detail`},Xe={class:`notification-detail__back`},Ze={class:`notification-detail__header`},Qe={class:`notification-detail__title`},$e={class:`notification-detail__meta`},et={class:`notification-detail__time`},tt={key:0,class:`notification-detail__sender`},nt=[`innerHTML`],rt={key:1,class:`notification-detail__body`},it={key:0,class:`notification-detail__footer`};var at=t(m({__name:`NotificationDetail`,props:{message:{},scrollHeight:{default:320}},emits:[`back`,`action`,`navigate`],setup(t,{emit:r}){let i=t,a=r,{formatRelativeTime:o}=Z(),m=s(()=>B[i.message.category]??B.system),h=s(()=>H[i.message.priority]??H.normal),g=s(()=>o(i.message.timestamp)),_=s(()=>n(i.message.content||``));function y(){let e=Je(i.message.actionUrl);e&&(a(`action`,e.url),e.kind===`external`?window.open(e.url,`_blank`,`noopener,noreferrer`):a(`navigate`,e.url))}return(n,r)=>{let i=ae,a=M,o=D,s=k;return b(),u(`div`,Ye,[l(` 返回栏 `),d(`div`,Xe,[p(i,{text:``,size:`small`,onClick:r[0]||=e=>n.$emit(`back`)},{icon:T(()=>[p(e,{name:`mdi:arrow-left`,size:16})]),default:T(()=>[r[1]||=f(` 返回列表 `,-1)]),_:1})]),l(` 消息头部 `),d(`div`,Ze,[d(`h3`,Qe,C(t.message.title),1),d(`div`,$e,[p(a,{type:m.value.color,size:`tiny`,bordered:!1,round:``},{icon:T(()=>[p(e,{name:m.value.icon,size:12},null,8,[`name`])]),default:T(()=>[f(` `+C(m.value.label),1)]),_:1},8,[`type`]),t.message.priority===`urgent`||t.message.priority===`high`?(b(),c(a,{key:0,type:h.value.type,size:`tiny`,bordered:!1,round:``},{default:T(()=>[f(C(h.value.label),1)]),_:1},8,[`type`])):l(`v-if`,!0),d(`span`,et,C(g.value),1)]),t.message.sender?(b(),u(`div`,tt,[t.message.sender.avatar?(b(),c(o,{key:0,src:t.message.sender.avatar,size:20,round:``},null,8,[`src`])):l(`v-if`,!0),d(`span`,null,C(t.message.sender.name),1)])):l(`v-if`,!0)]),l(` 消息内容 `),p(s,{class:`notification-detail__content`,style:v({maxHeight:`${t.scrollHeight}px`})},{default:T(()=>[t.message.content?(b(),u(`div`,{key:0,class:`notification-detail__body`,innerHTML:_.value},null,8,nt)):(b(),u(`div`,rt,C(t.message.summary),1))]),_:1},8,[`style`]),l(` 操作区 `),t.message.actionUrl?(b(),u(`div`,it,[p(i,{type:`primary`,size:`small`,onClick:y},{icon:T(()=>[p(e,{name:`mdi:arrow-right`,size:16})]),default:T(()=>[f(C(t.message.actionText||`查看详情`)+` `,1)]),_:1})])):l(`v-if`,!0)])}}}),[[`__scopeId`,`data-v-8e02b6cd`]]);const ot={class:`c-notification-center`},st={class:`c-notification-center__panel`},ct={class:`c-notification-center__header`},lt={class:`c-notification-center__header-extra`},ut={key:0,class:`c-notification-center__error`,role:`alert`},dt={class:`c-notification-center__footer`};var ft=t(m({name:`C_NotificationCenter`,__name:`index`,props:{dataMode:{},controller:{},autoStart:{type:Boolean,default:!0},fetchNotifications:{},markAsRead:{},markAllRead:{},deleteNotification:{},clearNotifications:{},wsConfig:{},desktopNotification:{type:Boolean,default:!1},maxBadgeCount:{default:99},pollingInterval:{default:6e4},pageSize:{default:20},storageKey:{default:`notification_center`},onError:{}},emits:[`itemClick`,`read`,`allRead`,`delete`,`unreadChange`,`wsStatusChange`,`newMessage`,`navigate`,`viewAll`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=r.controller??K(r,{onNewMessage:e=>i(`newMessage`,e),onWSStatusChange:e=>i(`wsStatusChange`,e)}),m=s(()=>a.messages.value.some(e=>e.status===`unread`&&e.priority===`urgent`)),h=s(()=>({connected:`已连接`,connecting:`连接中...`,disconnected:`未连接`,reconnecting:`重连中...`})[a.wsStatus.value]??`未知`);ie(()=>a.unreadCount.value,e=>{i(`unreadChange`,e)});function g(){a.popoverVisible.value=!a.popoverVisible.value}async function v(){try{a.retry?await a.retry():await a.fetchMessages(!0)}catch{}}async function y(){try{await a.loadMore()}catch{}}function ee(){a.popoverVisible.value=!1,i(`viewAll`)}function te(e){a.selectMessage(e),i(`itemClick`,e)}async function x(e){try{await a.markAsRead([e]),i(`read`,[e])}catch{}}async function S(e){try{await a.deleteMessages([e]),i(`delete`,[e])}catch{}}async function ne(){let e=a.activeCategory.value===`all`?void 0:a.activeCategory.value;try{await a.markAllAsRead(e),i(`allRead`,e)}catch{}}async function re(){let e=a.activeCategory.value===`all`?void 0:a.activeCategory.value;try{await a.clearMessages(e)}catch{}}function E(){a.popoverVisible.value=!1}function D(){a.clearSelection()}return t({refresh:()=>a.fetchMessages(!0),connectWS:()=>{r.wsConfig&&a.connectWS(r.wsConfig)},disconnectWS:a.disconnectWS,getUnreadCount:()=>a.unreadCount.value,getMessages:()=>a.messages.value.map(e=>({...e})),markRead:e=>a.markAsRead(e),markAllAsRead:e=>a.markAllAsRead(e),requestDesktopPermission:a.requestDesktopPermission}),(e,t)=>{let n=N,s=ae,ie=O;return b(),u(`div`,ot,[p(ie,{show:w(a).popoverVisible.value,"onUpdate:show":t[1]||=e=>w(a).popoverVisible.value=e,width:420,trigger:`manual`,placement:`bottom-end`,"show-arrow":!1,"content-class":`c-notification-center__popover`,onAfterLeave:D},{trigger:T(()=>[p(Se,{count:w(a).unreadCount.value,"max-count":r.maxBadgeCount,"has-urgent":m.value,onClick:g},null,8,[`count`,`max-count`,`has-urgent`])]),default:T(()=>[d(`div`,st,[l(` 头部标题 `),d(`div`,ct,[t[2]||=d(`span`,{class:`c-notification-center__title`},`消息中心`,-1),d(`div`,lt,[l(` WebSocket 连接状态 `),r.wsConfig||w(a).wsStatus.value!==`disconnected`?(b(),c(n,{key:0,trigger:`hover`,placement:`top`},{trigger:T(()=>[d(`span`,{class:_([`c-notification-center__ws-dot`,`c-notification-center__ws-dot--${w(a).wsStatus.value}`])},null,2)]),default:T(()=>[f(` `+C(h.value),1)]),_:1})):l(`v-if`,!0)])]),w(a).error.value?(b(),u(`div`,ut,[d(`span`,null,C(w(a).error.value),1),p(s,{size:`tiny`,loading:w(a).loading.value,onClick:v},{default:T(()=>[...t[3]||=[f(`重试`,-1)]]),_:1},8,[`loading`])])):l(`v-if`,!0),l(` 列表 / 详情切换 `),p(o,{name:`slide-fade`,mode:`out-in`},{default:T(()=>[w(a).selectedMessage.value?(b(),c(at,{key:w(a).selectedMessage.value.id,message:w(a).selectedMessage.value,onBack:w(a).clearSelection,onAction:E,onNavigate:t[0]||=e=>i(`navigate`,e)},null,8,[`message`,`onBack`])):(b(),c(Ke,{key:1,messages:w(a).filteredMessages.value,"active-category":w(a).activeCategory.value,"unread-by-category":w(a).unreadByCategory.value,"unread-count":w(a).unreadCount.value,loading:w(a).loading.value,"has-more":w(a).hasMore.value,busy:w(a).busy.value,"pending-ids":w(a).pendingIds.value,onSwitchCategory:w(a).switchCategory,onItemClick:te,onRead:x,onDelete:S,onMarkAllRead:ne,onClear:re,onLoadMore:y},null,8,[`messages`,`active-category`,`unread-by-category`,`unread-count`,`loading`,`has-more`,`busy`,`pending-ids`,`onSwitchCategory`]))]),_:1}),d(`div`,dt,[p(s,{text:``,type:`primary`,size:`small`,onClick:ee},{default:T(()=>[...t[4]||=[f(`查看全部消息`,-1)]]),_:1})])])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-21f127ad`]]);export{B as a,F as c,R as d,z as f,H as g,ce as h,le as i,oe as l,I as m,Z as n,V as o,L as p,K as r,P as s,ft as t,se as u};
|
package/dist/C_OrgChart.css
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
/* layer: default */
|
|
5
|
-
.transform[data-v-3c5e8f18]{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}
|
|
6
|
-
.rounded[data-v-3c5e8f18]{border-radius:0.25rem;}
|
|
7
|
-
.px[data-v-3c5e8f18]{padding-left:1rem;padding-right:1rem;}
|
|
8
|
-
|
|
9
|
-
/* unplugin-vue-components disabled *//* C_OrgChart 组织架构图组件样式 */
|
|
3
|
+
/* C_OrgChart 组织架构图组件样式 */
|
|
10
4
|
.c-orgchart {
|
|
11
5
|
--c-orgchart-line-color: #d1d5db;
|
|
12
6
|
--c-orgchart-line-width: 2px;
|
|
@@ -294,6 +288,12 @@
|
|
|
294
288
|
min-width: 40px;
|
|
295
289
|
text-align: center;
|
|
296
290
|
}
|
|
297
|
-
|
|
291
|
+
|
|
292
|
+
/* layer: default */
|
|
293
|
+
.transform[data-v-3c5e8f18]{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}
|
|
294
|
+
.rounded[data-v-3c5e8f18]{border-radius:0.25rem;}
|
|
295
|
+
.px[data-v-3c5e8f18]{padding-left:1rem;padding-right:1rem;}
|
|
296
|
+
|
|
297
|
+
|
|
298
298
|
/* layer: default */
|
|
299
299
|
.rounded[data-v-f16fa660]{border-radius:0.25rem;}
|
package/dist/C_PageLoading.css
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
/* layer: default */
|
|
5
|
-
.table[data-v-aec6cc81]{display:table;}
|
|
6
|
-
.filter[data-v-aec6cc81]{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
7
|
-
|
|
8
|
-
/* unplugin-vue-components disabled *//*
|
|
3
|
+
/*
|
|
9
4
|
* @Author: ChenYu ycyplus@gmail.com
|
|
10
5
|
* @Date: 2026-10-07
|
|
11
6
|
* @Description: 页面加载的主题卡片、波形和轨道动画,所有选择器限定作用域
|
|
12
7
|
* Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
|
|
13
8
|
*/
|
|
14
|
-
.c-page-loading[data-v-
|
|
9
|
+
.c-page-loading[data-v-ddb14af3] {
|
|
15
10
|
position: fixed;
|
|
16
11
|
inset: 0;
|
|
17
12
|
z-index: 1999;
|
|
@@ -23,7 +18,7 @@
|
|
|
23
18
|
backdrop-filter: blur(3px);
|
|
24
19
|
pointer-events: none;
|
|
25
20
|
}
|
|
26
|
-
.c-page-loading__card[data-v-
|
|
21
|
+
.c-page-loading__card[data-v-ddb14af3] {
|
|
27
22
|
display: flex;
|
|
28
23
|
flex-direction: column;
|
|
29
24
|
align-items: center;
|
|
@@ -39,30 +34,30 @@
|
|
|
39
34
|
box-shadow: 0 16px 56px rgba(0, 0, 0, 0.1);
|
|
40
35
|
text-align: center;
|
|
41
36
|
}
|
|
42
|
-
.c-page-loading__glyph[data-v-
|
|
37
|
+
.c-page-loading__glyph[data-v-ddb14af3] {
|
|
43
38
|
width: 76px;
|
|
44
39
|
height: 76px;
|
|
45
40
|
margin-bottom: 4px;
|
|
46
41
|
flex-shrink: 0;
|
|
47
42
|
}
|
|
48
|
-
.c-page-loading__outer[data-v-
|
|
43
|
+
.c-page-loading__outer[data-v-ddb14af3], .c-page-loading__inner[data-v-ddb14af3], .c-page-loading__pulse[data-v-ddb14af3] {
|
|
49
44
|
transform-box: view-box;
|
|
50
45
|
transform-origin: center;
|
|
51
46
|
}
|
|
52
|
-
.c-page-loading__outer[data-v-
|
|
53
|
-
animation: c-page-loading-orbit-
|
|
47
|
+
.c-page-loading__outer[data-v-ddb14af3] {
|
|
48
|
+
animation: c-page-loading-orbit-ddb14af3 2s linear infinite;
|
|
54
49
|
}
|
|
55
|
-
.c-page-loading__inner[data-v-
|
|
56
|
-
animation: c-page-loading-orbit-
|
|
50
|
+
.c-page-loading__inner[data-v-ddb14af3] {
|
|
51
|
+
animation: c-page-loading-orbit-ddb14af3 2.8s linear infinite reverse;
|
|
57
52
|
}
|
|
58
|
-
.c-page-loading__pulse[data-v-
|
|
59
|
-
animation: c-page-loading-pulse-
|
|
53
|
+
.c-page-loading__pulse[data-v-ddb14af3] {
|
|
54
|
+
animation: c-page-loading-pulse-ddb14af3 2s ease-in-out infinite alternate;
|
|
60
55
|
}
|
|
61
|
-
.c-page-loading__wave[data-v-
|
|
56
|
+
.c-page-loading__wave[data-v-ddb14af3] {
|
|
62
57
|
stroke-dasharray: 100;
|
|
63
|
-
animation: c-page-loading-wave-
|
|
58
|
+
animation: c-page-loading-wave-ddb14af3 2s ease-in-out infinite;
|
|
64
59
|
}
|
|
65
|
-
.c-page-loading__label[data-v-
|
|
60
|
+
.c-page-loading__label[data-v-ddb14af3] {
|
|
66
61
|
color: var(--c-page-loading-text);
|
|
67
62
|
font-size: 14px;
|
|
68
63
|
font-weight: 600;
|
|
@@ -70,13 +65,13 @@
|
|
|
70
65
|
line-height: 1.6;
|
|
71
66
|
overflow-wrap: anywhere;
|
|
72
67
|
}
|
|
73
|
-
.c-page-loading__description[data-v-
|
|
68
|
+
.c-page-loading__description[data-v-ddb14af3] {
|
|
74
69
|
color: var(--c-page-loading-muted);
|
|
75
70
|
font-size: 12px;
|
|
76
71
|
line-height: 1.5;
|
|
77
72
|
overflow-wrap: anywhere;
|
|
78
73
|
}
|
|
79
|
-
.c-page-loading__track[data-v-
|
|
74
|
+
.c-page-loading__track[data-v-ddb14af3] {
|
|
80
75
|
width: 88px;
|
|
81
76
|
height: 2px;
|
|
82
77
|
margin-top: 8px;
|
|
@@ -84,29 +79,29 @@
|
|
|
84
79
|
border-radius: 99px;
|
|
85
80
|
background: color-mix(in srgb, currentColor 10%, transparent);
|
|
86
81
|
}
|
|
87
|
-
.c-page-loading__track[data-v-
|
|
82
|
+
.c-page-loading__track[data-v-ddb14af3]::after {
|
|
88
83
|
content: "";
|
|
89
84
|
display: block;
|
|
90
85
|
width: 50%;
|
|
91
86
|
height: 100%;
|
|
92
87
|
border-radius: inherit;
|
|
93
88
|
background: linear-gradient(90deg, transparent, currentColor, transparent);
|
|
94
|
-
animation: c-page-loading-track-
|
|
89
|
+
animation: c-page-loading-track-ddb14af3 1.6s ease-in-out infinite;
|
|
95
90
|
}
|
|
96
|
-
.c-page-loading-fade-enter-active[data-v-
|
|
97
|
-
.c-page-loading-fade-leave-active[data-v-
|
|
91
|
+
.c-page-loading-fade-enter-active[data-v-ddb14af3],
|
|
92
|
+
.c-page-loading-fade-leave-active[data-v-ddb14af3] {
|
|
98
93
|
transition: opacity 0.16s ease;
|
|
99
94
|
}
|
|
100
|
-
.c-page-loading-fade-enter-from[data-v-
|
|
101
|
-
.c-page-loading-fade-leave-to[data-v-
|
|
95
|
+
.c-page-loading-fade-enter-from[data-v-ddb14af3],
|
|
96
|
+
.c-page-loading-fade-leave-to[data-v-ddb14af3] {
|
|
102
97
|
opacity: 0;
|
|
103
98
|
}
|
|
104
|
-
@keyframes c-page-loading-orbit-
|
|
99
|
+
@keyframes c-page-loading-orbit-ddb14af3 {
|
|
105
100
|
to {
|
|
106
101
|
transform: rotate(360deg);
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
|
-
@keyframes c-page-loading-pulse-
|
|
104
|
+
@keyframes c-page-loading-pulse-ddb14af3 {
|
|
110
105
|
from {
|
|
111
106
|
transform: scale(0.9);
|
|
112
107
|
}
|
|
@@ -114,7 +109,7 @@ to {
|
|
|
114
109
|
transform: scale(1.15);
|
|
115
110
|
}
|
|
116
111
|
}
|
|
117
|
-
@keyframes c-page-loading-wave-
|
|
112
|
+
@keyframes c-page-loading-wave-ddb14af3 {
|
|
118
113
|
0% {
|
|
119
114
|
stroke-dashoffset: 100;
|
|
120
115
|
opacity: 0.3;
|
|
@@ -128,7 +123,7 @@ to {
|
|
|
128
123
|
opacity: 0.3;
|
|
129
124
|
}
|
|
130
125
|
}
|
|
131
|
-
@keyframes c-page-loading-track-
|
|
126
|
+
@keyframes c-page-loading-track-ddb14af3 {
|
|
132
127
|
from {
|
|
133
128
|
transform: translateX(-100%);
|
|
134
129
|
}
|
|
@@ -137,18 +132,18 @@ to {
|
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
134
|
@media (prefers-reduced-motion: reduce) {
|
|
140
|
-
.c-page-loading__outer[data-v-
|
|
141
|
-
.c-page-loading__inner[data-v-
|
|
142
|
-
.c-page-loading__pulse[data-v-
|
|
143
|
-
.c-page-loading__wave[data-v-
|
|
144
|
-
.c-page-loading__track[data-v-
|
|
135
|
+
.c-page-loading__outer[data-v-ddb14af3],
|
|
136
|
+
.c-page-loading__inner[data-v-ddb14af3],
|
|
137
|
+
.c-page-loading__pulse[data-v-ddb14af3],
|
|
138
|
+
.c-page-loading__wave[data-v-ddb14af3],
|
|
139
|
+
.c-page-loading__track[data-v-ddb14af3]::after {
|
|
145
140
|
animation: none;
|
|
146
141
|
}
|
|
147
|
-
.c-page-loading__track[data-v-
|
|
142
|
+
.c-page-loading__track[data-v-ddb14af3]::after {
|
|
148
143
|
transform: translateX(50%);
|
|
149
144
|
}
|
|
150
|
-
.c-page-loading-fade-enter-active[data-v-
|
|
151
|
-
.c-page-loading-fade-leave-active[data-v-
|
|
145
|
+
.c-page-loading-fade-enter-active[data-v-ddb14af3],
|
|
146
|
+
.c-page-loading-fade-leave-active[data-v-ddb14af3] {
|
|
152
147
|
transition: none;
|
|
153
148
|
}
|
|
154
149
|
}
|
package/dist/C_QRCode.css
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
/* layer: default */
|
|
5
|
-
.px[data-v-5539bdf6]{padding-left:1rem;padding-right:1rem;}
|
|
6
|
-
|
|
7
|
-
/* unplugin-vue-components disabled *//* C_QRCode styles */
|
|
3
|
+
/* C_QRCode styles */
|
|
8
4
|
.c-qrcode[data-v-5539bdf6] {
|
|
9
5
|
display: inline-flex;
|
|
10
6
|
flex-direction: column;
|
|
@@ -52,4 +48,7 @@
|
|
|
52
48
|
font-weight: 500;
|
|
53
49
|
word-break: break-all;
|
|
54
50
|
max-width: 100%;
|
|
55
|
-
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* layer: default */
|
|
54
|
+
.px[data-v-5539bdf6]{padding-left:1rem;padding-right:1rem;}
|
package/dist/C_Signature.css
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
/* layer: default */
|
|
5
|
-
.px[data-v-66ce1727]{padding-left:1rem;padding-right:1rem;}
|
|
6
|
-
|
|
7
|
-
/* unplugin-vue-components disabled *//* 电子签名组件样式 */
|
|
3
|
+
/* 电子签名组件样式 */
|
|
8
4
|
.c-signature[data-v-66ce1727] {
|
|
9
5
|
display: flex;
|
|
10
6
|
flex-direction: column;
|
|
@@ -86,4 +82,7 @@
|
|
|
86
82
|
display: flex;
|
|
87
83
|
justify-content: flex-end;
|
|
88
84
|
gap: 8px;
|
|
89
|
-
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* layer: default */
|
|
88
|
+
.px[data-v-66ce1727]{padding-left:1rem;padding-right:1rem;}
|
package/dist/C_Skeleton.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
3
|
+
/* C_Skeleton 骨架屏组件样式 */
|
|
4
4
|
.c-skeleton {
|
|
5
5
|
--c-skeleton-bg: #e5e7eb;
|
|
6
6
|
--c-skeleton-wave-bg: linear-gradient(
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
.c-skeleton__detail-value {
|
|
252
252
|
margin-top: 4px;
|
|
253
253
|
}
|
|
254
|
-
|
|
254
|
+
|
|
255
255
|
/* layer: default */
|
|
256
256
|
.table[data-v-02f4cea3]{display:table;}
|
|
257
257
|
.px[data-v-02f4cea3]{padding-left:1rem;padding-right:1rem;}
|
package/dist/C_SplitPane.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:root{--c-primary: var(--primary-color, #2080f0);--c-primary-hover: var(--primary-color-hover, #4098fc);--c-primary-pressed: var(--primary-color-pressed, #1060c9);--c-success: var(--success-color, #18a058);--c-warning: var(--warning-color, #f0a020);--c-error: var(--error-color, #d03050);--c-info: var(--info-color, #2080f0);--c-bg-body: var(--body-color, #ffffff);--c-bg-card: var(--card-color, #ffffff);--c-bg-surface: var(--popover-color, #ffffff);--c-text-1: var(--text-color-1, #262626);--c-text-2: var(--text-color-2, #525252);--c-text-3: var(--text-color-3, #a3a3a3);--c-text-4: var(--text-color-4, #c0c0c0);--c-border: var(--border-color, #e5e7eb);--c-radius-sm: var(--border-radius-small, 4px);--c-radius: var(--border-radius, 6px);--c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);--c-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);--c-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);--c-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);--c-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1)}
|
|
2
2
|
|
|
3
|
-
/*
|
|
3
|
+
/* 分割面板组件样式 */
|
|
4
4
|
.c-split-pane[data-v-99f7e295] {
|
|
5
5
|
display: flex;
|
|
6
6
|
width: 100%;
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
.c-split-pane--vertical .split-gutter__collapse-btn--second[data-v-99f7e295] {
|
|
169
169
|
right: 8px;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
/* layer: shortcuts */
|
|
173
173
|
.container[data-v-99f7e295]{width:100%;}
|
|
174
174
|
@media (min-width: 640px){
|