@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.
Files changed (173) hide show
  1. package/.gitignore +1 -0
  2. package/bin/main.js +92 -0
  3. package/dist/index.js +7014 -14988
  4. package/package.json +8 -1
  5. package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1862 -0
  6. package/tests/test-app/.appthen/space-config.json +8 -0
  7. package/tests/test-app/docs/AI-Workflow.flow +112 -0
  8. package/tests/test-app/docs/Logic-1.flow +16 -0
  9. package/tests/test-app/docs/Logic.flow +16 -0
  10. package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
  11. package/tests/test-app/docs/Project-Blueprint.flow +119 -0
  12. package/tests/test-app/docs/README.md +3 -0
  13. package/tests/test-app/docs/claude.md +194 -0
  14. package/tests/test-app/docs/page_requirement_analysis.md +149 -0
  15. 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
  16. package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
  17. package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
  18. package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
  19. package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
  20. package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
  21. package/tests/test-app/src/app.css +15 -0
  22. package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
  23. package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
  24. package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
  25. package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
  26. package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
  27. package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
  28. package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
  29. package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
  30. package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
  31. package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
  32. package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
  33. package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
  34. package/tests/test-app/src/components/Button.js +11 -0
  35. package/tests/test-app/src/components/MessageCenter.tsx +506 -0
  36. package/tests/test-app/src/components/MouduleDemoNzp.tsx +40 -0
  37. package/tests/test-app/src/components/Timeline.tsx +145 -0
  38. package/tests/test-app/src/index.ts +2 -0
  39. package/tests/test-app/src/modules/work_order_module/apis/TicketCommentAddPost.api.ts +48 -0
  40. package/tests/test-app/src/modules/work_order_module/apis/TicketCreatePost.api.ts +52 -0
  41. package/tests/test-app/src/modules/work_order_module/apis/TicketDeleteDelete.api.ts +39 -0
  42. package/tests/test-app/src/modules/work_order_module/apis/TicketDetailGet.api.ts +39 -0
  43. package/tests/test-app/src/modules/work_order_module/apis/TicketListGet.api.ts +61 -0
  44. package/tests/test-app/src/modules/work_order_module/apis/TicketUpdatePut.api.ts +57 -0
  45. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorFaultListGet.ts +76 -0
  46. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorListGet.ts +76 -0
  47. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorOperationRecordsGet.ts +284 -0
  48. package/tests/test-app/src/modules/work_order_module/apis/TrainDoorStatisticsGet.ts +96 -0
  49. package/tests/test-app/src/modules/work_order_module/cloud_function/category|list.node.ts +40 -0
  50. package/tests/test-app/src/modules/work_order_module/cloud_function/priority|list.node.ts +26 -0
  51. package/tests/test-app/src/modules/work_order_module/cloud_function/status|list.node.ts +26 -0
  52. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|create.node.ts +54 -0
  53. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|delete.node.ts +55 -0
  54. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|detail.node.ts +65 -0
  55. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|list.node.ts +85 -0
  56. package/tests/test-app/src/modules/work_order_module/cloud_function/ticket|update.node.ts +73 -0
  57. package/tests/test-app/src/modules/work_order_module/data_model/Ticket.m.ts +85 -0
  58. package/tests/test-app/src/modules/work_order_module/data_model/TicketCategory.m.ts +53 -0
  59. package/tests/test-app/src/modules/work_order_module/data_model/TicketStatus.m.ts +60 -0
  60. 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
  61. 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
  62. package/tests/test-app/src/pages/CustomerManagement.tsx +535 -0
  63. package/tests/test-app/src/pages/CyberpunkDashboard.tsx +348 -0
  64. package/tests/test-app/src/pages/CyberpunkProductManagement.tsx +637 -0
  65. package/tests/test-app/src/pages/CyberpunkUserList.tsx +316 -0
  66. package/tests/test-app/src/pages/DashboardV2.tsx +334 -0
  67. package/tests/test-app/src/pages/DataReport.tsx +298 -0
  68. package/tests/test-app/src/pages/DataStatistics.tsx +317 -0
  69. package/tests/test-app/src/pages/DepartmentManagement.tsx +503 -0
  70. package/tests/test-app/src/pages/FileExplorer.tsx +441 -0
  71. package/tests/test-app/src/pages/OrderDetail.tsx +393 -0
  72. package/tests/test-app/src/pages/ProductManagement.tsx +521 -0
  73. package/tests/test-app/src/pages/ProjectTimeline.tsx +395 -0
  74. package/tests/test-app/src/pages/RoleManagement.tsx +523 -0
  75. package/tests/test-app/src/pages/SLAManagement.tsx +668 -0
  76. package/tests/test-app/src/pages/StaticCyberpunkDashboard.tsx +462 -0
  77. package/tests/test-app/src/pages/StaticCyberpunkUserList.tsx +567 -0
  78. package/tests/test-app/src/pages/StudentWeaknessList.tsx +547 -0
  79. package/tests/test-app/src/pages/SystemSettings.tsx +422 -0
  80. package/tests/test-app/src/pages/TaskManagement.tsx +467 -0
  81. package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
  82. package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
  83. package/tests/test-app/src/pages/TicketList.tsx +27 -0
  84. package/tests/test-app/src/pages/TicketManagement.tsx +402 -0
  85. package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
  86. package/tests/test-app/src/pages/UserProfile.tsx +404 -0
  87. package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
  88. package/tests/test-app/src/pages/WorkflowDesigner.tsx +434 -0
  89. package/tests/test-app/src/pages/admin/dashboard.tsx +591 -0
  90. package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
  91. package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
  92. package/tests/test-app/src/pages/article-list.tsx +222 -0
  93. package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -0
  94. package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
  95. package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
  96. package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
  97. package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
  98. package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
  99. package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
  100. package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
  101. package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
  102. package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
  103. package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
  104. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
  105. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
  106. package/tests/test-app/src/pages/category-list.tsx +179 -0
  107. package/tests/test-app/src/pages/comment-list.tsx +194 -0
  108. package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
  109. package/tests/test-app/src/pages/cover.tsx +42 -0
  110. package/tests/test-app/src/pages/cyberpunk/cyberpunkCRMPage.tsx +1299 -0
  111. package/tests/test-app/src/pages/data-analytics.tsx +1872 -0
  112. package/tests/test-app/src/pages/data-overview.tsx +600 -0
  113. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
  114. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
  115. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
  116. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
  117. package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
  118. package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
  119. package/tests/test-app/src/pages/demo-error-page.tsx +119 -0
  120. package/tests/test-app/src/pages/department-list.tsx +183 -0
  121. package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
  122. package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
  123. package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
  124. package/tests/test-app/src/pages/goods-list.tsx +233 -0
  125. package/tests/test-app/src/pages/housekeeping/adminDashboardPage.tsx +880 -0
  126. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
  127. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
  128. package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
  129. package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
  130. package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
  131. package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
  132. package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
  133. package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
  134. package/tests/test-app/src/pages/notice-list.tsx +217 -0
  135. package/tests/test-app/src/pages/order-detail.tsx +330 -0
  136. package/tests/test-app/src/pages/order-list.tsx +195 -0
  137. package/tests/test-app/src/pages/order-management.tsx +563 -0
  138. package/tests/test-app/src/pages/page/OrderList.tsx +230 -0
  139. package/tests/test-app/src/pages/role-list.tsx +184 -0
  140. package/tests/test-app/src/pages/simple/simplePage.tsx +92 -0
  141. package/tests/test-app/src/pages/simple-page.tsx +43 -0
  142. package/tests/test-app/src/pages/test-destructure.tsx +44 -0
  143. package/tests/test-app/src/pages/test-error-page.tsx +75 -0
  144. package/tests/test-app/src/pages/test-page-with-errors.tsx +51 -0
  145. package/tests/test-app/src/pages/test-page.tsx +101 -0
  146. package/tests/test-app/src/pages/test-render.tsx +52 -0
  147. package/tests/test-app/src/pages/test-return-type.tsx +41 -0
  148. package/tests/test-app/src/pages/test-type-assertion.tsx +37 -0
  149. package/tests/test-app/src/pages/testPage.css +3 -0
  150. package/tests/test-app/src/pages/testPage.tsx +158 -0
  151. package/tests/test-app/src/pages/ui/styleSelectorPage.tsx +1554 -0
  152. package/tests/test-app/src/pages/user-list.tsx +212 -0
  153. package/tests/test-app/src/pages/web_version/website.css +205 -0
  154. package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
  155. package/tests/test-app/src/pages/wrong-page.tsx +50 -0
  156. package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
  157. package/tests/test-app/src/project.json +1120 -0
  158. package/tests/test-app/src/store/global.store.ts +10 -0
  159. package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
  160. package/tests/test-app/src/types/SLAPolicy.ts +50 -0
  161. package/tests/test-app/src/types/Ticket.ts +68 -0
  162. package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
  163. package/tests/test-app/src/types/TicketComment.m.ts +59 -0
  164. package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
  165. package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
  166. package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
  167. package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
  168. package/tests/test-app/src/types/TicketRecord.ts +47 -0
  169. package/tests/test-app/src/types/TrainDoor.ts +284 -0
  170. package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
  171. package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
  172. package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
  173. package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
@@ -0,0 +1,434 @@
1
+ /**
2
+ * 流程设计器
3
+ * 业务流程设计和配置
4
+ *
5
+ * @type Page
6
+ * @route /workflow
7
+ * @screen 1920w
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+
12
+
13
+
14
+ class IProps {
15
+ workflowId?: number;
16
+ templateId?: number;
17
+ }
18
+
19
+ /*
20
+ * 数据与接口请求定义
21
+ */
22
+ class IState {
23
+ nodes?: {
24
+ /* @example 1 */id?: number,
25
+ /* @example start */type?: string,
26
+ /* @example 开始 */title?: string,
27
+ /* @example 100 */x?: number,
28
+ /* @example 100 */y?: number,
29
+ config?: {
30
+ /* @example 0 */timeout?: number,
31
+ /* @example manager */approver?: string,
32
+ /* @example 1 */level?: number,
33
+ /* @example amount > 10000 */expression?: string,
34
+ /* @example order */template?: string,
35
+ },
36
+ }[];
37
+ edges?: {
38
+ /* @example e1 */id?: string,
39
+ /* @example 1 */source?: number,
40
+ /* @example 2 */target?: number,
41
+ condition?: string,
42
+ }[];
43
+ loading?: boolean;
44
+ currentNode?: any;
45
+ showNodeDrawer?: boolean;
46
+ workflow?: {
47
+ /* @example 1 */id?: number,
48
+ /* @example 订单审批流程 */name?: string,
49
+ /* @example 1.0.0 */version?: string,
50
+ /* @example active */status?: string,
51
+ };
52
+ showPreview?: boolean;
53
+ }
54
+
55
+ class Document extends React.Component<IProps, IState> {
56
+ state = {
57
+ nodes: [
58
+ {
59
+ id: 1,
60
+ type: 'start',
61
+ title: '开始',
62
+ x: 100,
63
+ y: 100,
64
+ config: { timeout: 0 },
65
+ },
66
+ {
67
+ id: 2,
68
+ type: 'approval',
69
+ title: '审批',
70
+ x: 300,
71
+ y: 100,
72
+ config: { approver: 'manager', level: 1 },
73
+ },
74
+ {
75
+ id: 3,
76
+ type: 'condition',
77
+ title: '条件判断',
78
+ x: 500,
79
+ y: 100,
80
+ config: { expression: 'amount > 10000' },
81
+ },
82
+ {
83
+ id: 4,
84
+ type: 'action',
85
+ title: '生成订单',
86
+ x: 700,
87
+ y: 50,
88
+ config: { template: 'order' },
89
+ },
90
+ {
91
+ id: 5,
92
+ type: 'action',
93
+ title: '生成报告',
94
+ x: 700,
95
+ y: 150,
96
+ config: { template: 'report' },
97
+ },
98
+ { id: 6, type: 'end', title: '结束', x: 900, y: 100, config: {} },
99
+ ],
100
+ edges: [
101
+ { id: 'e1', source: 1, target: 2, condition: '' },
102
+ { id: 'e2', source: 2, target: 3, condition: '' },
103
+ { id: 'e3', source: 3, target: 4, condition: 'true' },
104
+ { id: 'e4', source: 3, target: 5, condition: 'false' },
105
+ { id: 'e5', source: 4, target: 6, condition: '' },
106
+ { id: 'e6', source: 5, target: 6, condition: '' },
107
+ ],
108
+ loading: false,
109
+ currentNode: null,
110
+ showNodeDrawer: false,
111
+ workflow: {
112
+ id: 1,
113
+ name: '订单审批流程',
114
+ version: '1.0.0',
115
+ status: 'active',
116
+ },
117
+ showPreview: false,
118
+ };
119
+
120
+ handleNodeClick(node) {
121
+ this.setState({
122
+ currentNode: node,
123
+ showNodeDrawer: true,
124
+ });
125
+ }
126
+
127
+ handleNodeConfigChange(field, value) {
128
+ this.setState({
129
+ currentNode: {
130
+ ...this.state.currentNode,
131
+ config: {
132
+ ...this.state.currentNode.config,
133
+ [field]: value,
134
+ },
135
+ },
136
+ });
137
+ }
138
+
139
+ handleSaveNode() {
140
+ this.setState({
141
+ nodes: this.state.nodes.map(n => {
142
+ if (n.id === this.state.currentNode.id) {
143
+ return this.state.currentNode;
144
+ }
145
+ return n;
146
+ }),
147
+ showNodeDrawer: false,
148
+ });
149
+ }
150
+
151
+ addNode(type, title) {
152
+ const newNode = {
153
+ id: Date.now(),
154
+ type,
155
+ title,
156
+ x: 100,
157
+ y: 100,
158
+ config: {},
159
+ };
160
+ this.setState({
161
+ nodes: [...this.state.nodes, newNode],
162
+ });
163
+ }
164
+
165
+ deleteNode(nodeId) {
166
+ this.setState({
167
+ nodes: this.state.nodes.filter(n => n.id !== nodeId),
168
+ edges: this.state.edges.filter(
169
+ e => e.source !== nodeId && e.target !== nodeId
170
+ ),
171
+ });
172
+ }
173
+
174
+ togglePreview() {
175
+ this.setState({
176
+ showPreview: !this.state.showPreview,
177
+ });
178
+ }
179
+
180
+ saveWorkflow() {
181
+ console.log(
182
+ '保存流程:',
183
+ this.state.workflow,
184
+ this.state.nodes,
185
+ this.state.edges
186
+ );
187
+ }
188
+
189
+ render() {
190
+ const nodes = this.state.nodes;
191
+ const edges = this.state.edges;
192
+ const loading = this.state.loading;
193
+ const currentNode = this.state.currentNode;
194
+ const showNodeDrawer = this.state.showNodeDrawer;
195
+ const workflow = this.state.workflow;
196
+ const showPreview = this.state.showPreview;
197
+ const nodeTypes = {
198
+ start: {
199
+ color: 'green',
200
+ icon: '⚡',
201
+ },
202
+ end: {
203
+ color: 'red',
204
+ icon: '🏁',
205
+ },
206
+ approval: {
207
+ color: 'blue',
208
+ icon: '✓',
209
+ },
210
+ condition: {
211
+ color: 'orange',
212
+ icon: '❓',
213
+ },
214
+ action: {
215
+ color: 'purple',
216
+ icon: '⚙️',
217
+ },
218
+ };
219
+ const selectedEdge = null;
220
+ const showEdgeConfig = false;
221
+ const flowSequence = nodes.map(node => {
222
+ const fromEdges = edges.filter(e => e.source === node.id);
223
+ const toEdges = edges.filter(e => e.target === node.id);
224
+ return {
225
+ node,
226
+ from: fromEdges.map(e => e.source),
227
+ to: toEdges.map(e => e.target),
228
+ };
229
+ });
230
+ const startNode = nodes.find(n => n.type === 'start');
231
+ const endNode = nodes.find(n => n.type === 'end');
232
+ const canPreview = startNode && endNode;
233
+ const nodeStats = {
234
+ total: nodes.length,
235
+ start: nodes.filter(n => n.type === 'start').length,
236
+ end: nodes.filter(n => n.type === 'end').length,
237
+ approval: nodes.filter(n => n.type === 'approval').length,
238
+ condition: nodes.filter(n => n.type === 'condition').length,
239
+ };
240
+ if (loading) {
241
+ return <View className="p-6">加载中...</View>;
242
+ }
243
+ const nodeCard = node => (
244
+ <Card
245
+ key={node.id}
246
+ className={`absolute cursor-pointer transition-all hover:shadow-lg`}
247
+ style={{
248
+ left: node.x + 'px',
249
+ top: node.y + 'px',
250
+ borderColor: nodeTypes[node.type]?.color,
251
+ }}
252
+ onClick={() => this.handleNodeClick(node)}
253
+ >
254
+ <View className="flex items-center gap-2">
255
+ <Text>{nodeTypes[node.type]?.icon}</Text>
256
+ <Text className="font-bold">{node.title}</Text>
257
+ </View>
258
+ </Card>
259
+ );
260
+ return (
261
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
262
+ <View className="mb-[24px]">
263
+ <Text className="text-2xl font-bold text-[#1f2937]">流程设计器</Text>
264
+ <Text className="text-[#6b7280] text-sm mt-[4px]">
265
+ 业务流程设计和配置
266
+ </Text>
267
+ </View>
268
+ <Card className="mb-[24px]">
269
+ <View className="flex items-center justify-between">
270
+ <View>
271
+ <Text className="text-lg font-bold">{workflow.name}</Text>
272
+ <Text className="text-[#6b7280]">
273
+ 版本:{workflow.version}| 状态:{workflow.status}
274
+ </Text>
275
+ </View>
276
+ <View className="gap-2 flex">
277
+ <Button onClick={() => this.togglePreview()}>预览</Button>
278
+ <Button type="primary" onClick={() => this.saveWorkflow()}>
279
+ 保存
280
+ </Button>
281
+ </View>
282
+ </View>
283
+ </Card>
284
+ <Card className="mb-[24px]">
285
+ <View className="gap-4 grid grid-cols-5">
286
+ <View className="text-[var(--center)]">
287
+ <Text className="text-2xl font-bold">{nodeStats.total}</Text>
288
+ <Text className="block text-sm text-[#6b7280]">节点总数</Text>
289
+ </View>
290
+ <View className="text-[var(--center)]">
291
+ <Text className="text-2xl font-bold text-[var(--green-600)]">
292
+ {nodeStats.start}
293
+ </Text>
294
+ <Text className="block text-sm text-[#6b7280]">开始节点</Text>
295
+ </View>
296
+ <View className="text-[var(--center)]">
297
+ <Text className="text-2xl font-bold text-[var(--red-600)]">
298
+ {nodeStats.end}
299
+ </Text>
300
+ <Text className="block text-sm text-[#6b7280]">结束节点</Text>
301
+ </View>
302
+ <View className="text-[var(--center)]">
303
+ <Text className="text-2xl font-bold text-[var(--blue-600)]">
304
+ {nodeStats.approval}
305
+ </Text>
306
+ <Text className="block text-sm text-[#6b7280]">审批节点</Text>
307
+ </View>
308
+ <View className="text-[var(--center)]">
309
+ <Text className="text-2xl font-bold text-[var(--orange-600)]">
310
+ {nodeStats.condition}
311
+ </Text>
312
+ <Text className="block text-sm text-[#6b7280]">条件节点</Text>
313
+ </View>
314
+ </View>
315
+ </Card>
316
+ <Card className="mb-[24px]">
317
+ <View className="gap-2 flex items-center">
318
+ <Button onClick={() => this.addNode('approval', '新审批节点')}>
319
+ + 审批
320
+ </Button>
321
+ <Button onClick={() => this.addNode('condition', '新条件节点')}>
322
+ + 条件
323
+ </Button>
324
+ <Button onClick={() => this.addNode('action', '新动作节点')}>
325
+ + 动作
326
+ </Button>
327
+ <Button onClick={() => this.addNode('start', '新开始节点')}>
328
+ + 开始
329
+ </Button>
330
+ <Button onClick={() => this.addNode('end', '新结束节点')}>
331
+ + 结束
332
+ </Button>
333
+ </View>
334
+ </Card>
335
+ <Card className="mb-[24px] h-[600px] overflow-hidden relative bg-[#f3f4f6]">
336
+ {nodes.map((node, index) => (
337
+ <Text>{nodeCard(node)}</Text>
338
+ ))}
339
+ </Card>
340
+ {!!showPreview && (
341
+ <Card>
342
+ <Text className="block text-lg font-bold mb-[16px]">流程预览</Text>
343
+ <Steps
344
+ current={flowSequence.findIndex(function (item) {
345
+ return item.node.id === currentNode?.id;
346
+ })}
347
+ items={flowSequence.map(function (item, index) {
348
+ return {
349
+ title: item.node.title,
350
+ description: item.node.type,
351
+ status: item.node.type === 'end' ? 'finish' : 'process',
352
+ };
353
+ })}
354
+ />
355
+ </Card>
356
+ )}
357
+ <Drawer
358
+ title="节点配置"
359
+ placement="right"
360
+ width={500}
361
+ visible={showNodeDrawer}
362
+ onClose={() =>
363
+ this.setState({
364
+ showNodeDrawer: false,
365
+ })
366
+ }
367
+ >
368
+ <View>
369
+ <View className="mb-[16px]">
370
+ <Text className="block mb-[8px] font-bold">节点名称</Text>
371
+ <Input
372
+ value={currentNode?.title}
373
+ onChange={e =>
374
+ this.setState({
375
+ currentNode: {
376
+ ...currentNode,
377
+ title: e.target.value,
378
+ },
379
+ })
380
+ }
381
+ />
382
+ </View>
383
+ <View className="mb-[16px]">
384
+ <Text className="block mb-[8px] font-bold">节点类型</Text>
385
+ <Text>{currentNode?.type}</Text>
386
+ </View>
387
+ <View className="mb-[16px]">
388
+ <Text className="block mb-[8px] font-bold">位置</Text>
389
+ <View className="gap-2 flex">
390
+ <InputNumber
391
+ value={currentNode?.x}
392
+ onChange={value =>
393
+ this.setState({
394
+ currentNode: {
395
+ ...currentNode,
396
+ x: value,
397
+ },
398
+ })
399
+ }
400
+ addonBefore="X"
401
+ />
402
+ <InputNumber
403
+ value={currentNode?.y}
404
+ onChange={value =>
405
+ this.setState({
406
+ currentNode: {
407
+ ...currentNode,
408
+ y: value,
409
+ },
410
+ })
411
+ }
412
+ addonBefore="Y"
413
+ />
414
+ </View>
415
+ </View>
416
+ <View className="gap-2 mt-[24px] flex justify-end">
417
+ <Button
418
+ danger={true}
419
+ onClick={() => this.deleteNode(currentNode?.id)}
420
+ >
421
+ 删除节点
422
+ </Button>
423
+ <Button type="primary" onClick={() => this.handleSaveNode()}>
424
+ 保存配置
425
+ </Button>
426
+ </View>
427
+ </View>
428
+ </Drawer>
429
+ </Page>
430
+ );
431
+ }
432
+ }
433
+
434
+ export default Document;