@appthen/cli 1.2.11 → 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 (59) hide show
  1. package/bin/main.js +47 -0
  2. package/dist/index.js +6165 -14980
  3. package/package.json +8 -1
  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
@@ -3,6 +3,6 @@
3
3
  "projectRoot": "/Users/huanglei/Documents/work/ruoqing/editor/packages/cli/tests/test-app",
4
4
  "projectId": "66123f22b93b36e6a40dbcb9",
5
5
  "userId": 100001,
6
- "createdAt": "2026-01-27T03:47:59.733Z",
7
- "lastAccess": "2026-01-27T03:47:59.733Z"
6
+ "createdAt": "2026-02-08T07:47:23.181Z",
7
+ "lastAccess": "2026-02-08T07:47:23.181Z"
8
8
  }
@@ -0,0 +1,506 @@
1
+ /**
2
+ * 消息中心
3
+ * 系统消息和通知管理
4
+ *
5
+ * @type Page
6
+ * @route /messages
7
+ * @screen 800x800 #fff
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+ import { AtIcon, Component, Text, View } from '@appthen/react';
12
+ import { Button, Pagination, Tabs } from '@appthen/antd';
13
+
14
+
15
+ class IProps {
16
+ userId?: number;
17
+ messageType?: string;
18
+ }
19
+
20
+ /*
21
+ * 数据与接口请求定义
22
+ */
23
+ class IState {
24
+ messages?: {
25
+ /* @example 1 */id?: number,
26
+ /* @example system */type?: string,
27
+ /* @example 系统升级通知 */title?: string,
28
+ /* @example 系统将于今晚22:00进行升级维护 */content?: string,
29
+ /* @example 2024-01-15 10:30 */time?: string,
30
+ /* @example false */read?: boolean,
31
+ /* @example high */priority?: string,
32
+ /* @example 系统管理员 */sender?: string,
33
+ }[];
34
+ loading?: boolean;
35
+ activeTab?: string;
36
+ @Form({
37
+ setter: "JsonSetter"
38
+ })
39
+ selectedIds?: string[];
40
+ searchKeyword?: string;
41
+ showUnreadOnly?: boolean;
42
+ totalCount?: number;
43
+ }
44
+
45
+ class Document extends React.Component<IProps, IState> {
46
+ state = {
47
+ messages: [
48
+ {
49
+ id: 1,
50
+ type: 'system',
51
+ title: '系统升级通知',
52
+ content: '系统将于今晚22:00进行升级维护',
53
+ time: '2024-01-15 10:30',
54
+ read: false,
55
+ priority: 'high',
56
+ sender: '系统管理员',
57
+ },
58
+ {
59
+ id: 2,
60
+ type: 'system',
61
+ title: '安全提醒',
62
+ content: '检测到您的账号在异地登录',
63
+ time: '2024-01-14 15:20',
64
+ read: false,
65
+ priority: 'high',
66
+ sender: '安全中心',
67
+ },
68
+ {
69
+ id: 3,
70
+ type: 'notice',
71
+ title: '新功能上线',
72
+ content: '数据分析模块已上线,欢迎体验',
73
+ time: '2024-01-13 09:00',
74
+ read: true,
75
+ priority: 'normal',
76
+ sender: '产品团队',
77
+ },
78
+ {
79
+ id: 4,
80
+ type: 'notice',
81
+ title: '活动通知',
82
+ content: '新春特惠活动即将开始',
83
+ time: '2024-01-12 16:45',
84
+ read: false,
85
+ priority: 'normal',
86
+ sender: '运营团队',
87
+ },
88
+ {
89
+ id: 5,
90
+ type: 'todo',
91
+ title: '待办任务',
92
+ content: '请完成本月的数据报表',
93
+ time: '2024-01-11 11:30',
94
+ read: true,
95
+ priority: 'low',
96
+ sender: '系统',
97
+ },
98
+ {
99
+ id: 6,
100
+ type: 'todo',
101
+ title: '审核待办',
102
+ content: '有3个订单需要审核',
103
+ time: '2024-01-10 14:20',
104
+ read: true,
105
+ priority: 'medium',
106
+ sender: '系统',
107
+ },
108
+ ],
109
+ loading: false,
110
+ activeTab: 'all',
111
+ selectedIds: [],
112
+ searchKeyword: '',
113
+ showUnreadOnly: false,
114
+ totalCount: 6,
115
+ };
116
+
117
+ handleTabChange(key) {
118
+ this.setState({
119
+ activeTab: key,
120
+ });
121
+ }
122
+
123
+ handleSearch(value) {
124
+ this.setState({
125
+ searchKeyword: value,
126
+ });
127
+ }
128
+
129
+ toggleShowUnread(checked) {
130
+ this.setState({
131
+ showUnreadOnly: checked,
132
+ });
133
+ }
134
+
135
+ handleSelectAll(checked) {
136
+ if (checked) {
137
+ this.setState({
138
+ selectedIds: this.state.messages.map(m => m.id),
139
+ });
140
+ } else {
141
+ this.setState({
142
+ selectedIds: [],
143
+ });
144
+ }
145
+ }
146
+
147
+ handleSelectMessage(id, checked) {
148
+ if (checked) {
149
+ this.setState({
150
+ selectedIds: [...this.state.selectedIds, id],
151
+ });
152
+ } else {
153
+ this.setState({
154
+ selectedIds: this.state.selectedIds.filter(id => id !== id),
155
+ });
156
+ }
157
+ }
158
+
159
+ markAsRead(id) {
160
+ this.setState({
161
+ messages: this.state.messages.map(m => {
162
+ if (m.id === id) {
163
+ return {
164
+ ...m,
165
+ read: true,
166
+ };
167
+ }
168
+ return m;
169
+ }),
170
+ });
171
+ }
172
+
173
+ markAllAsRead() {
174
+ this.setState({
175
+ messages: this.state.messages.map(m => ({
176
+ ...m,
177
+ read: true,
178
+ })),
179
+ });
180
+ }
181
+
182
+ deleteMessage(id) {
183
+ this.setState({
184
+ messages: this.state.messages.filter(m => m.id !== id),
185
+ totalCount: this.state.totalCount - 1,
186
+ });
187
+ }
188
+
189
+ batchDelete() {
190
+ this.setState({
191
+ messages: this.state.messages.filter(
192
+ m => !this.state.selectedIds.includes(m.id)
193
+ ),
194
+ selectedIds: [],
195
+ totalCount: this.state.totalCount - this.state.selectedIds.length,
196
+ });
197
+ }
198
+
199
+ refreshMessages() {
200
+ this.setState({
201
+ loading: true,
202
+ });
203
+ setTimeout(() => {
204
+ this.setState({
205
+ loading: false,
206
+ });
207
+ }, 1000);
208
+ }
209
+
210
+ render() {
211
+ const messages = this.state.messages;
212
+ const loading = this.state.loading;
213
+ const activeTab = this.state.activeTab;
214
+ const selectedIds = this.state.selectedIds;
215
+ const searchKeyword = this.state.searchKeyword;
216
+ const showUnreadOnly = this.state.showUnreadOnly;
217
+ const unreadCount = messages.filter(m => !m.read).length;
218
+ const filteredMessages = messages.filter(message => {
219
+ const matchTab = activeTab === 'all' || message.type === activeTab;
220
+ const matchSearch =
221
+ message.title.includes(searchKeyword) ||
222
+ message.content.includes(searchKeyword);
223
+ const matchUnread = !showUnreadOnly || !message.read;
224
+ return matchTab && matchSearch && matchUnread;
225
+ });
226
+ const priorityColors = {
227
+ high: 'red',
228
+ medium: 'orange',
229
+ normal: 'blue',
230
+ low: 'gray',
231
+ };
232
+ const typeLabels = {
233
+ system: '系统消息',
234
+ notice: '通知公告',
235
+ todo: '待办事项',
236
+ };
237
+ const messageCard = message => (
238
+ <Card
239
+ key={message.id}
240
+ className={`mb-3 ${message.read ? 'bg-gray-50' : 'bg-white'}`}
241
+ extra={
242
+ <View className="flex items-center gap-2">
243
+ <Switch
244
+ checked={selectedIds.includes(message.id)}
245
+ onChange={checked =>
246
+ this.handleSelectMessage(message.id, checked)
247
+ }
248
+ size="small"
249
+ />
250
+ {!message.read && <Badge status="processing" />}
251
+ </View>
252
+ }
253
+ >
254
+ <View className="flex items-start gap-3">
255
+ <Avatar size={40}>{message.sender.charAt(0)}</Avatar>
256
+ <View className="flex-1">
257
+ <View className="flex justify-between items-start">
258
+ <View>
259
+ <Text className="font-bold">{message.title}</Text>
260
+ <View className="flex items-center gap-2 mt-1">
261
+ <Tag color={priorityColors[message.priority]}>
262
+ {message.priority}
263
+ </Tag>
264
+ <Tag>{typeLabels[message.type]}</Tag>
265
+ </View>
266
+ </View>
267
+ <Text className="text-gray-400 text-sm">{message.time}</Text>
268
+ </View>
269
+ <Text className="text-gray-600 mt-2">{message.content}</Text>
270
+ <View className="flex gap-2 mt-3">
271
+ {!message.read && (
272
+ <Button
273
+ type="link"
274
+ size="small"
275
+ onClick={() => this.markAsRead(message.id)}
276
+ >
277
+ 标为已读
278
+ </Button>
279
+ )}
280
+ <Popconfirm
281
+ title="确认删除"
282
+ description="删除后无法恢复,确认删除吗?"
283
+ onConfirm={() => this.deleteMessage(message.id)}
284
+ >
285
+ <Button type="link" size="small" danger>
286
+ 删除
287
+ </Button>
288
+ </Popconfirm>
289
+ </View>
290
+ </View>
291
+ </View>
292
+ </Card>
293
+ );
294
+ return (
295
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
296
+ <View className="mb-[24px]">
297
+ <Text className="text-2xl font-bold text-[#1f2937]">消息中心</Text>
298
+ <Text className="text-[#6b7280] text-sm mt-[4px]">
299
+ 系统消息和通知管理
300
+ </Text>
301
+ </View>
302
+ <Card className="mb-[24px]">
303
+ <Row gutter={16}>
304
+ <Col span={6}>
305
+ <Badge count={unreadCount} showZero={true}>
306
+ <Statistic title="未读消息" value={unreadCount} suffix="条" />
307
+ </Badge>
308
+ </Col>
309
+ <Col span={6}>
310
+ <Statistic title="总消息" value={totalCount} suffix="条" />
311
+ </Col>
312
+ <Col span={6}>
313
+ <Statistic
314
+ title="系统消息"
315
+ value={
316
+ messages.filter(function (m) {
317
+ return m.type === 'system';
318
+ }).length
319
+ }
320
+ suffix="条"
321
+ />
322
+ </Col>
323
+ <Col span={6}>
324
+ <Statistic
325
+ title="待办事项"
326
+ value={
327
+ messages.filter(function (m) {
328
+ return m.type === 'todo';
329
+ }).length
330
+ }
331
+ suffix="条"
332
+ />
333
+ </Col>
334
+ </Row>
335
+ </Card>
336
+ <Card className="mb-[24px]">
337
+ <View className="flex items-center justify-between">
338
+ <View className="gap-4 flex items-center">
339
+ <Input
340
+ placeholder="搜索消息"
341
+ value={searchKeyword}
342
+ onChange={e => this.handleSearch(e.target.value)}
343
+ className=""
344
+ />
345
+ <View className="gap-2 flex items-center">
346
+ <Text>只看未读:</Text>
347
+ <Switch
348
+ checked={showUnreadOnly}
349
+ onChange={checked => this.toggleShowUnread(checked)}
350
+ />
351
+ </View>
352
+ </View>
353
+ <View className="gap-2 flex items-center">
354
+ <Switch
355
+ checked={
356
+ selectedIds.length > 0 &&
357
+ selectedIds.length === filteredMessages.length
358
+ }
359
+ onChange={checked => this.handleSelectAll(checked)}
360
+ />
361
+ <Text>全选</Text>
362
+ {!!(selectedIds.length > 0) && (
363
+ <Button
364
+ type="primary"
365
+ danger={true}
366
+ onClick={() => this.batchDelete()}
367
+ >{`批量删除 (${selectedIds.length})`}</Button>
368
+ )}
369
+ <Button onClick={() => this.markAllAsRead()}>全部标为已读</Button>
370
+ <Button onClick={() => this.refreshMessages()}>刷新</Button>
371
+ </View>
372
+ </View>
373
+ </Card>
374
+ <Card>
375
+ <Tabs
376
+ activeKey={activeTab}
377
+ onChange={key => this.handleTabChange(key)}
378
+ >
379
+ <Tabs.TabPane tab={`全部 (${messages.length})`} key="all">
380
+ {!!(filteredMessages.length === 0) && (
381
+ <Empty description="暂无消息" />
382
+ )}
383
+ {!(filteredMessages.length === 0) && (
384
+ <Text>
385
+ {filteredMessages.map(function (message) {
386
+ return messageCard(message);
387
+ })}
388
+ </Text>
389
+ )}
390
+ </Tabs.TabPane>
391
+ <Tabs.TabPane
392
+ tab={
393
+ <Badge
394
+ count={
395
+ messages.filter(function (m) {
396
+ return m.type === 'system' && !m.read;
397
+ }).length
398
+ }
399
+ overflowCount={99}
400
+ >
401
+ 系统消息
402
+ </Badge>
403
+ }
404
+ key="system"
405
+ >
406
+ {!!(
407
+ filteredMessages.filter(function (m) {
408
+ return m.type === 'system';
409
+ }).length === 0
410
+ ) && <Empty description="暂无系统消息" />}
411
+ {!(
412
+ filteredMessages.filter(function (m) {
413
+ return m.type === 'system';
414
+ }).length === 0
415
+ ) && (
416
+ <Text>
417
+ {filteredMessages
418
+ .filter(function (m) {
419
+ return m.type === 'system';
420
+ })
421
+ .map(function (message) {
422
+ return messageCard(message);
423
+ })}
424
+ </Text>
425
+ )}
426
+ </Tabs.TabPane>
427
+ <Tabs.TabPane
428
+ tab={
429
+ <Badge
430
+ count={
431
+ messages.filter(function (m) {
432
+ return m.type === 'notice' && !m.read;
433
+ }).length
434
+ }
435
+ overflowCount={99}
436
+ >
437
+ 通知公告
438
+ </Badge>
439
+ }
440
+ key="notice"
441
+ >
442
+ {!!(
443
+ filteredMessages.filter(function (m) {
444
+ return m.type === 'notice';
445
+ }).length === 0
446
+ ) && <Empty description="暂无通知公告" />}
447
+ {!(
448
+ filteredMessages.filter(function (m) {
449
+ return m.type === 'notice';
450
+ }).length === 0
451
+ ) && (
452
+ <Text>
453
+ {filteredMessages
454
+ .filter(function (m) {
455
+ return m.type === 'notice';
456
+ })
457
+ .map(function (message) {
458
+ return messageCard(message);
459
+ })}
460
+ </Text>
461
+ )}
462
+ </Tabs.TabPane>
463
+ <Tabs.TabPane
464
+ tab={
465
+ <Badge
466
+ count={
467
+ messages.filter(function (m) {
468
+ return m.type === 'todo' && !m.read;
469
+ }).length
470
+ }
471
+ overflowCount={99}
472
+ >
473
+ 待办事项
474
+ </Badge>
475
+ }
476
+ key="todo"
477
+ >
478
+ {!!(
479
+ filteredMessages.filter(function (m) {
480
+ return m.type === 'todo';
481
+ }).length === 0
482
+ ) && <Empty description="暂无待办事项" />}
483
+ {!(
484
+ filteredMessages.filter(function (m) {
485
+ return m.type === 'todo';
486
+ }).length === 0
487
+ ) && (
488
+ <Text>
489
+ {filteredMessages
490
+ .filter(function (m) {
491
+ return m.type === 'todo';
492
+ })
493
+ .map(function (message) {
494
+ return messageCard(message);
495
+ })}
496
+ </Text>
497
+ )}
498
+ </Tabs.TabPane>
499
+ </Tabs>
500
+ </Card>
501
+ </Page>
502
+ );
503
+ }
504
+ }
505
+
506
+ export default Document;