@appthen/cli 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/bin/main.js +47 -0
  2. package/dist/index.js +6185 -15001
  3. package/package.json +8 -4
  4. package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1197 -741
  5. package/tests/test-app/.appthen/space-config.json +2 -2
  6. package/tests/test-app/src/components/MessageCenter.tsx +506 -0
  7. package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
  8. package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
  9. package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
  10. package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
  11. package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
  12. package/tests/test-app/src/pages/DataReport.tsx +298 -0
  13. package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
  14. package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
  15. package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
  16. package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
  17. package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
  18. package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
  19. package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
  20. package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
  21. package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
  22. package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
  23. package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
  24. package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
  25. package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
  26. package/tests/test-app/src/pages/UserProfile.tsx +404 -0
  27. package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
  28. package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
  29. package/tests/test-app/src/pages/article-list.tsx +222 -0
  30. package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
  31. package/tests/test-app/src/pages/category-list.tsx +179 -0
  32. package/tests/test-app/src/pages/comment-list.tsx +194 -0
  33. package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
  34. package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
  35. package/tests/test-app/src/pages/data-overview.tsx +600 -0
  36. package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
  37. package/tests/test-app/src/pages/department-list.tsx +183 -0
  38. package/tests/test-app/src/pages/goods-list.tsx +233 -0
  39. package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
  40. package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +1 -1
  41. package/tests/test-app/src/pages/notice-list.tsx +217 -0
  42. package/tests/test-app/src/pages/order-detail.tsx +330 -0
  43. package/tests/test-app/src/pages/order-list.tsx +195 -0
  44. package/tests/test-app/src/pages/order-management.tsx +563 -0
  45. package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
  46. package/tests/test-app/src/pages/role-list.tsx +184 -0
  47. package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
  48. package/tests/test-app/src/pages/simple-page.tsx +43 -0
  49. package/tests/test-app/src/pages/test-destructure.tsx +44 -0
  50. package/tests/test-app/src/pages/test-error-page.tsx +75 -0
  51. package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
  52. package/tests/test-app/src/pages/test-page.tsx +101 -0
  53. package/tests/test-app/src/pages/test-render.tsx +52 -0
  54. package/tests/test-app/src/pages/test-return-type.tsx +41 -0
  55. package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
  56. package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
  57. package/tests/test-app/src/pages/user-list.tsx +212 -0
  58. package/tests/test-app/src/pages/wrong-page.tsx +50 -0
  59. package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +0 -1060
@@ -0,0 +1,591 @@
1
+ /**
2
+ * 数据概览 - 仪表盘8
3
+ * 展示关键业务指标和数据统计
4
+ *
5
+ * @type Page
6
+ * @route /dashboard
7
+ * @screen 1200w
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+ import { Page, Text, View } from '@appthen/react';
12
+ import { Card, Col, Row } from '@appthen/antd';
13
+
14
+
15
+ class IProps {
16
+ refreshInterval?: number;
17
+ }
18
+
19
+ /*
20
+ * 数据与接口请求定义
21
+ */
22
+ class IState {
23
+ /* 总订单数 */
24
+ totalOrders?: number;
25
+ /* 总收入 */
26
+ totalRevenue?: number;
27
+ /* 活跃用户数 */
28
+ activeUsers?: number;
29
+ /* 待处理订单 */
30
+ pendingOrders?: number;
31
+ /* 今日订单 */
32
+ todayOrders?: number;
33
+ /* 今日收入 */
34
+ todayRevenue?: number;
35
+ /* 昨日收入 */
36
+ yesterdayRevenue?: number;
37
+ /* 本周收入 */
38
+ weekRevenue?: number;
39
+ /* 订单状态分布 */
40
+ orderStatus?: {
41
+ /* @example 已完成 */name?: string,
42
+ /* @example 9850 */value?: number,
43
+ /* @example #52c41a */color?: string,
44
+ /* @example bg-green-500 */bgColor?: string,
45
+ }[];
46
+ /* 销售趋势 */
47
+ salesTrend?: any[];
48
+ /* 商品销量排行 */
49
+ topProducts?: {
50
+ /* @example 1 */id?: number,
51
+ /* @example iPhone 15 Pro */name?: string,
52
+ /* @example 1580 */sales?: number,
53
+ /* @example 1580000 */revenue?: number,
54
+ /* @example 📱 */image?: string,
55
+ }[];
56
+ /* 最近订单 */
57
+ recentOrders?: {
58
+ /* @example ORD-2024-001 */id?: string,
59
+ /* @example 张三 */customer?: string,
60
+ /* @example 12999 */amount?: number,
61
+ /* @example completed */status?: string,
62
+ /* @example 10分钟前 */time?: string,
63
+ }[];
64
+ }
65
+
66
+ class Document extends React.Component<IProps, IState> {
67
+ state = {
68
+ totalOrders: 12580,
69
+ totalRevenue: 856320,
70
+ activeUsers: 3268,
71
+ pendingOrders: 45,
72
+ todayOrders: 128,
73
+ todayRevenue: 8620,
74
+ yesterdayRevenue: 9530,
75
+ weekRevenue: 62850,
76
+ orderStatus: [
77
+ {
78
+ name: '已完成',
79
+ value: 9850,
80
+ color: '#52c41a',
81
+ bgColor: 'bg-green-500',
82
+ },
83
+ {
84
+ name: '待处理',
85
+ value: 450,
86
+ color: '#faad14',
87
+ bgColor: 'bg-yellow-500',
88
+ },
89
+ { name: '已取消', value: 2280, color: '#ff4d4f', bgColor: 'bg-red-500' },
90
+ ],
91
+ salesTrend: [
92
+ { date: '周一', revenue: 8500, orders: 120, growth: 8.5 },
93
+ { date: '周二', revenue: 9200, orders: 135, growth: 12.2 },
94
+ { date: '周三', revenue: 8800, orders: 128, growth: -4.3 },
95
+ { date: '周四', revenue: 10500, orders: 150, growth: 19.3 },
96
+ { date: '周五', revenue: 12000, orders: 168, growth: 14.3 },
97
+ { date: '周六', revenue: 14800, orders: 195, growth: 23.3 },
98
+ { date: '周日', revenue: 16200, orders: 215, growth: 9.5 },
99
+ ],
100
+ topProducts: [
101
+ {
102
+ id: 1,
103
+ name: 'iPhone 15 Pro',
104
+ sales: 1580,
105
+ revenue: 1580000,
106
+ image: '📱',
107
+ },
108
+ { id: 2, name: 'MacBook Air', sales: 680, revenue: 680000, image: '💻' },
109
+ { id: 3, name: 'AirPods Pro', sales: 2200, revenue: 440000, image: '🎧' },
110
+ { id: 4, name: 'iPad Air', sales: 420, revenue: 252000, image: '📱' },
111
+ { id: 5, name: 'Apple Watch', sales: 860, revenue: 258000, image: '⌚' },
112
+ ],
113
+ recentOrders: [
114
+ {
115
+ id: 'ORD-2024-001',
116
+ customer: '张三',
117
+ amount: 12999,
118
+ status: 'completed',
119
+ time: '10分钟前',
120
+ },
121
+ {
122
+ id: 'ORD-2024-002',
123
+ customer: '李四',
124
+ amount: 5999,
125
+ status: 'pending',
126
+ time: '25分钟前',
127
+ },
128
+ {
129
+ id: 'ORD-2024-003',
130
+ customer: '王五',
131
+ amount: 8999,
132
+ status: 'completed',
133
+ time: '1小时前',
134
+ },
135
+ {
136
+ id: 'ORD-2024-004',
137
+ customer: '赵六',
138
+ amount: 25999,
139
+ status: 'completed',
140
+ time: '2小时前',
141
+ },
142
+ {
143
+ id: 'ORD-2024-005',
144
+ customer: '钱七',
145
+ amount: 799,
146
+ status: 'cancelled',
147
+ time: '3小时前',
148
+ },
149
+ ],
150
+ };
151
+
152
+ componentDidMount() {
153
+ this.loadDashboardData();
154
+ }
155
+
156
+ async loadDashboardData() {
157
+ // 这里可以连接真实的数据源
158
+ }
159
+
160
+ refreshData() {
161
+ this.loadDashboardData();
162
+ }
163
+
164
+ getStatusBadge(status) {
165
+ const statusConfig = {
166
+ completed: {
167
+ text: '已完成',
168
+ bgColor: 'bg-green-100',
169
+ textColor: 'text-green-700',
170
+ },
171
+ pending: {
172
+ text: '待处理',
173
+ bgColor: 'bg-yellow-100',
174
+ textColor: 'text-yellow-700',
175
+ },
176
+ cancelled: {
177
+ text: '已取消',
178
+ bgColor: 'bg-red-100',
179
+ textColor: 'text-red-700',
180
+ },
181
+ };
182
+ const config = statusConfig[status] || statusConfig.pending;
183
+ return (
184
+ <span
185
+ className={`px-2 py-1 text-xs font-medium rounded-full ${config.bgColor} ${config.textColor}`}
186
+ >
187
+ {config.text}
188
+ </span>
189
+ );
190
+ }
191
+
192
+ render() {
193
+ return (
194
+ <Page className="bg-gradient-to-br from-[#f8fafc] via-blue-50 to-indigo-50 min-h-screen">
195
+ <View className="bg-white/80 backdrop-blur-sm border-gray-200 border-b-[1px] border-b-solid pl-[24px] pr-[24px] pt-[16px] pb-[16px] sticky top-[0px] z-10">
196
+ <View className="flex items-center justify-between">
197
+ <View>
198
+ <h1 className="bg-gradient-to-r from-blue-600 to-purple-600 [WebkitBackgroundClip:text] [WebkitTextFillColor:transparent] [backgroundClip:text] [WebkitBackgroundClip:text] [WebkitTextFillColor:transparent] [backgroundClip:text] text-2xl font-bold">
199
+ 📊 数据概览
200
+ </h1>
201
+ <p className="text-[#6b7280] text-sm mt-[4px]">
202
+ 实时监控您的业务数据
203
+ </p>
204
+ </View>
205
+ <button
206
+ onClick={() => this.refreshData()}
207
+ className="hover:shadow-lg hover:scale-105 transition-all duration-300 bg-gradient-to-r from-blue-500 to-purple-500 pl-[16px] pr-[16px] pt-[8px] pb-[8px] text-[#ffffff] rounded-lg font-medium"
208
+ >
209
+ 🔄 刷新数据
210
+ </button>
211
+ </View>
212
+ </View>
213
+ <View className="p-[24px] ml-[auto] mr-[auto]">
214
+ <Row gutter={[20, 20]} className="mb-[32px]">
215
+ <Col xs={24} sm={12} lg={6} order={0}>
216
+ <Card
217
+ className="hover:shadow-2xl hover:-translate-y-1 transition-all duration-300 overflow-hidden"
218
+ actions={[]}
219
+ bordered={false}
220
+ hoverable={false}
221
+ loading={false}
222
+ size="default"
223
+ type="default"
224
+ >
225
+ <View className="-translate-y-1/2 translate-x-1/2 bg-gradient-to-br from-blue-400 to-blue-600 absolute top-[0px] right-[0px] w-[128px] h-[128px] rounded-full [opacity:0.1]" />
226
+ <View className="relative">
227
+ <View className="text-[#6b7280] text-sm font-medium mb-[8px] flex items-center">
228
+ <Text className="w-[32px] h-[32px] rounded-lg bg-[var(--blue-100)] flex items-center justify-center mr-[8px]">
229
+ 📦
230
+ </Text>
231
+ 总订单数
232
+ </View>
233
+ <View className="text-3xl font-bold mb-[4px]">
234
+ <Text>{this.state.totalOrders?.toLocaleString()}</Text>
235
+ </View>
236
+ <View className="text-sm text-[#10b981] flex items-center">
237
+ <Text className="mr-[4px]">↑</Text>12.5% 较上周
238
+ </View>
239
+ </View>
240
+ </Card>
241
+ </Col>
242
+ <Col xs={24} sm={12} lg={6}>
243
+ <Card
244
+ className="hover:shadow-2xl hover:-translate-y-1 transition-all duration-300 overflow-hidden"
245
+ actions={[]}
246
+ bordered={false}
247
+ hoverable={false}
248
+ loading={false}
249
+ size="default"
250
+ type="default"
251
+ >
252
+ <View className="-translate-y-1/2 translate-x-1/2 bg-gradient-to-br from-green-400 to-green-600 absolute top-[0px] right-[0px] w-[128px] h-[128px] rounded-full [opacity:0.1]" />
253
+ <View className="relative">
254
+ <View className="text-[#6b7280] text-sm font-medium mb-[8px] flex items-center">
255
+ <Text className="w-[32px] h-[32px] rounded-lg bg-[var(--green-100)] flex items-center justify-center mr-[8px]">
256
+ 💰
257
+ </Text>
258
+ 总收入
259
+ </View>
260
+ <View className="text-3xl font-bold mb-[4px]">
261
+ ¥
262
+ <Text numberOfLines={1}>
263
+ {this.state.totalRevenue?.toLocaleString()}
264
+ </Text>
265
+ </View>
266
+ <View className="text-sm text-[#10b981] flex items-center">
267
+ <Text className="mr-[4px]">↑</Text>18.3% 较上周
268
+ </View>
269
+ </View>
270
+ </Card>
271
+ </Col>
272
+ <Col xs={24} sm={12} lg={6} order={0}>
273
+ <Card
274
+ className="hover:shadow-2xl hover:-translate-y-1 transition-all duration-300 overflow-hidden"
275
+ actions={[]}
276
+ bordered={false}
277
+ hoverable={false}
278
+ loading={false}
279
+ size="default"
280
+ type="default"
281
+ >
282
+ <View className="-translate-y-1/2 translate-x-1/2 bg-gradient-to-br from-purple-400 to-purple-600 absolute top-[0px] right-[0px] w-[128px] h-[128px] rounded-full [opacity:0.1]" />
283
+ <View className="relative">
284
+ <View className="text-[#6b7280] text-sm font-medium mb-[8px] flex items-center">
285
+ <Text className="w-[32px] h-[32px] rounded-lg bg-[var(--purple-100)] flex items-center justify-center mr-[8px]">
286
+ 👥
287
+ </Text>
288
+ 活跃用户
289
+ </View>
290
+ <View className="text-3xl font-bold mb-[4px]">
291
+ <Text>{this.state.activeUsers?.toLocaleString()}</Text>
292
+ </View>
293
+ <View className="text-sm text-[#10b981] flex items-center">
294
+ <Text className="mr-[4px]">↑</Text>8.7% 较上周
295
+ </View>
296
+ </View>
297
+ </Card>
298
+ </Col>
299
+ <Col xs={24} sm={12} lg={6} order={0}>
300
+ <Card
301
+ className="hover:shadow-2xl hover:-translate-y-1 transition-all duration-300 overflow-hidden"
302
+ actions={[]}
303
+ bordered={false}
304
+ hoverable={false}
305
+ loading={false}
306
+ size="default"
307
+ type="default"
308
+ >
309
+ <View className="-translate-y-1/2 translate-x-1/2 bg-gradient-to-br from-[#fb923c] to-[#ea580c] absolute top-[0px] right-[0px] w-[128px] h-[128px] rounded-full [opacity:0.1]" />
310
+ <View className="relative">
311
+ <View className="text-[#6b7280] text-sm font-medium mb-[8px] flex items-center">
312
+ <Text className="w-[32px] h-[32px] rounded-lg bg-[var(--orange-100)] flex items-center justify-center mr-[8px]">
313
+
314
+ </Text>
315
+ 待处理订单
316
+ </View>
317
+ <View className="text-3xl font-bold mb-[4px]">
318
+ <Text>{this.state.pendingOrders}</Text>
319
+ </View>
320
+ <View className="text-sm flex items-center">
321
+ <Text className="mr-[4px]">⚡</Text>需要处理
322
+ </View>
323
+ </View>
324
+ </Card>
325
+ </Col>
326
+ </Row>
327
+ <Row gutter={[20, 20]} className="mb-[32px]">
328
+ <Col xs={24} md={8}>
329
+ <Card className="hover:shadow-xl transition-all duration-300 bg-gradient-to-br from-blue-500 to-blue-600 text-[#ffffff] overflow-hidden">
330
+ <View className="translate-x-1/3 translate-y-1/3 absolute bottom-[0px] right-[0px] w-[160px] h-[160px] bg-[#ffffff] [opacity:0.1] rounded-full" />
331
+ <View className="relative">
332
+ <View className="text-white/80 text-sm font-medium mb-[4px]">
333
+ 今日订单
334
+ </View>
335
+ <View className="text-4xl font-bold mb-[8px]">
336
+ <Text>{this.state.todayOrders}</Text>
337
+ </View>
338
+ <View className="text-white/70 text-sm flex items-center">
339
+ <Text className="mr-[4px]">↑</Text>较昨日 +12%
340
+ </View>
341
+ </View>
342
+ </Card>
343
+ </Col>
344
+ <Col xs={24} md={8} order={0}>
345
+ <Card className="hover:shadow-xl transition-all duration-300 bg-gradient-to-br from-green-500 to-green-600 text-[#ffffff] overflow-hidden">
346
+ <View className="translate-x-1/3 translate-y-1/3 absolute bottom-[0px] right-[0px] w-[160px] h-[160px] bg-[#ffffff] [opacity:0.1] rounded-full" />
347
+ <View className="relative">
348
+ <View className="text-white/80 text-sm font-medium mb-[4px]">
349
+ 今日收入
350
+ </View>
351
+ <View className="text-4xl font-bold mb-[8px]">
352
+ ¥<Text>{this.state.todayRevenue?.toLocaleString()}</Text>
353
+ </View>
354
+ <View className="text-white/70 text-sm flex items-center">
355
+ <Text className="mr-[4px]">↓</Text>较昨日 -9.6%
356
+ </View>
357
+ </View>
358
+ </Card>
359
+ </Col>
360
+ <Col xs={24} md={8}>
361
+ <Card className="hover:shadow-xl transition-all duration-300 bg-gradient-to-br from-purple-500 to-purple-600 text-[#ffffff] overflow-hidden">
362
+ <View className="translate-x-1/3 translate-y-1/3 absolute bottom-[0px] right-[0px] w-[160px] h-[160px] bg-[#ffffff] [opacity:0.1] rounded-full" />
363
+ <View className="relative">
364
+ <View className="text-white/80 text-sm font-medium mb-[4px]">
365
+ 本周收入
366
+ </View>
367
+ <View className="text-4xl font-bold mb-[8px]">
368
+ ¥<Text>{this.state.weekRevenue?.toLocaleString()}</Text>
369
+ </View>
370
+ <View className="text-white/70 text-sm flex items-center">
371
+ <Text className="mr-[4px]">↑</Text>较上周 +15.3%
372
+ </View>
373
+ </View>
374
+ </Card>
375
+ </Col>
376
+ </Row>
377
+ <Row gutter={[20, 20]} className="mb-[32px]">
378
+ <Col xs={24} lg={14}>
379
+ <Card
380
+ title={
381
+ <View className="flex items-center">
382
+ <Text className="mr-[8px]">📈</Text>
383
+ <Text className="font-bold text-[#1f2937]">
384
+ 销售趋势(近7天)
385
+ </Text>
386
+ </View>
387
+ }
388
+ className="hover:shadow-xl transition-all duration-300"
389
+ >
390
+ <View className="space-y-3">
391
+ {this.state.salesTrend.map((item, index) => (
392
+ <View
393
+ key={index}
394
+ className="hover:from-blue-50 hover:to-indigo-50 transition-all duration-300 bg-gradient-to-r from-[#f9fafb] to-blue-50 flex items-center justify-between p-[16px] rounded-lg"
395
+ >
396
+ <View className="flex items-center">
397
+ <View
398
+ className={`w-12 h-12 rounded-xl flex items-center justify-center mr-4 ${
399
+ index % 2 === 0 ? 'bg-blue-500' : 'bg-purple-500'
400
+ } text-white font-bold`}
401
+ >
402
+ <Text>{item.date.substring(1)}</Text>
403
+ </View>
404
+ <View>
405
+ <View className="font-semibold text-[#1f2937]">
406
+ <Text>{item.date}</Text>
407
+ </View>
408
+ <View className="text-sm text-[#6b7280]">
409
+ <Text>{item.orders}</Text>订单
410
+ </View>
411
+ </View>
412
+ </View>
413
+ <View className="">
414
+ <View className="font-bold text-lg text-[#1f2937]">
415
+ ¥<Text>{item.revenue?.toLocaleString()}</Text>
416
+ </View>
417
+ <View
418
+ className={`text-sm font-medium ${
419
+ item.growth >= 0 ? 'text-green-500' : 'text-red-500'
420
+ }`}
421
+ >
422
+ {item.growth >= 0 ? '↑' : '↓'}
423
+ <Text>{Math.abs(item.growth)}</Text>%
424
+ </View>
425
+ </View>
426
+ </View>
427
+ ))}
428
+ </View>
429
+ </Card>
430
+ </Col>
431
+ <Col xs={24} lg={10} order={0}>
432
+ <Card
433
+ title={
434
+ <View className="flex items-center">
435
+ <Text className="mr-[8px]">🏆</Text>
436
+ <Text className="font-bold text-[#1f2937]">
437
+ 商品销量 TOP 5
438
+ </Text>
439
+ </View>
440
+ }
441
+ className="hover:shadow-xl transition-all duration-300"
442
+ >
443
+ <View className="space-y-3">
444
+ {this.state.topProducts.map((product, index) => (
445
+ <View
446
+ key={product.id}
447
+ className="hover:from-yellow-50 hover:to-orange-50 transition-all duration-300 group bg-gradient-to-r from-[#f9fafb] to-[#f3f4f6] flex items-center justify-between p-[16px] rounded-xl cursor-pointer"
448
+ >
449
+ <View className="flex items-center">
450
+ <View
451
+ className={`w-10 h-10 rounded-full flex items-center justify-center mr-3 text-xl ${
452
+ index === 0
453
+ ? 'bg-gradient-to-br from-yellow-400 to-yellow-600'
454
+ : index === 1
455
+ ? 'bg-gradient-to-br from-gray-300 to-gray-500'
456
+ : index === 2
457
+ ? 'bg-gradient-to-br from-orange-400 to-orange-600'
458
+ : 'bg-gradient-to-br from-gray-200 to-gray-300'
459
+ }`}
460
+ >
461
+ <Text>{index + 1}</Text>
462
+ </View>
463
+ <View className="group-hover:scale-110 transition-transform duration-300 text-2xl mr-[12px]">
464
+ <Text>{product.image}</Text>
465
+ </View>
466
+ <View>
467
+ <View className="text-gray-800 group-hover:text-blue-600 transition-colors font-semibold">
468
+ <Text>{product.name}</Text>
469
+ </View>
470
+ <View className="text-sm text-[#6b7280]">
471
+ 销量:<Text>{product.sales}</Text>
472
+ </View>
473
+ </View>
474
+ </View>
475
+ <View className="">
476
+ <View className="font-bold">
477
+ ¥<Text>{product.revenue?.toLocaleString()}</Text>
478
+ </View>
479
+ <View className="text-xs text-[#6b7280]">营收</View>
480
+ </View>
481
+ </View>
482
+ ))}
483
+ </View>
484
+ </Card>
485
+ </Col>
486
+ </Row>
487
+ <Row gutter={[20, 20]}>
488
+ <Col xs={24} lg={12}>
489
+ <Card
490
+ title={
491
+ <View className="flex items-center">
492
+ <Text className="mr-[8px]">📊</Text>
493
+ <Text className="font-bold text-[#1f2937]">
494
+ 订单状态分布
495
+ </Text>
496
+ </View>
497
+ }
498
+ className="hover:shadow-xl transition-all duration-300"
499
+ >
500
+ <View className="space-y-6">
501
+ {this.state.orderStatus.map((item, index) => {
502
+ const percentage = (
503
+ (item.value / this.state.totalOrders) *
504
+ 100
505
+ ).toFixed(1);
506
+ return (
507
+ <View key={index}>
508
+ <View className="flex items-center justify-between mb-[8px]">
509
+ <View className="flex items-center">
510
+ <View
511
+ className={`w-3 h-3 rounded-full ${item.bgColor} mr-2`}
512
+ />
513
+ <Text className="font-medium text-[#374151]">
514
+ {item.name}
515
+ </Text>
516
+ </View>
517
+ <Text className="font-bold text-[#1f2937]">
518
+ {item.value.toLocaleString()}单
519
+ </Text>
520
+ </View>
521
+ <View className="w-full bg-[#e5e7eb] rounded-full h-[16px] overflow-hidden">
522
+ <View
523
+ className="h-full rounded-full transition-all duration-500 ease-out flex items-center justify-end pr-2"
524
+ style={{
525
+ width: `${percentage}%`,
526
+ backgroundColor: item.color,
527
+ }}
528
+ >
529
+ <Text className="text-xs text-[#ffffff] font-medium">
530
+ {percentage}%
531
+ </Text>
532
+ </View>
533
+ </View>
534
+ </View>
535
+ );
536
+ })}
537
+ </View>
538
+ </Card>
539
+ </Col>
540
+ <Col xs={24} lg={12}>
541
+ <Card
542
+ title={
543
+ <View className="flex items-center">
544
+ <Text className="mr-[8px]">📋</Text>
545
+ <Text className="font-bold text-[#1f2937]">最近订单</Text>
546
+ </View>
547
+ }
548
+ className="hover:shadow-xl transition-all duration-300"
549
+ actions={[]}
550
+ bordered={false}
551
+ hoverable={false}
552
+ loading={false}
553
+ size="default"
554
+ type="default"
555
+ >
556
+ <View className="space-y-3">
557
+ {this.state.recentOrders.map((order, index) => (
558
+ <View
559
+ key={index}
560
+ className="hover:from-blue-100 hover:to-purple-100 transition-all duration-300 group bg-gradient-to-r from-[#f9fafb] to-blue-50 flex items-center justify-between p-[16px] rounded-xl cursor-pointer"
561
+ >
562
+ <View className="flex-1">
563
+ <View className="flex items-center justify-between">
564
+ <View className="text-gray-800 group-hover:text-blue-600 transition-colors font-semibold">
565
+ <Text>{order.id}</Text>
566
+ </View>
567
+ <Text>{this.getStatusBadge(order.status)}</Text>
568
+ </View>
569
+ <View className="text-sm text-[#6b7280] mt-[4px]">
570
+ <Text>{order.customer}</Text>·
571
+ <Text>{order.time}</Text>
572
+ </View>
573
+ </View>
574
+ <View className="ml-[16px]">
575
+ <View className="font-bold text-lg text-[#1f2937]">
576
+ ¥<Text>{order.amount?.toLocaleString()}</Text>
577
+ </View>
578
+ </View>
579
+ </View>
580
+ ))}
581
+ </View>
582
+ </Card>
583
+ </Col>
584
+ </Row>
585
+ </View>
586
+ </Page>
587
+ );
588
+ }
589
+ }
590
+
591
+ export default Document;