refactor: 统一分页组件和UI优化

- 使用公共Pagination组件统一各页面的分页逻辑
- 优化exceptions页面异常列表展示
- 简化settings/rules页面规则管理
- 后端tasks.py增加分页参数支持
This commit is contained in:
freedakgmail
2026-07-07 13:53:54 +08:00
parent b93929eb1a
commit feebbb10ac
6 changed files with 101 additions and 92 deletions
@@ -1,10 +1,8 @@
"use client";
import { useState, useCallback } from "react";
import { useRouter } from "next/navigation";
import { motion } from "motion/react";
import {
ArrowLeft,
Trash2,
ToggleLeft,
ToggleRight,
@@ -93,7 +91,6 @@ const item = {
};
export default function RulesPage() {
const router = useRouter();
const toast = useToast();
const [rules, setRules] = useState<CompanyRuleResponse[]>(mockRules);
@@ -160,28 +157,19 @@ export default function RulesPage() {
const inactiveCount = rules.filter((r) => r.status === "INACTIVE").length;
return (
<div className="min-h-full p-6 lg:p-8 max-w-7xl mx-auto">
<div className="min-h-full p-6 lg:p-8 max-w-7xl mx-auto space-y-6">
{/* 页面头部 */}
<motion.div
initial={{ opacity: 0, y: -8 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4, ease: [0.16, 1, 0.3, 1] }}
className="flex items-center justify-between mb-8"
className="mb-8"
>
<div className="flex items-center gap-4">
<Button
variant="ghost"
size="icon"
onClick={() => router.push("/dashboard")}
>
<ArrowLeft className="w-5 h-5" />
</Button>
<div>
<h1 className="text-heading-1 text-foreground"></h1>
<p className="text-muted-foreground mt-1">
</p>
</div>
<div>
<h1 className="text-heading-1 text-foreground"></h1>
<p className="text-muted-foreground mt-1">
</p>
</div>
</motion.div>