|
@@ -7,24 +7,25 @@ import React, { useState } from 'react'
|
|
|
import { Select } from 'antd'
|
|
|
|
|
|
const timeTypeOptions = [
|
|
|
- { label: '最近三天', value: 'days' },
|
|
|
- { label: '最近一周', value: 'week' },
|
|
|
- { label: '最近一个月', value: 'month' }
|
|
|
+ { label: '最近三天', value: '3' },
|
|
|
+ { label: '最近一周', value: '7' },
|
|
|
+ { label: '最近一个月', value: '30' }
|
|
|
]
|
|
|
const LoginLog = () => {
|
|
|
const [state, setState] = useState({
|
|
|
params: {
|
|
|
- search: null
|
|
|
+ search: null,
|
|
|
+ cycle: '7'
|
|
|
}
|
|
|
})
|
|
|
const columns: ProColumnType<API.LoginLogParams>[] = [
|
|
|
{
|
|
|
- dataIndex: 'userID',
|
|
|
+ dataIndex: 'account',
|
|
|
title: '账号',
|
|
|
onHeaderCell: () => ({ style: { textAlign: 'center' } })
|
|
|
},
|
|
|
{
|
|
|
- dataIndex: 'account',
|
|
|
+ dataIndex: 'accountName',
|
|
|
title: '姓名',
|
|
|
onHeaderCell: () => ({ style: { textAlign: 'center' } })
|
|
|
},
|
|
@@ -56,6 +57,7 @@ const LoginLog = () => {
|
|
|
rowKey="ID"
|
|
|
columns={columns}
|
|
|
search={false}
|
|
|
+ params={state.params}
|
|
|
scroll={{ y: document.body.clientHeight - 315 }}
|
|
|
request={async (params, sort, filter) => {
|
|
|
const {
|
|
@@ -78,7 +80,10 @@ const LoginLog = () => {
|
|
|
<Select
|
|
|
style={{ width: '100px' }}
|
|
|
key="primary"
|
|
|
- defaultValue={'days'}
|
|
|
+ onChange={value => {
|
|
|
+ setState({ ...state, params: { ...state.params, cycle: value } })
|
|
|
+ }}
|
|
|
+ defaultValue={'7'}
|
|
|
options={timeTypeOptions}
|
|
|
/>
|
|
|
]
|