@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.
- package/.gitignore +1 -0
- package/bin/main.js +92 -0
- package/dist/index.js +7014 -14988
- package/package.json +8 -1
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1862 -0
- package/tests/test-app/.appthen/space-config.json +8 -0
- package/tests/test-app/docs/AI-Workflow.flow +112 -0
- package/tests/test-app/docs/Logic-1.flow +16 -0
- package/tests/test-app/docs/Logic.flow +16 -0
- package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
- package/tests/test-app/docs/Project-Blueprint.flow +119 -0
- package/tests/test-app/docs/README.md +3 -0
- package/tests/test-app/docs/claude.md +194 -0
- package/tests/test-app/docs/page_requirement_analysis.md +149 -0
- 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
- package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
- package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
- package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
- package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
- package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
- package/tests/test-app/src/app.css +15 -0
- package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
- package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
- package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
- package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
- package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
- package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
- package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
- package/tests/test-app/src/components/Button.js +11 -0
- package/tests/test-app/src/components/MessageCenter.tsx +506 -0
- package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
- package/tests/test-app/src/components/Timeline.tsx +145 -0
- package/tests/test-app/src/index.ts +2 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
- package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
- package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
- package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
- package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
- 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
- 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
- package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
- package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
- package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
- package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
- package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
- package/tests/test-app/src/pages/DataReport.tsx +298 -0
- package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
- package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
- package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
- package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
- package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
- package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
- package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
- package/tests/test-app/src/pages/SLAManagement.tsx +668 -0
- package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
- package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
- package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
- package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
- package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
- package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
- package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
- package/tests/test-app/src/pages/TicketList.tsx +27 -0
- package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -0
- package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
- package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
- package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
- package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
- package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
- package/tests/test-app/src/pages/article-list.tsx +222 -0
- package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
- package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
- package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
- package/tests/test-app/src/pages/category-list.tsx +179 -0
- package/tests/test-app/src/pages/comment-list.tsx +194 -0
- package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
- package/tests/test-app/src/pages/cover.tsx +42 -0
- package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
- package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
- package/tests/test-app/src/pages/data-overview.tsx +600 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
- package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
- package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
- package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
- package/tests/test-app/src/pages/department-list.tsx +183 -0
- package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
- package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
- package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
- package/tests/test-app/src/pages/goods-list.tsx +233 -0
- package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
- package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
- package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
- package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
- package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
- package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
- package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
- package/tests/test-app/src/pages/notice-list.tsx +217 -0
- package/tests/test-app/src/pages/order-detail.tsx +330 -0
- package/tests/test-app/src/pages/order-list.tsx +195 -0
- package/tests/test-app/src/pages/order-management.tsx +563 -0
- package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
- package/tests/test-app/src/pages/role-list.tsx +184 -0
- package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
- package/tests/test-app/src/pages/simple-page.tsx +43 -0
- package/tests/test-app/src/pages/test-destructure.tsx +44 -0
- package/tests/test-app/src/pages/test-error-page.tsx +75 -0
- package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
- package/tests/test-app/src/pages/test-page.tsx +101 -0
- package/tests/test-app/src/pages/test-render.tsx +52 -0
- package/tests/test-app/src/pages/test-return-type.tsx +41 -0
- package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
- package/tests/test-app/src/pages/testPage.css +3 -0
- package/tests/test-app/src/pages/testPage.tsx +158 -0
- package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
- package/tests/test-app/src/pages/user-list.tsx +212 -0
- package/tests/test-app/src/pages/web_version/website.css +205 -0
- package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
- package/tests/test-app/src/project.json +1120 -0
- package/tests/test-app/src/store/global.store.ts +10 -0
- package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
- package/tests/test-app/src/types/SLAPolicy.ts +50 -0
- package/tests/test-app/src/types/Ticket.ts +68 -0
- package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
- package/tests/test-app/src/types/TicketComment.m.ts +59 -0
- package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
- package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
- package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
- package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
- package/tests/test-app/src/types/TicketRecord.ts +47 -0
- package/tests/test-app/src/types/TrainDoor.ts +284 -0
- package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
- package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
- package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
- package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
|
@@ -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;
|