import React, { useRef, useState } from 'react' import List from '@/components/Page/List' import { Button, Tag, Image } from 'antd' import { useNavigate } from 'react-router-dom' import { getTaPost, deleteTaPost } from "@/services/taPost"; export default (props) => { const actionRef = useRef(); const navigate = useNavigate(); const columns = [ { title: '标题', dataIndex: 'title', ellipsis: true, }, { title: '描述', dataIndex: 'describe', ellipsis: true, search: false, }, { title: '正文', dataIndex: 'content', render: (_, it) =>
, search: false, }, { title: '图片', dataIndex: 'images', render: (_, it) => it?.images ? : null, search: false, }, // { // title: '横向封面', // dataIndex: 'coverHorizontal', // render: (_, it) => it?.coverHorizontal ? : null, // search: false, // }, // { // title: '纵向封面', // dataIndex: 'coverVertical', // render: (_, it) => it?.coverVertical ? : null, // search: false, // }, { title: '标签', dataIndex: 'tags', search: false, render: (_, it) => it?.tags ? JSON.parse(it?.tags).map(it => {it}) : null }, { title: '作者', dataIndex: 'author' }, { title: '链接', dataIndex: 'link', ellipsis: true, render: (_, it) =>
{it?.link}
, search: false, }, // { // title: '附件', // dataIndex: 'attachment', // search: false, // } ] const onEdit = (it) => { navigate(`/article/edit?id=${it.postId}`) } const onDelete = (it) => { deleteTaPost(it.postId).then(res => { actionRef.current.reload(); }) } const onDetail = (it) => { navigate(`/article/detail?id=${it.postId}`) } return ( [ ]} /> ) }