feat: 订单双视图、工作台日历组件、医生排班管理与挂号语音提醒
- 订单双视图:商品订单/处方/挂号列表新增卡片视图(CardList)、视图切换组件 view-mode-switch、stat-islands 统计岛、constants 字典 - 工作台:新增工作日历 Widget、待办日历、即将到访预约、公告滚动 NoticeTicker、日历面板 CalendarPanel - 医生排班:新增排班 API、ScheduleDrawer 抽屉、schedule-calendar 组件、门店设置弹窗 - 日志与通知:新增排班变更日志页、排班变更通知视图 - 挂号提醒:新增挂号语音播报资源与 register-notify 工具 - 桌面端:新增 apps/desktop 壳及 desktop 工具方法 - 其他:处方/订单导出、聊天设置与 WebSocket 等小幅优化
This commit is contained in:
@@ -26,6 +26,7 @@ import DoctorTransferFloat from '#/components/doctor-transfer-float/DoctorTransf
|
||||
import HeaderVipBadge from '#/components/vip/HeaderVipBadge.vue';
|
||||
import SwitchAccountModal from '#/layouts/components/SwitchAccountModal.vue';
|
||||
import { useAuthStore } from '#/store';
|
||||
import { desktop, isElectron } from '#/util/desktop';
|
||||
import { formatTimeToRelative } from '#/util/tool';
|
||||
import LoginForm from '#/views/_core/authentication/login.vue';
|
||||
import NoticeActionHost from '#/views/notice/action/NoticeActionHost.vue';
|
||||
@@ -62,6 +63,15 @@ const getNoticeList = async () => {
|
||||
description: `您有 ${items.length} 条未读消息请注意查收`,
|
||||
duration: 5,
|
||||
});
|
||||
// 桌面端且窗口未聚焦时补发系统通知(页内 Toast 此时用户看不到),点击跳消息中心
|
||||
if (isElectron() && !document.hasFocus()) {
|
||||
desktop.notify({
|
||||
title: '您有新消息',
|
||||
body: `您有 ${items.length} 条未读消息请注意查收`,
|
||||
route: '/notice/list',
|
||||
});
|
||||
desktop.flashFrame();
|
||||
}
|
||||
}
|
||||
notifications.value = items.map((item: any) => {
|
||||
const color = resolveNoticeColor(item.type_color);
|
||||
@@ -122,11 +132,35 @@ localStorage.setItem = (key, value) => {
|
||||
window.addEventListener('storage', handleStorageChange);
|
||||
const stopRefreshListen = onNoticeRefresh(() => restartInterval());
|
||||
|
||||
// 桌面端:未读数变化同步任务栏/Dock 角标(浏览器环境 no-op)
|
||||
watch(unreadCount, (count) => desktop.setBadge(count));
|
||||
|
||||
// 桌面端:系统通知点击后主进程回传目标路由,这里执行实际跳转
|
||||
desktop.onNavigate((route) => {
|
||||
router.push(route);
|
||||
});
|
||||
|
||||
// 桌面端:自动更新事件轻量提示(下载完成后的安装确认由主进程弹窗负责)
|
||||
desktop.onUpdateEvent((payload) => {
|
||||
if (payload.type === 'available') {
|
||||
const version = (payload.data as { version?: string })?.version;
|
||||
notification.info({
|
||||
message: '发现新版本',
|
||||
description: `新版本 ${version ? `v${version} ` : ''}正在后台下载,完成后将提示安装`,
|
||||
duration: 5,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(intervalId);
|
||||
window.removeEventListener('storage', handleStorageChange);
|
||||
localStorage.setItem = originalSetItem;
|
||||
stopRefreshListen();
|
||||
// 布局卸载(登出)时清空桌面角标,避免残留未读数
|
||||
desktop.setBadge(0);
|
||||
// 解绑系统通知跳转回调,避免登出后点击残留通知仍对已登出会话执行 router.push
|
||||
desktop.offNavigate();
|
||||
});
|
||||
|
||||
const goNoticeList = () => {
|
||||
|
||||
Reference in New Issue
Block a user