@@ -2,9 +2,12 @@ import * as React from 'react'
22import { inject , observer } from 'mobx-react'
33import { Row , Col , Form , Input , Button , DatePicker , Table , Modal , Badge } from 'antd'
44import { object2Str } from '@utils/tools'
5+ import { ColumnProps } from 'antd/lib/table'
56
67const FormItem = Form . Item
78
9+ type TStatus = 'default' | 'success' | 'warning' | 'error'
10+
811
912@inject ( 'apiLogStore' )
1013@observer
@@ -18,7 +21,7 @@ export default class APILog extends React.Component<ICommonProps> {
1821 detailInfo : { }
1922 }
2023
21- columns = [ {
24+ columns : ColumnProps < AnyObject > [ ] = [ {
2225 title : 'ID' ,
2326 dataIndex : 'id' ,
2427 // render: (name: any) => `${name.first} ${name.last}`,
@@ -62,6 +65,7 @@ export default class APILog extends React.Component<ICommonProps> {
6265 title : '操作' ,
6366 dataIndex : '' ,
6467 width : '80px' ,
68+ fixed : 'right' ,
6569 render : ( text : string , record : any , index : number ) => < Button size = "small" type = "primary" onClick = { ( ) => this . viewDetail ( record ) } > 详情</ Button > ,
6670 } ]
6771
@@ -165,8 +169,8 @@ export default class APILog extends React.Component<ICommonProps> {
165169 }
166170
167171 // 获取状态badge
168- getStatus = ( status : any ) : 'default' | 'success' | 'warning' | 'error' => {
169- let info : 'default' | 'success' | 'warning' | 'error' = 'default'
172+ getStatus = ( status : any ) : TStatus => {
173+ let info : TStatus = 'default'
170174 switch ( status ) {
171175 case 200 :
172176 case 201 :
@@ -259,6 +263,7 @@ export default class APILog extends React.Component<ICommonProps> {
259263 < Table
260264 bordered
261265 className = "table-list"
266+ scroll = { { x : 1600 } }
262267 columns = { this . columns }
263268 rowKey = { ( record : any ) => record . id }
264269 dataSource = { list }
0 commit comments