@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,230 @@
1
+ /**
2
+ * 订单列表
3
+ * 管理所有订单信息
4
+ *
5
+ * @type Page
6
+ * @route /orders
7
+ * @screen 375x90 #fff
8
+ * @frames web
9
+ * @clients h5, weapp, web
10
+ */
11
+ import React from 'react';
12
+ import { AtDivider, Component, Text, View } from 'cross-ui';
13
+
14
+
15
+ class IProps {
16
+ title?: string;
17
+ }
18
+
19
+ /*
20
+ * 数据与接口请求定义
21
+ */
22
+ class IState {
23
+ orders?: {
24
+ /* @example 1 */id?: number,
25
+ /* @example ORD202401001 */orderNo?: string,
26
+ /* @example 张三 */customer?: string,
27
+ /* @example 1299 */amount?: number,
28
+ /* @example pending */status?: string,
29
+ /* @example 2024-01-15 10:30:00 */createTime?: string,
30
+ }[];
31
+ loading?: boolean;
32
+ searchKeyword?: string;
33
+ selectedOrder?: any;
34
+ showDetail?: boolean;
35
+ filterStatus?: string;
36
+ }
37
+
38
+ class Document extends React.Component<IProps, IState> {
39
+ state = {
40
+ orders: [
41
+ {
42
+ id: 1,
43
+ orderNo: 'ORD202401001',
44
+ customer: '张三',
45
+ amount: 1299,
46
+ status: 'pending',
47
+ createTime: '2024-01-15 10:30:00',
48
+ },
49
+ {
50
+ id: 2,
51
+ orderNo: 'ORD202401002',
52
+ customer: '李四',
53
+ amount: 2580.5,
54
+ status: 'paid',
55
+ createTime: '2024-01-16 14:20:00',
56
+ },
57
+ {
58
+ id: 3,
59
+ orderNo: 'ORD202401003',
60
+ customer: '王五',
61
+ amount: 899,
62
+ status: 'shipped',
63
+ createTime: '2024-01-17 09:15:00',
64
+ },
65
+ {
66
+ id: 4,
67
+ orderNo: 'ORD202401004',
68
+ customer: '赵六',
69
+ amount: 3456,
70
+ status: 'completed',
71
+ createTime: '2024-01-18 16:45:00',
72
+ },
73
+ {
74
+ id: 5,
75
+ orderNo: 'ORD202401005',
76
+ customer: '钱七',
77
+ amount: 1567.8,
78
+ status: 'cancelled',
79
+ createTime: '2024-01-19 11:30:00',
80
+ },
81
+ ],
82
+ loading: false,
83
+ searchKeyword: '',
84
+ selectedOrder: null,
85
+ showDetail: false,
86
+ filterStatus: '',
87
+ };
88
+
89
+ handleSearch(keyword) {
90
+ this.setState({
91
+ searchKeyword: keyword,
92
+ });
93
+ }
94
+
95
+ getStatusColor(status) {
96
+ const colors = {
97
+ pending: 'orange',
98
+ paid: 'blue',
99
+ shipped: 'cyan',
100
+ completed: 'green',
101
+ cancelled: 'red',
102
+ };
103
+ return colors[status] || 'default';
104
+ }
105
+
106
+ handleViewDetail(order) {
107
+ this.setState({
108
+ selectedOrder: order,
109
+ showDetail: true,
110
+ });
111
+ }
112
+
113
+ formatAmount(amount) {
114
+ return `¥${amount.toFixed(2)}`;
115
+ }
116
+
117
+ handleFilterStatus(status) {
118
+ this.setState({
119
+ filterStatus: status,
120
+ });
121
+ }
122
+
123
+ render() {
124
+ return (
125
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
126
+ <View className="mb-[24px]">
127
+ <Text className="text-2xl font-bold text-[#1f2937]">订单列表</Text>
128
+ <Text className="text-[#6b7280] text-sm mt-[4px]">
129
+ 管理所有订单信息
130
+ </Text>
131
+ </View>
132
+ {!!this.state.loading && <View className="p-[24px]">加载中...</View>}
133
+ <View className="gap-4 mb-[24px] flex items-center">
134
+ <Input
135
+ placeholder="搜索订单号/客户"
136
+ value={this.state.searchKeyword}
137
+ onChange={e => this.handleSearch(e.target.value)}
138
+ className=""
139
+ />
140
+ <Select
141
+ placeholder="筛选状态"
142
+ value={this.state.filterStatus || undefined}
143
+ onChange={value => this.handleFilterStatus(value)}
144
+ className=""
145
+ >
146
+ <Select.Option value="">全部</Select.Option>
147
+ <Select.Option value="pending">待支付</Select.Option>
148
+ <Select.Option value="paid">已支付</Select.Option>
149
+ <Select.Option value="shipped">已发货</Select.Option>
150
+ <Select.Option value="completed">已完成</Select.Option>
151
+ <Select.Option value="cancelled">已取消</Select.Option>
152
+ </Select>
153
+ <Button type="primary">新增订单</Button>
154
+ </View>
155
+ <Table
156
+ loading={this.state.loading}
157
+ columns={[
158
+ { title: '订单号', dataIndex: 'orderNo', key: 'orderNo' },
159
+ { title: '客户', dataIndex: 'customer', key: 'customer' },
160
+ {
161
+ title: '金额',
162
+ dataIndex: 'amount',
163
+ key: 'amount',
164
+ render: amount => <Text>{this.formatAmount(amount)}</Text>,
165
+ },
166
+ {
167
+ title: '状态',
168
+ dataIndex: 'status',
169
+ key: 'status',
170
+ render: status => (
171
+ <Text style={{ color: this.getStatusColor(status) }}>
172
+ {status}
173
+ </Text>
174
+ ),
175
+ },
176
+ { title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
177
+ {
178
+ title: '操作',
179
+ key: 'action',
180
+ render: (text, record) => (
181
+ <Space>
182
+ <Button
183
+ type="link"
184
+ onClick={() => this.handleViewDetail(record)}
185
+ >
186
+ 查看详情
187
+ </Button>
188
+ <Button type="link">编辑</Button>
189
+ <Button type="link" danger={true}>
190
+ 删除
191
+ </Button>
192
+ </Space>
193
+ ),
194
+ },
195
+ ]}
196
+ dataSource={this.state.orders?.filter(function (order) {
197
+ const matchKeyword =
198
+ order?.customer?.includes(this.state.searchKeyword) ||
199
+ order?.orderNo?.includes(this.state.searchKeyword);
200
+ const matchStatus =
201
+ !this.state.filterStatus ||
202
+ order?.status === this.state.filterStatus;
203
+ return matchKeyword && matchStatus;
204
+ })}
205
+ rowKey="id"
206
+ pagination={{
207
+ pageSize: 10,
208
+ showTotal: function (total) {
209
+ return `共 ${total} 条`;
210
+ },
211
+ }}
212
+ />
213
+ <Modal
214
+ animate="pop"
215
+ renderView={() => (
216
+ <View className="bg-[#ffffff] w-[800px] h-[600px] p-[24px]">
217
+ <Text>订单号:{this.state.selectedOrder?.orderNo}</Text>
218
+ <Text>客户:{this.state.selectedOrder?.customer}</Text>
219
+ <Text>金额:{this.state.selectedOrder?.amount}</Text>
220
+ <Text>状态:{this.state.selectedOrder?.status}</Text>
221
+ </View>
222
+ )}
223
+ maskClosable={true}
224
+ />
225
+ </Page>
226
+ );
227
+ }
228
+ }
229
+
230
+ export default Document;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * 角色列表
3
+ * 查看和管理所有系统角色
4
+ *
5
+ * @type Page
6
+ * @route /roles
7
+ * @screen 1920w
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+ import { Page, View } from '@appthen/react';
12
+ import { Button, Card, Input, Space, Table, Tag } from '@appthen/antd';
13
+
14
+
15
+ class IProps {}
16
+
17
+ /*
18
+ * 数据与接口请求定义
19
+ */
20
+ class IState {
21
+ roles?: {
22
+ /* @example 1 */id?: number,
23
+ /* @example 超级管理员 */name?: string,
24
+ /* @example 拥有系统所有权限 */description?: string,
25
+ /* @example 5 */userCount?: number,
26
+ /* @example enabled */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
+ roles: [
36
+ {
37
+ id: 1,
38
+ name: '超级管理员',
39
+ description: '拥有系统所有权限',
40
+ userCount: 5,
41
+ status: 'enabled',
42
+ createTime: '2024-01-15',
43
+ },
44
+ {
45
+ id: 2,
46
+ name: '管理员',
47
+ description: '拥有大部分管理权限',
48
+ userCount: 25,
49
+ status: 'enabled',
50
+ createTime: '2024-02-20',
51
+ },
52
+ {
53
+ id: 3,
54
+ name: '编辑',
55
+ description: '可以编辑内容',
56
+ userCount: 50,
57
+ status: 'enabled',
58
+ createTime: '2024-03-10',
59
+ },
60
+ {
61
+ id: 4,
62
+ name: '普通用户',
63
+ description: '基础用户权限',
64
+ userCount: 12580,
65
+ status: 'enabled',
66
+ createTime: '2024-04-05',
67
+ },
68
+ {
69
+ id: 5,
70
+ name: '游客',
71
+ description: '只读权限',
72
+ userCount: 8560,
73
+ status: 'enabled',
74
+ createTime: '2024-05-12',
75
+ },
76
+ ],
77
+ loading: false,
78
+ searchKeyword: '',
79
+ };
80
+
81
+ handleSearch(value) {
82
+ this.setState({
83
+ searchKeyword: value,
84
+ });
85
+ }
86
+
87
+ handleAdd() {
88
+ console.log('添加角色');
89
+ }
90
+
91
+ handleEdit(record) {
92
+ console.log('编辑角色', record);
93
+ }
94
+
95
+ handleDelete(record) {
96
+ console.log('删除角色', record);
97
+ }
98
+
99
+ getStatusTag(status) {
100
+ if (status === 'enabled') {
101
+ return <Tag color="green">启用</Tag>;
102
+ }
103
+ return <Tag color="gray">禁用</Tag>;
104
+ }
105
+
106
+ render() {
107
+ return (
108
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
109
+ <View className="mb-[24px]">
110
+ <h1 className="text-2xl font-bold text-[#1f2937]">角色列表</h1>
111
+ <p className="text-[#6b7280] text-sm mt-[4px]">
112
+ 管理系统中的所有系统角色
113
+ </p>
114
+ </View>
115
+ <Card className="mb-[24px]">
116
+ <View className="flex items-center justify-between">
117
+ <Input
118
+ placeholder="搜索角色名称"
119
+ value={this.state.searchKeyword}
120
+ onChange={e => this.handleSearch(e.target.value)}
121
+ prefix="🔍"
122
+ className=""
123
+ />
124
+ <Button type="primary" onClick={() => this.handleAdd()}>
125
+ + 新增角色
126
+ </Button>
127
+ </View>
128
+ </Card>
129
+ <Card>
130
+ <Table
131
+ loading={this.state.loading}
132
+ columns={[
133
+ { title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
134
+ { title: '角色名称', dataIndex: 'name', key: 'name' },
135
+ {
136
+ title: '角色描述',
137
+ dataIndex: 'description',
138
+ key: 'description',
139
+ },
140
+ { title: '用户数量', dataIndex: 'userCount', key: 'userCount' },
141
+ {
142
+ title: '状态3',
143
+ dataIndex: 'status',
144
+ key: 'status',
145
+ render: text => <View>{this.getStatusTag(text)}</View>,
146
+ },
147
+ { title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
148
+ {
149
+ title: '操作',
150
+ key: 'action',
151
+ render: (text, record) => (
152
+ <Space>
153
+ <Button type="link" onClick={() => this.handleEdit(record)}>
154
+ 编辑
155
+ </Button>
156
+ <Button
157
+ type="link"
158
+ danger={true}
159
+ onClick={() => this.handleDelete(record)}
160
+ >
161
+ 删除
162
+ </Button>
163
+ </Space>
164
+ ),
165
+ },
166
+ ]}
167
+ dataSource={this.state.roles}
168
+ rowKey="id"
169
+ pagination={{
170
+ pageSize: 10,
171
+ showTotal: (total, range) => `共 ${total} 条`,
172
+ }}
173
+ showHeader={true}
174
+ size="default"
175
+ tableLayout=""
176
+ scroll={{ scrollToFirstRowOnChange: true }}
177
+ />
178
+ </Card>
179
+ </Page>
180
+ );
181
+ }
182
+ }
183
+
184
+ export default Document;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * 极简主义页面
3
+ * @type Page
4
+ * @route /simple-minimalist-demo-2024
5
+ * @screen 1400x800 #ffffff
6
+ * @frames web
7
+ */
8
+ import React from 'react';
9
+
10
+
11
+ class IProps {
12
+ /* 页面标题 */
13
+ title?: string;
14
+ }
15
+
16
+ /*
17
+ * 数据与接口请求定义
18
+ */
19
+ class IState {
20
+ /* 主标题 */
21
+ title?: string;
22
+ /* 描述文字 */
23
+ description?: string;
24
+ /* 特性列表 */
25
+ features?: {
26
+ /* @example ✨ */icon?: string,
27
+ /* @example 简洁优雅 */text?: string,
28
+ }[];
29
+ }
30
+
31
+ class Document extends React.Component<IProps, IState> {
32
+ state = {
33
+ title: '极简之美',
34
+ description:
35
+ '少即是多。在这个复杂的数字世界中,我们追求简单与纯粹。让每一次交互都回归本质,让每一个设计都服务于功能。',
36
+ features: [
37
+ { icon: '✨', text: '简洁优雅' },
38
+ { icon: '🎯', text: '专注核心' },
39
+ { icon: '⚡', text: '高效体验' },
40
+ ],
41
+ };
42
+
43
+ handleGetStarted() {
44
+ this.utils.toast('开始探索极简之旅');
45
+ }
46
+
47
+ handleLearnMore() {
48
+ this.utils.toast('了解更多');
49
+ }
50
+
51
+ render() {
52
+ return (
53
+ <Page className="min-h-screen bg-[#ffffff] flex items-center justify-center pl-[24px] pr-[24px]">
54
+ <View className="w-full text-[var(--center)]">
55
+ <h1 className="text-5xl font-light text-[var(--blue-600)] mb-[32px] tracking-[-0.025em]">
56
+ <Text>{this.state.title}</Text>
57
+ </h1>
58
+ <p className="text-xl text-[#8b5cf6] font-light [lineHeight:1.625] mb-[64px]">
59
+ <Text>{this.state.description}</Text>
60
+ </p>
61
+ <View className="space-x-16 flex justify-center mb-[64px]">
62
+ {this.state.features.map((feature, index) => (
63
+ <View key={index} className="flex flex-col items-center">
64
+ <Text className="text-4xl mb-[12px]">{feature.icon}</Text>
65
+ <Text className="text-sm text-[#4b5563] font-light tracking-[0.025em]">
66
+ {feature.text}
67
+ </Text>
68
+ </View>
69
+ ))}
70
+ </View>
71
+ <View className="space-x-6 flex justify-center">
72
+ <button
73
+ onClick={() => this.handleGetStarted()}
74
+ className="bg-blue-500 hover:bg-blue-600 transition-colors duration-300 pl-[32px] pr-[32px] pt-[12px] pb-[12px] text-[#ffffff] text-sm font-light tracking-[0.05em]"
75
+ >
76
+ 探索未来
77
+ </button>
78
+ <button
79
+ onClick={() => this.handleLearnMore()}
80
+ className="border-purple-400 text-purple-600 text-sm hover:border-purple-500 hover:text-purple-700 transition-colors duration-300 pl-[32px] pr-[32px] pt-[12px] pb-[12px] border border-solid font-light tracking-[0.05em]"
81
+ >
82
+ 更多信息
83
+ </button>
84
+ </View>
85
+ <View className="mt-[80px] w-[48px] h-[0px] bg-[var(--blue-300)] ml-[auto] mr-[auto]" />
86
+ </View>
87
+ </Page>
88
+ );
89
+ }
90
+ }
91
+
92
+ export default Document;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * 简单页面
3
+ * @type Page
4
+ * @route /simple
5
+ * @screen 1920w
6
+ * @frames web
7
+ */
8
+ import React from 'react';
9
+
10
+
11
+
12
+ class IProps {}
13
+
14
+ /*
15
+ * 数据与接口请求定义
16
+ */
17
+ class IState {
18
+ count?: number;
19
+ }
20
+
21
+ class Document extends React.Component<IProps, IState> {
22
+ state = { count: 0 };
23
+
24
+ handleClick() {
25
+ this.setState({
26
+ count: this.state.count + 1,
27
+ });
28
+ }
29
+
30
+ render() {
31
+ return (
32
+ <Page className="p-[24px] bg-[#ffffff] min-h-screen">
33
+ <Card>
34
+ <h1 className="text-2xl font-bold mb-[16px]">简单页面</h1>
35
+ <p className="mb-[16px]">计数:{this.state.count}</p>
36
+ <Button onClick={() => this.handleClick()}>点击增加</Button>
37
+ </Card>
38
+ </Page>
39
+ );
40
+ }
41
+ }
42
+
43
+ export default Document;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 测试解构赋值
3
+ * @type Page
4
+ * @route /test-destructure
5
+ * @screen 1920w
6
+ * @frames web
7
+ */
8
+ import React from 'react';
9
+
10
+
11
+
12
+ class IProps {}
13
+
14
+ /*
15
+ * 数据与接口请求定义
16
+ */
17
+ class IState {
18
+ count?: number;
19
+ name?: string;
20
+ }
21
+
22
+ class Document extends React.Component<IProps, IState> {
23
+ state = { count: 0, name: '测试' };
24
+
25
+ handleClick() {
26
+ this.setState({
27
+ count: this.state.count + 1,
28
+ });
29
+ }
30
+
31
+ render() {
32
+ // ❌ 违反规范:render() 中有解构赋值
33
+ const { count, name } = this.state;
34
+ return (
35
+ <Page className="p-[24px]">
36
+ <h1>{name}</h1>
37
+ <p>计数:{count}</p>
38
+ <Button onClick={() => this.handleClick()}>点击</Button>
39
+ </Page>
40
+ );
41
+ }
42
+ }
43
+
44
+ export default Document;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * 测试错误页面
3
+ * @type Page
4
+ * @route /users
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
+ users?: string[];
22
+ searchKeyword?: string;
23
+ }
24
+
25
+ class Document extends React.Component<IProps, IState> {
26
+ state = { count: 0, users: [], searchKeyword: '' };
27
+
28
+ handleClick(event) {
29
+ this.setState({
30
+ count: this.state.count + 1,
31
+ });
32
+ }
33
+
34
+ getData() {
35
+ return Promise.resolve([]);
36
+ }
37
+
38
+ handleSearch(keyword) {
39
+ this.setState({
40
+ searchKeyword: keyword,
41
+ });
42
+ }
43
+
44
+ render() {
45
+ return (
46
+ <Page className="p-[24px]">
47
+ <h1>{this.props.title}</h1>
48
+ <p>计数:{this.state.count}</p>
49
+ <Input
50
+ placeholder="搜索"
51
+ value={this.state.searchKeyword}
52
+ onChange={e => this.handleSearch(e.target.value)}
53
+ />
54
+ <Table
55
+ columns={[
56
+ {
57
+ title: '姓名',
58
+ dataIndex: 'name',
59
+ render: text => <Text>{text}</Text>,
60
+ },
61
+ {
62
+ title: '邮箱',
63
+ dataIndex: 'email',
64
+ render: email => <Text>{email}</Text>,
65
+ },
66
+ ]}
67
+ dataSource={this.state.users}
68
+ />
69
+ <Button onClick={() => this.handleClick()}>点击我</Button>
70
+ </Page>
71
+ );
72
+ }
73
+ }
74
+
75
+ export default Document;