Skip to content

Commit f41ceff

Browse files
author
zhangbo
committed
fix: 新增预设和筛选,后端表类型修改
1 parent f2f68d7 commit f41ceff

11 files changed

Lines changed: 345 additions & 132 deletions

File tree

api/api-server.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ paths:
125125
minimum: 1
126126
maximum: 100
127127
default: 10
128+
- name: stock_code
129+
in: query
130+
description: 按股票代码子串筛选(不区分大小写,trim 后匹配)
131+
schema:
132+
type: string
133+
maxLength: 32
128134
responses:
129135
'200':
130136
description: 成功返回分页列表
@@ -133,7 +139,7 @@ paths:
133139
schema:
134140
$ref: '#/components/schemas/StockListPage'
135141
'400':
136-
description: 分页参数非法
142+
description: 分页或筛选参数非法
137143
content:
138144
application/json:
139145
schema:

apps/main/src/layouts/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const menuMap = [
1010
{ key: 'home', label: '首页', sub: false },
1111
{ key: 'skill', label: '技能', sub: true },
1212
{ key: 'resume', label: '简历', sub: true },
13-
{ key: 'agent', label: 'AI', sub: true },
14-
{ key: 'blog', label: 'Blog', sub: true },
15-
{ key: 'utils', label: 'Utils', sub: true },
13+
{ key: 'agent', label: 'AI工作台', sub: true },
14+
{ key: 'blog', label: '博客', sub: true },
15+
{ key: 'utils', label: '工具', sub: true },
1616
{ key: 'login', label: '登录', sub: true },
1717
];
1818

apps/utils/src/api/stockServer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ export type ServerStockRecord = StockRecord;
1111
export type { StockListPage };
1212

1313
/** GET /getStockList 分页列表 */
14-
export async function getStockList(params?: { page?: number; pageSize?: number }): Promise<StockListPage> {
14+
export async function getStockList(params?: {
15+
page?: number;
16+
pageSize?: number;
17+
stock_code?: string;
18+
}): Promise<StockListPage> {
1519
const response = await stockServerApi.getStockList({
1620
query: {
1721
page: params?.page,
1822
pageSize: params?.pageSize,
23+
stock_code: params?.stock_code,
1924
},
2025
});
2126
if (response.data == null) {

apps/utils/src/pages/stock-cost/index.scss

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,38 @@
7373
justify-content: flex-start;
7474
}
7575

76+
.utils-stock__presets {
77+
margin-bottom: 20px;
78+
}
79+
80+
.utils-stock__presets-label {
81+
display: block;
82+
margin-bottom: 8px;
83+
font-size: 13px;
84+
}
85+
86+
.utils-stock__summary {
87+
margin-top: 20px;
88+
}
89+
90+
.utils-stock__summary-desc {
91+
margin-top: 8px;
92+
}
93+
94+
.utils-stock__table {
95+
.utils-stock__row--clickable {
96+
cursor: pointer;
97+
}
98+
99+
.utils-stock__row--active > td {
100+
background: var(--ant-color-primary-bg) !important;
101+
}
102+
103+
.utils-stock__row--clickable:hover > td {
104+
background: var(--ant-color-fill-tertiary);
105+
}
106+
}
107+
76108
.utils-stock__form-grid {
77109
display: grid;
78110
grid-template-columns: 1fr 1fr;
@@ -89,16 +121,34 @@
89121

90122
.utils-stock__history {
91123
margin-top: 24px;
124+
125+
.ant-card-body {
126+
min-width: 0;
127+
}
128+
}
129+
130+
.utils-stock__table-toolbar {
131+
display: flex;
132+
flex-direction: column;
133+
gap: 12px;
134+
margin-bottom: 16px;
92135
}
93136

94-
.utils-stock__history-item {
95-
cursor: default;
137+
.utils-stock__table-filter {
138+
max-width: 320px;
139+
width: 100%;
140+
}
141+
142+
.utils-stock__table-filter-quick {
143+
align-items: center;
96144
}
97145

98146
.utils-stock__pagination {
99147
margin-top: 16px;
100148
display: flex;
149+
flex-wrap: wrap;
101150
justify-content: flex-end;
151+
row-gap: 8px;
102152
}
103153

104154
.utils-stock__actions {

0 commit comments

Comments
 (0)