import React, { useState, useEffect } from "react"; import { PageHeaderWrapper } from "@ant-design/pro-layout"; import { Button, Card, Table, Row, message, Space, Typography, Divider, Switch, Upload } from "antd"; import usePagination from "@/hooks/usePagination"; import { evaDataDetailApi } from "../api"; import { UploadOutlined } from "@ant-design/icons"; import type { UploadProps } from "antd"; import useInitail from "@/hooks/useInitail"; import { createStore } from "@/hooks/moz"; import { common } from "@/typing/common"; import store from "./store"; import { isArray } from "lodash"; import moment from "moment"; import { ReasonsEnum } from "../entity"; import { history } from "umi"; import st from "./style.less"; const Column = Table.Column; export const { Provider, useStore } = createStore(store); interface Props extends common.ConnectProps {} function Index(props: Props) { const { setId, configId } = useStore(); const [delay, setDelay] = useState(true); const [newData, setNewData] = useState([]); const { match } = props; const { id, num } = match.params; useEffect(() => { setId(id); }, [id]); useEffect(() => { if (configId) { setParams({ id: configId }, true); setDelay(false); } }, [configId]); console.log('num', num); const { data, errMsg, setParams, loading } = useInitail(evaDataDetailApi, {}, {}, delay); console.log(isArray(data)); useEffect(() => { if (isArray(data)) { setNewData(data); } }, [data]); return ( `id${id}`} dataSource={newData} pagination={{ total: num }}> {name || "--"}} /> {name || "--"}} /> {name || "--"}} /> ( {num !== undefined ? `${num}${ record.dataType == 1 ? "台" : record.dataType == 2 ? "%" : record.dataType == 3 ? "元" : "" }` : "--"} )} /> (time ? moment(time).format("YYYY-MM-DD") : "--")} /> {/* ""} /> */} record.errorType ?
未导入
:
已导入
} /> (record.errorType ? ReasonsEnum[record.errorType] : "--")} />
); } export default (props: Props) => ( );