@appthen/cli 1.2.11 → 1.2.13
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/bin/main.js +47 -0
- package/dist/index.js +6185 -15001
- package/package.json +8 -4
- package/tests/test-app/.appthen/shadow-space-100001-test-app-e99876b1.json +1197 -741
- package/tests/test-app/.appthen/space-config.json +2 -2
- package/tests/test-app/src/components/MessageCenter.tsx +506 -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/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/TicketManagement.tsx +402 -0
- package/tests/test-app/src/pages/UserProfile.tsx +404 -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/article-list.tsx +222 -0
- package/tests/test-app/src/pages/babyProductRecommendationPage.tsx +168 -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/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/demo-error-page.tsx +119 -0
- package/tests/test-app/src/pages/department-list.tsx +183 -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/uiHandsOnPractice.tsx +1 -1
- 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/ui/styleSelectorPage.tsx +1554 -0
- package/tests/test-app/src/pages/user-list.tsx +212 -0
- package/tests/test-app/src/pages/wrong-page.tsx +50 -0
- package/tests/test-app/.appthen/shadow-space-unknown-user-test-app-e99876b1.json +0 -1060
|
@@ -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;
|