import { history, Link } from 'umi'; import { useRef } from 'react'; import { Button, Modal, message, Popconfirm, Tooltip } from 'antd'; import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { PageHeaderWrapper } from '@ant-design/pro-layout'; import ProTable, { TableDropdown } from '@ant-design/pro-table'; export default (props) => { const dataSource = [ { id: 9, key: '1', name: '胡彦斌', age: 32, zz: '西湖区湖底公园1号', }, ]; // 测试内容👆------------------------- const actionRef = useRef(); const gotoDetail = (id) => { history.push(`InformationList/InformationListEdit`); }; const handleDelete = (e) => { deleteNote(e.noteId).then((res) => { message.success('删除成功'); actionRef.current.reload(); }); }; const actions = () => [ , ]; const columns = [ { title: '分类名', key: 'typeName', dataIndex: 'typeName', search: false, }, { title: '资讯标题', dataIndex: 'title', key: 'title', search: false, }, { title: '封面', key: 'thumb', dataIndex: 'thumb', search: false, render: (t) => , }, { title: ( <> 创建时间 ), // hideInTable: true, search: false, key: 'createdAt', dataIndex: 'createdAt', valueType: 'date', // render: (t) => formatterTime(t), sorter: (a, b) => a.createdAt - b.createdAt, //时间排序 }, { title: '状态', dataIndex: 'status', // initialValue: 'all', key: 'status', valueEnum: { 0: { text: '已发布', status: 'Success' }, 1: { text: '未发布', status: 'Error' }, }, }, { title: '操作', valueType: 'option', key: 'option', ellipsis: true, width: 200, render: (_, record) => [ 编辑 , handleDelete(record)} okText="确定" cancelText="取消" > 删除 , ], }, ]; return ( ); };