Browse Source

feat: 登录日志的调整+事项弹窗

outaozhen 2 years atrás
parent
commit
0acc5844c8

+ 1 - 1
src/components/Drawer/index.tsx

@@ -8,7 +8,7 @@ import React, {
   useImperativeHandle,
   useId
 } from 'react'
-import { Drawer, PageHeader } from 'antd'
+import { Drawer, PageHeader } from 'antd/lib/button/style/'
 import { useModel } from '@umijs/max'
 import type { DrawerProps } from 'antd'
 

+ 1 - 0
src/pages/System/Account/index.tsx

@@ -71,6 +71,7 @@ const Account: React.FC = () => {
         <div className="w-full h-full bg-white">
           <ProTable
             rowKey="ID"
+            params={state.params}
             columns={columns}
             search={false}
             scroll={{ y: document.body.clientHeight - 315 }}

+ 12 - 7
src/pages/System/Log/index.tsx

@@ -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}
                 />
               ]

+ 2 - 2
src/services/api/typings.d.ts

@@ -483,10 +483,10 @@ declare namespace API {
     sort?: number
     assembly?: any[]
     id?: string
-    children?: any[]
+    children?: MatterTreeItem[]
   }
 
-  type MatterListItem = Omit<MatterTreeItem, 'children'>
+  type MatterItem = Omit<MatterTreeItem, 'children'>
 
   type AddMatterParams = Pick<MatterTreeItem, 'subjectID' | 'businessType' | 'matterType' | 'name'>