@appthen/cli 1.2.8 → 1.2.11

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 (122) hide show
  1. package/.gitignore +1 -0
  2. package/bin/main.js +45 -0
  3. package/dist/index.js +1277 -909
  4. package/package.json +1 -1
  5. package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1406 -0
  6. package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +1060 -0
  7. package/tests/test-app/.appthen/space-config.json +8 -0
  8. package/tests/test-app/docs/AI-Workflow.flow +112 -0
  9. package/tests/test-app/docs/Logic-1.flow +16 -0
  10. package/tests/test-app/docs/Logic.flow +16 -0
  11. package/tests/test-app/docs/Project-Blueprint-1.flow +119 -0
  12. package/tests/test-app/docs/Project-Blueprint.flow +119 -0
  13. package/tests/test-app/docs/README.md +3 -0
  14. package/tests/test-app/docs/claude.md +194 -0
  15. package/tests/test-app/docs/page_requirement_analysis.md +149 -0
  16. 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
  17. package/tests/test-app/src/apis/AddTodoPost.api.ts +42 -0
  18. package/tests/test-app/src/apis/DeleteTodoPost.api.ts +32 -0
  19. package/tests/test-app/src/apis/GetListPost.api.ts +38 -0
  20. package/tests/test-app/src/apis/TicketAttachmentUploadPost.api.ts +42 -0
  21. package/tests/test-app/src/apis/UpdateTodoPost.api.ts +46 -0
  22. package/tests/test-app/src/app.css +15 -0
  23. package/tests/test-app/src/cloud_functions/ticket|attachment|upload.node.ts +86 -0
  24. package/tests/test-app/src/cloud_functions/ticket|comment|add.node.ts +65 -0
  25. package/tests/test-app/src/cloud_functions/types|entity|Ticket.node.ts +88 -0
  26. package/tests/test-app/src/cloud_functions/types|entity|TicketAttachment.node.ts +70 -0
  27. package/tests/test-app/src/cloud_functions/types|entity|TicketCategory.node.ts +56 -0
  28. package/tests/test-app/src/cloud_functions/types|entity|TicketComment.node.ts +62 -0
  29. package/tests/test-app/src/cloud_functions/types|entity|TicketHistory.node.ts +74 -0
  30. package/tests/test-app/src/cloud_functions/types|entity|TicketPriority.node.ts +68 -0
  31. package/tests/test-app/src/cloud_functions/types|entity|TicketStatus.node.ts +63 -0
  32. package/tests/test-app/src/cloud_functions/types|models|CreateTicketParams.node.ts +20 -0
  33. package/tests/test-app/src/cloud_functions/types|models|TicketListParams.node.ts +30 -0
  34. package/tests/test-app/src/cloud_functions/types|models|UpdateTicketParams.node.ts +22 -0
  35. package/tests/test-app/src/components/Button.js +11 -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/SLAManagement.tsx +668 -0
  63. package/tests/test-app/src/pages/TicketCreate.tsx +27 -0
  64. package/tests/test-app/src/pages/TicketDetail.tsx +27 -0
  65. package/tests/test-app/src/pages/TicketList.tsx +27 -0
  66. package/tests/test-app/src/pages/TicketManagementPage.tsx +1238 -0
  67. package/tests/test-app/src/pages/VisualAIIDEUpgrade.tsx +245 -0
  68. package/tests/test-app/src/pages/appthen_guide/ComponentTreeUnderstanding.tsx +26 -0
  69. package/tests/test-app/src/pages/appthen_guide/DataBindingLearning.tsx +26 -0
  70. package/tests/test-app/src/pages/back-end/adminRootLayout.tsx +155 -0
  71. package/tests/test-app/src/pages/back-end/adminRootLayout10.tsx +157 -0
  72. package/tests/test-app/src/pages/back-end/adminRootLayout2.tsx +156 -0
  73. package/tests/test-app/src/pages/back-end/adminRootLayout3.tsx +156 -0
  74. package/tests/test-app/src/pages/back-end/adminRootLayout4.tsx +157 -0
  75. package/tests/test-app/src/pages/back-end/adminRootLayout5.tsx +157 -0
  76. package/tests/test-app/src/pages/back-end/adminRootLayout6.tsx +157 -0
  77. package/tests/test-app/src/pages/back-end/adminRootLayout7.tsx +157 -0
  78. package/tests/test-app/src/pages/back-end/adminRootLayout8.tsx +157 -0
  79. package/tests/test-app/src/pages/back-end/adminRootLayout9.tsx +157 -0
  80. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.css +5 -0
  81. package/tests/test-app/src/pages/back-end/backgroundManagementSystem.tsx +1745 -0
  82. package/tests/test-app/src/pages/component/WorkOrderCard.tsx +140 -0
  83. package/tests/test-app/src/pages/cover.tsx +42 -0
  84. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.css +181 -0
  85. package/tests/test-app/src/pages/data_dashboard/blueBrightGreenTechnologyWind.tsx +225 -0
  86. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.css +181 -0
  87. package/tests/test-app/src/pages/data_dashboard/blueLargeScreen.tsx +138 -0
  88. package/tests/test-app/src/pages/data_dashboard/component_library/BlueBrightGreenBorder.tsx +47 -0
  89. package/tests/test-app/src/pages/data_dashboard/component_library/FullScreenContainer.tsx +133 -0
  90. package/tests/test-app/src/pages/description_of_mock_interface.md +32 -0
  91. package/tests/test-app/src/pages/digitalLargeScreen.css +181 -0
  92. package/tests/test-app/src/pages/digitalLargeScreen.tsx +1417 -0
  93. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.css +3 -0
  94. package/tests/test-app/src/pages/mobile_terminal/PersonalCenter.tsx +362 -0
  95. package/tests/test-app/src/pages/mobile_terminal/WorkOrderHomepage.tsx +337 -0
  96. package/tests/test-app/src/pages/mobile_terminal/newWorkOrder.tsx +224 -0
  97. package/tests/test-app/src/pages/mobile_terminal/tabbar.tsx +67 -0
  98. package/tests/test-app/src/pages/mobile_terminal/uiHandsOnPractice.tsx +638 -0
  99. package/tests/test-app/src/pages/mobile_terminal/workOrderDetails.tsx +346 -0
  100. package/tests/test-app/src/pages/mobile_terminal/workOrderPage.tsx +345 -0
  101. package/tests/test-app/src/pages/testPage.css +3 -0
  102. package/tests/test-app/src/pages/testPage.tsx +158 -0
  103. package/tests/test-app/src/pages/web_version/website.css +205 -0
  104. package/tests/test-app/src/pages/web_version/website.tsx +1066 -0
  105. package/tests/test-app/src/pages//345/276/205/345/212/236.apidoc.json +336 -0
  106. package/tests/test-app/src/project.json +1120 -0
  107. package/tests/test-app/src/store/global.store.ts +10 -0
  108. package/tests/test-app/src/types/CreateTicketParams.m.ts +20 -0
  109. package/tests/test-app/src/types/SLAPolicy.ts +50 -0
  110. package/tests/test-app/src/types/Ticket.ts +68 -0
  111. package/tests/test-app/src/types/TicketAttachment.m.ts +67 -0
  112. package/tests/test-app/src/types/TicketComment.m.ts +59 -0
  113. package/tests/test-app/src/types/TicketEvaluation.ts +44 -0
  114. package/tests/test-app/src/types/TicketHistory.m.ts +71 -0
  115. package/tests/test-app/src/types/TicketListParams.m.ts +30 -0
  116. package/tests/test-app/src/types/TicketPriority.m.ts +65 -0
  117. package/tests/test-app/src/types/TicketRecord.ts +47 -0
  118. package/tests/test-app/src/types/TrainDoor.ts +284 -0
  119. package/tests/test-app/src/types/UpdateTicketParams.m.ts +22 -0
  120. package/tests/test-app/src/utils/__afterRequest.util.ts +3 -0
  121. package/tests/test-app/src/utils/__beforeRequest.util.ts +10 -0
  122. package/tests/test-app/src/utils/testGlobalAction.util.ts +7 -0
@@ -0,0 +1,245 @@
1
+ /**
2
+ * 可视化AI IDE升级介绍
3
+ * 展示从可视化IDE升级到可视化AI IDE的四大核心特性
4
+ *
5
+ * @type Component
6
+ * @screen 1920x800 #1a1a1a
7
+ * @frames web
8
+ * @portal true
9
+ */
10
+ import React from 'react';
11
+ import { Component, Text, View } from '@appthen/react';
12
+ import main from '/src/pages/test/main';
13
+
14
+
15
+ class IProps {
16
+ /* 主题色 */
17
+ themeColor: string;
18
+ }
19
+
20
+ /*
21
+ * 数据与接口请求定义
22
+ */
23
+ class IState {
24
+ /* 当前激活的特性索引 */
25
+ activeFeature: number;
26
+ }
27
+
28
+ class Document extends React.Component<IProps, IState> {
29
+ state = { activeFeature: 0 };
30
+
31
+ /**
32
+ * 切换特性展示
33
+ */
34
+ switchFeature(index) {
35
+ this.setState({
36
+ activeFeature: index,
37
+ });
38
+ }
39
+
40
+ render() {
41
+ return (
42
+ <React.Fragment>
43
+ <View className="w-full h-full bg-[#111827] flex flex-col overflow-hidden">
44
+ <header className="p-[32px] text-[var(--center)]">
45
+ <h1 className="bg-gradient-to-r from-purple-400 via-[#f472b6] to-indigo-400 [WebkitBackgroundClip:text] [WebkitTextFillColor:transparent] [backgroundClip:text] [backgroundClip:text] [WebkitBackgroundClip:text] text-[transparent] text-5xl font-bold mb-[8px]">
46
+ 可视化AI IDE
47
+ </h1>
48
+ <h2 className="bg-gradient-to-r from-blue-400 via-[var(--cyan-400)] to-[var(--teal-400)] [WebkitBackgroundClip:text] [WebkitTextFillColor:transparent] [backgroundClip:text] [backgroundClip:text] [WebkitBackgroundClip:text] text-[transparent] text-3xl font-bold">
49
+ 全面升级
50
+ </h2>
51
+ <p className="text-[#9ca3af] mt-[16px] text-lg">
52
+ 从可视化IDE到可视化AI IDE的进化之路
53
+ </p>
54
+ </header>
55
+ <main className="flex-1 flex items-center justify-center pl-[32px] pr-[32px]">
56
+ <View className="w-full">
57
+ <View className="border-gray-700 bg-[#1f2937] rounded-2xl p-[32px] shadow-[0 25px 50px -12px rgb(0 0 0 / 0.25)] border border-solid">
58
+ <View className="text-[var(--center)] mb-[24px]">
59
+ <View className="text-6xl mb-[2px]">
60
+ {!!(this.state.activeFeature === 0) && <Text>📁</Text>}
61
+ {!!(this.state.activeFeature === 1) && <Text>⚡</Text>}
62
+ {!!(this.state.activeFeature === 2) && <Text>🤖</Text>}
63
+ {!!(this.state.activeFeature === 3) && <Text>👥</Text>}
64
+ </View>
65
+ <h3
66
+ className={`text-2xl font-bold bg-gradient-to-r ${
67
+ this.state.activeFeature === 0
68
+ ? 'from-purple-500 to-pink-500'
69
+ : this.state.activeFeature === 1
70
+ ? 'from-blue-500 to-cyan-500'
71
+ : this.state.activeFeature === 2
72
+ ? 'from-green-500 to-emerald-500'
73
+ : 'from-orange-500 to-red-500'
74
+ } bg-clip-text text-transparent mb-2`}
75
+ >{`${
76
+ this.state.activeFeature === 0 ? '对象资源管理能力增强' : ''
77
+ }${this.state.activeFeature === 1 ? '双向编辑能力' : ''}${
78
+ this.state.activeFeature === 2 ? 'AI能力增强' : ''
79
+ }${
80
+ this.state.activeFeature === 3 ? '协作能力增强' : ''
81
+ }`}</h3>
82
+ <p className="text-[#d1d5db] text-lg mt-[7px]">{`${
83
+ this.state.activeFeature === 0 ? '模块化文件夹管理' : ''
84
+ }${this.state.activeFeature === 1 ? '可视化 ↔ 代码' : ''}${
85
+ this.state.activeFeature === 2 ? '完整AI Agent集成' : ''
86
+ }${
87
+ this.state.activeFeature === 3 ? '人机协作新体验' : ''
88
+ }`}</p>
89
+ </View>
90
+ <View className="bg-[#374151] rounded-xl p-[24px] mb-[24px]">
91
+ <p className="text-[#fff4f4] [lineHeight:1.625]">{`${
92
+ this.state.activeFeature === 0
93
+ ? '现在可以用文件夹的方式,将前端、后端、接口文档、协作文档都方便进行模块化的管理'
94
+ : ''
95
+ }${
96
+ this.state.activeFeature === 1
97
+ ? '所有资源都可以进行可视化开发和代码开发双向编辑,让开发者可以自由切换工作模式,提升开发效率'
98
+ : ''
99
+ }${
100
+ this.state.activeFeature === 2
101
+ ? '引入完整的AI Agent,可以更好地理解低代码资源,提供更充足的上下文帮助我们完成应用开发工作'
102
+ : ''
103
+ }${
104
+ this.state.activeFeature === 3
105
+ ? '与同事更好的协作,与AI更好的协作,打造全新的协作开发体验'
106
+ : ''
107
+ }`}</p>
108
+ </View>
109
+ <View className="space-x-2 flex justify-center">
110
+ <button
111
+ onClick={() => this.switchFeature(0)}
112
+ className={`w-3 h-3 rounded-full transition-all duration-300 ${
113
+ this.state.activeFeature === 0
114
+ ? 'bg-white scale-125'
115
+ : 'bg-gray-600 hover:bg-gray-500'
116
+ }`}
117
+ />
118
+ <button
119
+ onClick={() => this.switchFeature(1)}
120
+ className={`w-3 h-3 rounded-full transition-all duration-300 ${
121
+ this.state.activeFeature === 1
122
+ ? 'bg-white scale-125'
123
+ : 'bg-gray-600 hover:bg-gray-500'
124
+ }`}
125
+ />
126
+ <button
127
+ onClick={() => this.switchFeature(2)}
128
+ className={`w-3 h-3 rounded-full transition-all duration-300 ${
129
+ this.state.activeFeature === 2
130
+ ? 'bg-white scale-125'
131
+ : 'bg-gray-600 hover:bg-gray-500'
132
+ }`}
133
+ />
134
+ <button
135
+ onClick={() => this.switchFeature(3)}
136
+ className={`w-3 h-3 rounded-full transition-all duration-300 ${
137
+ this.state.activeFeature === 3
138
+ ? 'bg-white scale-125'
139
+ : 'bg-gray-600 hover:bg-gray-500'
140
+ }`}
141
+ />
142
+ </View>
143
+ </View>
144
+ <View className="mt-[32px] grid grid-cols-2 gap-4">
145
+ <button
146
+ onClick={() => this.switchFeature(0)}
147
+ className={`p-4 rounded-xl border transition-all duration-300 ${
148
+ this.state.activeFeature === 0
149
+ ? 'border-purple-500 bg-purple-500/10'
150
+ : 'border-gray-700 bg-gray-800 hover:border-gray-600'
151
+ }`}
152
+ >
153
+ <View className="text-2xl mb-[8px]">
154
+ <Text>📁</Text>
155
+ </View>
156
+ <View
157
+ className={`text-sm font-medium ${
158
+ this.state.activeFeature === 0
159
+ ? 'text-purple-400'
160
+ : 'text-gray-400'
161
+ }`}
162
+ >
163
+ <Text>资源管理</Text>
164
+ </View>
165
+ </button>
166
+ <button
167
+ onClick={() => this.switchFeature(1)}
168
+ className={`p-4 rounded-xl border transition-all duration-300 ${
169
+ this.state.activeFeature === 1
170
+ ? 'border-blue-500 bg-blue-500/10'
171
+ : 'border-gray-700 bg-gray-800 hover:border-gray-600'
172
+ }`}
173
+ >
174
+ <View className="text-2xl mb-[8px]">
175
+ <Text>⚡</Text>
176
+ </View>
177
+ <View
178
+ className={`text-sm font-medium ${
179
+ this.state.activeFeature === 1
180
+ ? 'text-blue-400'
181
+ : 'text-gray-400'
182
+ }`}
183
+ >
184
+ <Text>双向编辑</Text>
185
+ </View>
186
+ </button>
187
+ <button
188
+ onClick={() => this.switchFeature(2)}
189
+ className={`p-4 rounded-xl border transition-all duration-300 ${
190
+ this.state.activeFeature === 2
191
+ ? 'border-green-500 bg-green-500/10'
192
+ : 'border-gray-700 bg-gray-800 hover:border-gray-600'
193
+ }`}
194
+ >
195
+ <View className="text-2xl mb-[8px]">
196
+ <Text>🤖</Text>
197
+ </View>
198
+ <View
199
+ className={`text-sm font-medium ${
200
+ this.state.activeFeature === 2
201
+ ? 'text-green-400'
202
+ : 'text-gray-400'
203
+ }`}
204
+ >
205
+ <Text>AI增强</Text>
206
+ </View>
207
+ </button>
208
+ <button
209
+ onClick={() => this.switchFeature(3)}
210
+ className={`p-4 rounded-xl border transition-all duration-300 ${
211
+ this.state.activeFeature === 3
212
+ ? 'border-orange-500 bg-orange-500/10'
213
+ : 'border-gray-700 bg-gray-800 hover:border-gray-600'
214
+ }`}
215
+ >
216
+ <View className="text-2xl mb-[8px]">
217
+ <Text>👥</Text>
218
+ </View>
219
+ <View
220
+ className={`text-sm font-medium ${
221
+ this.state.activeFeature === 3
222
+ ? 'text-orange-400'
223
+ : 'text-gray-400'
224
+ }`}
225
+ >
226
+ <Text>协作增强</Text>
227
+ </View>
228
+ </button>
229
+ </View>
230
+ </View>
231
+ </main>
232
+ <footer className="p-[16px] text-[var(--center)]">
233
+ <View className="space-x-8 flex justify-center text-[#6b7280] text-sm">
234
+ <Text>🚀 更快</Text>
235
+ <Text>🎯 更准</Text>
236
+ <Text>💡 更智能</Text>
237
+ </View>
238
+ </footer>
239
+ </View>
240
+ </React.Fragment>
241
+ );
242
+ }
243
+ }
244
+
245
+ export default Document;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 组件树理解
3
+ * @type Component
4
+ * @screen 1400w
5
+ * @frames web
6
+ */
7
+ import React from 'react';
8
+ import { Component } from '@appthen/react';
9
+
10
+
11
+ class IProps {}
12
+
13
+ /*
14
+ * 数据与接口请求定义
15
+ */
16
+ class IState {}
17
+
18
+ class Document extends React.Component<IProps, IState> {
19
+ state = {};
20
+
21
+ render() {
22
+ return <React.Fragment />;
23
+ }
24
+ }
25
+
26
+ export default Document;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 数据绑定学习
3
+ * @type Component
4
+ * @screen 1400w
5
+ * @frames web
6
+ */
7
+ import React from 'react';
8
+ import { Component } from '@appthen/react';
9
+
10
+
11
+ class IProps {}
12
+
13
+ /*
14
+ * 数据与接口请求定义
15
+ */
16
+ class IState {}
17
+
18
+ class Document extends React.Component<IProps, IState> {
19
+ state = {};
20
+
21
+ render() {
22
+ return <React.Fragment />;
23
+ }
24
+ }
25
+
26
+ export default Document;
@@ -0,0 +1,155 @@
1
+ /**
2
+ * 后台根布局
3
+ * @type Page
4
+ * @screen 1400w
5
+ * @frames web
6
+ */
7
+ import React from 'react';
8
+ import { AtIcon, Page, View } from '@appthen/react';
9
+ import { ProConfigProvider, ProLayout } from '@appthen/antd-pro';
10
+
11
+
12
+ class IProps {}
13
+
14
+ /*
15
+ * 数据与接口请求定义
16
+ */
17
+ class IState {
18
+ /* 菜单数据 */
19
+ menu?: any;
20
+ }
21
+
22
+ class Document extends React.Component<IProps, IState> {
23
+ state = {};
24
+
25
+ /**
26
+ * 页面加载后执行
27
+ */
28
+ componentDidMount() {
29
+ const globalMenu = this.utils.getGlobalData('ADMIN_MENU');
30
+ if (globalMenu) {
31
+ const menu = JSON.parse(JSON.stringify(globalMenu));
32
+ // 转换图标
33
+ menu.routes = this.transformMenus(menu.routes);
34
+ this.setState(
35
+ {
36
+ menu,
37
+ },
38
+ () => {
39
+ console.log(
40
+ 111,
41
+ this.history?.location?.pathname ||
42
+ this.state.menu?.routes[0]?.routes?.[0]?.path ||
43
+ this.state.menu?.routes[0]?.path
44
+ );
45
+ }
46
+ );
47
+ }
48
+ }
49
+
50
+ /**
51
+ * 菜单转换
52
+ */
53
+ transformMenus(routes) {
54
+ return routes.map(menu => {
55
+ if (menu.icon && menu.icon.includes('<svg')) {
56
+ menu.icon = React.createElement('div', {
57
+ style: {
58
+ width: '14px',
59
+ height: '14px',
60
+ lineHeight: 1,
61
+ },
62
+ dangerouslySetInnerHTML: { __html: menu.icon },
63
+ });
64
+ }
65
+ menu.routes =
66
+ menu.route?.length > 0 ? this.transformMenus(menu.routes) : [];
67
+ return menu;
68
+ });
69
+ }
70
+
71
+ render() {
72
+ return (
73
+ <Page>
74
+ <ProConfigProvider
75
+ autoClearCache={false}
76
+ needDeps={false}
77
+ dark={false}
78
+ hashed={false}
79
+ >
80
+ <ProLayout
81
+ avatarProps={{
82
+ src: 'https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg',
83
+ size: 'small',
84
+ title: 'Nickname',
85
+ }}
86
+ devops={false}
87
+ route={this.state.menu}
88
+ location={{
89
+ pathname:
90
+ this.history?.location?.pathname ||
91
+ this.state.menu?.routes[0]?.routes?.[0]?.path ||
92
+ this.state.menu?.routes[0]?.path,
93
+ }}
94
+ title="后台管理系统"
95
+ links={[]}
96
+ menu={{
97
+ locale: false,
98
+ defaultOpenAll: false,
99
+ ignoreFlatMenu: false,
100
+ loading: false,
101
+ params: {},
102
+ type: 'sub',
103
+ }}
104
+ siderWidth={280}
105
+ contentWidth="Fluid"
106
+ token={{}}
107
+ layout="mix"
108
+ content={
109
+ <View
110
+ inlineStyle={[
111
+ {
112
+ enable: this.props.__designMode === 'design',
113
+ name: '开发模式',
114
+ style: { height: '100%', backgroundColor: '#f5f5f5' },
115
+ },
116
+ ]}
117
+ __hidePh={true}
118
+ >
119
+ {this.props.children}
120
+ </View>
121
+ }
122
+ key={this.state.menu?.routes?.length}
123
+ _unsafe_MixedSetter_key_select="VariableSetter"
124
+ contentStyle={{
125
+ paddingTop: '0px',
126
+ paddingRight: '0px',
127
+ paddingBottom: '0px',
128
+ paddingLeft: '0px',
129
+ }}
130
+ onPageChange={location => {
131
+ if (location?.pathname) {
132
+ this.history.push(location?.pathname);
133
+ }
134
+ }}
135
+ _unsafe_extendAttr={[{ key: 'splitMenus', value: true }]}
136
+ splitMenus={true}
137
+ logo={
138
+ <View>
139
+ <AtIcon
140
+ color="#5281ff"
141
+ size={30}
142
+ svg="&#60;svg t=&#34;1754273789163&#34; class=&#34;icon&#34; viewBox=&#34;0 0 1024 1024&#34; version=&#34;1.1&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34; p-id=&#34;5352&#34; width=&#34;100%&#34; height=&#34;100%&#34;&#62;&#60;path d=&#34;M832.8 289L543.2 120.6c-19.4-11.4-43.3-11.4-62.4 0L191.2 289c-19.4 11.4-31.2 31.8-31.2 54.6v336.8c0 22.4 11.7 43.2 31.2 54.6l289.6 168.4c19.4 11.4 43.3 11.4 62.4 0L832.8 735c19.4-11.4 31.2-31.8 31.2-54.6V343.2c0-22.4-11.7-43.2-31.2-54.2zM731.5 406.4l-184.3 94.2v218.1c0 19.6-15.8 35.5-35.2 35.5-19.4 0-35.2-15.9-35.2-35.5V500.6l-184.3-94.2c-17.4-9-24.3-30.2-15.4-47.7 8.9-17.5 30-24.5 47.4-15.5L512 439.4l187.9-95.8c17.4-9 38.5-1.6 47.4 15.5 9 17.1 1.7 38.7-15.8 47.3z m0 0&#34; p-id=&#34;5353&#34; fill=&#34;currentColor&#34;/&#62;&#60;/path&#62;&#60;/svg&#62;"
143
+ />
144
+ </View>
145
+ }
146
+ _unsafe_MixedSetter_logo_select="SlotSetter"
147
+ className="min-h-screen"
148
+ />
149
+ </ProConfigProvider>
150
+ </Page>
151
+ );
152
+ }
153
+ }
154
+
155
+ export default Document;
@@ -0,0 +1,157 @@
1
+ /**
2
+ * 后台根布局10
3
+ * @type Page
4
+ * @screen 1400w
5
+ * @frames web
6
+ */
7
+ import React from 'react';
8
+ import { AtIcon, Page, View } from '@appthen/react';
9
+ import { ProConfigProvider, ProLayout } from '@appthen/antd-pro';
10
+
11
+
12
+ class IProps {}
13
+
14
+ /*
15
+ * 数据与接口请求定义
16
+ */
17
+ class IState {
18
+ /* 菜单数据 */
19
+ menu?: any;
20
+ }
21
+
22
+ class Document extends React.Component<IProps, IState> {
23
+ state = {};
24
+
25
+ /**
26
+ * 页面加载后执行
27
+ */
28
+ componentDidMount() {
29
+ const globalMenu = this.utils.getGlobalData('ADMIN_MENU');
30
+ if (globalMenu) {
31
+ const menu = JSON.parse(JSON.stringify(globalMenu));
32
+ // 转换图标
33
+ menu.routes = this.transformMenus(menu.routes);
34
+ this.setState(
35
+ {
36
+ menu,
37
+ },
38
+ () => {
39
+ console.log(
40
+ 111,
41
+ this.history?.location?.pathname ||
42
+ this.state.menu?.routes[0]?.routes?.[0]?.path ||
43
+ this.state.menu?.routes[0]?.path
44
+ );
45
+ }
46
+ );
47
+ }
48
+ }
49
+
50
+ /**
51
+ * 菜单转换
52
+ */
53
+ transformMenus(routes) {
54
+ return routes.map(menu => {
55
+ if (menu.icon && menu.icon.includes('<svg')) {
56
+ menu.icon = React.createElement('div', {
57
+ style: {
58
+ width: '14px',
59
+ height: '14px',
60
+ lineHeight: 1,
61
+ },
62
+ dangerouslySetInnerHTML: {
63
+ __html: menu.icon,
64
+ },
65
+ });
66
+ }
67
+ menu.routes =
68
+ menu.route?.length > 0 ? this.transformMenus(menu.routes) : [];
69
+ return menu;
70
+ });
71
+ }
72
+
73
+ render() {
74
+ return (
75
+ <Page>
76
+ <ProConfigProvider
77
+ autoClearCache={false}
78
+ needDeps={false}
79
+ dark={false}
80
+ hashed={false}
81
+ >
82
+ <ProLayout
83
+ avatarProps={{
84
+ src: 'https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg',
85
+ size: 'small',
86
+ title: 'Nickname',
87
+ }}
88
+ devops={false}
89
+ route={this.state.menu}
90
+ location={{
91
+ pathname:
92
+ this.history?.location?.pathname ||
93
+ this.state.menu?.routes[0]?.routes?.[0]?.path ||
94
+ this.state.menu?.routes[0]?.path,
95
+ }}
96
+ title="后台管理系统"
97
+ links={[]}
98
+ menu={{
99
+ locale: false,
100
+ defaultOpenAll: false,
101
+ ignoreFlatMenu: false,
102
+ loading: false,
103
+ params: {},
104
+ type: 'sub',
105
+ }}
106
+ siderWidth={280}
107
+ contentWidth="Fluid"
108
+ token={{}}
109
+ layout="mix"
110
+ content={
111
+ <View
112
+ inlineStyle={[
113
+ {
114
+ enable: this.props.__designMode === 'design',
115
+ name: '开发模式',
116
+ style: { height: '100%', backgroundColor: '#f5f5f5' },
117
+ },
118
+ ]}
119
+ __hidePh={true}
120
+ >
121
+ {this.props.children}
122
+ </View>
123
+ }
124
+ key={this.state.menu?.routes?.length}
125
+ _unsafe_MixedSetter_key_select="VariableSetter"
126
+ contentStyle={{
127
+ paddingTop: '0px',
128
+ paddingRight: '0px',
129
+ paddingBottom: '0px',
130
+ paddingLeft: '0px',
131
+ }}
132
+ onPageChange={location => {
133
+ if (location?.pathname) {
134
+ this.history.push(location?.pathname);
135
+ }
136
+ }}
137
+ _unsafe_extendAttr={[{ key: 'splitMenus', value: true }]}
138
+ splitMenus={true}
139
+ logo={
140
+ <View>
141
+ <AtIcon
142
+ color="#5281ff"
143
+ size={30}
144
+ svg="&#60;svg t=&#34;1754273789163&#34; class=&#34;icon&#34; viewBox=&#34;0 0 1024 1024&#34; version=&#34;1.1&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34; p-id=&#34;5352&#34; width=&#34;100%&#34; height=&#34;100%&#34;&#62;&#60;path d=&#34;M832.8 289L543.2 120.6c-19.4-11.4-43.3-11.4-62.4 0L191.2 289c-19.4 11.4-31.2 31.8-31.2 54.6v336.8c0 22.4 11.7 43.2 31.2 54.6l289.6 168.4c19.4 11.4 43.3 11.4 62.4 0L832.8 735c19.4-11.4 31.2-31.8 31.2-54.6V343.2c0-22.4-11.7-43.2-31.2-54.2zM731.5 406.4l-184.3 94.2v218.1c0 19.6-15.8 35.5-35.2 35.5-19.4 0-35.2-15.9-35.2-35.5V500.6l-184.3-94.2c-17.4-9-24.3-30.2-15.4-47.7 8.9-17.5 30-24.5 47.4-15.5L512 439.4l187.9-95.8c17.4-9 38.5-1.6 47.4 15.5 9 17.1 1.7 38.7-15.8 47.3z m0 0&#34; p-id=&#34;5353&#34; fill=&#34;currentColor&#34;/&#62;&#60;/path&#62;&#60;/svg&#62;"
145
+ />
146
+ </View>
147
+ }
148
+ _unsafe_MixedSetter_logo_select="SlotSetter"
149
+ className="min-h-screen"
150
+ />
151
+ </ProConfigProvider>
152
+ </Page>
153
+ );
154
+ }
155
+ }
156
+
157
+ export default Document;