从旧 Laravel 5.7 重构为现代技术栈,对接现有 MySQL。 - 技术栈: Next.js 15 App Router + TypeScript + Prisma + Auth.js + Tailwind v4 - 认证: 复用旧库 admins 的 bcrypt 密码,Auth.js Credentials - 客户管理: 列表(搜索/报单区间/分页)、增改删、Excel 导入导出 - 生日提醒: 阴阳历(lunar-typescript),口径对齐旧 overtrue 库 - RBAC: 管理员/角色/权限(菜单树) 完整 CRUD + 分配 - 控制台: 统计卡 + 月度新增报单柱状图 - 个人中心: 改昵称/改密码 - 现代 CMS 界面 + 联动支付品牌(logo/登录/底部/icon) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import * as React from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const fieldCls =
|
|
"flex h-9 w-full rounded-[var(--radius)] border bg-[var(--color-surface)] px-3 text-sm shadow-sm transition-colors placeholder:text-[var(--color-muted-foreground)] focus-visible:outline-none focus-visible:border-[var(--color-primary)] focus-visible:ring-2 focus-visible:ring-[var(--color-ring)] disabled:cursor-not-allowed disabled:opacity-50";
|
|
|
|
export const Input = React.forwardRef<
|
|
HTMLInputElement,
|
|
React.InputHTMLAttributes<HTMLInputElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<input ref={ref} className={cn(fieldCls, className)} {...props} />
|
|
));
|
|
Input.displayName = "Input";
|
|
|
|
export const Textarea = React.forwardRef<
|
|
HTMLTextAreaElement,
|
|
React.TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
>(({ className, ...props }, ref) => (
|
|
<textarea
|
|
ref={ref}
|
|
className={cn(fieldCls, "h-auto min-h-[76px] py-2 leading-relaxed", className)}
|
|
{...props}
|
|
/>
|
|
));
|
|
Textarea.displayName = "Textarea";
|
|
|
|
export const Select = React.forwardRef<
|
|
HTMLSelectElement,
|
|
React.SelectHTMLAttributes<HTMLSelectElement>
|
|
>(({ className, children, ...props }, ref) => (
|
|
<select ref={ref} className={cn(fieldCls, "pr-8", className)} {...props}>
|
|
{children}
|
|
</select>
|
|
));
|
|
Select.displayName = "Select";
|