客户查询添加操作功能

This commit is contained in:
Eamon
2026-04-09 17:08:59 +08:00
parent cc7e26561d
commit 790180a847
24 changed files with 2261 additions and 108 deletions

View File

@@ -4,18 +4,23 @@ import {
BarChart3,
ChevronsLeft,
ChevronsRight,
CircleDollarSign,
ClipboardList,
ClipboardMinus,
Code,
ComputerIcon,
ContactRound,
DollarSign,
FolderCode,
Home,
KeyRound,
type LucideIcon,
Package,
PackageSearch,
ScanSearch,
Shield,
ShoppingBag,
SquareActivity,
SquarePercent,
TicketPercent,
Users,
@@ -100,8 +105,6 @@ interface NavItemProps {
}
function NavItem({ href, icon: Icon, label, requiredScope }: NavItemProps) {
// console.log(requiredScope, "requiredScope")
const { collapsed, isActive } = useNavigation()
const active = isActive(href)
@@ -174,7 +177,7 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [
requiredScope: ScopeUserReadNotBind,
},
{
href: "/userQuery",
href: "/client/cust",
icon: ScanSearch,
label: "客户查询",
requiredScope: ScopeUserReadOne,
@@ -234,7 +237,7 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [
},
{
href: "/channel",
icon: Code,
icon: FolderCode,
label: "IP管理",
requiredScope: ScopeChannelRead,
},
@@ -269,9 +272,11 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [
export default function Navigation() {
const [collapsed, setCollapsed] = useState(false)
const pathname = usePathname()
const isActive = (path: string) => {
return path === "/" ? pathname === path : pathname.startsWith(path)
if (path === "/") {
return pathname === path
}
return pathname === path || pathname.startsWith(path + "/")
}
const contextValue: NavigationContextType = {
@@ -285,12 +290,12 @@ export default function Navigation() {
<NavigationContext.Provider value={contextValue}>
<aside
className={twJoin(
"bg-background border-r border-border transition-all duration-300 ease-in-out flex flex-col",
"bg-background border-r border-border transition-all duration-300 ease-in-out flex flex-col h-full",
collapsed ? "w-16" : "w-64",
)}
>
{/* Logo */}
<div className="h-16 flex items-center justify-center border-b border-border">
{/*Logo 区域 */}
<div className="h-16 flex items-center justify-center border-b border-border p-4 shrink-0">
{!collapsed ? (
<span className="text-xl font-bold tracking-wide text-foreground">
@@ -302,7 +307,7 @@ export default function Navigation() {
)}
</div>
{/* Navigation Menu */}
<ScrollArea className="flex-1 py-3">
<ScrollArea className="flex-1 py-3 overflow-hidden">
<nav className="space-y-3">
{menuSections.map((section, idx) => (
<div key={section.title}>
@@ -317,8 +322,7 @@ export default function Navigation() {
</nav>
</ScrollArea>
{/* Toggle Button */}
<div className="p-4 border-t border-border mt-auto">
<div className="p-4 border-t border-border mt-auto shrink-0">
<Button
variant="ghost"
onClick={() => setCollapsed(!collapsed)}