import { Button, DatePicker, Divider, Form, Input, Select, Table } from 'antd'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; const { RangePicker } = DatePicker const dataSource = [ { key: '1', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '2', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '3', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '4', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '5', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '6', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, { key: '7', travelAdvisor: '骆梅玉', contactList: 'Giacomo Guilizzoni, Mike, Jerry...', important: '5', star: '9', ing: '3', }, ]; const SearchForm = memo(function ({ onSubmit }) { const [form] = Form.useForm() function handleSubmit(values) { onSubmit?.(values) } return (
) }) const SalesTable = function({formValues}) { const isMounted = useRef(false) const [salesData, setSalesData] = useState([]) const [loading, setLoading] = useState(false) useEffect(() => { setLoading(true) setTimeout(() => { const randomData = dataSource.map(data => { data.travelAdvisor = 'LYJ2024' + Math.floor(Math.random() * (100 - 2 + 1) + 2) data.important = Math.floor(Math.random() * (100 - 2 + 1) + 2) data.star = Math.floor(Math.random() * (100 - 2 + 1) + 2) data.ing = Math.floor(Math.random() * (100 - 2 + 1) + 2) return data }) setSalesData([...randomData]) setLoading(false) }, 1000) isMounted.current = true }, [formValues]) const columns = [ { title: '顾问', dataIndex: 'travelAdvisor', key: 'travelAdvisor', }, { title: '重点订单', dataIndex: 'important', key: 'important', }, { title: '潜力客户', dataIndex: 'star', key: 'star', }, { title: '成型', dataIndex: 'ing', key: 'ing', }, ] return ( {return `总数:${total}`} }} /> ) } function SalesManagement() { const [formValues, setFormValues] = useState({}) const handleSubmit = useCallback((values) => { setFormValues({...values}) }, []) return ( <> ) } export default SalesManagement