feat: Initialize AI Studio project structure
Sets up the basic project files and dependencies for an AI Studio application. Includes README, `.env.example`, `.gitignore`, basic HTML structure, metadata, `package.json`, Vite configuration, and initial React component setup. This commit provides the foundation for running and deploying the AI Studio app locally.
This commit is contained in:
105
src/components/views/UsersView.tsx
Normal file
105
src/components/views/UsersView.tsx
Normal file
@@ -0,0 +1,105 @@
|
||||
import React from 'react';
|
||||
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend, BarChart, Bar, Cell } from 'recharts';
|
||||
import { StatCard } from '../ui/StatCard';
|
||||
import { Users, Truck, Smartphone } from 'lucide-react';
|
||||
|
||||
const driverGrowth = [
|
||||
{ date: '4/18', 活跃APP: 57, 绑定车辆: 114 },
|
||||
{ date: '4/19', 活跃APP: 57, 绑定车辆: 114 },
|
||||
{ date: '4/20', 活跃APP: 58, 绑定车辆: 114 },
|
||||
{ date: '4/21', 活跃APP: 59, 绑定车辆: 117 },
|
||||
{ date: '4/22', 活跃APP: 61, 绑定车辆: 121 },
|
||||
{ date: '4/23', 活跃APP: 74, 绑定车辆: 128 },
|
||||
{ date: '4/24', 活跃APP: 82, 绑定车辆: 135 },
|
||||
{ date: '4/25', 活跃APP: 84, 绑定车辆: 139 },
|
||||
{ date: '4/26', 活跃APP: 86, 绑定车辆: 139 },
|
||||
{ date: '4/27', 活跃APP: 89, 绑定车辆: 140 },
|
||||
{ date: '4/28', 活跃APP: 91, 绑定车辆: 141 },
|
||||
{ date: '4/29', 活跃APP: 93, 绑定车辆: 142 },
|
||||
];
|
||||
|
||||
const driverByStation = [
|
||||
{ name: '如皋华神', value: 40 },
|
||||
{ name: '嘉兴嘉燃', value: 32 },
|
||||
{ name: '嘉兴嘉锦', value: 32 },
|
||||
{ name: '桐乡绿能', value: 4 },
|
||||
{ name: '花桥/嘉善等', value: 7 },
|
||||
];
|
||||
|
||||
export function UsersView() {
|
||||
return (
|
||||
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500">
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-6">
|
||||
<StatCard
|
||||
title="累计入池APP用户总数"
|
||||
value="93 人"
|
||||
subValue="近期活跃司机达到45人"
|
||||
icon={Smartphone}
|
||||
highlight
|
||||
/>
|
||||
<StatCard
|
||||
title="累计绑定车辆司机总数"
|
||||
value="142 人"
|
||||
subValue="系统全量历史转化留存"
|
||||
icon={Truck}
|
||||
/>
|
||||
<StatCard
|
||||
title="总核验车辆绑定率"
|
||||
value="95 %"
|
||||
subValue="公司自营与核心车队"
|
||||
icon={Users}
|
||||
trend={5}
|
||||
/>
|
||||
<StatCard
|
||||
title="本周最佳外拓来源区"
|
||||
value="长三角外围"
|
||||
subValue="如皋及花桥累计贡献非标散户6个"
|
||||
icon={Users}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<div className="bg-white rounded-xl border border-slate-100 p-6 shadow-sm">
|
||||
<div className="mb-6">
|
||||
<h3 className="text-lg font-bold text-slate-800">平台APP渗透与车辆绑定追踪</h3>
|
||||
<p className="text-sm text-slate-500 mt-1">实时记录系统端用户量与车辆规模的扩充</p>
|
||||
</div>
|
||||
<div className="h-[300px]">
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<LineChart data={driverGrowth} margin={{ top: 10, right: 10, left: -25, bottom: 0 }}>
|
||||
<CartesianGrid vertical={false} stroke="#f1f5f9" strokeDasharray="3 3"/>
|
||||
<XAxis dataKey="date" axisLine={false} tickLine={false} tick={{fill: '#64748b', fontSize: 12}} dy={10} />
|
||||
<YAxis axisLine={false} tickLine={false} tick={{fill: '#64748b', fontSize: 12}} />
|
||||
<Tooltip cursor={{stroke: '#e2e8f0', strokeWidth: 2}} contentStyle={{ borderRadius: '12px', border: '1px solid #e2e8f0' }}/>
|
||||
<Legend verticalAlign="top" height={36} iconType="circle" wrapperStyle={{ fontSize: '12px' }} />
|
||||
<Line type="monotone" dataKey="绑定车辆" stroke="#6366f1" strokeWidth={3} dot={{r: 4}} activeDot={{r: 6}} />
|
||||
<Line type="monotone" dataKey="活跃APP" stroke="#14b8a6" strokeWidth={3} dot={{r: 4}} activeDot={{r: 6}} />
|
||||
</LineChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-white rounded-xl border border-slate-100 p-6 shadow-sm">
|
||||
<div className="mb-6">
|
||||
<h3 className="text-lg font-bold text-slate-800">全站存量司机资源池分布</h3>
|
||||
<p className="text-sm text-slate-500 mt-1">外拓下沉能力强劲,多区域司机基数稳步建立</p>
|
||||
</div>
|
||||
<div className="h-[300px]">
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<BarChart data={driverByStation} layout="vertical" margin={{ top: 0, right: 30, left: 20, bottom: 0 }}>
|
||||
<XAxis type="number" hide />
|
||||
<YAxis dataKey="name" type="category" axisLine={false} tickLine={false} tick={{fill: '#475569', fontSize: 12, fontWeight: 500}} width={80} />
|
||||
<Tooltip cursor={{fill: '#f8fafc'}} contentStyle={{ borderRadius: '12px', border: '1px solid #e2e8f0' }}/>
|
||||
<Bar dataKey="value" radius={[0, 6, 6, 0]} barSize={28}>
|
||||
{driverByStation.map((entry, index) => (
|
||||
<Cell key={`cell-${index}`} fill={index === 0 ? '#f59e0b' : '#94a3b8'} />
|
||||
))}
|
||||
</Bar>
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user