Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
e4bf4808
Commit
e4bf4808
authored
Nov 25, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: log
parent
b768069c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
117 deletions
+25
-117
index.js
src/pages/log/serviceLog/index.js
+25
-117
No files found.
src/pages/log/serviceLog/index.js
View file @
e4bf4808
...
...
@@ -5,27 +5,20 @@ import {
Row
,
Col
,
Button
,
Select
,
Menu
,
notification
,
message
,
Spin
,
}
from
'antd'
;
import
{
SwapRightOutlined
}
from
'@ant-design/icons'
;
import
{
SwapRightOutlined
,
DownOutlined
}
from
'@ant-design/icons'
;
import
{
Chart
,
Interval
,
Tooltip
,
Axis
}
from
'bizcharts'
;
import
{
DataSet
}
from
'@antv/data-set'
;
import
moment
from
'moment'
;
import
{
post
,
PUBLISH_SERVICE
}
from
'@/services/index'
;
const
{
Option
}
=
Select
;
// const data = [
// { value: 251, name: '接口名称一', subName: '子事例一' },
// { value: 1041, name: '接口名称三', subName: '子事例二' },
// { value: 610, name: '接口名称二', subName: '子事例二' },
// { value: 434, name: '接口名称二', subName: '子事例四' },
// { value: 335, name: '接口名称二', subName: '子事例五' },
// { value: 250, name: '接口名称三', subName: '子事例二' },
// ];
// const data = [];
const
Demo
=
()
=>
{
const
ServiceLog
=
()
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
// 源数据
const
[
data0
,
setData0
]
=
useState
([]);
// 源数据
const
[
pathCount
,
setPathCount
]
=
useState
([]);
// 接口调用次数,统计数据
...
...
@@ -35,6 +28,7 @@ const Demo = () => {
const
[
endTime
,
setEndTime
]
=
useState
(
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
),
// 默认值当前时间
);
const
[
logType
,
setLogType
]
=
useState
(
0
);
// 请求参数,日志类型,默认是正常,0:成功 -1:错误 9999:全部
const
[
tableColumns
,
setTableColumns
]
=
useState
([]);
// 源数据
console
.
log
(
startTime
.
format
(
'HH:mm:ss'
));
...
...
@@ -46,7 +40,7 @@ const Demo = () => {
setLoading
(
true
);
getData
();
}
},
[
startTime
,
endTime
]);
},
[
startTime
,
endTime
,
logType
]);
const
getData
=
()
=>
{
post
(
`
${
PUBLISH_SERVICE
}
/LogCenter/GetOMSLog`
,
{
PageIndex
:
0
,
...
...
@@ -57,7 +51,7 @@ const Demo = () => {
HourTo
:
endTime
.
format
(
'HH:mm:ss'
),
IP
:
''
,
Module
:
''
,
LogType
:
0
,
LogType
:
+
logType
,
Description
:
''
,
LoginName
:
''
,
UserName
:
''
,
...
...
@@ -154,11 +148,15 @@ const Demo = () => {
),
);
};
const
selectChange
=
value
=>
{
setLogType
(
value
);
};
return
(
<>
<
Row
>
<
div
style
=
{{
lineHeight
:
2
}}
>
时间:
<
/div
>
<
Row
style
=
{{
padding
:
'10px'
,
background
:
'white'
}}
>
<
Col
span
=
{
24
}
>
<
span
style
=
{{
lineHeight
:
2
}}
>
时间:
<
/span
>
<
DatePicker
showTime
format
=
"YYYY-MM-DD HH:mm:ss"
...
...
@@ -177,20 +175,24 @@ const Demo = () => {
style
=
{{
marginRight
:
'10px'
}}
allowClear
=
{
false
}
/
>
<
Col
span
=
{
12
}
>
<
Button
onClick
=
{()
=>
setTime
(
1
)}
>
近
1
小时
<
/Button
>
<
Button
onClick
=
{()
=>
setTime
(
6
)}
>
近
6
小时
<
/Button
>
<
Button
onClick
=
{()
=>
setTime
(
12
)}
>
近
12
小时
<
/Button
>
<
Button
onClick
=
{()
=>
setTime
(
24
)}
>
近
1
天
<
/Button
>
<
Button
onClick
=
{()
=>
setTime
(
24
*
7
)}
>
近
1
周
<
/Button
>
<
span
style
=
{{
lineHeight
:
2
,
marginLeft
:
'20px'
}}
>
日志类型:
<
/span
>
<
Select
defaultValue
=
"正常"
onChange
=
{
selectChange
}
>
<
Option
value
=
"9999"
>
全部
<
/Option
>
<
Option
value
=
"0"
>
正常
<
/Option
>
<
Option
value
=
"-1"
>
错误
<
/Option
>
<
/Select
>
<
/Col
>
{
/* <div style={{ lineHeight: 2 }}>类型:</div> */
}
<
/Row
>
<
Spin
spinning
=
{
loading
}
tip
=
"loading"
>
<
Row
style
=
{{
padding
:
'10px'
}}
>
<
Row
style
=
{{
padding
:
'10px'
,
background
:
'white'
}}
>
<
Col
span
=
{
12
}
>
<
Chart
height
=
{
3
40
}
height
=
{
3
16
}
width
=
{
400
}
autoFit
data
=
{
pathCount
}
...
...
@@ -200,6 +202,7 @@ const Demo = () => {
>
<
Axis
name
=
"Path"
// label={{ autoEllipsis: 'true', autoHide: 'true' }}
label
=
"null"
title
=
{{
offset
:
20
,
position
:
'end'
}}
/
>
...
...
@@ -210,7 +213,7 @@ const Demo = () => {
<
/Col
>
<
Col
span
=
{
12
}
>
<
Chart
height
=
{
3
40
}
height
=
{
3
16
}
width
=
{
400
}
autoFit
data
=
{
reponseTime
}
...
...
@@ -234,7 +237,6 @@ const Demo = () => {
bordered
columns
=
{
tableColumns
||
[]}
dataSource
=
{
data0
}
// loading={tableLoading}
scroll
=
{{
x
:
'max-content'
}}
pagination
=
{{
showTotal
:
(
total
,
range
)
=>
...
...
@@ -249,98 +251,4 @@ const Demo = () => {
<
/
>
);
};
export
default
Demo
;
// dv.transform({
// type: 'aggregate', // 别名summary
// fields: ['name', 'value'], // 统计字段集
// operations: ['count', 'mean'], // 统计操作集
// as: ['计数', '平均值'], // 存储字段集
// groupBy: ['name'], // 分组字段集
// }).transform({
// type: 'sort-by',
// fields: ['计数'], // 根据指定的字段集进行排序,与lodash的sortBy行为一致
// order: 'DESC', // 默认为 ASC,DESC 则为逆序
// });
// const data = [
// {
// ID: '215341',
// loginName: 'gcwqgps',
// userName: 'gcwqgps',
// systemType: 'solution',
// terminal: 'Browser',
// IP: '192.168.10.150',
// logTime: '2020/11/23 18:56:27',
// },
// {
// ID: '215342',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 19:17:51',
// },
// {
// ID: '215343',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 19:41:12',
// },
// {
// ID: '215344',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 19:42:04',
// },
// {
// ID: '215345',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 19:45:56',
// },
// {
// ID: '215346',
// loginName: 'panda',
// userName: '熊猫智慧水务',
// systemType: 'city',
// terminal: 'Browser',
// IP: '192.168.10.150',
// logTime: '2020/11/23 19:55:20',
// },
// {
// ID: '215347',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 19:55:39',
// },
// {
// ID: '215348',
// loginName: '17671748304',
// userName: '邹小仙',
// systemType: 'city',
// terminal: 'Browser',
// IP: '192.168.10.150',
// logTime: '2020/11/23 20:01:34',
// },
// {
// ID: '215349',
// loginName: 'luojian',
// userName: 'gwcj',
// systemType: 'city',
// terminal: 'Browser',
// IP: '127.0.0.1',
// logTime: '2020/11/23 20:16:51',
// },
// ];
export
default
ServiceLog
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment