Skip to content

Commit 9d27e68

Browse files
committed
fix
1 parent e41d172 commit 9d27e68

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/pages/logs/api.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
33
import { Row, Col, Form, Input, Button, DatePicker, Table, Modal, Badge } from 'antd'
44
import { object2Str } from '@utils/tools'
5+
import { ColumnProps } from 'antd/lib/table'
56

67
const 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}

src/pages/stocks/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const StockList: React.FC<ICommonProps> = ({history}) => {
2525
}
2626

2727
const onOpts = (data: Stock) => {
28-
history.push(`/home/stocks/stocks/detail/${data.id}`)
28+
history.push(`/home/stocks/detail/${data.id}`)
2929
}
3030

3131
useEffect(() => {

src/routes/pageRoutes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ const routesConf: Partial<XRouteProps>[] = [
212212
subRoute: [
213213
{
214214
title: 'Stocks',
215-
path: '/stocks',
215+
path: '',
216216
icon: <StockOutlined/>,
217217
component: StockList
218218
},
219219
{
220-
path: '/stocks/detail/:id',
220+
path: '/detail/:id',
221221
component: StockDetail
222222
},
223223
{

0 commit comments

Comments
 (0)