@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
@@ -0,0 +1,194 @@
1
+ /**
2
+ * 评论列表
3
+ * 查看和管理所有用户评论
4
+ *
5
+ * @type Page
6
+ * @route /comments
7
+ * @screen 1920w
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+
12
+
13
+
14
+ class IProps {}
15
+
16
+ /*
17
+ * 数据与接口请求定义
18
+ */
19
+ class IState {
20
+ comments?: {
21
+ /* @example 1 */id?: number,
22
+ /* @example 张三 */author?: string,
23
+ /* @example 这篇文章写得非常好,受益匪浅! */content?: string,
24
+ /* @example React入门教程 */article?: string,
25
+ /* @example 128 */likes?: number,
26
+ /* @example approved */status?: string,
27
+ /* @example 2024-01-15 */createTime?: string,
28
+ }[];
29
+ loading?: boolean;
30
+ searchKeyword?: string;
31
+ }
32
+
33
+ class Document extends React.Component<IProps, IState> {
34
+ state = {
35
+ comments: [
36
+ {
37
+ id: 1,
38
+ author: '张三',
39
+ content: '这篇文章写得非常好,受益匪浅!',
40
+ article: 'React入门教程',
41
+ likes: 128,
42
+ status: 'approved',
43
+ createTime: '2024-01-15',
44
+ },
45
+ {
46
+ id: 2,
47
+ author: '李四',
48
+ content: '希望能有更多关于TypeScript的教程',
49
+ article: 'JavaScript高级特性',
50
+ likes: 56,
51
+ status: 'approved',
52
+ createTime: '2024-02-20',
53
+ },
54
+ {
55
+ id: 3,
56
+ author: '王五',
57
+ content: '这个观点我不太认同,需要更多证据',
58
+ article: '2024年前端趋势',
59
+ likes: 23,
60
+ status: 'pending',
61
+ createTime: '2024-03-10',
62
+ },
63
+ {
64
+ id: 4,
65
+ author: '赵六',
66
+ content: '感谢分享,学到了很多',
67
+ article: 'Vue3最佳实践',
68
+ likes: 89,
69
+ status: 'approved',
70
+ createTime: '2024-04-05',
71
+ },
72
+ {
73
+ id: 5,
74
+ author: '钱七',
75
+ content: '代码示例很清晰,值得收藏',
76
+ article: 'TypeScript入门指南',
77
+ likes: 156,
78
+ status: 'approved',
79
+ createTime: '2024-05-12',
80
+ },
81
+ ],
82
+ loading: false,
83
+ searchKeyword: '',
84
+ };
85
+
86
+ handleSearch(value) {
87
+ this.setState({
88
+ searchKeyword: value,
89
+ });
90
+ }
91
+
92
+ handleAdd() {
93
+ console.log('添加评论');
94
+ }
95
+
96
+ handleEdit(record) {
97
+ console.log('编辑评论', record);
98
+ }
99
+
100
+ handleDelete(record) {
101
+ console.log('删除评论', record);
102
+ }
103
+
104
+ getStatusTag(status) {
105
+ if (status === 'approved') {
106
+ return <Tag color="green">已通过</Tag>;
107
+ }
108
+ if (status === 'pending') {
109
+ return <Tag color="orange">待审核</Tag>;
110
+ }
111
+ return <Tag color="red">已拒绝</Tag>;
112
+ }
113
+
114
+ render() {
115
+ return (
116
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
117
+ <View className="mb-[24px]">
118
+ <h1 className="text-2xl font-bold text-[#1f2937]">评论列表</h1>
119
+ <p className="text-[#6b7280] text-sm mt-[4px]">
120
+ 管理系统中的所有用户评论
121
+ </p>
122
+ </View>
123
+ <Card className="mb-[24px]">
124
+ <View className="flex items-center justify-between">
125
+ <Input
126
+ placeholder="搜索评论内容/作者"
127
+ value={this.state.searchKeyword}
128
+ onChange={e => this.handleSearch(e.target.value)}
129
+ prefix="🔍"
130
+ className=""
131
+ />
132
+ <Button type="primary" onClick={() => this.handleAdd()}>
133
+ + 新增评论
134
+ </Button>
135
+ </View>
136
+ </Card>
137
+ <Card>
138
+ <Table
139
+ loading={this.state.loading}
140
+ columns={[
141
+ { title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
142
+ { title: '作者', dataIndex: 'author', key: 'author' },
143
+ {
144
+ title: '评论内容',
145
+ dataIndex: 'content',
146
+ key: 'content',
147
+ ellipsis: true,
148
+ },
149
+ { title: '文章标题', dataIndex: 'article', key: 'article' },
150
+ { title: '点赞数', dataIndex: 'likes', key: 'likes' },
151
+ {
152
+ title: '状态',
153
+ dataIndex: 'status',
154
+ key: 'status',
155
+ render: function (text) {
156
+ return this.getStatusTag(text);
157
+ },
158
+ },
159
+ { title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
160
+ {
161
+ title: '操作',
162
+ key: 'action',
163
+ render: (text, record) => (
164
+ <Space>
165
+ <Button type="link" onClick={() => this.handleEdit(record)}>
166
+ 编辑
167
+ </Button>
168
+ <Button
169
+ type="link"
170
+ danger={true}
171
+ onClick={() => this.handleDelete(record)}
172
+ >
173
+ 删除
174
+ </Button>
175
+ </Space>
176
+ ),
177
+ },
178
+ ]}
179
+ dataSource={this.state.comments}
180
+ rowKey="id"
181
+ pagination={{
182
+ pageSize: 10,
183
+ showTotal: function (total) {
184
+ return `共 ${total} 条`;
185
+ },
186
+ }}
187
+ />
188
+ </Card>
189
+ </Page>
190
+ );
191
+ }
192
+ }
193
+
194
+ export default Document;