import { formatDate } from '@/utils/date'; import { DeleteOutlined, MinusSquareOutlined, PlusOutlined, } from '@ant-design/icons'; import { Card, Col, FloatButton, Popconfirm, Row } from 'antd'; import { useCallback, useEffect } from 'react'; import { useDispatch, useNavigate, useSelector } from 'umi'; import styles from './index.less'; const Knowledge = () => { const dispatch = useDispatch(); const knowledgeModel = useSelector((state: any) => state.knowledgeModel); const navigate = useNavigate(); const { data = [] } = knowledgeModel; const fetchList = useCallback(() => { dispatch({ type: 'knowledgeModel/getList', payload: {}, }); }, []); const confirm = (id: string) => { dispatch({ type: 'knowledgeModel/rmKb', payload: { kb_id: id, }, }); }; const handleAddKnowledge = () => { navigate(`add/setting?activeKey=setting`); }; const handleEditKnowledge = (id: string) => { navigate(`add/setting?activeKey=file&id=${id}`); }; useEffect(() => { fetchList(); }, [fetchList]); return ( <>