@appthen/cli 1.2.10 → 1.2.12

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 (173) hide show
  1. package/.gitignore +1 -0
  2. package/bin/main.js +92 -0
  3. package/dist/index.js +7014 -14988
  4. package/package.json +8 -1
  5. package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1862 -0
  6. package/tests/test-app/.appthen/space-config.json +8 -0
  7. package/tests/test-app/docs/AI-Workflow.flow +112 -0
  8. package/tests/test-app/docs/Logic-1.flow +16 -0
  9. package/tests/test-app/docs/Logic.flow +16 -0
  10. package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
  11. package/tests/test-app/docs/Project-Blueprint.flow +119 -0
  12. package/tests/test-app/docs/README.md +3 -0
  13. package/tests/test-app/docs/claude.md +194 -0
  14. package/tests/test-app/docs/page_requirement_analysis.md +149 -0
  15. package/tests/test-app/docs//345/267/245/345/215/225/347/256/241/347/220/206/347/263/273/347/273/237/350/257/246/347/273/206/350/256/276/350/256/241.md +377 -0
  16. package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
  17. package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
  18. package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
  19. package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
  20. package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
  21. package/tests/test-app/src/app.css +15 -0
  22. package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
  23. package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
  24. package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
  25. package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
  26. package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
  27. package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
  28. package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
  29. package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
  30. package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
  31. package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
  32. package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
  33. package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
  34. package/tests/test-app/src/components/Button.js +11 -0
  35. package/tests/test-app/src/components/MessageCenter.tsx +506 -0
  36. package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
  37. package/tests/test-app/src/components/Timeline.tsx +145 -0
  38. package/tests/test-app/src/index.ts +2 -0
  39. package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
  40. package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
  41. package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
  42. package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
  43. package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
  44. package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
  45. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
  46. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
  47. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
  48. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
  49. package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
  50. package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
  51. package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
  52. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
  53. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
  54. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
  55. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
  56. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
  57. package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
  58. package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
  59. package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
  60. package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/344/272/247/345/223/201/350/256/276/350/256/241/346/226/207/346/241/243.md +301 -0
  61. package/tests/test-app/src/modules/work_order_module//345/267/245/345/215/225/347/263/273/347/273/237/345/274/200/345/217/221/344/273/273/345/212/241/345/210/206/345/267/245/346/226/207/346/241/243.md +345 -0
  62. package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
  63. package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
  64. package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
  65. package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
  66. package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
  67. package/tests/test-app/src/pages/DataReport.tsx +298 -0
  68. package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
  69. package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
  70. package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
  71. package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
  72. package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
  73. package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
  74. package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
  75. package/tests/test-app/src/pages/SLAManagement.tsx +668 -0
  76. package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
  77. package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
  78. package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
  79. package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
  80. package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
  81. package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
  82. package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
  83. package/tests/test-app/src/pages/TicketList.tsx +27 -0
  84. package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
  85. package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
  86. package/tests/test-app/src/pages/UserProfile.tsx +404 -0
  87. package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
  88. package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
  89. package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
  90. package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
  91. package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
  92. package/tests/test-app/src/pages/article-list.tsx +222 -0
  93. package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
  94. package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
  95. package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
  96. package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
  97. package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
  98. package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
  99. package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
  100. package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
  101. package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
  102. package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
  103. package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
  104. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
  105. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
  106. package/tests/test-app/src/pages/category-list.tsx +179 -0
  107. package/tests/test-app/src/pages/comment-list.tsx +194 -0
  108. package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
  109. package/tests/test-app/src/pages/cover.tsx +42 -0
  110. package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
  111. package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
  112. package/tests/test-app/src/pages/data-overview.tsx +600 -0
  113. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
  114. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
  115. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
  116. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
  117. package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
  118. package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
  119. package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
  120. package/tests/test-app/src/pages/department-list.tsx +183 -0
  121. package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
  122. package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
  123. package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
  124. package/tests/test-app/src/pages/goods-list.tsx +233 -0
  125. package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
  126. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
  127. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
  128. package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
  129. package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
  130. package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
  131. package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
  132. package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
  133. package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
  134. package/tests/test-app/src/pages/notice-list.tsx +217 -0
  135. package/tests/test-app/src/pages/order-detail.tsx +330 -0
  136. package/tests/test-app/src/pages/order-list.tsx +195 -0
  137. package/tests/test-app/src/pages/order-management.tsx +563 -0
  138. package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
  139. package/tests/test-app/src/pages/role-list.tsx +184 -0
  140. package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
  141. package/tests/test-app/src/pages/simple-page.tsx +43 -0
  142. package/tests/test-app/src/pages/test-destructure.tsx +44 -0
  143. package/tests/test-app/src/pages/test-error-page.tsx +75 -0
  144. package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
  145. package/tests/test-app/src/pages/test-page.tsx +101 -0
  146. package/tests/test-app/src/pages/test-render.tsx +52 -0
  147. package/tests/test-app/src/pages/test-return-type.tsx +41 -0
  148. package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
  149. package/tests/test-app/src/pages/testPage.css +3 -0
  150. package/tests/test-app/src/pages/testPage.tsx +158 -0
  151. package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
  152. package/tests/test-app/src/pages/user-list.tsx +212 -0
  153. package/tests/test-app/src/pages/web_version/website.css +205 -0
  154. package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
  155. package/tests/test-app/src/pages/wrong-page.tsx +50 -0
  156. package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
  157. package/tests/test-app/src/project.json +1120 -0
  158. package/tests/test-app/src/store/global.store.ts +10 -0
  159. package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
  160. package/tests/test-app/src/types/SLAPolicy.ts +50 -0
  161. package/tests/test-app/src/types/Ticket.ts +68 -0
  162. package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
  163. package/tests/test-app/src/types/TicketComment.m.ts +59 -0
  164. package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
  165. package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
  166. package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
  167. package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
  168. package/tests/test-app/src/types/TicketRecord.ts +47 -0
  169. package/tests/test-app/src/types/TrainDoor.ts +284 -0
  170. package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
  171. package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
  172. package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
  173. package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
@@ -0,0 +1,637 @@
1
+ /**
2
+ * 赛博朋克产品管理
3
+ * 充满未来科技感的产品管理页面,采用全息卡片和霓虹效果
4
+ *
5
+ * @type Page
6
+ * @route /cyberpunk-product-management
7
+ * @screen 1920x1080 #0a0a0f
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+ import { Button, Image, Text, View } from '@appthen/react';
12
+ import { Input, Select, Space, Tag } from '@appthen/antd';
13
+
14
+
15
+ class IProps {
16
+ title?: string;
17
+ }
18
+
19
+ /*
20
+ * 数据与接口请求定义
21
+ */
22
+ class IState {
23
+ products?: {
24
+ /* @example 1 */id?: number,
25
+ /* @example 神经植入体 V7 */name?: string,
26
+ /* @example implants */category?: string,
27
+ /* @example 8999 */price?: number,
28
+ /* @example 42 */stock?: number,
29
+ /* @example available */status?: string,
30
+ /* @example 4.8 */rating?: number,
31
+ /* @example https://via.placeholder.com/200x200/00ffff/000000?text=NEURAL */image?: string,
32
+ /* @example 最新一代神经接口,支持直接脑机连接 */description?: string,
33
+ features?: string[],
34
+ }[];
35
+ filteredProducts?: string[];
36
+ selectedCategory?: string;
37
+ searchKeyword?: string;
38
+ selectedProduct?: any;
39
+ modalVisible?: boolean;
40
+ viewMode?: string;
41
+ sortBy?: string;
42
+ hologramMode?: boolean;
43
+ }
44
+
45
+ class Document extends React.Component<IProps, IState> {
46
+ state = {
47
+ products: [
48
+ {
49
+ id: 1,
50
+ name: '神经植入体 V7',
51
+ category: 'implants',
52
+ price: 8999,
53
+ stock: 42,
54
+ status: 'available',
55
+ rating: 4.8,
56
+ image: 'https://via.placeholder.com/200x200/00ffff/000000?text=NEURAL',
57
+ description: '最新一代神经接口,支持直接脑机连接',
58
+ features: ['低延迟', '高带宽', '自适应'],
59
+ },
60
+ {
61
+ id: 2,
62
+ name: '量子处理器核心',
63
+ category: 'hardware',
64
+ price: 15999,
65
+ stock: 18,
66
+ status: 'limited',
67
+ rating: 4.9,
68
+ image: 'https://via.placeholder.com/200x200/ff00ff/000000?text=QUANTUM',
69
+ description: '突破性的量子计算单元,算力提升1000倍',
70
+ features: ['超导', '稳定', '可扩展'],
71
+ },
72
+ {
73
+ id: 3,
74
+ name: '全息投影仪',
75
+ category: 'devices',
76
+ price: 4999,
77
+ stock: 67,
78
+ status: 'available',
79
+ rating: 4.5,
80
+ image:
81
+ 'https://via.placeholder.com/200x200/00ff88/000000?text=HOLOGRAM',
82
+ description: '8K 分辨率全息投影,支持360度观看',
83
+ features: ['8K', '360°', '触控'],
84
+ },
85
+ {
86
+ id: 4,
87
+ name: '纳米修复机器人',
88
+ category: 'medical',
89
+ price: 24999,
90
+ stock: 8,
91
+ status: 'limited',
92
+ rating: 4.7,
93
+ image: 'https://via.placeholder.com/200x200/ffaa00/000000?text=NANO',
94
+ description: '智能纳米机器人,快速修复细胞损伤',
95
+ features: ['精准', '快速', '安全'],
96
+ },
97
+ {
98
+ id: 5,
99
+ name: '反重力推进器',
100
+ category: 'vehicles',
101
+ price: 49999,
102
+ stock: 3,
103
+ status: 'rare',
104
+ rating: 5,
105
+ image: 'https://via.placeholder.com/200x200/ff0055/000000?text=GRAVITY',
106
+ description: '个人飞行装置,最高时速500km/h',
107
+ features: ['静音', '高效', '稳定'],
108
+ },
109
+ {
110
+ id: 6,
111
+ name: '记忆芯片 1PB',
112
+ category: 'storage',
113
+ price: 2999,
114
+ stock: 156,
115
+ status: 'available',
116
+ rating: 4.3,
117
+ image: 'https://via.placeholder.com/200x200/00ffff/000000?text=MEMORY',
118
+ description: '超高密度存储,可保存整个人类记忆',
119
+ features: ['1PB', '快速', '加密'],
120
+ },
121
+ {
122
+ id: 7,
123
+ name: '能量护盾发生器',
124
+ category: 'defense',
125
+ price: 12999,
126
+ stock: 24,
127
+ status: 'available',
128
+ rating: 4.6,
129
+ image: 'https://via.placeholder.com/200x200/ff00ff/000000?text=SHIELD',
130
+ description: '便携式能量护盾,可抵御物理和能量攻击',
131
+ features: ['轻便', '强效', '持久'],
132
+ },
133
+ {
134
+ id: 8,
135
+ name: 'AI 助手核心',
136
+ category: 'software',
137
+ price: 7999,
138
+ stock: 89,
139
+ status: 'available',
140
+ rating: 4.4,
141
+ image: 'https://via.placeholder.com/200x200/00ff88/000000?text=AI',
142
+ description: '个人AI助手,全天候智能服务',
143
+ features: ['学习', '推理', '创造'],
144
+ },
145
+ {
146
+ id: 9,
147
+ name: '隐形迷彩服',
148
+ category: 'clothing',
149
+ price: 6999,
150
+ stock: 31,
151
+ status: 'limited',
152
+ rating: 4.5,
153
+ image: 'https://via.placeholder.com/200x200/ffaa00/000000?text=CLOAK',
154
+ description: '光学隐形技术,完全融入环境',
155
+ features: ['隐形', '透气', '耐用'],
156
+ },
157
+ {
158
+ id: 10,
159
+ name: '时间扭曲器',
160
+ category: 'experimental',
161
+ price: 99999,
162
+ stock: 1,
163
+ status: 'rare',
164
+ rating: 5,
165
+ image: 'https://via.placeholder.com/200x200/ff0055/000000?text=TIME',
166
+ description: '实验性时间操控设备,慎用',
167
+ features: ['危险', '强大', '实验'],
168
+ },
169
+ ],
170
+ filteredProducts: [],
171
+ selectedCategory: 'all',
172
+ searchKeyword: '',
173
+ selectedProduct: null,
174
+ modalVisible: false,
175
+ viewMode: 'grid',
176
+ sortBy: 'name',
177
+ hologramMode: true,
178
+ };
179
+
180
+ componentDidMount() {
181
+ this.filterProducts();
182
+ }
183
+
184
+ filterProducts() {
185
+ let filtered = this.state.products;
186
+ if (this.state.selectedCategory !== 'all') {
187
+ filtered = filtered.filter(
188
+ p => p.category === this.state.selectedCategory
189
+ );
190
+ }
191
+ if (this.state.searchKeyword) {
192
+ const keyword = this.state.searchKeyword.toLowerCase();
193
+ filtered = filtered.filter(
194
+ p =>
195
+ p.name.toLowerCase().includes(keyword) ||
196
+ p.description.toLowerCase().includes(keyword)
197
+ );
198
+ }
199
+ if (this.state.sortBy === 'price') {
200
+ filtered = [...filtered].sort((a, b) => b.price - a.price);
201
+ } else if (this.state.sortBy === 'rating') {
202
+ filtered = [...filtered].sort((a, b) => b.rating - a.rating);
203
+ } else if (this.state.sortBy === 'stock') {
204
+ filtered = [...filtered].sort((a, b) => b.stock - a.stock);
205
+ }
206
+ this.setState({
207
+ filteredProducts: filtered,
208
+ });
209
+ }
210
+
211
+ handleCategoryChange(value) {
212
+ this.setState(
213
+ {
214
+ selectedCategory: value,
215
+ },
216
+ () => this.filterProducts()
217
+ );
218
+ }
219
+
220
+ handleSearch(value) {
221
+ this.setState(
222
+ {
223
+ searchKeyword: value,
224
+ },
225
+ () => this.filterProducts()
226
+ );
227
+ }
228
+
229
+ handleSortChange(value) {
230
+ this.setState(
231
+ {
232
+ sortBy: value,
233
+ },
234
+ () => this.filterProducts()
235
+ );
236
+ }
237
+
238
+ handleViewProduct(product) {
239
+ this.setState({
240
+ selectedProduct: product,
241
+ modalVisible: true,
242
+ });
243
+ }
244
+
245
+ handleCloseModal() {
246
+ this.setState({
247
+ modalVisible: false,
248
+ });
249
+ }
250
+
251
+ handleAddProduct() {
252
+ this.utils.showToast('添加新产品');
253
+ }
254
+
255
+ handleEditProduct(product) {
256
+ this.utils.showToast(`编辑产品: ${product.name}`);
257
+ }
258
+
259
+ handleDeleteProduct(product) {
260
+ this.utils.showToast(`删除产品: ${product.name}`);
261
+ }
262
+
263
+ toggleViewMode() {
264
+ this.setState({
265
+ viewMode: this.state.viewMode === 'grid' ? 'list' : 'grid',
266
+ });
267
+ }
268
+
269
+ toggleHologramMode() {
270
+ this.setState({
271
+ hologramMode: !this.state.hologramMode,
272
+ });
273
+ }
274
+
275
+ getStatusColor(status) {
276
+ switch (status) {
277
+ case 'available':
278
+ return '#00ff88';
279
+ case 'limited':
280
+ return '#ffaa00';
281
+ case 'rare':
282
+ return '#ff00ff';
283
+ default:
284
+ return '#888888';
285
+ }
286
+ }
287
+
288
+ getStatusText(status) {
289
+ switch (status) {
290
+ case 'available':
291
+ return '现货';
292
+ case 'limited':
293
+ return '限量';
294
+ case 'rare':
295
+ return '稀有';
296
+ default:
297
+ return status;
298
+ }
299
+ }
300
+
301
+ getCategoryColor(category) {
302
+ const colors = {
303
+ implants: '#00ffff',
304
+ hardware: '#ff00ff',
305
+ devices: '#00ff88',
306
+ medical: '#ffaa00',
307
+ vehicles: '#ff0055',
308
+ storage: '#00ffff',
309
+ defense: '#ff00ff',
310
+ software: '#00ff88',
311
+ clothing: '#ffaa00',
312
+ experimental: '#ff0055',
313
+ };
314
+ return colors[category] || '#888888';
315
+ }
316
+
317
+ render() {
318
+ return (
319
+ <Page style={styles.container}>
320
+ <View style={styles.scanlines} />
321
+ <View style={styles.grid} />
322
+ <View style={styles.particles} />
323
+ <View style={styles.header}>
324
+ <View style={styles.headerLeft}>
325
+ <Text style={styles.title}>产品管理</Text>
326
+ <Text style={styles.subtitle}>PRODUCT MANAGEMENT SYSTEM</Text>
327
+ </View>
328
+ <View style={styles.headerRight}>
329
+ <Button
330
+ style={styles.cyberButton}
331
+ onClick={() => this.toggleHologramMode()}
332
+ >
333
+ <Text style={styles.buttonText}>
334
+ {this.state.hologramMode ? '关闭全息' : '开启全息'}
335
+ </Text>
336
+ </Button>
337
+ <Button
338
+ style={[styles.cyberButton, styles.primaryButton]}
339
+ onClick={() => this.handleAddProduct()}
340
+ >
341
+ <Text style={styles.buttonText}>+ 新增产品</Text>
342
+ </Button>
343
+ </View>
344
+ </View>
345
+ <View style={styles.toolbar}>
346
+ <View style={styles.toolbarLeft}>
347
+ <Input
348
+ placeholder="搜索产品..."
349
+ style={styles.searchInput}
350
+ value={this.state.searchKeyword}
351
+ onChange={e => this.handleSearch(e.target.value)}
352
+ />
353
+ <Select
354
+ style={styles.categorySelect}
355
+ value={this.state.selectedCategory}
356
+ onChange={value => this.handleCategoryChange(value)}
357
+ >
358
+ {categories.map((cat, index) => (
359
+ <Select.Option key={cat.value} value={cat.value}>
360
+ <Text className="text-[#ffffff]">{cat.label}</Text>
361
+ </Select.Option>
362
+ ))}
363
+ </Select>
364
+ <Select
365
+ style={styles.sortSelect}
366
+ value={this.state.sortBy}
367
+ onChange={value => this.handleSortChange(value)}
368
+ >
369
+ <Select.Option value="name">
370
+ <Text className="text-[#ffffff]">按名称</Text>
371
+ </Select.Option>
372
+ <Select.Option value="price">
373
+ <Text className="text-[#ffffff]">按价格</Text>
374
+ </Select.Option>
375
+ <Select.Option value="rating">
376
+ <Text className="text-[#ffffff]">按评分</Text>
377
+ </Select.Option>
378
+ <Select.Option value="stock">
379
+ <Text className="text-[#ffffff]">按库存</Text>
380
+ </Select.Option>
381
+ </Select>
382
+ </View>
383
+ <View style={styles.toolbarRight}>
384
+ <Text style={styles.totalText}>
385
+ 共{this.state.filteredProducts?.length}件产品
386
+ </Text>
387
+ <Button
388
+ style={styles.viewModeButton}
389
+ onClick={() => this.toggleViewMode()}
390
+ >
391
+ <Text style={styles.buttonText}>
392
+ {this.state.viewMode === 'grid' ? '列表' : '网格'}
393
+ </Text>
394
+ </Button>
395
+ </View>
396
+ </View>
397
+ <View style={styles.productContainer}>
398
+ {!!(this.state.viewMode === 'grid') && (
399
+ <View style={styles.productGrid}>
400
+ {this.state.filteredProducts.map((product, index) => (
401
+ <View
402
+ key={product.id}
403
+ style={[
404
+ styles.productCard,
405
+ this.state.hologramMode && styles.productCardHologram,
406
+ ]}
407
+ onClick={() => this.handleViewProduct(product)}
408
+ >
409
+ <View style={styles.productImageContainer}>
410
+ <Image src={product.image} style={styles.productImage} />
411
+ <View
412
+ style={[
413
+ styles.statusBadge,
414
+ {
415
+ backgroundColor:
416
+ this.getStatusColor(product.status) + '33',
417
+ borderColor: this.getStatusColor(product.status),
418
+ },
419
+ ]}
420
+ >
421
+ <Text
422
+ style={[
423
+ styles.statusText,
424
+ { color: this.getStatusColor(product.status) },
425
+ ]}
426
+ >
427
+ {this.getStatusText(product.status)}
428
+ </Text>
429
+ </View>
430
+ </View>
431
+ <View style={styles.productInfo}>
432
+ <Text style={styles.productName}>{product.name}</Text>
433
+ <Tag
434
+ color={this.getCategoryColor(product.category)}
435
+ style={styles.categoryTag}
436
+ >
437
+ <Text>
438
+ {
439
+ this.categories.find(function (c) {
440
+ return c.value === product.category;
441
+ })?.label
442
+ }
443
+ </Text>
444
+ </Tag>
445
+ <View style={styles.productMeta}>
446
+ <Text style={styles.productPrice}>
447
+ ¥{product.price.toLocaleString()}
448
+ </Text>
449
+ <Text style={styles.productRating}>
450
+ ★{product.rating}
451
+ </Text>
452
+ </View>
453
+ <View style={styles.productStock}>
454
+ <Text style={styles.stockLabel}>库存:</Text>
455
+ <Text style={styles.stockValue}>{product.stock}</Text>
456
+ </View>
457
+ </View>
458
+ </View>
459
+ ))}
460
+ </View>
461
+ )}
462
+ {!(this.state.viewMode === 'grid') && (
463
+ <View style={styles.productList}>
464
+ {this.state.filteredProducts.map((product, index) => (
465
+ <View
466
+ key={product.id}
467
+ style={[
468
+ styles.productListItem,
469
+ this.state.hologramMode && styles.productListItemHologram,
470
+ ]}
471
+ onClick={() => this.handleViewProduct(product)}
472
+ >
473
+ <Image src={product.image} style={styles.listItemImage} />
474
+ <View style={styles.listItemInfo}>
475
+ <Text style={styles.listItemName}>{product.name}</Text>
476
+ <Text style={styles.listItemDescription}>
477
+ {product.description}
478
+ </Text>
479
+ </View>
480
+ <View style={styles.listItemMeta}>
481
+ <Text style={styles.listItemPrice}>
482
+ ¥{product.price.toLocaleString()}
483
+ </Text>
484
+ <Text style={styles.listItemRating}>★{product.rating}</Text>
485
+ <Text style={styles.listItemStock}>
486
+ 库存:{product.stock}
487
+ </Text>
488
+ </View>
489
+ <View style={styles.listItemActions}>
490
+ <Button
491
+ size="small"
492
+ style={styles.actionButton}
493
+ onClick={e => {
494
+ e.stopPropagation();
495
+ this.handleEditProduct(product);
496
+ }}
497
+ >
498
+ 编辑
499
+ </Button>
500
+ <Button
501
+ size="small"
502
+ style={[styles.actionButton, styles.deleteButton]}
503
+ onClick={e => {
504
+ e.stopPropagation();
505
+ this.handleDeleteProduct(product);
506
+ }}
507
+ >
508
+ 删除
509
+ </Button>
510
+ </View>
511
+ </View>
512
+ ))}
513
+ </View>
514
+ )}
515
+ </View>
516
+ {!!this.state.modalVisible && (
517
+ <View
518
+ style={styles.modalOverlay}
519
+ onClick={() => this.handleCloseModal()}
520
+ >
521
+ <View style={styles.modal} onClick={e => e.stopPropagation()}>
522
+ <View style={styles.modalHeader}>
523
+ <Text style={styles.modalTitle}>产品详情</Text>
524
+ <Button
525
+ style={styles.closeButton}
526
+ onClick={() => this.handleCloseModal()}
527
+ >
528
+ <Text style={styles.closeButtonText}>✕</Text>
529
+ </Button>
530
+ </View>
531
+ <View style={styles.modalContent}>
532
+ <View style={styles.modalImageSection}>
533
+ <Image
534
+ src={this.state.selectedProduct?.image}
535
+ style={styles.modalImage}
536
+ />
537
+ </View>
538
+ <View style={styles.modalInfoSection}>
539
+ <Text style={styles.modalProductName}>
540
+ {this.state.selectedProduct?.name}
541
+ </Text>
542
+ <View style={styles.modalTags}>
543
+ <Tag
544
+ color={this.getCategoryColor(
545
+ this.state.selectedProduct?.category
546
+ )}
547
+ style={styles.modalTag}
548
+ >
549
+ <Text>
550
+ {
551
+ this.categories.find(function (c) {
552
+ return (
553
+ c.value === this.state.selectedProduct?.category
554
+ );
555
+ })?.label
556
+ }
557
+ </Text>
558
+ </Tag>
559
+ <Tag
560
+ color={this.getStatusColor(
561
+ this.state.selectedProduct?.status
562
+ )}
563
+ style={styles.modalTag}
564
+ >
565
+ <Text>
566
+ {this.getStatusText(this.state.selectedProduct?.status)}
567
+ </Text>
568
+ </Tag>
569
+ </View>
570
+ <Text style={styles.modalDescription}>
571
+ {this.state.selectedProduct?.description}
572
+ </Text>
573
+ <View style={styles.modalFeatures}>
574
+ <Text style={styles.featuresTitle}>特性:</Text>
575
+ {(this.state.selectedProduct?.features).map(
576
+ (feature, index) => (
577
+ <Tag
578
+ key={index}
579
+ color="#00ffff"
580
+ style={styles.featureTag}
581
+ >
582
+ <Text>{feature}</Text>
583
+ </Tag>
584
+ )
585
+ )}
586
+ </View>
587
+ <View style={styles.modalMeta}>
588
+ <View style={styles.metaItem}>
589
+ <Text style={styles.metaLabel}>价格</Text>
590
+ <Text style={styles.metaValue}>
591
+ ¥{this.state.selectedProduct?.price?.toLocaleString()}
592
+ </Text>
593
+ </View>
594
+ <View style={styles.metaItem}>
595
+ <Text style={styles.metaLabel}>评分</Text>
596
+ <Text style={styles.metaValue}>
597
+ ★{this.state.selectedProduct?.rating}
598
+ </Text>
599
+ </View>
600
+ <View style={styles.metaItem}>
601
+ <Text style={styles.metaLabel}>库存</Text>
602
+ <Text style={styles.metaValue}>
603
+ {this.state.selectedProduct?.stock}
604
+ </Text>
605
+ </View>
606
+ </View>
607
+ </View>
608
+ </View>
609
+ <View style={styles.modalFooter}>
610
+ <Button
611
+ style={[styles.cyberButton, styles.modalButton]}
612
+ onClick={() => this.handleCloseModal()}
613
+ >
614
+ <Text style={styles.buttonText}>关闭</Text>
615
+ </Button>
616
+ <Button
617
+ style={[
618
+ styles.cyberButton,
619
+ styles.primaryButton,
620
+ styles.modalButton,
621
+ ]}
622
+ onClick={() =>
623
+ this.handleEditProduct(this.state.selectedProduct)
624
+ }
625
+ >
626
+ <Text style={styles.buttonText}>编辑产品</Text>
627
+ </Button>
628
+ </View>
629
+ </View>
630
+ </View>
631
+ )}
632
+ </Page>
633
+ );
634
+ }
635
+ }
636
+
637
+ export default Document;