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
bc05aba4
Commit
bc05aba4
authored
Mar 12, 2024
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '登录日志样式优化'
parent
0e2246b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
3 deletions
+90
-3
index.jsx
src/pages/log/loginLog/index.jsx
+84
-3
index.less
src/pages/log/loginLog/index.less
+6
-0
No files found.
src/pages/log/loginLog/index.jsx
View file @
bc05aba4
...
...
@@ -28,6 +28,54 @@ const LoginLog = () => {
const
[
chartData
,
setChartData
]
=
useState
([]);
const
[
showChart
,
setShowChart
]
=
useState
(
true
);
const
colorArr
=
[
'#FFAB18'
,
'#17B5F9'
,
'#1975FF'
,
'#56CF3A'
,
'#7D5CD4'
,
'#FF0060'
,
'#CA4ED9'
,
'#01CC9F'
,
'#FF4C3E'
,
'#E945D0'
,
'#0EC6DC'
,
'#63636D'
,
'#66517F'
,
'#996B6B'
,
'#ACAFC6'
,
'#FFAB18'
,
'#17B5F9'
,
'#1975FF'
,
'#56CF3A'
,
'#7D5CD4'
,
'#FF0060'
,
'#CA4ED9'
,
'#01CC9F'
,
'#FF4C3E'
,
'#E945D0'
,
'#0EC6DC'
,
'#63636D'
,
'#66517F'
,
'#996B6B'
,
'#ACAFC6'
,
'#FFAB18'
,
'#17B5F9'
,
'#1975FF'
,
'#56CF3A'
,
'#7D5CD4'
,
'#FF0060'
,
'#CA4ED9'
,
'#01CC9F'
,
'#FF4C3E'
,
'#E945D0'
,
'#0EC6DC'
,
'#63636D'
,
'#66517F'
,
'#996B6B'
,
'#ACAFC6'
]
console
.
log
(
colorArr
,
'colorArrcolorArrcolorArr'
);
const
columns
=
[
// {
// title: 'IP',
...
...
@@ -103,7 +151,7 @@ const LoginLog = () => {
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setData0
(
res
.
data
.
tableData
);
let
chartArr1
=
res
.
data
.
chartData
.
map
(
item
=>
item
.
client
)
let
chartArr1
=
res
.
data
.
chartData
.
map
(
item
=>
item
.
client
Name
||
item
.
client
)
let
chartArr2
=
res
.
data
.
chartData
.
map
(
item
=>
item
.
count
)
let
chartArr3
=
res
.
data
.
chartData
.
map
(
item
=>
{
return
{
...
...
@@ -174,6 +222,27 @@ const LoginLog = () => {
xAxis
:
{
type
:
'category'
,
data
:
chartData
[
0
],
// axisLabel: {
// interval: 0, //x轴文字全部显示
// formatter: function (params) {
// let newParamsName = ''
// const paramsNameNumber = params.length // 获取文数总长度
// const provideNumber = 8 //控制每行的字段
// const rowNumber = Math.ceil(paramsNameNumber / provideNumber)
// if (paramsNameNumber > provideNumber) {
// for (let p = 0; p < rowNumber; p++) {
// const start = p * provideNumber
// const end = start + provideNumber
// const tempStr = p === rowNumber - 1 ? params.substring(start, paramsNameNumber) :
// params.substring(start, end) + '\n'
// newParamsName += tempStr
// }
// } else {
// newParamsName = params
// }
// return newParamsName
// },
// },
},
yAxis
:
{
type
:
'value'
,
...
...
@@ -190,9 +259,20 @@ const LoginLog = () => {
const
percentage
=
((
params
.
data
/
total
)
*
100
).
toFixed
(
2
)
+
'%'
;
return
`
${
params
.
data
}
次 (
${
percentage
}
)`
;
}
},
itemStyle
:
{
color
:
function
(
params
)
{
// 这里可以根据你的需求设置不同的颜色,例如根据数据值或索引
return
(
colorArr
[
params
.
dataIndex
])
}
}
},
],
tooltip
:
{
trigger
:
'item'
,
show
:
true
,
formatter
:
'{b} : {c}次'
,
// 展示的文字 类型+百分比
},
};
},
[
chartData
])
const
leftOption
=
useMemo
(()
=>
{
...
...
@@ -210,6 +290,7 @@ const LoginLog = () => {
left
:
'center'
,
top
:
'10%'
,
},
color
:
colorArr
,
series
:
[
{
name
:
'占比'
,
...
...
@@ -229,7 +310,7 @@ const LoginLog = () => {
},
},
},
]
,
]
};
},
[
chartData
])
return
(
...
...
@@ -245,7 +326,7 @@ const LoginLog = () => {
onChange=
{
changeTime
}
value=
{
allTime
}
allowClear=
{
false
}
/>
/>
{
/* <DatePicker
showTime
format="YYYY-MM-DD HH:mm:ss"
...
...
src/pages/log/loginLog/index.less
View file @
bc05aba4
.loginLog{
:global {
.ant-table-body {
transition: all 0.3s ease 0s;
}
}
.head{
padding: 10px;
background: white;
...
...
@@ -12,6 +17,7 @@
.table{
position: relative;
border-top: 1px solid #f0eded;
transition: all 0.3s;
// overflow: auto;//不要这个,pagination否则无法固定底部
.ant-table-thead tr th{
font-weight: 600;
...
...
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