finstep-template-cli 1.0.1
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/README.md +41 -0
- package/cli.js +117 -0
- package/package.json +39 -0
- package/template/.env.development +3 -0
- package/template/.env.production +3 -0
- package/template/.env.staging +3 -0
- package/template/.env.test +3 -0
- package/template/.eslintrc.cjs +21 -0
- package/template/README.md +69 -0
- package/template/auto-imports.d.ts +47 -0
- package/template/eslint.config.js +26 -0
- package/template/index.html +16 -0
- package/template/package.json +46 -0
- package/template/postcss.config.js +5 -0
- package/template/public/logo.svg +85 -0
- package/template/public/vite.svg +1 -0
- package/template/src/App.css +42 -0
- package/template/src/App.tsx +25 -0
- package/template/src/api/home/index.ts +56 -0
- package/template/src/api/home/typings.d.ts +8 -0
- package/template/src/assets/logo.svg +85 -0
- package/template/src/assets/react.svg +1 -0
- package/template/src/components/admin-layout.tsx +211 -0
- package/template/src/components/f-b-footer.tsx +46 -0
- package/template/src/components/f-b-header.tsx +894 -0
- package/template/src/components/global-loading.tsx +143 -0
- package/template/src/components/hero-section.tsx +371 -0
- package/template/src/components/products-preview.tsx +175 -0
- package/template/src/components/stats-section.tsx +85 -0
- package/template/src/components/trusted-by.tsx +53 -0
- package/template/src/hooks/useGlobalLoading.ts +57 -0
- package/template/src/index.css +341 -0
- package/template/src/main.tsx +30 -0
- package/template/src/pages/admin/index.tsx +361 -0
- package/template/src/pages/admin/pages/applications/index.tsx +558 -0
- package/template/src/pages/home/index.tsx +129 -0
- package/template/src/router/index.tsx +9 -0
- package/template/src/router/routes.tsx +30 -0
- package/template/src/stores/loading.store.ts +46 -0
- package/template/src/stores/root.store.ts +22 -0
- package/template/src/stores/store-context.tsx +43 -0
- package/template/src/stores/user.store.ts +46 -0
- package/template/src/utils/index.ts +14 -0
- package/template/src/utils/request.ts +116 -0
- package/template/src/utils/tokenManager.ts +168 -0
- package/template/src/vite-env.d.ts +1 -0
- package/template/tailwind.config.js +19 -0
- package/template/tsconfig.app.json +29 -0
- package/template/tsconfig.json +7 -0
- package/template/tsconfig.node.json +26 -0
- package/template/vite.config.ts +36 -0
@@ -0,0 +1,361 @@
|
|
1
|
+
// AI生成的代码 - 管理后台主页组件
|
2
|
+
import { Card, Row, Col, Statistic, Progress, Table, Tag, Button } from "antd";
|
3
|
+
import { motion, type Variants } from "framer-motion";
|
4
|
+
import AdminLayout from "@/components/admin-layout";
|
5
|
+
import type { ColumnsType } from "antd/es/table";
|
6
|
+
|
7
|
+
interface DashboardCard {
|
8
|
+
title: string;
|
9
|
+
description: string;
|
10
|
+
icon: string;
|
11
|
+
link: string;
|
12
|
+
gradient: string;
|
13
|
+
stats: {
|
14
|
+
total: number;
|
15
|
+
pending: number;
|
16
|
+
completed: number;
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
interface RecentActivity {
|
21
|
+
key: string;
|
22
|
+
user: string;
|
23
|
+
action: string;
|
24
|
+
target: string;
|
25
|
+
time: string;
|
26
|
+
status: "success" | "warning" | "error";
|
27
|
+
}
|
28
|
+
|
29
|
+
const dashboardCards: DashboardCard[] = [
|
30
|
+
{
|
31
|
+
title: "客户申请",
|
32
|
+
description: "管理客户试用申请和审核流程",
|
33
|
+
icon: "ri-file-list-line",
|
34
|
+
link: "/admin/applications",
|
35
|
+
gradient: "from-blue-500 to-cyan-500",
|
36
|
+
stats: {
|
37
|
+
total: 156,
|
38
|
+
pending: 23,
|
39
|
+
completed: 133,
|
40
|
+
},
|
41
|
+
},
|
42
|
+
{
|
43
|
+
title: "用户管理",
|
44
|
+
description: "管理系统用户和权限配置",
|
45
|
+
icon: "ri-user-line",
|
46
|
+
link: "/admin/users",
|
47
|
+
gradient: "from-purple-500 to-pink-500",
|
48
|
+
stats: {
|
49
|
+
total: 1248,
|
50
|
+
pending: 12,
|
51
|
+
completed: 1236,
|
52
|
+
},
|
53
|
+
},
|
54
|
+
{
|
55
|
+
title: "产品配置",
|
56
|
+
description: "配置AI产品参数和功能设置",
|
57
|
+
icon: "ri-settings-line",
|
58
|
+
link: "/admin/products",
|
59
|
+
gradient: "from-green-500 to-teal-500",
|
60
|
+
stats: {
|
61
|
+
total: 8,
|
62
|
+
pending: 2,
|
63
|
+
completed: 6,
|
64
|
+
},
|
65
|
+
},
|
66
|
+
{
|
67
|
+
title: "使用统计",
|
68
|
+
description: "查看系统使用情况和性能数据",
|
69
|
+
icon: "ri-bar-chart-line",
|
70
|
+
link: "/admin/analytics",
|
71
|
+
gradient: "from-orange-500 to-red-500",
|
72
|
+
stats: {
|
73
|
+
total: 99.8,
|
74
|
+
pending: 0.2,
|
75
|
+
completed: 99.6,
|
76
|
+
},
|
77
|
+
},
|
78
|
+
];
|
79
|
+
|
80
|
+
const recentActivities: RecentActivity[] = [
|
81
|
+
{
|
82
|
+
key: "1",
|
83
|
+
user: "张三",
|
84
|
+
action: "申请试用",
|
85
|
+
target: "智能风控系统",
|
86
|
+
time: "2分钟前",
|
87
|
+
status: "warning",
|
88
|
+
},
|
89
|
+
{
|
90
|
+
key: "2",
|
91
|
+
user: "李四",
|
92
|
+
action: "完成审核",
|
93
|
+
target: "量化交易平台",
|
94
|
+
time: "5分钟前",
|
95
|
+
status: "success",
|
96
|
+
},
|
97
|
+
{
|
98
|
+
key: "3",
|
99
|
+
user: "王五",
|
100
|
+
action: "登录系统",
|
101
|
+
target: "管理后台",
|
102
|
+
time: "10分钟前",
|
103
|
+
status: "success",
|
104
|
+
},
|
105
|
+
{
|
106
|
+
key: "4",
|
107
|
+
user: "赵六",
|
108
|
+
action: "配置失败",
|
109
|
+
target: "数据分析模块",
|
110
|
+
time: "15分钟前",
|
111
|
+
status: "error",
|
112
|
+
},
|
113
|
+
{
|
114
|
+
key: "5",
|
115
|
+
user: "钱七",
|
116
|
+
action: "更新配置",
|
117
|
+
target: "智能投顾系统",
|
118
|
+
time: "20分钟前",
|
119
|
+
status: "success",
|
120
|
+
},
|
121
|
+
];
|
122
|
+
|
123
|
+
const activityColumns: ColumnsType<RecentActivity> = [
|
124
|
+
{
|
125
|
+
title: "用户",
|
126
|
+
dataIndex: "user",
|
127
|
+
key: "user",
|
128
|
+
render: (text) => (
|
129
|
+
<div className="flex items-center space-x-2">
|
130
|
+
<div className="w-8 h-8 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full flex items-center justify-center">
|
131
|
+
<span className="text-white text-xs font-medium">{text[0]}</span>
|
132
|
+
</div>
|
133
|
+
<span className="text-white">{text}</span>
|
134
|
+
</div>
|
135
|
+
),
|
136
|
+
},
|
137
|
+
{
|
138
|
+
title: "操作",
|
139
|
+
dataIndex: "action",
|
140
|
+
key: "action",
|
141
|
+
render: (text) => <span className="text-slate-300">{text}</span>,
|
142
|
+
},
|
143
|
+
{
|
144
|
+
title: "目标",
|
145
|
+
dataIndex: "target",
|
146
|
+
key: "target",
|
147
|
+
render: (text) => <span className="text-blue-400">{text}</span>,
|
148
|
+
},
|
149
|
+
{
|
150
|
+
title: "时间",
|
151
|
+
dataIndex: "time",
|
152
|
+
key: "time",
|
153
|
+
render: (text) => <span className="text-slate-400">{text}</span>,
|
154
|
+
},
|
155
|
+
{
|
156
|
+
title: "状态",
|
157
|
+
dataIndex: "status",
|
158
|
+
key: "status",
|
159
|
+
render: (status) => {
|
160
|
+
const statusConfig: Record<string, { color: string; text: string }> = {
|
161
|
+
success: { color: "green", text: "成功" },
|
162
|
+
warning: { color: "orange", text: "待处理" },
|
163
|
+
error: { color: "red", text: "失败" },
|
164
|
+
};
|
165
|
+
const config = statusConfig[status];
|
166
|
+
return <Tag color={config.color}>{config.text}</Tag>;
|
167
|
+
},
|
168
|
+
},
|
169
|
+
];
|
170
|
+
|
171
|
+
export default function Admin() {
|
172
|
+
const containerVariants: Variants = {
|
173
|
+
hidden: { opacity: 0 },
|
174
|
+
visible: {
|
175
|
+
opacity: 1,
|
176
|
+
transition: {
|
177
|
+
staggerChildren: 0.05,
|
178
|
+
delayChildren: 0.05,
|
179
|
+
},
|
180
|
+
},
|
181
|
+
};
|
182
|
+
|
183
|
+
const itemVariants: Variants = {
|
184
|
+
hidden: { opacity: 0, y: 10 },
|
185
|
+
visible: {
|
186
|
+
opacity: 1,
|
187
|
+
y: 0,
|
188
|
+
transition: {
|
189
|
+
duration: 0.3,
|
190
|
+
ease: [0.25, 0.46, 0.45, 0.94],
|
191
|
+
},
|
192
|
+
},
|
193
|
+
};
|
194
|
+
|
195
|
+
return (
|
196
|
+
<AdminLayout>
|
197
|
+
<motion.div
|
198
|
+
variants={containerVariants}
|
199
|
+
initial="hidden"
|
200
|
+
animate="visible"
|
201
|
+
className="space-y-6"
|
202
|
+
>
|
203
|
+
{/* 页面标题 */}
|
204
|
+
<motion.div variants={itemVariants}>
|
205
|
+
<div className="mb-8">
|
206
|
+
<h1 className="text-3xl font-bold text-white mb-2">仪表盘</h1>
|
207
|
+
<p className="text-slate-400">
|
208
|
+
欢迎回来,这里是系统概览和快速操作入口
|
209
|
+
</p>
|
210
|
+
</div>
|
211
|
+
</motion.div>
|
212
|
+
|
213
|
+
{/* 统计卡片 */}
|
214
|
+
<motion.div variants={itemVariants}>
|
215
|
+
<Row gutter={[24, 24]} className="mb-8">
|
216
|
+
<Col xs={24} sm={12} lg={6}>
|
217
|
+
<Card className="bg-slate-900/50 border-slate-800 hover:bg-slate-800/50 transition-all duration-300">
|
218
|
+
<Statistic
|
219
|
+
title={<span className="text-slate-400">今日访问</span>}
|
220
|
+
value={2847}
|
221
|
+
prefix={<i className="ri-eye-line text-blue-500"></i>}
|
222
|
+
valueStyle={{ color: "#3b82f6" }}
|
223
|
+
/>
|
224
|
+
</Card>
|
225
|
+
</Col>
|
226
|
+
<Col xs={24} sm={12} lg={6}>
|
227
|
+
<Card className="bg-slate-900/50 border-slate-800 hover:bg-slate-800/50 transition-all duration-300">
|
228
|
+
<Statistic
|
229
|
+
title={<span className="text-slate-400">活跃用户</span>}
|
230
|
+
value={1248}
|
231
|
+
prefix={<i className="ri-user-line text-green-500"></i>}
|
232
|
+
valueStyle={{ color: "#10b981" }}
|
233
|
+
/>
|
234
|
+
</Card>
|
235
|
+
</Col>
|
236
|
+
<Col xs={24} sm={12} lg={6}>
|
237
|
+
<Card className="bg-slate-900/50 border-slate-800 hover:bg-slate-800/50 transition-all duration-300">
|
238
|
+
<Statistic
|
239
|
+
title={<span className="text-slate-400">待处理申请</span>}
|
240
|
+
value={23}
|
241
|
+
prefix={<i className="ri-file-list-line text-orange-500"></i>}
|
242
|
+
valueStyle={{ color: "#f59e0b" }}
|
243
|
+
/>
|
244
|
+
</Card>
|
245
|
+
</Col>
|
246
|
+
<Col xs={24} sm={12} lg={6}>
|
247
|
+
<Card className="bg-slate-900/50 border-slate-800 hover:bg-slate-800/50 transition-all duration-300">
|
248
|
+
<Statistic
|
249
|
+
title={<span className="text-slate-400">系统健康度</span>}
|
250
|
+
value={99.8}
|
251
|
+
suffix="%"
|
252
|
+
prefix={<i className="ri-heart-pulse-line text-red-500"></i>}
|
253
|
+
valueStyle={{ color: "#ef4444" }}
|
254
|
+
/>
|
255
|
+
</Card>
|
256
|
+
</Col>
|
257
|
+
</Row>
|
258
|
+
</motion.div>
|
259
|
+
|
260
|
+
{/* 功能模块卡片 */}
|
261
|
+
<motion.div variants={itemVariants}>
|
262
|
+
<Row gutter={[24, 24]} className="mb-8">
|
263
|
+
{dashboardCards.map((card) => (
|
264
|
+
<Col key={card.title} xs={24} lg={12}>
|
265
|
+
<motion.div
|
266
|
+
variants={itemVariants}
|
267
|
+
whileHover={{ scale: 1.02 }}
|
268
|
+
transition={{ duration: 0.2 }}
|
269
|
+
>
|
270
|
+
<Card
|
271
|
+
className="bg-slate-900/50 border-slate-800 hover:bg-slate-800/50 hover:border-slate-700 transition-all duration-300 h-full"
|
272
|
+
styles={{ body: { padding: "24px" } }}
|
273
|
+
>
|
274
|
+
<div className="flex items-start justify-between mb-4">
|
275
|
+
<div className="flex items-center space-x-4">
|
276
|
+
<div
|
277
|
+
className={`w-12 h-12 bg-gradient-to-r ${card.gradient} rounded-xl flex items-center justify-center`}
|
278
|
+
>
|
279
|
+
<i className={`${card.icon} text-white text-xl`}></i>
|
280
|
+
</div>
|
281
|
+
<div>
|
282
|
+
<h3 className="text-xl font-semibold text-white mb-1">
|
283
|
+
{card.title}
|
284
|
+
</h3>
|
285
|
+
<p className="text-slate-400 text-sm">
|
286
|
+
{card.description}
|
287
|
+
</p>
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
<Button
|
291
|
+
type="text"
|
292
|
+
className="text-blue-400 hover:text-blue-300"
|
293
|
+
icon={<i className="ri-arrow-right-line"></i>}
|
294
|
+
/>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div className="grid grid-cols-3 gap-4 mb-4">
|
298
|
+
<div className="text-center">
|
299
|
+
<div className="text-2xl font-bold text-white">
|
300
|
+
{card.stats.total}
|
301
|
+
</div>
|
302
|
+
<div className="text-xs text-slate-400">总计</div>
|
303
|
+
</div>
|
304
|
+
<div className="text-center">
|
305
|
+
<div className="text-2xl font-bold text-orange-400">
|
306
|
+
{card.stats.pending}
|
307
|
+
</div>
|
308
|
+
<div className="text-xs text-slate-400">待处理</div>
|
309
|
+
</div>
|
310
|
+
<div className="text-center">
|
311
|
+
<div className="text-2xl font-bold text-green-400">
|
312
|
+
{card.stats.completed}
|
313
|
+
</div>
|
314
|
+
<div className="text-xs text-slate-400">已完成</div>
|
315
|
+
</div>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
<Progress
|
319
|
+
percent={Math.round(
|
320
|
+
(card.stats.completed / card.stats.total) * 100
|
321
|
+
)}
|
322
|
+
strokeColor={{
|
323
|
+
"0%": card.gradient.split(" ")[1],
|
324
|
+
"100%": card.gradient.split(" ")[3],
|
325
|
+
}}
|
326
|
+
trailColor="#334155"
|
327
|
+
showInfo={false}
|
328
|
+
/>
|
329
|
+
</Card>
|
330
|
+
</motion.div>
|
331
|
+
</Col>
|
332
|
+
))}
|
333
|
+
</Row>
|
334
|
+
</motion.div>
|
335
|
+
|
336
|
+
{/* 最近活动 */}
|
337
|
+
<motion.div variants={itemVariants}>
|
338
|
+
<Card
|
339
|
+
title={
|
340
|
+
<span className="text-white text-lg font-semibold">最近活动</span>
|
341
|
+
}
|
342
|
+
className="bg-slate-900/50 border-slate-800"
|
343
|
+
extra={
|
344
|
+
<Button type="text" className="text-blue-400 hover:text-blue-300">
|
345
|
+
查看全部
|
346
|
+
</Button>
|
347
|
+
}
|
348
|
+
>
|
349
|
+
<Table
|
350
|
+
columns={activityColumns}
|
351
|
+
dataSource={recentActivities}
|
352
|
+
pagination={false}
|
353
|
+
className="bg-transparent"
|
354
|
+
rowClassName="bg-transparent hover:bg-slate-800/30"
|
355
|
+
/>
|
356
|
+
</Card>
|
357
|
+
</motion.div>
|
358
|
+
</motion.div>
|
359
|
+
</AdminLayout>
|
360
|
+
);
|
361
|
+
}
|