根据需求更新首页驾驶舱

This commit is contained in:
xianyi
2025-12-16 17:33:10 +08:00
parent 564c80d63a
commit 5641279095
3 changed files with 15 additions and 14 deletions

View File

@@ -10,17 +10,17 @@ export const HomeSection = () => {
const [homeStats, setHomeStats] = useState<HomeStatItem[]>([
{ label: '今日预约', value: 0 },
{ label: '签到人数', value: 0 },
{ label: '在检人数', value: 0 },
{ label: '打印导检单', value: 0 },
{ label: '在检人数', value: 0 },
{ label: '已完成人数', value: 0 },
]);
const [revenueStats, setRevenueStats] = useState<RevenueStatItem[]>([
{ label: '体检收入', value: '¥ 0' },
{ label: '加项收入', value: '¥ 0' },
{ label: '整体收入', value: '¥ 0' },
{ label: '目标收入', value: '¥ 0' },
{ label: '当日目标', value: '¥ 0' },
{ label: '完成百分比', value: '0%' },
{ label: '缺口', value: '¥ 0' },
{ label: '当日缺口', value: '¥ 0' },
]);
const currencyFormatter = useMemo(() => new Intl.NumberFormat('zh-CN', {
@@ -37,8 +37,8 @@ export const HomeSection = () => {
setHomeStats([
{ label: '今日预约', value: Number(d?.today_appointment_count ?? 0) },
{ label: '签到人数', value: Number(d?.today_signin_count ?? 0) },
{ label: '在检人数', value: Number(d?.today_in_exam_count ?? 0) },
{ label: '打印导检单', value: Number(d?.today_print_guide_count ?? 0) },
{ label: '在检人数', value: Number(d?.today_in_exam_count ?? 0) },
{ label: '已完成人数', value: Number(d?.today_completed_count ?? 0) },
]);
})
@@ -56,9 +56,9 @@ export const HomeSection = () => {
{ label: '体检收入', value: fmt(d?.physical_exam_income) },
{ label: '加项收入', value: fmt(d?.add_item_income) },
{ label: '整体收入', value: fmt(d?.total_income) },
{ label: '目标收入', value: fmt(d?.target_income) },
{ label: '当日目标', value: fmt(d?.target_income) },
{ label: '完成百分比', value: d?.completion_percentage ?? '0%' },
{ label: '缺口', value: fmt(d?.gap_amount) },
{ label: '当日缺口', value: fmt(d?.gap_amount) },
]);
})
.catch((err) => {
@@ -80,7 +80,7 @@ export const HomeSection = () => {
</Card>
<Card>
<CardHeader></CardHeader>
<CardHeader></CardHeader>
<CardContent>
<div className='grid grid-cols-3 gap-3'>
{revenueStats.map(({ label, value }) => (
@@ -95,9 +95,9 @@ export const HomeSection = () => {
<CardHeader>B1 </CardHeader>
<CardContent>
<div className='grid grid-cols-3 gap-3 mb-3'>
<InfoCard label='当前客户总数' value={B1_SUMMARY.totalClients} />
<InfoCard label='客户总数' value={B1_SUMMARY.totalClients} />
<InfoCard label='待检人数' value={B1_SUMMARY.waiting} />
<InfoCard label='检人数' value={B1_SUMMARY.inExam} />
<InfoCard label='检人数' value={B1_SUMMARY.inExam} />
</div>
<table className='w-full text-xs'>
<thead>
@@ -148,6 +148,7 @@ export const HomeSection = () => {
<th className='py-2 text-left'></th>
<th className='py-2 text-right'></th>
<th className='py-2 text-right'></th>
<th className='py-2 text-right'></th>
</tr>
</thead>
<tbody>
@@ -156,6 +157,7 @@ export const HomeSection = () => {
<td className='py-2'>{name}</td>
<td className='py-2 text-right'>{total}</td>
<td className='py-2 text-right'>{consult}</td>
<td className='py-2 text-right'>{((Number(consult) / Number(total)) * 100).toFixed(2)}%</td>
</tr>
))}
</tbody>

View File

@@ -26,7 +26,7 @@ export const Sidebar = ({ active, onNavigate, onQuickAction }: SidebarProps) =>
<aside className='bg-white border-r p-4 flex flex-col gap-4'>
<div>
<div className='text-base font-semibold'> · </div>
<div className='text-xs text-gray-500 mt-1'>iPad </div>
<div className='text-xs text-gray-500 mt-1'></div>
</div>
<nav className='space-y-1'>

View File

@@ -1,4 +1,3 @@
import { Input } from '../ui';
interface TopBarProps {
search: string;
@@ -12,13 +11,13 @@ export const TopBar = ({ search, onSearch, enableSearch = true, operatorName, on
<header className='flex items-center gap-3 p-2 border-b bg-white'>
<div className='flex-1 flex items-center gap-3'>
{enableSearch ? (
<div className='w-[420px] max-w-[60vw] flex items-center'>
<Input
<div className='w-[420px] max-w-[60vw] h-[36px] flex items-center'>
{/* <Input
placeholder='搜索 姓名 / 证件号 / 手机号'
value={search}
onChange={(e) => onSearch(e.target.value)}
className='text-sm'
/>
/> */}
</div>
) : (
<div className='text-sm text-gray-500 flex items-center p-[9px] pl-[14px]'> · </div>