@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,212 @@
1
+ /**
2
+ * 用户列表
3
+ * 查看和管理所有用户信息
4
+ *
5
+ * @type Page
6
+ * @route /users
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
+ users?: {
21
+ /* @example 1 */id?: number,
22
+ /* @example 张三 */name?: string,
23
+ /* @example zhangsan@example.com */email?: string,
24
+ /* @example 138****1234 */phone?: string,
25
+ /* @example active */status?: string,
26
+ /* @example admin */role?: 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
+ users: [
36
+ {
37
+ id: 1,
38
+ name: '张三',
39
+ email: 'zhangsan@example.com',
40
+ phone: '138****1234',
41
+ status: 'active',
42
+ role: 'admin',
43
+ createTime: '2024-01-15',
44
+ },
45
+ {
46
+ id: 2,
47
+ name: '李四',
48
+ email: 'lisi@example.com',
49
+ phone: '139****5678',
50
+ status: 'active',
51
+ role: 'user',
52
+ createTime: '2024-02-20',
53
+ },
54
+ {
55
+ id: 3,
56
+ name: '王五',
57
+ email: 'wangwu@example.com',
58
+ phone: '137****9012',
59
+ status: 'inactive',
60
+ role: 'user',
61
+ createTime: '2024-03-10',
62
+ },
63
+ {
64
+ id: 4,
65
+ name: '赵六',
66
+ email: 'zhaoliu@example.com',
67
+ phone: '136****3456',
68
+ status: 'active',
69
+ role: 'user',
70
+ createTime: '2024-04-05',
71
+ },
72
+ {
73
+ id: 5,
74
+ name: '钱七',
75
+ email: 'qianqi@example.com',
76
+ phone: '135****7890',
77
+ status: 'active',
78
+ role: 'manager',
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 === 'active') {
106
+ return <Tag color="green">活跃</Tag>;
107
+ }
108
+ return <Tag color="gray">禁用</Tag>;
109
+ }
110
+
111
+ getRoleTag(role) {
112
+ const config = {
113
+ admin: {
114
+ text: '管理员',
115
+ color: 'red',
116
+ },
117
+ manager: {
118
+ text: '经理',
119
+ color: 'blue',
120
+ },
121
+ user: {
122
+ text: '用户',
123
+ color: 'default',
124
+ },
125
+ };
126
+ const configItem = config[role] || config.user;
127
+ return <Tag color={configItem.color}>{configItem.text}</Tag>;
128
+ }
129
+
130
+ render() {
131
+ return (
132
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
133
+ <View className="mb-[24px]">
134
+ <h1 className="text-2xl font-bold text-[#1f2937]">用户列表</h1>
135
+ <p className="text-[#6b7280] text-sm mt-[4px]">
136
+ 管理系统中的所有用户
137
+ </p>
138
+ </View>
139
+ <Card className="mb-[24px]">
140
+ <View className="flex items-center justify-between">
141
+ <Input
142
+ placeholder="搜索用户名/邮箱/手机号"
143
+ value={this.state.searchKeyword}
144
+ onChange={e => this.handleSearch(e.target.value)}
145
+ prefix="🔍"
146
+ className=""
147
+ />
148
+ <Button type="primary" onClick={() => this.handleAdd()}>
149
+ + 新增用户
150
+ </Button>
151
+ </View>
152
+ </Card>
153
+ <Card>
154
+ <Table
155
+ loading={this.state.loading}
156
+ columns={[
157
+ { title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
158
+ { title: '用户名', dataIndex: 'name', key: 'name' },
159
+ { title: '邮箱', dataIndex: 'email', key: 'email' },
160
+ { title: '手机号', dataIndex: 'phone', key: 'phone' },
161
+ {
162
+ title: '状态',
163
+ dataIndex: 'status',
164
+ key: 'status',
165
+ render: function (text) {
166
+ return this.getStatusTag(text);
167
+ },
168
+ },
169
+ {
170
+ title: '角色',
171
+ dataIndex: 'role',
172
+ key: 'role',
173
+ render: function (text) {
174
+ return this.getRoleTag(text);
175
+ },
176
+ },
177
+ { title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
178
+ {
179
+ title: '操作',
180
+ key: 'action',
181
+ render: (text, record) => (
182
+ <Space>
183
+ <Button type="link" onClick={() => this.handleEdit(record)}>
184
+ 编辑
185
+ </Button>
186
+ <Button
187
+ type="link"
188
+ danger={true}
189
+ onClick={() => this.handleDelete(record)}
190
+ >
191
+ 删除
192
+ </Button>
193
+ </Space>
194
+ ),
195
+ },
196
+ ]}
197
+ dataSource={this.state.users}
198
+ rowKey="id"
199
+ pagination={{
200
+ pageSize: 10,
201
+ showTotal: function (total) {
202
+ return `共 ${total} 条`;
203
+ },
204
+ }}
205
+ />
206
+ </Card>
207
+ </Page>
208
+ );
209
+ }
210
+ }
211
+
212
+ export default Document;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * 错误示例页面
3
+ * @type Page
4
+ * @route /wrong
5
+ * @screen 1920w
6
+ * @frames web
7
+ */
8
+ import React from 'react';
9
+
10
+
11
+
12
+ class IProps {
13
+ title?: string;
14
+ }
15
+
16
+ /*
17
+ * 数据与接口请求定义
18
+ */
19
+ class IState {
20
+ count?: number;
21
+ @Form({
22
+ setter: "JsonSetter"
23
+ })
24
+ users?: string[];
25
+ loading?: boolean;
26
+ }
27
+
28
+ class Document extends React.Component<IProps, IState> {
29
+ state = { count: 0, users: [], loading: false };
30
+
31
+ handleClick() {
32
+ this.setState({
33
+ count: this.state.count + 1,
34
+ });
35
+ }
36
+
37
+ render() {
38
+ // ❌ 违反规范:render() 中使用解构赋值
39
+ const { count, users, loading } = this.state;
40
+ return (
41
+ <Page className="p-[24px]">
42
+ <h1 className="text-2xl font-bold mb-[16px]">错误示例</h1>
43
+ <p>计数:{count}</p>
44
+ <Button onClick={() => this.handleClick()}>点击</Button>
45
+ </Page>
46
+ );
47
+ }
48
+ }
49
+
50
+ export default Document;