1
0

feat: 增加股票集展示

This commit is contained in:
2025-09-17 18:24:05 +08:00
parent f8ee51c0ed
commit 5953c9b9f2
12 changed files with 448 additions and 167 deletions

View File

@@ -5,6 +5,7 @@ import 'amis/sdk/iconfont.css'
import '@fortawesome/fontawesome-free/css/all.min.css'
import axios from 'axios'
import {isEqual} from 'es-toolkit'
import type {NavigateFunction} from 'react-router'
export const commonInfo = {
debug: isEqual(import.meta.env.MODE, 'development'),
@@ -334,3 +335,65 @@ export function remoteMappings(name: string, field: string) {
source: `get:${commonInfo.baseUrl}/constants/mappings/${name}/${field}`,
}
}
export function stockListColumns(navigate: NavigateFunction) {
return [
{
name: 'code',
label: '编号',
width: 150,
},
{
name: 'name',
label: '简称',
width: 150,
},
{
name: 'fullname',
label: '全名',
},
{
name: 'market',
label: '市场',
width: 100,
align: 'center',
...remoteMappings('stock_market', 'market'),
},
{
name: 'industry',
label: '行业',
width: 80,
},
{
label: '上市日期',
width: 100,
align: 'center',
...date('listedDate'),
},
{
type: 'operation',
label: '操作',
width: 100,
buttons: [
{
type: 'action',
label: '详情',
level: 'link',
onEvent: {
click: {
actions: [
{
actionType: 'custom',
// @ts-ignore
script: (context, action, event) => {
navigate(`/stock/detail/${context.props.data['id']}`)
},
},
],
},
},
},
],
},
]
}