43 lines
1.0 KiB
TypeScript
Raw Normal View History

2026-01-27 15:21:16 +08:00
import { MyPageContainer } from '@/common';
2026-01-28 18:25:03 +08:00
import { useSearchParams } from '@umijs/max';
2026-01-08 16:35:06 +08:00
import type { TabsProps } from 'antd';
2026-01-27 17:47:57 +08:00
import { Tabs } from 'antd';
2026-01-08 16:35:06 +08:00
import { useEffect, useState } from 'react';
import IsVisited from './components/IsVisited';
import NoVisited from './components/NoVisited';
export default function Index({ title = '工单回访' }) {
const [searchParams] = useSearchParams();
const [activeKey, setActiveKey] = useState('1');
2026-01-28 18:25:03 +08:00
2026-01-27 15:21:16 +08:00
const items: TabsProps['items'] = [
{
2026-01-08 16:35:06 +08:00
key: 'NoVisited',
label: '未回访工单',
children: <NoVisited />,
},
2026-01-27 15:21:16 +08:00
{
2026-01-08 16:35:06 +08:00
key: 'IsVisited',
label: '已回访工单',
children: <IsVisited />,
},
2026-01-27 15:21:16 +08:00
];
2026-01-08 16:35:06 +08:00
useEffect(() => {
if (searchParams?.get('key')) {
setActiveKey(searchParams?.get('key') || '1');
}
}, []);
return (
<MyPageContainer
title={title}
enableTabs={true}
tabKey="visited"
tabLabel={title}
>
2026-01-27 17:47:57 +08:00
<Tabs defaultActiveKey={activeKey} items={items} type="card" />
2026-01-08 16:35:06 +08:00
</MyPageContainer>
);
}