@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,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 项目时间线
|
|
3
|
+
* 项目进度跟踪和时间线展示
|
|
4
|
+
*
|
|
5
|
+
* @type Page
|
|
6
|
+
* @route /timeline
|
|
7
|
+
* @screen 1920w
|
|
8
|
+
* @frames web
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class IProps {
|
|
15
|
+
projectId?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* 数据与接口请求定义
|
|
20
|
+
*/
|
|
21
|
+
class IState {
|
|
22
|
+
events?: {
|
|
23
|
+
/* @example 1 */id?: number,
|
|
24
|
+
/* @example milestone */type?: string,
|
|
25
|
+
/* @example 项目启动 */title?: string,
|
|
26
|
+
/* @example 2024-01-01 */date?: string,
|
|
27
|
+
/* @example completed */status?: string,
|
|
28
|
+
/* @example 项目正式启动,团队组建完成 */description?: string,
|
|
29
|
+
/* @example 项目经理 */assignee?: string,
|
|
30
|
+
}[];
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
selectedDate?: string;
|
|
33
|
+
viewMode?: string;
|
|
34
|
+
currentProject?: {
|
|
35
|
+
/* @example 1 */id?: number,
|
|
36
|
+
/* @example 电商平台开发 */name?: string,
|
|
37
|
+
/* @example 45 */progress?: number,
|
|
38
|
+
/* @example 2024-01-01 */startDate?: string,
|
|
39
|
+
/* @example 2024-01-30 */endDate?: string,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class Document extends React.Component<IProps, IState> {
|
|
44
|
+
state = {
|
|
45
|
+
events: [
|
|
46
|
+
{
|
|
47
|
+
id: 1,
|
|
48
|
+
type: 'milestone',
|
|
49
|
+
title: '项目启动',
|
|
50
|
+
date: '2024-01-01',
|
|
51
|
+
status: 'completed',
|
|
52
|
+
description: '项目正式启动,团队组建完成',
|
|
53
|
+
assignee: '项目经理',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 2,
|
|
57
|
+
type: 'task',
|
|
58
|
+
title: '需求分析',
|
|
59
|
+
date: '2024-01-05',
|
|
60
|
+
status: 'completed',
|
|
61
|
+
description: '完成需求调研和分析文档',
|
|
62
|
+
assignee: '产品经理',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 3,
|
|
66
|
+
type: 'task',
|
|
67
|
+
title: 'UI设计',
|
|
68
|
+
date: '2024-01-10',
|
|
69
|
+
status: 'completed',
|
|
70
|
+
description: '完成UI设计和交互原型',
|
|
71
|
+
assignee: 'UI设计师',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 4,
|
|
75
|
+
type: 'task',
|
|
76
|
+
title: '前端开发',
|
|
77
|
+
date: '2024-01-15',
|
|
78
|
+
status: 'inProgress',
|
|
79
|
+
description: '前端页面开发',
|
|
80
|
+
assignee: '前端工程师',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 5,
|
|
84
|
+
type: 'task',
|
|
85
|
+
title: '后端开发',
|
|
86
|
+
date: '2024-01-15',
|
|
87
|
+
status: 'inProgress',
|
|
88
|
+
description: '后端接口开发',
|
|
89
|
+
assignee: '后端工程师',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 6,
|
|
93
|
+
type: 'milestone',
|
|
94
|
+
title: '中期评审',
|
|
95
|
+
date: '2024-01-20',
|
|
96
|
+
status: 'pending',
|
|
97
|
+
description: '项目中期评审和调整',
|
|
98
|
+
assignee: '项目经理',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 7,
|
|
102
|
+
type: 'task',
|
|
103
|
+
title: '测试',
|
|
104
|
+
date: '2024-01-25',
|
|
105
|
+
status: 'pending',
|
|
106
|
+
description: '系统测试和bug修复',
|
|
107
|
+
assignee: '测试工程师',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 8,
|
|
111
|
+
type: 'milestone',
|
|
112
|
+
title: '项目交付',
|
|
113
|
+
date: '2024-01-30',
|
|
114
|
+
status: 'pending',
|
|
115
|
+
description: '项目正式上线',
|
|
116
|
+
assignee: '项目经理',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
loading: false,
|
|
120
|
+
selectedDate: '[object Object]',
|
|
121
|
+
viewMode: 'timeline',
|
|
122
|
+
currentProject: {
|
|
123
|
+
id: 1,
|
|
124
|
+
name: '电商平台开发',
|
|
125
|
+
progress: 45,
|
|
126
|
+
startDate: '2024-01-01',
|
|
127
|
+
endDate: '2024-01-30',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
handleDateChange(date) {
|
|
132
|
+
this.setState({
|
|
133
|
+
selectedDate: date,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
handleViewModeChange(mode) {
|
|
138
|
+
this.setState({
|
|
139
|
+
viewMode: mode,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
addEvent(type) {
|
|
144
|
+
console.log('添加事件:', type);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
updateEvent(eventId, updates) {
|
|
148
|
+
this.setState({
|
|
149
|
+
events: this.state.events.map(e => {
|
|
150
|
+
if (e.id === eventId) {
|
|
151
|
+
return {
|
|
152
|
+
...e,
|
|
153
|
+
...updates,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return e;
|
|
157
|
+
}),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
deleteEvent(eventId) {
|
|
162
|
+
this.setState({
|
|
163
|
+
events: this.state.events.filter(e => e.id !== eventId),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
render() {
|
|
168
|
+
// 💀 死亡:变量声明 - 解构赋值
|
|
169
|
+
const { events, loading, selectedDate, viewMode, currentProject } =
|
|
170
|
+
this.state;
|
|
171
|
+
|
|
172
|
+
// 💀 死亡:变量声明 - 计算完成进度
|
|
173
|
+
// 💀 死亡:变量声明 - 计算完成进度
|
|
174
|
+
const completedEvents = this.state.events.filter(
|
|
175
|
+
e => e.status === 'completed'
|
|
176
|
+
).length;
|
|
177
|
+
const totalEvents = this.state.events.length;
|
|
178
|
+
const progress = Math.round((completedEvents / totalEvents) * 100);
|
|
179
|
+
|
|
180
|
+
// 💀 死亡:变量声明 - 按日期分组
|
|
181
|
+
// 💀 死亡:变量声明 - 按日期分组
|
|
182
|
+
const eventsByDate = this.state.events.reduce((acc, event) => {
|
|
183
|
+
const date = event.date;
|
|
184
|
+
if (!acc[date]) {
|
|
185
|
+
acc[date] = [];
|
|
186
|
+
}
|
|
187
|
+
acc[date].push(event);
|
|
188
|
+
return acc;
|
|
189
|
+
}, {});
|
|
190
|
+
|
|
191
|
+
// 💀 死亡:if 语句 - 条件渲染
|
|
192
|
+
// 💀 死亡:if 语句 - 条件渲染
|
|
193
|
+
if (loading) {
|
|
194
|
+
return <View className="p-6">加载中...</View>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// 💀 死亡:变量声明 - 日期列表
|
|
198
|
+
// 💀 死亡:变量声明 - 日期列表
|
|
199
|
+
const dateList = Object.keys(eventsByDate).sort();
|
|
200
|
+
|
|
201
|
+
// 💀 死亡:变量声明 - 类型配置
|
|
202
|
+
// 💀 死亡:变量声明 - 类型配置
|
|
203
|
+
const typeConfig = {
|
|
204
|
+
milestone: {
|
|
205
|
+
color: 'red',
|
|
206
|
+
icon: '🎯',
|
|
207
|
+
label: '里程碑',
|
|
208
|
+
},
|
|
209
|
+
task: {
|
|
210
|
+
color: 'blue',
|
|
211
|
+
icon: '📋',
|
|
212
|
+
label: '任务',
|
|
213
|
+
},
|
|
214
|
+
review: {
|
|
215
|
+
color: 'orange',
|
|
216
|
+
icon: '👁️',
|
|
217
|
+
label: '评审',
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// 💀 死亡:变量声明 - 状态配置
|
|
222
|
+
// 💀 死亡:变量声明 - 状态配置
|
|
223
|
+
const statusConfig = {
|
|
224
|
+
completed: {
|
|
225
|
+
color: 'green',
|
|
226
|
+
label: '已完成',
|
|
227
|
+
},
|
|
228
|
+
inProgress: {
|
|
229
|
+
color: 'blue',
|
|
230
|
+
label: '进行中',
|
|
231
|
+
},
|
|
232
|
+
pending: {
|
|
233
|
+
color: 'gray',
|
|
234
|
+
label: '待开始',
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// 💀 死亡:变量声明 - JSX 片段
|
|
239
|
+
// 💀 死亡:变量声明 - JSX 片段
|
|
240
|
+
const eventCard = event => (
|
|
241
|
+
<Card
|
|
242
|
+
key={event.id}
|
|
243
|
+
className={`mb-3 ${
|
|
244
|
+
event.status === 'completed' ? 'border-green-500' : ''
|
|
245
|
+
}`}
|
|
246
|
+
>
|
|
247
|
+
<View className="flex items-start justify-between">
|
|
248
|
+
<View className="flex items-start gap-3">
|
|
249
|
+
<Text className="text-2xl">{typeConfig[event.type]?.icon}</Text>
|
|
250
|
+
<View>
|
|
251
|
+
<Text className="font-bold">{event.title}</Text>
|
|
252
|
+
<Text className="text-sm text-gray-500">{event.description}</Text>
|
|
253
|
+
<View className="flex items-center gap-2 mt-2">
|
|
254
|
+
<Tag color={statusConfig[event.status]?.color}>
|
|
255
|
+
{statusConfig[event.status]?.label}
|
|
256
|
+
</Tag>
|
|
257
|
+
<Tag color={typeConfig[event.type]?.color}>
|
|
258
|
+
{typeConfig[event.type]?.label}
|
|
259
|
+
</Tag>
|
|
260
|
+
</View>
|
|
261
|
+
</View>
|
|
262
|
+
</View>
|
|
263
|
+
</View>
|
|
264
|
+
</Card>
|
|
265
|
+
);
|
|
266
|
+
return (
|
|
267
|
+
<Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
|
|
268
|
+
<View className="mb-[24px]">
|
|
269
|
+
<Text className="text-2xl font-bold text-[#1f2937]">项目时间线</Text>
|
|
270
|
+
<Text className="text-[#6b7280] text-sm mt-[4px]">
|
|
271
|
+
项目进度跟踪和时间线展示
|
|
272
|
+
</Text>
|
|
273
|
+
</View>
|
|
274
|
+
<Card className="mb-[24px]">
|
|
275
|
+
<View className="flex items-center justify-between">
|
|
276
|
+
<View>
|
|
277
|
+
<Text className="text-xl font-bold">{currentProject.name}</Text>
|
|
278
|
+
<Text className="text-[#6b7280]">
|
|
279
|
+
周期:{currentProject.startDate}至{currentProject.endDate}
|
|
280
|
+
</Text>
|
|
281
|
+
</View>
|
|
282
|
+
<View className="text-[var(--right)]">
|
|
283
|
+
<Text className="text-3xl font-bold text-[var(--blue-600)]">
|
|
284
|
+
{progress}%
|
|
285
|
+
</Text>
|
|
286
|
+
<Progress percent={progress} />
|
|
287
|
+
</View>
|
|
288
|
+
</View>
|
|
289
|
+
</Card>
|
|
290
|
+
<Card className="mb-[24px]">
|
|
291
|
+
<View className="gap-4 grid grid-cols-4">
|
|
292
|
+
<View className="text-[var(--center)] p-[16px] bg-[var(--blue-50)] rounded">
|
|
293
|
+
<Text className="text-2xl font-bold text-[var(--blue-600)]">
|
|
294
|
+
{totalEvents}
|
|
295
|
+
</Text>
|
|
296
|
+
<Text className="block text-sm text-[#4b5563] mt-[4px]">
|
|
297
|
+
总事件
|
|
298
|
+
</Text>
|
|
299
|
+
</View>
|
|
300
|
+
<View className="text-[var(--center)] p-[16px] bg-[var(--green-50)] rounded">
|
|
301
|
+
<Text className="text-2xl font-bold text-[var(--green-600)]">
|
|
302
|
+
{completedEvents}
|
|
303
|
+
</Text>
|
|
304
|
+
<Text className="block text-sm text-[#4b5563] mt-[4px]">
|
|
305
|
+
已完成
|
|
306
|
+
</Text>
|
|
307
|
+
</View>
|
|
308
|
+
<View className="text-[var(--center)] p-[16px] bg-[var(--orange-50)] rounded">
|
|
309
|
+
<Text className="text-2xl font-bold text-[var(--orange-600)]">
|
|
310
|
+
{events.filter(e => e.status === 'inProgress').length}
|
|
311
|
+
</Text>
|
|
312
|
+
<Text className="block text-sm text-[#4b5563] mt-[4px]">
|
|
313
|
+
进行中
|
|
314
|
+
</Text>
|
|
315
|
+
</View>
|
|
316
|
+
<View className="text-[var(--center)] p-[16px] bg-[var(--gray-50)] rounded">
|
|
317
|
+
<Text className="text-2xl font-bold text-[#4b5563]">
|
|
318
|
+
{events.filter(e => e.status === 'pending').length}
|
|
319
|
+
</Text>
|
|
320
|
+
<Text className="block text-sm text-[#4b5563] mt-[4px]">
|
|
321
|
+
待开始
|
|
322
|
+
</Text>
|
|
323
|
+
</View>
|
|
324
|
+
</View>
|
|
325
|
+
</Card>
|
|
326
|
+
<Card className="mb-[24px]">
|
|
327
|
+
<View className="flex items-center justify-between">
|
|
328
|
+
<View className="gap-4 flex items-center">
|
|
329
|
+
<Select
|
|
330
|
+
value={viewMode}
|
|
331
|
+
onChange={value => this.handleViewModeChange(value)}
|
|
332
|
+
className=""
|
|
333
|
+
>
|
|
334
|
+
<Select.Option value="timeline">时间线</Select.Option>
|
|
335
|
+
<Select.Option value="calendar">日历</Select.Option>
|
|
336
|
+
<Select.Option value="list">列表</Select.Option>
|
|
337
|
+
</Select>
|
|
338
|
+
</View>
|
|
339
|
+
<Button type="primary">+ 添加事件</Button>
|
|
340
|
+
</View>
|
|
341
|
+
</Card>
|
|
342
|
+
{!!(viewMode === 'timeline') && (
|
|
343
|
+
<Card>
|
|
344
|
+
<Timeline>
|
|
345
|
+
{events.map((event, index) => (
|
|
346
|
+
<Timeline.Item
|
|
347
|
+
key={event.id}
|
|
348
|
+
color={statusConfig[event.status]?.color}
|
|
349
|
+
dot={typeConfig[event.type]?.icon}
|
|
350
|
+
>
|
|
351
|
+
<View>
|
|
352
|
+
<Text className="font-bold">{event.title}</Text>
|
|
353
|
+
<Text className="block text-[#6b7280] text-sm">
|
|
354
|
+
{event.date}
|
|
355
|
+
</Text>
|
|
356
|
+
<Text className="text-[#4b5563]">{event.description}</Text>
|
|
357
|
+
<View className="gap-2 flex mt-[8px]">
|
|
358
|
+
<Tag color={statusConfig[event.status]?.color}>
|
|
359
|
+
<Text>{statusConfig[event.status]?.label}</Text>
|
|
360
|
+
</Tag>
|
|
361
|
+
<Tag>
|
|
362
|
+
<Text>{event.assignee}</Text>
|
|
363
|
+
</Tag>
|
|
364
|
+
</View>
|
|
365
|
+
</View>
|
|
366
|
+
</Timeline.Item>
|
|
367
|
+
))}
|
|
368
|
+
</Timeline>
|
|
369
|
+
</Card>
|
|
370
|
+
)}
|
|
371
|
+
{!!(viewMode === 'list') && (
|
|
372
|
+
<Card>
|
|
373
|
+
{dateList.map((date, index) => (
|
|
374
|
+
<View key={date} className="mb-[24px]">
|
|
375
|
+
<Text className="block text-lg font-bold mb-[12px]">
|
|
376
|
+
{date}
|
|
377
|
+
</Text>
|
|
378
|
+
{eventsByDate[date].map((event, index) => (
|
|
379
|
+
<Text>{eventCard(event)}</Text>
|
|
380
|
+
))}
|
|
381
|
+
</View>
|
|
382
|
+
))}
|
|
383
|
+
</Card>
|
|
384
|
+
)}
|
|
385
|
+
{!!(viewMode === 'calendar') && (
|
|
386
|
+
<Card>
|
|
387
|
+
<Calendar />
|
|
388
|
+
</Card>
|
|
389
|
+
)}
|
|
390
|
+
</Page>
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export default Document;
|