@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,422 @@
1
+ /**
2
+ * 系统设置
3
+ * 系统参数配置和管理
4
+ *
5
+ * @type Page
6
+ * @route /settings
7
+ * @screen 1920w
8
+ * @frames web
9
+ */
10
+ import React from 'react';
11
+
12
+
13
+
14
+ class IProps {
15
+ systemId?: number;
16
+ }
17
+
18
+ /*
19
+ * 数据与接口请求定义
20
+ */
21
+ class IState {
22
+ settings?: {
23
+ /* @example 1 */id?: number,
24
+ /* @example system.name */key?: string,
25
+ /* @example 我的系统 */value?: string,
26
+ /* @example 系统名称 */description?: string,
27
+ /* @example 基础设置 */category?: string,
28
+ /* @example string */type?: string,
29
+ /* @example 1 */level?: number,
30
+ }[];
31
+ loading?: boolean;
32
+ searchKeyword?: string;
33
+ selectedCategory?: string;
34
+ showEditModal?: boolean;
35
+ formData?: {
36
+ key?: string,
37
+ value?: string,
38
+ description?: string,
39
+ };
40
+ selectedSetting?: any;
41
+ }
42
+
43
+ class Document extends React.Component<IProps, IState> {
44
+ state = {
45
+ settings: [
46
+ {
47
+ id: 1,
48
+ key: 'system.name',
49
+ value: '我的系统',
50
+ description: '系统名称',
51
+ category: '基础设置',
52
+ type: 'string',
53
+ level: 1,
54
+ },
55
+ {
56
+ id: 2,
57
+ key: 'system.timezone',
58
+ value: 'Asia/Shanghai',
59
+ description: '系统时区',
60
+ category: '基础设置',
61
+ type: 'select',
62
+ level: 1,
63
+ },
64
+ {
65
+ id: 3,
66
+ key: 'system.language',
67
+ value: 'zh-CN',
68
+ description: '系统语言',
69
+ category: '基础设置',
70
+ type: 'select',
71
+ level: 1,
72
+ },
73
+ {
74
+ id: 4,
75
+ key: 'security.session.timeout',
76
+ value: 3600,
77
+ description: '会话超时时间(秒)',
78
+ category: '安全设置',
79
+ type: 'number',
80
+ level: 2,
81
+ },
82
+ {
83
+ id: 5,
84
+ key: 'security.login.attempts',
85
+ value: 5,
86
+ description: '最大登录尝试次数',
87
+ category: '安全设置',
88
+ type: 'number',
89
+ level: 2,
90
+ },
91
+ {
92
+ id: 6,
93
+ key: 'security.ip.whitelist',
94
+ value: '',
95
+ description: 'IP 白名单(逗号分隔)',
96
+ category: '安全设置',
97
+ type: 'string',
98
+ level: 2,
99
+ },
100
+ {
101
+ id: 7,
102
+ key: 'notification.email.enabled',
103
+ value: true,
104
+ description: '启用邮件通知',
105
+ category: '通知设置',
106
+ type: 'boolean',
107
+ level: 3,
108
+ },
109
+ {
110
+ id: 8,
111
+ key: 'notification.sms.enabled',
112
+ value: false,
113
+ description: '启用短信通知',
114
+ category: '通知设置',
115
+ type: 'boolean',
116
+ level: 3,
117
+ },
118
+ {
119
+ id: 9,
120
+ key: 'log.level',
121
+ value: 'info',
122
+ description: '日志级别',
123
+ category: '日志设置',
124
+ type: 'select',
125
+ level: 4,
126
+ },
127
+ {
128
+ id: 10,
129
+ key: 'log.retention.days',
130
+ value: 30,
131
+ description: '日志保留天数',
132
+ category: '日志设置',
133
+ type: 'number',
134
+ level: 4,
135
+ },
136
+ ],
137
+ loading: false,
138
+ searchKeyword: '',
139
+ selectedCategory: 'all',
140
+ showEditModal: false,
141
+ formData: { key: '', value: '', description: '' },
142
+ selectedSetting: null,
143
+ };
144
+
145
+ handleSearch(keyword) {
146
+ this.setState({
147
+ searchKeyword: keyword,
148
+ });
149
+ }
150
+
151
+ getSettingByKey(key) {
152
+ return this.state.settings.find(setting => setting.key === key);
153
+ }
154
+
155
+ getCategorySettings(category) {
156
+ if (category === 'all') {
157
+ return this.state.settings;
158
+ }
159
+ return this.state.settings.filter(setting => setting.category === category);
160
+ }
161
+
162
+ renderValue(setting) {
163
+ const value = setting.value;
164
+ const type = setting.type;
165
+ if (type === 'boolean') {
166
+ return <Switch checked={value} />;
167
+ } else if (type === 'select') {
168
+ return <Text>{value}</Text>;
169
+ } else {
170
+ return <Text>{String(value)}</Text>;
171
+ }
172
+ }
173
+
174
+ handleEdit(setting) {
175
+ this.setState({
176
+ selectedSetting: setting,
177
+ formData: {
178
+ ...setting,
179
+ },
180
+ showEditModal: true,
181
+ });
182
+ }
183
+
184
+ handleDelete(setting) {
185
+ this.setState({
186
+ settings: this.state.settings.filter(s => s.id !== setting.id),
187
+ });
188
+ }
189
+
190
+ handleSave(key, value) {
191
+ console.log('保存设置:', key, value);
192
+ this.setState({
193
+ settings: this.state.settings.map(s => {
194
+ if (s.key === key) {
195
+ return {
196
+ ...s,
197
+ value,
198
+ };
199
+ }
200
+ return s;
201
+ }),
202
+ showEditModal: false,
203
+ });
204
+ }
205
+
206
+ exportSettings(format) {
207
+ console.log('导出设置:', format, this.state.settings);
208
+ }
209
+
210
+ render() {
211
+ const settings = this.state.settings;
212
+ const loading = this.state.loading;
213
+ const searchKeyword = this.state.searchKeyword;
214
+ const selectedCategory = this.state.selectedCategory;
215
+ const showEditModal = this.state.showEditModal;
216
+ const formData = this.state.formData;
217
+ const selectedSetting = this.state.selectedSetting;
218
+ const categories = ['all', '基础设置', '安全设置', '通知设置', '日志设置'];
219
+ const filteredSettings = this.getCategorySettings(selectedCategory).filter(
220
+ setting => {
221
+ return (
222
+ setting.key.includes(searchKeyword) ||
223
+ setting.description.includes(searchKeyword)
224
+ );
225
+ }
226
+ );
227
+ if (loading) {
228
+ return <View className="p-6">加载中...</View>;
229
+ }
230
+ const categoryTab = category => (
231
+ <Tabs.TabPane tab={category} key={category}>
232
+ {category}
233
+ </Tabs.TabPane>
234
+ );
235
+ return (
236
+ <Page className="p-[24px] bg-[var(--gray-50)] min-h-screen">
237
+ <View className="mb-[24px]">
238
+ <Text className="text-2xl font-bold text-[#1f2937]">系统设置</Text>
239
+ <Text className="text-[#6b7280] text-sm mt-[4px]">
240
+ 系统参数配置和管理
241
+ </Text>
242
+ </View>
243
+ <View className="mb-[24px]">
244
+ <Alert
245
+ message="系统设置会影响整个系统的运行"
246
+ description="修改设置后请谨慎操作,建议在非高峰时段进行调整"
247
+ type="info"
248
+ showIcon={true}
249
+ />
250
+ </View>
251
+ <View className="mb-[24px] flex items-center justify-between">
252
+ <View className="gap-4 flex items-center">
253
+ <Input
254
+ placeholder="搜索设置项"
255
+ value={searchKeyword}
256
+ onChange={e => this.handleSearch(e.target.value)}
257
+ className=""
258
+ />
259
+ <Select
260
+ value={selectedCategory}
261
+ onChange={value =>
262
+ this.setState({
263
+ selectedCategory: value,
264
+ })
265
+ }
266
+ className=""
267
+ >
268
+ {categories.map((category, index) => (
269
+ <Select.Option key={category} value={category}>
270
+ <Text>{category}</Text>
271
+ </Select.Option>
272
+ ))}
273
+ </Select>
274
+ </View>
275
+ <Button
276
+ type="primary"
277
+ onClick={() =>
278
+ this.setState({
279
+ showEditModal: true,
280
+ })
281
+ }
282
+ >
283
+ 添加设置
284
+ </Button>
285
+ </View>
286
+ <Card className="mb-[24px]">
287
+ <Tabs
288
+ activeKey={selectedCategory}
289
+ onChange={key =>
290
+ this.setState({
291
+ selectedCategory: key,
292
+ })
293
+ }
294
+ >
295
+ {categories.map((category, index) => (
296
+ <Text>{categoryTab(category)}</Text>
297
+ ))}
298
+ </Tabs>
299
+ </Card>
300
+ <Card>
301
+ <View>设置列表</View>
302
+ </Card>
303
+ <Modal
304
+ animate="pop"
305
+ visible={showEditModal}
306
+ renderView={() => (
307
+ <View className="bg-[#ffffff] w-[600px] h-[500px] p-[24px]">
308
+ <Text className="text-xl font-bold mb-[16px]">添加系统设置</Text>
309
+ <View className="space-y-4">
310
+ <View>
311
+ <Text className="block mb-[8px]">设置项</Text>
312
+ <Input
313
+ value={formData?.key}
314
+ onChange={e =>
315
+ this.setState({
316
+ formData: {
317
+ ...formData,
318
+ key: e.target.value,
319
+ },
320
+ })
321
+ }
322
+ placeholder="请输入设置项键"
323
+ />
324
+ </View>
325
+ <View>
326
+ <Text className="block mb-[8px]">描述</Text>
327
+ <Input
328
+ value={formData?.description}
329
+ onChange={e =>
330
+ this.setState({
331
+ formData: {
332
+ ...formData,
333
+ description: e.target.value,
334
+ },
335
+ })
336
+ }
337
+ placeholder="请输入描述"
338
+ />
339
+ </View>
340
+ <View>
341
+ <Text className="block mb-[8px]">值</Text>
342
+ <Input
343
+ value={formData?.value}
344
+ onChange={e =>
345
+ this.setState({
346
+ formData: {
347
+ ...formData,
348
+ value: e.target.value,
349
+ },
350
+ })
351
+ }
352
+ placeholder="请输入值"
353
+ />
354
+ </View>
355
+ <View>
356
+ <Text className="block mb-[8px]">类别</Text>
357
+ <Select
358
+ value={formData?.category}
359
+ onChange={value =>
360
+ this.setState({
361
+ formData: {
362
+ ...formData,
363
+ category: value,
364
+ },
365
+ })
366
+ }
367
+ placeholder="请选择类别"
368
+ className="w-full"
369
+ >
370
+ <Select.Option value="基础设置">基础设置</Select.Option>
371
+ <Select.Option value="安全设置">安全设置</Select.Option>
372
+ <Select.Option value="通知设置">通知设置</Select.Option>
373
+ <Select.Option value="日志设置">日志设置</Select.Option>
374
+ </Select>
375
+ </View>
376
+ <View>
377
+ <Text className="block mb-[8px]">级别</Text>
378
+ <InputNumber
379
+ value={formData?.level}
380
+ onChange={value =>
381
+ this.setState({
382
+ formData: {
383
+ ...formData,
384
+ level: value,
385
+ },
386
+ })
387
+ }
388
+ placeholder="请输入级别"
389
+ min={1}
390
+ max={5}
391
+ />
392
+ </View>
393
+ <View className="gap-2 flex justify-end mt-[24px]">
394
+ <Button
395
+ onClick={() =>
396
+ this.setState({
397
+ showEditModal: false,
398
+ })
399
+ }
400
+ >
401
+ 取消
402
+ </Button>
403
+ <Button
404
+ type="primary"
405
+ onClick={() =>
406
+ this.handleSave(formData?.key || '', formData?.value)
407
+ }
408
+ >
409
+ 确认
410
+ </Button>
411
+ </View>
412
+ </View>
413
+ </View>
414
+ )}
415
+ maskClosable={true}
416
+ />
417
+ </Page>
418
+ );
419
+ }
420
+ }
421
+
422
+ export default Document;