import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col, Tooltip } from 'antd';
import '@common/common.less';
import { useSelector } from 'react-redux'
import apiObj from '@api/index';
const { post, api, xPost } = apiObj;
const { Option } = Select;
function ExceptionLog() {
useEffect(() => {
getAbnormalLog();
}, []);
const [logList, setLogList] = useState([]);
const [total, setTotal] = useState(0);
const [size, setSize] = useState(15);
const [msvisible, setMsvisible] = useState(false);
const [tipText, setTipText] = useState('');
const [current, setCurrent] = useState(1);
const [params, setParams] = useState({
pages: 1,
current: 1,
size: 15
});
const [form] = Form.useForm();
let list = []
let data = {
pages: 1,
current: 1,
size: size,
}
//表格数据
function getAbnormalLog(param) {
post(api.getAbnormalLog, param || params).then((res) => {
if (res.data.code === 200) {
const data = res.data.data;
setLogList(data.records);
setTotal(data.total)
}
})
}
function onSizeChange(current, pageSize) {
params.current = current
params.size = pageSize
setSize(pageSize)
setCurrent(current)
setParams(params)
getAbnormalLog()
}
function changePage(page, pageSize) {
params.current = page
params.size = pageSize
setCurrent(page)
setParams(params)
getAbnormalLog()
}
function showModal(operationErrorInfo) {
setMsvisible(true)
setTipText(operationErrorInfo)
}
function handleOk() {
setMsvisible(false)
}
function handleCancel() {
setMsvisible(false)
}
const onFinish = (value) => {
const param = {
...data,
...value
}
setCurrent(1)
setParams(param)
getAbnormalLog(param);
};
const onReset = () => {
setCurrent(1)
setParams(data)
form.resetFields();
getAbnormalLog(data);
};
const columns = [
{ title: '编号', dataIndex: 'operationId', key: 'index' },
{ title: '请求URL', dataIndex: 'operationUrl', key: 'index' },
{ title: '请求方式', dataIndex: 'operationWay', key: 'index' },
{
title: '请求参数', key: 'index', render: (text, record) => (