diff --git a/SuperAdmin/app/dashboard/admins/page.tsx b/SuperAdmin/app/dashboard/admins/page.tsx index af272b9ae..51e80f716 100644 --- a/SuperAdmin/app/dashboard/admins/page.tsx +++ b/SuperAdmin/app/dashboard/admins/page.tsx @@ -21,46 +21,6 @@ import { AlertDialogTitle, } from "@/components/ui/alert-dialog" -// 保留原始示例数据,作为加载失败时的备用数据 -const adminsData = [ - { - id: "1", - account: "admin_zhang", - username: "张管理", - role: "超级管理员", - permissions: ["项目管理", "客户池", "管理员权限"], - createdAt: "2023-05-01", - lastLogin: "2023-06-28 09:15", - }, - { - id: "2", - account: "admin_li", - username: "李管理", - role: "项目管理员", - permissions: ["项目管理", "客户池"], - createdAt: "2023-05-10", - lastLogin: "2023-06-27 14:30", - }, - { - id: "3", - account: "admin_wang", - username: "王管理", - role: "客户管理员", - permissions: ["客户池"], - createdAt: "2023-05-15", - lastLogin: "2023-06-28 11:45", - }, - { - id: "4", - account: "admin_zhao", - username: "赵管理", - role: "项目管理员", - permissions: ["项目管理"], - createdAt: "2023-05-20", - lastLogin: "2023-06-26 16:20", - }, -] - export default function AdminsPage() { const [searchTerm, setSearchTerm] = useState("") const [isLoading, setIsLoading] = useState(true) @@ -95,14 +55,8 @@ export default function AdminsPage() { description: response.msg || "请稍后重试", variant: "destructive", }) - // 加载失败时显示示例数据 - setAdministrators(adminsData.map(admin => ({ - ...admin, - id: Number(admin.id), - name: admin.username, - status: 1 - }))) - setTotalCount(adminsData.length) + setAdministrators([]) + setTotalCount(0) } } catch (error) { console.error("获取管理员列表出错:", error) @@ -111,14 +65,8 @@ export default function AdminsPage() { description: "请检查网络连接后重试", variant: "destructive", }) - // 加载失败时显示示例数据 - setAdministrators(adminsData.map(admin => ({ - ...admin, - id: Number(admin.id), - name: admin.username, - status: 1 - }))) - setTotalCount(adminsData.length) + setAdministrators([]) + setTotalCount(0) } finally { setIsLoading(false) } diff --git a/SuperAdmin/app/dashboard/customers/page.tsx b/SuperAdmin/app/dashboard/customers/page.tsx index ee613e8fd..0fe327bd5 100644 --- a/SuperAdmin/app/dashboard/customers/page.tsx +++ b/SuperAdmin/app/dashboard/customers/page.tsx @@ -20,94 +20,6 @@ import { getTrafficPoolList } from "@/lib/traffic-pool-api" import { Customer } from "@/lib/traffic-pool-api" import { PaginationControls } from "@/components/ui/pagination-controls" -// Sample customer data -const customersData = [ - { - id: "1", - name: "张三", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "zhangsan123", - gender: "男", - region: "北京", - source: "微信搜索", - tags: ["潜在客户", "高消费"], - projectName: "电商平台项目", - addedDate: "2023-06-10", - }, - { - id: "2", - name: "李四", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "lisi456", - gender: "男", - region: "上海", - source: "朋友推荐", - tags: ["活跃用户"], - projectName: "社交媒体营销", - addedDate: "2023-06-12", - }, - { - id: "3", - name: "王五", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "wangwu789", - gender: "男", - region: "广州", - source: "广告点击", - tags: ["新用户"], - projectName: "企业官网推广", - addedDate: "2023-06-15", - }, - { - id: "4", - name: "赵六", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "zhaoliu321", - gender: "男", - region: "深圳", - source: "线下活动", - tags: ["高消费", "忠诚客户"], - projectName: "教育平台项目", - addedDate: "2023-06-18", - }, - { - id: "5", - name: "钱七", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "qianqi654", - gender: "女", - region: "成都", - source: "微信群", - tags: ["潜在客户"], - projectName: "金融服务推广", - addedDate: "2023-06-20", - }, - { - id: "6", - name: "孙八", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "sunba987", - gender: "女", - region: "武汉", - source: "微信搜索", - tags: ["活跃用户", "高消费"], - projectName: "电商平台项目", - addedDate: "2023-06-22", - }, - { - id: "7", - name: "周九", - avatar: "/placeholder.svg?height=40&width=40", - wechatId: "zhoujiu135", - gender: "女", - region: "杭州", - source: "朋友推荐", - tags: ["新用户"], - projectName: "社交媒体营销", - addedDate: "2023-06-25", - }, -] - export default function CustomersPage() { const [searchTerm, setSearchTerm] = useState("") const [selectedRegion, setSelectedRegion] = useState("") @@ -162,25 +74,6 @@ export default function CustomersPage() { setCurrentPage(1); // Reset to first page when page size changes }; - // Filter customers based on search and filters (兼容示例数据) - const filteredCustomers = customersData.filter((customer) => { - const matchesSearch = - customer.name.toLowerCase().includes(searchTerm.toLowerCase()) || - customer.wechatId.toLowerCase().includes(searchTerm.toLowerCase()) - - const matchesRegion = selectedRegion ? customer.region === selectedRegion : true - const matchesGender = selectedGender ? customer.gender === selectedGender : true - const matchesSource = selectedSource ? customer.source === selectedSource : true - const matchesProject = selectedProject ? customer.projectName === selectedProject : true - - return matchesSearch && matchesRegion && matchesGender && matchesSource && matchesProject - }) - - // Get unique values for filters - const regions = [...new Set(customersData.map((c) => c.region))] - const sources = [...new Set(customersData.map((c) => c.source))] - const projects = [...new Set(customersData.map((c) => c.projectName))] - return (
所属项目
+项目