import { useAjax } from "@/Hook/useAjax" import { getTaskV3LogListApi } from "@/services/adqV3" import { Button, Drawer, Space, Table, Tag } from "antd" import React, { useEffect, useState } from "react" import { columnsLog } from "./tableConfig" import DynamicLog from "./dynamicLog" interface Props { data: any visible?: boolean, onClose?: () => void } /** * 创建日志 * @returns */ const Log: React.FC = (props) => { /*****************************/ const { data, visible, onClose } = props const { id, taskName } = data const [queryForm, setQueryForm] = useState({ pageNum: 1, pageSize: 20 }) const getTaskV3LogList = useAjax((params) => getTaskV3LogListApi(params), { formatResult: true }) /*****************************/ useEffect(() => { getList() }, [queryForm, id]) /** 获取列表 */ const getList = () => { if (id) { getTaskV3LogList.run({ ...queryForm, taskId: id }) } } return {taskName + ' 日志'} } width={1400} placement="right" onClose={() => { onClose && onClose() }} visible={visible} > 总共{total}数据 }} onChange={(pagination) => { let { current, pageSize } = pagination let newQueryForm = JSON.parse(JSON.stringify(queryForm)) newQueryForm.pageNum = current newQueryForm.pageSize = pageSize setQueryForm(newQueryForm) }} expandable={{ expandedRowRender: record => }} /> } export default React.memo(Log)