R32-1 R32-4 R33-2: 收口工作台交互与报销链路

这个提交包含在:
2026-03-24 20:26:22 +08:00
父节点 5aaa628d54
当前提交 1056c81940
共修改 20 个文件,包含 856 行新增和 141 行删除
+31 -1
查看文件
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import { Link, useLocation } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import { fetchNotifications } from "../../api/notifications";
@@ -58,6 +58,36 @@ export function Topbar() {
const unreadCount = unreadQuery.data?.unreadCount ?? 0;
const unreadBadge = unreadCount > 99 ? "99+" : String(unreadCount);
useEffect(() => {
const handleKeydown = (event: KeyboardEvent) => {
if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey) {
return;
}
if (event.key.toLowerCase() !== "k") {
return;
}
if (!window.matchMedia("(min-width: 768px)").matches) {
return;
}
const target = event.target;
if (target instanceof HTMLElement) {
const tagName = target.tagName.toLowerCase();
if (target.isContentEditable || tagName === "input" || tagName === "textarea" || tagName === "select") {
return;
}
}
event.preventDefault();
setSearchOpen(true);
};
window.addEventListener("keydown", handleKeydown);
return () => window.removeEventListener("keydown", handleKeydown);
}, []);
return (
<>
<header className="sticky top-0 z-10 border-b border-zinc-200/80 bg-white/90 px-4 py-4 backdrop-blur sm:px-8">