浏览代码

'添加操作日志页面基础代码'

main
郑州 3 年前
父节点
当前提交
4e6aea8033
共有 2 个文件被更改,包括 90 次插入5 次删除
  1. +48
    -5
      src/pages/log/index.tsx
  2. +42
    -0
      src/pages/log/log.less

+ 48
- 5
src/pages/log/index.tsx 查看文件

@@ -1,9 +1,52 @@
import React from 'react'
import React from 'react';
import { Form, Table, Input, Button, Space } from 'antd';
import ProTable, { ProColumns } from '@ant-design/pro-table';
import styles from './log.less';

enum LogActionType {
Download,
Delete,
Upload,
}

const tableColumns: Array<ProColumns<any>> = [
{ dataIndex: 'archName', title: '名称' },
{ dataIndex: 'folderName', title: '所属文件夹', search: false },
{ dataIndex: 'size', title: '大小', search: false },
{
dataIndex: 'actionType',
title: '操作类型',
search: false,
valueEnum: {
[LogActionType.Download]: '下载',
[LogActionType.Delete]: '删除',
[LogActionType.Upload]: '上传',
},
},
{ dataIndex: 'operator', title: '操作人' },
{ dataIndex: 'operateTime', title: '操作时间', search: false },
// {
// search: false,
// render() {
// return (
// <div>
// 查看
// </div>
// )
// }
// },
];

export default function LogView() {
return (
<div>
操作日志界面
<div className={styles.logView}>
<ProTable
className={styles.tableWrapper}
tableClassName={styles.table}
columns={tableColumns}
toolBarRender={false}
pagination={false}
/>
</div>
)
}
);
}

+ 42
- 0
src/pages/log/log.less 查看文件

@@ -0,0 +1,42 @@
.logView {
display: flex;
flex-direction: column;
height: 100%;
padding: 12px;
}

.controller {
flex-direction: row;
justify-content: flex-end;
margin-bottom: 12px;
:global(.ant-form-item) {
margin-bottom: 0;
}
}

.tableWrapper {
flex: 1;
display: flex;
flex-direction: column;
:global {
.ant-pro-table-search {
flex: none;
background-color: transparent;
padding: 0;
margin-bottom: 12px;
.ant-form-item {
margin-bottom: 0;
}
}
.ant-card {
flex: 1;
}
th.ant-table-cell {
background: rgba(235, 235, 242, 0.8);
box-shadow: 0px 0px 0px 0px #f1f4f6;
&:before {
content: none !important;
}
}
}
}

正在加载...
取消
保存