import { useAjax } from "@/Hook/useAjax" import { getSelectAdTaskLogListApi } from "@/services/adqV3" import { Button, Modal, Space, Table, Tag } from "antd" import React, { useEffect, useState } from "react" import { columnsExecuteLog } from "./tableConfig" interface Props { data: any visible?: boolean, onClose?: () => void } /** * 任务执行记录 * @param param0 * @returns */ const ExecuteLog: React.FC = ({ data, visible, onClose }) => { /*************************************/ const { id, taskName } = data const [queryForm, setQueryForm] = useState({ pageNum: 1, pageSize: 20 }) const getSelectAdTaskLogList = useAjax((params) => getSelectAdTaskLogListApi(params), { formatResult: true }) /*************************************/ useEffect(() => { getList() }, [queryForm, id]) /** 获取列表 */ const getList = () => { if (id) { getSelectAdTaskLogList.run({ ...queryForm, taskId: id }) } } return {taskName + ' 执行记录'} } className="modalResetCss" open={visible} width={750} onCancel={onClose} footer={null} > 总共{total}数据 }} onChange={(pagination) => { let { current, pageSize } = pagination let newQueryForm = JSON.parse(JSON.stringify(queryForm)) newQueryForm.pageNum = current newQueryForm.pageSize = pageSize setQueryForm(newQueryForm) }} /> } export default React.memo(ExecuteLog)