Commit 892c8db9 authored by 陈前坚's avatar 陈前坚

perf: 运维痕迹

parent 78090608
Pipeline #21405 skipped with stages
...@@ -16,7 +16,7 @@ import moment from 'moment'; ...@@ -16,7 +16,7 @@ import moment from 'moment';
import { post, PUBLISH_SERVICE } from '@/services/index'; import { post, PUBLISH_SERVICE } from '@/services/index';
import styles from './index.less'; import styles from './index.less';
const ServiceLog = () => { const LoginLog = () => {
const [loading, setLoading] = useState(false); // 源数据 const [loading, setLoading] = useState(false); // 源数据
const [data0, setData0] = useState([]); // 源数据 const [data0, setData0] = useState([]); // 源数据
const [LoginNameFilters, setLoginNameFilters] = useState([]); // 用户列筛选 const [LoginNameFilters, setLoginNameFilters] = useState([]); // 用户列筛选
...@@ -76,8 +76,6 @@ const ServiceLog = () => { ...@@ -76,8 +76,6 @@ const ServiceLog = () => {
}, [startTime, endTime]); }, [startTime, endTime]);
const getData = () => { const getData = () => {
post(`${PUBLISH_SERVICE}/LogCenter/GetLoginLog`, { post(`${PUBLISH_SERVICE}/LogCenter/GetLoginLog`, {
PageIndex: 1,
PageSize: 1000,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'), DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'), DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '', IP: '',
...@@ -88,17 +86,17 @@ const ServiceLog = () => { ...@@ -88,17 +86,17 @@ const ServiceLog = () => {
}) })
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
setData0(res.data.list); setData0(res.data);
// 过滤LoginName // 过滤LoginName
let arr1 = res.data.list.map(item => item.LoginName); let arr1 = res.data.map(item => item.LoginName);
arr1 = arr1.filter((value, index) => arr1.indexOf(value) === index); arr1 = arr1.filter((value, index) => arr1.indexOf(value) === index);
setLoginNameFilters(arr1.map(item => ({ text: item, value: item }))); setLoginNameFilters(arr1.map(item => ({ text: item, value: item })));
// 过滤ShowName // 过滤ShowName
let arr2 = res.data.list.map(item => item.ShowName); let arr2 = res.data.map(item => item.ShowName);
arr2 = arr2.filter((value, index) => arr2.indexOf(value) === index); arr2 = arr2.filter((value, index) => arr2.indexOf(value) === index);
setShowNameFilters(arr2.map(item => ({ text: item, value: item }))); setShowNameFilters(arr2.map(item => ({ text: item, value: item })));
// 过滤系统类型SystemType // 过滤系统类型SystemType
let arr3 = res.data.list.map(item => item.SystemType); let arr3 = res.data.map(item => item.SystemType);
arr3 = arr3.filter((value, index) => arr3.indexOf(value) === index); arr3 = arr3.filter((value, index) => arr3.indexOf(value) === index);
setSystemTypeFilters(arr3.map(item => ({ text: item, value: item }))); setSystemTypeFilters(arr3.map(item => ({ text: item, value: item })));
} else { } else {
...@@ -114,30 +112,6 @@ const ServiceLog = () => { ...@@ -114,30 +112,6 @@ const ServiceLog = () => {
setLoading(false); setLoading(false);
}); });
}; };
// const dataTransforrm = data => {
// data.map((item, index) => {
// item.key = index;
// return item;
// });
// const dv1 = new DataSet.View().source(data);
// dv1
// .transform({
// type: 'aggregate', // 别名summary
// fields: ['IP'], // 统计字段集
// operations: ['count'], // 统计操作集
// as: ['计数'], // 存储字段集
// groupBy: ['IP'], // 分组字段集
// })
// .transform({
// type: 'sort-by',
// fields: ['计数'], // 根据指定的字段集进行排序,与lodash的sortBy行为一致
// order: 'DESC', // 默认为 ASC,DESC 则为逆序
// });
// console.log(dv1.rows);
// setIPCount(dv1.rows.slice(0, 20));
// };
// DatePicker改变点击确定时 // DatePicker改变点击确定时
const changeStartTime = time => { const changeStartTime = time => {
setStartTime(time); setStartTime(time);
...@@ -170,7 +144,7 @@ const ServiceLog = () => { ...@@ -170,7 +144,7 @@ const ServiceLog = () => {
onChange={changeStartTime} onChange={changeStartTime}
allowClear={false} allowClear={false}
/> />
<SwapRightOutlined style={{ lineHeight: 2 }} /> <SwapRightOutlined style={{ verticalAlign: '0.125em' }} />
<DatePicker <DatePicker
showTime showTime
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
...@@ -189,27 +163,6 @@ const ServiceLog = () => { ...@@ -189,27 +163,6 @@ const ServiceLog = () => {
</Col> </Col>
</Row> </Row>
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
{/* <Row className={styles.chart}>
<Col span={12}>
<Chart
height={316}
width={400}
autoFit
data={IPCount}
interactions={['active-region']}
padding="auto"
>
<Axis
name="IP"
label="null"
title={{ offset: 20, position: 'end' }}
/>
<Axis name="计数" title />
<Interval position="IP*计数" />
<Tooltip shared />
</Chart>
</Col>
</Row> */}
<div className={styles.table}> <div className={styles.table}>
<Table <Table
size="small" size="small"
...@@ -232,4 +185,4 @@ const ServiceLog = () => { ...@@ -232,4 +185,4 @@ const ServiceLog = () => {
</> </>
); );
}; };
export default ServiceLog; export default LoginLog;
This diff is collapsed.
.serviceLog{ .omsLog{
.head{ .head{
padding: 10px; padding: 10px;
background: white; background: white;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
min-width: 1030px; min-width: 1030px;
} }
.chart{ .chart{
padding: 10px; padding: 16px;
background: white; background: white;
} }
.table{ .table{
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
color:rgba(0,0,0,0.85); color:rgba(0,0,0,0.85);
} }
.ant-table-content{ .ant-table-content{
height:calc(100vh - 520px); height:calc(100vh - 172px);
border-right: white; border-right: white;
overflow: auto !important; overflow: auto !important;
.ant-table-tbody{
overflow: scroll !important;
}
} }
.ant-pagination{ .ant-pagination{
z-index: 999; z-index: 999;
......
...@@ -265,7 +265,7 @@ const ServiceLog = () => { ...@@ -265,7 +265,7 @@ const ServiceLog = () => {
<Select defaultValue="异常" onChange={changeStatus}> <Select defaultValue="异常" onChange={changeStatus}>
<Option value="9999">全部</Option> <Option value="9999">全部</Option>
<Option value="0">正常</Option> <Option value="0">正常</Option>
<Option value="-1">错误</Option> <Option value="-1">异常</Option>
</Select> </Select>
<Search <Search
allowClear allowClear
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment