From d981e53330db03a04a99ee31d0c76c6fd068f663 Mon Sep 17 00:00:00 2001 From: luishou Date: Sat, 29 Aug 2026 21:55:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E9=80=82=E9=85=8D=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E5=B8=83=E5=B1=80=E4=B8=8E=E8=A7=A6=E6=8E=A7?= =?UTF-8?q?=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 窄屏改用抽屉导航和卡片列表,加大触控区域并处理安全区,避免表格横向溢出。 Co-authored-by: Cursor --- package-lock.json | 1 + .../customers/birthday/birthday-control.tsx | 10 +- .../(dashboard)/customers/birthday/page.tsx | 50 +++++++- .../(dashboard)/customers/customer-form.tsx | 2 +- .../customers/customer-toolbar.tsx | 46 +++---- .../(dashboard)/customers/customer-view.tsx | 19 +-- src/app/(dashboard)/customers/page.tsx | 74 ++++++++++- src/app/(dashboard)/layout.tsx | 8 +- src/app/(dashboard)/me/me-forms.tsx | 4 +- src/app/(dashboard)/me/page.tsx | 6 +- src/app/(dashboard)/page.tsx | 104 ++++++++++------ .../(dashboard)/rbac/admins/admin-form.tsx | 2 +- src/app/(dashboard)/rbac/admins/page.tsx | 41 ++++++- src/app/(dashboard)/rbac/permissions/page.tsx | 28 ++++- .../rbac/permissions/permission-form.tsx | 8 +- .../[id]/permissions/assign-permissions.tsx | 18 +-- src/app/(dashboard)/rbac/roles/page.tsx | 37 +++++- src/app/(dashboard)/rbac/roles/role-form.tsx | 2 +- src/app/(dashboard)/report-chart.tsx | 11 +- src/app/globals.css | 12 ++ src/app/layout.tsx | 9 +- src/app/login/page.tsx | 2 +- src/components/app/sidebar-context.tsx | 52 ++++++-- src/components/app/sidebar.tsx | 115 ++++++++++-------- src/components/app/topbar.tsx | 34 ++++-- src/components/ui/button.tsx | 10 +- src/components/ui/card.tsx | 6 +- src/components/ui/input.tsx | 2 +- src/components/ui/table.tsx | 8 +- 29 files changed, 519 insertions(+), 202 deletions(-) diff --git a/package-lock.json b/package-lock.json index df6c581..7bdb10a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "crm-new", "version": "0.1.0", + "hasInstallScript": true, "dependencies": { "@prisma/client": "^6.11.0", "bcryptjs": "^2.4.3", diff --git a/src/app/(dashboard)/customers/birthday/birthday-control.tsx b/src/app/(dashboard)/customers/birthday/birthday-control.tsx index a08827f..0e0a67a 100644 --- a/src/app/(dashboard)/customers/birthday/birthday-control.tsx +++ b/src/app/(dashboard)/customers/birthday/birthday-control.tsx @@ -22,17 +22,19 @@ export function BirthdayControl({ } return ( -
+
@@ -41,7 +43,7 @@ export function BirthdayControl({ type="date" defaultValue={date} onChange={(e) => go({ date: e.target.value })} - className="w-40" + className="w-full sm:w-40" /> (不填默认今天) diff --git a/src/app/(dashboard)/customers/birthday/page.tsx b/src/app/(dashboard)/customers/birthday/page.tsx index 0c0d5fd..1ac25af 100644 --- a/src/app/(dashboard)/customers/birthday/page.tsx +++ b/src/app/(dashboard)/customers/birthday/page.tsx @@ -76,14 +76,14 @@ export default async function BirthdayPage({ return (
- + -
+
命中 {rows.length} 位商户
- + @@ -131,6 +131,50 @@ export default async function BirthdayPage({
+ +
+ {rows.length === 0 && ( + + 该时段暂无生日商户 + + )} + {rows.map((c) => { + const ownerName = c.birthdayOwner === 1 ? c.balanceUser : c.contacts; + const ownerPhone = + (c.birthdayOwner === 1 ? c.balanceUserPhone : c.contactsPhone) || c.phone; + return ( + +
+
+
{c.customerName}
+
+ {c.salesman || "—"} +
+
+ + {c.birthdayType === 2 ? "农历" : "阳历"} + +
+
+
+
归属人
+
{ownerName || "—"}
+
+ {superAdmin ? ownerPhone : maskPhone(ownerPhone)} +
+
+
+
生日
+
{fmtDate(c.birthday)}
+
+ {c.birthdayOwner === 1 ? "结算人" : "联系人"} +
+
+
+
+ ); + })} +
); } diff --git a/src/app/(dashboard)/customers/customer-form.tsx b/src/app/(dashboard)/customers/customer-form.tsx index f573200..dd11918 100644 --- a/src/app/(dashboard)/customers/customer-form.tsx +++ b/src/app/(dashboard)/customers/customer-form.tsx @@ -202,7 +202,7 @@ export function CustomerForm({

)} -
+
diff --git a/src/app/(dashboard)/customers/customer-toolbar.tsx b/src/app/(dashboard)/customers/customer-toolbar.tsx index e5647a0..71f9c1d 100644 --- a/src/app/(dashboard)/customers/customer-toolbar.tsx +++ b/src/app/(dashboard)/customers/customer-toolbar.tsx @@ -1,6 +1,6 @@ "use client"; -import { useRef, useState, useTransition } from "react"; +import { useRef, useTransition } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { Plus, Upload, Download, Search, RotateCcw } from "lucide-react"; @@ -78,50 +78,54 @@ export function CustomerToolbar({ } return ( - -
-
+ + +
- - ~ - - - +
+ + ~ + +
+
+ + +
-
+
- - {canExport && ( - - )} - - diff --git a/src/app/(dashboard)/customers/customer-view.tsx b/src/app/(dashboard)/customers/customer-view.tsx index 3314c50..8276ea5 100644 --- a/src/app/(dashboard)/customers/customer-view.tsx +++ b/src/app/(dashboard)/customers/customer-view.tsx @@ -4,7 +4,7 @@ import { useEffect, useState, type ReactNode } from "react"; import { Eye, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { fmtDate } from "@/lib/utils"; +import { fmtDate, cn } from "@/lib/utils"; type CustomerViewProps = { customer: { @@ -35,7 +35,12 @@ export function CustomerView({ customer }: CustomerViewProps) { if (e.key === "Escape") setOpen(false); }; window.addEventListener("keydown", handleEsc); - return () => window.removeEventListener("keydown", handleEsc); + const prev = document.body.style.overflow; + document.body.style.overflow = "hidden"; + return () => { + window.removeEventListener("keydown", handleEsc); + document.body.style.overflow = prev; + }; }, [open]); const birthdayLabel = customer.birthdayType === 2 ? "阴历" : "阳历"; @@ -56,11 +61,11 @@ export function CustomerView({ customer }: CustomerViewProps) { {open && (
setOpen(false)} > e.stopPropagation()} > @@ -69,7 +74,7 @@ export function CustomerView({ customer }: CustomerViewProps) {