add mock: reportlist

mgy
Dawn1Ocean 2024-04-02 14:59:06 +08:00
parent 2cb4684130
commit e71abc0c0b
6 changed files with 133 additions and 108 deletions

View File

@ -233,84 +233,6 @@
} }
} }
}, },
"RuleListItem": {
"type": "object",
"properties": {
"key": {
"type": "integer",
"format": "int32"
},
"disabled": {
"type": "boolean"
},
"href": {
"type": "string"
},
"avatar": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"desc": {
"type": "string"
},
"callNo": {
"type": "integer",
"format": "int32"
},
"status": {
"type": "integer",
"format": "int32"
},
"updatedAt": {
"type": "string",
"format": "datetime"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"progress": {
"type": "integer",
"format": "int32"
}
}
},
"RuleList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RuleListItem"
}
},
"total": {
"type": "integer",
"description": "列表的内容总数",
"format": "int32"
},
"success": {
"type": "boolean"
}
}
},
"FakeCaptcha": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"status": {
"type": "string"
}
}
},
"LoginParams": { "LoginParams": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -216,19 +216,33 @@ request:
}, },
``` ```
## 日志页面 ## 反馈页面
### 获取日志列表 `GET /admin/loglist` ### 获取反馈列表 `GET /admin/reportlist`
request: data:
```json ```json
{ {
"pageIndex": 1, "page": 1,
"size": 10, "total": 24,
"success": true,
"data": [
{
"name": "晓洋",
"phone": "13333333333",
"time": "2024-03-07T17:52:48.523303",
"text": "你们为什么修不好天选3的PD充电"
},
// ...
]
} }
``` ```
## 日志页面
### 获取日志列表 `GET /admin/loglist`
data: data:
```json ```json

View File

@ -0,0 +1,62 @@
[
{
"name": "晓洋",
"phone": "13333333333",
"time": "2024-03-07T17:52:48.523303",
"text": "你们为什么修不好天选3的PD充电"
},
{
"name": "晓洋1",
"phone": "13333333334",
"time": "2024-03-07T17:53:48.523303",
"text": "你们为什么修不好天选4的PD充电"
},
{
"name": "晓洋2",
"phone": "13333333335",
"time": "2024-03-07T17:54:48.523303",
"text": "你们为什么修不好天选5的PD充电"
},
{
"name": "晓洋3",
"phone": "13333333336",
"time": "2024-03-07T17:55:48.523303",
"text": "你们为什么修不好天选6的PD充电"
},
{
"name": "晓洋4",
"phone": "13333333337",
"time": "2024-03-07T17:56:48.523303",
"text": "你们为什么修不好天选7的PD充电"
},
{
"name": "晓洋5",
"phone": "13333333338",
"time": "2024-03-07T17:57:48.523303",
"text": "你们为什么修不好天选8的PD充电"
},
{
"name": "晓洋6",
"phone": "13333333339",
"time": "2024-03-07T17:58:48.523303",
"text": "你们为什么修不好天选9的PD充电"
},
{
"name": "晓洋7",
"phone": "13333333330",
"time": "2024-03-07T17:59:48.523303",
"text": "你们为什么修不好天选0的PD充电"
},
{
"name": "晓洋8",
"phone": "13333333331",
"time": "2024-03-07T18:52:48.523303",
"text": "你们为什么修不好天选1的PD充电"
},
{
"name": "晓洋9",
"phone": "13333333332",
"time": "2024-03-07T19:52:48.523303",
"text": "你们为什么修不好天选2的PD充电"
}
]

View File

@ -1,6 +1,7 @@
import loglist from './loglist.json'; import loglist from './loglist.json';
import sheet from './sheet.json'; import sheet from './sheet.json';
import sheetlist from './sheetlist.json'; import sheetlist from './sheetlist.json';
import reportlist from './reportlist.json';
module.exports = { module.exports = {
'GET /admin/stats': { 'GET /admin/stats': {
@ -48,6 +49,12 @@ module.exports = {
total: 24, total: 24,
data: loglist, data: loglist,
}, },
'GET /admin/reportlist': {
success: true,
page: 1,
total: 24,
data: reportlist,
},
'GET /api/currentUser': { 'GET /api/currentUser': {
data: { data: {
name: 'Serati Ma', name: 'Serati Ma',

View File

@ -17,12 +17,12 @@ const Logs: React.FC = () => {
request={async (params = {} as Record<string, any>) => request={async (params = {} as Record<string, any>) =>
request<{ request<{
data: LogsItem[]; data: LogsItem[];
}>('http://127.0.0.1:8000/admin/loglist', { }>('/admin/loglist', {
params, params,
}) })
} }
pagination={{ pagination={{
pageSize: 5, pageSize: 10,
}} }}
metas={{ metas={{
title: { title: {
@ -40,10 +40,10 @@ const Logs: React.FC = () => {
return ( return (
<div> <div>
{'于 ' + {'于 ' +
moment(row.time).format('lll') + moment(row.time).format('YYYY-M-D HH:mm:ss') +
' ' + ' ' +
transInfo(row.operation, 'operation') + transInfo(row.operation, 'operation') +
'了 ' + '了' +
transInfo(row.target, 'target') + transInfo(row.target, 'target') +
'' + '' +
row.prev.info + row.prev.info +
@ -61,26 +61,46 @@ const Logs: React.FC = () => {
], ],
search: false, search: false,
}, },
// status: { operation: {
// // 自己扩展的字段,主要用于筛选,不在列表中显示 // 自己扩展的字段,主要用于筛选,不在列表中显示
// title: '更改部分', title: '操作',
// valueType: 'select', valueType: 'select',
// valueEnum: { valueEnum: {
// all: { text: '全部', status: 'Default' }, all: { text: '全部', status: 'Default' },
// open: { add: {
// text: '未解决', text: '增加',
// status: 'Error', status: '0',
// }, },
// closed: { delete: {
// text: '已解决', text: '删除',
// status: 'Success', status: '1',
// }, },
// processing: { change: {
// text: '解决中', text: '更改',
// status: 'Processing', status: '2',
// }, },
// }, },
// }, },
target: {
// 自己扩展的字段,主要用于筛选,不在列表中显示
title: '操作对象',
valueType: 'select',
valueEnum: {
all: { text: '全部', status: 'Default' },
dutyTable: {
text: '值班表',
status: '0',
},
dutyInfo: {
text: '值班信息',
status: '1',
},
conclusion: {
text: '值班总结',
status: '2',
},
},
},
}} }}
/> />
</Card> </Card>

View File

@ -1,7 +1,7 @@
const operationMap: { [key: number]: string } = { const operationMap: { [key: number]: string } = {
0: '增加', 0: '增加',
1: '删除', 1: '删除',
2: '改', 2: '改',
}; };
const targetMap: { [key: number]: string } = { const targetMap: { [key: number]: string } = {