Skip to content

Commit cd3fd12

Browse files
committed
feat: 修复字段显示长度的问题
1 parent 201ac73 commit cd3fd12

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

mock/history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const genList = (current: number, pageSize: number) => {
1717
{
1818
'id|+1': 1, // 自增 ID
1919
'url_id|1-100': 1, // 短链接 ID(1-100随机)
20-
short_code: '@word(5,8)', // 5-8位短码
20+
short_code: '@word(6,16)', // 5-8位短码
2121
ip_address: '@ip', // IPv4 地址
2222
user_agent: '@string(16,32)', // 浏览器 UA
2323
referer: function () {

mock/shorten.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const genList = (current: number, pageSize: number) => {
1616

1717
for (let i = 0; i < pageSize; i += 1) {
1818
const index = (current - 1) * 10 + i + 1;
19-
const code = Random.word(6, 8);
19+
const code = Random.word(6, 16);
2020
tableListDataSource.push({
2121
id: index,
2222
code: code,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@types/react-helmet": "^6.1.11",
7575
"@typescript-eslint/eslint-plugin": "^8.31.0",
7676
"@typescript-eslint/parser": "^8.31.0",
77-
"@umijs/lint": "^4.4.6",
77+
"@umijs/lint": "4.4.10",
7878
"@umijs/max": "^4.4.10",
7979
"cross-env": "^7.0.3",
8080
"eslint": "^9.25.1",
@@ -87,7 +87,7 @@
8787
"mockjs": "^1.1.0",
8888
"prettier": "^3.5.3",
8989
"react-dev-inspector": "^2.0.1",
90-
"swagger-ui-dist": "^5.20.7",
90+
"swagger-ui-dist": "5.21.0",
9191
"ts-node": "^10.9.2",
9292
"typescript": "^5.8.3",
9393
"umi-presets-pro": "^2.0.3",

src/pages/History/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ const TableList: React.FC = () => {
5555
sorter: true,
5656
dataIndex: 'id',
5757
hideInSearch: true,
58+
width: 12,
5859
},
5960
{
6061
title: '短码',
6162
dataIndex: 'short_code',
6263
copyable: true,
64+
width: 150,
6365
},
6466
{
6567
title: '访问者 IP',
6668
dataIndex: 'ip_address',
69+
width: 100,
6770
},
6871
{
6972
title: '来源 URL',
@@ -76,13 +79,13 @@ const TableList: React.FC = () => {
7679
hideInSearch: true,
7780
},
7881
{
79-
title: '国家',
80-
dataIndex: 'country',
82+
title: '区域',
83+
dataIndex: 'region',
8184
hideInSearch: true,
8285
},
8386
{
84-
title: '区域',
85-
dataIndex: 'region',
87+
title: '国家',
88+
dataIndex: 'country',
8689
hideInSearch: true,
8790
},
8891
{
@@ -120,13 +123,15 @@ const TableList: React.FC = () => {
120123
dataIndex: 'accessed_at',
121124
valueType: 'dateTime',
122125
hideInSearch: true,
126+
width: 146,
123127
},
124128
{
125129
title: '创建时间',
126130
sorter: true,
127131
dataIndex: 'created_at',
128132
valueType: 'dateTime',
129133
hideInSearch: true,
134+
width: 146,
130135
},
131136
];
132137

@@ -187,7 +192,7 @@ const TableList: React.FC = () => {
187192
country: { show: false },
188193
region: { show: false },
189194
province: { show: false },
190-
city: { show: false },
195+
city: { show: true },
191196
// browser: { show: false },
192197
os: { show: false },
193198
device_type: { show: false },

src/pages/Shortener/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const TableList: React.FC = () => {
144144
sorter: true,
145145
dataIndex: 'id',
146146
hideInSearch: true,
147+
width: 12,
147148
},
148149
// {
149150
// title: '短码',
@@ -165,7 +166,7 @@ const TableList: React.FC = () => {
165166
{
166167
title: '短码',
167168
dataIndex: 'code',
168-
width: 10,
169+
width: 180,
169170
render: (_, entity) => (
170171
<span className={styles.codeContainer}>
171172
<a
@@ -217,6 +218,7 @@ const TableList: React.FC = () => {
217218
title: '状态',
218219
dataIndex: 'status',
219220
hideInForm: true,
221+
width: 58,
220222
valueEnum: {
221223
0: {
222224
text: '启用',
@@ -238,18 +240,21 @@ const TableList: React.FC = () => {
238240
dataIndex: 'updated_at',
239241
valueType: 'dateTime',
240242
hideInSearch: true,
243+
width: 146,
241244
},
242245
{
243246
title: '创建时间',
244247
sorter: true,
245248
dataIndex: 'created_at',
246249
valueType: 'dateTime',
247250
hideInSearch: true,
251+
width: 146,
248252
},
249253
{
250254
title: '操作',
251255
dataIndex: 'option',
252256
valueType: 'option',
257+
width: 80,
253258
render: (_, record) => [
254259
<a
255260
key="update"

0 commit comments

Comments
 (0)